In the spirit of the PCx86 Debugger, the PDP11 Debugger can now distinguish between virtual and physical addresses; physical addresses are specified with a leading '%'; this necessitated special CPU memory interfaces that mirror the Bus memory interfaces, which perform mapVirtualToPhysical() as needed, with traps disabled.
This commit is contained in:
parent
686396d726
commit
2a1be67727
5 changed files with 520 additions and 422 deletions
|
|
@ -1201,7 +1201,7 @@ PDP11.opJSR = function(opCode)
|
|||
PDP11.opMARK = function(opCode)
|
||||
{
|
||||
var addr = (this.getPC() + ((opCode & 0x3F) << 1)) & 0xffff;
|
||||
var src = this.readWordFromVirtual(addr | 0x10000);
|
||||
var src = this.readWord(addr | this.addrDSpace);
|
||||
this.setPC(this.regsGen[5]);
|
||||
this.setSP(addr + 2);
|
||||
this.regsGen[5] = src;
|
||||
|
|
|
|||
|
|
@ -125,13 +125,17 @@ CPUStatePDP11.prototype.initProcessor = function()
|
|||
{
|
||||
this.decode = PDP11.op1170.bind(this);
|
||||
|
||||
/** @type {Array.<Trigger>} */
|
||||
this.aTriggers = []; // list of all triggers, active or not (TODO: DEBUG-only?)
|
||||
this.initRegs();
|
||||
|
||||
this.nDisableTraps = 0;
|
||||
|
||||
/** @type {Trigger|null} */
|
||||
this.triggerNext = null; // the head of the active triggers list, in priority order
|
||||
|
||||
this.initRegs();
|
||||
if (DEBUG) {
|
||||
/** @type {Array.<Trigger>} */
|
||||
this.aTriggers = []; // list of all triggers, active or not (just for debugging)
|
||||
}
|
||||
|
||||
this.flags.complete = this.flags.debugCheck = false;
|
||||
};
|
||||
|
|
@ -144,9 +148,9 @@ CPUStatePDP11.prototype.initProcessor = function()
|
|||
CPUStatePDP11.prototype.reset = function()
|
||||
{
|
||||
if (this.flags.running) this.stopCPU();
|
||||
this.resetRegs();
|
||||
this.initRegs();
|
||||
this.resetCycles();
|
||||
this.clearError(); // clear any fatal error/exception that setError() may have flagged
|
||||
this.clearError(); // clear any fatal error/exception that setError() may have flagged
|
||||
this.parent.reset.call(this);
|
||||
};
|
||||
|
||||
|
|
@ -200,7 +204,7 @@ CPUStatePDP11.prototype.initRegs = function()
|
|||
this.regMB = 0;
|
||||
|
||||
/*
|
||||
* opFlags contains various conditions that stepCPU() needs to be aware of
|
||||
* opFlags contains various conditions that stepCPU() needs to be aware of.
|
||||
*/
|
||||
this.opFlags = 0;
|
||||
|
||||
|
|
@ -213,9 +217,7 @@ CPUStatePDP11.prototype.initRegs = function()
|
|||
this.srcMode = this.srcReg = 0;
|
||||
this.dstMode = this.dstReg = this.dstAddr = 0;
|
||||
|
||||
this.cpuType = 70;
|
||||
this.trapPSW = -1;
|
||||
this.loopRate = 9999; // instructions we can execute in 12ms
|
||||
this.resetRegs();
|
||||
};
|
||||
|
||||
|
|
@ -250,9 +252,8 @@ CPUStatePDP11.prototype.resetRegs = function()
|
|||
* Define handlers and DSPACE setting appropriate for the current MMU mode, in order to eliminate
|
||||
* unnecessary calls to mapVirtualToPhysical().
|
||||
*
|
||||
* TODO: We could further optimize readWordFromAddr(), splitting it into readWordFromDSpace() and
|
||||
* readWordFromISpace(), eliminating the need to OR the addrDSpace bit when we know that bit is zero,
|
||||
* but that seems like a pretty tiny optimization.
|
||||
* TODO: We could further optimize readWord(), splitting it into readWordFromDSpace() and readWordFromISpace(),
|
||||
* eliminating the need to OR the addrDSpace bit when we know that bit is zero, but that's a pretty tiny optimization.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
*/
|
||||
|
|
@ -260,15 +261,15 @@ CPUStatePDP11.prototype.setMemoryAccess = function()
|
|||
{
|
||||
if (this.mmuEnable) {
|
||||
this.addrDSpace = PDP11.ACCESS.DSPACE;
|
||||
this.getAddrByMode = this.getVirtualAddrByMode;
|
||||
this.readWordFromAddr = this.readWordFromVirtual;
|
||||
this.writeWordToAddr = this.writeWordToVirtual;
|
||||
this.getAddr = this.getVirtualAddrByMode;
|
||||
this.readWord = this.readWordFromVirtual;
|
||||
this.writeWord = this.writeWordToVirtual;
|
||||
this.bus.setIOPageRange((this.regMMR3 & PDP11.MMR3.MMU_22BIT)? 22 : 18);
|
||||
} else {
|
||||
this.addrDSpace = 0;
|
||||
this.getAddrByMode = this.getPhysicalAddrByMode;
|
||||
this.readWordFromAddr = this.readWordFromPhysical;
|
||||
this.writeWordToAddr = this.writeWordToPhysical;
|
||||
this.getAddr = this.getPhysicalAddrByMode;
|
||||
this.readWord = this.readWordFromPhysical;
|
||||
this.writeWord = this.writeWordToPhysical;
|
||||
this.bus.setIOPageRange(16);
|
||||
}
|
||||
};
|
||||
|
|
@ -335,9 +336,9 @@ CPUStatePDP11.prototype.getMMR1 = function()
|
|||
CPUStatePDP11.prototype.setMMR3 = function(newMMR3)
|
||||
{
|
||||
/*
|
||||
* Don't allow 11/45 to do 22 bit or use unibus map
|
||||
* Don't allow the 11/45 to use 22-bit addressing or the UNIBUS map
|
||||
*/
|
||||
if (this.cpuType !== 70) {
|
||||
if (this.model < PDP11.MODEL_1170) {
|
||||
newMMR3 &= ~(PDP11.MMR3.MMU_22BIT | PDP11.MMR3.UNIBUS_MAP);
|
||||
}
|
||||
if (this.regMMR3 != newMMR3) {
|
||||
|
|
@ -541,7 +542,7 @@ CPUStatePDP11.prototype.getPC = function()
|
|||
*/
|
||||
CPUStatePDP11.prototype.getPCWord = function()
|
||||
{
|
||||
var data = this.readWordFromAddr(this.regsGen[PDP11.REG.PC]);
|
||||
var data = this.readWord(this.regsGen[PDP11.REG.PC]);
|
||||
this.advancePC(2);
|
||||
return data;
|
||||
};
|
||||
|
|
@ -601,7 +602,7 @@ CPUStatePDP11.prototype.setSP = function(addr)
|
|||
CPUStatePDP11.prototype.addTrigger = function(vector, priority)
|
||||
{
|
||||
var trigger = {vector: vector, priority: priority, next: null};
|
||||
this.aTriggers.push(trigger);
|
||||
if (DEBUG) this.aTriggers.push(trigger);
|
||||
return trigger;
|
||||
};
|
||||
|
||||
|
|
@ -653,6 +654,7 @@ CPUStatePDP11.prototype.removeTrigger = function(trigger)
|
|||
triggerPrev = triggerNext;
|
||||
}
|
||||
}
|
||||
// We could also set trigger.next to null now, but strictly speaking, that shouldn't be necessary
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1051,6 +1053,14 @@ CPUStatePDP11.prototype.panic = function(reason)
|
|||
*/
|
||||
CPUStatePDP11.prototype.trap = function(vector, reason)
|
||||
{
|
||||
if (DEBUG && this.dbg) {
|
||||
if (this.messageEnabled(MessagesPDP11.TRAP)) {
|
||||
this.printMessage("trap to vector " + this.dbg.toStrBase(vector, 0, true) + (reason? " (" + this.dbg.toStrBase(reason) + ")" : ""), MessagesPDP11.TRAP, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.nDisableTraps) return;
|
||||
|
||||
var doubleTrap = false;
|
||||
|
||||
if (this.trapPSW < 0) {
|
||||
|
|
@ -1069,8 +1079,8 @@ CPUStatePDP11.prototype.trap = function(vector, reason)
|
|||
* Read from kernel D space
|
||||
*/
|
||||
this.mmuMode = 0;
|
||||
var newPC = this.readWordFromAddr(vector | this.addrDSpace);
|
||||
var newPSW = this.readWordFromAddr(((vector + 2) & 0xffff) | this.addrDSpace);
|
||||
var newPC = this.readWord(vector | this.addrDSpace);
|
||||
var newPSW = this.readWord(((vector + 2) & 0xffff) | this.addrDSpace);
|
||||
|
||||
/*
|
||||
* Set new PSW with previous mode
|
||||
|
|
@ -1089,12 +1099,6 @@ CPUStatePDP11.prototype.trap = function(vector, reason)
|
|||
this.opFlags &= ~PDP11.OPFLAG.TRAP_MASK; // lose interest in traps after an abort
|
||||
this.trapPSW = -1; // reset flag that we have a trap within a trap
|
||||
|
||||
if (DEBUG && this.dbg) {
|
||||
if (this.messageEnabled(MessagesPDP11.TRAP)) {
|
||||
this.printMessage("trap to vector " + this.dbg.toStrBase(vector, 0, true) + (reason? " (" + this.dbg.toStrBase(reason) + ")" : ""), MessagesPDP11.TRAP, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (reason != PDP11.REASON.INTERRUPT) throw vector;
|
||||
};
|
||||
|
||||
|
|
@ -1149,33 +1153,31 @@ CPUStatePDP11.prototype.mapUnibus = function(unibusAddress)
|
|||
/**
|
||||
* mapVirtualToPhysical(virtualAddress, accessFlags)
|
||||
*
|
||||
* 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 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
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
* As an aside it turns out that it is the memory management unit that does odd address
|
||||
* and non-existent memory trapping: who knew? :-) I thought these would have been
|
||||
* handled at access time.
|
||||
* As an aside it turns out that it is the memory management unit that does odd address and
|
||||
* non-existent memory trapping: who knew? :-) I thought these would have been handled at
|
||||
* access time.
|
||||
*
|
||||
* When doing mapping, mmuMode is used to decide what address space is to be
|
||||
* used. 0 = kernel, 1 = supervisor, 2 = illegal, 3 = user. Normally, mmuMode is
|
||||
* set by the setPSW() function but there are exceptions for instructions which
|
||||
* move data between address spaces (MFPD, MFPI, MTPD, and MTPI) and trap(). These will
|
||||
* modify mmuMode outside of setPSW() and then restore it again if all worked. If
|
||||
* however something happens to cause a trap then no restore is done as setPSW()
|
||||
* will have been invoked as part of the trap, which will resynchronize mmuMode
|
||||
* When doing mapping, mmuMode is used to decide what address space is to be used (0 = kernel,
|
||||
* 1 = supervisor, 2 = illegal, 3 = user). Normally, mmuMode is set by the setPSW() function,
|
||||
* but there are exceptions for instructions which move data between address spaces (MFPD, MFPI,
|
||||
* MTPD, and MTPI) and trap(). These will modify mmuMode outside of setPSW() and then restore
|
||||
* it again if all worked. If however something happens to cause a trap then no restore is
|
||||
* done as setPSW() will have been invoked as part of the trap, which will resynchronize mmuMode.
|
||||
*
|
||||
* A PDP 11/70 is different to other PDP 11's in that the highest 18 bit space (017000000
|
||||
* & above) maps directly to UNIBUS space - including low memory. This doesn't appear to
|
||||
* be particularly useful as it restricts maximum system memory - although it does appear
|
||||
* to allow software testing of the unibus map. This feature also appears to confuse some
|
||||
* OSes which test consecutive memory locations to find maximum memory - and on a full
|
||||
* memory system find themselves accessing low memory again at high addresses.
|
||||
* A PDP 11/70 is different to other PDP 11's in that the highest 18 bit space (017000000 & above)
|
||||
* maps directly to UNIBUS space - including low memory. This doesn't appear to be particularly
|
||||
* useful as it restricts maximum system memory - although it does appear to allow software
|
||||
* testing of the unibus map. This feature also appears to confuse some OSes which test consecutive
|
||||
* memory locations to find maximum memory - and on a full memory system find themselves accessing
|
||||
* low memory again at high addresses.
|
||||
*
|
||||
* 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 MMR0
|
||||
* nonr leng read trap unus unus ena mnt cmp -mode- i/d --page-- enable
|
||||
|
|
@ -1324,7 +1326,7 @@ CPUStatePDP11.prototype.writeByteToPhysical = function(physicalAddress, data)
|
|||
*/
|
||||
CPUStatePDP11.prototype.popWord = function()
|
||||
{
|
||||
var result = this.readWordFromAddr(this.regsGen[6] | this.addrDSpace);
|
||||
var result = this.readWord(this.regsGen[6] | this.addrDSpace);
|
||||
this.regsGen[6] = (this.regsGen[6] + 2) & 0xffff;
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1355,18 +1357,18 @@ CPUStatePDP11.prototype.pushWord = function(data)
|
|||
this.opFlags |= 4;
|
||||
}
|
||||
}
|
||||
this.writeWordToAddr(virtualAddress, data);
|
||||
this.writeWord(virtualAddress, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* getAddress(mode, reg, accessFlags)
|
||||
* getAddrByMode(mode, reg, accessFlags)
|
||||
*
|
||||
* getAddress() maps a six bit operand to a 17 bit I/D virtual address space.
|
||||
* getAddrByMode() maps a six bit operand to a 17 bit I/D virtual address space.
|
||||
*
|
||||
* Instruction operands are six bits in length - three bits for the mode and three
|
||||
* for the register. The 17th I/D bit in the resulting virtual address represents
|
||||
* whether the reference is to Instruction space or Data space - which depends on
|
||||
* combination of the mode and whether the register is the Program Counter (register 7).
|
||||
* combination of the mode and whether the register is the Program Counter (R7).
|
||||
*
|
||||
* The eight modes are:-
|
||||
* 0 R no valid virtual address
|
||||
|
|
@ -1388,7 +1390,7 @@ CPUStatePDP11.prototype.pushWord = function(data)
|
|||
* @param {number} accessFlags
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
||||
CPUStatePDP11.prototype.getAddrByMode = function(mode, reg, accessFlags)
|
||||
{
|
||||
var virtualAddress, stepSize;
|
||||
var addrDSpace = (accessFlags & PDP11.ACCESS.VIRT)? 0 : this.addrDSpace;
|
||||
|
|
@ -1401,7 +1403,7 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
|||
/*
|
||||
* Mode 0: Registers don't have a virtual address, so trap.
|
||||
*
|
||||
* NOTE: Most instruction code paths never call getAddress() when the mode is zero;
|
||||
* NOTE: Most instruction code paths never call getAddrByMode() when the mode is zero;
|
||||
* JMP and JSR instructions are exceptions, but that's OK, because those are documented to
|
||||
* "cause an 'illegal' instruction" condition", which presumably means a BUS_ERROR trap.
|
||||
*/
|
||||
|
|
@ -1449,8 +1451,7 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
|||
stepSize = 2;
|
||||
virtualAddress = this.regsGen[reg];
|
||||
if (reg !== 7) virtualAddress |= addrDSpace;
|
||||
virtualAddress = this.readWordFromAddr(virtualAddress);
|
||||
// if (reg === 7) LOG_ADDRESS(virtualAddress); // @#n not operational
|
||||
virtualAddress = this.readWord(virtualAddress);
|
||||
virtualAddress |= addrDSpace;
|
||||
this.nStepCycles -= (5 + 2);
|
||||
break;
|
||||
|
|
@ -1473,7 +1474,7 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
|||
stepSize = -2;
|
||||
virtualAddress = (this.regsGen[reg] - 2) & 0xffff;
|
||||
if (reg !== 7) virtualAddress |= addrDSpace;
|
||||
virtualAddress = this.readWordFromAddr(virtualAddress) | addrDSpace;
|
||||
virtualAddress = this.readWord(virtualAddress) | addrDSpace;
|
||||
this.nStepCycles -= (6 + 2);
|
||||
break;
|
||||
|
||||
|
|
@ -1492,7 +1493,7 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
|||
case 7:
|
||||
virtualAddress = this.getPCWord();
|
||||
virtualAddress = (virtualAddress + this.regsGen[reg]) & 0xffff;
|
||||
virtualAddress = this.readWordFromAddr(virtualAddress | this.addrDSpace) | addrDSpace;
|
||||
virtualAddress = this.readWord(virtualAddress | this.addrDSpace) | addrDSpace;
|
||||
this.nStepCycles -= (7 + 3);
|
||||
return virtualAddress;
|
||||
}
|
||||
|
|
@ -1516,10 +1517,94 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
|||
return virtualAddress;
|
||||
};
|
||||
|
||||
/**
|
||||
* getByteDirect(addr)
|
||||
*
|
||||
* This interface is expressly for the Debugger, to access virtual memory without faulting;
|
||||
* note that if the MMU is not enabled, this is effectively the same as using the Bus interface.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.getByteDirect = function(addr)
|
||||
{
|
||||
if (!this.mmuEnable) {
|
||||
return this.bus.getByteDirect(addr);
|
||||
}
|
||||
this.nDisableTraps++;
|
||||
var b = this.readByteFromPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.READ_BYTE));
|
||||
this.nDisableTraps--;
|
||||
return b;
|
||||
};
|
||||
|
||||
/**
|
||||
* getWordDirect(addr)
|
||||
*
|
||||
* This interface is expressly for the Debugger, to access virtual memory without faulting;
|
||||
* note that if the MMU is not enabled, this is effectively the same as using the Bus interface.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.getWordDirect = function(addr)
|
||||
{
|
||||
if (!this.mmuEnable) {
|
||||
return this.bus.getWordDirect(addr);
|
||||
}
|
||||
this.nDisableTraps++;
|
||||
var w = this.readWordFromPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.READ_WORD));
|
||||
this.nDisableTraps--;
|
||||
return w;
|
||||
};
|
||||
|
||||
/**
|
||||
* setByteDirect(addr, data)
|
||||
*
|
||||
* This interface is expressly for the Debugger, to access virtual memory without faulting;
|
||||
* note that if the MMU is not enabled, this is effectively the same as using the Bus interface.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @param {number} data
|
||||
*/
|
||||
CPUStatePDP11.prototype.setByteDirect = function(addr, data)
|
||||
{
|
||||
if (!this.mmuEnable) {
|
||||
this.bus.setByteDirect(addr, data);
|
||||
return;
|
||||
}
|
||||
this.nDisableTraps++;
|
||||
this.writeByteToPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.WRITE_BYTE), data);
|
||||
this.nDisableTraps--;
|
||||
};
|
||||
|
||||
/**
|
||||
* setWordDirect(addr, data)
|
||||
*
|
||||
* This interface is expressly for the Debugger, to access virtual memory without faulting;
|
||||
* note that if the MMU is not enabled, this is effectively the same as using the Bus interface.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} addr
|
||||
* @param {number} data
|
||||
*/
|
||||
CPUStatePDP11.prototype.setWordDirect = function(addr, data)
|
||||
{
|
||||
if (!this.mmuEnable) {
|
||||
this.bus.setWordDirect(addr, data);
|
||||
return;
|
||||
}
|
||||
this.nDisableTraps++;
|
||||
this.writeWordToPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.WRITE_WORD), data);
|
||||
this.nDisableTraps--;
|
||||
};
|
||||
|
||||
/**
|
||||
* getPhysicalAddrByMode(mode, reg, accessFlags)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through getAddrByMode().
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through getAddr().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} mode
|
||||
|
|
@ -1529,13 +1614,13 @@ CPUStatePDP11.prototype.getAddress = function(mode, reg, accessFlags)
|
|||
*/
|
||||
CPUStatePDP11.prototype.getPhysicalAddrByMode = function(mode, reg, accessFlags)
|
||||
{
|
||||
return this.getAddress(mode, reg, accessFlags);
|
||||
return this.getAddrByMode(mode, reg, accessFlags);
|
||||
};
|
||||
|
||||
/**
|
||||
* getVirtualAddrByMode(mode, reg, accessFlags)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through getAddrByMode().
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through getAddr().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} mode
|
||||
|
|
@ -1545,13 +1630,13 @@ CPUStatePDP11.prototype.getPhysicalAddrByMode = function(mode, reg, accessFlags)
|
|||
*/
|
||||
CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, accessFlags)
|
||||
{
|
||||
return this.mapVirtualToPhysical(this.getAddress(mode, reg, accessFlags), accessFlags);
|
||||
return this.mapVirtualToPhysical(this.getAddrByMode(mode, reg, accessFlags), accessFlags);
|
||||
};
|
||||
|
||||
/**
|
||||
* readWordFromPhysical(physicalAddress)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through readWordFromAddr().
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through readWord().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} physicalAddress
|
||||
|
|
@ -1565,7 +1650,7 @@ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress)
|
|||
/**
|
||||
* readWordFromVirtual(virtualAddress)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through readWordFromAddr().
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through readWord().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} virtualAddress (input address is 17 bit (I&D))
|
||||
|
|
@ -1579,7 +1664,7 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress)
|
|||
/**
|
||||
* writeWordToPhysical(physicalAddress, data)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through writeWordToAddr().
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through writeWord().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} physicalAddress
|
||||
|
|
@ -1593,7 +1678,7 @@ CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data)
|
|||
/**
|
||||
* writeWordToVirtual(virtualAddress, data)
|
||||
*
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through writeWordToAddr().
|
||||
* This is a handler set up by setMemoryAccess(). All calls should go through writeWord().
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} virtualAddress (input address is 17 bit (I&D))
|
||||
|
|
@ -1624,12 +1709,12 @@ CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags)
|
|||
src = this.regsAltStack[(this.regPSW >> 12) & 3];
|
||||
}
|
||||
} else {
|
||||
var addr = this.getAddress(mode, reg, PDP11.ACCESS.READ_WORD);
|
||||
var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD);
|
||||
if (!(accessFlags & PDP11.ACCESS.DSPACE)) {
|
||||
if ((this.regPSW & 0xf000) !== 0xf000) addr &= 0xffff;
|
||||
}
|
||||
this.mmuMode = (this.regPSW >> 12) & 3;
|
||||
src = this.readWordFromAddr(addr | (accessFlags & this.addrDSpace));
|
||||
src = this.readWord(addr | (accessFlags & this.addrDSpace));
|
||||
this.mmuMode = (this.regPSW >> 14) & 3;
|
||||
}
|
||||
return src;
|
||||
|
|
@ -1657,10 +1742,10 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat
|
|||
this.regsAltStack[(this.regPSW >> 12) & 3] = data;
|
||||
}
|
||||
} else {
|
||||
var addr = this.getAddress(mode, reg, PDP11.ACCESS.WRITE_WORD);
|
||||
var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_WORD);
|
||||
if (!(accessFlags & PDP11.ACCESS.DSPACE)) addr &= 0xffff;
|
||||
/*
|
||||
* TODO: Consider replacing the following code with writeWordToAddr(), by adding optional mmuMode
|
||||
* TODO: Consider replacing the following code with writeWord(), by adding optional mmuMode
|
||||
* parameters for each of the discrete mapVirtualToPhysical() and bus.setWord() operations, because
|
||||
* as it stands, this is the only remaining call to mapVirtualToPhysical() outside of our
|
||||
* setMemoryAccess() handlers.
|
||||
|
|
@ -1688,7 +1773,7 @@ CPUStatePDP11.prototype.readSrcByte = function(opCode)
|
|||
if (!mode) {
|
||||
result = this.regsGen[reg] & 0xff;
|
||||
} else {
|
||||
result = this.readByteFromPhysical(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_BYTE));
|
||||
result = this.readByteFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_BYTE));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1709,7 +1794,7 @@ CPUStatePDP11.prototype.readSrcWord = function(opCode)
|
|||
if (!mode) {
|
||||
result = this.regsGen[reg];
|
||||
} else {
|
||||
result = this.bus.getWord(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD));
|
||||
result = this.bus.getWord(this.getAddr(mode, reg, PDP11.ACCESS.READ_WORD));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1725,7 +1810,7 @@ CPUStatePDP11.prototype.readDstAddr = function(opCode)
|
|||
{
|
||||
var reg = this.dstReg = opCode & PDP11.OPREG.MASK;
|
||||
var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT;
|
||||
return this.getAddress(mode, reg, PDP11.ACCESS.VIRT);
|
||||
return this.getAddrByMode(mode, reg, PDP11.ACCESS.VIRT);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1743,7 +1828,7 @@ CPUStatePDP11.prototype.readDstByte = function(opCode)
|
|||
if (!mode) {
|
||||
result = this.regsGen[reg] & 0xff;
|
||||
} else {
|
||||
result = this.readByteFromPhysical(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_BYTE));
|
||||
result = this.readByteFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_BYTE));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1763,7 +1848,7 @@ CPUStatePDP11.prototype.readDstWord = function(opCode)
|
|||
if (!mode) {
|
||||
result = this.regsGen[reg];
|
||||
} else {
|
||||
result = this.bus.getWord(this.getAddrByMode(mode, reg, PDP11.ACCESS.READ_WORD));
|
||||
result = this.bus.getWord(this.getAddr(mode, reg, PDP11.ACCESS.READ_WORD));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1785,7 +1870,7 @@ CPUStatePDP11.prototype.updateDstByte = function(opCode, src, fnOp)
|
|||
if (!mode) {
|
||||
this.regsGen[reg] = (this.regsGen[reg] & 0xff00) | fnOp.call(this, src, this.regsGen[reg]);
|
||||
} else {
|
||||
var addr = this.dstAddr = this.getAddrByMode(mode, reg, PDP11.ACCESS.UPDATE_BYTE);
|
||||
var addr = this.dstAddr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_BYTE);
|
||||
this.writeByteToPhysical(addr, fnOp.call(this, src, this.readByteFromPhysical(addr)));
|
||||
}
|
||||
};
|
||||
|
|
@ -1807,7 +1892,7 @@ CPUStatePDP11.prototype.updateDstWord = function(opCode, src, fnOp)
|
|||
if (!mode) {
|
||||
this.regsGen[reg] = fnOp.call(this, src, this.regsGen[reg]);
|
||||
} else {
|
||||
var addr = this.getAddrByMode(mode, reg, PDP11.ACCESS.UPDATE_WORD);
|
||||
var addr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_WORD);
|
||||
this.bus.setWord(addr, fnOp.call(this, src, this.bus.getWord(addr)));
|
||||
}
|
||||
};
|
||||
|
|
@ -1836,7 +1921,7 @@ CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags)
|
|||
this.regsGen[reg] = (this.regsGen[reg] & ~0xff) | (data & 0xff);
|
||||
}
|
||||
} else {
|
||||
this.writeByteToPhysical(this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_BYTE), data);
|
||||
this.writeByteToPhysical(this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE), data);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
|
@ -1858,7 +1943,7 @@ CPUStatePDP11.prototype.writeDstWord = function(opCode, data)
|
|||
if (!mode) {
|
||||
this.regsGen[reg] = data & 0xffff;
|
||||
} else {
|
||||
this.bus.setWord(this.getAddrByMode(mode, reg, PDP11.ACCESS.WRITE_WORD), data);
|
||||
this.bus.setWord(this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD), data);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -52,12 +52,14 @@ if (DEBUGGER) {
|
|||
* DebuggerPDP11 Address Object
|
||||
*
|
||||
* addr address
|
||||
* fPhysical true if this is a physical address
|
||||
* fTemporary true if this is a temporary breakpoint address
|
||||
* sCmd set for breakpoint addresses if there's an associated command string
|
||||
* aCmds preprocessed commands (from sCmd)
|
||||
*
|
||||
* @typedef {{
|
||||
* addr:(number|undefined),
|
||||
* fPhysical:(boolean|undefined),
|
||||
* fTemporary:(boolean|undefined),
|
||||
* sCmd:(string|undefined),
|
||||
* aCmds:(Array.<string>|undefined)
|
||||
|
|
@ -587,7 +589,7 @@ if (DEBUGGER) {
|
|||
var b = 0xff;
|
||||
var addr = this.getAddr(dbgAddr, false, 1);
|
||||
if (addr !== PDP11.ADDR_INVALID) {
|
||||
b = this.bus.getByteDirect(addr);
|
||||
b = dbgAddr.fPhysical? this.bus.getByteDirect(addr) : this.cpu.getByteDirect(addr);
|
||||
if (inc) this.incAddr(dbgAddr, inc);
|
||||
}
|
||||
return b;
|
||||
|
|
@ -606,7 +608,7 @@ if (DEBUGGER) {
|
|||
var w = 0xffff;
|
||||
var addr = this.getAddr(dbgAddr, false, 2);
|
||||
if (addr !== PDP11.ADDR_INVALID) {
|
||||
w = this.bus.getWordDirect(addr);
|
||||
w = dbgAddr.fPhysical? this.bus.getWordDirect(addr) : this.cpu.getWordDirect(addr);
|
||||
if (inc) this.incAddr(dbgAddr, inc);
|
||||
}
|
||||
return w;
|
||||
|
|
@ -624,7 +626,11 @@ if (DEBUGGER) {
|
|||
{
|
||||
var addr = this.getAddr(dbgAddr, true, 1);
|
||||
if (addr !== PDP11.ADDR_INVALID) {
|
||||
this.bus.setByteDirect(addr, b);
|
||||
if (dbgAddr.fPhysical) {
|
||||
this.bus.setByteDirect(addr, b);
|
||||
} else {
|
||||
this.cpu.setByteDirect(addr, b);
|
||||
}
|
||||
if (inc) this.incAddr(dbgAddr, inc);
|
||||
this.cmp.updateStatus(true); // force a computer status update if, say, video memory was the target
|
||||
}
|
||||
|
|
@ -642,24 +648,29 @@ if (DEBUGGER) {
|
|||
{
|
||||
var addr = this.getAddr(dbgAddr, true, 2);
|
||||
if (addr !== PDP11.ADDR_INVALID) {
|
||||
this.bus.setWordDirect(addr, w);
|
||||
if (dbgAddr.fPhysical) {
|
||||
this.bus.setWordDirect(addr, w);
|
||||
} else {
|
||||
this.cpu.setWordDirect(addr, w);
|
||||
}
|
||||
if (inc) this.incAddr(dbgAddr, inc);
|
||||
this.cmp.updateStatus(true); // force a computer status update if, say, video memory was the target
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* newAddr(addr)
|
||||
* newAddr(addr, fPhysical)
|
||||
*
|
||||
* Returns a NEW DbgAddrPDP11 object, initialized with specified values and/or defaults.
|
||||
*
|
||||
* @this {DebuggerPDP11}
|
||||
* @param {number} [addr]
|
||||
* @param {boolean} [fPhysical]
|
||||
* @return {DbgAddrPDP11}
|
||||
*/
|
||||
DebuggerPDP11.prototype.newAddr = function(addr)
|
||||
DebuggerPDP11.prototype.newAddr = function(addr, fPhysical)
|
||||
{
|
||||
return {addr: addr, fTemporary: false};
|
||||
return {addr: addr, fPhysical: fPhysical, fTemporary: false};
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -729,14 +740,20 @@ if (DEBUGGER) {
|
|||
var dbgAddr;
|
||||
var dbgAddrNext = (fCode? this.dbgAddrNextCode : this.dbgAddrNextData);
|
||||
var addr = dbgAddrNext.addr;
|
||||
var fPhysical = false;
|
||||
if (sAddr !== undefined) {
|
||||
sAddr = this.parseReference(sAddr);
|
||||
var ch = sAddr.charAt(0);
|
||||
if (ch == '%') {
|
||||
fPhysical = true;
|
||||
sAddr = sAddr.substr(1);
|
||||
}
|
||||
dbgAddr = this.findSymbolAddr(sAddr);
|
||||
if (dbgAddr) return dbgAddr;
|
||||
addr = this.parseExpression(sAddr, fPrint);
|
||||
}
|
||||
if (addr != null) {
|
||||
dbgAddr = this.newAddr(addr);
|
||||
dbgAddr = this.newAddr(addr, fPhysical);
|
||||
}
|
||||
return dbgAddr;
|
||||
};
|
||||
|
|
@ -1228,15 +1245,16 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* startCPU(fUpdateFocus)
|
||||
* startCPU(fUpdateFocus, fQuiet)
|
||||
*
|
||||
* @this {DebuggerPDP11}
|
||||
* @param {boolean} [fUpdateFocus] is true to update focus
|
||||
* @param {boolean} [fQuiet]
|
||||
* @return {boolean} true if run request successful, false if not
|
||||
*/
|
||||
DebuggerPDP11.prototype.startCPU = function(fUpdateFocus)
|
||||
DebuggerPDP11.prototype.startCPU = function(fUpdateFocus, fQuiet)
|
||||
{
|
||||
if (!this.checkCPU()) return false;
|
||||
if (!this.checkCPU(fQuiet)) return false;
|
||||
this.cpu.startCPU(fUpdateFocus);
|
||||
return true;
|
||||
};
|
||||
|
|
@ -1336,23 +1354,20 @@ if (DEBUGGER) {
|
|||
};
|
||||
|
||||
/**
|
||||
* checkCPU()
|
||||
* checkCPU(fQuiet)
|
||||
*
|
||||
* Make sure the CPU is ready (finished initializing), powered, not already running, and not in an error state.
|
||||
*
|
||||
* @this {DebuggerPDP11}
|
||||
* @param {boolean} [fQuiet]
|
||||
* @return {boolean}
|
||||
*/
|
||||
DebuggerPDP11.prototype.checkCPU = function()
|
||||
DebuggerPDP11.prototype.checkCPU = function(fQuiet)
|
||||
{
|
||||
if (!this.cpu)
|
||||
return false;
|
||||
if (!this.cpu.isReady())
|
||||
return false;
|
||||
if (!this.cpu.isPowered())
|
||||
return false;
|
||||
if (this.cpu.isRunning())
|
||||
if (!this.cpu || !this.cpu.isReady() || !this.cpu.isPowered() || this.cpu.isRunning()) {
|
||||
if (!fQuiet) this.println("cpu busy or unavailable, command ignored");
|
||||
return false;
|
||||
}
|
||||
return !this.cpu.isError();
|
||||
};
|
||||
|
||||
|
|
@ -1581,7 +1596,7 @@ if (DEBUGGER) {
|
|||
*/
|
||||
if (nState >= 0 && this.aaOpcodeCounts.length) {
|
||||
this.cOpcodes++;
|
||||
var opCode = this.bus.getWordDirect(addr);
|
||||
var opCode = this.cpu.getWordDirect(addr);
|
||||
if (opCode != null) {
|
||||
var dbgAddr = this.aOpcodeHistory[this.iOpcodeHistory];
|
||||
this.setAddr(dbgAddr, cpu.getPC());
|
||||
|
|
@ -3279,9 +3294,7 @@ if (DEBUGGER) {
|
|||
this.parseAddrOptions(dbgAddr, sOptions);
|
||||
this.setTempBreakpoint(dbgAddr);
|
||||
}
|
||||
if (!this.startCPU(true)) {
|
||||
if (!fQuiet) this.println("cpu busy or unavailable, run command ignored");
|
||||
}
|
||||
this.startCPU(true, fQuiet);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -682,214 +682,215 @@
|
|||
as to their contents.
|
||||
*/
|
||||
var h;
|
||||
function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
function ba(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 ca(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 k(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 da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function ea(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function fa(){var a=ga();return-1!==a.indexOf("pcjs.org",a.length-8)}var la={"&":"&","<":"<",">":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function na(a,b){return(a+" ").slice(0,b)}
|
||||
function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function ea(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function fa(){var a=ka();return-1!==a.indexOf("pcjs.org",a.length-8)}var la={"&":"&","<":"<",">":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function na(a,b){return(a+" ").slice(0,b)}
|
||||
function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",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 qa(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,l;l=c(b,a[g]);0<l?d=g+1:(e=g,f=!l)}return f?d:~d}var ra=Date.now||function(){return+new Date};function ta(){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 ua(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 l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ga(){return"http://"+(window?window.location.host:"www.pcjs.org")}
|
||||
typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ka(){return"http://"+(window?window.location.host:"www.pcjs.org")}
|
||||
function n(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){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}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(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 Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function Fa(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 Ga={init:[],show:[],exit:[]},Ha=!1,Ia=!1,Ja=!0;function Ka(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function La(a){Ga.init.push(a)}
|
||||
function Ma(a){if(Ja)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){n(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Na(a){!Ja&&a?(Ja=!0,Ha&&Oa("init"),Ia&&Oa("show")):Ja=a}function Oa(a){Ga[a]&&Ma(Ga[a])}Ka("onload",function(){Ha=!0;Ma(Ga.init)});Ka("onpageshow",function(){Ia=!0;Ma(Ga.show)});Ka(Da("Opera")||Da("iOS")?"onunload":"onbeforeunload",function(){Ma(Ga.exit)});
|
||||
function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Lb=b.comment;this.mc=b;b=this.id.indexOf(".");0>b?this.Sa=this.id:(this.vb=this.id.substr(0,b),this.Sa=this.id.substr(b+1));this[a]=c;this.v={ready:!1,gb:!1,wb:!1,ga:!1,error:!1};this.pb=null;this.v.error=!1;this.I={};this.j=null;this.ia=d||0;t.push(this)}var Va=void 0,Wa={};
|
||||
function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ub=b.comment;this.pc=b;b=this.id.indexOf(".");0>b?this.Ua=this.id:(this.Db=this.id.substr(0,b),this.Ua=this.id.substr(b+1));this[a]=c;this.v={ready:!1,ib:!1,Eb:!1,ha:!1,error:!1};this.vb=null;this.v.error=!1;this.J={};this.i=null;this.ia=d||0;t.push(this)}var Va=void 0,Wa={};
|
||||
if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function $a(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 y(a,b){b||(b=r);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},t=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<t.length;b++){var d=t[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function db(a){if(void 0!==a){var b;for(b=0;b<t.length;b++)if(t[b].id===a)return t[b]}return null}function eb(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<t.length;d++)if(c)c==t[d]&&(c=null);else if(!(a!=t[d].type||b&&t[d].id.indexOf(b)))return t[d]}return null}function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){n(c.message+" ("+a+")")}return b}
|
||||
function fb(a,b){b=A(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 l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=z(f))&&g.binding&&a.pa(g.type,g.binding,f,g.value),m=l.length}}}}
|
||||
function fb(a,b){b=A(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 l=g.split(" "),m=0;m<l.length;m++)switch(g=l[m],g){case "pdp11-binding":(g=z(f))&&g.binding&&a.ra(g.type,g.binding,f,g.value),m=l.length}}}}
|
||||
function A(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}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},pa:function(a,b,c){switch(b){case "clear":return this.I[b]||(this.I[b]=c,c.onclick=function(a){return function(){a.I.print&&(a.I.print.value="")}}(this)),!0;case "print":return this.I[b]||(this.Oa=this.I[b]=c,c.value="",this.g=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.na=function(a){this.g(a,this.Sa)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.Sa+": "+a)},na:function(a,b,c){c=c||this.type;b||n((c?c+": ":"")+a)},ya:function(){return this.v.ga=!0},xa:function(a,b){b&&(this.v.ga=!1);return!0}};function B(a,b,c,d){a.j&&(!0===c||E(a,c|0))&&a.j.message(b,d)}function E(a,b){if(a.j){a===a.j?b|=0:b=b||a.ia;var c=a.j.ia&b;return!!b&&c===b||!!(c&a.j.ec)}return!1}
|
||||
function gb(a,b){if(a.v.wb)return a.v.gb=!1,a.v.wb=!1;if(a.v.error)return a.g(a.toString()+" error"),!1;a.v.gb=b;return a.v.gb}function hb(a,b){a.v.gb&&(b?a.v.wb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.v.gb}function G(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.pb;a.pb=null;b&&b()}}function ib(a,b){b&&(a.v.ready?b():a.pb=b);return a.v.ready}function jb(a){return a.v.error?(a.g(a.toString()+" error"),!0):!1}function kb(a,b){a.v.error=!0;a.na(b)}
|
||||
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ra:function(a,b,c){switch(b){case "clear":return this.J[b]||(this.J[b]=c,c.onclick=function(a){return function(){a.J.print&&(a.J.print.value="")}}(this)),!0;case "print":return this.J[b]||(this.Qa=this.J[b]=c,c.value="",this.g=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.na=function(a){this.g(a,this.Ua)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.Ua+": "+a)},na:function(a,b,c){c=c||this.type;b||n((c?c+": ":"")+a)},Aa:function(){return this.v.ha=!0},za:function(a,b){b&&(this.v.ha=!1);return!0}};function B(a,b,c,d){a.i&&(!0===c||E(a,c|0))&&a.i.message(b,d)}function E(a,b){if(a.i){a===a.i?b|=0:b=b||a.ia;var c=a.i.ia&b;return!!b&&c===b||!!(c&a.i.jc)}return!1}
|
||||
function gb(a,b){if(a.v.Eb)return a.v.ib=!1,a.v.Eb=!1;if(a.v.error)return a.g(a.toString()+" error"),!1;a.v.ib=b;return a.v.ib}function hb(a,b){a.v.ib&&(b?a.v.Eb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.v.ib}function G(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.vb;a.vb=null;b&&b()}}function ib(a,b){b&&(a.v.ready?b():a.vb=b);return a.v.ready}function jb(a){return a.v.error?(a.g(a.toString()+" error"),!0):!1}function kb(a,b){a.v.error=!0;a.na(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});
|
||||
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 lb="undefined"!==typeof ArrayBuffer,H={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function mb(a){r.call(this,"Panel",a,mb);this.f=0;this.v.Jb=!0}y(mb);h=mb.prototype;
|
||||
h.pa=function(a,b,c,d){if(this.B&&this.B.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.j&&this.j.pa(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.I[b]=c,this.f++,!0;default:return"rled"==a?(this.I[b]=c,this.f++,!0):this.parent.pa.call(this,a,b,c,d)}};h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d};h.ya=function(a,b){b||Ab();return!0};h.xa=function(){return!0};
|
||||
function Bb(a,b,c,d){if(a.I[b]){void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.b.fa());var e=a.j&&a.j.ha||8;c=!a.b.v.da||a.v.Jb?8==e?ca(c,d):k(c,d):"--------".substr(0,d||4);a.I[b].textContent!=c&&(a.I[b].textContent=c)}}function Cb(a,b,c,d){for(var e=0;e<d;e++){var f=a.I[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
h.aa=function(a){if(this.f&&(a||!this.b.v.da||this.v.Jb)){for(a=0;a<this.b.u.length;a++)Bb(this,"R"+a,this.b.u[a]);a=Db(this.b);Bb(this,"PS",a);Bb(this,"NF",a&8?1:0,1);Bb(this,"ZF",a&4?1:0,1);Bb(this,"VF",a&2?1:0,1);Bb(this,"CF",a&1?1:0,1);Cb(this,"D",this.b.u[0],16);Cb(this,"A",this.b.u[7],22)}};function Ab(){for(var a=!1,b=A(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=db(e.id);f||(a=!0,f=new mb(e));fb(f,d);a&&G(f)}}La(Ab);
|
||||
function Eb(a,b,c){r.call(this,"Bus",a,Eb,64);this.b=b;this.j=c;this.H=a.busWidth||16;this.B=0;this.M=[];this.G=null;this.J=Math.pow(2,this.H);this.i=this.J-1|0;this.Y=(this.H>>1)+2;10>this.Y&&(this.Y=10);15<this.Y&&(this.Y=15);this.ua=1<<this.Y;this.K=this.ua>>2;this.f=this.ua-1;this.F=this.J/this.ua|0;this.Ea=[];this.w=0;this.C=[];this.dc=[Fb,Gb,Hb,Ib];a=new I(this);Jb(a,this.j);this.W=Array(this.F);for(b=0;b<this.F;b++)this.W[b]=a;G(this)}y(Eb);
|
||||
function Fb(a,b){var c=-1,d=this.controller,e=d.Ea[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ea[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&E(this.j,64)&&B(this.j,e[4]+".readByte("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=Kb(d,b|4186112,-1,1);this.j&&E(this.j,64)&&B(this.j,"warning: unconverted read access to byte @"+J(this.j,b)+": "+J(this.j,c),!0,!0);return c}
|
||||
function Gb(a,b,c){var d=!1,e=this.controller,f=e.Ea[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ea[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&E(this.j,64)&&B(this.j,f[4]+".writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(Kb(e,c|4186112,b,1),this.j&&E(this.j,64)&&B(this.j,"warning: unconverted write access to byte @"+J(this.j,c)+": "+J(this.j,b),!0,!0))}
|
||||
function Hb(a,b){var c=-1,d=this.controller;(a=d.Ea[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&E(this.j,64)&&B(this.j,a[4]+".readWord("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=Kb(d,b|4186112,-1,0);this.j&&E(this.j,64)&&B(this.j,"warning: unconverted read access to word @"+J(this.j,b)+": "+J(this.j,c),!0,!0);return c}
|
||||
function Ib(a,b,c){var d=!1,e=this.controller;if(a=e.Ea[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.j&&E(this.j,64)&&B(this.j,a[4]+".writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(Kb(e,c|4186112,b,0),this.j&&E(this.j,64)&&B(this.j,"warning: unconverted write access to word @"+J(this.j,c)+": "+J(this.j,b),!0,!0))}
|
||||
function Lb(a,b){if(b!=a.B){var c;a.B&&(c=(1<<a.B)-8192,Mb(a,c,8192,a.M),a.B=0);b&&(a.B=b,c=(1<<b)-8192,a.M=Nb(a,c,8192),a.G?Mb(a,c,8192,a.G):(Ob(a,c,8192,Pb,a),a.G=Nb(a,c,8192)))}}h=Eb.prototype;h.reset=function(){for(var a=0;a<this.C.length;a++)this.C[a]();Lb(this,16)};function Kb(a,b,c,d){a.w||(a.j&&E(a.j,536870912)&&B(a.j,"warning: unrecognized I/O access("+J(a.j,b)+","+J(a.j,c)+","+d+")",!0,!0),a.b.$(4,b));return 0}h.ya=function(a,b){b||this.reset();return!0};
|
||||
function Ob(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.Y;0<g&&l<a.W.length;){var m=a.W[l],p=l*a.ua,q=a.ua-(f-p);q>g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.ob+=m.A-f,m.A=f,!0;if(f>=m.A+m.ob){q=m.size-(f-p);q>g&&(q=g);m.ob=f-m.A+q;f=p+a.ua;g-=q;l++;continue}}return Qb(1,f,g)}f=new I(a,f,q,a.ua,d,e);Jb(f,a.j,m);a.W[l++]=f;f=p+a.ua;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Rb[d]+" at "+k(b,8,!0)),!0):Qb(2,b,c)}
|
||||
function Nb(a,b,c){var d=[];for(b>>>=a.Y;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.ua;return d}function Mb(a,b,c,d){var e=0;for(b>>>=a.Y;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.ua}}h.Pa=function(a){return this.W[(a&this.i)>>>this.Y].tb(a&this.f,a)};h.ja=function(a){return this.W[(a&this.i)>>>this.Y].Vb(a&this.f,a)};function Sb(a,b){var c=b&a.f,d=(b&a.i)>>>a.Y;a.w++;b=a.W[d].zb(c,b);a.w--;return b}h.mb=function(a,b){this.W[(a&this.i)>>>this.Y].ub(a&this.f,b&255,a)};
|
||||
function Tb(a,b,c){a.w++;a.W[(b&a.i)>>>a.Y].Fb(b&a.f,c&255,b);a.w--}h.Ra=function(a,b){this.W[(a&this.i)>>>this.Y].bc(a&this.f,b&65535,a)};function Ub(a){for(var b=0,c=[],d=0;d<a.F;d++){var e=a.W[d];if(e.Fa||e.gc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,l=0,m=[];g<e.length;){for(var p=e[g],q=g+1;q<e.length&&e[q]===p;)q++;m[l++]=q-g;m[l++]=p;g=q}m.length<e.length&&(e=m)}c[f]=e}}return c}
|
||||
function Vb(a,b,c,d,e,f,g,l){for(;b<=c;b+=2){var m=b&8191;void 0!==a.Ea[m]?n("I/O address already registered: "+k(b,8,!0)):a.Ea[m]=[d,e,f,g,l||"unknown",!1]}}
|
||||
function Wb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.b.Tb)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));Vb(a,e,e,g,l,m,p,f[4])}}}function Xb(a,b){a.C.push(b)}
|
||||
function fc(a,b){a.w||(a.j&&E(a.j,536870912)&&B(a.j,"memory fault on address "+J(a.j,b),!0,!0),a.b.$(4,b))}function Qb(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.i={data:0,Fd:0,rb:20,Id:0};this.f={Gd:0,Eb:-1}}y(K);h=K.prototype;
|
||||
h.Ba=function(a,b,c,d){this.w=b;this.b=c;this.j=d;var e=this;this.f.Eb=gc(c,function(){e.f.Ga|=128;e.f.Ga&64&&(hc(e.b,e.f.Xc),ic(e.b,e.f.Eb,1E3/60))});this.f.Xc=jc(c,64,6);Wb(b,this,L);Xb(b,this.reset.bind(this));G(this)};h.vc=function(){var a=this.f.Ga;this.f.Ga&=-129;return a};h.ed=function(a){this.f.Ga=a;a&64&&ic(this.b,this.f.Eb,1E3/60);this.f.Ga=a&-129};h.xc=function(){var a=this.b;return a.F&62337|a.sa<<5|a.ta<<1};
|
||||
h.gd=function(a){var b=this.b;a&=62337;if(b.F!=a){b.F=a;b.sa=a>>5&3;b.ta=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.sb!=c&&(b.sb=c,kc(b))}lc(this)};h.yc=function(){var a=this.b.Ia;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.zc=function(){return this.b.Bb};h.Ac=function(){return this.b.Ja};h.hd=function(a){var b=this.b;b.Ja!=a&&(b.Ja=a,a&16?(b.hb=4194303,b.va=3915776):(b.hb=262143,b.va=253952),kc(b));lc(this)};function lc(a){a.i.rb=a.i.rb&-8|(a.b.sb?a.b.Ja&16?1:2:4)}
|
||||
h.Mc=function(a){return this.b.P[1][a>>1&7]};h.ud=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Kc=function(a){return this.b.P[1][(a>>1&7)+8]};h.sd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Lc=function(a){return this.b.oa[1][a>>1&7]};h.td=function(a,b){b=b>>1&7;this.b.oa[1][b]=a;this.b.P[1][b]&=65295};h.Jc=function(a){return this.b.oa[1][(a>>1&7)+8]};h.rd=function(a,b){b=(b>>1&7)+8;this.b.oa[1][b]=a;this.b.P[1][b]&=65295};h.uc=function(a){return this.b.P[0][a>>1&7]};
|
||||
h.dd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.sc=function(a){return this.b.P[0][(a>>1&7)+8]};h.bd=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.tc=function(a){return this.b.oa[0][a>>1&7]};h.cd=function(a,b){b=b>>1&7;this.b.oa[0][b]=a;this.b.P[0][b]&=65295};h.rc=function(a){return this.b.oa[0][(a>>1&7)+8]};h.ad=function(a,b){b=(b>>1&7)+8;this.b.oa[0][b]=a;this.b.P[0][b]&=65295};h.Sc=function(a){return this.b.P[3][a>>1&7]};h.Ad=function(a,b){this.b.P[3][b>>1&7]=a&65295};
|
||||
h.Qc=function(a){return this.b.P[3][(a>>1&7)+8]};h.yd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Rc=function(a){return this.b.oa[3][a>>1&7]};h.zd=function(a,b){b=b>>1&7;this.b.oa[3][b]=a;this.b.P[3][b]&=65295};h.Pc=function(a){return this.b.oa[3][(a>>1&7)+8]};h.xd=function(a,b){b=(b>>1&7)+8;this.b.oa[3][b]=a;this.b.P[3][b]&=65295};h.Za=function(a){a&=7;return this.b.L&2048?this.b.Ca[a]:this.b.u[a]};h.cb=function(a,b){b&=7;this.b.L&2048?this.b.Ca[b]=a:this.b.u[b]=a};
|
||||
h.Dc=function(){return this.b.L&49152?this.b.ra[0]:this.b.u[6]};h.ld=function(a){this.b.L&49152?this.b.ra[0]=a:this.b.u[6]=a};h.Gc=function(){return this.b.u[7]};h.od=function(a){this.b.u[7]=a};h.$a=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ca[a]};h.eb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ca[b]=a};h.Ec=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.ra[1]};h.md=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ra[1]=a};
|
||||
h.Fc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.ra[3]};h.nd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.ra[3]=a};h.qc=function(a){return this.b.Yb[a-65504>>1]};h.$c=function(a,b){this.b.Yb[b-65504>>1]=a};h.Ub=function(a){return 65520==a?61183:0};h.ac=function(){};h.Oc=function(){return 1};h.wd=function(){};h.pc=function(){return this.b.Z};h.Zc=function(){this.b.Z=0};h.wc=function(){return this.b.Xb};h.fd=function(a,b){b&1||(a&=255);this.b.Xb=a};
|
||||
h.Bc=function(a){return a?this.b.Cb:0};h.jd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Cb=a;b.D|=2};h.Nc=function(a){return a?this.b.Ka&65280:0};h.vd=function(a){this.b.Ka=a|255};h.Cc=function(){return Db(this.b)};h.kd=function(a){mc(this.b,a&-1809|Db(this.b)&1808);this.b.D|=128};h.$b=function(a,b){E(this)&&B(this,"writeIgnored("+ca(b)+"): "+ca(a),!0,!0)};h.reset=function(){this.i.rb=this.i.rb&-120|20;this.f.Ga=0};
|
||||
var M={},L=(M[62592]=[null,null,K.prototype.Mc,K.prototype.ud,"SISDR"],M[62608]=[null,null,K.prototype.Kc,K.prototype.sd,"SDSDR"],M[62624]=[null,null,K.prototype.Lc,K.prototype.td,"SISAR"],M[62640]=[null,null,K.prototype.Jc,K.prototype.rd,"SDSAR"],M[62656]=[null,null,K.prototype.uc,K.prototype.dd,"KISDR"],M[62672]=[null,null,K.prototype.sc,K.prototype.bd,"KDSDR"],M[62688]=[null,null,K.prototype.tc,K.prototype.cd,"KISAR"],M[62704]=[null,null,K.prototype.rc,K.prototype.ad,"KDSAR"],M[62798]=[null,null,
|
||||
K.prototype.Ac,K.prototype.hd,"MMR3"],M[65382]=[null,null,K.prototype.vc,K.prototype.ed,"LKS"],M[65402]=[null,null,K.prototype.xc,K.prototype.gd,"MMR0"],M[65404]=[null,null,K.prototype.yc,K.prototype.$b,"MMR1"],M[65406]=[null,null,K.prototype.zc,K.prototype.$b,"MMR2"],M[65408]=[null,null,K.prototype.Sc,K.prototype.Ad,"UISDR"],M[65424]=[null,null,K.prototype.Qc,K.prototype.yd,"UDSDR"],M[65440]=[null,null,K.prototype.Rc,K.prototype.zd,"UISAR"],M[65456]=[null,null,K.prototype.Pc,K.prototype.xd,"UDSAR"],
|
||||
M[65472]=[null,null,K.prototype.Za,K.prototype.cb,"R0SET0"],M[65473]=[null,null,K.prototype.Za,K.prototype.cb,"R1SET0"],M[65474]=[null,null,K.prototype.Za,K.prototype.cb,"R2SET0"],M[65475]=[null,null,K.prototype.Za,K.prototype.cb,"R3SET0"],M[65476]=[null,null,K.prototype.Za,K.prototype.cb,"R4SET0"],M[65477]=[null,null,K.prototype.Za,K.prototype.cb,"R5SET0"],M[65478]=[null,null,K.prototype.Dc,K.prototype.ld,"R6KERNEL"],M[65479]=[null,null,K.prototype.Gc,K.prototype.od,"R7KERNEL"],M[65480]=[null,null,
|
||||
K.prototype.$a,K.prototype.eb,"R0SET1"],M[65481]=[null,null,K.prototype.$a,K.prototype.eb,"R1SET1"],M[65482]=[null,null,K.prototype.$a,K.prototype.eb,"R2SET1"],M[65483]=[null,null,K.prototype.$a,K.prototype.eb,"R3SET1"],M[65484]=[null,null,K.prototype.$a,K.prototype.eb,"R4SET1"],M[65485]=[null,null,K.prototype.$a,K.prototype.eb,"R5SET1"],M[65486]=[null,null,K.prototype.Ec,K.prototype.md,"R6SUPER"],M[65487]=[null,null,K.prototype.Fc,K.prototype.nd,"R6USER"],M[65504]=[null,null,K.prototype.qc,K.prototype.$c,
|
||||
"CTRL",1170],M[65520]=[null,null,K.prototype.Ub,K.prototype.ac,"LSIZE",1170],M[65522]=[null,null,K.prototype.Ub,K.prototype.ac,"HSIZE",1170],M[65524]=[null,null,K.prototype.Oc,K.prototype.wd,"SYSID",1170],M[65526]=[null,null,K.prototype.pc,K.prototype.Zc,"CPUERR",1170],M[65528]=[null,null,K.prototype.wc,K.prototype.fd,"MB",1170],M[65530]=[null,null,K.prototype.Bc,K.prototype.jd,"PIR"],M[65532]=[null,null,K.prototype.Nc,K.prototype.vd,"SL"],M[65534]=[null,null,K.prototype.Cc,K.prototype.kd,"PSW"],
|
||||
var lb="undefined"!==typeof ArrayBuffer,H={cpu:1,trap:16,bus:64,memory:128,device:256,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function mb(a){r.call(this,"Panel",a,mb);this.f=0;this.v.Sb=!0}y(mb);h=mb.prototype;
|
||||
h.ra=function(a,b,c,d){if(this.B&&this.B.ra(a,b,c,d)||this.b&&this.b.ra(a,b,c,d)||this.i&&this.i.ra(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.J[b]=c,this.f++,!0;default:return"rled"==a?(this.J[b]=c,this.f++,!0):this.parent.ra.call(this,a,b,c,d)}};h.Da=function(a,b,c,d){this.B=a;this.A=b;this.b=c;this.i=d};h.Aa=function(a,b){b||Ab();return!0};h.za=function(){return!0};
|
||||
function Bb(a,b,c,d){if(a.J[b]){void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.b.ga());var e=a.i&&a.i.ja||8;c=!a.b.v.ea||a.v.Sb?8==e?ca(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}}function Cb(a,b,c,d){for(var e=0;e<d;e++){var f=a.J[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
h.ba=function(a){if(this.f&&(a||!this.b.v.ea||this.v.Sb)){for(a=0;a<this.b.u.length;a++)Bb(this,"R"+a,this.b.u[a]);a=Db(this.b);Bb(this,"PS",a);Bb(this,"NF",a&8?1:0,1);Bb(this,"ZF",a&4?1:0,1);Bb(this,"VF",a&2?1:0,1);Bb(this,"CF",a&1?1:0,1);Cb(this,"D",this.b.u[0],16);Cb(this,"A",this.b.u[7],22)}};function Ab(){for(var a=!1,b=A(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=db(e.id);f||(a=!0,f=new mb(e));fb(f,d);a&&G(f)}}La(Ab);
|
||||
function Eb(a,b,c){r.call(this,"Bus",a,Eb,64);this.b=b;this.i=c;this.H=a.busWidth||16;this.j=0;this.M=[];this.G=null;this.I=Math.pow(2,this.H);this.f=this.I-1|0;this.Z=(this.H>>1)+2;10>this.Z&&(this.Z=10);15<this.Z&&(this.Z=15);this.wa=1<<this.Z;this.K=this.wa>>2;this.A=this.wa-1;this.D=this.I/this.wa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Fb,Gb,Hb,Ib];a=new I(this);Jb(a,this.i);this.W=Array(this.D);for(b=0;b<this.D;b++)this.W[b]=a;G(this)}y(Eb);
|
||||
function Fb(a,b){var c=-1,d=this.controller,e=d.Ga[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&E(this.i,64)&&B(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Kb(d,b|4186112,-1,1);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
|
||||
function Gb(a,b,c){var d=!1,e=this.controller,f=e.Ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&E(this.i,64)&&B(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Kb(e,c|4186112,b,1),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
|
||||
function Hb(a,b){var c=-1,d=this.controller;(a=d.Ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&E(this.i,64)&&B(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Kb(d,b|4186112,-1,0);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c}
|
||||
function Ib(a,b,c){var d=!1,e=this.controller;if(a=e.Ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&E(this.i,64)&&B(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Kb(e,c|4186112,b,0),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))}
|
||||
function Lb(a,b){if(b!=a.j){var c;a.j&&(c=(1<<a.j)-8192,Mb(a,c,8192,a.M),a.j=0);b&&(a.j=b,c=(1<<b)-8192,a.M=Nb(a,c,8192),a.G?Mb(a,c,8192,a.G):(Ob(a,c,8192,Pb,a),a.G=Nb(a,c,8192)))}}h=Eb.prototype;h.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();Lb(this,16)};function Kb(a,b,c,d){a.C||(a.i&&E(a.i,536870912)&&B(a.i,"warning: unrecognized I/O access("+J(a.i,b)+","+J(a.i,c)+","+d+")",!0,!0),a.b.aa(4,b));return 0}h.Aa=function(a,b){b||this.reset();return!0};
|
||||
function Ob(a,b,c,d,e){for(var f=b,g=c,l=f>>>a.Z;0<g&&l<a.W.length;){var m=a.W[l],p=l*a.wa,q=a.wa-(f-p);q>g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.w)return m.rb+=m.w-f,m.w=f,!0;if(f>=m.w+m.rb){q=m.size-(f-p);q>g&&(q=g);m.rb=f-m.w+q;f=p+a.wa;g-=q;l++;continue}}return Qb(1,f,g)}f=new I(a,f,q,a.wa,d,e);Jb(f,a.i,m);a.W[l++]=f;f=p+a.wa;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Rb[d]+" at "+k(b,8,!0)),!0):Qb(2,b,c)}
|
||||
function Nb(a,b,c){var d=[];for(b>>>=a.Z;0<c&&b<a.W.length;)d.push(a.W[b++]),c-=a.wa;return d}function Mb(a,b,c,d){var e=0;for(b>>>=a.Z;0<c&&b<a.W.length;){var f=d[e++];if(!f)break;a.W[b++]=f;c-=a.wa}}h.kb=function(a){return this.W[(a&this.f)>>>this.Z].zb(a&this.A,a)};h.xb=function(a){this.C++;a=this.W[(a&this.f)>>>this.Z].Hb(a&this.A,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.Z].qa(a&this.A,a)};
|
||||
h.lb=function(a){var b=a&this.A,c=(a&this.f)>>>this.Z;this.C++;a=this.W[c].Ib(b,a);this.C--;return a};h.Ab=function(a,b){this.W[(a&this.f)>>>this.Z].Cb(a&this.A,b&255,a)};h.pb=function(a,b){this.C++;this.W[(a&this.f)>>>this.Z].Ob(a&this.A,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.Z].sb(a&this.A,b&65535,a)};h.Bb=function(a,b){var c=a&this.A,d=(a&this.f)>>>this.Z;this.C++;this.W[d].Pb(c,b&65535,a);this.C--};
|
||||
function Sb(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.W[d];if(e.Ha||e.lc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,l=0,m=[];g<e.length;){for(var p=e[g],q=g+1;q<e.length&&e[q]===p;)q++;m[l++]=q-g;m[l++]=p;g=q}m.length<e.length&&(e=m)}c[f]=e}}return c}function Tb(a,b,c,d,e,f,g,l){for(;b<=c;b+=2){var m=b&8191;void 0!==a.Ga[m]?n("I/O address already registered: "+k(b,8,!0)):a.Ga[m]=[d,e,f,g,l||"unknown",!1]}}
|
||||
function Ub(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.b.Gb)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));Tb(a,e,e,g,l,m,p,f[4])}}}function Vb(a,b){a.B.push(b)}
|
||||
function Wb(a,b){a.C||(a.i&&E(a.i,536870912)&&B(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.aa(4,b))}function Qb(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.j={data:0,Id:0,yb:20,Ld:0};this.f={Jd:0,Nb:-1}}y(K);h=K.prototype;
|
||||
h.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;var e=this;this.f.Nb=Xb(c,function(){e.f.Ia|=128;e.f.Ia&64&&(fc(e.b,e.f.ad),gc(e.b,e.f.Nb,1E3/60))});this.f.ad=hc(64,6);Ub(b,this,L);Vb(b,this.reset.bind(this));G(this)};h.zc=function(){var a=this.f.Ia;this.f.Ia&=-129;return a};h.jd=function(a){this.f.Ia=a;a&64&&gc(this.b,this.f.Nb,1E3/60);this.f.Ia=a&-129};h.Bc=function(){var a=this.b;return a.G&62337|a.ta<<5|a.ua<<1};
|
||||
h.ld=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ta=a>>5&3;b.ua=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ja!=c&&(b.Ja=c,ic(b))}jc(this)};h.Cc=function(){var a=this.b.La;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Dc=function(){return this.b.Kb};h.Ec=function(){return this.b.Ma};h.md=function(a){var b=this.b;1170>b.Gb&&(a&=-49);b.Ma!=a&&(b.Ma=a,a&16?(b.Wa=4194303,b.va=3915776):(b.Wa=262143,b.va=253952),ic(b));jc(this)};function jc(a){a.j.yb=a.j.yb&-8|(a.b.Ja?a.b.Ma&16?1:2:4)}
|
||||
h.Qc=function(a){return this.b.P[1][a>>1&7]};h.yd=function(a,b){this.b.P[1][b>>1&7]=a&65295};h.Oc=function(a){return this.b.P[1][(a>>1&7)+8]};h.wd=function(a,b){this.b.P[1][(b>>1&7)+8]=a&65295};h.Pc=function(a){return this.b.pa[1][a>>1&7]};h.xd=function(a,b){b=b>>1&7;this.b.pa[1][b]=a;this.b.P[1][b]&=65295};h.Nc=function(a){return this.b.pa[1][(a>>1&7)+8]};h.vd=function(a,b){b=(b>>1&7)+8;this.b.pa[1][b]=a;this.b.P[1][b]&=65295};h.yc=function(a){return this.b.P[0][a>>1&7]};
|
||||
h.hd=function(a,b){this.b.P[0][b>>1&7]=a&65295};h.wc=function(a){return this.b.P[0][(a>>1&7)+8]};h.fd=function(a,b){this.b.P[0][(b>>1&7)+8]=a&65295};h.xc=function(a){return this.b.pa[0][a>>1&7]};h.gd=function(a,b){b=b>>1&7;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.vc=function(a){return this.b.pa[0][(a>>1&7)+8]};h.ed=function(a,b){b=(b>>1&7)+8;this.b.pa[0][b]=a;this.b.P[0][b]&=65295};h.Wc=function(a){return this.b.P[3][a>>1&7]};h.Ed=function(a,b){this.b.P[3][b>>1&7]=a&65295};
|
||||
h.Uc=function(a){return this.b.P[3][(a>>1&7)+8]};h.Cd=function(a,b){this.b.P[3][(b>>1&7)+8]=a&65295};h.Vc=function(a){return this.b.pa[3][a>>1&7]};h.Dd=function(a,b){b=b>>1&7;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.Tc=function(a){return this.b.pa[3][(a>>1&7)+8]};h.Bd=function(a,b){b=(b>>1&7)+8;this.b.pa[3][b]=a;this.b.P[3][b]&=65295};h.ab=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};h.fb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};
|
||||
h.Hc=function(){return this.b.L&49152?this.b.sa[0]:this.b.u[6]};h.pd=function(a){this.b.L&49152?this.b.sa[0]=a:this.b.u[6]=a};h.Kc=function(){return this.b.u[7]};h.sd=function(a){this.b.u[7]=a};h.bb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]};h.gb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};h.Ic=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.sa[1]};h.qd=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.sa[1]=a};
|
||||
h.Jc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.sa[3]};h.rd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.sa[3]=a};h.uc=function(a){return this.b.cc[a-65504>>1]};h.dd=function(a,b){this.b.cc[b-65504>>1]=a};h.$b=function(a){return 65520==a?61183:0};h.fc=function(){};h.Sc=function(){return 1};h.Ad=function(){};h.tc=function(){return this.b.$};h.cd=function(){this.b.$=0};h.Ac=function(){return this.b.bc};h.kd=function(a,b){b&1||(a&=255);this.b.bc=a};
|
||||
h.Fc=function(a){return a?this.b.Lb:0};h.nd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Lb=a;b.F|=2};h.Rc=function(a){return a?this.b.Na&65280:0};h.zd=function(a){this.b.Na=a|255};h.Gc=function(){return Db(this.b)};h.od=function(a){kc(this.b,a&-1809|Db(this.b)&1808);this.b.F|=128};h.ec=function(a,b){E(this)&&B(this,"writeIgnored("+ca(b)+"): "+ca(a),!0,!0)};h.reset=function(){this.j.yb=this.j.yb&-120|20;this.f.Ia=0};
|
||||
var M={},L=(M[62592]=[null,null,K.prototype.Qc,K.prototype.yd,"SISDR"],M[62608]=[null,null,K.prototype.Oc,K.prototype.wd,"SDSDR"],M[62624]=[null,null,K.prototype.Pc,K.prototype.xd,"SISAR"],M[62640]=[null,null,K.prototype.Nc,K.prototype.vd,"SDSAR"],M[62656]=[null,null,K.prototype.yc,K.prototype.hd,"KISDR"],M[62672]=[null,null,K.prototype.wc,K.prototype.fd,"KDSDR"],M[62688]=[null,null,K.prototype.xc,K.prototype.gd,"KISAR"],M[62704]=[null,null,K.prototype.vc,K.prototype.ed,"KDSAR"],M[62798]=[null,null,
|
||||
K.prototype.Ec,K.prototype.md,"MMR3"],M[65382]=[null,null,K.prototype.zc,K.prototype.jd,"LKS"],M[65402]=[null,null,K.prototype.Bc,K.prototype.ld,"MMR0"],M[65404]=[null,null,K.prototype.Cc,K.prototype.ec,"MMR1"],M[65406]=[null,null,K.prototype.Dc,K.prototype.ec,"MMR2"],M[65408]=[null,null,K.prototype.Wc,K.prototype.Ed,"UISDR"],M[65424]=[null,null,K.prototype.Uc,K.prototype.Cd,"UDSDR"],M[65440]=[null,null,K.prototype.Vc,K.prototype.Dd,"UISAR"],M[65456]=[null,null,K.prototype.Tc,K.prototype.Bd,"UDSAR"],
|
||||
M[65472]=[null,null,K.prototype.ab,K.prototype.fb,"R0SET0"],M[65473]=[null,null,K.prototype.ab,K.prototype.fb,"R1SET0"],M[65474]=[null,null,K.prototype.ab,K.prototype.fb,"R2SET0"],M[65475]=[null,null,K.prototype.ab,K.prototype.fb,"R3SET0"],M[65476]=[null,null,K.prototype.ab,K.prototype.fb,"R4SET0"],M[65477]=[null,null,K.prototype.ab,K.prototype.fb,"R5SET0"],M[65478]=[null,null,K.prototype.Hc,K.prototype.pd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Kc,K.prototype.sd,"R7KERNEL"],M[65480]=[null,null,
|
||||
K.prototype.bb,K.prototype.gb,"R0SET1"],M[65481]=[null,null,K.prototype.bb,K.prototype.gb,"R1SET1"],M[65482]=[null,null,K.prototype.bb,K.prototype.gb,"R2SET1"],M[65483]=[null,null,K.prototype.bb,K.prototype.gb,"R3SET1"],M[65484]=[null,null,K.prototype.bb,K.prototype.gb,"R4SET1"],M[65485]=[null,null,K.prototype.bb,K.prototype.gb,"R5SET1"],M[65486]=[null,null,K.prototype.Ic,K.prototype.qd,"R6SUPER"],M[65487]=[null,null,K.prototype.Jc,K.prototype.rd,"R6USER"],M[65504]=[null,null,K.prototype.uc,K.prototype.dd,
|
||||
"CTRL",1170],M[65520]=[null,null,K.prototype.$b,K.prototype.fc,"LSIZE",1170],M[65522]=[null,null,K.prototype.$b,K.prototype.fc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Sc,K.prototype.Ad,"SYSID",1170],M[65526]=[null,null,K.prototype.tc,K.prototype.cd,"CPUERR",1170],M[65528]=[null,null,K.prototype.Ac,K.prototype.kd,"MB",1170],M[65530]=[null,null,K.prototype.Fc,K.prototype.nd,"PIR"],M[65532]=[null,null,K.prototype.Rc,K.prototype.zd,"SL"],M[65534]=[null,null,K.prototype.Gc,K.prototype.od,"PSW"],
|
||||
M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624];L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];
|
||||
L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688];L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];
|
||||
L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440];L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456];
|
||||
L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];La(function(){for(var a=A(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=z(c);switch(d.name){case "default":d=new K(d),fb(d,c)}}});var nc;if(lb){var oc=new ArrayBuffer(2);(new DataView(oc)).setUint16(0,256,!0);nc=256===(new Uint16Array(oc))[0]}else nc=!1;var pc=nc;
|
||||
function I(a,b,c,d,e,f){this.w=a;this.id=qc+=2;this.b=null;this.A=b;this.ob=c;this.size=d||0;this.type=e||rc;this.f=e==sc;this.controller=null;Jb(this);this.Fa=this.gc=!1;if(d)if(f)this.controller=f,this.b=null,tc(this,f.dc);else if(lb)this.C=new ArrayBuffer(d),this.G=new DataView(this.C,0,d),this.F=new Uint8Array(this.C,0,d),this.J=new Uint16Array(this.C,0,d>>1),this.b=new Int32Array(this.C,0,d>>2),tc(this,pc?uc:vc);else{this.b=Array(d>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;tc(this,wc)}else tc(this)}
|
||||
var rc=0,sc=2,Pb=4,Rb=["NONE","RAM","ROM","VID","H/W"],qc=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(lb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.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(lb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.b=a;return this.Fa=!0}return!1},Na:function(a,b){b?this.B++||xc(this,yc,!1):this.i++||zc(this,yc,!1)},K:function(){this.j&&E(this.j,128)&&(B(this.j,"attempt to read invalid block %"+
|
||||
k(this.A),!0),this.j.fa());return 255},I:function(a,b){this.j&&E(this.j,128)&&(B(this.j,"attempt to write "+k(b,4,!0)+" to invalid block %"+k(this.A),!0),this.j.fa())},M:function(a,b){return this.tb(a++,b++)|this.tb(a,b)<<8},H:function(a,b,c){this.ub(a++,b&255,c++);this.ub(a,b>>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ha:function(a,b){a&1&&fc(this.w,b);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},qa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=
|
||||
this.b[c]&~(255<<a)|b<<a;this.Fa=!0},va:function(a,b,c){a&1&&fc(this.w,c);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.Fa=!0},T:function(a,b){if(this.j&&null!=this.A){var c=this.j;Ac(c,this.A+a,1,c.M)&&c.fa(!0)}return this.yb(a,b)},ca:function(a,b){if(this.j&&null!=this.A){var c=this.j;Ac(c,this.A+a,2,c.M)&&c.fa(!0)}return this.zb(a,b)},la:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;Ac(d,this.A+a,
|
||||
1,d.F)&&d.fa(!0)}this.f?this.I(a,b,c):this.Fb(a,b,c)},ta:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;Ac(d,this.A+a,2,d.F)&&d.fa(!0)}this.f?this.I(a,b,c):this.Gb(a,b,c)},R:function(a){return this.F[a]},U:function(a,b){a=this.F[a];this.j&&E(this.j,128)&&B(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ba:function(a,b){a&1&&fc(this.w,b);return this.G.getUint16(a,!0)},ea:function(a,b){a&1&&fc(this.w,b);a=this.J[a>>1];this.j&&E(this.j,128)&&B(this.j,"Memory.readWord("+
|
||||
J(this.j,b)+"): "+J(this.j,a),!0);return a},ka:function(a,b){this.F[a]=b;this.Fa=!0},ma:function(a,b,c){this.F[a]=b;this.Fa=!0;this.j&&E(this.j,128)&&B(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},sa:function(a,b,c){a&1&&fc(this.w,c);this.G.setUint16(a,b,!0);this.Fa=!0},Sa:function(a,b,c){a&1&&fc(this.w,c);this.J[a>>1]=b;this.Fa=!0;this.j&&E(this.j,128)&&B(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0)}};
|
||||
function Jb(a,b,c){a.j=b;a.i=a.B=0;c&&((a.i=c.i)&&zc(a,yc,!1),(a.B=c.B)&&xc(a,yc,!1))}function Bc(a,b){b?--a.B||(a.ub=a.f?a.I:a.Fb,a.bc=a.f?a.H:a.Gb):--a.i||(a.tb=a.yb,a.Vb=a.zb)}function xc(a,b,c){c&&a.B||(a.ub=!a.f&&b[1]||a.I,a.bc=!a.f&&b[3]||a.H);if(c||void 0===c)a.Fb=b[1]||a.I,a.Gb=b[3]||a.H}function zc(a,b,c){c&&a.i||(a.tb=b[0]||a.K,a.Vb=b[2]||a.M);if(c||void 0===c)a.yb=b[0]||a.K,a.zb=b[2]||a.M}function tc(a,b){b||(b=Cc);zc(a,b,void 0);xc(a,b,void 0)}
|
||||
var Cc=[],wc=[I.prototype.V,I.prototype.qa,I.prototype.ha,I.prototype.va],yc=[I.prototype.T,I.prototype.la,I.prototype.ca,I.prototype.ta];if(lb)var vc=[I.prototype.R,I.prototype.ka,I.prototype.ba,I.prototype.sa],uc=[I.prototype.U,I.prototype.ma,I.prototype.ea,I.prototype.Sa];
|
||||
function Dc(a,b){r.call(this,"CPU",a,Dc,1);var c=a.multiplier||1;this.Ma=a.cycles||b;this.Ha=c;this.Ua=Math.round(this.Ma/1E4)/100;this.Qa=this.Ua*this.Ha;this.v.da=!1;this.v.Db=!1;this.v.fb=a.autoStart;this.v.Va=!1;this.jb=this.ka=0;this.kb=a.csStart;this.Wa=a.csInterval;this.Xa=a.csStop;this.J=[];this.Qb=this.Wc.bind(this);G(this)}y(Dc);var Ec=["power","reset"];h=Dc.prototype;
|
||||
h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.j=d;for(b=0;b<Ec.length;b++)(c=this.I[Ec[b]])&&this.B.pa(null,Ec[b],c);a=Fc(a,"autoStart");null!=a&&(this.v.fb="true"==a?!0:"false"==a?!1:!!a);G(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.ya=function(a,b){if(!b){if(a&&this.restore){Gc(this);if(!this.restore(a))return!1;Hc(this)}else this.reset();this.j?(a=this.j,a.g("Type ? for help with PDP11 Debugger commands"),a.aa(),a.Da&&(b=a.Da,a.Da=null,Ic(a,b))):this.g("No debugger detected")}this.B.aa();return!0};h.xa=function(a){return a?this.save():!0};h.fb=function(){return this.v.fb||!this.j&&void 0===this.I.run?(this.ab(!0),!0):!1};h.Mb=function(){return 0};
|
||||
function Hc(a){void 0===a.kb&&(a.kb=0);void 0===a.Wa&&(a.Wa=-1);void 0===a.Xa&&(a.Xa=-1);a.v.Va=0<=a.kb&&0<a.Wa;a.v.Va&&(a.jb=0,a.ka=a.kb-a.ha)}function Jc(a,b){if(a.v.Va){var c=!1;a.jb=a.jb+a.Mb()|0;a.ka-=b;0>=a.ka&&(a.ka+=a.Wa,c=!0);0<=a.Xa&&a.Xa<=Kc(a)&&(a.Wa=a.Xa=-1,Hc(a),a.fa(),c=!0);c&&a.g(Kc(a)+" cycles: checksum="+k(a.jb))}}
|
||||
h.pa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ga)a=!0;else{var b=null,c,l=cb(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.v.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.v.ga);c++);c==l.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.pb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.da?d.fa():d.ab())},
|
||||
!0;case "speed":return this.I[b]=c,!0;case "setSpeed":return this.I[b]=c,c.onclick=function(){Lc(d,d.Ha<<1,!0)},c.textContent=this.Qa.toFixed(2)+"Mhz",!0}return!1};h.aa=function(){var a=this.I.speed;a&&(a.textContent=this.v.da&&this.ba?this.ba.toFixed(2)+"Mhz":"Stopped")};function Mc(a,b,c){a.ha+=b;c&&(a.ea=a.b=0)}function Nc(a,b){var c=1;b&&1<a.Ha&&a.ba&&(c=a.ba/a.Ua);a.qb=Math.round(1E3/30);a.La=Math.floor(a.Ma/30*c);b||(a.la=a.La);a.ib=0}function Kc(a){return a.ha+a.T+a.ea-a.b}
|
||||
function Gc(a){a.ba=0;a.Pb=0;a.ha=a.T=a.ea=a.b=0;Hc(a);Lc(a,1)}function Lc(a,b,c){var d=!1;if(void 0!==b){.8>a.ba/a.Qa?b=1:d=!0;a.Ha=b;b=a.Ua*a.Ha;if(a.Qa!=b){a.Qa=b;b=a.Qa.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.B&&a.B.nb()}Mc(a,a.T);a.T=0;a.R=ra();a.ca=0;Nc(a);return d}function gc(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function ic(a,b,c){0<=b&&b<a.J.length&&0>a.J[b][0]&&(c*=a.Ma*a.Ha/1E3,a.J[b][0]=c+Oc(a))}
|
||||
function Pc(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Qc(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 Oc(a,b){var c=a.ea-=a.b;a.b=0;b&&(a.ea=0);return c}
|
||||
h.Wc=function(){if(this.v.da){this.ib>=this.Ma&&Nc(this,!0);this.qa=0;this.Da=ra();if(this.ca){var a=this.Da-this.ca;a>this.qb&&(this.R+=a,this.R>this.Da&&(this.R=this.Da))}try{do{var b=Pc(this,this.v.Va?1:this.La);try{this.bb(b)}catch(e){if("number"!=typeof e)throw e;}b=Oc(this,!0);this.qa+=b;this.T+=b;Jc(this,b);Qc(this,b);this.la-=b;if(0>=this.la){this.la+=this.La;15<=++this.Pb&&(this.B&&this.B.aa(),this.Pb=0);break}}while(this.v.da)}catch(e){this.fa();this.B&&this.B.stop(ra(),Kc(this));kb(this,
|
||||
e.stack||e.message);return}if(this.v.da){a=setTimeout;b=this.Qb;this.ca=ra();var c=this.qb;this.qa&&(c=Math.round(c*this.qa/this.La));var c=c-(this.ca-this.Da),d=this.ca-this.R;d&&(this.ba=Math.round(this.T/(10*d))/100,864E5<=d&&(this.ha=0,Lc(this)));if(0>c||this.ba<this.Qa)-1E3>c&&(this.R-=c),c=0;this.ib+=this.qa;this.ca+=c;a(b,c)}}};
|
||||
h.ab=function(a){if(jb(this))return!1;if(this.v.da)return this.g(this.toString()+" busy"),!1;Lc(this);this.v.da=!0;this.v.Db=!0;var b=this.I.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.nb(!0),this.B.start(this.R,Kc(this)));setTimeout(this.Qb,0);return!0};h.bb=function(){return 0};h.fa=function(a){if(this.v.da){Oc(this);Mc(this,this.T);this.T=0;this.v.da=!1;var b=this.I.run;b&&(b.textContent="Run");this.B&&this.B.stop(ra(),Kc(this))}this.v.complete=a};
|
||||
function jd(a){this.Tb=+a.model||1170;this.nc=a.resetAddr||0;Dc.call(this,a,6666667);this.decode=kd.bind(this);this.jc=[];this.U=null;this.N=65536;this.O=32768;this.X=65535;this.S=32768;this.L=15;this.u=[0,0,0,0,0,0,0,this.nc];this.Ca=[0,0,0,0,0,0];this.ra=[0,0,0,0];this.ta=this.C=0;this.kc=[4,2,0,1];this.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],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.oa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.oc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Yb=[0,0,0,0,0,0,0,0];this.i=this.f=this.Ta=this.G=this.H=this.D=this.Xb=0;this.ma=-1;ld(this);this.v.complete=this.v.fc=!1}y(jd,Dc);h=jd.prototype;h.reset=function(){this.v.da&&this.fa();ld(this);Gc(this);this.v.error=!1;this.parent.reset.call(this)};
|
||||
function ld(a){a.Ka=255;a.Z=0;a.Cb=0;a.F=0;a.Ia=0;a.Bb=0;a.Ja=0;a.sb=0;a.sa=0;a.hb=262143;a.va=253952;a.D|=2;a.w&&kc(a)}function kc(a){a.sb?(a.V=65536,a.K=a.ic,a.M=a.Wb,a.Sb=a.Cd,Lb(a.w,a.Ja&16?22:18)):(a.V=0,a.K=a.hc,a.M=a.Tc,a.Sb=a.Bd,Lb(a.w,16))}h.Mb=function(){return 0};h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ha,this.Ha]);a.set(2,Ub(this.w));return a.data()};
|
||||
h.restore=function(a){var b=a[1];this.ha=b[1];Lc(this,b[3]);a:{b=this.w;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.K){for(var f=0,g=Array(b.K),l=0;l<e.length-1;)for(var m=e[l++],p=e[l++];m--;)g[f++]=p;e=g}f=b.W[d];if(!f||!f.restore(e)){n("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function md(a){return a.N&65536?1:0}function nd(a){return a.O&32768?2:0}function od(a){return a.X&65535?0:4}h.Aa=function(){return this.S&32768?8:0};
|
||||
function pd(a){var b=a.M(a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function qd(a,b){a.u[7]=b&65535}function jc(a,b,c){b={Yc:b,Ya:c,next:null};a.jc.push(b);return b}function hc(a,b){if(b!=a.U){var c=a.U;if(!c||c.Ya<=b.Ya)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.Ya<=b.Ya){b.next=d;c.next=b;break}c=d}while(c)}}a.D|=2}function Db(a){return a.L=a.L&63728|a.Aa()|od(a)|nd(a)|md(a)}
|
||||
function mc(a,b){a.S=b<<12;a.X=~b&4;a.O=b<<14;a.N=b<<16;if((b^a.L)&2048)for(var c=a.Ca.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ca[c];a.Ca[c]=d}a.C=b>>14&3;c=a.L>>14&3;a.C!=c&&(a.ra[c]=a.u[6],a.u[6]=a.ra[a.C]);a.L=b;a.D|=2}function O(a,b){a.D&128||(a.S=a.X=b,a.O=0)}function rd(a,b,c){a.D&128||(a.S=a.X=a.N=b,a.O=c||0)}function sd(a,b,c,d){a.D&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function td(a,b){a.D&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function ud(a,b,c,d){a.D&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))}
|
||||
h.$=function(a,b){var c=!1;0>this.ma?this.ma=Db(this):this.C||(a=4,c=!0);this.F&57344||(this.Ia=63222,this.Bb=a);this.C=0;var d=this.M(a|this.V),e=this.M(a+2&65535|this.V);mc(this,e&-12289|this.ma>>2&12288);c&&(this.Z|=4,this.u[6]=4);vd(this,this.ma);vd(this,this.u[7]);qd(this,d);this.D&=-113;this.ma=-1;if(26!=b)throw a;};function wd(a){var b=xd(a),c=xd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);qd(a,b);mc(a,c);a.D&=-17}
|
||||
function yd(a,b,c){var d,e,f,g=0;d=b>>13;a.Ja&a.kc[a.C]||(d&=7);e=a.P[a.C][d];f=(a.oa[a.C][d]<<6)+(b&8191)&a.hb;if(f<a.va)f&1&&!(c&1)&&(a.Z|=64,a.$(4,10));else if(a.Ja&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ja&32&&(f=a.oc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.va&&4186112>f&&(a.Z|=32,a.$(4,12))}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.C][d]=e;if(4194170!==f||a.C)a.sa=a.C,a.ta=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.F&57344||(a.F=a.F|g|a.sa<<5|a.ta<<1),a.$(168,16)),a.F&61440||!(4191360>f||4194239<f)||(a.F|=4096,a.F&512&&(a.D|=32)));return f}function xd(a){var b=a.M(a.u[6]|a.V);a.u[6]=a.u[6]+2&65535;return b}
|
||||
function vd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.F&57344||(a.Ia=a.Ia<<8|246);!a.C&&c<=a.Ka&&4<c&&(c<=a.Ka-32?(a.Z|=4,a.u[6]=4,a.$(4,18)):(a.Z|=8,a.D|=4));a.Sb(c,b)}
|
||||
function zd(a,b,c,d){var e,f,g=d&8?0:a.V;switch(b){case 0:return a.$(4,20),0;case 1:return 6===c&&!a.C&&d&4&&(a.u[6]<=a.Ka||65534<=a.u[6])&&(a.u[6]<=a.Ka-32||65534<=a.u[6]?(a.Z|=4,a.u[6]=4,a.$(4,22)):(a.Z|=8,a.D|=64)),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.M(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.M(e)|g;a.b-=
|
||||
8;break;case 6:return e=pd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=pd(a),e=e+a.u[c]&65535,e=a.M(e|a.V)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Ia=a.Ia<<8|f<<3&248|c);6==c&&!a.C&&d&4&&0>=f&&(a.u[6]<=a.Ka||65534<=a.u[6])&&(a.u[6]<=a.Ka-32?(a.Z|=4,a.u[6]=4,a.$(4,24)):(a.Z|=8,a.D|=64));return e}h.hc=function(a,b,c){return zd(this,a,b,c)};h.ic=function(a,b,c){return yd(this,zd(this,a,b,c),c)};h.Tc=function(a){return this.w.ja(a)};h.Wb=function(a){return this.w.ja(yd(this,a,2))};
|
||||
h.Bd=function(a,b){this.w.Ra(a,b&65535)};h.Cd=function(a,b){this.w.Ra(yd(this,a,4),b)};function Ad(a,b,c){var d=a.f=b&7;(b=a.i=(b&56)>>3)?(d=zd(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.C=a.L>>12&3,c=a.M(d|c&a.V),a.C=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.ra[a.L>>12&3];return c}
|
||||
function Bd(a,b,c,d){a.F&57344||(a.Ia=22);var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=zd(a,b,e,4),c&65536||(e&=65535),a.C=a.L>>12&3,e=yd(a,e|c&65536,4),a.C=a.L>>14&3,a.w.Ra(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.ra[a.L>>12&3]=d}function Cd(a,b){b>>=6;var c=a.H=b&7;(b=a.G=(b&56)>>3)?(c=a.K(b,c,3),a=a.w.Pa(c)):a=a.u[c]&255;return a}function Dd(a,b){b>>=6;var c=a.H=b&7;return(b=a.G=(b&56)>>3)?a.w.ja(a.K(b,c,2)):a.u[c]}function Ed(a,b){var c=a.f=b&7;b=a.i=(b&56)>>3;return zd(a,b,c,8)}
|
||||
function Fd(a,b){var c=a.f=b&7;(b=a.i=(b&56)>>3)?(c=a.K(b,c,3),a=a.w.Pa(c)):a=a.u[c]&255;return a}function Gd(a,b){var c=a.f=b&7;return(b=a.i=(b&56)>>3)?a.w.ja(a.K(b,c,2)):a.u[c]}function P(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=a.Ta=a.K(b,e,7),c=d.call(a,c,a.w.Pa(e)),e&1&&a.b--,a.w.mb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function Q(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=a.K(b,e,6),a.w.Ra(e,d.call(a,c,a.w.ja(e)))):a.u[e]=d.call(a,c,a.u[e])}
|
||||
function Hd(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(d=a.K(b,e,5),d&1&&a.b--,a.w.mb(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Id(a,b,c){var d=a.f=b&7;(b=a.i=(b&56)>>3)?a.w.Ra(a.K(b,d,4),c):a.u[d]=c&65535;return c}function R(a,b,c){c&&(qd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
h.bb=function(a){this.v.complete=!0;var b=this.v.fc=this.j&&Jd(this.j),c=a?this.v.Db?0:1:-1;this.v.Db=!1;this.ea=this.b=a;do{if(b){if(Kd(this.j,this.u[7],c)){this.fa();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.$(168,28):this.D&64?this.$(4,30):this.D&16&&this.$(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;var d=160,e=(this.Cb&224)>>5;if(a=this.U&&this.U.Ya>e?this.U:null)d=a.Yc,e=a.Ya;e>(this.L&224)>>5?(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),this.$(d,26),e=!0):e=!1;if(e&&
|
||||
a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.D&1&&this.D++;this.F&57344||(this.Ia=0,this.Bb=this.u[7]);this.D=this.D&7|this.L&16;this.decode(pd(this))}while(0<this.b);return this.v.complete?this.ea-this.b:void 0===this.v.complete?0:-1};La(function(){for(var a=A(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new jd(d);fb(d,c)}});function Ld(a,b){var c=b+a;sd(this,c,a,b);return c&65535}
|
||||
function Md(a,b){var c=b+a;sd(this,c<<8,a<<8,b<<8);return c&255}function Nd(a,b){a=b<<1;td(this,a);return a&65535}function Od(a,b){a=b<<1;td(this,a<<8);return a&255}function Pd(a,b){a=b&32768|b>>1|b<<16;td(this,a);return a&65535}function Qd(a,b){a=b&2048|b>>1|b<<8;td(this,a<<8);return a&255}function Rd(a,b){a=b&~a;O(this,a);return a}function Sd(a,b){a=b&~a;O(this,a<<8);return a}function Td(a,b){a|=b;O(this,a);return a}function Ud(a,b){a|=b;O(this,a<<8);return a}
|
||||
function Vd(a,b){a=~b|65536;rd(this,a);return a&65535}function Wd(a,b){a=~b|256;rd(this,a<<8);return a&255}function Xd(a,b){a=b-a;this.D&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function Yd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function Zd(a,b){a=b+a;this.D&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function $d(a,b){a=b+a;var c=a<<8;this.D&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255}
|
||||
function ae(a,b){a=-b;rd(this,a,a&b&32768);return a&65535}function be(a,b){a=-b;rd(this,a<<8,(a&b&128)<<8);return a&255}function ce(a,b){a=b<<1|this.N>>16&1;td(this,a);return a&65535}function de(a,b){a=b<<1|this.N>>16&1;td(this,a<<8);return a&255}function ee(a,b){a=(this.N&65536|b)>>1|b<<16;td(this,a);return a&65535}function fe(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;td(this,a<<8);return a&255}function ge(a,b){var c=b-a;ud(this,c,a,b);return c&65535}
|
||||
function he(a,b){var c=b-a;ud(this,c<<8,a<<8,b<<8);return c&255}function ie(a,b){this.D&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function je(a,b){a^=b;O(this,a);return a&65535}
|
||||
function ke(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.N=c<<17-b,c>>=b;else if(b)if(16<b)this.O=c,c=0;else{this.N=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.i?6:7)+b}
|
||||
function le(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.N=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.O=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.i?6:7)+b}function S(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5}
|
||||
function me(a){var b=Gd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=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.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}var ne=[0,7,7,10,7,11,9,13];function oe(a){var b=this.b;qd(this,Ed(this,a));this.b=b-ne[this.i]}
|
||||
var pe=[0,14,14,17,14,18,16,20];function qe(a){var b=this.b,c=Ed(this,a);a=a>>6&7;vd(this,this.u[a]);this.u[a]=this.u[7];qd(this,c);this.b=b-pe[this.i]}var re=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],se=[7,13,13,17,14,18,17,21];function te(a){var b=Gd(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.D&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767<b?65536:0);this.b-=23}
|
||||
function ue(){this.b-=5}function T(a){a&1&&(this.N=65536);a&2&&(this.O=32768);a&4&&(this.X=0);a&8&&(this.S=32768);this.b-=5}function ve(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)qd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function we(a){Q(this,a,0,ie);this.b-=this.i?9:3+(7==this.f?2:0)}function xe(a){Q(this,a,Dd(this,a),je);this.b-=this.i?9:3+(7==this.f?2:0)}function V(){this.$(8,6)}function kd(a){ye[a>>12].call(this,a)}
|
||||
var ye=[function(a){ze[a>>8&15].call(this,a)},function(a){var b=Dd(this,a),c=this.b;O(this,Id(this,a,b));this.b=c-re[(this.G?8:0)+this.i]+(7!=this.f||this.i?0:2)},function(a){var b=Dd(this,a);a=Gd(this,a);ud(this,b-a,a,b);this.b-=this.i?4+(this.H&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)},function(a){O(this,Dd(this,a)&Gd(this,a));this.b-=this.i?4+(this.H&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Dd(this,a),Rd);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?
|
||||
2:0)},function(a){Q(this,a,Dd(this,a),Td);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Dd(this,a),Ld);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);O(this,Hd(this,a,b,1)<<8);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;ud(this,b-a,a,b);this.b-=this.i?
|
||||
4+(this.H&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)},function(a){O(this,(Cd(this,a)&Fd(this,a))<<8);this.b-=this.i?4+(this.H&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)},function(a){P(this,a,Cd(this,a),Sd);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){P(this,a,Cd(this,a),Ud);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Dd(this,a),ge);this.b-=this.i?9+(this.H&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},V],ze=
|
||||
[function(a){Ve[a>>4&15].call(this,a)},function(a){R(this,a,!0)},function(a){R(this,a,!od(this))},function(a){R(this,a,od(this))},function(a){R(this,a,!this.Aa()==!nd(this))},function(a){R(this,a,!this.Aa()!=!nd(this))},function(a){R(this,a,!od(this)&&!this.Aa()==!nd(this))},function(a){R(this,a,od(this)||!this.Aa()!=!nd(this))},qe,qe,function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},V,V],We=[function(a){rd(this,
|
||||
Id(this,a,0));this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Vd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Zd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Xd);this.b-=this.i?9:3+(7==this.f?2:0)}],Xe=[function(a){Q(this,a,0,ae);this.b-=this.i?11:6},function(a){Q(this,a,md(this)?1:0,Ld);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,md(this)?1:0,ge);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);rd(this,a);this.b-=this.i?4:3+(7==this.f?
|
||||
2:0)}],Ye=[function(a){Q(this,a,0,ee);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Pd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Nd);this.b-=this.i?9:3+(7==this.f?2:0)}],Ze=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Wb(a|65536);qd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this,a,0);vd(this,a);O(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,
|
||||
0,b);O(this,b);this.b=c-se[this.i]},function(a){O(this,Id(this,a,this.Aa?65535:0));this.b-=this.i?9:3+(7==this.f?2:0)}],Ve=[function(a){$e[a&15].call(this,a)},V,V,V,oe,oe,oe,oe,function(a){if(a&8)this.$(8,6);else{var b=xd(this);a&=7;qd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.$(8,6)},function(a){af[a&15].call(this,a)},function(a){bf[a&15].call(this,a)},we,we,we,we],$e=[function(){this.L&49152?(this.Z|=128,this.$(4,
|
||||
3)):this.fa();this.b-=7},function(){this.D&4||this.B.aa();this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){wd(this);this.D|=this.L&16;this.b-=13},function(){this.$(12,1);this.b-=5},function(){this.$(16,4);this.b-=25},function(){this.L&49152||(ld(this),this.w.reset());this.b-=667},function(){wd(this);this.b-=13},V,V,V,V,V,V,V,V,V],af=[ue,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},S,function(){this.X=1;this.b-=5},S,S,S,function(){this.S=0;this.b-=5},S,S,S,S,S,S,S],bf=
|
||||
[ue,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},T,function(){this.X=0;this.b-=5},T,T,T,function(){this.S=32768;this.b-=5},T,T,T,T,T,T,T],Te=[te,te,me,me,ke,ke,le,le,xe,xe,V,V,V,V,ve,ve],Ue=[function(a){R(this,a,!this.Aa())},function(a){R(this,a,this.Aa())},function(a){R(this,a,!md(this)&&!od(this))},function(a){R(this,a,md(this)||od(this))},function(a){R(this,a,!nd(this))},function(a){R(this,a,nd(this))},function(a){R(this,a,!md(this))},function(a){R(this,a,md(this))},function(){this.$(24,
|
||||
2);this.b-=25},function(){this.$(28,5);this.b-=5},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},V,V],cf=[function(a){rd(this,Hd(this,a,0));this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,1,$d);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Yd);this.b-=this.i?9:3+(7==this.f?2:0)}],df=[function(a){P(this,a,0,be);this.b-=
|
||||
this.i?11:6},function(a){P(this,a,md(this)?1:0,Md);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,md(this)?1:0,he);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){a=Fd(this,a);rd(this,a<<8);this.b-=this.i?4:3+(7==this.f?2:0)}],ef=[function(a){P(this,a,0,fe);this.b-=this.i?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){P(this,a,0,de);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Qd);this.b-=this.i?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.b-=this.i?9:3+(7==
|
||||
this.f?2:0)}],ff=[V,function(a){a=Ad(this,a,65536);vd(this,a);O(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,65536,b);O(this,b);this.b=c-se[this.i]},V];function gf(a){r.call(this,"ROM",a,gf);this.f=null;this.F=a.addr;this.i=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=da(this.C);if(this.C){a=this.C;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf);
|
||||
gf.prototype.Ba=function(a,b,c,d){this.w=b;this.b=c;this.j=d;jf(this)};gf.prototype.ya=function(){if(this.za){if(this.j){var a=this.j,b=this.id,c=this.F,d=this.i,e=this.za,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],w=qa(q,m,a.Ib);0>w&&q.splice(-(w+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Hd:b,A:c,lc:d,za:e,Hb:f})}delete this.za}return!0};gf.prototype.xa=function(){return!0};
|
||||
function hf(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.vb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.za=l.symbols;if(!a.f.length){n("Empty ROM: "+
|
||||
b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e<b.length;e++)a.f[e]=aa(b[e],16);jf(a)}}
|
||||
function jf(a){if(!ib(a))if(!a.C)G(a);else if(a.f&&a.w){a.i||(a.i=a.f.length);if(a.f.length!=a.i)kb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.i,8,!0)+")");else{var b;b=a.F;if(Ob(a.w,b,a.i,a.G?1:sc)){var c;for(c=0;c<a.f.length;c++)Tb(a.w,b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.B?b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Nb(d.w,d.F,d.i);Mb(d.w,e,d.i,f)}delete a.f}}G(a)}}
|
||||
La(function(){for(var a=A(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new gf(d);fb(d,c)}});function kf(a){r.call(this,"RAM",a,kf);this.B=a.addr;this.i=a.size;this.f=!1}y(kf);kf.prototype.Ba=function(a,b,c,d){this.w=b;this.b=c;this.j=d;!this.f&&this.i&&Ob(this.w,this.B,this.i,1)&&(this.f=!0);this.f||n("No RAM allocated");G(this)};kf.prototype.ya=function(){return!0};kf.prototype.xa=function(){return!0};kf.prototype.reset=function(){};
|
||||
La(function(){for(var a=A(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new kf(d);fb(d,c)}});function lf(a){r.call(this,"Keyboard",a,lf,65536);G(this)}y(lf);lf.prototype.pa=function(){return!1};lf.prototype.Ba=function(a,b,c,d){this.B=a;this.b=c;this.j=d};La(function(){for(var a=A(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new lf(d);fb(d,c)}});
|
||||
function W(a){this.C=this.G=null;this.T=a.tabSize;this.M=a.charBOL;this.H=0;r.call(this,"SerialPort",a,W,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=mf;b&&(void 0===c&&(c="Panel"),(c=eb(c,this.id))&&(b=c.I[b])&&this.pa(null,a,b))}this.J=this.K=null;this.exports={connect:this.Rb,receiveData:this.Ab}}y(W);var mf="buffer";h=W.prototype;
|
||||
h.pa=function(a,b,c){var d=this;switch(b){case mf:return this.I[b]=this.C=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.Ab(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Ab(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Ba=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;var e=this;this.ba=jc(this.b,48,4);this.U=gc(this.b,function(){e.f&128||!e.F.length||(e.R=e.F.shift(),e.f|=128,e.f&64&&hc(e.b,e.ba))});this.ca=jc(this.b,52,4);this.V=gc(this.b,function(){e.i|=128;e.i&64&&hc(e.b,e.ca)});Wb(b,this,nf);G(this)};
|
||||
h.Rb=function(){if(!this.J){var a=Fc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.Sa)return;b=oa(b[1]);if(this.J=db(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.K=d.receiveData){this.status(this.vb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ya=function(a,b){if(!b)if(this.Rb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.xa=function(a){return a?this.save():!0};h.reset=function(){of(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return of(this)};function of(a){a.R=0;a.f=0;a.i=128;a.F=[];return!0}h.Ab=function(a){if("number"==typeof a)this.F.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.F.push(a.charCodeAt(b));else this.F=this.F.concat(a);ic(this.b,this.U,1);return!0};h.Ic=function(){return this.f&65535};h.qd=function(a){this.f=this.f&-112|a&111};
|
||||
h.Hc=function(){this.f&=-129;0<this.F.length&&ic(this.b,this.U,1);return this.R};h.pd=function(){};h.Vc=function(){return this.i};h.Ed=function(a){128==(this.i&192)&&a&64&&ic(this.b,this.V,1);this.i=this.i&-70|a&69};h.Uc=function(){return 0};
|
||||
h.Dd=function(a){if(a&=255){B(this,"transmitByte("+k(a,2,!0)+")");this.K&&this.K.call(this.J,a);if(this.C)if(13==a)this.H=0;else if(8==a)this.C.value=this.C.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=pa[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=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.g(this.G),
|
||||
this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.i&=-129;ic(this.b,this.V,1)}};var pf={},nf=(pf[65392]=[null,null,W.prototype.Ic,W.prototype.qd,"RCSR"],pf[65394]=[null,null,W.prototype.Hc,W.prototype.pd,"RBUF"],pf[65396]=[null,null,W.prototype.Vc,W.prototype.Ed,"XCSR"],pf[65398]=[null,null,W.prototype.Uc,W.prototype.Dd,"XBUF"],pf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new W(d);fb(d,c)}});
|
||||
function qf(a){r.call(this,"Debugger",a,qf);this.ha=a.base||16;this.ta=!1;this.R=this.sa=this.H=0;this.U=!1;this.C=-1;this.i=[];this.ba={}}y(qf);var rf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};qf.prototype.Nb=function(){return-1};qf.prototype.Ob=function(){};
|
||||
function sf(a,b,c,d){if(c)if(b){0>a.C&&a.i.length&&(a.C=0);if(0>a.C||b!=a.i[a.C])a.i.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.i[a.C+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(oa(b.substring(c,f))),c=f+1}}return a}
|
||||
L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504];La(function(){for(var a=A(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=z(c);switch(d.name){case "default":d=new K(d),fb(d,c)}}});var lc;if(lb){var mc=new ArrayBuffer(2);(new DataView(mc)).setUint16(0,256,!0);lc=256===(new Uint16Array(mc))[0]}else lc=!1;var nc=lc;
|
||||
function I(a,b,c,d,e,f){this.A=a;this.id=oc+=2;this.b=null;this.w=b;this.rb=c;this.size=d||0;this.type=e||pc;this.f=e==qc;this.controller=null;Jb(this);this.Ha=this.lc=!1;if(d)if(f)this.controller=f,this.b=null,rc(this,f.ic);else if(lb)this.C=new ArrayBuffer(d),this.G=new DataView(this.C,0,d),this.D=new Uint8Array(this.C,0,d),this.I=new Uint16Array(this.C,0,d>>1),this.b=new Int32Array(this.C,0,d>>2),rc(this,nc?sc:tc);else{this.b=Array(d>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;rc(this,uc)}else rc(this)}
|
||||
var pc=0,qc=2,Pb=4,Rb=["NONE","RAM","ROM","VID","H/W"],oc=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(lb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.G.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(lb)for(b=0;b<a.length;b++)this.G.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ha=!0}return!1},Pa:function(a,b){b?this.B++||vc(this,wc,!1):this.j++||xc(this,wc,!1)},K:function(){this.i&&E(this.i,128)&&(B(this.i,"attempt to read invalid block %"+
|
||||
k(this.w),!0),this.i.ga());return 255},J:function(a,b){this.i&&E(this.i,128)&&(B(this.i,"attempt to write "+k(b,4,!0)+" to invalid block %"+k(this.w),!0),this.i.ga())},M:function(a,b){return this.zb(a++,b++)|this.zb(a,b)<<8},H:function(a,b,c){this.Cb(a++,b&255,c++);this.Cb(a,b>>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ja:function(a,b){a&1&&Wb(this.A,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},ta:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=
|
||||
this.b[c]&~(255<<a)|b<<a;this.Ha=!0},xa:function(a,b,c){a&1&&Wb(this.A,c);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.Ha=!0},T:function(a,b){if(this.i&&null!=this.w){var c=this.i;yc(c,this.w+a,1,c.M)&&c.ga(!0)}return this.Hb(a,b)},da:function(a,b){if(this.i&&null!=this.w){var c=this.i;yc(c,this.w+a,2,c.M)&&c.ga(!0)}return this.Ib(a,b)},ma:function(a,b,c){if(this.i&&null!=this.w){var d=this.i;yc(d,this.w+a,
|
||||
1,d.D)&&d.ga(!0)}this.f?this.J(a,b,c):this.Ob(a,b,c)},va:function(a,b,c){if(this.i&&null!=this.w){var d=this.i;yc(d,this.w+a,2,d.D)&&d.ga(!0)}this.f?this.J(a,b,c):this.Pb(a,b,c)},R:function(a){return this.D[a]},U:function(a,b){a=this.D[a];this.i&&E(this.i,128)&&B(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ca:function(a,b){a&1&&Wb(this.A,b);return this.G.getUint16(a,!0)},fa:function(a,b){a&1&&Wb(this.A,b);a=this.I[a>>1];this.i&&E(this.i,128)&&B(this.i,"Memory.readWord("+
|
||||
J(this.i,b)+"): "+J(this.i,a),!0);return a},la:function(a,b){this.D[a]=b;this.Ha=!0},oa:function(a,b,c){this.D[a]=b;this.Ha=!0;this.i&&E(this.i,128)&&B(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ua:function(a,b,c){a&1&&Wb(this.A,c);this.G.setUint16(a,b,!0);this.Ha=!0},Ua:function(a,b,c){a&1&&Wb(this.A,c);this.I[a>>1]=b;this.Ha=!0;this.i&&E(this.i,128)&&B(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}};
|
||||
function Jb(a,b,c){a.i=b;a.j=a.B=0;c&&((a.j=c.j)&&xc(a,wc,!1),(a.B=c.B)&&vc(a,wc,!1))}function zc(a,b){b?--a.B||(a.Cb=a.f?a.J:a.Ob,a.sb=a.f?a.H:a.Pb):--a.j||(a.zb=a.Hb,a.qa=a.Ib)}function vc(a,b,c){c&&a.B||(a.Cb=!a.f&&b[1]||a.J,a.sb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Ob=b[1]||a.J,a.Pb=b[3]||a.H}function xc(a,b,c){c&&a.j||(a.zb=b[0]||a.K,a.qa=b[2]||a.M);if(c||void 0===c)a.Hb=b[0]||a.K,a.Ib=b[2]||a.M}function rc(a,b){b||(b=Ac);xc(a,b,void 0);vc(a,b,void 0)}
|
||||
var Ac=[],uc=[I.prototype.V,I.prototype.ta,I.prototype.ja,I.prototype.xa],wc=[I.prototype.T,I.prototype.ma,I.prototype.da,I.prototype.va];if(lb)var tc=[I.prototype.R,I.prototype.la,I.prototype.ca,I.prototype.ua],sc=[I.prototype.U,I.prototype.oa,I.prototype.fa,I.prototype.Ua];
|
||||
function Bc(a,b){r.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Fa=a.cycles||b;this.Ka=c;this.Va=Math.round(this.Fa/1E4)/100;this.Ra=this.Va*this.Ka;this.v.ea=!1;this.v.Mb=!1;this.v.hb=a.autoStart;this.v.Xa=!1;this.mb=this.ja=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.K=[];this.Yb=this.$c.bind(this);G(this)}y(Bc);var Cc=["power","reset"];h=Bc.prototype;
|
||||
h.Da=function(a,b,c,d){this.B=a;this.A=b;this.i=d;for(b=0;b<Cc.length;b++)(c=this.J[Cc[b]])&&this.B.ra(null,Cc[b],c);a=Dc(a,"autoStart");null!=a&&(this.v.hb="true"==a?!0:"false"==a?!1:!!a);G(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
|
||||
h.Aa=function(a,b){if(!b){if(a&&this.restore){Ec(this);if(!this.restore(a))return!1;Fc(this)}else this.reset();this.i?(a=this.i,a.g("Type ? for help with PDP11 Debugger commands"),a.ba(),a.Fa&&(b=a.Fa,a.Fa=null,Gc(a,b))):this.g("No debugger detected")}this.B.ba();return!0};h.za=function(a){return a?this.save():!0};h.hb=function(){return this.v.hb||!this.i&&void 0===this.J.run?(this.cb(!0),!0):!1};h.Vb=function(){return 0};
|
||||
function Fc(a){void 0===a.nb&&(a.nb=0);void 0===a.Ya&&(a.Ya=-1);void 0===a.Za&&(a.Za=-1);a.v.Xa=0<=a.nb&&0<a.Ya;a.v.Xa&&(a.mb=0,a.ja=a.nb-a.fa)}function Hc(a,b){if(a.v.Xa){var c=!1;a.mb=a.mb+a.Vb()|0;a.ja-=b;0>=a.ja&&(a.ja+=a.Ya,c=!0);0<=a.Za&&a.Za<=Ic(a)&&(a.Ya=a.Za=-1,Fc(a),a.ga(),c=!0);c&&a.g(Ic(a)+" cycles: checksum="+k(a.mb))}}
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,l=cb(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.v.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.v.ha);c++);c==l.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.vb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ea?d.ga():d.cb())},
|
||||
!0;case "speed":return this.J[b]=c,!0;case "setSpeed":return this.J[b]=c,c.onclick=function(){Jc(d,d.Ka<<1,!0)},c.textContent=this.Ra.toFixed(2)+"Mhz",!0}return!1};h.ba=function(){var a=this.J.speed;a&&(a.textContent=this.v.ea&&this.V?this.V.toFixed(2)+"Mhz":"Stopped")};function Kc(a,b,c){a.fa+=b;c&&(a.da=a.b=0)}function Lc(a,b){var c=1;b&&1<a.Ka&&a.V&&(c=a.V/a.Va);a.ub=Math.round(1E3/30);a.Oa=Math.floor(a.Fa/30*c);b||(a.la=a.Oa);a.jb=0}function Ic(a){return a.fa+a.T+a.da-a.b}
|
||||
function Ec(a){a.V=0;a.wb=0;a.fa=a.T=a.da=a.b=0;Fc(a);Jc(a,1)}function Jc(a,b,c){var d=!1;if(void 0!==b){.8>a.V/a.Ra?b=1:d=!0;a.Ka=b;b=a.Va*a.Ka;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.B&&a.B.qb()}Kc(a,a.T);a.T=0;a.R=ra();a.ca=0;Lc(a);return d}function Xb(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function gc(a,b,c){0<=b&&b<a.K.length&&0>a.K[b][0]&&(c*=a.Fa*a.Ka/1E3,a.K[b][0]=c+Mc(a))}
|
||||
function Nc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Oc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Mc(a,b){var c=a.da-=a.b;a.b=0;b&&(a.da=0);return c}
|
||||
h.$c=function(){if(this.v.ea){this.jb>=this.Fa&&Lc(this,!0);this.oa=0;this.xa=ra();if(this.ca){var a=this.xa-this.ca;a>this.ub&&(this.R+=a,this.R>this.xa&&(this.R=this.xa))}try{do{var b=Nc(this,this.v.Xa?1:this.Oa);try{this.eb(b)}catch(e){if("number"!=typeof e)throw e;}b=Mc(this,!0);this.oa+=b;this.T+=b;Hc(this,b);Oc(this,b);this.la-=b;if(0>=this.la){this.la+=this.Oa;15<=++this.wb&&(this.B&&this.B.ba(),this.wb=0);break}}while(this.v.ea)}catch(e){this.ga();this.B&&this.B.stop(ra(),Ic(this));kb(this,
|
||||
e.stack||e.message);return}if(this.v.ea){a=setTimeout;b=this.Yb;this.ca=ra();var c=this.ub;this.oa&&(c=Math.round(c*this.oa/this.Oa));var c=c-(this.ca-this.xa),d=this.ca-this.R;d&&(this.V=Math.round(this.T/(10*d))/100,864E5<=d&&(this.fa=0,Jc(this)));if(0>c||this.V<this.Ra)-1E3>c&&(this.R-=c),c=0;this.jb+=this.oa;this.ca+=c;a(b,c)}}};
|
||||
h.cb=function(a){if(jb(this))return!1;if(this.v.ea)return this.g(this.toString()+" busy"),!1;Jc(this);this.v.ea=!0;this.v.Mb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.qb(!0),this.B.start(this.R,Ic(this)));setTimeout(this.Yb,0);return!0};h.eb=function(){return 0};h.ga=function(a){if(this.v.ea){Mc(this);Kc(this,this.T);this.T=0;this.v.ea=!1;var b=this.J.run;b&&(b.textContent="Run");this.B&&this.B.stop(ra(),Ic(this))}this.v.complete=a};
|
||||
function Pc(a){this.Gb=+a.model||1170;this.qc=a.resetAddr||0;Bc.call(this,a,6666667);this.decode=Qc.bind(this);jd(this);this.C=0;this.U=null;this.v.complete=this.v.kc=!1}y(Pc,Bc);h=Pc.prototype;h.reset=function(){this.v.ea&&this.ga();jd(this);Ec(this);this.v.error=!1;this.parent.reset.call(this)};
|
||||
function jd(a){a.N=65536;a.O=32768;a.X=65535;a.S=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.qc];a.Ea=[0,0,0,0,0,0];a.sa=[0,0,0,0];a.D=0;a.ua=0;a.oc=[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],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.pa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.rc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.cc=[0,0,0,0,0,0,0,0];a.bc=0;a.F=0;a.H=a.I=0;a.j=a.f=a.Ta=0;a.ma=-1;kd(a)}function kd(a){a.Na=255;a.$=0;a.Lb=0;a.G=0;a.La=0;a.Kb=0;a.Ma=0;a.Ja=0;a.ta=0;a.Wa=262143;a.va=253952;a.F|=2;a.A&&ic(a)}function ic(a){a.Ja?(a.M=65536,a.Y=a.nc,a.qa=a.Xc,a.sb=a.Fd,Lb(a.A,a.Ma&16?22:18)):(a.M=0,a.Y=a.mc,a.qa=a.ac,a.sb=a.gc,Lb(a.A,16))}h.Vb=function(){return 0};
|
||||
h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.fa,this.Ka]);a.set(2,Sb(this.A));return a.data()};h.restore=function(a){var b=a[1];this.fa=b[1];Jc(this,b[3]);a:{b=this.A;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.K){for(var f=0,g=Array(b.K),l=0;l<e.length-1;)for(var m=e[l++],p=e[l++];m--;)g[f++]=p;e=g}f=b.W[d];if(!f||!f.restore(e)){n("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function O(a){return a.N&65536?1:0}
|
||||
function ld(a){return a.O&32768?2:0}function md(a){return a.X&65535?0:4}h.Ca=function(){return this.S&32768?8:0};function nd(a){var b=a.qa(a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function od(a,b){a.u[7]=b&65535}function hc(a,b){return{bd:a,$a:b,next:null}}function fc(a,b){if(b!=a.U){var c=a.U;if(!c||c.$a<=b.$a)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.$a<=b.$a){b.next=d;c.next=b;break}c=d}while(c)}}a.F|=2}function Db(a){return a.L=a.L&63728|a.Ca()|md(a)|ld(a)|O(a)}
|
||||
function kc(a,b){a.S=b<<12;a.X=~b&4;a.O=b<<14;a.N=b<<16;if((b^a.L)&2048)for(var c=a.Ea.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ea[c];a.Ea[c]=d}a.D=b>>14&3;c=a.L>>14&3;a.D!=c&&(a.sa[c]=a.u[6],a.u[6]=a.sa[a.D]);a.L=b;a.F|=2}function P(a,b){a.F&128||(a.S=a.X=b,a.O=0)}function pd(a,b,c){a.F&128||(a.S=a.X=a.N=b,a.O=c||0)}function qd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^b)&(d^b))}function rd(a,b){a.F&128||(a.S=a.X=a.N=b,a.O=a.S^a.N>>1)}function sd(a,b,c,d){a.F&128||(a.S=a.X=a.N=b,a.O=(c^d)&(d^b))}
|
||||
h.aa=function(a,b){if(!this.C){var c=!1;0>this.ma?this.ma=Db(this):this.D||(a=4,c=!0);this.G&57344||(this.La=63222,this.Kb=a);this.D=0;var d=this.qa(a|this.M),e=this.qa(a+2&65535|this.M);kc(this,e&-12289|this.ma>>2&12288);c&&(this.$|=4,this.u[6]=4);td(this,this.ma);td(this,this.u[7]);od(this,d);this.F&=-113;this.ma=-1;if(26!=b)throw a;}};function ud(a){var b=vd(a),c=vd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);od(a,b);kc(a,c);a.F&=-17}
|
||||
function wd(a,b,c){var d,e,f,g=0;d=b>>13;a.Ma&a.oc[a.D]||(d&=7);e=a.P[a.D][d];f=(a.pa[a.D][d]<<6)+(b&8191)&a.Wa;if(f<a.va)f&1&&!(c&1)&&(a.$|=64,a.aa(4,10));else if(a.Ma&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ma&32&&(f=a.rc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.va&&4186112>f&&(a.$|=32,a.aa(4,12))}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.D][d]=e;if(4194170!==f||a.D)a.ta=a.D,a.ua=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ta<<5|a.ua<<1),a.aa(168,16)),a.G&61440||!(4191360>f||4194239<f)||(a.G|=4096,a.G&512&&(a.F|=32)));return f}function xd(a,b){return a.A.kb(b)}function yd(a,b,c){b&1&&a.b--;a.A.Ab(b,c&255)}function vd(a){var b=a.qa(a.u[6]|a.M);a.u[6]=a.u[6]+2&65535;return b}
|
||||
function td(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.G&57344||(a.La=a.La<<8|246);!a.D&&c<=a.Na&&4<c&&(c<=a.Na-32?(a.$|=4,a.u[6]=4,a.aa(4,18)):(a.$|=8,a.F|=4));a.sb(c,b)}
|
||||
function zd(a,b,c,d){var e,f,g=d&8?0:a.M;switch(b){case 0:return a.aa(4,20),0;case 1:return 6===c&&!a.D&&d&4&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32||65534<=a.u[6]?(a.$|=4,a.u[6]=4,a.aa(4,22)):(a.$|=8,a.F|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.qa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.qa(e)|g;
|
||||
a.b-=8;break;case 6:return e=nd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=nd(a),e=e+a.u[c]&65535,e=a.qa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.La=a.La<<8|f<<3&248|c);6==c&&!a.D&&d&4&&0>=f&&(a.u[6]<=a.Na||65534<=a.u[6])&&(a.u[6]<=a.Na-32?(a.$|=4,a.u[6]=4,a.aa(4,24)):(a.$|=8,a.F|=64));return e}h.xb=function(a){if(!this.Ja)return this.A.xb(a);this.C++;a=xd(this,wd(this,a,3));this.C--;return a};
|
||||
h.lb=function(a){if(!this.Ja)return this.A.lb(a);this.C++;a=this.ac(wd(this,a,2));this.C--;return a};h.pb=function(a,b){this.Ja?(this.C++,yd(this,wd(this,a,5),b),this.C--):this.A.pb(a,b)};h.Bb=function(a,b){this.Ja?(this.C++,this.gc(wd(this,a,4),b),this.C--):this.A.Bb(a,b)};h.mc=function(a,b,c){return zd(this,a,b,c)};h.nc=function(a,b,c){return wd(this,zd(this,a,b,c),c)};h.ac=function(a){return this.A.ka(a)};h.Xc=function(a){return this.A.ka(wd(this,a,2))};h.gc=function(a,b){this.A.Sa(a,b&65535)};
|
||||
h.Fd=function(a,b){this.A.Sa(wd(this,a,4),b)};function Ad(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?(d=zd(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.D=a.L>>12&3,c=a.qa(d|c&a.M),a.D=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.sa[a.L>>12&3];return c}function Bd(a,b,c,d){a.G&57344||(a.La=22);var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=zd(a,b,e,4),c&65536||(e&=65535),a.D=a.L>>12&3,e=wd(a,e|c&65536,4),a.D=a.L>>14&3,a.A.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.sa[a.L>>12&3]=d}
|
||||
function Cd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?xd(a,a.Y(b,c,3)):a.u[c]&255}function Dd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]}function Ed(a,b){var c=a.f=b&7;b=a.j=(b&56)>>3;return zd(a,b,c,8)}function Fd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?xd(a,a.Y(b,c,3)):a.u[c]&255}function Gd(a,b){var c=a.f=b&7;return(b=a.j=(b&56)>>3)?a.A.ka(a.Y(b,c,2)):a.u[c]}
|
||||
function Q(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Ta=a.Y(b,e,7),yd(a,e,d.call(a,c,xd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?(e=a.Y(b,e,6),a.A.Sa(e,d.call(a,c,a.A.ka(e)))):a.u[e]=d.call(a,c,a.u[e])}function Hd(a,b,c,d){var e=a.f=b&7;(b=a.j=(b&56)>>3)?yd(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Id(a,b,c){var d=a.f=b&7;(b=a.j=(b&56)>>3)?a.A.Sa(a.Y(b,d,4),c):a.u[d]=c&65535;return c}
|
||||
function S(a,b,c){c&&(od(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
||||
h.eb=function(a){this.v.complete=!0;var b=this.v.kc=this.i&&Jd(this.i),c=a?this.v.Mb?0:1:-1;this.v.Mb=!1;this.da=this.b=a;do{if(b){if(Kd(this.i,this.u[7],c)){this.ga();break}c=1}if(this.F&&(this.F&112&&(this.F&32?this.aa(168,28):this.F&64?this.aa(4,30):this.F&16&&this.aa(12,32),this.F&=-113),this.F&7))if(this.F&2){this.F&=-3;var d=160,e=(this.Lb&224)>>5;if(a=this.U&&this.U.$a>e?this.U:null)d=a.bd,e=a.$a;e>(this.L&224)>>5?(this.F&4&&(this.u[7]=this.u[7]+2&65535,this.F&=-5),this.aa(d,26),e=!0):e=!1;
|
||||
if(e&&a)if(e=this.U,e==a)this.U=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.F&1&&this.F++;this.G&57344||(this.La=0,this.Kb=this.u[7]);this.F=this.F&7|this.L&16;this.decode(nd(this))}while(0<this.b);return this.v.complete?this.da-this.b:void 0===this.v.complete?0:-1};La(function(){for(var a=A(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Pc(d);fb(d,c)}});function Ld(a,b){var c=b+a;qd(this,c,a,b);return c&65535}
|
||||
function Md(a,b){var c=b+a;qd(this,c<<8,a<<8,b<<8);return c&255}function Nd(a,b){a=b<<1;rd(this,a);return a&65535}function Od(a,b){a=b<<1;rd(this,a<<8);return a&255}function Pd(a,b){a=b&32768|b>>1|b<<16;rd(this,a);return a&65535}function Qd(a,b){a=b&2048|b>>1|b<<8;rd(this,a<<8);return a&255}function Rd(a,b){a=b&~a;P(this,a);return a}function Sd(a,b){a=b&~a;P(this,a<<8);return a}function Td(a,b){a|=b;P(this,a);return a}function Ud(a,b){a|=b;P(this,a<<8);return a}
|
||||
function Vd(a,b){a=~b|65536;pd(this,a);return a&65535}function Wd(a,b){a=~b|256;pd(this,a<<8);return a&255}function Xd(a,b){a=b-a;this.F&128||(this.S=this.X=a,this.O=b&(b^a));return a&65535}function Yd(a,b){a=b-a;var c=a<<8;b<<=8;this.F&128||(this.S=this.X=c,this.O=b&(b^c));return a&255}function Zd(a,b){a=b+a;this.F&128||(this.S=this.X=a,this.O=a&(b^a));return a&65535}function $d(a,b){a=b+a;var c=a<<8;this.F&128||(this.S=this.X=c,this.O=c&(b<<8^c));return a&255}
|
||||
function ae(a,b){a=-b;pd(this,a,a&b&32768);return a&65535}function be(a,b){a=-b;pd(this,a<<8,(a&b&128)<<8);return a&255}function ce(a,b){a=b<<1|this.N>>16&1;rd(this,a);return a&65535}function de(a,b){a=b<<1|this.N>>16&1;rd(this,a<<8);return a&255}function ee(a,b){a=(this.N&65536|b)>>1|b<<16;rd(this,a);return a&65535}function fe(a,b){a=((this.N&65536)>>8|b)>>1|b<<8;rd(this,a<<8);return a&255}function ge(a,b){var c=b-a;sd(this,c,a,b);return c&65535}
|
||||
function he(a,b){var c=b-a;sd(this,c<<8,a<<8,b<<8);return c&255}function ie(a,b){this.F&128||(this.S=this.X=b&65280,this.O=this.N=0);return(b<<8|b>>8)&65535}function je(a,b){a^=b;P(this,a);return a&65535}
|
||||
function ke(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.N=this.O=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.N=c<<17-b,c>>=b;else if(b)if(16<b)this.O=c,c=0;else{this.N=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.O=32768)}this.u[a]=c&65535;this.S=this.X=c;this.b-=(this.j?6:7)+b}
|
||||
function le(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.N=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.N=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.O=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.S=d>>16;this.X=d>>16|d;this.b-=(this.j?6:7)+b}function U(a){a&1&&(this.N=0);a&2&&(this.O=0);a&4&&(this.X=1);a&8&&(this.S=0);this.b-=5}
|
||||
function me(a){var b=Gd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.N=this.O=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.X=d>>16|d,this.S=d>>16):(this.O=32768,this.X=d>>15|d,this.S=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.S=0,this.O=32768,this.N=65536,this.b-=7}var ne=[0,7,7,10,7,11,9,13];function oe(a){var b=this.b;od(this,Ed(this,a));this.b=b-ne[this.j]}
|
||||
var pe=[0,14,14,17,14,18,16,20];function qe(a){var b=this.b,c=Ed(this,a);a=a>>6&7;td(this,this.u[a]);this.u[a]=this.u[7];od(this,c);this.b=b-pe[this.j]}var re=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],se=[7,13,13,17,14,18,17,21];function te(a){var b=Gd(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.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767<b?65536:0);this.b-=23}
|
||||
function ue(){this.b-=5}function V(a){a&1&&(this.N=65536);a&2&&(this.O=32768);a&4&&(this.X=0);a&8&&(this.S=32768);this.b-=5}function ve(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)od(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function we(a){R(this,a,0,ie);this.b-=this.j?9:3+(7==this.f?2:0)}function xe(a){R(this,a,Dd(this,a),je);this.b-=this.j?9:3+(7==this.f?2:0)}function W(){this.aa(8,6)}function Qc(a){ye[a>>12].call(this,a)}
|
||||
var ye=[function(a){ze[a>>8&15].call(this,a)},function(a){var b=Dd(this,a),c=this.b;P(this,Id(this,a,b));this.b=c-re[(this.H?8:0)+this.j]+(7!=this.f||this.j?0:2)},function(a){var b=Dd(this,a);a=Gd(this,a);sd(this,b-a,a,b);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,Dd(this,a)&Gd(this,a));this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Rd);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?
|
||||
2:0)},function(a){R(this,a,Dd(this,a),Td);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Ld);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);P(this,Hd(this,a,b,1)<<8);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;sd(this,b-a,a,b);this.b-=this.j?
|
||||
4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,(Cd(this,a)&Fd(this,a))<<8);this.b-=this.j?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Sd);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Ud);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),ge);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},W],ze=
|
||||
[function(a){Ve[a>>4&15].call(this,a)},function(a){S(this,a,!0)},function(a){S(this,a,!md(this))},function(a){S(this,a,md(this))},function(a){S(this,a,!this.Ca()==!ld(this))},function(a){S(this,a,!this.Ca()!=!ld(this))},function(a){S(this,a,!md(this)&&!this.Ca()==!ld(this))},function(a){S(this,a,md(this)||!this.Ca()!=!ld(this))},qe,qe,function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},W,W],We=[function(a){pd(this,
|
||||
Id(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Vd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Zd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Xd);this.b-=this.j?9:3+(7==this.f?2:0)}],Xe=[function(a){R(this,a,0,ae);this.b-=this.j?11:6},function(a){R(this,a,O(this)?1:0,Ld);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,O(this)?1:0,ge);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);pd(this,a);this.b-=this.j?4:3+(7==this.f?
|
||||
2:0)}],Ye=[function(a){R(this,a,0,ee);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ce);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Pd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Nd);this.b-=this.j?9:3+(7==this.f?2:0)}],Ze=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.M);od(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this,a,0);td(this,a);P(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;Bd(this,a,
|
||||
0,b);P(this,b);this.b=c-se[this.j]},function(a){P(this,Id(this,a,this.Ca?65535:0));this.b-=this.j?9:3+(7==this.f?2:0)}],Ve=[function(a){$e[a&15].call(this,a)},W,W,W,oe,oe,oe,oe,function(a){if(a&8)this.aa(8,6);else{var b=vd(this);a&=7;od(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.F|=1),this.b-=5):this.aa(8,6)},function(a){af[a&15].call(this,a)},function(a){bf[a&15].call(this,a)},we,we,we,we],$e=[function(){this.L&49152?(this.$|=128,this.aa(4,
|
||||
3)):this.ga();this.b-=7},function(){this.F&4||this.B.ba();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){ud(this);this.F|=this.L&16;this.b-=13},function(){this.aa(12,1);this.b-=5},function(){this.aa(16,4);this.b-=25},function(){this.L&49152||(kd(this),this.A.reset());this.b-=667},function(){ud(this);this.b-=13},W,W,W,W,W,W,W,W,W],af=[ue,function(){this.N=0;this.b-=5},function(){this.O=0;this.b-=5},U,function(){this.X=1;this.b-=5},U,U,U,function(){this.S=0;this.b-=5},U,U,U,U,U,U,U],bf=
|
||||
[ue,function(){this.N=65536;this.b-=5},function(){this.O=32768;this.b-=5},V,function(){this.X=0;this.b-=5},V,V,V,function(){this.S=32768;this.b-=5},V,V,V,V,V,V,V],Te=[te,te,me,me,ke,ke,le,le,xe,xe,W,W,W,W,ve,ve],Ue=[function(a){S(this,a,!this.Ca())},function(a){S(this,a,this.Ca())},function(a){S(this,a,!O(this)&&!md(this))},function(a){S(this,a,O(this)||md(this))},function(a){S(this,a,!ld(this))},function(a){S(this,a,ld(this))},function(a){S(this,a,!O(this))},function(a){S(this,a,O(this))},function(){this.aa(24,
|
||||
2);this.b-=25},function(){this.aa(28,5);this.b-=5},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},W,W],cf=[function(a){pd(this,Hd(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Wd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,$d);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Yd);this.b-=this.j?9:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,be);this.b-=
|
||||
this.j?11:6},function(a){Q(this,a,O(this)?1:0,Md);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,O(this)?1:0,he);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Fd(this,a);pd(this,a<<8);this.b-=this.j?4:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,fe);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,de);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Qd);this.b-=this.j?9+(this.Ta&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Od);this.b-=this.j?9:3+(7==
|
||||
this.f?2:0)}],ff=[W,function(a){a=Ad(this,a,65536);td(this,a);P(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;Bd(this,a,65536,b);P(this,b);this.b=c-se[this.j]},W];function gf(a){r.call(this,"ROM",a,gf);this.f=null;this.D=a.addr;this.j=a.size;this.G=a.writable;this.B=a.alias;this.C=a.file;this.H=da(this.C);if(this.C){a=this.C;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf);
|
||||
gf.prototype.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;jf(this)};gf.prototype.Aa=function(){if(this.Ba){if(this.i){var a=this.i,b=this.id,c=this.D,d=this.j,e=this.Ba,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],w=qa(q,m,a.Rb);0>w&&q.splice(-(w+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Kd:b,w:c,sc:d,Ba:e,Qb:f})}delete this.Ba}return!0};gf.prototype.za=function(){return!0};
|
||||
function hf(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.Db,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Ba=l.symbols;if(!a.f.length){n("Empty ROM: "+
|
||||
b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e<b.length;e++)a.f[e]=ba(b[e],16);jf(a)}}
|
||||
function jf(a){if(!ib(a))if(!a.C)G(a);else if(a.f&&a.A){a.j||(a.j=a.f.length);if(a.f.length!=a.j)kb(a,"ROM size ("+k(a.f.length,8,!0)+") does not match specified size ("+k(a.j,8,!0)+")");else{var b;b=a.D;if(Ob(a.A,b,a.j,a.G?1:qc)){var c;for(c=0;c<a.f.length;c++)a.A.pb(b+c,a.f[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.B?b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Nb(d.A,d.D,d.j);Mb(d.A,e,d.j,f)}delete a.f}}G(a)}}
|
||||
La(function(){for(var a=A(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new gf(d);fb(d,c)}});function kf(a){r.call(this,"RAM",a,kf);this.B=a.addr;this.j=a.size;this.f=!1}y(kf);kf.prototype.Da=function(a,b,c,d){this.A=b;this.b=c;this.i=d;!this.f&&this.j&&Ob(this.A,this.B,this.j,1)&&(this.f=!0);this.f||n("No RAM allocated");G(this)};kf.prototype.Aa=function(){return!0};kf.prototype.za=function(){return!0};kf.prototype.reset=function(){};
|
||||
La(function(){for(var a=A(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new kf(d);fb(d,c)}});function lf(a){r.call(this,"Keyboard",a,lf,65536);G(this)}y(lf);lf.prototype.ra=function(){return!1};lf.prototype.Da=function(a,b,c,d){this.B=a;this.b=c;this.i=d};La(function(){for(var a=A(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new lf(d);fb(d,c)}});
|
||||
function Y(a){this.C=this.G=null;this.T=a.tabSize;this.M=a.charBOL;this.H=0;r.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=mf;b&&(void 0===c&&(c="Panel"),(c=eb(c,this.id))&&(b=c.J[b])&&this.ra(null,a,b))}this.I=this.K=null;this.exports={connect:this.Zb,receiveData:this.Jb}}y(Y);var mf="buffer";h=Y.prototype;
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case mf:return this.J[b]=this.C=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.Jb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Jb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.Da=function(a,b,c,d){this.B=a;this.A=b;this.b=c;this.i=d;var e=this;this.ca=hc(48,4);this.U=Xb(this.b,function(){e.f&128||!e.D.length||(e.R=e.D.shift(),e.f|=128,e.f&64&&fc(e.b,e.ca))});this.da=hc(52,4);this.V=Xb(this.b,function(){e.j|=128;e.j&64&&fc(e.b,e.da)});Ub(b,this,nf);G(this)};
|
||||
h.Zb=function(){if(!this.I){var a=Dc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.Ua)return;b=oa(b[1]);if(this.I=db(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.Db+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Aa=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.za=function(a){return a?this.save():!0};h.reset=function(){of(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return of(this)};function of(a){a.R=0;a.f=0;a.j=128;a.D=[];return!0}h.Jb=function(a){if("number"==typeof a)this.D.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.D.push(a.charCodeAt(b));else this.D=this.D.concat(a);gc(this.b,this.U,1);return!0};h.Mc=function(){return this.f&65535};h.ud=function(a){this.f=this.f&-112|a&111};
|
||||
h.Lc=function(){this.f&=-129;0<this.D.length&&gc(this.b,this.U,1);return this.R};h.td=function(){};h.Zc=function(){return this.j};h.Hd=function(a){128==(this.j&192)&&a&64&&gc(this.b,this.V,1);this.j=this.j&-70|a&69};h.Yc=function(){return 0};
|
||||
h.Gd=function(a){if(a&=255){B(this,"transmitByte("+k(a,2,!0)+")");this.K&&this.K.call(this.I,a);if(this.C)if(13==a)this.H=0;else if(8==a)this.C.value=this.C.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=pa[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=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.C.value+=b;this.C.scrollTop=this.C.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.g(this.G),
|
||||
this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.j&=-129;gc(this.b,this.V,1)}};var pf={},nf=(pf[65392]=[null,null,Y.prototype.Mc,Y.prototype.ud,"RCSR"],pf[65394]=[null,null,Y.prototype.Lc,Y.prototype.td,"RBUF"],pf[65396]=[null,null,Y.prototype.Zc,Y.prototype.Hd,"XCSR"],pf[65398]=[null,null,Y.prototype.Yc,Y.prototype.Gd,"XBUF"],pf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Y(d);fb(d,c)}});
|
||||
function qf(a){r.call(this,"Debugger",a,qf);this.ja=a.base||16;this.va=!1;this.R=this.ua=this.H=0;this.U=!1;this.C=-1;this.j=[];this.ca={}}y(qf);var rf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};qf.prototype.Wb=function(){return-1};qf.prototype.Xb=function(){};
|
||||
function sf(a,b,c,d){if(c)if(b){0>a.C&&a.j.length&&(a.C=0);if(0>a.C||b!=a.j[a.C])a.j.splice(0,0,b),a.C=0;a.C--}else a.U?b="end":b=a.j[a.C+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(oa(b.substring(c,f))),c=f+1}}return a}
|
||||
function tf(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 uf(a,b,c){var d;if(b){b=vf(a,b);for(var e=0,f=!1,g=b,l=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<p.length;){var q=p[e++],w=q.length,q=oa(q);if(!q){f=!0;break}q=wf(a,q,null,!1===c);if(void 0===q){f=!0;c=!1;break}l.push(q);if(e==p.length)break;var q=p[e++],u=q.length;m.length&&rf[q]<rf[m[m.length-1]]&&tf(l,m,1);m.push(q);b=b.substr(w+u)}tf(l,m)&&1==l.length||(f=!0);f?c&&a.g("error parsing '"+g+"' at character "+(g.length-b.length)):(d=l.pop(),c&&xf(a,null,
|
||||
d))}return d}function vf(a,b){for(var c,d=a.ta?"(":"{",e=a.ta?")":"}",f=new RegExp(a.ta?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=uf(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(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.R-a.sa}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||
function wf(a,b,c,d){var e;null!=b?(e=a.Nb(b),0<=e?e=a.Ob(e):(e=a.ba[b],null==e&&(e=aa(b,a.ha))),null!=e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e}
|
||||
function xf(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 l=0;l<f;l++){g&&(g=","+g);var m=d&255,p=8,q="";p?32<p&&(p=32):p=32;if(null==m||isNaN(m))for(;0<p--;)q="?"+q;else for(;0<p--;)q=(m&1?"1":"0")+q,m>>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function yf(a,b){if(b)return xf(a,b,a.ba[b]);var c=0;for(b in a.ba)xf(a,b,a.ba[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.ha){case 8:a=ca(b,3*c);break;case 10:a=b.toString();break;default:a=k(b,2*c)}d&&"0"==a.charAt(0)&&(a=a.replace(/^0+([0-9A-F]+)$/i,"$1"));return a}
|
||||
function zf(a){qf.call(this,a);this.ta=!0;this.K=X(0);this.Ma=X(0);this.T=X(0);this.G=[];this.f=this.M=this.F=[];Af(this);this.la=0;Bf(this);this.va={};Cf(this,a.messages);this.Da=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Ic(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Ic(b,a)})}y(zf,qf);
|
||||
d))}return d}function vf(a,b){for(var c,d=a.va?"(":"{",e=a.va?")":"}",f=new RegExp(a.va?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=uf(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(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.R-a.ua}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
||||
function wf(a,b,c,d){var e;null!=b?(e=a.Wb(b),0<=e?e=a.Xb(e):(e=a.ca[b],null==e&&(e=ba(b,a.ja))),null!=e||d||a.g("invalid "+(c?c:"value")+": "+b)):d||a.g("missing "+(c||"value"));return e}
|
||||
function xf(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 l=0;l<f;l++){g&&(g=","+g);var m=d&255,p=8,q="";p?32<p&&(p=32):p=32;if(null==m||isNaN(m))for(;0<p--;)q="?"+q;else for(;0<p--;)q=(m&1?"1":"0")+q,m>>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function yf(a,b){if(b)return xf(a,b,a.ca[b]);var c=0;for(b in a.ca)xf(a,b,a.ca[b]),c++;return 0<c}
|
||||
function J(a,b,c,d){switch(a.ja){case 8:a=ca(b,3*c);break;case 10:a=b.toString();break;default:a=k(b,2*c)}d&&"0"==a.charAt(0)&&(a=a.replace(/^0+([0-9A-F]+)$/i,"$1"));return a}
|
||||
function zf(a){qf.call(this,a);this.va=!0;this.K=Z(0);this.Oa=Z(0);this.T=Z(0);this.G=[];this.f=this.M=this.D=[];Af(this);this.ma=0;Bf(this);this.xa={};Cf(this,a.messages);this.Fa=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Gc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Gc(b,a)})}y(zf,qf);
|
||||
var Df={"?":"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"},Ef="NONE 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(" "),
|
||||
Ff={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],35072:[107]},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]}};h=zf.prototype;
|
||||
h.Ba=function(a,b,c,d){this.w=b;this.b=c;this.B=a;(a=Fc(a,"messages"))&&Cf(this,a);this.Ua=Ff;Gf(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=Z(Hf(d,c));if(-1===a){d.g("invalid address: "+c);break a}e=a>>>d.w.Y;m=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.g("..."):(c=q.type,p=Rb[c],q&&d.g(k(q.id,8)+" %"+k(e<<d.w.Y,8)+" %%"+k(q.A,8)+" "+k(q.ob,4,
|
||||
!0)+" "+k(q.size,4,!0)+" "+p),c!=rc&&(c=-1),p=0);a+=d.w.ua;e++}}});G(this)};
|
||||
h.pa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ka=this.I[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Ic(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.i.length-1&&(b=d.i[++d.C])):40==a.keyCode&&(0<d.C?b=d.i[--d.C]:(b="",d.C=-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.I[b]=c,Fa(c,function(){if(d.ka){var a=d.ka.value;
|
||||
d.ka.value="";Ic(d,a,!0);return!0}return!1}),!0;case "step":return this.I[b]=c,Fa(c,function(a){var b=!1;hb(d,!0)||(gb(d,!0),b=d.bb(a?1:0),gb(d,!1));return b}),!0}return!1};h.nb=function(){this.ka&&this.ka.focus()};function Z(a){a=a&&a.A;null==a&&(a=-1);return a}h.Pa=function(a,b){var c=255,d=Z(a);-1!==d&&(c=this.w,c.w++,d=c.W[(d&c.i)>>>c.Y].yb(d&c.f,d),c.w--,c=d,b&&If(a,b));return c};h.ja=function(a,b){var c=65535,d=Z(a);-1!==d&&(c=Sb(this.w,d),b&&If(a,b));return c};
|
||||
h.mb=function(a,b,c){var d=Z(a);-1!==d&&(Tb(this.w,d,b),c&&If(a,c),this.B.aa(!0))};h.Ra=function(a,b,c){var d=Z(a);if(-1!==d){var e=this.w,f=d&e.f,g=(d&e.i)>>>e.Y;e.w++;e.W[g].Gb(f,b&65535,d);e.w--;c&&If(a,c);this.B.aa(!0)}};function X(a){return{A:a,wa:!1}}function Jf(a){return[a.A,a.wa]}function Kf(a){return{A:a[0],wa:a[1]}}
|
||||
function Hf(a,b,c){var d;c=(c?a.K:a.Ma).A;if(void 0!==b){d=b=vf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.G.length;c++){var f=a.G[c].za[d];if(void 0!==f){d=f.o;void 0!==d&&(e=X(d));break}}if(d=e)return d;c=uf(a,b,void 0)}null!=c&&(d=X(c));return d}function Lf(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.cc=sf(a,b.Zb=c[2]))}function If(a,b){null!=a.A&&(a.A+=b||1)}
|
||||
function Cf(a,b){a.j=a;a.ia=a.ec=536870912;a.ma=null;a.qa=[];b=sf(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in H){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.ia|=H[c],a.g(c+" messages enabled"))}}function Gf(a,b){for(var c in H)if(64==H[c]){a.va[c]=b;break}}
|
||||
h.Nb=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Mf(a){return 6>a?"R"+a:6==a?"SP":"PC"}h.Ob=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ca[a-8]:20>a?b=this.b.ra[a-16]:20==a&&(b=Db(this.b)));return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+J(this,X(this.b.u[7]).A));this.ia&1073741824?this.qa.push(a):this.ma&&a==this.ma||(this.ma=a,this.ia&-2147483648&&(this.fa(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Oc(a),a.la=0,a.B.aa()))};
|
||||
function Bf(a){var b;if(Jd(a)){if(!a.J||!a.J.length){a.J=Array(1E3);for(b=0;b<a.J.length;b++)a.J[b]=X();a.ea=0;a.g("instruction history buffer allocated")}if(!a.ca||!a.ca.length)for(a.ca=Array(256),b=0;b<a.ca.length;b++)a.ca[b]=[b,0]}else a.J&&a.J.length&&a.g("instruction history buffer freed"),a.ea=0,a.J=[],a.ca=[]}h.ab=function(a){if(!Nf(this))return!1;this.b.ab(a);return!0};
|
||||
h.bb=function(a,b,c){if(!Nf(this))return!1;this.H=0;a||Jd(this)&&Kd(this,this.b.u[7],0);try{a=Pc(this.b,a);var d=this.b.bb(a);0<d&&(Qc(this.b,a),this.H+=d,Mc(this.b,d,!0),Jc(this.b,d),this.R++)}catch(e){"number"!=typeof e&&(this.H=0,kb(this.b,e.stack||e.message))}!1!==c&&this.B.aa();this.aa(b||!1);return 0<this.H};h.fa=function(a){this.b&&this.b.fa(a)};h.aa=function(a){void 0===a&&(a=!0);this.K=X(this.b.u[7]);a&&1!=this.V?Of(this):Pf(this)};
|
||||
function Nf(a){var b;if(b=a.b&&ib(a.b))b=a.b,b.v.ga?b=!0:(b.g(b.toString()+" not powered"),b=!1);return b&&!a.b.v.da?!jb(a.b):!1}h.ya=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};h.xa=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Bf(this);this.R=this.sa=0;this.ma=null;this.H=0;this.K=X(this.b.u[7]);this.v.da=!1;Qf(this);a||this.aa()};
|
||||
h.save=function(){var a=new N(this);a.set(0,Jf(this.K));a.set(1,Jf(this.T));a.set(2,[this.i,this.U,this.ia]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Kf(a[b++]),this.T=Kf(a[b++]),this.i=a[b][0],"string"==typeof this.i&&(this.i=[this.i]),this.U=a[b][1],this.ia|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.g("running");this.v.da=!0;this.hb=a;this.ib=b};
|
||||
h.stop=function(a,b){if(this.v.da){this.v.da=!1;this.H=b-this.ib;if(!this.V){b="stopped";if(this.H){a-=this.hb;var c=0<a?Math.round(1E3*this.H/a):0;b+=" (";Jd(this)&&(b+=this.R+" opcodes, ",this.sa-=this.R,this.R=0);b+=this.H+" cycles, "+a+" ms, "+c+" hz)"}else E(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.g(b)}this.aa(!0);this.nb();Qf(this,this.b.u[7])}};function Jd(a){return 1<a.f.length||!!a.la}
|
||||
function Kd(a,b,c){var d=a.b;if(0<c&&(a.la&&!--a.la||Ac(a,b,1,a.f)))return!0;0<=c&&a.ca.length&&(a.R++,null!=Sb(a.w,b)&&(b=a.J[a.ea],b.A=d.u[7],b.wa=!1,++a.ea==a.J.length&&(a.ea=0)));return!1}function Af(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.w;Bc(d.W[Z(c)>>>d.Y],!1)}a.M=["br"];if(a.F)for(b=1;b<a.F.length;b++)c=a.F[b],d=a.w,Bc(d.W[Z(c)>>>d.Y],!0);a.F=["bw"];a.La=0}
|
||||
h.Na=function(a,b,c){var d=!0;c||Rf(this,a,b,!1,!0);if(a!=this.f){var e=Z(b);if(-1===e)this.g("invalid address: "+J(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.Y].Na(e&f.f,a==this.F)}}d&&(a.push(b),c?b.wa=!0:(Sf(this,a,a.length-1,"set"),Bf(this)));return d};function Rf(a,b,c,d,e){var f=!1;c=Z(c);for(var g=1;g<b.length;g++){var l=b[g];if(c==Z(l)&&(!d||l.wa)){f=!0;l.wa||e||Sf(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Bc(d.W[c>>>d.Y],b==a.F));l.wa||Bf(a);break}}return f}
|
||||
function Tf(a,b){for(var c=1;c<b.length;c++)Sf(a,b,c);return b.length-1}function Sf(a,b,c,d){c=b[c];a.g(b[0]+" "+J(a,c.A)+(d?" "+d:c.Zb?' "'+c.Zb+'"':""))}function Qf(a,b){if(void 0!==b)Ac(a,b,1,a.f,!0),a.V=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.wa){if(!Rf(a,a.f,c,!0))break;b=0}}}
|
||||
function Ac(a,b,c,d,e){var f=!1;if(!a.La++)for(var g=1;!f&&g<d.length;g++){var l=d[g];if(!e||l.wa)for(var m=Z(l),p=0;p<c;p++)if(b+p==m){var q,f=!0;l.wa&&(Rf(a,d,l,!0),e=!0);if(q=l.cc){for(var f=!1,w=0;w<q.length;w++)if(!Uf(a,q[w],!0)){if(q[w].indexOf("if")){f=!0;break}for(var u=w+1;u<q.length&&q[u].indexOf("else");u++)w++;if(u==q.length){f=!0;break}}a.b.v.da||(f=!0)}if(f){e||Sf(a,d,g,"hit");break}}}a.La--;return f}
|
||||
function Vf(a,b,c,d){var e=X(b.A),f=a.ja(b,2),g,l;for(l in a.Ua)if(g=a.Ua[l][f&l])break;g||(g=[0]);for(var m=l="",p=Ef[g[0]],q=g.length-1,w=1;w<=q;w++){var u=g[w];if(void 0!==u){var v;v=a;var C=u,u=b,x="",D=C&61440;if(4096==D)u=u.A+((f&255)<<24>>23)&65535,x=J(v,u);else if(8192==D)u=u.A-((f&63)<<1)&65535,x=J(v,u);else if(12288==D)x=J(v,f&7,1);else if(24576==D)x=J(v,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:x=Mf(C);break;case 8:x="@"+Mf(C);break;case 16:7>C?x="("+Mf(C)+
|
||||
")+":(D=v.ja(u,2),x="#"+J(v,D,0,!0));break;case 24:7>C?x="@("+Mf(C)+")+":(D=v.ja(u,2),x="@#"+J(v,D,0,!0));break;case 32:x="-("+Mf(C)+")";break;case 40:x="@-("+Mf(C)+")";break;case 48:D=v.ja(u,2);x=J(v,D,0,!0)+"("+Mf(C)+")";7==C&&(x=[x,J(v,D+u.A&65535)]);break;case 56:D=v.ja(u,2),x="@"+J(v,D)+"("+Mf(C)+")",7==C&&(x=[x,J(v,D+u.A&65535)])}v=x;if(!v||!v.length){l="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]);0<l.length&&(l+=",");l+=v||"???"}}f="";g=J(a,e.A)+":";if(-1!==e.A&&-1!==b.A){do if(f+=" "+
|
||||
J(a,a.ja(e,2)),null==e.A)break;while(e.A!=b.A)}g+=na(f,24);g+=na(p,5);l&&(g+=" "+l);if(c||m)g=na(g,60)+";"+(c||""),g=a.b.v.Va?g+("cycles="+Kc(a.b).toString()+" cs="+k(a.b.jb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function Wf(a,b){switch(b){case "N":a=a.b.Aa();break;case "Z":a=od(a.b);break;case "V":a=nd(a.b);break;case "C":a=md(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Xf(a,b){var c="",d=a.b;8>b?(c=Mf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ca[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.ra[b-16]):20==b&&(c="PS="+J(a,Db(d)));c&&(c+=" ");return c}function Yf(a){var b,c="";for(b=0;6>b;b++)c+=Xf(a,b);c=c+"\n"+(Xf(a,6)+Xf(a,7)+Xf(a,20));return c+=Wf(a,"T")+Wf(a,"N")+Wf(a,"Z")+Wf(a,"V")+Wf(a,"C")}h.Ib=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function Zf(a,b,c){var d=[],e=Z(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.A>>>0,l=f.lc;if(e>=g&&e<g+l){e=qa(f.Hb,[e-g],a.Ib);0<=e?$f(a,b,e,d):c&&(e=~e,$f(a,b,e-1,d),$f(a,b,e,d));break}}return d}function $f(a,b,c,d){var e={},f=a.G[b].Hb,g=0,l=null;0<=c&&c<f.length&&(g=f[c][0],l=f[c][1]);l&&(e=a.G[b].za[l],l="."==l.charAt(0)?null:e.l||l);d.push(l);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function ag(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return yf(a)||a.g("no variables"),!0;if(!c[2])return yf(a,c[1]);if(!c[3])return delete a.ba[c[1]],!0;b=uf(a,c[3]);return void 0!==b?(a.ba[c[1]]=b,!0):!1}a.g("invalid assignment:"+b);return!1}
|
||||
function bg(a,b,c){var d=null;if(b=Hf(a,b,!0)){var e=Zf(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.A-e[1])&&(g=" + "+k(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.g(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.A)&&(g=" - "+k(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
|
||||
function Of(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.g("missing value for "+b[1]);return}f=uf(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":qd(d,f);a.K=X(d.u[7]);break;case "N":d.S=f?32768:0;break;
|
||||
case "Z":d.X=f?0:1;break;case "V":d.O=f?32768:0;break;case "C":d.N=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.g("unknown register: "+e);return}a.B.aa();a.g("updated registers:")}a.g(Yf(a));c&&(a.K=X(d.u[7]),Pf(a,J(a,a.K.A)))}}function cg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.g(c[2]):xf(a,null,c[2].charCodeAt(0)):uf(a,b,!0)}
|
||||
function dg(a,b,c){var d="t"!=b;c=wf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ea(c,function(){return gb(a,!0)&&a.bb(e,d,!1)},function(){a.B.aa();gb(a,!1)})}
|
||||
function Pf(a,b,c,d){if(b=Hf(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Hf(a,c,!0);if(!d||d.A<b.A)return;e=d.A-b.A;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=hb(a,!1)||a.V?a.H:null;var g=null!=f?"cycles":null,l=Zf(a,b),m=b.A;if(l[0]&&d&&(!c&&d||0>l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.g(p)}l[3]&&(g=l[3],f=null);f=Vf(a,b,g,f);a.g(f);a.K=b;e-=b.A-m;c++}}}
|
||||
function Uf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.U&&(a.g("ended assemble at "+J(a,a.T.A)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ma=null;if(ib(a)&&0<b.length){a.U&&(b="a "+J(a,a.T.A)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var l=g[0],m=l.charAt(0),p=1;p<l.length;p++){var q=l.charAt(p);if("?"==m||"r"==m||"a">q||"z"<q){g[0]=l.substr(p);g.unshift(l.substr(0,p));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var w=
|
||||
Hf(a,g[1],!0);if(w)if(a.T=w,void 0===g[2])a.g("begin assemble at "+J(a,w.A)),a.U=!0,a.B.aa();else{var u;a.g("not supported yet");u=[];if(u.length){for(var v=0;v<u.length;v++)a.mb(w,u[v],1);a.g(Vf(a,a.T))}}break;case "b":a:{var C=g[0],x=g[1],D=b;if("?"==x)a.g("breakpoint commands:"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),a.g("\tbc [a]\tclear breakpoint at addr [a]"),a.g("\tbl\tlist all breakpoints"),
|
||||
a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var ya=C.charAt(1);if("l"==ya){var Rc;Rc=0+Tf(a,a.f);Rc+=Tf(a,a.M);(Rc+=Tf(a,a.F))||a.g("no breakpoints")}else if("n"==ya)a.la=wf(a,x),a.g("break after "+a.la+" instruction(s)");else if(void 0===x)a.g("missing breakpoint address");else{var U=X();if("*"!=x&&(U=Hf(a,x,!0),!U))break a;"c"==ya?null==U.A?(Af(a),a.g("all breakpoints cleared")):Rf(a,a.f,U)||Rf(a,a.M,U)||Rf(a,a.F,U)||a.g("breakpoint missing: "+J(a,U.A)):null!=U.A&&(Lf(a,U,D),"p"==ya?a.Na(a.f,
|
||||
U):"r"==ya?a.Na(a.M,U):"w"==ya?a.Na(a.F,U):a.g("unknown breakpoint command: "+ya))}}}break;case "c":a.Oa&&(a.Oa.value="");break;case "d":a:{var Pa,Qa=g[0],ha=g[1],za=g[2],wg=g[3];if("?"==ha){var Ra="";for(Pa in H)a.va[Pa]&&(Ra&&(Ra+=","),Ra+=Pa);Ra+=",state,symbols";a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");Ra.length&&
|
||||
a.g("dump extension commands:\n\t"+Ra)}else if("state"==ha){var Ae=eg(a.B,!0);"console"==za?console.log(Ae):(a.Oa&&(a.Oa.value=""),a.g(Ae))}else if("symbols"==ha)for(var Sc=0;Sc<a.G.length;Sc++){var Tc=a.G[Sc],Sa;for(Sa in Tc.za)if("."!=Sa.charAt(0)){var Be=Tc.za[Sa].o;if(void 0!==Be){var Ce=Tc.za[Sa].l;Ce&&(Sa=Ce);a.g(J(a,Be)+" "+Sa)}}}else{if("d"==Qa){for(Pa in H)if(g[1]==Pa){var De=a.va[Pa];De?(g.shift(),g.shift(),De(g)):a.g("no dump registered for "+ha);break a}ha||(Qa=a.qb||"db")}else a.qb=Qa;
|
||||
if("dh"==Qa){var Ee=ha,Fe=za,Ge="",He=0,ba=a.ea,ia=a.J;if(ia.length){var Y=+Ee||a.Ta,nb=+Fe||10;isNaN(Y)?Y=nb:Ge="more ";Y>ia.length&&(a.g("note: only "+ia.length+" available"),Y=ia.length);ba-=Y;0>ba&&(null==ia[ia.length-1].A?(Y=ba+Y,ba=0):ba+=ia.length);var Uc=[];"call"==Fe&&(nb=1E5,Uc=["CALL"]);for(void 0!==Ee&&a.g(Y+" instructions earlier:");0<nb&&ba!=a.ea;){var Ie=ia[ba++];if(null==Ie.A)break;var ob=X(Ie.A),xg=Y--,Je=Vf(a,ob,"history",xg);(!Uc.length||0<=Je.indexOf(Uc[0]))&&a.g(Je);ob.xb&&(ba+=
|
||||
ob.xb,nb-=ob.xb,Y-=ob.xb);ba>=ia.length&&(ba=0);a.Ta=Y;He++;nb--}}He||(a.g("no "+Ge+"history available"),a.Ta=void 0)}else{var pb=Hf(a,ha);if(pb){var Yb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),Yb=wf(a,za)>>>0,65536<Yb&&(Yb=65536));for(var qb="",Ta="dd"==Qa?4:"dw"==Qa?2:1,Zb=Ta*Yb||128,yg=Zb+15>>4||1;yg--&&0<Zb;){var $b=0,rb=0,sb,Vc="",Ke="",ha=J(a,pb.A);for(sb=4==Ta?16:a.ha;0<sb&&0<Zb;sb--){var Wc,ac=2==Ta?a.ja(pb,Wc=2):a.Pa(pb,Wc=1),$b=$b|ac<<(rb<<3),rb=rb+Wc;rb==Ta&&(Vc+=J(a,$b,Ta),Vc+=
|
||||
1==Ta?9==sb?"-":" ":" ",$b=rb=0);Ke+=32<=ac&&128>ac?String.fromCharCode(ac):".";Zb--}qb&&(qb+="\n");qb+=ha+" "+Vc+(0==sb?" "+Ke:"")}qb&&a.g(qb);a.Ma=pb}}}}break;case "e":if("else"==g[0])break;var Ua,Xc,Yc,Zc,$c=g[0],ad=g[1];"eb"==$c?(Ua=1,Xc=255,Yc=a.Pa,Zc=a.mb):"e"==$c||"ew"==$c?(Ua=2,Xc=65535,Yc=a.ja,Zc=a.Ra):ad=null;if(null==ad)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var bc=Hf(a,ad);if(bc)for(var cc=2;cc<
|
||||
g.length;cc++){var tb=uf(a,g[cc]);if(void 0===tb){a.g("unrecognized value: "+g[cc]);break}tb&~Xc&&a.g("warning: "+k(tb)+" exceeds "+Ua+"-byte value");var zg=Yc.call(a,bc);a.g("changing "+J(a,bc.A)+" from "+J(a,zg,Ua)+" to "+J(a,tb,Ua));Zc.call(a,bc,tb,Ua)}}break;case "g":a:{var Le=g[1],Ag=b;if(void 0!==Le){var bd=Hf(a,Le,!0);if(!bd)break a;Lf(a,bd,Ag);a.Na(a.f,bd,!0)}a.ab(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;case "h":a.v.da?(c||a.g("halting"),a.fa()):hb(a,!0)||c||a.g("already halted");
|
||||
break;case "i":if("if"==g[0]){var cd;var ub=b.substr(2),ub=oa(ub);uf(a,ub)?(c||a.g("true: "+ub),cd=!0):(c||a.g("false: "+ub),cd=!1);cd||(d=!1);break}f=!0;break;case "k":var Bg=g[0];if("?"==g[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var dd=0,ed=X(),vb=X(a.b.u[6]);for(a.g("stack trace for "+J(a,vb.A));10>dd;){for(var Aa=null,Cg=256;65536>vb.A>>>0;){ed.A=a.ja(vb,2);if(null==vb.A||!Cg--)break;if(!(ed.A&1)){for(var Dg=a,dc=ed,Me=null,wb=
|
||||
dc.A,Ne=wb,fd=1;6>=fd&&wb;fd++){if(2<fd){dc.A=wb;var ec=Vf(Dg,dc);if(0<=ec.indexOf("JSR")){var Oe=ec.indexOf(" ");if(wb+(ec.indexOf(" ",Oe+1)-Oe-1)/2==Ne){Me=ec;break}}}wb-=2}dc.A=Ne;if(Aa=Me)break}}if(!Aa||null==Aa)break;var Pe=null;if("ks"==Bg){var Qe=Aa.match(/[0-9A-F]+$/);Qe&&(Pe=bg(a,Qe[0]))}Aa=na(Aa,50)+" ;"+(Pe||"stack="+J(a,vb.A));a.g(Aa);dd++}dd||a.g("no return addresses found")}break;case "l":if("ln"==g[0]){bg(a,g[1],!0);break}f=!0;break;case "m":a:{var ja,ka=null,F=g[1];"?"==F&&(F=void 0);
|
||||
if(void 0!==F){var sa=0;if("all"==F)sa=1878917119,F=null;else if("on"==F)ka=!0,F=null;else if("off"==F)ka=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ja in H)if(F==ja){sa=H[ja];ka=!!(a.ia&sa);break}if(!sa){a.g("unknown message category: "+F);break a}}if(sa)if("on"==g[2])a.ia|=sa,ka=!0;else if("off"==g[2]&&(a.ia&=~sa,ka=!1,1073741824==sa)){for(var gd=0;gd<a.qa.length;gd++)a.g(a.qa[gd]);a.qa=[]}}var Eg=0,xb="";for(ja in H)if(!F||F==ja){var Fg=!!(a.ia&H[ja]);if(null===ka||ka==Fg)xb&&
|
||||
(xb+=","),++Eg%10||(xb+="\n\t"),"key"==ja&&(ja="keys"),xb+=ja}void 0===F&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==ka?ka?"messages on: ":"messages off: ":"message categories:\n\t")+(xb||"none"));Bf(a)}break;case "p":if("print"==g[0]){cg(a,b.substr(5));break}var Gg="pr"==g[0]?1:0;if(a.V)a.g("step in progress");else{var Re=X(a.b.u[7]);a.Pa(Re);a.V?(a.Na(a.f,Re,!0),a.ab()||(a.B&&a.B.nb(),a.V=0)):dg(a,Gg?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();
|
||||
break}Of(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var yb=+g[2];if(8==yb||10==yb||16==yb)a.ha=yb;else{a.g("invalid base: "+yb);break}}a.g("default base: "+a.ha);break;case "cs":var zb;void 0!==g[3]&&(zb=+g[3]);switch(g[2]){case "int":a.b.Wa=zb;break;case "start":a.b.kb=zb;break;case "stop":a.b.Xa=zb;break;default:a.g("unknown cs option");break a}void 0!==zb&&Hc(a.b);a.g("checksums "+(a.b.v.Va?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Lc(a.b,+g[2])||a.g("warning: using 1x multiplier, previous target not reached"));
|
||||
a.g("target speed: "+(a.b.Qa.toFixed(2)+"Mhz")+" ("+a.b.Ha+"x)");break;default:if(g[1]){a.g("unknown option: "+g[1]);break}case "?":a.g("debugger options:"),a.g("\tbase #\t\tset default base to #"),a.g("\tcs int #\tset checksum cycle interval to #"),a.g("\tcs start #\tset checksum cycle start count to #"),a.g("\tcs stop #\tset checksum cycle stop count to #"),a.g("\tsp #\t\tset speed multiplier to #")}break;case "t":dg(a,g[0],g[1]);break;case "u":Pf(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ag(a,
|
||||
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.g("PDPjs version 1.30.1 ("+a.b.Tb+",RELEASE"+(lb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){cg(a,b.substr(1));break}var hd="commands:",id;for(id in Df)hd+="\n"+na(id,9)+Df[id];Jd(a)||(hd+="\nnote: history disabled if no exec breakpoints");a.g(hd);break;default:f=!0}f&&(a.g("unknown command: "+b),d=!1)}}catch(Se){a.g("debugger error: "+(Se.stack||Se.message)),d=!1}return d}
|
||||
function Ic(a,b,c){b=sf(a,b,c);for(var d in b)if(!Uf(a,b[+d]))return!1;return!0}La(function(){for(var a=A(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zf(d);fb(d,c)}});
|
||||
function fg(a,b,c){r.call(this,"Computer",a,fg,67108864);this.v.ga=!1;gg(this,b);this.M=Fc(this,"autoPower",a);this.B=0;this.ba=a.busWidth||a.buswidth;this.f=hg;this.J=null;this.G=this.U=!1;this.ca=Fc(this,"url")||"";(Math.random()+.1).toString(36);this.i=ig(this);if(this.b=eb("CPU",this.id)){this.j=eb("Debugger",this.id);this.w=new Eb({id:this.vb+".bus",busWidth:this.ba},this.b,this.j);var d,e=cb(this.id);if((this.C=eb("Panel",this.id))&&this.C.Oa)for(b=0;b<e.length;b++)d=e[b],d.na=this.C.na,d.g=
|
||||
this.C.g,d.Oa=this.C.Oa;this.g("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.g("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.Ba&&d.Ba(this,this.w,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=Fc(this,"state")||(f=!0,a.state))b=this.R=a,f||(this.G=!0,this.f=hg),this.f&&
|
||||
(this.K=new N(this,"1.30.1"),jg(this.K)?b=null:delete this.K);!b&&this.f&&(b=kg(this))&&(this.G=!0);if(b){var g=this;ua(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.na("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.J=b,g.U=!0);G(g)})}else G(this);this.I.power||(this.M=!0);!c&&this.M&&lg(this,this.lb)}else n("Unable to find CPU component")}y(fg);var hg=0;
|
||||
function gg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){n(d.message+" ("+c+")")}}a.V=b}function Fc(a,b,c){var d=b.toLowerCase(),d=Wa[b]||Wa[d];void 0===d&&a.V&&(d=a.V[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function lg(a,b,c){for(var d=cb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ib(f)){ib(f,function(){lg(a,b,c)});return}}b.call(a,c)}
|
||||
h.Da=function(a,b,c,d){this.A=b;this.b=c;this.B=a;(a=Dc(a,"messages"))&&Cf(this,a);this.Wa=Ff;Gf(this,function(a){a:{var b=d.A.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(Hf(d,c));if(-1===a){d.g("invalid address: "+c);break a}e=a>>>d.A.Z;m=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.g("..."):(c=q.type,p=Rb[c],q&&d.g(k(q.id,8)+" %"+k(e<<d.A.Z,8)+" %%"+k(q.w,8)+" "+k(q.rb,
|
||||
4,!0)+" "+k(q.size,4,!0)+" "+p),c!=pc&&(c=-1),p=0);a+=d.A.wa;e++}}});G(this)};
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case "debugInput":return this.la=this.J[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Gc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.C<d.j.length-1&&(b=d.j[++d.C])):40==a.keyCode&&(0<d.C?b=d.j[--d.C]:(b="",d.C=-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.J[b]=c,Fa(c,function(){if(d.la){var a=d.la.value;
|
||||
d.la.value="";Gc(d,a,!0);return!0}return!1}),!0;case "step":return this.J[b]=c,Fa(c,function(a){var b=!1;hb(d,!0)||(gb(d,!0),b=d.eb(a?1:0),gb(d,!1));return b}),!0}return!1};h.qb=function(){this.la&&this.la.focus()};h.Y=function(a){a=a&&a.w;null==a&&(a=-1);return a};h.kb=function(a,b){var c=255,d=this.Y(a,!1,1);-1!==d&&(c=a.tb?this.A.xb(d):this.b.xb(d),b&&If(a,b));return c};h.ka=function(a,b){var c=65535,d=this.Y(a,!1,2);-1!==d&&(c=a.tb?this.A.lb(d):this.b.lb(d),b&&If(a,b));return c};
|
||||
h.Ab=function(a,b,c){var d=this.Y(a,!0,1);-1!==d&&(a.tb?this.A.pb(d,b):this.b.pb(d,b),c&&If(a,c),this.B.ba(!0))};h.Sa=function(a,b,c){var d=this.Y(a,!0,2);-1!==d&&(a.tb?this.A.Bb(d,b):this.b.Bb(d,b),c&&If(a,c),this.B.ba(!0))};function Z(a,b){return{w:a,tb:b,ya:!1}}function Jf(a){return[a.w,a.ya]}function Kf(a){return{w:a[0],ya:a[1]}}
|
||||
function Hf(a,b,c){var d,e=(c?a.K:a.Oa).w;c=!1;if(void 0!==b){b=vf(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.G.length;e++){var g=a.G[e].Ba[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=uf(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function Lf(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.hc=sf(a,b.dc=c[2]))}function If(a,b){null!=a.w&&(a.w+=b||1)}
|
||||
function Cf(a,b){a.i=a;a.ia=a.jc=536870912;a.oa=null;a.ta=[];b=sf(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in H){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.ia|=H[c],a.g(c+" messages enabled"))}}function Gf(a,b){for(var c in H)if(64==H[c]){a.xa[c]=b;break}}
|
||||
h.Wb=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Mf(a){return 6>a?"R"+a:6==a?"SP":"PC"}h.Xb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.sa[a-16]:20==a&&(b=Db(this.b)));return b};
|
||||
h.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.u[7]).w));this.ia&1073741824?this.ta.push(a):this.oa&&a==this.oa||(this.oa=a,this.ia&-2147483648&&(this.ga(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,Mc(a),a.la=0,a.B.ba()))};
|
||||
function Bf(a){var b;if(Jd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b<a.I.length;b++)a.I[b]=Z();a.fa=0;a.g("instruction history buffer allocated")}if(!a.da||!a.da.length)for(a.da=Array(256),b=0;b<a.da.length;b++)a.da[b]=[b,0]}else a.I&&a.I.length&&a.g("instruction history buffer freed"),a.fa=0,a.I=[],a.da=[]}h.cb=function(a,b){if(!Nf(this,b))return!1;this.b.cb(a);return!0};
|
||||
h.eb=function(a,b,c){if(!Nf(this))return!1;this.H=0;a||Jd(this)&&Kd(this,this.b.u[7],0);try{a=Nc(this.b,a);var d=this.b.eb(a);0<d&&(Oc(this.b,a),this.H+=d,Kc(this.b,d,!0),Hc(this.b,d),this.R++)}catch(e){"number"!=typeof e&&(this.H=0,kb(this.b,e.stack||e.message))}!1!==c&&this.B.ba();this.ba(b||!1);return 0<this.H};h.ga=function(a){this.b&&this.b.ga(a)};h.ba=function(a){void 0===a&&(a=!0);this.K=Z(this.b.u[7]);a&&1!=this.V?Of(this):Pf(this)};
|
||||
function Nf(a,b){var c;(c=!a.b||!ib(a.b))||(c=a.b,c.v.ha?c=!0:(c.g(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.v.ea?(b||a.g("cpu busy or unavailable, command ignored"),!1):!jb(a.b)}h.Aa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};h.za=function(a,b){b&&this.g(a?"suspending":"shutting down");return a?this.save():!0};h.reset=function(a){Bf(this);this.R=this.ua=0;this.oa=null;this.H=0;this.K=Z(this.b.u[7]);this.v.ea=!1;Qf(this);a||this.ba()};
|
||||
h.save=function(){var a=new N(this);a.set(0,Jf(this.K));a.set(1,Jf(this.T));a.set(2,[this.j,this.U,this.ia]);a.set(3,this.G);return a.data()};h.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Kf(a[b++]),this.T=Kf(a[b++]),this.j=a[b][0],"string"==typeof this.j&&(this.j=[this.j]),this.U=a[b][1],this.ia|=a[b][2]);a[3]&&(this.G=a[3]);return!0};h.start=function(a,b){this.V||this.g("running");this.v.ea=!0;this.jb=a;this.ub=b};
|
||||
h.stop=function(a,b){if(this.v.ea){this.v.ea=!1;this.H=b-this.ub;if(!this.V){b="stopped";if(this.H){a-=this.jb;var c=0<a?Math.round(1E3*this.H/a):0;b+=" (";Jd(this)&&(b+=this.R+" opcodes, ",this.ua-=this.R,this.R=0);b+=this.H+" cycles, "+a+" ms, "+c+" hz)"}else E(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.g(b)}this.ba(!0);this.qb();Qf(this,this.b.u[7])}};function Jd(a){return 1<a.f.length||!!a.ma}
|
||||
function Kd(a,b,c){var d=a.b;if(0<c&&(a.ma&&!--a.ma||yc(a,b,1,a.f)))return!0;0<=c&&a.da.length&&(a.R++,null!=a.b.lb(b)&&(b=a.I[a.fa],b.w=d.u[7],b.ya=!1,++a.fa==a.I.length&&(a.fa=0)));return!1}function Af(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.A;c=a.Y(c);zc(d.W[c>>>d.Z],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.A,c=a.Y(c),zc(d.W[c>>>d.Z],!0);a.D=["bw"];a.Ta=0}
|
||||
h.Pa=function(a,b,c){var d=!0;c||Rf(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.g("invalid address: "+J(this,b.w)),d=!1;else{var f=this.A;f.W[e>>>f.Z].Pa(e&f.A,a==this.D)}}d&&(a.push(b),c?b.ya=!0:(Sf(this,a,a.length-1,"set"),Bf(this)));return d};function Rf(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g<b.length;g++){var l=b[g];if(c==a.Y(l)&&(!d||l.ya)){f=!0;l.ya||e||Sf(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.A,zc(d.W[c>>>d.Z],b==a.D));l.ya||Bf(a);break}}return f}
|
||||
function Tf(a,b){for(var c=1;c<b.length;c++)Sf(a,b,c);return b.length-1}function Sf(a,b,c,d){c=b[c];a.g(b[0]+" "+J(a,c.w)+(d?" "+d:c.dc?' "'+c.dc+'"':""))}function Qf(a,b){if(void 0!==b)yc(a,b,1,a.f,!0),a.V=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.ya){if(!Rf(a,a.f,c,!0))break;b=0}}}
|
||||
function yc(a,b,c,d,e){var f=!1;if(!a.Ta++)for(var g=1;!f&&g<d.length;g++){var l=d[g];if(!e||l.ya)for(var m=a.Y(l),p=0;p<c;p++)if(b+p==m){var q,f=!0;l.ya&&(Rf(a,d,l,!0),e=!0);if(q=l.hc){for(var f=!1,w=0;w<q.length;w++)if(!Uf(a,q[w],!0)){if(q[w].indexOf("if")){f=!0;break}for(var u=w+1;u<q.length&&q[u].indexOf("else");u++)w++;if(u==q.length){f=!0;break}}a.b.v.ea||(f=!0)}if(f){e||Sf(a,d,g,"hit");break}}}a.Ta--;return f}
|
||||
function Vf(a,b,c,d){var e=Z(b.w),f=a.ka(b,2),g,l;for(l in a.Wa)if(g=a.Wa[l][f&l])break;g||(g=[0]);for(var m=l="",p=Ef[g[0]],q=g.length-1,w=1;w<=q;w++){var u=g[w];if(void 0!==u){var v;v=a;var C=u,u=b,x="",D=C&61440;if(4096==D)u=u.w+((f&255)<<24>>23)&65535,x=J(v,u);else if(8192==D)u=u.w-((f&63)<<1)&65535,x=J(v,u);else if(12288==D)x=J(v,f&7,1);else if(24576==D)x=J(v,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:x=Mf(C);break;case 8:x="@"+Mf(C);break;case 16:7>C?x="("+Mf(C)+
|
||||
")+":(D=v.ka(u,2),x="#"+J(v,D,0,!0));break;case 24:7>C?x="@("+Mf(C)+")+":(D=v.ka(u,2),x="@#"+J(v,D,0,!0));break;case 32:x="-("+Mf(C)+")";break;case 40:x="@-("+Mf(C)+")";break;case 48:D=v.ka(u,2);x=J(v,D,0,!0)+"("+Mf(C)+")";7==C&&(x=[x,J(v,D+u.w&65535)]);break;case 56:D=v.ka(u,2),x="@"+J(v,D)+"("+Mf(C)+")",7==C&&(x=[x,J(v,D+u.w&65535)])}v=x;if(!v||!v.length){l="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]);0<l.length&&(l+=",");l+=v||"???"}}f="";g=J(a,e.w)+":";if(-1!==e.w&&-1!==b.w){do if(f+=" "+
|
||||
J(a,a.ka(e,2)),null==e.w)break;while(e.w!=b.w)}g+=na(f,24);g+=na(p,5);l&&(g+=" "+l);if(c||m)g=na(g,60)+";"+(c||""),g=a.b.v.Xa?g+("cycles="+Ic(a.b).toString()+" cs="+k(a.b.mb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function Wf(a,b){switch(b){case "N":a=a.b.Ca();break;case "Z":a=md(a.b);break;case "V":a=ld(a.b);break;case "C":a=O(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
||||
function Xf(a,b){var c="",d=a.b;8>b?(c=Mf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.sa[b-16]):20==b&&(c="PS="+J(a,Db(d)));c&&(c+=" ");return c}function Yf(a){var b,c="";for(b=0;6>b;b++)c+=Xf(a,b);c=c+"\n"+(Xf(a,6)+Xf(a,7)+Xf(a,20));return c+=Wf(a,"T")+Wf(a,"N")+Wf(a,"Z")+Wf(a,"V")+Wf(a,"C")}h.Rb=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function Zf(a,b,c){var d=[],e=a.Y(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.w>>>0,l=f.sc;if(e>=g&&e<g+l){e=qa(f.Qb,[e-g],a.Rb);0<=e?$f(a,b,e,d):c&&(e=~e,$f(a,b,e-1,d),$f(a,b,e,d));break}}return d}function $f(a,b,c,d){var e={},f=a.G[b].Qb,g=0,l=null;0<=c&&c<f.length&&(g=f[c][0],l=f[c][1]);l&&(e=a.G[b].Ba[l],l="."==l.charAt(0)?null:e.l||l);d.push(l);d.push(g);d.push(e.a);d.push(e.c)}
|
||||
function ag(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return yf(a)||a.g("no variables"),!0;if(!c[2])return yf(a,c[1]);if(!c[3])return delete a.ca[c[1]],!0;b=uf(a,c[3]);return void 0!==b?(a.ca[c[1]]=b,!0):!1}a.g("invalid assignment:"+b);return!1}
|
||||
function bg(a,b,c){var d=null;if(b=Hf(a,b,!0)){a.Y(b);var e=Zf(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.w-e[1])&&(g=" + "+k(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.g(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.w)&&(g=" - "+k(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.g(f),d||(d=f))}else c&&a.g("no symbols")}return d}
|
||||
function Of(a,b){var c;if(b&&"?"==b[1])a.g("register commands:"),a.g("\tr\tdump registers"),a.g("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.g("missing value for "+b[1]);return}f=uf(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":od(d,f);a.K=Z(d.u[7]);break;case "N":d.S=f?32768:0;break;
|
||||
case "Z":d.X=f?0:1;break;case "V":d.O=f?32768:0;break;case "C":d.N=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.g("unknown register: "+e);return}a.B.ba();a.g("updated registers:")}a.g(Yf(a));c&&(a.K=Z(d.u[7]),Pf(a,J(a,a.K.w)))}}function cg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.g(c[2]):xf(a,null,c[2].charCodeAt(0)):uf(a,b,!0)}
|
||||
function dg(a,b,c){var d="t"!=b;c=wf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ea(c,function(){return gb(a,!0)&&a.eb(e,d,!1)},function(){a.B.ba();gb(a,!1)})}
|
||||
function Pf(a,b,c,d){if(b=Hf(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Hf(a,c,!0);if(!d||d.w<b.w)return;e=d.w-b.w;if(256<e){a.g("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=hb(a,!1)||a.V?a.H:null;var g=null!=f?"cycles":null,l=Zf(a,b),m=b.w;if(l[0]&&d&&(!c&&d||0>l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.g(p)}l[3]&&(g=l[3],f=null);f=Vf(a,b,g,f);a.g(f);a.K=b;e-=b.w-m;c++}}}
|
||||
function Uf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.U&&(a.g("ended assemble at "+J(a,a.T.w)),a.K=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.oa=null;if(ib(a)&&0<b.length){a.U&&(b="a "+J(a,a.T.w)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var l=g[0],m=l.charAt(0),p=1;p<l.length;p++){var q=l.charAt(p);if("?"==m||"r"==m||"a">q||"z"<q){g[0]=l.substr(p);g.unshift(l.substr(0,p));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var w=
|
||||
Hf(a,g[1],!0);if(w)if(a.T=w,void 0===g[2])a.g("begin assemble at "+J(a,w.w)),a.U=!0,a.B.ba();else{var u;a.g("not supported yet");u=[];if(u.length){for(var v=0;v<u.length;v++)a.Ab(w,u[v],1);a.g(Vf(a,a.T))}}break;case "b":a:{var C=g[0],x=g[1],D=b;if("?"==x)a.g("breakpoint commands:"),a.g("\tbp [a]\tset exec breakpoint at addr [a]"),a.g("\tbr [a]\tset read breakpoint at addr [a]"),a.g("\tbw [a]\tset write breakpoint at addr [a]"),a.g("\tbc [a]\tclear breakpoint at addr [a]"),a.g("\tbl\tlist all breakpoints"),
|
||||
a.g("\tbn [n]\tbreak after [n] instruction(s)");else{var ya=C.charAt(1);if("l"==ya){var Rc;Rc=0+Tf(a,a.f);Rc+=Tf(a,a.M);(Rc+=Tf(a,a.D))||a.g("no breakpoints")}else if("n"==ya)a.ma=wf(a,x),a.g("break after "+a.ma+" instruction(s)");else if(void 0===x)a.g("missing breakpoint address");else{var T=Z();if("*"!=x&&(T=Hf(a,x,!0),!T))break a;"c"==ya?null==T.w?(Af(a),a.g("all breakpoints cleared")):Rf(a,a.f,T)||Rf(a,a.M,T)||Rf(a,a.D,T)||a.g("breakpoint missing: "+J(a,T.w)):null!=T.w&&(Lf(a,T,D),"p"==ya?a.Pa(a.f,
|
||||
T):"r"==ya?a.Pa(a.M,T):"w"==ya?a.Pa(a.D,T):a.g("unknown breakpoint command: "+ya))}}}break;case "c":a.Qa&&(a.Qa.value="");break;case "d":a:{var Pa,Qa=g[0],ga=g[1],za=g[2],wg=g[3];if("?"==ga){var Ra="";for(Pa in H)a.xa[Pa]&&(Ra&&(Ra+=","),Ra+=Pa);Ra+=",state,symbols";a.g("dump memory commands:");a.g("\tdb [a] [#] dump # bytes at address a");a.g("\tdw [a] [#] dump # words at address a");a.g("\tdd [a] [#] dump # dwords at address a");a.g("\tdh [#] [#] dump # instructions from history");Ra.length&&
|
||||
a.g("dump extension commands:\n\t"+Ra)}else if("state"==ga){var Ae=eg(a.B,!0);"console"==za?console.log(Ae):(a.Qa&&(a.Qa.value=""),a.g(Ae))}else if("symbols"==ga)for(var Sc=0;Sc<a.G.length;Sc++){var Tc=a.G[Sc],Sa;for(Sa in Tc.Ba)if("."!=Sa.charAt(0)){var Be=Tc.Ba[Sa].o;if(void 0!==Be){var Ce=Tc.Ba[Sa].l;Ce&&(Sa=Ce);a.g(J(a,Be)+" "+Sa)}}}else{if("d"==Qa){for(Pa in H)if(g[1]==Pa){var De=a.xa[Pa];De?(g.shift(),g.shift(),De(g)):a.g("no dump registered for "+ga);break a}ga||(Qa=a.wb||"db")}else a.wb=Qa;
|
||||
if("dh"==Qa){var Ee=ga,Fe=za,Ge="",He=0,aa=a.fa,ha=a.I;if(ha.length){var X=+Ee||a.Va,nb=+Fe||10;isNaN(X)?X=nb:Ge="more ";X>ha.length&&(a.g("note: only "+ha.length+" available"),X=ha.length);aa-=X;0>aa&&(null==ha[ha.length-1].w?(X=aa+X,aa=0):aa+=ha.length);var Uc=[];"call"==Fe&&(nb=1E5,Uc=["CALL"]);for(void 0!==Ee&&a.g(X+" instructions earlier:");0<nb&&aa!=a.fa;){var Ie=ha[aa++];if(null==Ie.w)break;var ob=Z(Ie.w),xg=X--,Je=Vf(a,ob,"history",xg);(!Uc.length||0<=Je.indexOf(Uc[0]))&&a.g(Je);ob.Fb&&(aa+=
|
||||
ob.Fb,nb-=ob.Fb,X-=ob.Fb);aa>=ha.length&&(aa=0);a.Va=X;He++;nb--}}He||(a.g("no "+Ge+"history available"),a.Va=void 0)}else{var pb=Hf(a,ga);if(pb){var Yb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),Yb=wf(a,za)>>>0,65536<Yb&&(Yb=65536));for(var qb="",Ta="dd"==Qa?4:"dw"==Qa?2:1,Zb=Ta*Yb||128,yg=Zb+15>>4||1;yg--&&0<Zb;){var $b=0,rb=0,sb,Vc="",Ke="",ga=J(a,pb.w);for(sb=4==Ta?16:a.ja;0<sb&&0<Zb;sb--){var Wc,ac=2==Ta?a.ka(pb,Wc=2):a.kb(pb,Wc=1),$b=$b|ac<<(rb<<3),rb=rb+Wc;rb==Ta&&(Vc+=J(a,$b,Ta),Vc+=
|
||||
1==Ta?9==sb?"-":" ":" ",$b=rb=0);Ke+=32<=ac&&128>ac?String.fromCharCode(ac):".";Zb--}qb&&(qb+="\n");qb+=ga+" "+Vc+(0==sb?" "+Ke:"")}qb&&a.g(qb);a.Oa=pb}}}}break;case "e":if("else"==g[0])break;var Ua,Xc,Yc,Zc,$c=g[0],ad=g[1];"eb"==$c?(Ua=1,Xc=255,Yc=a.kb,Zc=a.Ab):"e"==$c||"ew"==$c?(Ua=2,Xc=65535,Yc=a.ka,Zc=a.Sa):ad=null;if(null==ad)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var bc=Hf(a,ad);if(bc)for(var cc=2;cc<
|
||||
g.length;cc++){var tb=uf(a,g[cc]);if(void 0===tb){a.g("unrecognized value: "+g[cc]);break}tb&~Xc&&a.g("warning: "+k(tb)+" exceeds "+Ua+"-byte value");var zg=Yc.call(a,bc);a.g("changing "+J(a,bc.w)+" from "+J(a,zg,Ua)+" to "+J(a,tb,Ua));Zc.call(a,bc,tb,Ua)}}break;case "g":a:{var Le=g[1],Ag=b;if(void 0!==Le){var bd=Hf(a,Le,!0);if(!bd)break a;Lf(a,bd,Ag);a.Pa(a.f,bd,!0)}a.cb(!0,c)}break;case "h":a.v.ea?(c||a.g("halting"),a.ga()):hb(a,!0)||c||a.g("already halted");break;case "i":if("if"==g[0]){var cd;
|
||||
var ub=b.substr(2),ub=oa(ub);uf(a,ub)?(c||a.g("true: "+ub),cd=!0):(c||a.g("false: "+ub),cd=!1);cd||(d=!1);break}f=!0;break;case "k":var Bg=g[0];if("?"==g[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var dd=0,ed=Z(),vb=Z(a.b.u[6]);for(a.g("stack trace for "+J(a,vb.w));10>dd;){for(var Aa=null,Cg=256;65536>vb.w>>>0;){ed.w=a.ka(vb,2);if(null==vb.w||!Cg--)break;if(!(ed.w&1)){for(var Dg=a,dc=ed,Me=null,wb=dc.w,Ne=wb,fd=1;6>=fd&&wb;fd++){if(2<
|
||||
fd){dc.w=wb;var ec=Vf(Dg,dc);if(0<=ec.indexOf("JSR")){var Oe=ec.indexOf(" ");if(wb+(ec.indexOf(" ",Oe+1)-Oe-1)/2==Ne){Me=ec;break}}}wb-=2}dc.w=Ne;if(Aa=Me)break}}if(!Aa||null==Aa)break;var Pe=null;if("ks"==Bg){var Qe=Aa.match(/[0-9A-F]+$/);Qe&&(Pe=bg(a,Qe[0]))}Aa=na(Aa,50)+" ;"+(Pe||"stack="+J(a,vb.w));a.g(Aa);dd++}dd||a.g("no return addresses found")}break;case "l":if("ln"==g[0]){bg(a,g[1],!0);break}f=!0;break;case "m":a:{var ia,ja=null,F=g[1];"?"==F&&(F=void 0);if(void 0!==F){var sa=0;if("all"==
|
||||
F)sa=1878917119,F=null;else if("on"==F)ja=!0,F=null;else if("off"==F)ja=!1,F=null;else{"keys"==F&&(F="key");"kbd"==F&&(F="keyboard");for(ia in H)if(F==ia){sa=H[ia];ja=!!(a.ia&sa);break}if(!sa){a.g("unknown message category: "+F);break a}}if(sa)if("on"==g[2])a.ia|=sa,ja=!0;else if("off"==g[2]&&(a.ia&=~sa,ja=!1,1073741824==sa)){for(var gd=0;gd<a.ta.length;gd++)a.g(a.ta[gd]);a.ta=[]}}var Eg=0,xb="";for(ia in H)if(!F||F==ia){var Fg=!!(a.ia&H[ia]);if(null===ja||ja==Fg)xb&&(xb+=","),++Eg%10||(xb+="\n\t"),
|
||||
"key"==ia&&(ia="keys"),xb+=ia}void 0===F&&a.g("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.g((null!==ja?ja?"messages on: ":"messages off: ":"message categories:\n\t")+(xb||"none"));Bf(a)}break;case "p":if("print"==g[0]){cg(a,b.substr(5));break}var Gg="pr"==g[0]?1:0;if(a.V)a.g("step in progress");else{var Re=Z(a.b.u[7]);a.kb(Re);a.V?(a.Pa(a.f,Re,!0),a.cb()||(a.B&&a.B.qb(),a.V=0)):dg(a,Gg?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}Of(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var yb=
|
||||
+g[2];if(8==yb||10==yb||16==yb)a.ja=yb;else{a.g("invalid base: "+yb);break}}a.g("default base: "+a.ja);break;case "cs":var zb;void 0!==g[3]&&(zb=+g[3]);switch(g[2]){case "int":a.b.Ya=zb;break;case "start":a.b.nb=zb;break;case "stop":a.b.Za=zb;break;default:a.g("unknown cs option");break a}void 0!==zb&&Fc(a.b);a.g("checksums "+(a.b.v.Xa?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Jc(a.b,+g[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.Ra.toFixed(2)+
|
||||
"Mhz")+" ("+a.b.Ka+"x)");break;default:if(g[1]){a.g("unknown option: "+g[1]);break}case "?":a.g("debugger options:"),a.g("\tbase #\t\tset default base to #"),a.g("\tcs int #\tset checksum cycle interval to #"),a.g("\tcs start #\tset checksum cycle start count to #"),a.g("\tcs stop #\tset checksum cycle stop count to #"),a.g("\tsp #\t\tset speed multiplier to #")}break;case "t":dg(a,g[0],g[1]);break;case "u":Pf(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ag(a,b.substr(3))||(d=!1);break}if("ver"==
|
||||
g[0]){a.g("PDPjs version 1.30.1 ("+a.b.Gb+",RELEASE"+(lb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){cg(a,b.substr(1));break}var hd="commands:",id;for(id in Df)hd+="\n"+na(id,9)+Df[id];Jd(a)||(hd+="\nnote: history disabled if no exec breakpoints");a.g(hd);break;default:f=!0}f&&(a.g("unknown command: "+b),d=!1)}}catch(Se){a.g("debugger error: "+(Se.stack||Se.message)),d=!1}return d}
|
||||
function Gc(a,b,c){b=sf(a,b,c);for(var d in b)if(!Uf(a,b[+d]))return!1;return!0}La(function(){for(var a=A(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zf(d);fb(d,c)}});
|
||||
function fg(a,b,c){r.call(this,"Computer",a,fg,67108864);this.v.ha=!1;gg(this,b);this.M=Dc(this,"autoPower",a);this.B=0;this.ca=a.busWidth||a.buswidth;this.f=hg;this.I=null;this.G=this.U=!1;this.da=Dc(this,"url")||"";(Math.random()+.1).toString(36);this.j=ig(this);if(this.b=eb("CPU",this.id)){this.i=eb("Debugger",this.id);this.A=new Eb({id:this.Db+".bus",busWidth:this.ca},this.b,this.i);var d,e=cb(this.id);if((this.C=eb("Panel",this.id))&&this.C.Qa)for(b=0;b<e.length;b++)d=e[b],d.na=this.C.na,d.g=
|
||||
this.C.g,d.Qa=this.C.Qa;this.g("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.g("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.Da&&d.Da(this,this.A,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Dc(this,"state")||(f=!0,a.state))b=this.R=a,f||(this.G=!0,this.f=hg),this.f&&
|
||||
(this.K=new N(this,"1.30.1"),jg(this.K)?b=null:delete this.K);!b&&this.f&&(b=kg(this))&&(this.G=!0);if(b){var g=this;ua(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.na("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.I=b,g.U=!0);G(g)})}else G(this);this.J.power||(this.M=!0);!c&&this.M&&lg(this,this.ob)}else n("Unable to find CPU component")}y(fg);var hg=0;
|
||||
function gg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){n(d.message+" ("+c+")")}}a.V=b}function Dc(a,b,c){var d=b.toLowerCase(),d=Wa[b]||Wa[d];void 0===d&&a.V&&(d=a.V[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function lg(a,b,c){for(var d=cb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ib(f)){ib(f,function(){lg(a,b,c)});return}}b.call(a,c)}
|
||||
function mg(a,b){var c=new N(a,"1.30.1","validate");if(jg(c)&&ng(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.na("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=fg.prototype;
|
||||
h.lb=function(a){void 0===a&&(a=this.f||(this.J?1:hg));if(!this.B){this.B++;var b=!1,c=!1;this.T=!1;var d=this.K||new N(this,"1.30.1");if(-1==a)b=!0;else if(a>hg){if(jg(d,this.J)){this.F=new N(this,"1.30.1","failsafe");jg(this.F)&&(og(this,d),a=2,pg(this.F));this.F.set("timestamp",ta());qg(this.F);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.i=null)):this.g(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.J;delete this.K}e=cb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=rg(this,g,d,b,c));b=[d,a,c];-1!=a?lg(this,this.Kb,b):this.Kb(b)}};
|
||||
function rg(a,b,c,d,e){if(!b.v.ga){b.v.ga=!0;if(b.ya){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.ya(f,d)&&f&&(n("Unable to restore state for "+b.type),a.R&&!a.U?(c.clear(),a.f=hg,window&&window.location.reload()):a.T=!0,b.ya(null),e=!1)}if(!d&&b.Lb)for(a=b.Lb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Kb=function(a){var b=a[0],c=0>a[1];a=a[2];this.ea=!0;this.v.ga=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.b&&(rg(this,this.b,b,c,a),this.b.fb());this.T&&(og(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.B=0};
|
||||
function og(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.i||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function eg(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=ta();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.xa&&(c&&a.b.fa(),d=a.b.xa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ga=!1,!1===d&&(e=null)));for(var l=cb(a.id),m=0;m<l.length;m++){var p=l[m];p.v.ga&&(p.xa&&(d=p.xa(b,c),"object"===typeof d&&f.set(p.id,
|
||||
d)),c&&(p.v.ga=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.i&&sg(a,a.i,f.toString()),qg(g)&&qg(f)||(e=null,d=l=!0)):a.f&&(d=!0,l=3==a.f),d&&f.clear(l)):e=f.toString());c&&(a.v.ga=!1,b=a.I.power)&&(b.textContent="Power");a.B=0;return e}h.reset=function(){this.w&&this.w.reset&&(B(this,"Resetting "+this.w.type),this.w.reset());for(var a=cb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.w&&c.reset&&(B(this,"Resetting "+c.type),c.reset())}};
|
||||
h.start=function(a,b){for(var c=cb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.aa(!0)};h.stop=function(a,b){for(var c=cb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.aa(!0)};
|
||||
h.pa=function(a,b,c){var d=this;switch(b){case "power":return this.I[b]=c,c.onclick=function(){d.B||(d.v.ga?eg(d,!1,!0):lg(d,d.lb))},!0;case "reset":return this.I[b]=c,c.onclick=function(){if(d.v.ga&&!d.B)if(d.f&&!d.H){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");eg(d,a,!0);!a&&d.R?window&&window.location.reload():d.lb(hg)}else d.reset(),d.b&&d.b.fb()},!0;case "save":if(fa())c.parentNode.removeChild(c);else return this.I[b]=
|
||||
h.ob=function(a){void 0===a&&(a=this.f||(this.I?1:hg));if(!this.B){this.B++;var b=!1,c=!1;this.T=!1;var d=this.K||new N(this,"1.30.1");if(-1==a)b=!0;else if(a>hg){if(jg(d,this.I)){this.D=new N(this,"1.30.1","failsafe");jg(this.D)&&(og(this,d),a=2,pg(this.D));this.D.set("timestamp",ta());qg(this.D);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.j=null)):this.g(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.I;delete this.K}e=cb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=rg(this,g,d,b,c));b=[d,a,c];-1!=a?lg(this,this.Tb,b):this.Tb(b)}};
|
||||
function rg(a,b,c,d,e){if(!b.v.ha){b.v.ha=!0;if(b.Aa){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.Aa(f,d)&&f&&(n("Unable to restore state for "+b.type),a.R&&!a.U?(c.clear(),a.f=hg,window&&window.location.reload()):a.T=!0,b.Aa(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.Tb=function(a){var b=a[0],c=0>a[1];a=a[2];this.fa=!0;this.v.ha=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(rg(this,this.b,b,c,a),this.b.hb());this.T&&(og(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.B=0};
|
||||
function og(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.j||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.da;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function eg(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=ta();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.ga(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var l=cb(a.id),m=0;m<l.length;m++){var p=l[m];p.v.ha&&(p.za&&(d=p.za(b,c),"object"===typeof d&&f.set(p.id,
|
||||
d)),c&&(p.v.ha=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.j&&sg(a,a.j,f.toString()),qg(g)&&qg(f)||(e=null,d=l=!0)):a.f&&(d=!0,l=3==a.f),d&&f.clear(l)):e=f.toString());c&&(a.v.ha=!1,b=a.J.power)&&(b.textContent="Power");a.B=0;return e}h.reset=function(){this.A&&this.A.reset&&(B(this,"Resetting "+this.A.type),this.A.reset());for(var a=cb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.A&&c.reset&&(B(this,"Resetting "+c.type),c.reset())}};
|
||||
h.start=function(a,b){for(var c=cb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ba(!0)};h.stop=function(a,b){for(var c=cb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ba(!0)};
|
||||
h.ra=function(a,b,c){var d=this;switch(b){case "power":return this.J[b]=c,c.onclick=function(){d.B||(d.v.ha?eg(d,!1,!0):lg(d,d.ob))},!0;case "reset":return this.J[b]=c,c.onclick=function(){if(d.v.ha&&!d.B)if(d.f&&!d.H){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");eg(d,a,!0);!a&&d.R?window&&window.location.reload():d.ob(hg)}else d.reset(),d.b&&d.b.hb()},!0;case "save":if(fa())c.parentNode.removeChild(c);else return this.J[b]=
|
||||
c,c.onclick=function(){var a=ig(d,!0);if(a){var b=!!(d.f&&!d.H||d.R),c=eg(d,b);b?sg(d,a,c):d.na("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function ig(a,b){var c=a.i;c||((c=Ba("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=tg(a,c))||a.na("The user ID is invalid.")):b&&a.na("Browser local storage is not available"));return c}
|
||||
function tg(a,b){a.i=null;b=ua(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&&(Ca("user",b.data),a.i=b.data)}catch(d){n(d.message+" ("+c+")")}return a.i}function kg(a){var b=null;a.i&&(b=ga()+"/api/v1/user?req=load&user="+a.i+"&state="+ug(a,"1.30.1"));return b}
|
||||
function sg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ug(a,"1.30.1");d.data=c;b=ua(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.na("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.na(c),Ca("user",""),a.i=null)}}h.nb=function(){};
|
||||
h.aa=function(a){this.b&&this.b.aa(a);this.C&&this.C.aa(a)};La(function(){for(var a=A(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=A(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new fg(g,d,!0);fb(g,f);g.M&&lg(g,g.lb)}});Ga.show.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=eb("Computer",c.id))&&c.ea&&!c.v.ga&&c.lb(-1)}});
|
||||
Ga.exit.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=eb("Computer",c.id))&&c.v.ga&&eg(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=ug(a,b,c);this.j=a.j;pg(this,a.mc)}function ug(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}
|
||||
function ig(a,b){var c=a.j;c||((c=Ba("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=tg(a,c))||a.na("The user ID is invalid.")):b&&a.na("Browser local storage is not available"));return c}
|
||||
function tg(a,b){a.j=null;b=ua(ka()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ca("user",b.data),a.j=b.data)}catch(d){n(d.message+" ("+c+")")}return a.j}function kg(a){var b=null;a.j&&(b=ka()+"/api/v1/user?req=load&user="+a.j+"&state="+ug(a,"1.30.1"));return b}
|
||||
function sg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ug(a,"1.30.1");d.data=c;b=ua(ka()+"/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.na("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.na(c),Ca("user",""),a.j=null)}}h.qb=function(){};
|
||||
h.ba=function(a){this.b&&this.b.ba(a);this.C&&this.C.ba(a)};La(function(){for(var a=A(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=A(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new fg(g,d,!0);fb(g,f);g.M&&lg(g,g.ob)}});Ga.show.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=eb("Computer",c.id))&&c.fa&&!c.v.ha&&c.ob(-1)}});
|
||||
Ga.exit.push(function(){for(var a=A(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=eb("Computer",c.id))&&c.v.ha&&eg(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=ug(a,b,c);this.i=a.i;pg(this,a.pc)}function ug(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
N.prototype={constructor:N,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){pg(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 pg(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function qg(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);Ca(a.key,c)||(n("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ng(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){n(c.message||c),b=!1}return b}function jg(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:xa()&&(b=Ba(a.key))?(a[a.id]=b,a.b=!0):!1}var vg=0;
|
||||
function Hg(a,b,c,d,e,f){e("Loading "+a+"...");ua(a,null,!0,function(g,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),f(l,null)):Ig(l,a,b,c,d,e,f)})}
|
||||
|
|
|
|||
|
|
@ -684,7 +684,7 @@
|
|||
var g;
|
||||
function aa(a){var b=16,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 k(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 ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function ca(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
|
||||
function da(){var a=ea();return-1!==a.indexOf("pcjs.org",a.length-8)}var fa={"&":"&","<":"<",">":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
function da(){var a=ea();return-1!==a.indexOf("pcjs.org",a.length-8)}var fa={"&":"&","<":"<",">":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
|
||||
var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",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"},ka=Date.now||function(){return+new Date};
|
||||
function la(){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 m(a,b,c,d){var e=0,f=null,h=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)}),h;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
||||
|
|
@ -692,141 +692,140 @@ typeof b){var n="",q;for(q in b)b.hasOwnProperty(q)&&(n&&(n+="&"),n+=q+"="+encod
|
|||
function p(a){window&&window.alert(a)}function ma(a){var b=!1;window&&(b=window.confirm(a));return b}var na=null;function oa(){if(null==na){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}na=a}return na}function pa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},sa=!1,ta=!1,ua=!0;function va(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){r.init.push(a)}
|
||||
function wa(a){if(ua)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){p(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function xa(a){!ua&&a?(ua=!0,sa&&ya("init"),ta&&ya("show")):ua=a}function ya(a){r[a]&&wa(r[a])}va("onload",function(){sa=!0;wa(r.init)});va("onpageshow",function(){ta=!0;wa(r.show)});va(ra("Opera")||ra("iOS")?"onunload":"onbeforeunload",function(){wa(r.exit)});
|
||||
function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.eb=b.comment;this.Bb=b;b=this.id.indexOf(".");0>b?this.Ca=this.id:(this.Sa=this.id.substr(0,b),this.Ca=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Wc:!1,Xc:!1,L:!1,error:!1};this.La=null;this.h.error=!1;this.v={};this.I=null;w.push(this)}var za=void 0,Aa={};
|
||||
function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.hb=b.comment;this.Bb=b;b=this.id.indexOf(".");0>b?this.Ea=this.id:(this.Ta=this.id.substr(0,b),this.Ea=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Vc:!1,Wc:!1,L:!1,error:!1};this.Na=null;this.h.error=!1;this.v={};this.H=null;w.push(this)}var za=void 0,Aa={};
|
||||
if(window){za||(za=window.location.search.substr(1));for(var Ba,Ca=/\+/g,Da=/([^&=]+)=?([^&]*)/g;Ba=Da.exec(za);)Aa[decodeURIComponent(Ba[1].replace(Ca," "))]=decodeURIComponent(Ba[2].replace(Ca," "))}function Ea(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 x(a,b){b||(b=v);a.prototype=Ea(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Fa=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Fa={},w=[];function Ga(a,b,c){Fa[a]&&b&&(Fa[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<w.length;b++){var d=w[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function Ha(a){if(void 0!==a){var b;for(b=0;b<w.length;b++)if(w[b].id===a)return w[b]}return null}function z(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<w.length;d++)if(c)c==w[d]&&(c=null);else if(!(a!=w[d].type||b&&w[d].id.indexOf(b)))return w[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){p(c.message+" ("+a+")")}return b}
|
||||
function B(a,b){b=C(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 h=f.getAttribute("class");if(h)for(var l=h.split(" "),n=0;n<l.length;n++)switch(h=l[n],h){case "pdp11-binding":(h=A(f))&&h.binding&&a.T(h.type,h.binding,f,h.value),n=l.length}}}}
|
||||
function B(a,b){b=C(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 h=f.getAttribute("class");if(h)for(var l=h.split(" "),n=0;n<l.length;n++)switch(h=l[n],h){case "pdp11-binding":(h=A(f))&&h.binding&&a.U(h.type,h.binding,f,h.value),n=l.length}}}}
|
||||
function C(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}
|
||||
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},T:function(a,b,c){switch(b){case "clear":return this.v[b]||(this.v[b]=c,c.onclick=function(a){return function(){a.v.print&&(a.v.print.value="")}}(this)),!0;case "print":return this.v[b]||(this.Qa=this.v[b]=c,c.value="",this.O=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.K=function(a){this.O(a,this.Ca)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.Ca+": "+a)},K:function(a,b,c){c=c||this.type;b||p((c?c+": ":"")+a)},aa:function(){return this.h.L=!0},$:function(a,b){b&&(this.h.L=!1);return!0}};function D(a){if(!a.h.error&&(a.h.ready=!0,a.h.ready)){var b=a.La;a.La=null;b&&b()}}function Ia(a,b){b&&(a.h.ready?b():a.La=b);return a.h.ready}
|
||||
v.prototype={constructor:v,parent:null,toString:function(){return this.name?this.name:this.id||this.type},U:function(a,b,c){switch(b){case "clear":return this.v[b]||(this.v[b]=c,c.onclick=function(a){return function(){a.v.print&&(a.v.print.value="")}}(this)),!0;case "print":return this.v[b]||(this.Ra=this.v[b]=c,c.value="",this.O=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.K=function(a){this.O(a,this.Ea)}),!0;default:return!1}},log:function(){},O:function(){},status:function(a){this.O(this.Ea+": "+a)},K:function(a,b,c){c=c||this.type;b||p((c?c+": ":"")+a)},ba:function(){return this.h.L=!0},aa:function(a,b){b&&(this.h.L=!1);return!0}};function D(a){if(!a.h.error&&(a.h.ready=!0,a.h.ready)){var b=a.Na;a.Na=null;b&&b()}}function Ia(a,b){b&&(a.h.ready?b():a.Na=b);return a.h.ready}
|
||||
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});
|
||||
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 Ja="undefined"!==typeof ArrayBuffer;function Ka(a){v.call(this,"Panel",a,Ka);this.b=0;this.h.ab=!0}x(Ka);g=Ka.prototype;
|
||||
g.T=function(a,b,c,d){if(this.w&&this.w.T(a,b,c,d)||this.a&&this.a.T(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.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.T.call(this,a,b,c,d)}};g.ja=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.I=d};g.aa=function(a,b){b||La();return!0};g.$=function(){return!0};
|
||||
function E(a,b,c,d){if(a.v[b]){void 0===c&&(a.h.error=!0,a.K("Value for "+b+" is invalid"),F(a.a));var e=a.I&&a.I.b||8;if(!a.a.h.S||a.h.ab)if(8==e){e="";d?11<d&&(d=11):d=c&-65536?11:6;if(null==c||isNaN(c))for(;0<d--;)e="?"+e;else for(;0<d--;)e=String.fromCharCode((c&7)+48)+e,c>>=3;d=""+e}else d=k(c,d);else d="--------".substr(0,d||4);a.v[b].textContent!=d&&(a.v[b].textContent=d)}}function Ma(a,b,c,d){for(var e=0;e<d;e++){var f=a.v[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
g.ba=function(a){if(this.b&&(a||!this.a.h.S||this.h.ab)){for(a=0;a<this.a.f.length;a++)E(this,"R"+a,this.a.f[a]);a=Na(this.a);E(this,"PS",a);E(this,"NF",a&8?1:0,1);E(this,"ZF",a&4?1:0,1);E(this,"VF",a&2?1:0,1);E(this,"CF",a&1?1:0,1);Ma(this,"D",this.a.f[0],16);Ma(this,"A",this.a.f[7],22)}};function La(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Ha(e.id);f||(a=!0,f=new Ka(e));B(f,d);a&&D(f)}}u(La);
|
||||
function Oa(a,b,c){v.call(this,"Bus",a,Oa);this.a=b;this.I=c;this.B=a.busWidth||16;this.m=0;this.H=[];this.A=null;this.D=Math.pow(2,this.B);this.i=this.D-1|0;this.c=(this.B>>1)+2;10>this.c&&(this.c=10);15<this.c&&(this.c=15);this.l=1<<this.c;this.G=this.l>>2;this.g=this.l-1;this.s=this.D/this.l|0;this.ga=[];this.o=0;this.w=[];this.tb=[Pa,Qa,Ra,Sa];a=new G(this);Ta(a,this.I);this.b=Array(this.s);for(b=0;b<this.s;b++)this.b[b]=a;D(this)}x(Oa);
|
||||
function Pa(a,b){var c=-1,d=this.controller,e=d.ga[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=Ua(d,b|4186112)}function Qa(a,b,c){var d=!1,e=this.controller,f=e.ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||Ua(e,c|4186112)}
|
||||
function Ra(a,b){var c=-1,d=this.controller;(a=d.ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=Ua(d,b|4186112)}function Sa(a,b,c){var d=!1,e=this.controller;if(a=e.ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||Ua(e,c|4186112)}function Va(a,b){if(b!=a.m){var c;a.m&&(c=(1<<a.m)-8192,Wa(a,c,8192,a.H),a.m=0);b&&(a.m=b,c=(1<<b)-8192,a.H=Xa(a,c,8192),a.A?Wa(a,c,8192,a.A):(Ya(a,c,8192,Za,a),a.A=Xa(a,c,8192)))}}
|
||||
Oa.prototype.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Va(this,16)};function Ua(a,b){a.o||H(a.a,4,b);return 0}Oa.prototype.aa=function(a,b){b||this.reset();return!0};
|
||||
function Ya(a,b,c,d,e){for(var f=b,h=c,l=f>>>a.c;0<h&&l<a.b.length;){var n=a.b[l],q=l*a.l,t=a.l-(f-q);t>h&&(t=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.ya)return n.Oa+=n.ya-f,n.ya=f,!0;if(f>=n.ya+n.Oa){t=n.size-(f-q);t>h&&(t=h);n.Oa=f-n.ya+t;f=q+a.l;h-=t;l++;continue}}return $a(1,f,h)}f=new G(a,f,t,a.l,d,e);Ta(f,a.I,n);a.b[l++]=f;f=q+a.l;h-=t}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+ab[d]+" at "+k(b,8,!0)),!0):$a(2,b,c)}
|
||||
function Xa(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.l;return d}function Wa(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.l}}function bb(a,b){return a.b[(b&a.i)>>>a.c].Wa(b&a.g,b)}function cb(a,b){return a.b[(b&a.i)>>>a.c].gc(b&a.g,b)}function db(a,b,c){a.b[(b&a.i)>>>a.c].Qc(b&a.g,c&65535,b)}
|
||||
function eb(a){for(var b=0,c=[],d=0;d<a.s;d++){var e=a.b[d];if(e.ha||e.vb){c[b++]=d;var f=b++;if(e=e.save()){for(var h=0,l=0,n=[];h<e.length;){for(var q=e[h],t=h+1;t<e.length&&e[t]===q;)t++;n[l++]=t-h;n[l++]=q;h=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function fb(a,b,c,d,e,f,h,l){for(;b<=c;b+=2){var n=b&8191;void 0!==a.ga[n]?p("I/O address already registered: "+k(b,8,!0)):a.ga[n]=[d,e,f,h,l||"unknown",!1]}}
|
||||
function gb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Ab)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,q=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&q&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(q)));fb(a,e,e,h,l,n,q,f[4])}}}function hb(a,b){a.w.push(b)}function ib(a,b){a.o||H(a.a,4,b)}
|
||||
function $a(a,b,c){p("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Vc:0,Ma:20,Zc:0};this.b={Yc:0,$a:-1}}x(I);g=I.prototype;g.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;var e=this;this.b.$a=jb(c,function(){e.b.ka|=128;e.b.ka&64&&(kb(e.a,e.b.mc),lb(e.a,e.b.$a,1E3/60))});this.b.mc=mb(c,64,6);gb(b,this,J);hb(b,this.reset.bind(this));D(this)};g.Jb=function(){var a=this.b.ka;this.b.ka&=-129;return a};
|
||||
g.uc=function(a){this.b.ka=a;a&64&&lb(this.a,this.b.$a,1E3/60);this.b.ka=a&-129};g.Lb=function(){var a=this.a;return a.A&62337|a.Da<<5|a.Ea<<1};g.wc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Da=a>>5&3;b.Ea=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Na!=c&&(b.Na=c,nb(b))}ob(this)};g.Mb=function(){var a=this.a.la;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Nb=function(){return this.a.Ya};g.Ob=function(){return this.a.ma};
|
||||
g.xc=function(a){var b=this.a;b.ma!=a&&(b.ma=a,a&16?(b.Ua=4194303,b.Fa=3915776):(b.Ua=262143,b.Fa=253952),nb(b));ob(this)};function ob(a){a.c.Ma=a.c.Ma&-8|(a.a.Na?a.a.ma&16?1:2:4)}g.$b=function(a){return this.a.C[1][a>>1&7]};g.Jc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.Yb=function(a){return this.a.C[1][(a>>1&7)+8]};g.Hc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.Zb=function(a){return this.a.P[1][a>>1&7]};g.Ic=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295};
|
||||
g.Xb=function(a){return this.a.P[1][(a>>1&7)+8]};g.Gc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Ib=function(a){return this.a.C[0][a>>1&7]};g.tc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Gb=function(a){return this.a.C[0][(a>>1&7)+8]};g.rc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Hb=function(a){return this.a.P[0][a>>1&7]};g.sc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Fb=function(a){return this.a.P[0][(a>>1&7)+8]};
|
||||
g.qc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.fc=function(a){return this.a.C[3][a>>1&7]};g.Pc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.dc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Nc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.ec=function(a){return this.a.P[3][a>>1&7]};g.Oc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.cc=function(a){return this.a.P[3][(a>>1&7)+8]};g.Mc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295};
|
||||
g.ta=function(a){a&=7;return this.a.u&2048?this.a.ra[a]:this.a.f[a]};g.va=function(a,b){b&=7;this.a.u&2048?this.a.ra[b]=a:this.a.f[b]=a};g.Rb=function(){return this.a.u&49152?this.a.V[0]:this.a.f[6]};g.Ac=function(a){this.a.u&49152?this.a.V[0]=a:this.a.f[6]=a};g.Ub=function(){return this.a.f[7]};g.Dc=function(a){this.a.f[7]=a};g.ua=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.ra[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.ra[b]=a};
|
||||
g.Sb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.V[1]};g.Bc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.V[1]=a};g.Tb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.V[3]};g.Cc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.V[3]=a};g.Eb=function(a){return this.a.nb[a-65504>>1]};g.pc=function(a,b){this.a.nb[b-65504>>1]=a};g.kb=function(a){return 65520==a?61183:0};g.sb=function(){};g.bc=function(){return 1};g.Lc=function(){};g.Db=function(){return this.a.F};
|
||||
g.oc=function(){this.a.F=0};g.Kb=function(){return this.a.mb};g.vc=function(a,b){b&1||(a&=255);this.a.mb=a};g.Pb=function(a){return a?this.a.Za:0};g.yc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Za=a;b.j|=2};g.ac=function(a){return a?this.a.na&65280:0};g.Kc=function(a){this.a.na=a|255};g.Qb=function(){return Na(this.a)};g.zc=function(a){pb(this.a,a&-1809|Na(this.a)&1808);this.a.j|=128};g.rb=function(){};g.reset=function(){this.c.Ma=this.c.Ma&-120|20;this.b.ka=0};
|
||||
var K={},J=(K[62592]=[null,null,I.prototype.$b,I.prototype.Jc,"SISDR"],K[62608]=[null,null,I.prototype.Yb,I.prototype.Hc,"SDSDR"],K[62624]=[null,null,I.prototype.Zb,I.prototype.Ic,"SISAR"],K[62640]=[null,null,I.prototype.Xb,I.prototype.Gc,"SDSAR"],K[62656]=[null,null,I.prototype.Ib,I.prototype.tc,"KISDR"],K[62672]=[null,null,I.prototype.Gb,I.prototype.rc,"KDSDR"],K[62688]=[null,null,I.prototype.Hb,I.prototype.sc,"KISAR"],K[62704]=[null,null,I.prototype.Fb,I.prototype.qc,"KDSAR"],K[62798]=[null,null,
|
||||
I.prototype.Ob,I.prototype.xc,"MMR3"],K[65382]=[null,null,I.prototype.Jb,I.prototype.uc,"LKS"],K[65402]=[null,null,I.prototype.Lb,I.prototype.wc,"MMR0"],K[65404]=[null,null,I.prototype.Mb,I.prototype.rb,"MMR1"],K[65406]=[null,null,I.prototype.Nb,I.prototype.rb,"MMR2"],K[65408]=[null,null,I.prototype.fc,I.prototype.Pc,"UISDR"],K[65424]=[null,null,I.prototype.dc,I.prototype.Nc,"UDSDR"],K[65440]=[null,null,I.prototype.ec,I.prototype.Oc,"UISAR"],K[65456]=[null,null,I.prototype.cc,I.prototype.Mc,"UDSAR"],
|
||||
K[65472]=[null,null,I.prototype.ta,I.prototype.va,"R0SET0"],K[65473]=[null,null,I.prototype.ta,I.prototype.va,"R1SET0"],K[65474]=[null,null,I.prototype.ta,I.prototype.va,"R2SET0"],K[65475]=[null,null,I.prototype.ta,I.prototype.va,"R3SET0"],K[65476]=[null,null,I.prototype.ta,I.prototype.va,"R4SET0"],K[65477]=[null,null,I.prototype.ta,I.prototype.va,"R5SET0"],K[65478]=[null,null,I.prototype.Rb,I.prototype.Ac,"R6KERNEL"],K[65479]=[null,null,I.prototype.Ub,I.prototype.Dc,"R7KERNEL"],K[65480]=[null,null,
|
||||
I.prototype.ua,I.prototype.wa,"R0SET1"],K[65481]=[null,null,I.prototype.ua,I.prototype.wa,"R1SET1"],K[65482]=[null,null,I.prototype.ua,I.prototype.wa,"R2SET1"],K[65483]=[null,null,I.prototype.ua,I.prototype.wa,"R3SET1"],K[65484]=[null,null,I.prototype.ua,I.prototype.wa,"R4SET1"],K[65485]=[null,null,I.prototype.ua,I.prototype.wa,"R5SET1"],K[65486]=[null,null,I.prototype.Sb,I.prototype.Bc,"R6SUPER"],K[65487]=[null,null,I.prototype.Tb,I.prototype.Cc,"R6USER"],K[65504]=[null,null,I.prototype.Eb,I.prototype.pc,
|
||||
"CTRL",1170],K[65520]=[null,null,I.prototype.kb,I.prototype.sb,"LSIZE",1170],K[65522]=[null,null,I.prototype.kb,I.prototype.sb,"HSIZE",1170],K[65524]=[null,null,I.prototype.bc,I.prototype.Lc,"SYSID",1170],K[65526]=[null,null,I.prototype.Db,I.prototype.oc,"CPUERR",1170],K[65528]=[null,null,I.prototype.Kb,I.prototype.vc,"MB",1170],K[65530]=[null,null,I.prototype.Pb,I.prototype.yc,"PIR"],K[65532]=[null,null,I.prototype.ac,I.prototype.Kc,"SL"],K[65534]=[null,null,I.prototype.Qb,I.prototype.zc,"PSW"],
|
||||
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 Ja="undefined"!==typeof ArrayBuffer;function Ka(a){v.call(this,"Panel",a,Ka);this.b=0;this.h.eb=!0}x(Ka);g=Ka.prototype;
|
||||
g.U=function(a,b,c,d){if(this.w&&this.w.U(a,b,c,d)||this.a&&this.a.U(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.v[b]=c,this.b++,!0;default:return"rled"==a?(this.v[b]=c,this.b++,!0):this.parent.U.call(this,a,b,c,d)}};g.ka=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.H=d};g.ba=function(a,b){b||La();return!0};g.aa=function(){return!0};
|
||||
function E(a,b,c,d){if(a.v[b]){void 0===c&&(a.h.error=!0,a.K("Value for "+b+" is invalid"),F(a.a));var e=a.H&&a.H.b||8;if(!a.a.h.T||a.h.eb)if(8==e){e="";d?11<d&&(d=11):d=c&-65536?11:6;if(null==c||isNaN(c))for(;0<d--;)e="?"+e;else for(;0<d--;)e=String.fromCharCode((c&7)+48)+e,c>>=3;d=""+e}else d=k(c,d);else d="--------".substr(0,d||4);a.v[b].textContent!=d&&(a.v[b].textContent=d)}}function Ma(a,b,c,d){for(var e=0;e<d;e++){var f=a.v[b+e];f&&(f.style.backgroundColor=c&1<<e?"#ff0000":"#000000")}}
|
||||
g.ca=function(a){if(this.b&&(a||!this.a.h.T||this.h.eb)){for(a=0;a<this.a.f.length;a++)E(this,"R"+a,this.a.f[a]);a=Na(this.a);E(this,"PS",a);E(this,"NF",a&8?1:0,1);E(this,"ZF",a&4?1:0,1);E(this,"VF",a&2?1:0,1);E(this,"CF",a&1?1:0,1);Ma(this,"D",this.a.f[0],16);Ma(this,"A",this.a.f[7],22)}};function La(){for(var a=!1,b=C(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=Ha(e.id);f||(a=!0,f=new Ka(e));B(f,d);a&&D(f)}}u(La);
|
||||
function Oa(a,b,c){v.call(this,"Bus",a,Oa);this.a=b;this.H=c;this.A=a.busWidth||16;this.m=0;this.G=[];this.s=null;this.B=Math.pow(2,this.A);this.i=this.B-1|0;this.c=(this.A>>1)+2;10>this.c&&(this.c=10);15<this.c&&(this.c=15);this.l=1<<this.c;this.D=this.l>>2;this.g=this.l-1;this.w=this.B/this.l|0;this.ha=[];this.R=0;this.o=[];this.vb=[Pa,Qa,Ra,Sa];a=new G(this);Ta(a,this.H);this.b=Array(this.w);for(b=0;b<this.w;b++)this.b[b]=a;D(this)}x(Oa);
|
||||
function Pa(a,b){var c=-1,d=this.controller,e=d.ha[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=Ua(d,b|4186112)}function Qa(a,b,c){var d=!1,e=this.controller,f=e.ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||Ua(e,c|4186112)}
|
||||
function Ra(a,b){var c=-1,d=this.controller;(a=d.ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=Ua(d,b|4186112)}function Sa(a,b,c){var d=!1,e=this.controller;if(a=e.ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||Ua(e,c|4186112)}function Va(a,b){if(b!=a.m){var c;a.m&&(c=(1<<a.m)-8192,Wa(a,c,8192,a.G),a.m=0);b&&(a.m=b,c=(1<<b)-8192,a.G=Xa(a,c,8192),a.s?Wa(a,c,8192,a.s):(Ya(a,c,8192,Za,a),a.s=Xa(a,c,8192)))}}
|
||||
Oa.prototype.reset=function(){for(var a=0;a<this.o.length;a++)this.o[a]();Va(this,16)};function Ua(a,b){a.R||H(a.a,4,b);return 0}Oa.prototype.ba=function(a,b){b||this.reset();return!0};
|
||||
function Ya(a,b,c,d,e){for(var f=b,h=c,l=f>>>a.c;0<h&&l<a.b.length;){var n=a.b[l],q=l*a.l,t=a.l-(f-q);t>h&&(t=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.za)return n.Pa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Pa){t=n.size-(f-q);t>h&&(t=h);n.Pa=f-n.za+t;f=q+a.l;h-=t;l++;continue}}return $a(1,f,h)}f=new G(a,f,t,a.l,d,e);Ta(f,a.H,n);a.b[l++]=f;f=q+a.l;h-=t}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+ab[d]+" at "+k(b,8,!0)),!0):$a(2,b,c)}
|
||||
function Xa(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.l;return d}function Wa(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.l}}function bb(a,b){return a.b[(b&a.i)>>>a.c].Xa(b&a.g,b)}function cb(a,b){return a.b[(b&a.i)>>>a.c].S(b&a.g,b)}Oa.prototype.ab=function(a,b){this.R++;this.b[(a&this.i)>>>this.c].sb(a&this.g,b&255,a);this.R--};function db(a,b,c){a.b[(b&a.i)>>>a.c].Qa(b&a.g,c&65535,b)}
|
||||
function eb(a){for(var b=0,c=[],d=0;d<a.w;d++){var e=a.b[d];if(e.ia||e.xb){c[b++]=d;var f=b++;if(e=e.save()){for(var h=0,l=0,n=[];h<e.length;){for(var q=e[h],t=h+1;t<e.length&&e[t]===q;)t++;n[l++]=t-h;n[l++]=q;h=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function fb(a,b,c,d,e,f,h,l){for(;b<=c;b+=2){var n=b&8191;void 0!==a.ha[n]?p("I/O address already registered: "+k(b,8,!0)):a.ha[n]=[d,e,f,h,l||"unknown",!1]}}
|
||||
function gb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.jb)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,q=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&q&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(q)));fb(a,e,e,h,l,n,q,f[4])}}}function hb(a,b){a.o.push(b)}function ib(a,b){a.R||H(a.a,4,b)}
|
||||
function $a(a,b,c){p("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function I(a){v.call(this,"Device",a,I);this.c={data:0,Uc:0,Oa:20,Yc:0};this.b={Xc:0,bb:-1}}x(I);g=I.prototype;g.ka=function(a,b,c,d){this.l=b;this.a=c;this.H=d;var e=this;this.b.bb=jb(c,function(){e.b.la|=128;e.b.la&64&&(kb(e.a,e.b.mc),lb(e.a,e.b.bb,1E3/60))});this.b.mc=mb(64,6);gb(b,this,J);hb(b,this.reset.bind(this));D(this)};g.Kb=function(){var a=this.b.la;this.b.la&=-129;return a};
|
||||
g.uc=function(a){this.b.la=a;a&64&&lb(this.a,this.b.bb,1E3/60);this.b.la=a&-129};g.Mb=function(){var a=this.a;return a.A&62337|a.Fa<<5|a.Ga<<1};g.wc=function(a){var b=this.a;a&=62337;if(b.A!=a){b.A=a;b.Fa=a>>5&3;b.Ga=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,nb(b))}ob(this)};g.Nb=function(){var a=this.a.ma;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Ob=function(){return this.a.Za};g.Pb=function(){return this.a.na};
|
||||
g.xc=function(a){var b=this.a;1170>b.jb&&(a&=-49);b.na!=a&&(b.na=a,a&16?(b.Va=4194303,b.Ha=3915776):(b.Va=262143,b.Ha=253952),nb(b));ob(this)};function ob(a){a.c.Oa=a.c.Oa&-8|(a.a.Ba?a.a.na&16?1:2:4)}g.ac=function(a){return this.a.C[1][a>>1&7]};g.Jc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.Zb=function(a){return this.a.C[1][(a>>1&7)+8]};g.Hc=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.$b=function(a){return this.a.P[1][a>>1&7]};g.Ic=function(a,b){b=b>>1&7;this.a.P[1][b]=a;this.a.C[1][b]&=65295};
|
||||
g.Yb=function(a){return this.a.P[1][(a>>1&7)+8]};g.Gc=function(a,b){b=(b>>1&7)+8;this.a.P[1][b]=a;this.a.C[1][b]&=65295};g.Jb=function(a){return this.a.C[0][a>>1&7]};g.tc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Hb=function(a){return this.a.C[0][(a>>1&7)+8]};g.rc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Ib=function(a){return this.a.P[0][a>>1&7]};g.sc=function(a,b){b=b>>1&7;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.Gb=function(a){return this.a.P[0][(a>>1&7)+8]};
|
||||
g.qc=function(a,b){b=(b>>1&7)+8;this.a.P[0][b]=a;this.a.C[0][b]&=65295};g.gc=function(a){return this.a.C[3][a>>1&7]};g.Pc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.ec=function(a){return this.a.C[3][(a>>1&7)+8]};g.Nc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.fc=function(a){return this.a.P[3][a>>1&7]};g.Oc=function(a,b){b=b>>1&7;this.a.P[3][b]=a;this.a.C[3][b]&=65295};g.dc=function(a){return this.a.P[3][(a>>1&7)+8]};g.Mc=function(a,b){b=(b>>1&7)+8;this.a.P[3][b]=a;this.a.C[3][b]&=65295};
|
||||
g.ua=function(a){a&=7;return this.a.u&2048?this.a.sa[a]:this.a.f[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.sa[b]=a:this.a.f[b]=a};g.Sb=function(){return this.a.u&49152?this.a.X[0]:this.a.f[6]};g.Ac=function(a){this.a.u&49152?this.a.X[0]=a:this.a.f[6]=a};g.Vb=function(){return this.a.f[7]};g.Dc=function(a){this.a.f[7]=a};g.va=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.sa[a]};g.xa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.sa[b]=a};
|
||||
g.Tb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[1]};g.Bc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[1]=a};g.Ub=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.X[3]};g.Cc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.X[3]=a};g.Fb=function(a){return this.a.pb[a-65504>>1]};g.pc=function(a,b){this.a.pb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.ub=function(){};g.cc=function(){return 1};g.Lc=function(){};g.Eb=function(){return this.a.F};
|
||||
g.oc=function(){this.a.F=0};g.Lb=function(){return this.a.ob};g.vc=function(a,b){b&1||(a&=255);this.a.ob=a};g.Qb=function(a){return a?this.a.$a:0};g.yc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.$a=a;b.j|=2};g.bc=function(a){return a?this.a.oa&65280:0};g.Kc=function(a){this.a.oa=a|255};g.Rb=function(){return Na(this.a)};g.zc=function(a){pb(this.a,a&-1809|Na(this.a)&1808);this.a.j|=128};g.tb=function(){};g.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.la=0};
|
||||
var K={},J=(K[62592]=[null,null,I.prototype.ac,I.prototype.Jc,"SISDR"],K[62608]=[null,null,I.prototype.Zb,I.prototype.Hc,"SDSDR"],K[62624]=[null,null,I.prototype.$b,I.prototype.Ic,"SISAR"],K[62640]=[null,null,I.prototype.Yb,I.prototype.Gc,"SDSAR"],K[62656]=[null,null,I.prototype.Jb,I.prototype.tc,"KISDR"],K[62672]=[null,null,I.prototype.Hb,I.prototype.rc,"KDSDR"],K[62688]=[null,null,I.prototype.Ib,I.prototype.sc,"KISAR"],K[62704]=[null,null,I.prototype.Gb,I.prototype.qc,"KDSAR"],K[62798]=[null,null,
|
||||
I.prototype.Pb,I.prototype.xc,"MMR3"],K[65382]=[null,null,I.prototype.Kb,I.prototype.uc,"LKS"],K[65402]=[null,null,I.prototype.Mb,I.prototype.wc,"MMR0"],K[65404]=[null,null,I.prototype.Nb,I.prototype.tb,"MMR1"],K[65406]=[null,null,I.prototype.Ob,I.prototype.tb,"MMR2"],K[65408]=[null,null,I.prototype.gc,I.prototype.Pc,"UISDR"],K[65424]=[null,null,I.prototype.ec,I.prototype.Nc,"UDSDR"],K[65440]=[null,null,I.prototype.fc,I.prototype.Oc,"UISAR"],K[65456]=[null,null,I.prototype.dc,I.prototype.Mc,"UDSAR"],
|
||||
K[65472]=[null,null,I.prototype.ua,I.prototype.wa,"R0SET0"],K[65473]=[null,null,I.prototype.ua,I.prototype.wa,"R1SET0"],K[65474]=[null,null,I.prototype.ua,I.prototype.wa,"R2SET0"],K[65475]=[null,null,I.prototype.ua,I.prototype.wa,"R3SET0"],K[65476]=[null,null,I.prototype.ua,I.prototype.wa,"R4SET0"],K[65477]=[null,null,I.prototype.ua,I.prototype.wa,"R5SET0"],K[65478]=[null,null,I.prototype.Sb,I.prototype.Ac,"R6KERNEL"],K[65479]=[null,null,I.prototype.Vb,I.prototype.Dc,"R7KERNEL"],K[65480]=[null,null,
|
||||
I.prototype.va,I.prototype.xa,"R0SET1"],K[65481]=[null,null,I.prototype.va,I.prototype.xa,"R1SET1"],K[65482]=[null,null,I.prototype.va,I.prototype.xa,"R2SET1"],K[65483]=[null,null,I.prototype.va,I.prototype.xa,"R3SET1"],K[65484]=[null,null,I.prototype.va,I.prototype.xa,"R4SET1"],K[65485]=[null,null,I.prototype.va,I.prototype.xa,"R5SET1"],K[65486]=[null,null,I.prototype.Tb,I.prototype.Bc,"R6SUPER"],K[65487]=[null,null,I.prototype.Ub,I.prototype.Cc,"R6USER"],K[65504]=[null,null,I.prototype.Fb,I.prototype.pc,
|
||||
"CTRL",1170],K[65520]=[null,null,I.prototype.nb,I.prototype.ub,"LSIZE",1170],K[65522]=[null,null,I.prototype.nb,I.prototype.ub,"HSIZE",1170],K[65524]=[null,null,I.prototype.cc,I.prototype.Lc,"SYSID",1170],K[65526]=[null,null,I.prototype.Eb,I.prototype.oc,"CPUERR",1170],K[65528]=[null,null,I.prototype.Lb,I.prototype.vc,"MB",1170],K[65530]=[null,null,I.prototype.Qb,I.prototype.yc,"PIR"],K[65532]=[null,null,I.prototype.bc,I.prototype.Kc,"SL"],K[65534]=[null,null,I.prototype.Rb,I.prototype.zc,"PSW"],
|
||||
K);J[62594]=J[62592];J[62596]=J[62592];J[62598]=J[62592];J[62600]=J[62592];J[62602]=J[62592];J[62604]=J[62592];J[62606]=J[62592];J[62610]=J[62608];J[62612]=J[62608];J[62614]=J[62608];J[62616]=J[62608];J[62618]=J[62608];J[62620]=J[62608];J[62622]=J[62608];J[62626]=J[62624];J[62628]=J[62624];J[62630]=J[62624];J[62632]=J[62624];J[62634]=J[62624];J[62636]=J[62624];J[62638]=J[62624];J[62642]=J[62640];J[62644]=J[62640];J[62646]=J[62640];J[62648]=J[62640];J[62650]=J[62640];J[62652]=J[62640];J[62654]=J[62640];
|
||||
J[62658]=J[62656];J[62660]=J[62656];J[62662]=J[62656];J[62664]=J[62656];J[62666]=J[62656];J[62668]=J[62656];J[62670]=J[62656];J[62674]=J[62672];J[62676]=J[62672];J[62678]=J[62672];J[62680]=J[62672];J[62682]=J[62672];J[62684]=J[62672];J[62686]=J[62672];J[62690]=J[62688];J[62692]=J[62688];J[62694]=J[62688];J[62696]=J[62688];J[62698]=J[62688];J[62700]=J[62688];J[62702]=J[62688];J[62706]=J[62704];J[62708]=J[62704];J[62710]=J[62704];J[62712]=J[62704];J[62714]=J[62704];J[62716]=J[62704];J[62718]=J[62704];
|
||||
J[65410]=J[65408];J[65412]=J[65408];J[65414]=J[65408];J[65416]=J[65408];J[65418]=J[65408];J[65420]=J[65408];J[65422]=J[65408];J[65426]=J[65424];J[65428]=J[65424];J[65430]=J[65424];J[65432]=J[65424];J[65434]=J[65424];J[65436]=J[65424];J[65438]=J[65424];J[65442]=J[65440];J[65444]=J[65440];J[65446]=J[65440];J[65448]=J[65440];J[65450]=J[65440];J[65452]=J[65440];J[65454]=J[65440];J[65458]=J[65456];J[65460]=J[65456];J[65462]=J[65456];J[65464]=J[65456];J[65466]=J[65456];J[65468]=J[65456];J[65470]=J[65456];
|
||||
J[65506]=J[65504];J[65508]=J[65504];J[65510]=J[65504];J[65512]=J[65504];J[65514]=J[65504];J[65516]=J[65504];J[65518]=J[65504];u(function(){for(var a=C(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=A(c);switch(d.name){case "default":d=new I(d),B(d,c)}}});var qb;if(Ja){var rb=new ArrayBuffer(2);(new DataView(rb)).setUint16(0,256,!0);qb=256===(new Uint16Array(rb))[0]}else qb=!1;var sb=qb;
|
||||
function G(a,b,c,d,e,f){this.l=a;this.id=tb+=2;this.a=null;this.ya=b;this.Oa=c;this.size=d||0;this.type=e||ub;this.v=e==vb;this.controller=null;Ta(this);this.ha=this.vb=!1;if(d)if(f)this.controller=f,this.a=null,wb(this,f.tb);else if(Ja)this.b=new ArrayBuffer(d),this.g=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>1),this.a=new Int32Array(this.b,0,d>>2),wb(this,sb?xb:yb);else{this.a=Array(d>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;wb(this,zb)}else wb(this)}
|
||||
function G(a,b,c,d,e,f){this.l=a;this.id=tb+=2;this.a=null;this.za=b;this.Pa=c;this.size=d||0;this.type=e||ub;this.v=e==vb;this.controller=null;Ta(this);this.ia=this.xb=!1;if(d)if(f)this.controller=f,this.a=null,wb(this,f.vb);else if(Ja)this.b=new ArrayBuffer(d),this.g=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>1),this.a=new Int32Array(this.b,0,d>>2),wb(this,sb?xb:yb);else{this.a=Array(d>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;wb(this,zb)}else wb(this)}
|
||||
var ub=0,vb=2,Za=4,ab=["NONE","RAM","ROM","VID","H/W"],tb=0;
|
||||
G.prototype={constructor:G,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ja)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.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(Ja)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.ha=!0}return!1},w:function(){return 255},A:function(){},s:function(a,b){return this.Wa(a++,b++)|this.Wa(a,b)<<8},B:function(a,b,c){this.Pa(a++,
|
||||
b&255,c++);this.Pa(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},X:function(a,b){a&1&&ib(this.l,b);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},da:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ha=!0},qa:function(a,b,c){a&1&&ib(this.l,c);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.ha=!0},G:function(a,b){return this.H(a,b)},
|
||||
R:function(a,b){return this.U(a,b)},Z:function(a,b,c){this.v||this.qb(a,b,c)},fa:function(a,b,c){this.v||this.oa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},N:function(a,b){a&1&&ib(this.l,b);return this.g.getUint16(a,!0)},W:function(a,b){a&1&&ib(this.l,b);return this.o[a>>1]},Y:function(a,b){this.c[a]=b;this.ha=!0},ca:function(a,b){this.c[a]=b;this.ha=!0},ea:function(a,b,c){a&1&&ib(this.l,c);this.g.setUint16(a,b,!0);this.ha=!0},pa:function(a,b,c){a&1&&ib(this.l,c);this.o[a>>
|
||||
1]=b;this.ha=!0}};function Ta(a,b,c){a.I=b;a.i=a.m=0;c&&((a.i=c.i)&&Ab(a,Bb,!1),(a.m=c.m)&&Cb(a,Bb,!1))}function Cb(a,b,c){c&&a.m||(a.Pa=!a.v&&b[1]||a.A,a.Qc=!a.v&&b[3]||a.B);if(c||void 0===c)a.qb=b[1]||a.A,a.oa=b[3]||a.B}function Ab(a,b,c){c&&a.i||(a.Wa=b[0]||a.w,a.gc=b[2]||a.s);if(c||void 0===c)a.H=b[0]||a.w,a.U=b[2]||a.s}function wb(a,b){b||(b=Db);Ab(a,b,void 0);Cb(a,b,void 0)}
|
||||
var Db=[],zb=[G.prototype.M,G.prototype.da,G.prototype.X,G.prototype.qa],Bb=[G.prototype.G,G.prototype.Z,G.prototype.R,G.prototype.fa];if(Ja)var yb=[G.prototype.D,G.prototype.Y,G.prototype.N,G.prototype.ea],xb=[G.prototype.J,G.prototype.ca,G.prototype.W,G.prototype.pa];
|
||||
function Eb(a,b){v.call(this,"CPU",a,Eb);var c=a.multiplier||1;this.Ia=a.cycles||b;this.Z=c;this.Ta=Math.round(this.Ia/1E4)/100;this.ca=this.Ta*this.Z;this.h.S=!1;this.h.ob=!1;this.h.za=a.autoStart;this.h.Ka=!1;this.Ba=this.ea=0;this.Ha=a.csStart;this.oa=a.csInterval;this.pa=a.csStop;this.G=[];this.ib=this.kc.bind(this);D(this)}x(Eb);var Fb=["power","reset"];g=Eb.prototype;
|
||||
g.ja=function(a,b,c,d){this.w=a;this.l=b;this.I=d;for(b=0;b<Fb.length;b++)(c=this.v[Fb[b]])&&this.w.T(null,Fb[b],c);a=Gb(a,"autoStart");null!=a&&(this.h.za="true"==a?!0:"false"==a?!1:!!a);D(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.aa=function(a,b){if(!b){if(a&&this.restore){Hb(this);if(!this.restore(a))return!1;Ib(this)}else this.reset();this.O("No debugger detected")}this.w.ba();return!0};g.$=function(a){return a?this.save():!0};
|
||||
g.za=function(){return this.h.za||void 0===this.v.run?(Jb(this),!0):!1};g.cb=function(){return 0};function Ib(a){void 0===a.Ha&&(a.Ha=0);void 0===a.oa&&(a.oa=-1);void 0===a.pa&&(a.pa=-1);a.h.Ka=0<=a.Ha&&0<a.oa;a.h.Ka&&(a.Ba=0,a.ea=a.Ha-a.J)}
|
||||
g.T=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.v[b]=c,!0;case "run":return this.v[b]=c,c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.h.L)a=!0;else{var b=null,c,l=y(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.h.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.h.L);c++);c==l.length&&(b=a);p("The "+b.type+" component ("+b.id+") is not "+(b.h.ready?"powered yet":"ready yet"+(b.La?" (waiting for notification)":""))+".");a=!1}a&&(d.h.S?F(d):Jb(d))},!0;case "speed":return this.v[b]=
|
||||
c,!0;case "setSpeed":return this.v[b]=c,c.onclick=function(){Kb(d,d.Z<<1)},c.textContent=this.ca.toFixed(2)+"Mhz",!0}return!1};g.ba=function(){var a=this.v.speed;a&&(a.textContent=this.h.S&&this.X?this.X.toFixed(2)+"Mhz":"Stopped")};function Lb(a,b){var c=1;b&&1<a.Z&&a.X&&(c=a.X/a.Ta);a.gb=Math.round(1E3/30);a.Ja=Math.floor(a.Ia/30*c);b||(a.qa=a.Ja);a.Va=0}function Mb(a){return a.J+a.R+a.da-a.a}function Hb(a){a.X=0;a.hb=0;a.J=a.R=a.da=a.a=0;Ib(a);Kb(a,1)}
|
||||
function Kb(a,b){if(void 0!==b&&(.8>a.X/a.ca&&(b=1),a.Z=b,b=a.Ta*a.Z,a.ca!=b)){a.ca=b;b=a.ca.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.O("target speed: "+b)}a.J+=a.R;a.R=0;a.N=ka();a.Y=0;Lb(a)}function jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function lb(a,b,c){0<=b&&b<a.G.length&&0>a.G[b][0]&&(c*=a.Ia*a.Z/1E3,a.G[b][0]=c+Nb(a))}function Nb(a,b){var c=a.da-=a.a;a.a=0;b&&(a.da=0);return c}
|
||||
g.kc=function(){if(this.h.S){this.Va>=this.Ia&&Lb(this,!0);this.xa=0;this.Ga=ka();if(this.Y){var a=this.Ga-this.Y;a>this.gb&&(this.N+=a,this.N>this.Ga&&(this.N=this.Ga))}try{do{for(var b,c=this.h.Ka?1:this.Ja,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.pb(b)}catch(n){if("number"!=typeof n)throw n;}b=Nb(this,!0);this.xa+=b;this.R+=b;a=b;if(this.h.Ka){var f=!1;this.Ba=this.Ba+this.cb()|0;this.ea-=a;0>=this.ea&&(this.ea+=this.oa,f=!0);0<=this.pa&&this.pa<=Mb(this)&&
|
||||
(this.oa=this.pa=-1,Ib(this),F(this),f=!0);f&&this.O(Mb(this)+" cycles: checksum="+k(this.Ba))}for(var a=b,h=this.G.length-1;0<=h;h--){var l=this.G[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.qa-=b;if(0>=this.qa){this.qa+=this.Ja;15<=++this.hb&&(this.w&&this.w.ba(),this.hb=0);break}}while(this.h.S)}catch(n){F(this);this.w&&this.w.stop(ka(),Mb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.S){b=setTimeout;c=this.ib;this.Y=ka();d=this.gb;this.xa&&(d=Math.round(d*this.xa/
|
||||
this.Ja));d-=this.Y-this.Ga;if(e=this.Y-this.N)this.X=Math.round(this.R/(10*e))/100,864E5<=e&&(this.J=0,Kb(this));if(0>d||this.X<this.ca)-1E3>d&&(this.N-=d),d=0;this.Va+=this.xa;this.Y+=d;b(c,d)}}};function Jb(a){var b;a.h.error?(a.O(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.S)a.O(a.toString()+" busy");else{Kb(a);a.h.S=!0;a.h.ob=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.N,Mb(a));setTimeout(a.ib,0)}}g.pb=function(){return 0};
|
||||
function F(a){if(a.h.S){Nb(a);a.J+=a.R;a.R=0;a.h.S=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(ka(),Mb(a))}a.h.complete=void 0}
|
||||
function Ob(a){this.Ab=+a.model||1170;this.Cb=a.resetAddr||0;Eb.call(this,a,6666667);this.decode=Pb.bind(this);this.yb=[];this.U=null;this.m=65536;this.g=32768;this.i=65535;this.o=32768;this.u=15;this.f=[0,0,0,0,0,0,0,this.Cb];this.ra=[0,0,0,0,0,0];this.V=[0,0,0,0];this.Ea=this.s=0;this.zb=[4,2,0,1];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.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],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.lc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.nb=[0,0,0,0,0,0,0,0];this.c=this.b=this.Ra=this.B=this.D=this.j=this.mb=0;this.fa=-1;Qb(this);this.h.complete=this.h.ub=!1}x(Ob,Eb);g=Ob.prototype;g.reset=function(){this.h.S&&F(this);Qb(this);Hb(this);this.h.error=!1;this.parent.reset.call(this)};
|
||||
function Qb(a){a.na=255;a.F=0;a.Za=0;a.A=0;a.la=0;a.Ya=0;a.ma=0;a.Na=0;a.Da=0;a.Ua=262143;a.Fa=253952;a.j|=2;a.l&&nb(a)}function nb(a){a.Na?(a.W=65536,a.H=a.xb,a.M=a.lb,a.jb=a.Sc,Va(a.l,a.ma&16?22:18)):(a.W=0,a.H=a.wb,a.M=a.hc,a.jb=a.Rc,Va(a.l,16))}g.cb=function(){return 0};g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.J,this.Z]);a.set(2,eb(this.l));return a.data()};
|
||||
g.restore=function(a){var b=a[1];this.J=b[1];Kb(this,b[3]);a:{b=this.l;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.G){for(var f=0,h=Array(b.G),l=0;l<e.length-1;)for(var n=e[l++],q=e[l++];n--;)h[f++]=q;e=h}f=b.b[d];if(!f||!f.restore(e)){p("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function M(a){return a.m&65536?1:0}g.ia=function(){return this.o&32768?8:0};function Rb(a){var b=a.M(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}
|
||||
function mb(a,b,c){b={nc:b,sa:c,next:null};a.yb.push(b);return b}function kb(a,b){if(b!=a.U){var c=a.U;if(!c||c.sa<=b.sa)b.next=c,a.U=b;else{do{var d=c.next;if(!d||d.sa<=b.sa){b.next=d;c.next=b;break}c=d}while(c)}}a.j|=2}function Na(a){return a.u=a.u&63728|a.ia()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)}
|
||||
function pb(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.u)&2048)for(var c=a.ra.length;0<=--c;){var d=a.f[c];a.f[c]=a.ra[c];a.ra[c]=d}a.s=b>>14&3;c=a.u>>14&3;a.s!=c&&(a.V[c]=a.f[6],a.f[6]=a.V[a.s]);a.u=b;a.j|=2}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function Sb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function Tb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))}
|
||||
function H(a,b,c){var d=!1;0>a.fa?a.fa=Na(a):a.s||(b=4,d=!0);a.A&57344||(a.la=63222,a.Ya=b);a.s=0;var e=a.M(b|a.W),f=a.M(b+2&65535|a.W);pb(a,f&-12289|a.fa>>2&12288);d&&(a.F|=4,a.f[6]=4);Ub(a,a.fa);Ub(a,a.f[7]);a.f[7]=e&65535;a.j&=-113;a.fa=-1;if(26!=c)throw b;}function Vb(a){var b=Wb(a),c=Wb(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;pb(a,c);a.j&=-17}
|
||||
function Xb(a,b,c){var d,e,f,h=0;d=b>>13;a.ma&a.zb[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Ua;if(f<a.Fa)f&1&&!(c&1)&&(a.F|=64,H(a,4,10));else if(a.ma&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.ma&32&&(f=a.lc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Fa&&4186112>f&&(a.F|=32,H(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:
|
||||
128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Da=a.s,a.Ea=d;h&&(h&57344&&(0<=a.fa&&(h|=128),a.A&57344||(a.A=a.A|h|a.Da<<5|a.Ea<<1),H(a,168,16)),a.A&61440||!(4191360>f||4194239<f)||(a.A|=4096,a.A&512&&(a.j|=32)));return f}function Wb(a){var b=a.M(a.f[6]|a.W);a.f[6]=a.f[6]+2&65535;return b}
|
||||
function Ub(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.la=a.la<<8|246);!a.s&&c<=a.na&&4<c&&(c<=a.na-32?(a.F|=4,a.f[6]=4,H(a,4,18)):(a.F|=8,a.j|=4));a.jb(c,b)}
|
||||
function Yb(a,b,c,d){var e,f,h=d&8?0:a.W;switch(b){case 0:return H(a,4,20),0;case 1:return 6===c&&!a.s&&d&4&&(a.f[6]<=a.na||65534<=a.f[6])&&(a.f[6]<=a.na-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,H(a,4,22)):(a.F|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|h;case 2:f=2;e=a.f[c];7!==c&&(e|=h,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.M(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.M(e)|h;a.a-=
|
||||
8;break;case 6:return e=Rb(a),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=Rb(a),e=e+a.f[c]&65535,e=a.M(e|a.W)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.A&57344||(a.la=a.la<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.na||65534<=a.f[6])&&(a.f[6]<=a.na-32?(a.F|=4,a.f[6]=4,H(a,4,24)):(a.F|=8,a.j|=64));return e}g.wb=function(a,b,c){return Yb(this,a,b,c)};g.xb=function(a,b,c){return Xb(this,Yb(this,a,b,c),c)};g.hc=function(a){return cb(this.l,a)};g.lb=function(a){return cb(this.l,Xb(this,a,2))};
|
||||
g.Rc=function(a,b){db(this.l,a,b&65535)};g.Sc=function(a,b){db(this.l,Xb(this,a,4),b)};function Zb(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Yb(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.M(d|c&a.W),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.V[a.u>>12&3];return c}
|
||||
function $b(a,b,c,d){a.A&57344||(a.la=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Yb(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=Xb(a,e|c&65536,4),a.s=a.u>>14&3,db(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.V[a.u>>12&3]=d}function ac(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.H(b,c,3),a=bb(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?cb(a.l,a.H(b,c,2)):a.f[c]}function bc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Yb(a,b,c,8)}
|
||||
function cc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.H(b,c,3),a=bb(a.l,c)):a=a.f[c]&255;return a}function R(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?cb(a.l,a.H(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.Ra=a.H(b,e,7),c=d.call(a,c,bb(a.l,e)),e&1&&a.a--,a=a.l,a.b[(e&a.i)>>>a.c].Pa(e&a.g,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.H(b,e,6),db(a.l,e,d.call(a,c,cb(a.l,e)))):a.f[e]=d.call(a,c,a.f[e])}
|
||||
function dc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.H(b,e,5),d&1&&a.a--,a=a.l,a.b[(d&a.i)>>>a.c].Pa(d&a.g,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function ec(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?db(a.l,a.H(b,d,4),c):a.f[d]=c&65535;return c}function U(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3}
|
||||
g.pb=function(a){this.h.complete=!0;this.h.ub=!1;this.h.ob=!1;this.da=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168,28):this.j&64?H(this,4,30):this.j&16&&H(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.Za&224)>>5;if(a=this.U&&this.U.sa>c?this.U:null)b=a.nc,c=a.sa;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),H(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.U,c==a)this.U=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j&
|
||||
1&&this.j++;this.A&57344||(this.la=0,this.Ya=this.f[7]);this.j=this.j&7|this.u&16;this.decode(Rb(this))}while(0<this.a);return this.h.complete?this.da-this.a:void 0===this.h.complete?0:-1};u(function(){for(var a=C(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ob(d);B(d,c)}});function fc(a,b){var c=b+a;Sb(this,c,a,b);return c&65535}function gc(a,b){var c=b+a;Sb(this,c<<8,a<<8,b<<8);return c&255}function hc(a,b){a=b<<1;P(this,a);return a&65535}
|
||||
function ic(a,b){a=b<<1;P(this,a<<8);return a&255}function jc(a,b){a=b&32768|b>>1|b<<16;P(this,a);return a&65535}function kc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function lc(a,b){a=b&~a;N(this,a);return a}function mc(a,b){a=b&~a;N(this,a<<8);return a}function nc(a,b){a|=b;N(this,a);return a}function oc(a,b){a|=b;N(this,a<<8);return a}function pc(a,b){a=~b|65536;O(this,a);return a&65535}function qc(a,b){a=~b|256;O(this,a<<8);return a&255}
|
||||
function rc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function sc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function tc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function uc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function vc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function wc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255}
|
||||
function xc(a,b){a=b<<1|this.m>>16&1;P(this,a);return a&65535}function yc(a,b){a=b<<1|this.m>>16&1;P(this,a<<8);return a&255}function zc(a,b){a=(this.m&65536|b)>>1|b<<16;P(this,a);return a&65535}function Ac(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Bc(a,b){var c=b-a;Tb(this,c,a,b);return c&65535}function Cc(a,b){var c=b-a;Tb(this,c<<8,a<<8,b<<8);return c&255}function Dc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}
|
||||
function Ec(a,b){a^=b;N(this,a);return a&65535}function Fc(a){var b=R(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.o=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function Gc(a){var b=R(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.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function V(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}
|
||||
function Ic(a){var b=R(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.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.m=65536,this.a-=7}var Jc=[0,7,7,10,7,11,9,13];function Kc(a){var b=this.a;a=bc(this,a);this.f[7]=a&65535;this.a=b-Jc[this.c]}
|
||||
var Lc=[0,14,14,17,14,18,16,20];function Mc(a){var b=this.a,c=bc(this,a);a=a>>6&7;Ub(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Lc[this.c]}var Nc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Oc=[7,13,13,17,14,18,17,21];function Pc(a){var b=R(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.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}
|
||||
function Qc(){this.a-=5}function W(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.o=32768);this.a-=5}function Rc(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Sc(a){T(this,a,0,Dc);this.a-=this.c?9:3+(7==this.b?2:0)}function Tc(a){T(this,a,Q(this,a),Ec);this.a-=this.c?9:3+(7==this.b?2:0)}function X(){H(this,8,6)}function Pb(a){Uc[a>>12].call(this,a)}
|
||||
var Uc=[function(a){Vc[a>>8&15].call(this,a)},function(a){var b=Q(this,a),c=this.a;N(this,ec(this,a,b));this.a=c-Nc[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=Q(this,a);a=R(this,a);Tb(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){N(this,Q(this,a)&R(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),lc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?
|
||||
2:0)},function(a){T(this,a,Q(this,a),nc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),fc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){Wc[a>>8&15].call(this,a)},function(a){Xc[a>>8&15].call(this,a)},function(a){var b=ac(this,a);N(this,dc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){var b=ac(this,a)<<8;a=cc(this,a)<<8;Tb(this,b-a,a,b);this.a-=this.c?4+
|
||||
(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){N(this,(ac(this,a)&cc(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){S(this,a,ac(this,a),mc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){S(this,a,ac(this,a),oc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),Bc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},X],Vc=[function(a){Yc[a>>
|
||||
4&15].call(this,a)},function(a){U(this,a,!0)},function(a){U(this,a,!!(this.i&65535))},function(a){U(this,a,this.i&65535?0:4)},function(a){U(this,a,!this.ia()==!(this.g&32768))},function(a){U(this,a,!this.ia()!=!(this.g&32768))},function(a){U(this,a,!!(this.i&65535)&&!this.ia()==!(this.g&32768))},function(a){U(this,a,(this.i&65535?0:4)||!this.ia()!=!(this.g&32768))},Mc,Mc,function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>>6&3].call(this,a)},function(a){ad[a>>6&3].call(this,a)},function(a){bd[a>>
|
||||
6&3].call(this,a)},X,X],Zc=[function(a){O(this,ec(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,rc);this.a-=this.c?9:3+(7==this.b?2:0)}],$c=[function(a){T(this,a,0,vc);this.a-=this.c?11:6},function(a){T(this,a,M(this)?1:0,fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,M(this)?1:0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=R(this,
|
||||
a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],ad=[function(a){T(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,hc);this.a-=this.c?9:3+(7==this.b?2:0)}],bd=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.lb(a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Zb(this,a,0);Ub(this,a);N(this,a);this.a-=
|
||||
11},function(a){var b=Wb(this),c=this.a;$b(this,a,0,b);N(this,b);this.a=c-Oc[this.c]},function(a){N(this,ec(this,a,this.ia?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Yc=[function(a){cd[a&15].call(this,a)},X,X,X,Kc,Kc,Kc,Kc,function(a){if(a&8)H(this,8,6);else{var b=Wb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):H(this,8,6)},function(a){dd[a&15].call(this,a)},function(a){ed[a&15].call(this,a)},Sc,
|
||||
Sc,Sc,Sc],cd=[function(){this.u&49152?(this.F|=128,H(this,4,3)):F(this);this.a-=7},function(){this.j&4||this.w.ba();this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Vb(this);this.j|=this.u&16;this.a-=13},function(){H(this,12,1);this.a-=5},function(){H(this,16,4);this.a-=25},function(){this.u&49152||(Qb(this),this.l.reset());this.a-=667},function(){Vb(this);this.a-=13},X,X,X,X,X,X,X,X,X],dd=[Qc,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},V,function(){this.i=1;this.a-=
|
||||
5},V,V,V,function(){this.o=0;this.a-=5},V,V,V,V,V,V,V],ed=[Qc,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],Wc=[Pc,Pc,Ic,Ic,Fc,Fc,Gc,Gc,Tc,Tc,X,X,X,X,Rc,Rc],Xc=[function(a){U(this,a,!this.ia())},function(a){U(this,a,this.ia())},function(a){U(this,a,!M(this)&&!!(this.i&65535))},function(a){U(this,a,M(this)||(this.i&65535?0:4))},function(a){U(this,a,!(this.g&32768))},function(a){U(this,a,
|
||||
this.g&32768?2:0)},function(a){U(this,a,!M(this))},function(a){U(this,a,M(this))},function(){H(this,24,2);this.a-=25},function(){H(this,28,5);this.a-=5},function(a){fd[a>>6&3].call(this,a)},function(a){gd[a>>6&3].call(this,a)},function(a){hd[a>>6&3].call(this,a)},function(a){id[a>>6&3].call(this,a)},X,X],fd=[function(a){O(this,dc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,uc);this.a-=this.c?9:3+(7==this.b?2:
|
||||
0)},function(a){S(this,a,1,sc);this.a-=this.c?9:3+(7==this.b?2:0)}],gd=[function(a){S(this,a,0,wc);this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,gc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=cc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],hd=[function(a){S(this,a,0,Ac);this.a-=this.c?9+(this.Ra&1):3+(7==this.b?2:0)},function(a){S(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,
|
||||
a,0,kc);this.a-=this.c?9+(this.Ra&1):3+(7==this.b?2:0)},function(a){S(this,a,0,ic);this.a-=this.c?9:3+(7==this.b?2:0)}],id=[X,function(a){a=Zb(this,a,65536);Ub(this,a);N(this,a);this.a-=11},function(a){var b=Wb(this),c=this.a;$b(this,a,65536,b);N(this,b);this.a=c-Oc[this.c]},X];
|
||||
function jd(a){v.call(this,"ROM",a,jd);this.b=null;this.o=a.addr;this.c=a.size;this.w=a.writable;this.g=a.alias;this.i=a.file;this.s=ba(this.i);if(this.i){a=this.i;var b=ca(this.s);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){kd(c,a,b,f)})}}x(jd);jd.prototype.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;ld(this)};jd.prototype.aa=function(){this.m&&(this.I&&this.I.a(this.id,this.o,this.c,this.m),delete this.m);return!0};
|
||||
jd.prototype.$=function(){return!0};
|
||||
function kd(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Sa,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,h,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),h=e=0;e<f.length;e++)a.b[h++]=f[e]&255,a.b[h++]=f[e]>>8&255;else if(f=l.data)for(a.b=Array(4*f.length),h=e=0;e<f.length;e++)a.b[h++]=f[e]&255,a.b[h++]=f[e]>>8&255,a.b[h++]=f[e]>>16&255,a.b[h++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){p("Empty ROM: "+b);
|
||||
return}if(1==a.b.length){p(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=aa(b[e]);ld(a)}}
|
||||
function ld(a){if(!Ia(a))if(!a.i)D(a);else if(a.b&&a.l){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+k(a.b.length,8,!0)+") does not match specified size ("+k(a.c,8,!0)+")";a.h.error=!0;a.K(b)}else{b=a.o;if(Ya(a.l,b,a.c,a.w?1:vb)){var c;for(c=0;c<a.b.length;c++){var d=a.l,e=b+c,f=a.b[c];d.o++;d.b[(e&d.i)>>>d.c].qb(e&d.g,f&255,e);d.o--}b=!0}else 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++)d=a,e=b[c],f=Xa(d.l,d.o,d.c),Wa(d.l,
|
||||
e,d.c,f);delete a.b}}D(a)}}u(function(){for(var a=C(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new jd(d);B(d,c)}});function Y(a){v.call(this,"RAM",a,Y);this.g=a.addr;this.c=a.size;this.b=!1}x(Y);Y.prototype.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;!this.b&&this.c&&Ya(this.l,this.g,this.c,1)&&(this.b=!0);this.b||p("No RAM allocated");D(this)};Y.prototype.aa=function(){return!0};Y.prototype.$=function(){return!0};Y.prototype.reset=function(){};
|
||||
u(function(){for(var a=C(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Y(d);B(d,c)}});function md(a){v.call(this,"Keyboard",a,md);D(this)}x(md);md.prototype.T=function(){return!1};md.prototype.ja=function(a,b,c,d){this.w=a;this.a=c;this.I=d};u(function(){for(var a=C(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new md(d);B(d,c)}});
|
||||
function Z(a){this.g=this.m=null;this.G=a.tabSize;this.B=a.charBOL;this.o=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=nd;b&&(void 0===c&&(c="Panel"),(c=z(c,this.id))&&(b=c.v[b])&&this.T(null,a,b))}this.s=this.A=null;this.exports={connect:this.fb,receiveData:this.Xa}}x(Z);var nd="buffer";g=Z.prototype;
|
||||
g.T=function(a,b,c){var d=this;switch(b){case nd:return this.v[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.Xa(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Xa(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
g.ja=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.I=d;var e=this;this.M=mb(this.a,48,4);this.H=jb(this.a,function(){e.b&128||!e.i.length||(e.D=e.i.shift(),e.b|=128,e.b&64&&kb(e.a,e.M))});this.N=mb(this.a,52,4);this.J=jb(this.a,function(){e.c|=128;e.c&64&&kb(e.a,e.N)});gb(b,this,od);D(this)};
|
||||
g.fb=function(){if(!this.s){var a=Gb(this.w,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ia(b[0]);if(c!=this.Ca)return;b=ia(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Sa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.aa=function(a,b){if(!b)if(this.fb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
g.$=function(a){return a?this.save():!0};g.reset=function(){pd(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return pd(this)};function pd(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.Xa=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);lb(this.a,this.H,1);return!0};g.Wb=function(){return this.b&65535};g.Fc=function(a){this.b=this.b&-112|a&111};
|
||||
g.Vb=function(){this.b&=-129;0<this.i.length&&lb(this.a,this.H,1);return this.D};g.Ec=function(){};g.jc=function(){return this.c};g.Uc=function(a){128==(this.c&192)&&a&64&&lb(this.a,this.J,1);this.c=this.c&-70|a&69};g.ic=function(){return 0};
|
||||
g.Tc=function(a){if(a&=255){this.A&&this.A.call(this.s,a);if(this.g)if(13==a)this.o=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.o&&this.o--;else{var b;b=(b=ja[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.G||8,c=a-this.o%a,this.G&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.O(this.m),
|
||||
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;lb(this.a,this.J,1)}};var qd={},od=(qd[65392]=[null,null,Z.prototype.Wb,Z.prototype.Fc,"RCSR"],qd[65394]=[null,null,Z.prototype.Vb,Z.prototype.Ec,"RBUF"],qd[65396]=[null,null,Z.prototype.jc,Z.prototype.Uc,"XCSR"],qd[65398]=[null,null,Z.prototype.ic,Z.prototype.Tc,"XBUF"],qd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Z(d);B(d,c)}});
|
||||
function rd(a,b,c){v.call(this,"Computer",a,rd);this.h.L=!1;sd(this,b);this.B=Gb(this,"autoPower",a);this.g=0;this.M=a.busWidth||a.buswidth;this.b=td;this.s=null;this.o=this.H=!1;this.N=Gb(this,"url")||"";(Math.random()+.1).toString(36);this.c=ud(this);if(this.a=z("CPU",this.id)){this.I=z("Debugger",this.id);this.l=new Oa({id:this.Sa+".bus",busWidth:this.M},this.a,this.I);var d,e=y(this.id);if((this.i=z("Panel",this.id))&&this.i.Qa)for(b=0;b<e.length;b++)d=e[b],d.K=this.i.K,d.O=this.i.O,d.Qa=this.i.Qa;
|
||||
this.O("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.O("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.l,this.a,this.I);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=Gb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=td),this.b&&(this.A=new L(this,
|
||||
"1.30.1"),vd(this.A)?b=null:delete this.A);!b&&this.b&&(b=wd(this))&&(this.o=!0);if(b){var h=this;m(b,null,!0,function(a,b,c){c?(h.w=null,h.o=!1,h.K("Unable to load machine state from server (error "+c+(b?": "+ia(b):"")+")")):(h.s=b,h.H=!0);D(h)})}else D(this);this.v.power||(this.B=!0);!c&&this.B&&xd(this,this.Aa)}else p("Unable to find CPU component")}x(rd);var td=0;
|
||||
function sd(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){p(d.message+" ("+c+")")}}a.J=b}function Gb(a,b,c){var d=b.toLowerCase(),d=Aa[b]||Aa[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 xd(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ia(f)){Ia(f,function(){xd(a,b,c)});return}}b.call(a,c)}
|
||||
function yd(a,b){var c=new L(a,"1.30.1","validate");if(vd(c)&&zd(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=rd.prototype;
|
||||
g.Aa=function(a){void 0===a&&(a=this.b||(this.s?1:td));if(!this.g){this.g++;var b=!1,c=!1;this.G=!1;var d=this.A||new L(this,"1.30.1");if(-1==a)b=!0;else if(a>td){if(vd(d,this.s)){this.m=new L(this,"1.30.1","failsafe");vd(this.m)&&(Ad(this,d),a=2,Bd(this.m));this.m.set("timestamp",la());Cd(this.m);var e=this.b&&!this.o;if(1==a||ma("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=zd(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?vd(d,h):("error"==
|
||||
f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.O(f+": "+h),Bd(d),vd(d)?(c=zd(d),e=!0):c=!1))}e&&yd(this,c?d:null)}else 2==a&&d.clear()}else yd(this);delete this.s;delete this.A}e=y(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=Dd(this,h,d,b,c));b=[d,a,c];-1!=a?xd(this,this.bb,b):this.bb(b)}};
|
||||
function Dd(a,b,c,d,e){if(!b.h.L){b.h.L=!0;if(b.aa){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.aa(f,d)&&f&&(p("Unable to restore state for "+b.type),a.D&&!a.H?(c.clear(),a.b=td,window&&window.location.reload()):a.G=!0,b.aa(null),e=!1)}if(!d&&b.eb)for(a=b.eb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.bb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.h.L=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Dd(this,this.a,b,c,a),this.a.za());this.G&&(Ad(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0};
|
||||
function Ad(a,b){if(ma("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.1"};d.url=a.N;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Ed(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),h=new L(a,"1.30.1","validate"),l=la();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.$&&(c&&F(a.a),d=a.a.$(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;n<l.length;n++){var q=l[n];q.h.L&&(q.$&&(d=q.$(b,c),"object"===typeof d&&f.set(q.id,
|
||||
d)),c&&(q.h.L=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Fd(a,a.c,f.toString()),Cd(h)&&Cd(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.h.L=!1,b=a.v.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.l&&this.l.reset&&this.l.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.l&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ba(!0)};
|
||||
g.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ba(!0)};
|
||||
g.T=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.h.L?Ed(d,!1,!0):xd(d,d.Aa))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.w){var a=ma("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ed(d,a,!0);!a&&d.D?window&&window.location.reload():d.Aa(td)}else d.reset(),d.a&&d.a.za()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.v[b]=
|
||||
c,c.onclick=function(){var a=ud(d,!0);if(a){var b=!!(d.b&&!d.w||d.D),c=Ed(d,b);b?Fd(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function ud(a,b){var c=a.c;c||((c=pa("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=Gd(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
||||
function Gd(a,b){a.c=null;b=m(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(qa("user",b.data),a.c=b.data)}catch(d){p(d.message+" ("+c+")")}return a.c}function wd(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+Hd(a,"1.30.1"));return b}
|
||||
function Fd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Hd(a,"1.30.1");d.data=c;b=m(ea()+"/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.K("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.K(c),qa("user",""),a.c=null)}}
|
||||
g.ba=function(a){this.a&&this.a.ba(a);this.i&&this.i.ba(a)};u(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],h=A(f),h=new rd(h,d,!0);B(h,f);h.B&&xd(h,h.Aa)}});r.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.R&&!c.h.L&&c.Aa(-1)}});
|
||||
r.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.h.L&&Ed(c,!(!c.b||c.w),!0)}});function L(a,b,c){this.id=a.id;this.key=Hd(a,b,c);this.I=a.I;Bd(this,a.Bb)}function Hd(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}
|
||||
L.prototype={constructor:L,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){Bd(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 Bd(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Cd(a){var b=!0;if(oa()){var c=JSON.stringify(a[a.id]);qa(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function zd(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function vd(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:oa()&&(b=pa(a.key))?(a[a.id]=b,a.a=!0):!1}var Id=0;
|
||||
function Jd(a,b,c,d,e,f){e("Loading "+a+"...");m(a,null,!0,function(h,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Kd(l,a,b,c,d,e,f)})}
|
||||
function Kd(a,b,c,d,e,f,h){function l(a,f){if(f)h(f,null);else{c&&(Ga(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(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?e?Ld(a,f,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Ld(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);Ld(a,b,c)}})}else c(a,null)}
|
||||
function Md(a,b,c,d){function e(a){if(void 0===l){var b=h&&C(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=ga(a))}function f(a){e("Error: "+a);n&&(--Id||xa(!0));n=!1}var h,l,n=!0;Id++;Fa[a]={};try{if(h=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],ha=document.createElement("style");ha.type="text/css";ha.styleSheet?ha.styleSheet.cssText=q:ha.appendChild(document.createTextNode(q));t.appendChild(ha)}c||
|
||||
(c="/versions/pdpjs/1.30.1/components.xsl");q=function(d,l){l?Jd(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--Id||xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--Id||xa(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Jd(b,a,d,!0,e,q):Kd(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Hc){f(Hc.message)}return n}window.embedPDP11=function(a,b,c,d){xa(!1);return Md(a,b,c,d)};window.enableEvents=xa;window.sendEvent=ya;})();
|
||||
G.prototype={constructor:G,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ja)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.g.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(Ja)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.ia=!0}return!1},w:function(){return 255},A:function(){},s:function(a,b){return this.Xa(a++,b++)|this.Xa(a,b)<<8},B:function(a,b,c){this.cb(a++,
|
||||
b&255,c++);this.cb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},Y:function(a,b){a&1&&ib(this.l,b);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},ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.ia=!0},ra:function(a,b,c){a&1&&ib(this.l,c);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.ia=!0},G:function(a,b){return this.I(a,b)},
|
||||
R:function(a,b){return this.V(a,b)},$:function(a,b,c){this.v||this.sb(a,b,c)},ga:function(a,b,c){this.v||this.pa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},N:function(a,b){a&1&&ib(this.l,b);return this.g.getUint16(a,!0)},W:function(a,b){a&1&&ib(this.l,b);return this.o[a>>1]},Z:function(a,b){this.c[a]=b;this.ia=!0},da:function(a,b){this.c[a]=b;this.ia=!0},fa:function(a,b,c){a&1&&ib(this.l,c);this.g.setUint16(a,b,!0);this.ia=!0},qa:function(a,b,c){a&1&&ib(this.l,c);this.o[a>>
|
||||
1]=b;this.ia=!0}};function Ta(a,b,c){a.H=b;a.i=a.m=0;c&&((a.i=c.i)&&Ab(a,Bb,!1),(a.m=c.m)&&Cb(a,Bb,!1))}function Cb(a,b,c){c&&a.m||(a.cb=!a.v&&b[1]||a.A,a.Qa=!a.v&&b[3]||a.B);if(c||void 0===c)a.sb=b[1]||a.A,a.pa=b[3]||a.B}function Ab(a,b,c){c&&a.i||(a.Xa=b[0]||a.w,a.S=b[2]||a.s);if(c||void 0===c)a.I=b[0]||a.w,a.V=b[2]||a.s}function wb(a,b){b||(b=Db);Ab(a,b,void 0);Cb(a,b,void 0)}
|
||||
var Db=[],zb=[G.prototype.M,G.prototype.ea,G.prototype.Y,G.prototype.ra],Bb=[G.prototype.G,G.prototype.$,G.prototype.R,G.prototype.ga];if(Ja)var yb=[G.prototype.D,G.prototype.Z,G.prototype.N,G.prototype.fa],xb=[G.prototype.J,G.prototype.da,G.prototype.W,G.prototype.qa];
|
||||
function Eb(a,b){v.call(this,"CPU",a,Eb);var c=a.multiplier||1;this.Ka=a.cycles||b;this.$=c;this.Ua=Math.round(this.Ka/1E4)/100;this.da=this.Ua*this.$;this.h.T=!1;this.h.qb=!1;this.h.Aa=a.autoStart;this.h.Ma=!1;this.Da=this.fa=0;this.Ja=a.csStart;this.pa=a.csInterval;this.qa=a.csStop;this.G=[];this.mb=this.lc.bind(this);D(this)}x(Eb);var Fb=["power","reset"];g=Eb.prototype;
|
||||
g.ka=function(a,b,c,d){this.w=a;this.l=b;this.H=d;for(b=0;b<Fb.length;b++)(c=this.v[Fb[b]])&&this.w.U(null,Fb[b],c);a=Gb(a,"autoStart");null!=a&&(this.h.Aa="true"==a?!0:"false"==a?!1:!!a);D(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.ba=function(a,b){if(!b){if(a&&this.restore){Hb(this);if(!this.restore(a))return!1;Ib(this)}else this.reset();this.O("No debugger detected")}this.w.ca();return!0};g.aa=function(a){return a?this.save():!0};
|
||||
g.Aa=function(){return this.h.Aa||void 0===this.v.run?(Jb(this),!0):!1};g.gb=function(){return 0};function Ib(a){void 0===a.Ja&&(a.Ja=0);void 0===a.pa&&(a.pa=-1);void 0===a.qa&&(a.qa=-1);a.h.Ma=0<=a.Ja&&0<a.pa;a.h.Ma&&(a.Da=0,a.fa=a.Ja-a.J)}
|
||||
g.U=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.v[b]=c,!0;case "run":return this.v[b]=c,c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.h.L)a=!0;else{var b=null,c,l=y(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.h.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.h.L);c++);c==l.length&&(b=a);p("The "+b.type+" component ("+b.id+") is not "+(b.h.ready?"powered yet":"ready yet"+(b.Na?" (waiting for notification)":""))+".");a=!1}a&&(d.h.T?F(d):Jb(d))},!0;case "speed":return this.v[b]=
|
||||
c,!0;case "setSpeed":return this.v[b]=c,c.onclick=function(){Kb(d,d.$<<1)},c.textContent=this.da.toFixed(2)+"Mhz",!0}return!1};g.ca=function(){var a=this.v.speed;a&&(a.textContent=this.h.T&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped")};function Lb(a,b){var c=1;b&&1<a.$&&a.Y&&(c=a.Y/a.Ua);a.kb=Math.round(1E3/30);a.La=Math.floor(a.Ka/30*c);b||(a.ra=a.La);a.Wa=0}function Mb(a){return a.J+a.V+a.ea-a.a}function Hb(a){a.Y=0;a.lb=0;a.J=a.V=a.ea=a.a=0;Ib(a);Kb(a,1)}
|
||||
function Kb(a,b){if(void 0!==b&&(.8>a.Y/a.da&&(b=1),a.$=b,b=a.Ua*a.$,a.da!=b)){a.da=b;b=a.da.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.O("target speed: "+b)}a.J+=a.V;a.V=0;a.N=ka();a.Z=0;Lb(a)}function jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function lb(a,b,c){0<=b&&b<a.G.length&&0>a.G[b][0]&&(c*=a.Ka*a.$/1E3,a.G[b][0]=c+Nb(a))}function Nb(a,b){var c=a.ea-=a.a;a.a=0;b&&(a.ea=0);return c}
|
||||
g.lc=function(){if(this.h.T){this.Wa>=this.Ka&&Lb(this,!0);this.ya=0;this.Ia=ka();if(this.Z){var a=this.Ia-this.Z;a>this.kb&&(this.N+=a,this.N>this.Ia&&(this.N=this.Ia))}try{do{for(var b,c=this.h.Ma?1:this.La,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.rb(b)}catch(n){if("number"!=typeof n)throw n;}b=Nb(this,!0);this.ya+=b;this.V+=b;a=b;if(this.h.Ma){var f=!1;this.Da=this.Da+this.gb()|0;this.fa-=a;0>=this.fa&&(this.fa+=this.pa,f=!0);0<=this.qa&&this.qa<=Mb(this)&&
|
||||
(this.pa=this.qa=-1,Ib(this),F(this),f=!0);f&&this.O(Mb(this)+" cycles: checksum="+k(this.Da))}for(var a=b,h=this.G.length-1;0<=h;h--){var l=this.G[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.ra-=b;if(0>=this.ra){this.ra+=this.La;15<=++this.lb&&(this.w&&this.w.ca(),this.lb=0);break}}while(this.h.T)}catch(n){F(this);this.w&&this.w.stop(ka(),Mb(this));b=n.stack||n.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.mb;this.Z=ka();d=this.kb;this.ya&&(d=Math.round(d*this.ya/
|
||||
this.La));d-=this.Z-this.Ia;if(e=this.Z-this.N)this.Y=Math.round(this.V/(10*e))/100,864E5<=e&&(this.J=0,Kb(this));if(0>d||this.Y<this.da)-1E3>d&&(this.N-=d),d=0;this.Wa+=this.ya;this.Z+=d;b(c,d)}}};function Jb(a){var b;a.h.error?(a.O(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.O(a.toString()+" busy");else{Kb(a);a.h.T=!0;a.h.qb=!0;if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.N,Mb(a));setTimeout(a.mb,0)}}g.rb=function(){return 0};
|
||||
function F(a){if(a.h.T){Nb(a);a.J+=a.V;a.V=0;a.h.T=!1;var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(ka(),Mb(a))}a.h.complete=void 0}function Ob(a){this.jb=+a.model||1170;this.Cb=a.resetAddr||0;Eb.call(this,a,6666667);this.decode=Pb.bind(this);Qb(this);this.R=0;this.W=null;this.h.complete=this.h.wb=!1}x(Ob,Eb);g=Ob.prototype;g.reset=function(){this.h.T&&F(this);Qb(this);Hb(this);this.h.error=!1;this.parent.reset.call(this)};
|
||||
function Qb(a){a.m=65536;a.g=32768;a.i=65535;a.o=32768;a.u=15;a.f=[0,0,0,0,0,0,0,a.Cb];a.sa=[0,0,0,0,0,0];a.X=[0,0,0,0];a.s=0;a.Ga=0;a.Ab=[4,2,0,1];a.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.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],[0,0,0,0,0,0,0,0,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.Db=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.pb=[0,0,0,0,0,0,0,0];a.ob=0;a.j=0;a.B=a.D=0;a.c=a.b=a.Sa=0;a.ga=-1;Rb(a)}function Rb(a){a.oa=255;a.F=0;a.$a=0;a.A=0;a.ma=0;a.Za=0;a.na=0;a.Ba=0;a.Fa=0;a.Va=262143;a.Ha=253952;a.j|=2;a.l&&nb(a)}function nb(a){a.Ba?(a.M=65536,a.I=a.zb,a.S=a.ic,a.Qa=a.Rc,Va(a.l,a.na&16?22:18)):(a.M=0,a.I=a.yb,a.S=a.hc,a.Qa=a.Qc,Va(a.l,16))}g.gb=function(){return 0};
|
||||
g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.J,this.$]);a.set(2,eb(this.l));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Kb(this,b[3]);a:{b=this.l;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,h=Array(b.D),l=0;l<e.length-1;)for(var n=e[l++],q=e[l++];n--;)h[f++]=q;e=h}f=b.b[d];if(!f||!f.restore(e)){p("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function M(a){return a.m&65536?1:0}
|
||||
g.ja=function(){return this.o&32768?8:0};function Sb(a){var b=a.S(a.f[7]);a.f[7]=a.f[7]+2&65535;return b}function mb(a,b){return{nc:a,ta:b,next:null}}function kb(a,b){if(b!=a.W){var c=a.W;if(!c||c.ta<=b.ta)b.next=c,a.W=b;else{do{var d=c.next;if(!d||d.ta<=b.ta){b.next=d;c.next=b;break}c=d}while(c)}}a.j|=2}function Na(a){return a.u=a.u&63728|a.ja()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)}
|
||||
function pb(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.u)&2048)for(var c=a.sa.length;0<=--c;){var d=a.f[c];a.f[c]=a.sa[c];a.sa[c]=d}a.s=b>>14&3;c=a.u>>14&3;a.s!=c&&(a.X[c]=a.f[6],a.f[6]=a.X[a.s]);a.u=b;a.j|=2}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function Tb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function Ub(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))}
|
||||
function H(a,b,c){if(!a.R){var d=!1;0>a.ga?a.ga=Na(a):a.s||(b=4,d=!0);a.A&57344||(a.ma=63222,a.Za=b);a.s=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);pb(a,f&-12289|a.ga>>2&12288);d&&(a.F|=4,a.f[6]=4);Vb(a,a.ga);Vb(a,a.f[7]);a.f[7]=e&65535;a.j&=-113;a.ga=-1;if(26!=c)throw b;}}function Wb(a){var b=Xb(a),c=Xb(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;pb(a,c);a.j&=-17}
|
||||
function Yb(a,b,c){var d,e,f,h=0;d=b>>13;a.na&a.Ab[a.s]||(d&=7);e=a.C[a.s][d];f=(a.P[a.s][d]<<6)+(b&8191)&a.Va;if(f<a.Ha)f&1&&!(c&1)&&(a.F|=64,H(a,4,10));else if(a.na&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.na&32&&(f=a.Db[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ha&&4186112>f&&(a.F|=32,H(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:
|
||||
128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.C[a.s][d]=e;if(4194170!==f||a.s)a.Fa=a.s,a.Ga=d;h&&(h&57344&&(0<=a.ga&&(h|=128),a.A&57344||(a.A=a.A|h|a.Fa<<5|a.Ga<<1),H(a,168,16)),a.A&61440||!(4191360>f||4194239<f)||(a.A|=4096,a.A&512&&(a.j|=32)));return f}function Zb(a,b,c){b&1&&a.a--;a=a.l;a.b[(b&a.i)>>>a.c].cb(b&a.g,c&255,b)}function Xb(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b}
|
||||
function Vb(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A&57344||(a.ma=a.ma<<8|246);!a.s&&c<=a.oa&&4<c&&(c<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,18)):(a.F|=8,a.j|=4));a.Qa(c,b)}
|
||||
function $b(a,b,c,d){var e,f,h=d&8?0:a.M;switch(b){case 0:return H(a,4,20),0;case 1:return 6===c&&!a.s&&d&4&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32||65534<=a.f[6]?(a.F|=4,a.f[6]=4,H(a,4,22)):(a.F|=8,a.j|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|h;case 2:f=2;e=a.f[c];7!==c&&(e|=h,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.S(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.S(e)|h;a.a-=
|
||||
8;break;case 6:return e=Sb(a),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=Sb(a),e=e+a.f[c]&65535,e=a.S(e|a.M)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.A&57344||(a.ma=a.ma<<8|f<<3&248|c);6==c&&!a.s&&d&4&&0>=f&&(a.f[6]<=a.oa||65534<=a.f[6])&&(a.f[6]<=a.oa-32?(a.F|=4,a.f[6]=4,H(a,4,24)):(a.F|=8,a.j|=64));return e}g.ab=function(a,b){this.Ba?(this.R++,Zb(this,Yb(this,a,5),b),this.R--):this.l.ab(a,b)};g.yb=function(a,b,c){return $b(this,a,b,c)};g.zb=function(a,b,c){return Yb(this,$b(this,a,b,c),c)};
|
||||
g.hc=function(a){return cb(this.l,a)};g.ic=function(a){return cb(this.l,Yb(this,a,2))};g.Qc=function(a,b){db(this.l,a,b&65535)};g.Rc=function(a,b){db(this.l,Yb(this,a,4),b)};function ac(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=$b(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.s=a.u>>12&3,c=a.S(d|c&a.M),a.s=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.X[a.u>>12&3];return c}
|
||||
function bc(a,b,c,d){a.A&57344||(a.ma=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=$b(a,b,e,4),c&65536||(e&=65535),a.s=a.u>>12&3,e=Yb(a,e|c&65536,4),a.s=a.u>>14&3,db(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.X[a.u>>12&3]=d}function cc(a,b){b>>=6;var c=a.D=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=bb(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.D=b&7;return(b=a.B=(b&56)>>3)?cb(a.l,a.I(b,c,2)):a.f[c]}function dc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return $b(a,b,c,8)}
|
||||
function ec(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=bb(a.l,c)):a=a.f[c]&255;return a}function R(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?cb(a.l,a.I(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.Sa=a.I(b,e,7),Zb(a,e,d.call(a,c,bb(a.l,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),db(a.l,e,d.call(a,c,cb(a.l,e)))):a.f[e]=d.call(a,c,a.f[e])}
|
||||
function fc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?Zb(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function gc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?db(a.l,a.I(b,d,4),c):a.f[d]=c&65535;return c}function U(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3}
|
||||
g.rb=function(a){this.h.complete=!0;this.h.wb=!1;this.h.qb=!1;this.ea=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?H(this,168,28):this.j&64?H(this,4,30):this.j&16&&H(this,12,32),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;var b=160,c=(this.$a&224)>>5;if(a=this.W&&this.W.ta>c?this.W:null)b=a.nc,c=a.ta;c>(this.u&224)>>5?(this.j&4&&(this.f[7]=this.f[7]+2&65535,this.j&=-5),H(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.j&
|
||||
1&&this.j++;this.A&57344||(this.ma=0,this.Za=this.f[7]);this.j=this.j&7|this.u&16;this.decode(Sb(this))}while(0<this.a);return this.h.complete?this.ea-this.a:void 0===this.h.complete?0:-1};u(function(){for(var a=C(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ob(d);B(d,c)}});function hc(a,b){var c=b+a;Tb(this,c,a,b);return c&65535}function ic(a,b){var c=b+a;Tb(this,c<<8,a<<8,b<<8);return c&255}function jc(a,b){a=b<<1;P(this,a);return a&65535}
|
||||
function kc(a,b){a=b<<1;P(this,a<<8);return a&255}function lc(a,b){a=b&32768|b>>1|b<<16;P(this,a);return a&65535}function mc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function nc(a,b){a=b&~a;N(this,a);return a}function oc(a,b){a=b&~a;N(this,a<<8);return a}function pc(a,b){a|=b;N(this,a);return a}function qc(a,b){a|=b;N(this,a<<8);return a}function rc(a,b){a=~b|65536;O(this,a);return a&65535}function sc(a,b){a=~b|256;O(this,a<<8);return a&255}
|
||||
function tc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function uc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function vc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function wc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function xc(a,b){a=-b;O(this,a,a&b&32768);return a&65535}function yc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255}
|
||||
function zc(a,b){a=b<<1|this.m>>16&1;P(this,a);return a&65535}function Ac(a,b){a=b<<1|this.m>>16&1;P(this,a<<8);return a&255}function Bc(a,b){a=(this.m&65536|b)>>1|b<<16;P(this,a);return a&65535}function Cc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Dc(a,b){var c=b-a;Ub(this,c,a,b);return c&65535}function Ec(a,b){var c=b-a;Ub(this,c<<8,a<<8,b<<8);return c&255}function Fc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}
|
||||
function Gc(a,b){a^=b;N(this,a);return a&65535}function Hc(a){var b=R(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.o=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function Ic(a){var b=R(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.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function V(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5}
|
||||
function Kc(a){var b=R(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.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.m=65536,this.a-=7}var Lc=[0,7,7,10,7,11,9,13];function Mc(a){var b=this.a;a=dc(this,a);this.f[7]=a&65535;this.a=b-Lc[this.c]}
|
||||
var Nc=[0,14,14,17,14,18,16,20];function Oc(a){var b=this.a,c=dc(this,a);a=a>>6&7;Vb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Nc[this.c]}var Pc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Qc=[7,13,13,17,14,18,17,21];function Rc(a){var b=R(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.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}
|
||||
function Sc(){this.a-=5}function W(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.o=32768);this.a-=5}function Tc(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Uc(a){T(this,a,0,Fc);this.a-=this.c?9:3+(7==this.b?2:0)}function Vc(a){T(this,a,Q(this,a),Gc);this.a-=this.c?9:3+(7==this.b?2:0)}function X(){H(this,8,6)}function Pb(a){Wc[a>>12].call(this,a)}
|
||||
var Wc=[function(a){Xc[a>>8&15].call(this,a)},function(a){var b=Q(this,a),c=this.a;N(this,gc(this,a,b));this.a=c-Pc[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=Q(this,a);a=R(this,a);Ub(this,b-a,a,b);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){N(this,Q(this,a)&R(this,a));this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),nc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?
|
||||
2:0)},function(a){T(this,a,Q(this,a),pc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),hc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){Yc[a>>8&15].call(this,a)},function(a){Zc[a>>8&15].call(this,a)},function(a){var b=cc(this,a);N(this,fc(this,a,b,1)<<8);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){var b=cc(this,a)<<8;a=ec(this,a)<<8;Ub(this,b-a,a,b);this.a-=this.c?4+
|
||||
(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){N(this,(cc(this,a)&ec(this,a))<<8);this.a-=this.c?4+(this.D&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)},function(a){S(this,a,cc(this,a),oc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){S(this,a,cc(this,a),qc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),Dc);this.a-=this.c?9+(this.D&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)},X],Xc=[function(a){$c[a>>
|
||||
4&15].call(this,a)},function(a){U(this,a,!0)},function(a){U(this,a,!!(this.i&65535))},function(a){U(this,a,this.i&65535?0:4)},function(a){U(this,a,!this.ja()==!(this.g&32768))},function(a){U(this,a,!this.ja()!=!(this.g&32768))},function(a){U(this,a,!!(this.i&65535)&&!this.ja()==!(this.g&32768))},function(a){U(this,a,(this.i&65535?0:4)||!this.ja()!=!(this.g&32768))},Oc,Oc,function(a){ad[a>>6&3].call(this,a)},function(a){bd[a>>6&3].call(this,a)},function(a){cd[a>>6&3].call(this,a)},function(a){dd[a>>
|
||||
6&3].call(this,a)},X,X],ad=[function(a){O(this,gc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)}],bd=[function(a){T(this,a,0,xc);this.a-=this.c?11:6},function(a){T(this,a,M(this)?1:0,hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,M(this)?1:0,Dc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=R(this,
|
||||
a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],cd=[function(a){T(this,a,0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jc);this.a-=this.c?9:3+(7==this.b?2:0)}],dd=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.M);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=ac(this,a,0);Vb(this,a);N(this,a);this.a-=
|
||||
11},function(a){var b=Xb(this),c=this.a;bc(this,a,0,b);N(this,b);this.a=c-Qc[this.c]},function(a){N(this,gc(this,a,this.ja?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],$c=[function(a){ed[a&15].call(this,a)},X,X,X,Mc,Mc,Mc,Mc,function(a){if(a&8)H(this,8,6);else{var b=Xb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):H(this,8,6)},function(a){fd[a&15].call(this,a)},function(a){gd[a&15].call(this,a)},Uc,
|
||||
Uc,Uc,Uc],ed=[function(){this.u&49152?(this.F|=128,H(this,4,3)):F(this);this.a-=7},function(){this.j&4||this.w.ca();this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Wb(this);this.j|=this.u&16;this.a-=13},function(){H(this,12,1);this.a-=5},function(){H(this,16,4);this.a-=25},function(){this.u&49152||(Rb(this),this.l.reset());this.a-=667},function(){Wb(this);this.a-=13},X,X,X,X,X,X,X,X,X],fd=[Sc,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},V,function(){this.i=1;this.a-=
|
||||
5},V,V,V,function(){this.o=0;this.a-=5},V,V,V,V,V,V,V],gd=[Sc,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],Yc=[Rc,Rc,Kc,Kc,Hc,Hc,Ic,Ic,Vc,Vc,X,X,X,X,Tc,Tc],Zc=[function(a){U(this,a,!this.ja())},function(a){U(this,a,this.ja())},function(a){U(this,a,!M(this)&&!!(this.i&65535))},function(a){U(this,a,M(this)||(this.i&65535?0:4))},function(a){U(this,a,!(this.g&32768))},function(a){U(this,a,
|
||||
this.g&32768?2:0)},function(a){U(this,a,!M(this))},function(a){U(this,a,M(this))},function(){H(this,24,2);this.a-=25},function(){H(this,28,5);this.a-=5},function(a){hd[a>>6&3].call(this,a)},function(a){id[a>>6&3].call(this,a)},function(a){jd[a>>6&3].call(this,a)},function(a){kd[a>>6&3].call(this,a)},X,X],hd=[function(a){O(this,fc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,wc);this.a-=this.c?9:3+(7==this.b?2:
|
||||
0)},function(a){S(this,a,1,uc);this.a-=this.c?9:3+(7==this.b?2:0)}],id=[function(a){S(this,a,0,yc);this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ec(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],jd=[function(a){S(this,a,0,Cc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b?2:0)},function(a){S(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,
|
||||
a,0,mc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b?2:0)},function(a){S(this,a,0,kc);this.a-=this.c?9:3+(7==this.b?2:0)}],kd=[X,function(a){a=ac(this,a,65536);Vb(this,a);N(this,a);this.a-=11},function(a){var b=Xb(this),c=this.a;bc(this,a,65536,b);N(this,b);this.a=c-Qc[this.c]},X];
|
||||
function ld(a){v.call(this,"ROM",a,ld);this.b=null;this.o=a.addr;this.c=a.size;this.w=a.writable;this.g=a.alias;this.i=a.file;this.s=ba(this.i);if(this.i){a=this.i;var b=ca(this.s);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){md(c,a,b,f)})}}x(ld);ld.prototype.ka=function(a,b,c,d){this.l=b;this.a=c;this.H=d;nd(this)};ld.prototype.ba=function(){this.m&&(this.H&&this.H.a(this.id,this.o,this.c,this.m),delete this.m);return!0};
|
||||
ld.prototype.aa=function(){return!0};
|
||||
function md(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ta,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,h,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),h=e=0;e<f.length;e++)a.b[h++]=f[e]&255,a.b[h++]=f[e]>>8&255;else if(f=l.data)for(a.b=Array(4*f.length),h=e=0;e<f.length;e++)a.b[h++]=f[e]&255,a.b[h++]=f[e]>>8&255,a.b[h++]=f[e]>>16&255,a.b[h++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){p("Empty ROM: "+b);
|
||||
return}if(1==a.b.length){p(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e<b.length;e++)a.b[e]=aa(b[e]);nd(a)}}
|
||||
function nd(a){if(!Ia(a))if(!a.i)D(a);else if(a.b&&a.l){a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+k(a.b.length,8,!0)+") does not match specified size ("+k(a.c,8,!0)+")";a.h.error=!0;a.K(b)}else{b=a.o;if(Ya(a.l,b,a.c,a.w?1:vb)){var c;for(c=0;c<a.b.length;c++)a.l.ab(b+c,a.b[c]);b=!0}else 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=Xa(d.l,d.o,d.c);Wa(d.l,e,d.c,f)}delete a.b}}D(a)}}
|
||||
u(function(){for(var a=C(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new ld(d);B(d,c)}});function Y(a){v.call(this,"RAM",a,Y);this.g=a.addr;this.c=a.size;this.b=!1}x(Y);Y.prototype.ka=function(a,b,c,d){this.l=b;this.a=c;this.H=d;!this.b&&this.c&&Ya(this.l,this.g,this.c,1)&&(this.b=!0);this.b||p("No RAM allocated");D(this)};Y.prototype.ba=function(){return!0};Y.prototype.aa=function(){return!0};Y.prototype.reset=function(){};
|
||||
u(function(){for(var a=C(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Y(d);B(d,c)}});function od(a){v.call(this,"Keyboard",a,od);D(this)}x(od);od.prototype.U=function(){return!1};od.prototype.ka=function(a,b,c,d){this.w=a;this.a=c;this.H=d};u(function(){for(var a=C(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new od(d);B(d,c)}});
|
||||
function Z(a){this.g=this.m=null;this.G=a.tabSize;this.B=a.charBOL;this.o=0;v.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=pd;b&&(void 0===c&&(c="Panel"),(c=z(c,this.id))&&(b=c.v[b])&&this.U(null,a,b))}this.s=this.A=null;this.exports={connect:this.ib,receiveData:this.Ya}}x(Z);var pd="buffer";g=Z.prototype;
|
||||
g.U=function(a,b,c){var d=this;switch(b){case pd:return this.v[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.Ya(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Ya(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
g.ka=function(a,b,c,d){this.w=a;this.l=b;this.a=c;this.H=d;var e=this;this.M=mb(48,4);this.I=jb(this.a,function(){e.b&128||!e.i.length||(e.D=e.i.shift(),e.b|=128,e.b&64&&kb(e.a,e.M))});this.N=mb(52,4);this.J=jb(this.a,function(){e.c|=128;e.c&64&&kb(e.a,e.N)});gb(b,this,qd);D(this)};
|
||||
g.ib=function(){if(!this.s){var a=Gb(this.w,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ha(b[0]);if(c!=this.Ea)return;b=ha(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.A=d.receiveData){this.status(this.Ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ba=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
g.aa=function(a){return a?this.save():!0};g.reset=function(){rd(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return rd(this)};function rd(a){a.D=0;a.b=0;a.c=128;a.i=[];return!0}g.Ya=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);lb(this.a,this.I,1);return!0};g.Xb=function(){return this.b&65535};g.Fc=function(a){this.b=this.b&-112|a&111};
|
||||
g.Wb=function(){this.b&=-129;0<this.i.length&&lb(this.a,this.I,1);return this.D};g.Ec=function(){};g.kc=function(){return this.c};g.Tc=function(a){128==(this.c&192)&&a&64&&lb(this.a,this.J,1);this.c=this.c&-70|a&69};g.jc=function(){return 0};
|
||||
g.Sc=function(a){if(a&=255){this.A&&this.A.call(this.s,a);if(this.g)if(13==a)this.o=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.o&&this.o--;else{var b;b=(b=ja[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.G||8,c=a-this.o%a,this.G&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.O(this.m),
|
||||
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;lb(this.a,this.J,1)}};var sd={},qd=(sd[65392]=[null,null,Z.prototype.Xb,Z.prototype.Fc,"RCSR"],sd[65394]=[null,null,Z.prototype.Wb,Z.prototype.Ec,"RBUF"],sd[65396]=[null,null,Z.prototype.kc,Z.prototype.Tc,"XCSR"],sd[65398]=[null,null,Z.prototype.jc,Z.prototype.Sc,"XBUF"],sd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Z(d);B(d,c)}});
|
||||
function td(a,b,c){v.call(this,"Computer",a,td);this.h.L=!1;ud(this,b);this.B=Gb(this,"autoPower",a);this.g=0;this.M=a.busWidth||a.buswidth;this.b=vd;this.s=null;this.o=this.I=!1;this.N=Gb(this,"url")||"";(Math.random()+.1).toString(36);this.c=wd(this);if(this.a=z("CPU",this.id)){this.H=z("Debugger",this.id);this.l=new Oa({id:this.Ta+".bus",busWidth:this.M},this.a,this.H);var d,e=y(this.id);if((this.i=z("Panel",this.id))&&this.i.Ra)for(b=0;b<e.length;b++)d=e[b],d.K=this.i.K,d.O=this.i.O,d.Ra=this.i.Ra;
|
||||
this.O("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.O("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.ka&&d.ka(this,this.l,this.a,this.H);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.w=d:this.b=parseInt(d,10));var f;if(a=Gb(this,"state")||(f=!0,a.state))b=this.D=a,f||(this.o=!0,this.b=vd),this.b&&(this.A=new L(this,
|
||||
"1.30.1"),xd(this.A)?b=null:delete this.A);!b&&this.b&&(b=yd(this))&&(this.o=!0);if(b){var h=this;m(b,null,!0,function(a,b,c){c?(h.w=null,h.o=!1,h.K("Unable to load machine state from server (error "+c+(b?": "+ha(b):"")+")")):(h.s=b,h.I=!0);D(h)})}else D(this);this.v.power||(this.B=!0);!c&&this.B&&zd(this,this.Ca)}else p("Unable to find CPU component")}x(td);var vd=0;
|
||||
function ud(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){p(d.message+" ("+c+")")}}a.J=b}function Gb(a,b,c){var d=b.toLowerCase(),d=Aa[b]||Aa[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 zd(a,b,c){for(var d=y(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ia(f)){Ia(f,function(){zd(a,b,c)});return}}b.call(a,c)}
|
||||
function Ad(a,b){var c=new L(a,"1.30.1","validate");if(xd(c)&&Bd(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=td.prototype;
|
||||
g.Ca=function(a){void 0===a&&(a=this.b||(this.s?1:vd));if(!this.g){this.g++;var b=!1,c=!1;this.G=!1;var d=this.A||new L(this,"1.30.1");if(-1==a)b=!0;else if(a>vd){if(xd(d,this.s)){this.m=new L(this,"1.30.1","failsafe");xd(this.m)&&(Cd(this,d),a=2,Dd(this.m));this.m.set("timestamp",la());Ed(this.m);var e=this.b&&!this.o;if(1==a||ma("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Bd(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?xd(d,h):("error"==
|
||||
f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.O(f+": "+h),Dd(d),xd(d)?(c=Bd(d),e=!0):c=!1))}e&&Ad(this,c?d:null)}else 2==a&&d.clear()}else Ad(this);delete this.s;delete this.A}e=y(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=Fd(this,h,d,b,c));b=[d,a,c];-1!=a?zd(this,this.fb,b):this.fb(b)}};
|
||||
function Fd(a,b,c,d,e){if(!b.h.L){b.h.L=!0;if(b.ba){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.ba(f,d)&&f&&(p("Unable to restore state for "+b.type),a.D&&!a.I?(c.clear(),a.b=vd,window&&window.location.reload()):a.G=!0,b.ba(null),e=!1)}if(!d&&b.hb)for(a=b.hb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
g.fb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.h.L=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Fd(this,this.a,b,c,a),this.a.Aa());this.G&&(Cd(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0};
|
||||
function Cd(a,b){if(ma("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.1"};d.url=a.N;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Gd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),h=new L(a,"1.30.1","validate"),l=la();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.aa&&(c&&F(a.a),d=a.a.aa(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;n<l.length;n++){var q=l[n];q.h.L&&(q.aa&&(d=q.aa(b,c),"object"===typeof d&&f.set(q.id,
|
||||
d)),c&&(q.h.L=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&Hd(a,a.c,f.toString()),Ed(h)&&Ed(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.h.L=!1,b=a.v.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.l&&this.l.reset&&this.l.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.l&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ca(!0)};
|
||||
g.stop=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ca(!0)};
|
||||
g.U=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.h.L?Gd(d,!1,!0):zd(d,d.Ca))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.w){var a=ma("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Gd(d,a,!0);!a&&d.D?window&&window.location.reload():d.Ca(vd)}else d.reset(),d.a&&d.a.Aa()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.v[b]=
|
||||
c,c.onclick=function(){var a=wd(d,!0);if(a){var b=!!(d.b&&!d.w||d.D),c=Gd(d,b);b?Hd(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function wd(a,b){var c=a.c;c||((c=pa("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=Id(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
|
||||
function Id(a,b){a.c=null;b=m(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(qa("user",b.data),a.c=b.data)}catch(d){p(d.message+" ("+c+")")}return a.c}function yd(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+Jd(a,"1.30.1"));return b}
|
||||
function Hd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Jd(a,"1.30.1");d.data=c;b=m(ea()+"/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.K("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.K(c),qa("user",""),a.c=null)}}
|
||||
g.ca=function(a){this.a&&this.a.ca(a);this.i&&this.i.ca(a)};u(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],h=A(f),h=new td(h,d,!0);B(h,f);h.B&&zd(h,h.Ca)}});r.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.R&&!c.h.L&&c.Ca(-1)}});
|
||||
r.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=z("Computer",c.id))&&c.h.L&&Gd(c,!(!c.b||c.w),!0)}});function L(a,b,c){this.id=a.id;this.key=Jd(a,b,c);this.H=a.H;Dd(this,a.Bb)}function Jd(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}
|
||||
L.prototype={constructor:L,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){Dd(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 Dd(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function Ed(a){var b=!0;if(oa()){var c=JSON.stringify(a[a.id]);qa(a.key,c)||(p("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Bd(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){p(c.message||c),b=!1}return b}function xd(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:oa()&&(b=pa(a.key))?(a[a.id]=b,a.a=!0):!1}var Kd=0;
|
||||
function Ld(a,b,c,d,e,f){e("Loading "+a+"...");m(a,null,!0,function(h,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):Md(l,a,b,c,d,e,f)})}
|
||||
function Md(a,b,c,d,e,f,h){function l(a,f){if(f)h(f,null);else{c&&(Ga(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(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?e?Nd(a,f,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Nd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],h);Nd(a,b,c)}})}else c(a,null)}
|
||||
function Od(a,b,c,d){function e(a){if(void 0===l){var b=h&&C(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=ga(a))}function f(a){e("Error: "+a);n&&(--Kd||xa(!0));n=!1}var h,l,n=!0;Kd++;Fa[a]={};try{if(h=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],ia=document.createElement("style");ia.type="text/css";ia.styleSheet?ia.styleSheet.cssText=q:ia.appendChild(document.createTextNode(q));t.appendChild(ia)}c||
|
||||
(c="/versions/pdpjs/1.30.1/components.xsl");q=function(d,l){l?Ld(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--Kd||xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--Kd||xa(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ld(b,a,d,!0,e,q):Md(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Jc){f(Jc.message)}return n}window.embedPDP11=function(a,b,c,d){xa(!1);return Od(a,b,c,d)};window.enableEvents=xa;window.sendEvent=ya;})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue