Added another example of an I/O address handler (XCSR)
This commit is contained in:
parent
da617d454d
commit
a451bbc5bc
6 changed files with 391 additions and 334 deletions
|
|
@ -591,7 +591,7 @@ PDP11.opCLR = function(opCode)
|
|||
*/
|
||||
PDP11.opCLRB = function(opCode)
|
||||
{
|
||||
this.updateNZCFlags(this.writeByteByMode(opCode, 0, PDP11.WRITE.ZERO));
|
||||
this.updateNZCFlags(this.writeByteByMode(opCode, 0));
|
||||
this.nStepCycles -= 1;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -205,9 +205,9 @@ CPUStatePDP11.prototype.resetRegs = function()
|
|||
* Define getAddr(), readWord(), etc, handlers appropriate for the current MMU mode.
|
||||
*
|
||||
* The initial goal is to eliminate unnecessary calls to mapVirtualToPhysical(); for example,
|
||||
* readWordByVirtual() always does this:
|
||||
* readWordFromVirtual() always does this:
|
||||
*
|
||||
* return this.readWordByPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ));
|
||||
* return this.readWordFromPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ));
|
||||
*
|
||||
* and getAddrVirtual() -- formerly getAddrByMode() -- always does this:
|
||||
*
|
||||
|
|
@ -222,11 +222,11 @@ CPUStatePDP11.prototype.initMemoryAccess = function()
|
|||
if (this.mmuEnable) {
|
||||
this.addrDSpace = PDP11.ACCESS.DSPACE;
|
||||
this.getAddr = this.getAddrVirtual;
|
||||
this.readWord = this.readWordByVirtual;
|
||||
this.readWord = this.readWordFromVirtual;
|
||||
} else {
|
||||
this.addrDSpace = 0;
|
||||
this.getAddr = this.getAddrPhysical;
|
||||
this.readWord = this.readWordByPhysical;
|
||||
this.readWord = this.readWordFromPhysical;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -594,7 +594,7 @@ CPUStatePDP11.prototype.interrupt = function(delay, priority, vector, callback)
|
|||
}
|
||||
this.interruptQueue.splice(i + 1, 0, {
|
||||
"delay": delay,
|
||||
"priority": priority & 0xe0,
|
||||
"priority": (priority << 5) & 0xe0,
|
||||
"vector": vector,
|
||||
"callback": callback
|
||||
});
|
||||
|
|
@ -771,8 +771,8 @@ CPUStatePDP11.prototype.trap = function(vector, reason)
|
|||
this.MMR2 = vector;
|
||||
}
|
||||
this.mmuMode = 0; // read from kernel D space
|
||||
if ((newPC = this.readWordByVirtual(vector | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((newPSW = this.readWordByVirtual(((vector + 2) & 0xffff) | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((newPC = this.readWordFromVirtual(vector | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((newPSW = this.readWordFromVirtual(((vector + 2) & 0xffff) | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
this.setPSW((newPSW & 0xcfff) | ((this.trapPSW >> 2) & 0x3000)); // set new this.PSW with previous mode
|
||||
if (doubleTrap) {
|
||||
this.regCPUErr |= PDP11.CPUERR.RED;
|
||||
|
|
@ -964,13 +964,13 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl
|
|||
};
|
||||
|
||||
/**
|
||||
* readWordByPhysical(physicalAddress) [formerly readWordByAddr]
|
||||
* readWordFromPhysical(physicalAddress) [formerly readWordByAddr]
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} physicalAddress
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.readWordByPhysical = function(physicalAddress)
|
||||
CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress)
|
||||
{
|
||||
if (physicalAddress >= BusPDP11.MAX_ADDRESS) {
|
||||
return this.regsGen[physicalAddress - BusPDP11.MAX_ADDRESS];
|
||||
|
|
@ -987,25 +987,25 @@ CPUStatePDP11.prototype.readWordByPhysical = function(physicalAddress)
|
|||
};
|
||||
|
||||
/**
|
||||
* readWordByVirtual(virtualAddress)
|
||||
* readWordFromVirtual(virtualAddress)
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} virtualAddress (input address is 17 bit (I&D))
|
||||
*/
|
||||
CPUStatePDP11.prototype.readWordByVirtual = function(virtualAddress)
|
||||
CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress)
|
||||
{
|
||||
return this.readWordByPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ));
|
||||
return this.readWordFromPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ));
|
||||
};
|
||||
|
||||
/**
|
||||
* writeWordByPhysical(physicalAddress, data) [formerly writeWordByAddr]
|
||||
* writeWordToPhysical(physicalAddress, data) [formerly writeWordByAddr]
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} physicalAddress
|
||||
* @param {number} data
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.writeWordByPhysical = function(physicalAddress, data)
|
||||
CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data)
|
||||
{
|
||||
data &= 0xffff;
|
||||
if (physicalAddress >= BusPDP11.MAX_ADDRESS) {
|
||||
|
|
@ -1024,13 +1024,13 @@ CPUStatePDP11.prototype.writeWordByPhysical = function(physicalAddress, data)
|
|||
};
|
||||
|
||||
/**
|
||||
* readByteByPhysical(physicalAddress) [formerly readByteByAddr]
|
||||
* readByteFromPhysical(physicalAddress) [formerly readByteByAddr]
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} physicalAddress
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.readByteByPhysical = function(physicalAddress)
|
||||
CPUStatePDP11.prototype.readByteFromPhysical = function(physicalAddress)
|
||||
{
|
||||
var result;
|
||||
if (physicalAddress >= BusPDP11.MAX_ADDRESS) {
|
||||
|
|
@ -1048,14 +1048,14 @@ CPUStatePDP11.prototype.readByteByPhysical = function(physicalAddress)
|
|||
};
|
||||
|
||||
/**
|
||||
* writeByteByPhysical(physicalAddress, data) [formerly writeByteByAddr]
|
||||
* writeByteToPhysical(physicalAddress, data) [formerly writeByteByAddr]
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} physicalAddress
|
||||
* @param {number} data
|
||||
* @return {number}
|
||||
*/
|
||||
CPUStatePDP11.prototype.writeByteByPhysical = function(physicalAddress, data)
|
||||
CPUStatePDP11.prototype.writeByteToPhysical = function(physicalAddress, data)
|
||||
{
|
||||
data &= 0xff;
|
||||
if (physicalAddress >= BusPDP11.MAX_ADDRESS) {
|
||||
|
|
@ -1081,7 +1081,7 @@ CPUStatePDP11.prototype.writeByteByPhysical = function(physicalAddress, data)
|
|||
*/
|
||||
CPUStatePDP11.prototype.popWord = function()
|
||||
{
|
||||
var result = this.readWordByVirtual(this.regsGen[6] | PDP11.ACCESS.DSPACE);
|
||||
var result = this.readWordFromVirtual(this.regsGen[6] | PDP11.ACCESS.DSPACE);
|
||||
if (result >= 0) {
|
||||
this.regsGen[6] = (this.regsGen[6] + 2) & 0xffff;
|
||||
}
|
||||
|
|
@ -1113,7 +1113,7 @@ CPUStatePDP11.prototype.pushWord = function(data)
|
|||
}
|
||||
}
|
||||
if ((physicalAddress = this.mapVirtualToPhysical(virtualAddress | PDP11.ACCESS.DSPACE, PDP11.ACCESS.WRITE)) >= 0) {
|
||||
return this.writeWordByPhysical(physicalAddress, data);
|
||||
return this.writeWordToPhysical(physicalAddress, data);
|
||||
}
|
||||
return physicalAddress;
|
||||
};
|
||||
|
|
@ -1185,7 +1185,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags)
|
|||
stepSize = 2;
|
||||
virtualAddress = this.regsGen[reg];
|
||||
if (reg !== 7) virtualAddress |= this.addrDSpace;
|
||||
if ((virtualAddress = this.readWordByVirtual(virtualAddress)) < 0) {
|
||||
if ((virtualAddress = this.readWordFromVirtual(virtualAddress)) < 0) {
|
||||
return virtualAddress;
|
||||
}
|
||||
// if (reg === 7) LOG_ADDRESS(virtualAddress); // @#n not operational
|
||||
|
|
@ -1203,13 +1203,13 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags)
|
|||
stepSize = -2;
|
||||
virtualAddress = (this.regsGen[reg] - 2) & 0xffff;
|
||||
if (reg !== 7) virtualAddress |= this.addrDSpace;
|
||||
if ((virtualAddress = this.readWordByVirtual(virtualAddress)) < 0) {
|
||||
if ((virtualAddress = this.readWordFromVirtual(virtualAddress)) < 0) {
|
||||
return virtualAddress;
|
||||
}
|
||||
virtualAddress |= this.addrDSpace;
|
||||
break;
|
||||
case 6: // Mode 6: d(R)
|
||||
if ((virtualAddress = this.readWordByVirtual(this.regsGen[7])) < 0) {
|
||||
if ((virtualAddress = this.readWordFromVirtual(this.regsGen[7])) < 0) {
|
||||
return virtualAddress;
|
||||
}
|
||||
this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff;
|
||||
|
|
@ -1222,7 +1222,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags)
|
|||
}
|
||||
return virtualAddress | this.addrDSpace;
|
||||
case 7: // Mode 7: @d(R)
|
||||
if ((virtualAddress = this.readWordByVirtual(this.regsGen[7])) < 0) {
|
||||
if ((virtualAddress = this.readWordFromVirtual(this.regsGen[7])) < 0) {
|
||||
return virtualAddress;
|
||||
}
|
||||
this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff;
|
||||
|
|
@ -1233,7 +1233,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags)
|
|||
virtualAddress = (virtualAddress + this.regsGen[reg]) & 0xffff;
|
||||
//LOG_ADDRESS(virtualAddress);
|
||||
}
|
||||
if ((virtualAddress = this.readWordByVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) < 0) {
|
||||
if ((virtualAddress = this.readWordFromVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) < 0) {
|
||||
return virtualAddress;
|
||||
}
|
||||
return virtualAddress | this.addrDSpace;
|
||||
|
|
@ -1306,7 +1306,7 @@ CPUStatePDP11.prototype.readWordByMode = function(addressMode)
|
|||
result = this.regsGen[addressMode & PDP11.OPREG.MASK];
|
||||
} else {
|
||||
/*
|
||||
* NOTE: This used to call readWordByPhysical(), after calling getAddrVirtual(), but the latter is
|
||||
* NOTE: This used to call readWordFromPhysical(), after calling getAddrVirtual(), but the latter is
|
||||
* just a wrapper around mapVirtualToPhysical() on the result from getVirtualByMode(), so now we call
|
||||
* getVirtualByMode() directly, knowing that the current readWord() will call the correct function.
|
||||
*/
|
||||
|
|
@ -1328,7 +1328,7 @@ CPUStatePDP11.prototype.readByteByMode = function(addressMode)
|
|||
if (!(addressMode & 0x38)) {
|
||||
result = this.regsGen[addressMode & 7] & 0xff;
|
||||
} else {
|
||||
result = this.readByteByPhysical(this.getAddr(addressMode, PDP11.ACCESS.READ_BYTE));
|
||||
result = this.readByteFromPhysical(this.getAddr(addressMode, PDP11.ACCESS.READ_BYTE));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -1352,7 +1352,7 @@ CPUStatePDP11.prototype.updateWordByMode = function(addressMode, src, fnOp)
|
|||
this.regsGen[reg] = (data = fnOp.call(this, src, this.regsGen[reg]) & 0xffff);
|
||||
} else {
|
||||
var addr = this.getAddr(addressMode, PDP11.ACCESS.UPDATE);
|
||||
this.writeWordByPhysical(addr, (data = fnOp.call(this, src, this.readWordByPhysical(addr))));
|
||||
this.writeWordToPhysical(addr, (data = fnOp.call(this, src, this.readWordFromPhysical(addr))));
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
|
@ -1376,7 +1376,7 @@ CPUStatePDP11.prototype.updateByteByMode = function(addressMode, src, fnOp)
|
|||
this.regsGen[reg] = (this.regsGen[reg] & 0xff00) | ((data = fnOp.call(this, src, this.regsGen[reg]) & 0xff));
|
||||
} else {
|
||||
var addr = this.getAddr(addressMode, PDP11.ACCESS.UPDATE_BYTE);
|
||||
this.writeByteByPhysical(addr, (data = fnOp.call(this, src, this.readByteByPhysical(addr))));
|
||||
this.writeByteToPhysical(addr, (data = fnOp.call(this, src, this.readByteFromPhysical(addr))));
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
|
@ -1396,7 +1396,7 @@ CPUStatePDP11.prototype.writeWordByMode = function(addressMode, data)
|
|||
if (!(addressMode & PDP11.OPMODE.MASK)) {
|
||||
this.regsGen[addressMode & PDP11.OPREG.MASK] = data & 0xffff;
|
||||
} else {
|
||||
this.writeWordByPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE), data);
|
||||
this.writeWordToPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE), data);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
|
@ -1416,16 +1416,15 @@ CPUStatePDP11.prototype.writeByteByMode = function(addressMode, data, writeFlags
|
|||
{
|
||||
if (!(addressMode & PDP11.OPMODE.MASK)) {
|
||||
var reg = addressMode & PDP11.OPREG.MASK;
|
||||
if (!writeFlags) {
|
||||
this.regsGen[reg] = (this.regsGen[reg] & ~0xff) | (data & 0xff);
|
||||
} else if (writeFlags & PDP11.WRITE.ZERO) {
|
||||
this.regsGen[reg] &= ~0xff;
|
||||
} else {
|
||||
this.assert(writeFlags & PDP11.WRITE.SIGNEXT);
|
||||
if (!data) {
|
||||
this.regsGen[reg] &= ~0xff; // TODO: Profile to determine if this is a win
|
||||
} else if (writeFlags & PDP11.WRITE.SIGNEXT) {
|
||||
this.regsGen[reg] = ((data << 24) >> 24) & 0xffff;
|
||||
} else {
|
||||
this.regsGen[reg] = (this.regsGen[reg] & ~0xff) | (data & 0xff);
|
||||
}
|
||||
} else {
|
||||
this.writeByteByPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE_BYTE), data);
|
||||
this.writeByteToPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE_BYTE), data);
|
||||
}
|
||||
return data;
|
||||
};
|
||||
|
|
@ -1600,7 +1599,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
* it to detect if our new decode() function has processed (ie, "consumed") the opcode,
|
||||
* by setting it to -1. If it has, then we can skip the older opcode decode logic below.
|
||||
*/
|
||||
this.regOp = opCode = this.readWordByVirtual(this.regsGen[7]);
|
||||
this.regOp = opCode = this.readWordFromVirtual(this.regsGen[7]);
|
||||
if (opCode >= 0) this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff;
|
||||
|
||||
this.decode(opCode);
|
||||
|
|
@ -1616,7 +1615,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagV = 0;
|
||||
// } else {
|
||||
// if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE)) >= 0) {
|
||||
// if (this.writeWordByPhysical(dstAddr, src) >= 0) {
|
||||
// if (this.writeWordToPhysical(dstAddr, src) >= 0) {
|
||||
// this.flagN = this.flagZ = src;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -1651,9 +1650,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagN = this.flagZ = result;
|
||||
// this.flagV = 0;
|
||||
// } else {
|
||||
// if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// result = dst & ~src;
|
||||
// if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
// if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
// this.flagN = this.flagZ = result;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -1669,9 +1668,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagN = this.flagZ = result;
|
||||
// this.flagV = 0;
|
||||
// } else {
|
||||
// if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// result = dst | src;
|
||||
// if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
// if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
// this.flagN = this.flagZ = result;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -1689,9 +1688,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagN = this.flagZ = this.flagC = result;
|
||||
// this.flagV = (src ^ result) & (dst ^ result);
|
||||
// } else {
|
||||
// if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// result = src + dst;
|
||||
// if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
// if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
// this.flagN = this.flagZ = this.flagC = result;
|
||||
// this.flagV = (src ^ result) & (dst ^ result);
|
||||
// }
|
||||
|
|
@ -1709,7 +1708,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagV = 0;
|
||||
// } else {
|
||||
// if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte
|
||||
// if (this.writeByteByPhysical(dstAddr, src) >= 0) {
|
||||
// if (this.writeByteToPhysical(dstAddr, src) >= 0) {
|
||||
// this.flagN = this.flagZ = src << 8;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -1739,9 +1738,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
case 0xC000: /*0140000*/ // BICB 14SSDD
|
||||
//LOG_INSTRUCTION(opCode, 2, "BICB");
|
||||
// if ((src = this.readByteByMode(opCode >> 6)) >= 0) {
|
||||
// if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) {
|
||||
// if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) {
|
||||
// result = dst & ~src;
|
||||
// if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
// if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
// this.flagN = this.flagZ = result << 8;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -1751,9 +1750,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
case 0xD000: /*0150000*/ // BISB 15SSDD
|
||||
//LOG_INSTRUCTION(opCode, 2, "BISB");
|
||||
// if ((src = this.readByteByMode(opCode >> 6)) >= 0) {
|
||||
// if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) {
|
||||
// if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) {
|
||||
// result = dst | src;
|
||||
// if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
// if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
// this.flagN = this.flagZ = result << 8;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -1770,9 +1769,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagN = this.flagZ = this.flagC = result;
|
||||
// this.flagV = (src ^ dst) & (dst ^ result);
|
||||
// } else {
|
||||
// if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
// result = dst - src;
|
||||
// if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
// if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
// this.flagN = this.flagZ = this.flagC = result;
|
||||
// this.flagV = (src ^ dst) & (dst ^ result);
|
||||
// }
|
||||
|
|
@ -1909,9 +1908,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagN = this.flagZ = dst;
|
||||
this.flagV = 0;
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >= 0) {
|
||||
dst ^= this.regsGen[(opCode >> 6) & 7];
|
||||
if (this.writeWordByPhysical(dstAddr, dst) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, dst) >= 0) {
|
||||
this.flagN = this.flagZ = dst;
|
||||
this.flagV = 0;
|
||||
}
|
||||
|
|
@ -2019,10 +2018,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagN = this.flagZ = dst & 0xff00;
|
||||
this.flagV = this.flagC = 0;
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = (dst << 8) | (dst >> 8);
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = dst & 0xff00;
|
||||
this.flagV = this.flagC = 0;
|
||||
}
|
||||
|
|
@ -2036,7 +2035,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagN = this.flagC = this.flagV = this.flagZ = 0;
|
||||
// } else {
|
||||
// if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE)) >= 0) { // write word
|
||||
// if (this.writeWordByPhysical(dstAddr, 0) >= 0) {
|
||||
// if (this.writeWordToPhysical(dstAddr, 0) >= 0) {
|
||||
// this.flagN = this.flagC = this.flagV = this.flagZ = 0;
|
||||
// }
|
||||
// }
|
||||
|
|
@ -2047,10 +2046,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = ~dst;
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = result;
|
||||
this.flagC = 0x10000;
|
||||
this.flagV = 0;
|
||||
|
|
@ -2067,10 +2066,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagN = this.flagZ = result;
|
||||
this.flagV = result & (result ^ dst);
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = dst + 1;
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = result;
|
||||
this.flagV = result & (result ^ dst);
|
||||
}
|
||||
|
|
@ -2087,10 +2086,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagN = this.flagZ = result;
|
||||
this.flagV = (result ^ dst) & dst;
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = dst - 1;
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = result;
|
||||
this.flagV = (result ^ dst) & dst;
|
||||
}
|
||||
|
|
@ -2102,10 +2101,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = -dst;
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = result & dst;
|
||||
}
|
||||
|
|
@ -2116,10 +2115,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = dst + ((this.flagC >> 16) & 1);
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = result & (result ^ dst);
|
||||
}
|
||||
|
|
@ -2130,10 +2129,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = dst - ((this.flagC >> 16) & 1);
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = (result ^ dst) & dst;
|
||||
}
|
||||
|
|
@ -2157,10 +2156,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagN = this.flagZ = result;
|
||||
this.flagV = result ^ (this.flagC >> 1);
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = ((this.flagC & 0x10000) | dst) >> 1;
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = (dst << 16);
|
||||
this.flagN = this.flagZ = result;
|
||||
this.flagV = result ^ (this.flagC >> 1);
|
||||
|
|
@ -2178,10 +2177,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = result ^ dst;
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = (dst << 1) | ((this.flagC >> 16) & 1);
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = result ^ dst;
|
||||
}
|
||||
|
|
@ -2199,10 +2198,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagN = this.flagZ = result;
|
||||
this.flagV = this.flagN ^ (this.flagC >> 1);
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = (dst & 0x8000) | (dst >> 1);
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = dst << 16;
|
||||
this.flagN = this.flagZ = result;
|
||||
this.flagV = this.flagN ^ (this.flagC >> 1);
|
||||
|
|
@ -2220,10 +2219,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = result ^ dst;
|
||||
} else {
|
||||
if ((dst = this.readWordByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
if ((dst = this.readWordFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE))) >=
|
||||
0) {
|
||||
result = dst << 1;
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result;
|
||||
this.flagV = result ^ dst;
|
||||
}
|
||||
|
|
@ -2233,7 +2232,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
case 0xD00: /*0006400*/ // MARK 0064nn
|
||||
//LOG_INSTRUCTION(opCode, 8, "MARK");
|
||||
virtualAddress = (this.regsGen[7] + ((opCode & 0x3F) /*077*/ << 1)) & 0xffff;
|
||||
if ((src = this.readWordByVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((src = this.readWordFromVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
this.regsGen[7] = this.regsGen[5];
|
||||
this.regsGen[5] = src;
|
||||
this.regsGen[6] = (virtualAddress + 2) & 0xffff;
|
||||
|
|
@ -2256,7 +2255,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) {
|
||||
if ((this.PSW & 0xf000) !== 0xf000) virtualAddress &= 0xffff;
|
||||
this.mmuMode = (this.PSW >> 12) & 3;
|
||||
if ((src = this.readWordByVirtual(virtualAddress)) >= 0) {
|
||||
if ((src = this.readWordFromVirtual(virtualAddress)) >= 0) {
|
||||
this.mmuMode = (this.PSW >> 14) & 3;
|
||||
if (this.pushWord(src) >= 0) {
|
||||
this.flagN = this.flagZ = src;
|
||||
|
|
@ -2285,7 +2284,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.mmuMode = (this.PSW >> 12) & 3;
|
||||
if ((dstAddr = this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.WRITE)) >= 0) {
|
||||
this.mmuMode = (this.PSW >> 14) & 3;
|
||||
if (this.writeWordByPhysical(dstAddr, dst) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, dst) >= 0) {
|
||||
this.flagN = this.flagZ = dst;
|
||||
this.flagV = 0;
|
||||
}
|
||||
|
|
@ -2301,7 +2300,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
*/
|
||||
if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE)) >= 0) { // write word
|
||||
result = -((this.flagN >> 15) & 1);
|
||||
if (this.writeWordByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagZ = result;
|
||||
this.flagV = 0;
|
||||
}
|
||||
|
|
@ -2314,7 +2313,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// this.flagN = this.flagC = this.flagV = this.flagZ = 0;
|
||||
// } else {
|
||||
// if ((dstAddr = this.getAddr(opCode, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte
|
||||
// if (this.writeByteByPhysical(dstAddr, 0) >= 0) {
|
||||
// if (this.writeByteToPhysical(dstAddr, 0) >= 0) {
|
||||
// this.flagN = this.flagC = this.flagV = this.flagZ = 0;
|
||||
// }
|
||||
// }
|
||||
|
|
@ -2325,10 +2324,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = ~dst;
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = result << 8;
|
||||
this.flagC = 0x10000;
|
||||
this.flagV = 0;
|
||||
|
|
@ -2340,10 +2339,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = dst + 1;
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = result << 8;
|
||||
this.flagV = (result & (result ^ dst)) << 8;
|
||||
}
|
||||
|
|
@ -2354,10 +2353,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = dst - 1;
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = result << 8;
|
||||
this.flagV = ((result ^ dst) & dst) << 8;
|
||||
}
|
||||
|
|
@ -2368,10 +2367,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = -dst;
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result << 8;
|
||||
this.flagV = (result & dst) << 8;
|
||||
}
|
||||
|
|
@ -2382,10 +2381,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = dst + ((this.flagC >> 16) & 1);
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = this.flagC = result << 8;
|
||||
this.flagV = (result & (result ^ dst)) << 8;
|
||||
}
|
||||
|
|
@ -2396,10 +2395,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = dst - ((this.flagC >> 16) & 1);
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagN = this.flagZ = this.flagC = result << 8;
|
||||
this.flagV = ((result ^ dst) & dst) << 8;
|
||||
}
|
||||
|
|
@ -2417,10 +2416,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = (((this.flagC & 0x10000) >> 8) | dst) >> 1;
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = (dst << 16);
|
||||
this.flagN = this.flagZ = (result << 8);
|
||||
this.flagV = this.flagN ^ (this.flagC >> 1);
|
||||
|
|
@ -2432,10 +2431,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = (dst << 1) | ((this.flagC >> 16) & 1);
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result << 8;
|
||||
this.flagV = (result ^ dst) << 8;
|
||||
}
|
||||
|
|
@ -2446,10 +2445,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = (dst & 0x80) | (dst >> 1);
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = dst << 16;
|
||||
this.flagN = this.flagZ = result << 8;
|
||||
this.flagV = this.flagN ^ (this.flagC >> 1);
|
||||
|
|
@ -2461,10 +2460,10 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
/*
|
||||
* TODO: Here's an example where getAddr() could be called in the register-only case.
|
||||
*/
|
||||
if ((dst = this.readByteByPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
if ((dst = this.readByteFromPhysical(dstAddr = this.getAddr(opCode, PDP11.ACCESS.UPDATE_BYTE))) >=
|
||||
0) {
|
||||
result = dst << 1;
|
||||
if (this.writeByteByPhysical(dstAddr, result) >= 0) {
|
||||
if (this.writeByteToPhysical(dstAddr, result) >= 0) {
|
||||
this.flagC = this.flagN = this.flagZ = result << 8;
|
||||
this.flagV = (result ^ dst) << 8;
|
||||
}
|
||||
|
|
@ -2492,7 +2491,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
} else {
|
||||
if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) {
|
||||
this.mmuMode = (this.PSW >> 12) & 3;
|
||||
if ((src = this.readWordByVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((src = this.readWordFromVirtual(virtualAddress | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
this.mmuMode = (this.PSW >> 14) & 3;
|
||||
if (this.pushWord(src) >= 0) {
|
||||
this.flagN = this.flagZ = src;
|
||||
|
|
@ -2520,7 +2519,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
this.mmuMode = (this.PSW >> 12) & 3;
|
||||
if ((dstAddr = this.mapVirtualToPhysical(virtualAddress | PDP11.ACCESS.DSPACE, PDP11.ACCESS.WRITE)) >= 0) {
|
||||
this.mmuMode = (this.PSW >> 14) & 3;
|
||||
if (this.writeWordByPhysical(dstAddr, dst) >= 0) {
|
||||
if (this.writeWordToPhysical(dstAddr, dst) >= 0) {
|
||||
this.flagN = this.flagZ = dst;
|
||||
this.flagV = 0;
|
||||
}
|
||||
|
|
@ -2534,7 +2533,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
// src = this.getPSW() & 0xff;
|
||||
// if (instruction & 0x38) {
|
||||
// if ((dstAddr = this.getAddr(instruction, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte
|
||||
// if (this.writeByteByPhysical(dstAddr, src) >= 0) {
|
||||
// if (this.writeByteToPhysical(dstAddr, src) >= 0) {
|
||||
// this.flagN = this.flagZ = src << 8;
|
||||
// this.flagV = 0;
|
||||
// }
|
||||
|
|
@ -2625,9 +2624,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles)
|
|||
case 0x6: /*0000006*/ // RTT 000006
|
||||
//LOG_INSTRUCTION(opCode, 0, "RTT");
|
||||
dstAddr = this.regsGen[6];
|
||||
if ((virtualAddress = this.readWordByVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((virtualAddress = this.readWordFromVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
dstAddr = (dstAddr + 2) & 0xffff;
|
||||
if ((savePSW = this.readWordByVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
if ((savePSW = this.readWordFromVirtual(dstAddr | PDP11.ACCESS.DSPACE)) >= 0) {
|
||||
this.regsGen[6] = (dstAddr + 2) & 0xffff;
|
||||
savePSW &= 0xf8ff;
|
||||
if (this.PSW & 0xc000) { // user / super restrictions
|
||||
|
|
|
|||
|
|
@ -234,8 +234,7 @@ var PDP11 = {
|
|||
*/
|
||||
WRITE: {
|
||||
NORMAL: 0x0, // write byte or word normally
|
||||
ZERO: 0x1, // zero byte or word
|
||||
SIGNEXT: 0x2 // sign-extend a byte to a word
|
||||
SIGNEXT: 0x1 // sign-extend a byte to a word
|
||||
},
|
||||
CPUERR: {
|
||||
RED: 0x0004, // red zone stack limit
|
||||
|
|
@ -307,6 +306,10 @@ var PDP11 = {
|
|||
SIZE_HI: 0o177762, // Upper Size Register (always zero) (11/70 only?)
|
||||
SIZE_LO: 0o177760, // Lower Size Register (last 32-word block) (11/70 only?)
|
||||
DISPLAY: 0o177570, // Console Switch and Display
|
||||
XBUF: 0o177566, // Console Terminal: Transmitter Data Buffer Register
|
||||
XCSR: 0o177564, // Console Terminal: Transmitter Status Register
|
||||
RBUF: 0o177562, // Console Terminal: Receiver Data Buffer Register
|
||||
RCSR: 0o177560, // Console Terminal: Receiver Status Register
|
||||
MMR0: 0o177572, // 777572 17777572
|
||||
MMR1: 0o177574, // 777574 17777574
|
||||
MMR2: 0o177576, // 777576 17777576
|
||||
|
|
@ -407,6 +410,17 @@ var PDP11 = {
|
|||
KDSAR5: 0o172372, // Kernel D Space Address Register 5
|
||||
KDSAR6: 0o172374, // Kernel D Space Address Register 6
|
||||
KDSAR7: 0o172376, // Kernel D Space Address Register 7
|
||||
},
|
||||
DL11: {
|
||||
DELAY: 8,
|
||||
PRI: 4,
|
||||
VEC: 0o64,
|
||||
XCSR: {
|
||||
READY: 0x80, // Transmitter Ready (read-only)
|
||||
INT_ENABLE: 0x40, // Transmitter Interrupt Enable (read-write)
|
||||
MAINT: 0x04, // Maintenance (read-write)
|
||||
BREAK: 0x01 // BREAK (read-write)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ DevicePDP11.prototype.initBus = function(cmp, bus, cpu, dbg)
|
|||
* readPSW(addr)
|
||||
*
|
||||
* @this {DevicePDP11}
|
||||
* @param {number} addr (eg, PDP11.UNIBUS.PSW)
|
||||
* @param {number} addr (eg, 177776)
|
||||
* @return {number}
|
||||
*/
|
||||
DevicePDP11.prototype.readPSW = function(addr)
|
||||
|
|
@ -217,7 +217,7 @@ DevicePDP11.prototype.readPSW = function(addr)
|
|||
*
|
||||
* @this {DevicePDP11}
|
||||
* @param {number} data
|
||||
* @param {number} addr (ie, PDP11.UNIBUS.PSW)
|
||||
* @param {number} addr (eg, 177776)
|
||||
*/
|
||||
DevicePDP11.prototype.writePSW = function(data, addr)
|
||||
{
|
||||
|
|
@ -226,6 +226,43 @@ DevicePDP11.prototype.writePSW = function(data, addr)
|
|||
this.cpu.opFlags |= PDP11.OPFLAG.SKIP_FLAGS;
|
||||
};
|
||||
|
||||
/**
|
||||
* readXCSR(addr)
|
||||
*
|
||||
* @this {DevicePDP11}
|
||||
* @param {number} addr (eg, 177564)
|
||||
* @return {number}
|
||||
*/
|
||||
DevicePDP11.prototype.readXCSR = function(addr)
|
||||
{
|
||||
return this.tty.xcsr;
|
||||
};
|
||||
|
||||
/**
|
||||
* writeXCSR(data, addr)
|
||||
*
|
||||
* @this {DevicePDP11}
|
||||
* @param {number} data
|
||||
* @param {number} addr (eg, 177564)
|
||||
*/
|
||||
DevicePDP11.prototype.writeXCSR = function(data, addr)
|
||||
{
|
||||
/*
|
||||
* If the device is READY and INT_ENABLE is transitioning to *set*, generate an interrupt.
|
||||
*/
|
||||
var device = this;
|
||||
if ((this.tty.xcsr & (PDP11.DL11.XCSR.READY | PDP11.DL11.XCSR.INT_ENABLE)) == PDP11.DL11.XCSR.READY && (data & PDP11.DL11.XCSR.INT_ENABLE)) {
|
||||
this.cpu.interrupt(PDP11.DL11.DELAY, PDP11.DL11.PRI, PDP11.DL11.VEC, function() {
|
||||
device.tty.xcsr |= PDP11.DL11.XCSR.READY;
|
||||
return !!(device.tty.xcsr & PDP11.DL11.XCSR.INT_ENABLE);
|
||||
});
|
||||
}
|
||||
/*
|
||||
* In any event, update all bits from data *except* for READY.
|
||||
*/
|
||||
this.tty.xcsr = (this.tty.xcsr & PDP11.DL11.XCSR.READY) | (data & ~PDP11.DL11.XCSR.READY);
|
||||
};
|
||||
|
||||
/**
|
||||
* rk11_go()
|
||||
*
|
||||
|
|
@ -295,7 +332,7 @@ DevicePDP11.prototype.rk11_go = function()
|
|||
break;
|
||||
}
|
||||
rk11.rkds = (drive << 13) | (rk11.rkds & 0x1ff0) | ((rk11.rkda % 9) & 0xf);
|
||||
this.cpu.interrupt(20, 5 << 5, 0x90, /*0220*/ function() {
|
||||
this.cpu.interrupt(20, 5, 0x90, /*0220*/ function() {
|
||||
rk11.rkcs = (rk11.rkcs & 0xfffe) | 0x80; // turn off go & set done
|
||||
return !!(rk11.rkcs & 0x40);
|
||||
});
|
||||
|
|
@ -327,7 +364,7 @@ DevicePDP11.prototype.rk11_end = function(err, meta, block, address, count)
|
|||
rk11.rkcs |= 0xc000; // err
|
||||
break;
|
||||
}
|
||||
this.cpu.interrupt(20, 5 << 5, 0x90, /*0220*/ function() {
|
||||
this.cpu.interrupt(20, 5, 0x90, /*0220*/ function() {
|
||||
rk11.rkcs = (rk11.rkcs & 0xfffe) | 0x80; // turn off go & set done
|
||||
return !!(rk11.rkcs & 0x40);
|
||||
});
|
||||
|
|
@ -408,7 +445,7 @@ DevicePDP11.prototype.rl11_go = function()
|
|||
case 7: // Read data without header check
|
||||
break;
|
||||
}
|
||||
this.cpu.interrupt(20, 5 << 5, 0x70, /*0160*/ function() {
|
||||
this.cpu.interrupt(20, 5, 0x70, /*0160*/ function() {
|
||||
rl11.csr |= 0x81; // turn off go & set ready
|
||||
return !!(rl11.csr & 0x40);
|
||||
});
|
||||
|
|
@ -442,7 +479,7 @@ DevicePDP11.prototype.rl11_end = function(err, meta, block, address, count)
|
|||
rl11.csr |= 0xa000; // NXM
|
||||
break;
|
||||
}
|
||||
this.cpu.interrupt(20, 5 << 5, 0x70, /*0160*/ function() {
|
||||
this.cpu.interrupt(20, 5, 0x70, /*0160*/ function() {
|
||||
rl11.csr |= 0x81; // turn off go & set ready
|
||||
return !!(rl11.csr & 0x40);
|
||||
});
|
||||
|
|
@ -551,7 +588,7 @@ DevicePDP11.prototype.rp11_go = function(drive)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
this.cpu.interrupt(3, 5 << 5, 0xAC, /*0254*/ function() {
|
||||
this.cpu.interrupt(3, 5, 0xAC, /*0254*/ function() {
|
||||
rp11.rpcs1 = (rp11.rpcs1 & 0xfffe) | 0x80; // Turn go off and ready on
|
||||
rp11.rpds[drive] |= 0x80; // ATA
|
||||
return !!(rp11.rpcs1 & 0x40);
|
||||
|
|
@ -594,7 +631,7 @@ DevicePDP11.prototype.rp11_end = function(err, meta, block, address, count)
|
|||
rp11.rpcs1 |= 0xc000; // set SC & TRE
|
||||
break;
|
||||
}
|
||||
this.cpu.interrupt(20, 5 << 5, 0xAC, /*0254*/ function() {
|
||||
this.cpu.interrupt(20, 5, 0xAC, /*0254*/ function() {
|
||||
rp11.rpds[meta.drive] |= 0x80;
|
||||
rp11.rpcs1 = (rp11.rpcs1 & 0xfffe) | 0x80; // Turn go off and ready on
|
||||
return !!(rp11.rpcs1 & 0x40);
|
||||
|
|
@ -610,7 +647,7 @@ DevicePDP11.prototype.kw11_interrupt = function()
|
|||
{
|
||||
this.kw11.csr |= 0x80;
|
||||
if (this.kw11.csr & 0x40) {
|
||||
this.cpu.interrupt(0, 6 << 5, 0x40 /*0100*/);
|
||||
this.cpu.interrupt(0, 6, 0x40 /*0100*/);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -734,7 +771,7 @@ DevicePDP11.prototype.readData = function(meta, block, address, count)
|
|||
return;
|
||||
}
|
||||
for (word = 0; word < meta.blocksize && count > 0; word++) {
|
||||
if (this.cpu.writeWordByPhysical((meta.mapped? this.cpu.mapUnibus(address) : address), meta.cache[block][word]) < 0) {
|
||||
if (this.cpu.writeWordToPhysical((meta.mapped? this.cpu.mapUnibus(address) : address), meta.cache[block][word]) < 0) {
|
||||
meta.postProcess(2, meta, block, address, count); // NXM
|
||||
return;
|
||||
}
|
||||
|
|
@ -768,7 +805,7 @@ DevicePDP11.prototype.writeData = function(meta, block, address, count)
|
|||
}
|
||||
}
|
||||
for (word = 0; word < meta.blocksize && count > 0; word++) {
|
||||
data = this.cpu.readWordByPhysical((meta.mapped? this.cpu.mapUnibus(address) : address));
|
||||
data = this.cpu.readWordFromPhysical((meta.mapped? this.cpu.mapUnibus(address) : address));
|
||||
if (data < 0) {
|
||||
meta.postProcess(2, meta, block, address, count); // NXM
|
||||
return;
|
||||
|
|
@ -1057,7 +1094,7 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag)
|
|||
tty.del = 0;
|
||||
}
|
||||
tty.xcsr &= ~0x80; /*0200*/
|
||||
cpu.interrupt(100, 4 << 5, 0x34, /*064*/ function() {
|
||||
cpu.interrupt(100, 4, 0x34, /*064*/ function() {
|
||||
tty.xcsr |= 0x80; /*0200*/
|
||||
return !!(tty.xcsr & 0x40); /*0100*/
|
||||
});
|
||||
|
|
@ -1065,20 +1102,20 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag)
|
|||
result = 0;
|
||||
break;
|
||||
case 0x3FFF74: /*017777564*/ // console xcsr
|
||||
if (data < 0) {
|
||||
result = tty.xcsr;
|
||||
} else {
|
||||
result = this.insertData(tty.xcsr, physicalAddress, data, byteFlag);
|
||||
if (result >= 0) {
|
||||
if ((tty.xcsr & 0xC0) /*0300*/ == 0x80 /*0200*/&& (result & 0x40) /*0100*/) {
|
||||
cpu.interrupt(8, 4 << 5, 0x34, /*064*/ function() {
|
||||
tty.xcsr |= 0x80; /*0200*/
|
||||
return !!(tty.xcsr & 0x40); /*0100*/
|
||||
});
|
||||
}
|
||||
tty.xcsr = (tty.xcsr & 0x80) /*0200*/ | (result & ~0x80) /*0200*/;
|
||||
}
|
||||
}
|
||||
// if (data < 0) {
|
||||
// result = tty.xcsr;
|
||||
// } else {
|
||||
// result = this.insertData(tty.xcsr, physicalAddress, data, byteFlag);
|
||||
// if (result >= 0) {
|
||||
// if ((tty.xcsr & 0xC0) /*0300*/ == 0x80 /*0200*/&& (result & 0x40) /*0100*/) {
|
||||
// cpu.interrupt(8, 4, 0x34, /*064*/ function() {
|
||||
// tty.xcsr |= 0x80; /*0200*/
|
||||
// return !!(tty.xcsr & 0x40); /*0100*/
|
||||
// });
|
||||
// }
|
||||
// tty.xcsr = (tty.xcsr & 0x80) /*0200*/ | (result & ~0x80) /*0200*/;
|
||||
// }
|
||||
// }
|
||||
break;
|
||||
case 0x3FFF72: /*017777562*/ // console rbuf
|
||||
result = 0;
|
||||
|
|
@ -1089,7 +1126,7 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag)
|
|||
if (tty.rbuf.length > 0) {
|
||||
setTimeout(function() {
|
||||
tty.rcsr |= 0x80; /*0200*/
|
||||
if (tty.rcsr & 0x40) /*0100*/ cpu.interrupt(40, 4 << 5, 0x30) /*060*/;
|
||||
if (tty.rcsr & 0x40) /*0100*/ cpu.interrupt(40, 4, 0x30) /*060*/;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
|
@ -1182,7 +1219,7 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag)
|
|||
this.rp11_go(idx);
|
||||
} else {
|
||||
if ((result & 0xc0) == 0xc0) {
|
||||
cpu.interrupt(0, 5 << 5, 0xAC) /*0254*/;
|
||||
cpu.interrupt(0, 5, 0xAC) /*0254*/;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1409,7 +1446,12 @@ DevicePDP11.prototype.access = function(physicalAddress, data, byteFlag)
|
|||
* ES6 ALERT: As you can see below, I've finally started using computed property names.
|
||||
*/
|
||||
DevicePDP11.UNIBUS_TABLE = {
|
||||
[PDP11.UNIBUS.PSW]: [null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW]
|
||||
[PDP11.UNIBUS.PSW]: [
|
||||
null, null, DevicePDP11.prototype.readPSW, DevicePDP11.prototype.writePSW
|
||||
],
|
||||
[PDP11.UNIBUS.XCSR]: [
|
||||
null, null, DevicePDP11.prototype.readXCSR, DevicePDP11.prototype.writeXCSR
|
||||
]
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
function ba(a,b){var d;if(a){b||(b=10);var c=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==c?(b=8,c=null):"$"==c&&(b=16,c=null);null==c?a=a.substr(1):("0"==c&&(c=a.charAt(1),"b"==c&&e&&(b=2,c=null),"o"==c?(b=8,c=null):"x"==c&&(b=16,c=null)),null==c?a=a.substr(2):(c=a.charAt(a.length-1).toLowerCase(),"y"==c?(b=2,c=null):"."==c?(b=10,c=null):"h"==c&&(b=16,c=null),null==c&&(a=a.substr(0,a.length-1))));var f,c=a;((e=b)&&10!=e?16==e?c.match(/^[0-9a-f]+$/i):8==e?c.match(/^[0-7]+$/):2==e&&
|
||||
c.match(/^[01]+$/):c.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(d=f|0)}return d}function ca(a,b,d){var c="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return(d?"0o":"")+c}function r(a,b,d){var c="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),c=String.fromCharCode(e)+c;a>>=4}return(d?"0x":"")+c}
|
||||
function da(a){var b=a,d=a.lastIndexOf("/");0<=d&&(b=a.substr(d+1));d=b.indexOf("&");0<d&&(b=b.substr(0,d));return b}function ia(a){var b="",d=a.lastIndexOf(".");0<=d&&(b=a.substr(d+1).toLowerCase());return b}function ja(){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 pa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function qa(a,b,d){var c=0,e=a.length,f=0;for(d||(d=function(a,b){return a>b?1:a<b?-1:0});c<e;){var g=c+e>>1,h;h=d(b,a[g]);0<h?c=g+1:(e=g,f=!h)}return f?c:~c}var ra=Date.now||function(){return+new Date};function va(){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 oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function qa(a,b,d){var c=0,e=a.length,f=0;for(d||(d=function(a,b){return a>b?1:a<b?-1:0});c<e;){var g=c+e>>1,h;h=d(b,a[g]);0<h?c=g+1:(e=g,f=!h)}return f?c:~c}var ra=Date.now||function(){return+new Date};function sa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function wa(a,b,d,c){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return c&&c(a,f,e),[f,e];if(d&&"function"==typeof resources)return resources(a,function(b,d){c&&c(a,b,d)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");d&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),c&&c(a,f,e))});if(b&&"object"==
|
||||
typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,!!d);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,!!d),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();d||(f=h.responseText,200!=h.status&&(e=h.status||-1),c&&c(a,f,e),g=[f,e]);return g}function ka(){return"http://"+(window?window.location.host:"www.pcjs.org")}
|
||||
function t(a){window&&window.alert(a)}function xa(a){var b=!1;window&&(b=window.confirm(a));return b}var ya=null;function za(){if(null==ya){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}ya=a}return ya}function Aa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(d){}return b}
|
||||
|
|
@ -13,75 +13,76 @@ function u(a,b,d,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.nam
|
|||
if(window){Sa||(Sa=window.location.search.substr(1));for(var Ua,Va=/\+/g,Wa=/([^&=]+)=?([^&]*)/g;Ua=Wa.exec(Sa);)Ta[decodeURIComponent(Ua[1].replace(Va," "))]=decodeURIComponent(Ua[2].replace(Va," "))}function Xa(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var d=typeof a;if("object"!==d&&"function"!==d)throw new TypeError;}b.prototype=a;return new b}
|
||||
function w(a,b){b||(b=u);a.prototype=Xa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ya=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Ya={},v=[];function Za(a,b,d){Ya[a]&&b&&(Ya[a][b]=d)}function $a(a){var b,d=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var c=v[b];a&&c.id.indexOf(a)||d.push(c)}return d}
|
||||
function ab(a,b){var d;if(void 0!==a){var c;b&&(b=0<(c=b.indexOf("."))?b.substr(0,c+1):"");for(c=0;c<v.length;c++)if(d)d==v[c]&&(d=null);else if(!(a!=v[c].type||b&&v[c].id.indexOf(b)))return v[c]}return null}function y(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(d){t(d.message+" ("+a+")")}return b}
|
||||
function bb(a,b){b=B(b.parentNode,"pdp11-control");for(var d=0;d<b.length;d++)for(var c=b[d].childNodes,e=0;e<c.length;e++){var f=c[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pdp11-binding":(g=y(f))&&g.binding&&a.xa(g.type,g.binding,f,g.value),k=h.length}}}}
|
||||
function bb(a,b){b=B(b.parentNode,"pdp11-control");for(var d=0;d<b.length;d++)for(var c=b[d].childNodes,e=0;e<c.length;e++){var f=c[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pdp11-binding":(g=y(f))&&g.binding&&a.wa(g.type,g.binding,f,g.value),k=h.length}}}}
|
||||
function B(a,b,d){d&&(b+="-"+d+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var c;d=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(c=a.length;b<c;b++)e.test(a[b].className)&&d.push(a[b]);return d}
|
||||
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},xa:function(a,b,d){switch(b){case "clear":return this.P[b]||(this.P[b]=d,d.onclick=function(a){return function(){a.P.print&&(a.P.print.value="")}}(this)),!0;case "print":return this.P[b]||(this.ib=this.P[b]=d,d.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(d),
|
||||
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},wa:function(a,b,d){switch(b){case "clear":return this.P[b]||(this.P[b]=d,d.onclick=function(a){return function(){a.P.print&&(a.P.print.value="")}}(this)),!0;case "print":return this.P[b]||(this.ib=this.P[b]=d,d.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(d),
|
||||
this.sa=function(a){this.i(a,this.Fb)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.Fb+": "+a)},sa:function(a,b,d){d=d||this.type;b||t((d?d+": ":"")+a)},Qa:function(){return this.j.ga=!0},Pa:function(a,b){b&&(this.j.ga=!1);return!0}};function cb(a,b){if(a.I){a===a.I?b|=0:b=b||a.ja;var d=a.I.ja&b;return!!b&&d===b||!!(d&a.I.Kc)}return!1}
|
||||
function db(a,b){if(a.j.hc)return a.j.qb&&(a.j.qb=!1),a.j.hc=!1;if(a.j.error)return a.i(a.toString()+" error"),!1;a.j.qb=b;return a.j.qb}function pb(a,b){a.j.qb&&(b?a.j.hc=!0:void 0===b&&a.i(a.toString()+" busy"));return a.j.qb}function D(a){if(!a.j.error&&(a.j.ready=!0,a.j.ready)){var b=a.$b;a.$b=null;b&&b()}}function qb(a,b){b&&(a.j.ready?b():a.$b=b);return a.j.ready}function rb(a,b){a.j.error=!0;a.sa(b)}
|
||||
var sb="undefined"!==typeof ArrayBuffer,tb=2,E=4,F=6,tb=0|tb,ub=1|tb,E=0|E,vb=1|E,F=0|F,G=1|F,H={cpu:1,bus:64,mem:128,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function wb(a){u.call(this,"Panel",a,wb)}w(wb);l=wb.prototype;l.xa=function(a,b,d,c){return this.B&&this.B.xa(a,b,d,c)||this.b&&this.b.xa(a,b,d,c)||this.I&&this.I.xa(a,b,d,c)?!0:this.parent.xa.call(this,a,b,d,c)};
|
||||
l.$a=function(a,b,d,c){this.B=a;this.H=b;this.b=d;this.I=c};l.Qa=function(a,b){b||xb();return!0};l.Pa=function(){return!0};l.Ba=function(){};function xb(){for(var a=!1,b=B(document,"pdp11","panel"),d=0;d<b.length;d++){var c=b[d],e=y(c),f;a:{f=e.id;if(void 0!==f){var g;for(g=0;g<v.length;g++)if(v[g].id===f){f=v[g];break a}}f=null}f||(a=!0,f=new wb(e));bb(f,c);a&&D(f)}}Oa(xb);
|
||||
function yb(a,b,d){u.call(this,"Bus",a,yb);this.b=b;this.I=d;this.O=a.busWidth||16;this.G=Math.pow(2,this.O);this.H=this.G-1|0;this.Z=(this.O>>1)+2;10>this.Z&&(this.Z=10);15<this.Z&&(this.Z=15);this.Da=1<<this.Z;this.R=this.Da>>2;this.g=this.Da-1;this.u=this.G/this.Da|0;this.B=this.u-1;this.Wa=[];this.J=null;this.Mb=this.Gc;a=new I;zb(a,this.I);this.S=Array(this.u);for(b=0;b<this.u;b++)this.S[b]=a;this.Gb=Array(4);this.Gb[0]=Ab;this.Gb[1]=Bb;this.Gb[2]=Cb;this.Gb[3]=Db;Eb(this,this.G-8192,8192,Fb,
|
||||
var sb="undefined"!==typeof ArrayBuffer,tb=2,E=4,F=6,tb=0|tb,ub=1|tb,E=0|E,vb=1|E,F=0|F,G=1|F,H={cpu:1,bus:64,mem:128,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function wb(a){u.call(this,"Panel",a,wb)}w(wb);l=wb.prototype;l.wa=function(a,b,d,c){return this.w&&this.w.wa(a,b,d,c)||this.b&&this.b.wa(a,b,d,c)||this.I&&this.I.wa(a,b,d,c)?!0:this.parent.wa.call(this,a,b,d,c)};
|
||||
l.$a=function(a,b,d,c){this.w=a;this.H=b;this.b=d;this.I=c};l.Qa=function(a,b){b||xb();return!0};l.Pa=function(){return!0};l.Ba=function(){};function xb(){for(var a=!1,b=B(document,"pdp11","panel"),d=0;d<b.length;d++){var c=b[d],e=y(c),f;a:{f=e.id;if(void 0!==f){var g;for(g=0;g<v.length;g++)if(v[g].id===f){f=v[g];break a}}f=null}f||(a=!0,f=new wb(e));bb(f,c);a&&D(f)}}Oa(xb);
|
||||
function yb(a,b,d){u.call(this,"Bus",a,yb);this.b=b;this.I=d;this.O=a.busWidth||16;this.G=Math.pow(2,this.O);this.H=this.G-1|0;this.Z=(this.O>>1)+2;10>this.Z&&(this.Z=10);15<this.Z&&(this.Z=15);this.Da=1<<this.Z;this.R=this.Da>>2;this.g=this.Da-1;this.u=this.G/this.Da|0;this.w=this.u-1;this.Wa=[];this.J=null;this.Mb=this.Gc;a=new I;zb(a,this.I);this.S=Array(this.u);for(b=0;b<this.u;b++)this.S[b]=a;this.Gb=Array(4);this.Gb[0]=Ab;this.Gb[1]=Bb;this.Gb[2]=Cb;this.Gb[3]=Db;Eb(this,this.G-8192,8192,Fb,
|
||||
this);Eb(this,57344,8192,Fb,this);D(this)}w(yb);function Ab(a,b){var d=this.controller,c=d.Wa[a];if(c){if(c[0])return c[0](b);if(c[2])return b&1?c[2](b&-2)>>8:c[2](b)&255}else if(b&1&&(c=d.Wa[a&-2],c[2]))return c[2](b&-2)>>8;return d.Mb(b,-1,1)}
|
||||
function Bb(a,b,d){var c=this.controller,e=c.Wa[a];if(e){if(e[1]){e[1](b,d);return}if(e[3]){a=e[2]?e[2](d):0;if(d&1)e[3](a&255|b<<8,d&-2);else e[3](a&-256|b,d);return}}else if(d&1&&(e=c.Wa[a&-2],e[3])){d&=-2;a=e[2]?e[2](d):0;e[3](a&255|b<<8,d);return}c.Mb(d,b,1)}function Cb(a,b){var d=this.controller;if(a=d.Wa[a]){if(a[2])return a[2](b);if(a[0])return a[0](b)|a[0](b+1)<<8}return d.Mb(b,-1,0)}
|
||||
function Db(a,b,d){var c=this.controller;if(a=c.Wa[a]){if(a[3]){a[3](b,d);return}if(a[1]){a[1](b&255,d);a[1](b>>8,d+1);return}}c.Mb(d,b,0)}l=yb.prototype;l.reset=function(){this.J&&this.J()};l.Gc=function(){return 0};l.Qa=function(a,b){b||this.reset();return!0};
|
||||
function Eb(a,b,d,c,e){for(var f=b,g=d,h=f>>>a.Z;0<g&&h<a.S.length;){var k=a.S[h],m=h*a.Da,n=a.Da-(f-m);n>g&&(n=g);if(k&&k.size){if(k.type==c&&k.controller==e){if(f+g<=k.w)return k.Zb+=k.w-f,k.w=f,!0;if(f>=k.w+k.Zb){n=k.size-(f-m);n>g&&(n=g);k.Zb=f-k.w+n;f=m+a.Da;g-=n;h++;continue}}return Gb(1,f,g)}f=new I(f,n,a.Da,c,e);zb(f,a.I,k);a.S[h++]=f;f=m+a.Da;g-=n}return 0>=g?(a.status(Math.floor(d/1024)+"Kb "+Hb[c]+" at "+r(b,8,!0)),!0):Gb(2,b,d)}
|
||||
l.Nb=function(a){return this.S[(a&this.H)>>>this.Z].wb(a&this.g,a)};l.La=function(a){var b=a&this.g,d=(a&this.H)>>>this.Z;return b!=this.g?this.S[d].zc(b,a):this.S[d++].wb(b,a)|this.S[d&this.B].wb(0,a+1)<<8};function Ib(a,b){var d=b&a.g,c=(b&a.H)>>>a.Z;return d!=a.g?a.S[c].mc(d,b):a.S[c++].Tb(d,b)|a.S[c&a.B].Tb(0,b+1)<<8}l.fc=function(a,b){this.S[(a&this.H)>>>this.Z].Bb(a&this.g,b&255,a)};
|
||||
l.oc=function(a,b){var d=a&this.g,c=(a&this.H)>>>this.Z;d!=this.g?this.S[c].Fc(d,b&65535,a):(this.S[c++].Bb(d,b&255,a),this.S[c&this.B].Bb(0,b>>8&255,a+1))};function Jb(a){for(var b=0,d=[],c=0;c<a.u;c++){var e=a.S[c];if(e.Za||e.Nc){d[b++]=c;var f=b++;if(e=e.save()){for(var g=0,h=0,k=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;k[h++]=n-g;k[h++]=m;g=n}k.length<e.length&&(e=k)}d[f]=e}}return d}function Gb(a,b,d){t("Memory block error ("+a+": "+r(b)+","+r(d)+")");return!1}
|
||||
function Vb(a){u.call(this,"Device",a,Vb);this.O={lc:[],Ma:0,ua:128,g:127,Mc:0};this.g={data:0,md:0,sb:20,jd:0};this.B={Ob:0,K:0};this.u={Vb:2496,oa:0,T:128,Wb:0,Ub:0,wa:0,Ac:0,ra:[],gb:[406,406,406,406],aa:[12,12,12,12]};this.G={K:129,Jb:0,fa:0,ab:0,Xa:0,eb:0,ra:[],aa:[40,40,40,40],gb:[1024,1024,512,512],Ic:[157,157,29,29]};this.J={b:[8210,8208,8210,8226],aa:[22,22,22,50],fb:[19,19,19,32],gc:[815,411,815,630],ra:[],U:2176,zb:0,xb:0,Fa:[0,0,0,0,0,0,0,0],Ea:0,ta:[4544,4544,4544,4544,4544,4544,4544,
|
||||
4544],yb:[0,0,0,0,0,0,0,0],nb:0,gd:[0,0,0,0,0,0,0,0],Bc:0,Cc:[0,0,0,0,0,0,0,0],I:[0,0,0,0,0,0,0,0],hd:[1,2,3,4,5,6,7,8],Dc:[0,0,0,0,0,0,0,0],Ta:[0,0,0,0,0,0,0,0],ec:[0,0,0,0,0,0,0,0],ed:[0,0,0,0,0,0,0,0],fd:[0,0,0,0,0,0,0,0],cd:[0,0,0,0,0,0,0,0],dd:[0,0,0,0,0,0,0,0],cb:0,nc:0}}w(Vb);
|
||||
function Eb(a,b,d,c,e){for(var f=b,g=d,h=f>>>a.Z;0<g&&h<a.S.length;){var k=a.S[h],m=h*a.Da,n=a.Da-(f-m);n>g&&(n=g);if(k&&k.size){if(k.type==c&&k.controller==e){if(f+g<=k.A)return k.Zb+=k.A-f,k.A=f,!0;if(f>=k.A+k.Zb){n=k.size-(f-m);n>g&&(n=g);k.Zb=f-k.A+n;f=m+a.Da;g-=n;h++;continue}}return Gb(1,f,g)}f=new I(f,n,a.Da,c,e);zb(f,a.I,k);a.S[h++]=f;f=m+a.Da;g-=n}return 0>=g?(a.status(Math.floor(d/1024)+"Kb "+Hb[c]+" at "+r(b,8,!0)),!0):Gb(2,b,d)}
|
||||
l.Nb=function(a){return this.S[(a&this.H)>>>this.Z].wb(a&this.g,a)};l.La=function(a){var b=a&this.g,d=(a&this.H)>>>this.Z;return b!=this.g?this.S[d].zc(b,a):this.S[d++].wb(b,a)|this.S[d&this.w].wb(0,a+1)<<8};function Ib(a,b){var d=b&a.g,c=(b&a.H)>>>a.Z;return d!=a.g?a.S[c].mc(d,b):a.S[c++].Tb(d,b)|a.S[c&a.w].Tb(0,b+1)<<8}l.fc=function(a,b){this.S[(a&this.H)>>>this.Z].Bb(a&this.g,b&255,a)};
|
||||
l.oc=function(a,b){var d=a&this.g,c=(a&this.H)>>>this.Z;d!=this.g?this.S[c].Fc(d,b&65535,a):(this.S[c++].Bb(d,b&255,a),this.S[c&this.w].Bb(0,b>>8&255,a+1))};function Jb(a){for(var b=0,d=[],c=0;c<a.u;c++){var e=a.S[c];if(e.Za||e.Nc){d[b++]=c;var f=b++;if(e=e.save()){for(var g=0,h=0,k=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;k[h++]=n-g;k[h++]=m;g=n}k.length<e.length&&(e=k)}d[f]=e}}return d}function Gb(a,b,d){t("Memory block error ("+a+": "+r(b)+","+r(d)+")");return!1}
|
||||
function Vb(a){u.call(this,"Device",a,Vb);this.g={lc:[],Ma:0,xa:128,g:127,Mc:0};this.w={data:0,od:0,sb:20,kd:0};this.u={Ob:0,K:0};this.G={Vb:2496,oa:0,T:128,Wb:0,Ub:0,va:0,Ac:0,ra:[],gb:[406,406,406,406],aa:[12,12,12,12]};this.J={K:129,Jb:0,fa:0,ab:0,Xa:0,eb:0,ra:[],aa:[40,40,40,40],gb:[1024,1024,512,512],Ic:[157,157,29,29]};this.O={b:[8210,8208,8210,8226],aa:[22,22,22,50],fb:[19,19,19,32],gc:[815,411,815,630],ra:[],U:2176,zb:0,xb:0,Fa:[0,0,0,0,0,0,0,0],Ea:0,ta:[4544,4544,4544,4544,4544,4544,4544,
|
||||
4544],yb:[0,0,0,0,0,0,0,0],nb:0,hd:[0,0,0,0,0,0,0,0],Bc:0,Cc:[0,0,0,0,0,0,0,0],I:[0,0,0,0,0,0,0,0],jd:[1,2,3,4,5,6,7,8],Dc:[0,0,0,0,0,0,0,0],Ta:[0,0,0,0,0,0,0,0],ec:[0,0,0,0,0,0,0,0],fd:[0,0,0,0,0,0,0,0],gd:[0,0,0,0,0,0,0,0],dd:[0,0,0,0,0,0,0,0],ed:[0,0,0,0,0,0,0,0],cb:0,nc:0}}w(Vb);
|
||||
var Wb=[4127,448,4191,450,4383,452,2591,454,21983,32768,65534,13791,16384,65534,770,2719,454,2591,65534,257,0,2566,33028,34051,33282,1281,33537,0,2758,32771,770,1025,1793,0,3078,33794,34305,513,0,5574,43690,4480,4097,4162,4227,4292,4357,57665,1281,769,0,3138,34305,1281,0,24707,2691,2627,24769,34561,1793,0,3076,20739,24899,2691,34562,2753,1281,0,2624,33537,0,16385,24641,1537,1793,0,193,8279,21589,516,12549,1538,2629,513,0,38336,65281,32769,0,32258,2561,2689,32258,3008,514,3009,769,0,5574,510,2551,
|
||||
2,0,9678,208,769,0,5582,226,135,0,2598,5606,236,2,0,95,242,128,5573,57344,2591,6,5599,256,4,5574,510,3045,5599,460,76,2591,78,5571,65510,5579,12,5570,512,4224,4104,3024,8197,33788,4224,4609,8193,769,0,2640,8197,33785,6145,2625,8193,769,0,8194,761,2574,5572,43690,5579,24,5568,2048,5570,512,2628,4360,2632,2632,8708,769,0,3103,65514,34562,0,305,35406,754,258,119,65160,3024,32403,5579,36,5568,3072,35446,1,740,5570,512,4224,4104,3024,8197,33788,5569,3,2574,3039,454,528,5582,24,4224,2632,2632,8200,769,
|
||||
0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];l=Vb.prototype;
|
||||
l.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;a=Xb;for(var e in a){var f=a[e];d=b;c=+e;for(var g=f[0]?f[0].bind(this):null,h=f[1]?f[1].bind(this):null,k=f[2]?f[2].bind(this):null,f=f[3]?f[3].bind(this):null,m=+e;m<=c;m+=2){var n=m&8191;void 0!==d.Wa[n]?t("I/O address already registered: "+r(m,8,!0)):d.Wa[n]=[g,h,k,f,!1]}}e=this.Hc.bind(this);b.J=this.reset.bind(this);b.Mb=e;D(this)};l.Zc=function(){return Yb(this.b)};l.ld=function(a){Zb(this.b,a&-1809|Yb(this.b)&1808);this.b.V|=128};
|
||||
function $b(a){var b=a.u,d,c,e,f=b.wa>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.$c,drive:f,blocksize:256,mapped:0,maxblock:b.gb[f]*b.aa[f],url:"rk"+f+".dsk"});b.T&=-129;switch(b.T>>1&7){case 0:b.Vb=2496;b.oa=0;b.T=128;b.wa=0;break;case 1:if((b.wa>>4&511)>=b.gb[f]){b.oa|=32832;b.T|=49152;break}if((b.wa&15)>=b.aa[f]){b.oa|=32800;b.T|=49152;break}d=(b.wa>>4&511)*b.aa[f]+(b.wa&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;ac(a,b.ra[f],d,c,e);return;case 2:if((b.wa>>4&511)>=b.gb[f])b.oa|=
|
||||
32832,b.T|=49152;else if((b.wa&15)>=b.aa[f])b.oa|=32800,b.T|=49152;else{d=(b.wa>>4&511)*b.aa[f]+(b.wa&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;a.cc(b.ra[f],d,c,e);return}}b.Vb=f<<13|b.Vb&8176|b.wa%9&15;J(a.b,20,160,144,function(){b.T=b.T&65534|128;return!!(b.T&64)})}l.$c=function(a,b,d,c,e){var f=this.u;f.Ub=c&65535;f.T=f.T&-49|c>>12&48;f.Wb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.T|=49152;break;case 2:f.oa|=33792,f.T|=49152}J(this.b,20,160,144,function(){f.T=f.T&65534|128;return!!(f.T&64)})};
|
||||
function bc(a){var b=a.G,d,c,e,f=b.K>>8&3;b.K&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.ad,drive:f,blocksize:128,mapped:1,maxblock:b.gb[f]*b.aa[f],url:"rl"+f+".dsk"});switch(b.K>>1&7){case 2:b.ab&8&&(b.K&=63);b.ab=b.Ic[f]|b.eb&64;break;case 3:1==(b.fa&3)&&(b.eb=b.fa&4?b.eb+(b.fa&65408)&65408|b.fa<<2&64:b.eb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.eb);break;case 4:b.ab=b.eb;break;case 5:if(b.fa>>6>=b.gb[f]){b.K|=37888;break}if((b.fa&63)>=b.aa[f]){b.K|=37888;break}d=(b.fa>>6)*
|
||||
b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;ac(a,b.ra[f],d,c,e);return;case 6:if(b.fa>>6>=b.gb[f])b.K|=37888;else if((b.fa&63)>=b.aa[f])b.K|=37888;else{d=(b.fa>>6)*b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;a.cc(b.ra[f],d,c,e);return}}J(a.b,20,160,112,function(){b.K|=129;return!!(b.K&64)})}
|
||||
l.ad=function(a,b,d,c,e){var f=this.G;f.Jb=c&65535;f.K=f.K&-49|c>>12&48;f.Xa=c>>16&63;f.fa=~~(d/f.aa[b.Oa])<<6|d%f.aa[b.Oa];f.eb=f.fa;f.ab=65536-e&65535;switch(a){case 1:f.K|=33792;break;case 2:f.K|=40960}J(this.b,20,160,112,function(){f.K|=129;return!!(f.K&64)})};function cc(a){a=a.J;a.U=2176;a.Ea=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.yb=[0,0,0,0,0,0,0,0];a.nb=a.zb=a.xb=a.cb=a.nc=0}
|
||||
function dc(a,b){var d=a.J,c,e,f;d.U&=-16513;d.Ea&=-2049;d.ta[b]&=-1153;J(a.b,-1,0,172);"undefined"===typeof d.ra[b]&&(d.ra[b]={cache:[],postProcess:a.bd,drive:b,blocksize:256,mapped:0,maxblock:d.gc[0]*d.fb[0]*d.aa[0],url:"rp"+b+".dsk"});switch(d.U&63){case 5:d.ec[b]=d.Ta[b];d.U|=32896;d.ta[b]|=32896;d.nb|=1<<b;break;case 9:cc(a);break;case 19:d.ta[b]|=64;break;case 49:if(d.Ta[b]>=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0]){d.yb[b]|=1024;d.U|=49152;break}c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))*
|
||||
d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;ac(a,d.ra[b],c,e,f);return;case 57:if(d.Ta[b]>=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0])d.yb[b]|=1024,d.U|=49152;else{c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))*d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;a.cc(d.ra[b],c,e,f);return}}J(a.b,3,160,172,function(){d.U=d.U&65534|128;d.ta[b]|=128;return!!(d.U&64)})}
|
||||
l.bd=function(a,b,d,c,e){var f=this.J;f.zb=65536-e&65535;f.xb=c&65535;f.U=f.U&-769|c>>8&768;f.cb=c>>16&63;e=~~(d/f.aa[0]);c=~~(e/f.fb[0]);f.Fa[b.Oa]=e%f.fb[0]<<8|d%f.aa[0];f.ec[b.Oa]=f.Ta[b.Oa]=c;f.nb|=1<<b.Oa;d>=b.Wc-1&&(f.ta[b.Oa]|=1024);switch(a){case 1:f.Ea|=512;f.U|=49152;break;case 2:f.Ea|=2048,f.U|=49152}J(this.b,20,160,172,function(){f.ta[b.Oa]|=128;f.U=f.U&65534|128;return!!(f.U&64)})};l.Tc=function(){this.B.K|=128;this.B.K&64&&J(this.b,0,192,64)};
|
||||
l.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;a=Xb;for(var e in a){var f=a[e];d=b;c=+e;for(var g=f[0]?f[0].bind(this):null,h=f[1]?f[1].bind(this):null,k=f[2]?f[2].bind(this):null,f=f[3]?f[3].bind(this):null,m=+e;m<=c;m+=2){var n=m&8191;void 0!==d.Wa[n]?t("I/O address already registered: "+r(m,8,!0)):d.Wa[n]=[g,h,k,f,!1]}}e=this.Hc.bind(this);b.J=this.reset.bind(this);b.Mb=e;D(this)};l.Zc=function(){return Yb(this.b)};l.md=function(a){Zb(this.b,a&-1809|Yb(this.b)&1808);this.b.V|=128};l.$c=function(){return this.g.xa};
|
||||
l.nd=function(a){var b=this;128==(this.g.xa&192)&&a&64&&J(this.b,8,4,52,function(){b.g.xa|=128;return!!(b.g.xa&64)});this.g.xa=this.g.xa&128|a&-129};
|
||||
function $b(a){var b=a.G,d,c,e,f=b.va>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.ad,drive:f,blocksize:256,mapped:0,maxblock:b.gb[f]*b.aa[f],url:"rk"+f+".dsk"});b.T&=-129;switch(b.T>>1&7){case 0:b.Vb=2496;b.oa=0;b.T=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.gb[f]){b.oa|=32832;b.T|=49152;break}if((b.va&15)>=b.aa[f]){b.oa|=32800;b.T|=49152;break}d=(b.va>>4&511)*b.aa[f]+(b.va&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;ac(a,b.ra[f],d,c,e);return;case 2:if((b.va>>4&511)>=b.gb[f])b.oa|=
|
||||
32832,b.T|=49152;else if((b.va&15)>=b.aa[f])b.oa|=32800,b.T|=49152;else{d=(b.va>>4&511)*b.aa[f]+(b.va&15);c=(b.T&48)<<12|b.Ub;e=65536-b.Wb&65535;a.cc(b.ra[f],d,c,e);return}}b.Vb=f<<13|b.Vb&8176|b.va%9&15;J(a.b,20,5,144,function(){b.T=b.T&65534|128;return!!(b.T&64)})}l.ad=function(a,b,d,c,e){var f=this.G;f.Ub=c&65535;f.T=f.T&-49|c>>12&48;f.Wb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.T|=49152;break;case 2:f.oa|=33792,f.T|=49152}J(this.b,20,5,144,function(){f.T=f.T&65534|128;return!!(f.T&64)})};
|
||||
function bc(a){var b=a.J,d,c,e,f=b.K>>8&3;b.K&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.bd,drive:f,blocksize:128,mapped:1,maxblock:b.gb[f]*b.aa[f],url:"rl"+f+".dsk"});switch(b.K>>1&7){case 2:b.ab&8&&(b.K&=63);b.ab=b.Ic[f]|b.eb&64;break;case 3:1==(b.fa&3)&&(b.eb=b.fa&4?b.eb+(b.fa&65408)&65408|b.fa<<2&64:b.eb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.eb);break;case 4:b.ab=b.eb;break;case 5:if(b.fa>>6>=b.gb[f]){b.K|=37888;break}if((b.fa&63)>=b.aa[f]){b.K|=37888;break}d=(b.fa>>6)*
|
||||
b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;ac(a,b.ra[f],d,c,e);return;case 6:if(b.fa>>6>=b.gb[f])b.K|=37888;else if((b.fa&63)>=b.aa[f])b.K|=37888;else{d=(b.fa>>6)*b.aa[f]+(b.fa&63);c=(b.Xa&63)<<16|b.Jb;e=65536-b.ab&65535;a.cc(b.ra[f],d,c,e);return}}J(a.b,20,5,112,function(){b.K|=129;return!!(b.K&64)})}
|
||||
l.bd=function(a,b,d,c,e){var f=this.J;f.Jb=c&65535;f.K=f.K&-49|c>>12&48;f.Xa=c>>16&63;f.fa=~~(d/f.aa[b.Oa])<<6|d%f.aa[b.Oa];f.eb=f.fa;f.ab=65536-e&65535;switch(a){case 1:f.K|=33792;break;case 2:f.K|=40960}J(this.b,20,5,112,function(){f.K|=129;return!!(f.K&64)})};function cc(a){a=a.O;a.U=2176;a.Ea=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.yb=[0,0,0,0,0,0,0,0];a.nb=a.zb=a.xb=a.cb=a.nc=0}
|
||||
function dc(a,b){var d=a.O,c,e,f;d.U&=-16513;d.Ea&=-2049;d.ta[b]&=-1153;J(a.b,-1,0,172);"undefined"===typeof d.ra[b]&&(d.ra[b]={cache:[],postProcess:a.cd,drive:b,blocksize:256,mapped:0,maxblock:d.gc[0]*d.fb[0]*d.aa[0],url:"rp"+b+".dsk"});switch(d.U&63){case 5:d.ec[b]=d.Ta[b];d.U|=32896;d.ta[b]|=32896;d.nb|=1<<b;break;case 9:cc(a);break;case 19:d.ta[b]|=64;break;case 49:if(d.Ta[b]>=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0]){d.yb[b]|=1024;d.U|=49152;break}c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))*
|
||||
d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;ac(a,d.ra[b],c,e,f);return;case 57:if(d.Ta[b]>=d.gc[0]||d.Fa[b]>>8>=d.fb[0]||(d.Fa[b]&255)>=d.aa[0])d.yb[b]|=1024,d.U|=49152;else{c=(d.Ta[b]*d.fb[0]+(d.Fa[b]>>8))*d.aa[0]+(d.Fa[b]&255);e=(d.cb&63)<<16|d.xb;f=65536-d.zb&65535;a.cc(d.ra[b],c,e,f);return}}J(a.b,3,5,172,function(){d.U=d.U&65534|128;d.ta[b]|=128;return!!(d.U&64)})}
|
||||
l.cd=function(a,b,d,c,e){var f=this.O;f.zb=65536-e&65535;f.xb=c&65535;f.U=f.U&-769|c>>8&768;f.cb=c>>16&63;e=~~(d/f.aa[0]);c=~~(e/f.fb[0]);f.Fa[b.Oa]=e%f.fb[0]<<8|d%f.aa[0];f.ec[b.Oa]=f.Ta[b.Oa]=c;f.nb|=1<<b.Oa;d>=b.Wc-1&&(f.ta[b.Oa]|=1024);switch(a){case 1:f.Ea|=512;f.U|=49152;break;case 2:f.Ea|=2048,f.U|=49152}J(this.b,20,5,172,function(){f.ta[b.Oa]|=128;f.U=f.U&65534|128;return!!(f.U&64)})};l.Tc=function(){this.u.K|=128;this.u.K&64&&J(this.b,0,6,64)};
|
||||
function ec(a,b,d,c,e,f){var g=~~((f+d.Ya-1)/d.Ya),h=new XMLHttpRequest;2048>g&&c+2048<d.Wc&&(g=2048);h.open("GET",d.url,!0);h.setRequestHeader("Range","bytes="+(c*d.Ya<<1)+"-"+(((c+g)*d.Ya<<1)-1));h.responseType="arraybuffer";h.onreadystatechange=function(){if(4==h.readyState){var g=b.bind(a),m,n,q,p;m=h.response;if(h.status&&206!=h.status||!m)d.bc(1,d,c,e,f);else{m=new Uint8Array(m);n=c;for(p=0;p<m.length;){if("undefined"===typeof d.cache[n])for(d.cache[n]=[],q=0;q<d.Ya;q++)d.cache[n][q]=p<m.length?
|
||||
m[p]&255|m[p+1]<<8&65280:0,p+=2;else p+=d.Ya<<1;n++}g(d,c,e,f)}}};h.send(null)}function K(a,b,d,c,e){if(d&1){if(!e)return L(a.b,4,122);c=0<=c?c<<8&65280|b&255:b}else 0<=c?e&&(c=b&65280|c&255):c=b;return c}l.cc=function(a,b,d,c){for(var e;0<c;){if("undefined"===typeof a.cache[b]){ec(this,this.cc,a,b,d,c);return}for(e=0;e<a.Ya&&0<c;e++){if(0>M(this.b,a.Vc?fc(this.b,d):d,a.cache[b][e])){a.bc(2,a,b,d,c);return}d+=2;--c}b++}a.bc(0,a,b,d,c)};
|
||||
function ac(a,b,d,c,e){for(var f,g;0<e;){if("undefined"===typeof b.cache[d])for(b.cache[d]=[],f=0;f<b.Ya;f++)b.cache[d][f]=0;for(f=0;f<b.Ya&&0<e;f++){g=a.b.ka(b.Vc?fc(a.b,c):c);if(0>g){b.bc(2,b,d,c,e);return}b.cache[d][f]=g;c+=2;--e}d++}b.bc(0,b,d,c,e)}l.reset=function(){this.g.sb=this.g.sb&-120|20;this.O.Ma=0;this.O.ua=128;this.B.K=0;this.u.T=128;this.G.K=128;cc(this)};
|
||||
function ac(a,b,d,c,e){for(var f,g;0<e;){if("undefined"===typeof b.cache[d])for(b.cache[d]=[],f=0;f<b.Ya;f++)b.cache[d][f]=0;for(f=0;f<b.Ya&&0<e;f++){g=a.b.ka(b.Vc?fc(a.b,c):c);if(0>g){b.bc(2,b,d,c,e);return}b.cache[d][f]=g;c+=2;--e}d++}b.bc(0,b,d,c,e)}l.reset=function(){this.w.sb=this.w.sb&-120|20;this.g.Ma=0;this.g.xa=128;this.u.K=0;this.G.T=128;this.J.K=128;cc(this)};
|
||||
l.Hc=function(a,b,d){var c,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?c=f.Sa&65280:(a&1&&(b<<=8),f.Sa=b|255,c=0);break;case 4194298:if(0>b)c=f.dc;else{a&1&&(b<<=8);if(c=b&65024){e=c>>9;do c+=34;while(e>>=1)}f.dc=c;f.Ra=2}break;case 4194294:if(70!==f.jb)return L(f,4,222);0>b?c=f.M:c=f.M=0;break;case 4194292:if(70!==f.jb)return L(f,4,224);c=1;break;case 4194290:if(70!==f.jb)return L(f,4,226);c=0;break;case 4194288:if(70!==f.jb)return L(f,4,228);c=61183;break;case 4194296:0<=
|
||||
b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.jb)return L(f,4,232);e=a-4194272>>1;0>b?c=f.jc[e]:(c=K(this,f.jc[e],a,b,d),0<=c&&(f.jc[e]=c));break;case 4194254:return a&1?f.N>>14&1?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.va[3]=b),c=f.va[3]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.va[1]=b),c=f.va[1]),c;case 4194252:case 4194250:case 4194248:return e=a&7,f.N&2048?(0<=b&&(f.f[e]=b),c=f.f[e]):(0<=b&&(f.bb[e]=
|
||||
b),c=f.bb[e]),c;case 4194246:return a&1?(0<=b&&(f.f[7]=b),c=f.f[7]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.va[0]=b),c=f.va[0]),c;case 4194244:case 4194242:case 4194240:return e=a&7,f.N&2048?(0<=b&&(f.bb[e]=b),c=f.bb[e]):(0<=b&&(f.f[e]=b),c=f.f[e]),c;default:return f.M|=16,L(f,4,124)}break;case 4194176:e=a>>1&31;c=K(this,f.ma[3][e],a,b,d);0<=c&&(f.ma[3][e]=c,f.ma[3][e&15]&=65295);break;case 4194112:var g=this.O;e=this.B;switch(a&-2){case 4194174:c=K(this,f.Eb,a,b,d);0<=c&&(f.Eb=c);break;case 4194172:c=
|
||||
f.Ga;c&65280&&(c=(c<<8|c>>8)&65535);break;case 4194170:f.ea=f.ea&62337|f.Pb<<5|f.ac<<1;0>b?c=f.ea:(c=K(this,f.ea,a,b,d),0<=c&&(f.ea=c&=62337,f.Pb=c>>5&3,f.ac=c>>1&15,c&257?(e=2,f.Ua&16&&(e=1),f.tb=c&1?tb|E:E):(f.tb=0,e=4),this.g.sb=this.g.sb&-8|e));break;case 4194168:0>b?c=this.g.jd&65535:(c=K(this,this.g.data,a,b,d),0<=c&&(this.g.data=c));break;case 4194166:0<=b&&(b&127&&(g.Mc=0),g.ua&=-129,J(f,100,128,52,function(){g.ua|=128;return!!(g.ua&64)}));c=0;break;case 4194164:0>b?c=g.ua:(c=K(this,g.ua,
|
||||
a,b,d),0<=c&&(128==(g.ua&192)&&c&64&&J(f,8,128,52,function(){g.ua|=128;return!!(g.ua&64)}),g.ua=g.ua&128|c&-129));break;case 4194162:c=0;0>b&&(g.Ma&=-129,0<g.lc.length&&(c=g.lc.shift(),0<g.lc.length&&setTimeout(function(){g.Ma|=128;g.Ma&64&&J(f,40,128,48)},50)));break;case 4194160:0>b?c=g.Ma:(c=K(this,g.Ma,a,b,d),0<=c&&(g.Ma=g.Ma&128|c&-129));break;case 4194150:0>b?(c=e.K,e.K&=-129):(c=K(this,e.K,a,b,d),0<=c&&(c&64&&!e.Ob&&(setInterval(this.Tc.bind(this),25),e.Ob=1),e.K=c&-129));break;default:return f.M|=
|
||||
16,L(f,4,126)}break;case 4194048:e=this.u;switch(a&-2){case 4194048:c=K(this,e.Vb,a,b,d);0<=c&&(e.Vb=c);break;case 4194050:c=K(this,e.oa,a,b,d);0<=c&&(e.oa=c);break;case 4194052:c=K(this,e.T,a,b,d);0<=b&&0<=c&&(e.T=c&-36993|e.T&36992,e.T&1&&$b(this));break;case 4194054:c=K(this,e.Wb,a,b,d);0<=c&&(e.Wb=c);break;case 4194056:c=K(this,e.Ub,a,b,d);0<=c&&(e.Ub=c);break;case 4194058:c=K(this,e.wa,a,b,d);0<=c&&(e.wa=c);break;case 4194060:break;case 4194062:c=K(this,e.Ac,a,b,d);0<=c&&(e.Ac=c);break;default:return f.M|=
|
||||
16,L(f,4,128)}break;case 4193728:var h=this.J;e=h.Ea&7;switch(a&-2){case 4193728:c=K(this,h.U,a,b,d);0<=b&&0<=c&&(h.cb=h.cb&60|c>>8&3,h.U=c&17279|h.U&34944|2048,c&1&&h.U&128?dc(this,e):192==(c&192)&&J(f,0,160,172));break;case 4193730:c=K(this,h.zb,a,b,d);0<=c&&(h.zb=c);break;case 4193732:c=K(this,h.xb,a,b,d);0<=c&&(h.xb=c&65534);break;case 4193734:c=K(this,h.Fa[e],a,b,d);0<=c&&(h.Fa[e]=c&7967);break;case 4193736:c=K(this,h.Ea,a,b,d);0<=c&&(h.Ea=c&63|h.Ea&65472,c&128&&cc(this));break;case 4193738:c=
|
||||
h.ta[e];break;case 4193740:c=h.yb[e];break;case 4193742:c=K(this,h.nb,a,b,d);0<=c&&(h.nb=c&255);break;case 4193744:c=h.gd[e];break;case 4193746:c=K(this,h.Bc,a,b,d);0<=c&&(h.Bc=c);break;case 4193748:c=K(this,h.Cc[e],a,b,d);0<=c&&(h.Cc[e]=c&1023);break;case 4193750:c=8210;break;case 4193752:c=h.hd[e];break;case 4193754:c=K(this,h.Dc[e],a,b,d);0<=c&&(h.Dc[e]=c);break;case 4193756:c=K(this,h.Ta[e],a,b,d);0<=c&&(h.Ta[e]=c&511);break;case 4193758:h.ec[e]=h.Ta[e];c=h.ec[e];break;case 4193760:c=h.ed[e];
|
||||
break;case 4193762:c=h.fd[e];break;case 4193764:c=h.cd[e];break;case 4193766:c=h.dd[e];break;case 4193768:c=K(this,h.cb,a,b,d);0<=c&&(h.cb=c&63,h.U=h.U&-769|(c&3)<<8);break;case 4193770:c=K(this,h.nc,a,b,d);0<=c&&(h.nc=c);break;default:return f.M|=16,L(f,4,132)}break;case 4192512:e=this.G;switch(a&-2){case 4192512:c=K(this,e.K,a,b,d);0<=b&&0<=c&&(e.Xa=e.Xa&60|c>>4&3,e.K=e.K&-1023|c&1022,e.K&128||bc(this));break;case 4192514:c=K(this,e.Jb,a,b,d);0<=c&&(e.Jb=c&65534);break;case 4192516:c=K(this,e.fa,
|
||||
a,b,d);0<=c&&(e.fa=c);break;case 4192518:c=K(this,e.ab,a,b,d);0<=c&&(e.ab=c);break;case 4192520:c=K(this,e.Xa,a,b,d);0<=c&&(e.Xa=c&63,e.K=e.K&-49|(e.Xa&3)<<4);break;default:return f.M|=16,L(f,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?c=f.Ua:(c=K(this,f.Ua,a,b,d),0<=c&&(70!==f.jb&&(c&=-49),f.Ua=c,f.lb[0]=c&4?15:7,f.lb[1]=c&2?15:7,f.lb[3]=c&1?15:7,f.tb&&(e=2,f.Ua&16&&(e=1),this.g.sb=this.g.sb&-8|e)));break;default:return f.M|=16,L(f,4,136)}break;case 4191424:e=a>>1&31;c=K(this,f.ma[0][e],
|
||||
a,b,d);0<=c&&(f.ma[0][e]=c,f.ma[0][e&15]&=65295);break;case 4191360:e=a>>1&31;c=K(this,f.ma[1][e],a,b,d);0<=c&&(f.ma[1][e]=c,f.ma[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.jb)return L(f,4,234);e=a>>2&31;c=f.Xb[e];a&2&&(c>>=16);c&=65535;0<=b&&(c=K(this,c,a,b,d),0<=c&&(f.Xb[e]=a&2?c<<16|f.Xb[e]&65535:f.Xb[e]&4294901760|c&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)c=Wb[a>>1&255];else return f.M|=16,L(f,
|
||||
4,138);break;default:return f.M|=16,L(f,4,142)}d&&0<=c&&(a&1?c>>=8:c&=255);"undefined"===typeof c&&console.log("panic(76)");return c};var gc={},Xb=(gc[65534]=[null,null,Vb.prototype.Zc,Vb.prototype.ld],gc);Oa(function(){for(var a=B(document,"pdp11","device"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Vb(c);bb(c,d)}});var hc;if(sb){var ic=new ArrayBuffer(2);(new DataView(ic)).setUint16(0,256,!0);hc=256===(new Uint16Array(ic))[0]}else hc=!1;var jc=hc;
|
||||
function I(a,b,d,c,e){this.id=kc+=2;this.b=null;this.w=a;this.Zb=b;this.size=d||0;this.type=c||lc;this.H=c==mc;this.controller=null;zb(this);this.Za=this.Nc=!1;if(d)if(e)this.controller=e,this.b=null,nc(this,e.Gb);else if(sb)this.G=new ArrayBuffer(d),this.J=new DataView(this.G,0,d),this.g=new Uint8Array(this.G,0,d),this.R=new Uint16Array(this.G,0,d>>1),this.b=new Int32Array(this.G,0,d>>2),nc(this,jc?oc:pc);else{this.b=Array(d>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;nc(this,qc)}else nc(this)}
|
||||
b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.jb)return L(f,4,232);e=a-4194272>>1;0>b?c=f.jc[e]:(c=K(this,f.jc[e],a,b,d),0<=c&&(f.jc[e]=c));break;case 4194254:return a&1?f.N>>14&1?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.ua[3]=b),c=f.ua[3]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.ua[1]=b),c=f.ua[1]),c;case 4194252:case 4194250:case 4194248:return e=a&7,f.N&2048?(0<=b&&(f.f[e]=b),c=f.f[e]):(0<=b&&(f.bb[e]=
|
||||
b),c=f.bb[e]),c;case 4194246:return a&1?(0<=b&&(f.f[7]=b),c=f.f[7]):f.N>>14&0?(0<=b&&(f.f[6]=b),c=f.f[6]):(0<=b&&(f.ua[0]=b),c=f.ua[0]),c;case 4194244:case 4194242:case 4194240:return e=a&7,f.N&2048?(0<=b&&(f.bb[e]=b),c=f.bb[e]):(0<=b&&(f.f[e]=b),c=f.f[e]),c;default:return f.M|=16,L(f,4,124)}break;case 4194176:e=a>>1&31;c=K(this,f.ma[3][e],a,b,d);0<=c&&(f.ma[3][e]=c,f.ma[3][e&15]&=65295);break;case 4194112:var g=this.g;e=this.u;switch(a&-2){case 4194174:c=K(this,f.Eb,a,b,d);0<=c&&(f.Eb=c);break;case 4194172:c=
|
||||
f.Ga;c&65280&&(c=(c<<8|c>>8)&65535);break;case 4194170:f.ea=f.ea&62337|f.Pb<<5|f.ac<<1;0>b?c=f.ea:(c=K(this,f.ea,a,b,d),0<=c&&(f.ea=c&=62337,f.Pb=c>>5&3,f.ac=c>>1&15,c&257?(e=2,f.Ua&16&&(e=1),f.tb=c&1?tb|E:E):(f.tb=0,e=4),this.w.sb=this.w.sb&-8|e));break;case 4194168:0>b?c=this.w.kd&65535:(c=K(this,this.w.data,a,b,d),0<=c&&(this.w.data=c));break;case 4194166:0<=b&&(b&127&&(g.Mc=0),g.xa&=-129,J(f,100,4,52,function(){g.xa|=128;return!!(g.xa&64)}));c=0;break;case 4194164:break;case 4194162:c=0;0>b&&
|
||||
(g.Ma&=-129,0<g.lc.length&&(c=g.lc.shift(),0<g.lc.length&&setTimeout(function(){g.Ma|=128;g.Ma&64&&J(f,40,4,48)},50)));break;case 4194160:0>b?c=g.Ma:(c=K(this,g.Ma,a,b,d),0<=c&&(g.Ma=g.Ma&128|c&-129));break;case 4194150:0>b?(c=e.K,e.K&=-129):(c=K(this,e.K,a,b,d),0<=c&&(c&64&&!e.Ob&&(setInterval(this.Tc.bind(this),25),e.Ob=1),e.K=c&-129));break;default:return f.M|=16,L(f,4,126)}break;case 4194048:e=this.G;switch(a&-2){case 4194048:c=K(this,e.Vb,a,b,d);0<=c&&(e.Vb=c);break;case 4194050:c=K(this,e.oa,
|
||||
a,b,d);0<=c&&(e.oa=c);break;case 4194052:c=K(this,e.T,a,b,d);0<=b&&0<=c&&(e.T=c&-36993|e.T&36992,e.T&1&&$b(this));break;case 4194054:c=K(this,e.Wb,a,b,d);0<=c&&(e.Wb=c);break;case 4194056:c=K(this,e.Ub,a,b,d);0<=c&&(e.Ub=c);break;case 4194058:c=K(this,e.va,a,b,d);0<=c&&(e.va=c);break;case 4194060:break;case 4194062:c=K(this,e.Ac,a,b,d);0<=c&&(e.Ac=c);break;default:return f.M|=16,L(f,4,128)}break;case 4193728:var h=this.O;e=h.Ea&7;switch(a&-2){case 4193728:c=K(this,h.U,a,b,d);0<=b&&0<=c&&(h.cb=h.cb&
|
||||
60|c>>8&3,h.U=c&17279|h.U&34944|2048,c&1&&h.U&128?dc(this,e):192==(c&192)&&J(f,0,5,172));break;case 4193730:c=K(this,h.zb,a,b,d);0<=c&&(h.zb=c);break;case 4193732:c=K(this,h.xb,a,b,d);0<=c&&(h.xb=c&65534);break;case 4193734:c=K(this,h.Fa[e],a,b,d);0<=c&&(h.Fa[e]=c&7967);break;case 4193736:c=K(this,h.Ea,a,b,d);0<=c&&(h.Ea=c&63|h.Ea&65472,c&128&&cc(this));break;case 4193738:c=h.ta[e];break;case 4193740:c=h.yb[e];break;case 4193742:c=K(this,h.nb,a,b,d);0<=c&&(h.nb=c&255);break;case 4193744:c=h.hd[e];
|
||||
break;case 4193746:c=K(this,h.Bc,a,b,d);0<=c&&(h.Bc=c);break;case 4193748:c=K(this,h.Cc[e],a,b,d);0<=c&&(h.Cc[e]=c&1023);break;case 4193750:c=8210;break;case 4193752:c=h.jd[e];break;case 4193754:c=K(this,h.Dc[e],a,b,d);0<=c&&(h.Dc[e]=c);break;case 4193756:c=K(this,h.Ta[e],a,b,d);0<=c&&(h.Ta[e]=c&511);break;case 4193758:h.ec[e]=h.Ta[e];c=h.ec[e];break;case 4193760:c=h.fd[e];break;case 4193762:c=h.gd[e];break;case 4193764:c=h.dd[e];break;case 4193766:c=h.ed[e];break;case 4193768:c=K(this,h.cb,a,b,d);
|
||||
0<=c&&(h.cb=c&63,h.U=h.U&-769|(c&3)<<8);break;case 4193770:c=K(this,h.nc,a,b,d);0<=c&&(h.nc=c);break;default:return f.M|=16,L(f,4,132)}break;case 4192512:e=this.J;switch(a&-2){case 4192512:c=K(this,e.K,a,b,d);0<=b&&0<=c&&(e.Xa=e.Xa&60|c>>4&3,e.K=e.K&-1023|c&1022,e.K&128||bc(this));break;case 4192514:c=K(this,e.Jb,a,b,d);0<=c&&(e.Jb=c&65534);break;case 4192516:c=K(this,e.fa,a,b,d);0<=c&&(e.fa=c);break;case 4192518:c=K(this,e.ab,a,b,d);0<=c&&(e.ab=c);break;case 4192520:c=K(this,e.Xa,a,b,d);0<=c&&(e.Xa=
|
||||
c&63,e.K=e.K&-49|(e.Xa&3)<<4);break;default:return f.M|=16,L(f,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?c=f.Ua:(c=K(this,f.Ua,a,b,d),0<=c&&(70!==f.jb&&(c&=-49),f.Ua=c,f.lb[0]=c&4?15:7,f.lb[1]=c&2?15:7,f.lb[3]=c&1?15:7,f.tb&&(e=2,f.Ua&16&&(e=1),this.w.sb=this.w.sb&-8|e)));break;default:return f.M|=16,L(f,4,136)}break;case 4191424:e=a>>1&31;c=K(this,f.ma[0][e],a,b,d);0<=c&&(f.ma[0][e]=c,f.ma[0][e&15]&=65295);break;case 4191360:e=a>>1&31;c=K(this,f.ma[1][e],a,b,d);0<=c&&(f.ma[1][e]=c,
|
||||
f.ma[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.jb)return L(f,4,234);e=a>>2&31;c=f.Xb[e];a&2&&(c>>=16);c&=65535;0<=b&&(c=K(this,c,a,b,d),0<=c&&(f.Xb[e]=a&2?c<<16|f.Xb[e]&65535:f.Xb[e]&4294901760|c&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)c=Wb[a>>1&255];else return f.M|=16,L(f,4,138);break;default:return f.M|=16,L(f,4,142)}d&&0<=c&&(a&1?c>>=8:c&=255);"undefined"===typeof c&&console.log("panic(76)");
|
||||
return c};var gc={},Xb=(gc[65534]=[null,null,Vb.prototype.Zc,Vb.prototype.md],gc[65396]=[null,null,Vb.prototype.$c,Vb.prototype.nd],gc);Oa(function(){for(var a=B(document,"pdp11","device"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Vb(c);bb(c,d)}});var hc;if(sb){var ic=new ArrayBuffer(2);(new DataView(ic)).setUint16(0,256,!0);hc=256===(new Uint16Array(ic))[0]}else hc=!1;var jc=hc;
|
||||
function I(a,b,d,c,e){this.id=kc+=2;this.b=null;this.A=a;this.Zb=b;this.size=d||0;this.type=c||lc;this.H=c==mc;this.controller=null;zb(this);this.Za=this.Nc=!1;if(d)if(e)this.controller=e,this.b=null,nc(this,e.Gb);else if(sb)this.G=new ArrayBuffer(d),this.J=new DataView(this.G,0,d),this.g=new Uint8Array(this.G,0,d),this.R=new Uint16Array(this.G,0,d>>1),this.b=new Int32Array(this.G,0,d>>2),nc(this,jc?oc:pc);else{this.b=Array(d>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;nc(this,qc)}else nc(this)}
|
||||
var lc=0,mc=2,Fb=4,Hb=["NONE","RAM","ROM","VID","H/W"],kc=0;
|
||||
I.prototype={constructor:I,parent:null,Ob:function(a){this.w=a},save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.J.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(sb)for(b=0;b<a.length;b++)this.J.setInt32(b<<2,a[b],!0);else this.b=a;return this.Za=!0}return!1},hb:function(a,b){b?this.B++||rc(this,sc,!1):this.P++||tc(this,sc,!1)},W:function(){this.I&&cb(this.I,
|
||||
129)&&this.I.message("attempt to read invalid block %"+r(this.w),!0);return 255},u:function(a,b){this.I&&cb(this.I,129)&&this.I.message("attempt to write "+r(b,4,!0)+" to invalid block %"+r(this.w),!0)},X:function(a,b){return this.wb(a++,b++)|this.wb(a,b)<<8},O:function(a,b,d){this.Bb(a++,b&255,d++);this.Bb(a,b>>8,d)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var d=this.b[b]>>a;return 24>a?d&65535:d&255|(this.b[b+1]&255)<<8},Ca:function(a,b){var d=a>>
|
||||
2;a=(a&3)<<3;this.b[d]=this.b[d]&~(255<<a)|b<<a;this.Za=!0},Fb:function(a,b){var d=a>>2;a=(a&3)<<3;24>a?this.b[d]=this.b[d]&~(65535<<a)|b<<a:(this.b[d]=this.b[d]&16777215|b<<24,d++,this.b[d]=this.b[d]&-256|b>>8);this.Za=!0},$:function(a,b){if(this.I&&null!=this.w){var d=this.I;uc(d,this.w+a,1,d.Y)&&d.pa(!0)}return this.Tb(a,b)},ha:function(a,b){if(this.I&&null!=this.w){var d=this.I;uc(d,this.w+a,2,d.Y)&&d.pa(!0)}return this.mc(a,b)},za:function(a,b,d){if(this.I&&null!=this.w){var c=this.I;uc(c,this.w+
|
||||
a,1,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.Cb(a,b,d)},Ia:function(a,b,d){if(this.I&&null!=this.w){var c=this.I;uc(c,this.w+a,2,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.qc(a,b,d)},Y:function(a){return this.g[a]},ba:function(a){return this.g[a]},da:function(a){return this.J.getUint16(a,!0)},ia:function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.R[a>>1]},ya:function(a,b){this.g[a]=b;this.Za=!0},Aa:function(a,b){this.g[a]=b;this.Za=!0},Ha:function(a,b){this.J.setUint16(a,b,!0);this.Za=!0},Va:function(a,
|
||||
b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.R[a>>1]=b;this.Za=!0}};function zb(a,b,d){a.I=b;a.P=a.B=0;d&&((a.P=d.P)&&tc(a,sc,!1),(a.B=d.B)&&rc(a,sc,!1))}function vc(a,b){b?--a.B||(a.Bb=a.H?a.u:a.Cb,a.Fc=a.H?a.O:a.qc):--a.P||(a.wb=a.Tb,a.zc=a.mc)}function rc(a,b,d){d&&a.B||(a.Bb=!a.H&&b[1]||a.u,a.Fc=!a.H&&b[3]||a.O);if(d||void 0===d)a.Cb=b[1]||a.u,a.qc=b[3]||a.O}function tc(a,b,d){d&&a.P||(a.wb=b[0]||a.W,a.zc=b[2]||a.X);if(d||void 0===d)a.Tb=b[0]||a.W,a.mc=b[2]||a.X}
|
||||
I.prototype={constructor:I,parent:null,Ob:function(a){this.A=a},save:function(){var a,b;if(this.controller)a=null;else if(sb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.J.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(sb)for(b=0;b<a.length;b++)this.J.setInt32(b<<2,a[b],!0);else this.b=a;return this.Za=!0}return!1},hb:function(a,b){b?this.w++||rc(this,sc,!1):this.P++||tc(this,sc,!1)},W:function(){this.I&&cb(this.I,
|
||||
129)&&this.I.message("attempt to read invalid block %"+r(this.A),!0);return 255},u:function(a,b){this.I&&cb(this.I,129)&&this.I.message("attempt to write "+r(b,4,!0)+" to invalid block %"+r(this.A),!0)},X:function(a,b){return this.wb(a++,b++)|this.wb(a,b)<<8},O:function(a,b,d){this.Bb(a++,b&255,d++);this.Bb(a,b>>8,d)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},qa:function(a){var b=a>>2;a=(a&3)<<3;var d=this.b[b]>>a;return 24>a?d&65535:d&255|(this.b[b+1]&255)<<8},Ca:function(a,b){var d=a>>
|
||||
2;a=(a&3)<<3;this.b[d]=this.b[d]&~(255<<a)|b<<a;this.Za=!0},Fb:function(a,b){var d=a>>2;a=(a&3)<<3;24>a?this.b[d]=this.b[d]&~(65535<<a)|b<<a:(this.b[d]=this.b[d]&16777215|b<<24,d++,this.b[d]=this.b[d]&-256|b>>8);this.Za=!0},$:function(a,b){if(this.I&&null!=this.A){var d=this.I;uc(d,this.A+a,1,d.Y)&&d.pa(!0)}return this.Tb(a,b)},ha:function(a,b){if(this.I&&null!=this.A){var d=this.I;uc(d,this.A+a,2,d.Y)&&d.pa(!0)}return this.mc(a,b)},za:function(a,b,d){if(this.I&&null!=this.A){var c=this.I;uc(c,this.A+
|
||||
a,1,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.Cb(a,b,d)},Ia:function(a,b,d){if(this.I&&null!=this.A){var c=this.I;uc(c,this.A+a,2,c.J)&&c.pa(!0)}this.H?this.u(a,b,d):this.qc(a,b,d)},Y:function(a){return this.g[a]},ba:function(a){return this.g[a]},da:function(a){return this.J.getUint16(a,!0)},ia:function(a){return a&1?this.g[a]|this.g[a+1]<<8:this.R[a>>1]},ya:function(a,b){this.g[a]=b;this.Za=!0},Aa:function(a,b){this.g[a]=b;this.Za=!0},Ha:function(a,b){this.J.setUint16(a,b,!0);this.Za=!0},Va:function(a,
|
||||
b){a&1?(this.g[a]=b,this.g[a+1]=b>>8):this.R[a>>1]=b;this.Za=!0}};function zb(a,b,d){a.I=b;a.P=a.w=0;d&&((a.P=d.P)&&tc(a,sc,!1),(a.w=d.w)&&rc(a,sc,!1))}function vc(a,b){b?--a.w||(a.Bb=a.H?a.u:a.Cb,a.Fc=a.H?a.O:a.qc):--a.P||(a.wb=a.Tb,a.zc=a.mc)}function rc(a,b,d){d&&a.w||(a.Bb=!a.H&&b[1]||a.u,a.Fc=!a.H&&b[3]||a.O);if(d||void 0===d)a.Cb=b[1]||a.u,a.qc=b[3]||a.O}function tc(a,b,d){d&&a.P||(a.wb=b[0]||a.W,a.zc=b[2]||a.X);if(d||void 0===d)a.Tb=b[0]||a.W,a.mc=b[2]||a.X}
|
||||
function nc(a,b){b||(b=wc);tc(a,b,void 0);rc(a,b,void 0)}var wc=[],qc=[I.prototype.ca,I.prototype.Ca,I.prototype.qa,I.prototype.Fb],sc=[I.prototype.$,I.prototype.za,I.prototype.ha,I.prototype.Ia];if(sb)var pc=[I.prototype.Y,I.prototype.ya,I.prototype.da,I.prototype.Ha],oc=[I.prototype.ba,I.prototype.Aa,I.prototype.ia,I.prototype.Va];
|
||||
function xc(a,b){u.call(this,"CPU",a,xc,1);var d=a.multiplier||1;this.Ha=a.cycles||b;this.mb=d;this.Ca=Math.round(this.Ha/1E4)/100;this.kb=this.Ca*this.mb;this.j.la=!1;this.j.pc=!1;this.j.Hb=a.autoStart;this.j.wc=!1;this.j.rb=!1;this.Qb=this.ba=0;this.Rb=a.csStart;this.ub=a.csInterval;this.vb=a.csStop;this.ya=[];this.Kb=this.ob.bind(this);D(this)}w(xc);var yc=["power","reset"];l=xc.prototype;
|
||||
l.$a=function(a,b,d,c){this.B=a;this.H=b;this.I=c;for(b=0;b<yc.length;b++)(d=this.P[yc[b]])&&this.B.xa(null,yc[b],d);this.ha=null;a=Nc(a,"autoStart");null!=a&&(this.j.Hb="true"==a?!0:"false"==a?!1:!!a);D(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.Qa=function(a,b){if(!b){if(a&&this.restore){Oc(this);if(!this.restore(a))return!1;Pc(this)}else this.reset();this.I?this.I.Ob():this.i("No debugger detected")}N(this);return!0};
|
||||
l.$a=function(a,b,d,c){this.w=a;this.H=b;this.I=c;for(b=0;b<yc.length;b++)(d=this.P[yc[b]])&&this.w.wa(null,yc[b],d);this.ha=null;a=zc(a,"autoStart");null!=a&&(this.j.Hb="true"==a?!0:"false"==a?!1:!!a);D(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.Qa=function(a,b){if(!b){if(a&&this.restore){Oc(this);if(!this.restore(a))return!1;Pc(this)}else this.reset();this.I?this.I.Ob():this.i("No debugger detected")}N(this);return!0};
|
||||
l.Pa=function(a){return a?this.save():!0};l.Hb=function(){return this.j.Hb||!this.I&&void 0===this.P.run?(this.ob(!0),!0):!1};l.yc=function(){return 0};function Pc(a){void 0===a.Rb&&(a.Rb=0);void 0===a.ub&&(a.ub=-1);void 0===a.vb&&(a.vb=-1);a.j.rb=0<=a.Rb&&0<a.ub;a.j.rb&&(a.Qb=0,a.ba=a.Rb-a.$)}function Qc(a,b){if(a.j.rb){var d=!1;a.Qb=a.Qb+a.yc()|0;a.ba-=b;0>=a.ba&&(a.ba+=a.ub,d=!0);0<=a.vb&&a.vb<=Rc(a)&&(a.ub=a.vb=-1,Pc(a),a.pa(),d=!0);d&&a.i(Rc(a)+" cycles: checksum="+r(a.Qb))}}
|
||||
function Sc(a,b,d,c){if(a.P[b]){void 0===d&&(rb(a,"Value for "+b+" is invalid"),a.pa());var e=a.I&&a.I.za||8;d=!a.j.la||a.j.wc?8==e?ca(d,c):r(d,c):"--------".substr(0,c||4);a.P[b].textContent!=d&&(a.P[b].textContent=d)}}
|
||||
l.xa=function(a,b,d){var c=this;a=!1;switch(b){case "power":case "reset":this.P[b]=d;a=!0;break;case "run":this.P[b]=d;d.onclick=function(){var a;if(a=c.B)if(a=c.B,a.j.ga)a=!0;else{var b=null,d,h=$a(a.id);for(d=0;d<h.length&&(b=h[d],b===a||b.j.ready);d++);if(d==h.length)for(d=0;d<h.length&&(b=h[d],b===a||b.j.ga);d++);d==h.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.$b?" (waiting for notification)":""))+".");a=!1}a&&(c.j.la?c.pa():c.ob())};
|
||||
l.wa=function(a,b,d){var c=this;a=!1;switch(b){case "power":case "reset":this.P[b]=d;a=!0;break;case "run":this.P[b]=d;d.onclick=function(){var a;if(a=c.w)if(a=c.w,a.j.ga)a=!0;else{var b=null,d,h=$a(a.id);for(d=0;d<h.length&&(b=h[d],b===a||b.j.ready);d++);if(d==h.length)for(d=0;d<h.length&&(b=h[d],b===a||b.j.ga);d++);d==h.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.$b?" (waiting for notification)":""))+".");a=!1}a&&(c.j.la?c.pa():c.ob())};
|
||||
a=!0;break;case "speed":this.P[b]=d;a=!0;break;case "setSpeed":this.P[b]=d,d.onclick=function(){Tc(c,c.mb<<1,!0)},d.textContent=this.kb.toFixed(2)+"Mhz",a=!0}return a};function Uc(a,b,d){a.$+=b;d&&(a.Y=a.b=0)}function Vc(a,b){var d=1;b&&1<a.mb&&a.W&&(d=a.W/a.Ca);a.Db=Math.round(1E3/30);a.Aa=Math.floor(a.Ha/30*d);b||(a.ca=a.Aa);a.Ia=0}function Rc(a){return a.$+a.R+a.Y-a.b}function Oc(a){a.W=0;a.Ib=0;a.$=a.R=a.Y=a.b=0;Pc(a);Tc(a,1)}
|
||||
function Tc(a,b,d){var c=!1;if(void 0!==b){.8>a.W/a.kb?b=1:c=!0;a.mb=b;b=a.Ca*a.mb;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.P.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}d&&a.B&&a.B.Yb()}Uc(a,a.R);a.R=0;a.O=ra();a.X=0;Vc(a);return c}function Wc(a){a.Y-=a.b;a.b=0}
|
||||
l.ob=function(a){if(db(this,!0)){if(!this.j.la){Tc(this);this.B&&this.B.start(this.O,Rc(this));this.j.la=!0;this.j.pc=!0;this.ha&&this.ha.start();var b=this.P.run;b&&(b.textContent="Halt");this.B&&(this.B.Ba(!0),a&&this.B.Yb(!0))}this.Ia>=this.Ha&&Vc(this,!0);this.ia=0;this.za=ra();this.X&&(a=this.za-this.X,a>this.Db&&(this.O+=a,this.O>this.za&&(this.O=this.za)));try{do{for(var d,c=this.j.rb?1:this.Aa,e=this.ya.length-1;0<=e;e--){var f=this.ya[e];0>f[0]||c>f[0]&&(c=f[0])}d=c;try{this.Ab(d)}catch(m){if("number"!=
|
||||
typeof m)throw m;}var g=this.Y-this.b;a=g;for(var h=this.ya.length-1;0<=h;h--){var k=this.ya[h];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.ia+=g;this.R+=g;Uc(this,0,!0);Qc(this,g);this.ca-=g;if(0>=this.ca){this.ca+=this.Aa;15<=++this.Ib&&(this.B&&this.B.Ba(),this.Ib=0);break}}while(this.j.la)}catch(m){this.pa();N(this);this.B&&this.B.stop(ra(),Rc(this));db(this,!1);rb(this,m.stack||m.message);return}d=setTimeout;c=this.Kb;this.X=ra();e=this.Db;this.ia&&(e=Math.round(e*this.ia/this.Aa));e-=this.X-
|
||||
this.za;if(f=this.X-this.O)this.W=Math.round(this.R/(10*f))/100,864E5<=f&&(this.$=0,Tc(this));if(0>e||this.W<this.kb)-1E3>e&&(this.O-=e),e=0;this.Ia+=this.ia;this.X+=e;d(c,e)}else N(this),this.B&&this.B.stop(ra(),Rc(this))};l.Ab=function(){return 0};l.pa=function(a){pb(this,!0);Wc(this);Uc(this,this.R);this.R=0;if(this.j.la){this.j.la=!1;this.ha&&this.ha.stop();var b=this.P.run;b&&(b.textContent="Run")}this.j.complete=a};function N(a,b){a.B&&a.B.Ba(b)}
|
||||
function Xc(a){this.Xc=+a.model||1170;this.kc=a.resetAddr||0;xc.call(this,a,1E6);this.Va=0;this.decode=Yc.bind(this);this.D=65536;this.C=32768;this.F=65535;this.A=32768;this.f=[0,0,0,0,0,0,0,this.kc];this.bb=[0,0,0,0,0,0];this.va=[0,0,0,0];this.Sa=255;this.ac=this.Pb=this.tb=this.G=this.Ua=this.Eb=this.Ga=this.ea=this.M=this.dc=0;this.lb=[7,7,7,7];this.ma=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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,
|
||||
function Tc(a,b,d){var c=!1;if(void 0!==b){.8>a.W/a.kb?b=1:c=!0;a.mb=b;b=a.Ca*a.mb;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.P.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}d&&a.w&&a.w.Yb()}Uc(a,a.R);a.R=0;a.O=ra();a.X=0;Vc(a);return c}function Wc(a){a.Y-=a.b;a.b=0}
|
||||
l.ob=function(a){if(db(this,!0)){if(!this.j.la){Tc(this);this.w&&this.w.start(this.O,Rc(this));this.j.la=!0;this.j.pc=!0;this.ha&&this.ha.start();var b=this.P.run;b&&(b.textContent="Halt");this.w&&(this.w.Ba(!0),a&&this.w.Yb(!0))}this.Ia>=this.Ha&&Vc(this,!0);this.ia=0;this.za=ra();this.X&&(a=this.za-this.X,a>this.Db&&(this.O+=a,this.O>this.za&&(this.O=this.za)));try{do{for(var d,c=this.j.rb?1:this.Aa,e=this.ya.length-1;0<=e;e--){var f=this.ya[e];0>f[0]||c>f[0]&&(c=f[0])}d=c;try{this.Ab(d)}catch(m){if("number"!=
|
||||
typeof m)throw m;}var g=this.Y-this.b;a=g;for(var h=this.ya.length-1;0<=h;h--){var k=this.ya[h];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.ia+=g;this.R+=g;Uc(this,0,!0);Qc(this,g);this.ca-=g;if(0>=this.ca){this.ca+=this.Aa;15<=++this.Ib&&(this.w&&this.w.Ba(),this.Ib=0);break}}while(this.j.la)}catch(m){this.pa();N(this);this.w&&this.w.stop(ra(),Rc(this));db(this,!1);rb(this,m.stack||m.message);return}d=setTimeout;c=this.Kb;this.X=ra();e=this.Db;this.ia&&(e=Math.round(e*this.ia/this.Aa));e-=this.X-
|
||||
this.za;if(f=this.X-this.O)this.W=Math.round(this.R/(10*f))/100,864E5<=f&&(this.$=0,Tc(this));if(0>e||this.W<this.kb)-1E3>e&&(this.O-=e),e=0;this.Ia+=this.ia;this.X+=e;d(c,e)}else N(this),this.w&&this.w.stop(ra(),Rc(this))};l.Ab=function(){return 0};l.pa=function(a){pb(this,!0);Wc(this);Uc(this,this.R);this.R=0;if(this.j.la){this.j.la=!1;this.ha&&this.ha.stop();var b=this.P.run;b&&(b.textContent="Run")}this.j.complete=a};function N(a,b){a.w&&a.w.Ba(b)}
|
||||
function Xc(a){this.Xc=+a.model||1170;this.kc=a.resetAddr||0;xc.call(this,a,1E6);this.Va=0;this.decode=Yc.bind(this);this.D=65536;this.C=32768;this.F=65535;this.B=32768;this.f=[0,0,0,0,0,0,0,this.kc];this.bb=[0,0,0,0,0,0];this.ua=[0,0,0,0];this.Sa=255;this.ac=this.Pb=this.tb=this.G=this.Ua=this.Eb=this.Ga=this.ea=this.M=this.dc=0;this.lb=[7,7,7,7];this.ma=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Xb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.jc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=-1;this.V=0;this.jb=70;this.da=-1;this.u=[];this.qa=0;this.Ra=2;Zc(this);this.j.complete=this.j.Lc=!1}w(Xc,xc);l=Xc.prototype;
|
||||
l.reset=function(){this.j.la&&this.pa();$c(this);Oc(this);this.j.error=!1;this.parent.reset.call(this)};function $c(a){a.Sa=255;a.M=0;a.u=[];a.dc=0;a.ea=a.Ga=a.Eb=a.Ua=a.tb=0;a.lb[0]=a.lb[1]=a.lb[3]=7;a.Pb=0;Zc(a)}function Zc(a){a.tb?(a.J=65536,a.L=a.Rc,a.Lb=a.na):(a.J=0,a.L=a.Qc,a.Lb=a.ka)}l.yc=function(){return 0};l.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.pb,this.$,this.mb]);a.set(2,Jb(this.H));return a.data()};
|
||||
l.restore=function(a){var b=a[1];this.pb=b[0];this.$=b[1];Tc(this,b[3]);a:{b=this.H;a=a[2];var d;for(d=0;d<a.length-1;d+=2){var c=a[d],e=a[d+1];if(e&&e.length<b.R){for(var f=0,g=Array(b.R),h=0;h<e.length-1;)for(var k=e[h++],m=e[h++];k--;)g[f++]=m;e=g}f=b.S[c];if(!f||!f.restore(e)){t("Unable to restore memory block "+c);b=!1;break a}}b=!0}return b};
|
||||
l.xa=function(a,b,d){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":this.P[b]=d;this.Va++;a=!0;break;default:a=this.parent.xa.call(this,a,b,d)}return a};
|
||||
l.wa=function(a,b,d){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":this.P[b]=d;this.Va++;a=!0;break;default:a=this.parent.wa.call(this,a,b,d)}return a};
|
||||
l.Ba=function(a){if(this.Va&&(a||!this.j.la||this.j.wc)){for(a=0;a<this.f.length;a++)Sc(this,"R"+a,this.f[a]);a=Yb(this);Sc(this,"PS",a);Sc(this,"NF",a&8?1:0,1);Sc(this,"ZF",a&4?1:0,1);Sc(this,"VF",a&2?1:0,1);Sc(this,"CF",a&1?1:0,1)}if(a=this.P.speed)a.textContent=this.j.la&&this.W?this.W.toFixed(2)+"Mhz":"Stopped"};
|
||||
function J(a,b,d,c,e){for(var f=a.u.length;0<f--;)if(a.u[f].kd===c){0<f&&(a.u[f-1].Ja+=a.u[f].Ja);a.u.splice(f,1);break}if(0<=b){2===a.qa&&(b=0,a.qa=0,setTimeout(a.Kb,0));for(f=a.u.length;0<f--;){if(a.u[f].Ja>b){a.u[f].Ja-=b;break}b-=a.u[f].Ja}a.u.splice(f+1,0,{delay:b,priority:d&224,vector:c,callback:e})}a.Ra=2}function Yb(a){return a.N=a.N&63728|(a.A&32768?8:0)|(a.F&65535?0:4)|(a.C&32768?2:0)|(a.D&65536?1:0)}
|
||||
function Zb(a,b){a.A=b<<12;a.F=~b&4;a.C=b<<14;a.D=b<<16;if((b^a.N)&2048)for(var d=a.bb.length;0<=--d;){var c=a.f[d];a.f[d]=a.bb[d];a.bb[d]=c}a.G=b>>14&3;d=a.N>>14&3;a.G!=d&&(a.va[d]=a.f[6],a.f[6]=a.va[a.G]);a.Ra=2;a.N=b}function ad(a,b){a.V&128||(a.A=a.F=a.D=b,a.C=0)}function bd(a,b){a.V&128||(a.A=a.F=b,a.C=0)}function cd(a,b,d,c){a.V&128||(a.A=a.F=a.D=b,a.C=(d^c)&(c^b))}
|
||||
function J(a,b,d,c,e){for(var f=a.u.length;0<f--;)if(a.u[f].ld===c){0<f&&(a.u[f-1].Ja+=a.u[f].Ja);a.u.splice(f,1);break}if(0<=b){2===a.qa&&(b=0,a.qa=0,setTimeout(a.Kb,0));for(f=a.u.length;0<f--;){if(a.u[f].Ja>b){a.u[f].Ja-=b;break}b-=a.u[f].Ja}a.u.splice(f+1,0,{delay:b,priority:d<<5&224,vector:c,callback:e})}a.Ra=2}function Yb(a){return a.N=a.N&63728|(a.B&32768?8:0)|(a.F&65535?0:4)|(a.C&32768?2:0)|(a.D&65536?1:0)}
|
||||
function Zb(a,b){a.B=b<<12;a.F=~b&4;a.C=b<<14;a.D=b<<16;if((b^a.N)&2048)for(var d=a.bb.length;0<=--d;){var c=a.f[d];a.f[d]=a.bb[d];a.bb[d]=c}a.G=b>>14&3;d=a.N>>14&3;a.G!=d&&(a.ua[d]=a.f[6],a.f[6]=a.ua[a.G]);a.Ra=2;a.N=b}function ad(a,b){a.V&128||(a.B=a.F=a.D=b,a.C=0)}function bd(a,b){a.V&128||(a.B=a.F=b,a.C=0)}function cd(a,b,d,c){a.V&128||(a.B=a.F=a.D=b,a.C=(d^c)&(c^b))}
|
||||
function L(a,b,d){var c,e,f=0;0>a.da?a.da=Yb(a):a.G||(b=4,f=1);a.ea&57344||(a.Ga=63222,a.Eb=b);a.G=0;0<=(c=a.na(b|65536))&&0<=(e=a.na(b+2&65535|65536))&&(Zb(a,e&53247|a.da>>2&12288),f&&(a.M|=4,a.f[6]=4),0<=dd(a,a.da)&&0<=dd(a,a.f[7])&&(a.f[7]=c));a.V&=-113;a.da=-1;throw b|d<<8;}function fc(a,b){var d=b>>13&31;31>d?a.Ua&32&&(b=a.Xb[d]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b}
|
||||
function ed(a,b,d){var c,e,f,g=0;if(d&a.tb){c=b>>13&a.lb[a.G];e=a.ma[a.G][c];f=(a.ma[a.G][c+16]<<6)+(b&8191)&4194303;a.Ua&16?3932160<=f&&4186112>f&&(f=fc(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&(3915776<=f&&(a.M|=32,L(a,4,24)),f&1&&!(d&1)&&(a.M|=64,L(a,4,26)));switch(e&7){case 1:g=4096;case 2:e|=128;d&E&&(g=8192);break;case 4:g=4096;case 5:d&E&&(g=4096);case 6:e|=d&E?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.ma[a.G][c]=e;if(4194170!==f||a.G)a.Pb=a.G,a.ac=c;g&&(g&57344&&(0<=a.da&&(g|=128),a.ea&57344||(a.ea=a.ea|g|a.Pb<<5|a.ac<<1),L(a,168,28)),a.ea&61440||!(4191360>f||4194239<f)||(a.ea|=4096,a.ea&512&&(a.V|=32)))}else f=b&65535,57344<=f?f|=4186112:f&1&&!(d&1)&&(a.M|=64,L(a,4,22));return f}l.ka=function(a){return 4194304<=a?this.f[a-4194304]:0<=a?this.H.La(a):a};l.na=function(a){return this.ka(ed(this,a,tb))};
|
||||
|
|
@ -90,47 +91,47 @@ function dd(a,b){var d,c;a.f[6]=c=a.f[6]-2&65535;a.ea&57344||(a.Ga=a.Ga<<8|246);
|
|||
function gd(a,b,d){var c,e,f=b&7;switch(b>>3&7){case 0:L(a,4,34);break;case 1:return 6===f&&!a.G&&d&E&&(a.f[6]<=a.Sa||65534<=a.f[6])&&(a.f[6]<=a.Sa-32||65534<=a.f[6]?(a.M|=4,a.f[6]=4,L(a,4,36)):(a.M|=8,a.V|=64)),7===f?a.f[f]:a.f[f]|a.J;case 2:e=2;c=a.f[f];7!==f&&(c|=a.J,6>f&&d&1&&(e=1));break;case 3:e=2;c=a.f[f];7!==f&&(c|=a.J);if(0>(c=a.na(c)))return c;c|=a.J;break;case 4:e=-2;6>f&&d&1&&(e=-1);c=a.f[f]+e&65535;7!==f&&(c|=a.J);break;case 5:e=-2;c=a.f[f]-2&65535;7!==f&&(c|=a.J);if(0>(c=a.na(c)))return c;
|
||||
c|=a.J;break;case 6:if(0>(c=a.na(a.f[7])))return c;a.f[7]=a.f[7]+2&65535;c=c+a.f[f]&65535;return c|a.J;case 7:if(0>(c=a.na(a.f[7])))return c;a.f[7]=a.f[7]+2&65535;c=c+a.f[f]&65535;return 0>(c=a.na(c|65536))?c:c|a.J}a.f[f]=a.f[f]+e&65535;!a.J||a.ea&57344||(a.Ga=a.Ga<<8|e<<3&248|f);6===f&&!a.G&&d&E&&0>=e&&(a.f[6]<=a.Sa||65534<=a.f[6])&&(a.f[6]<=a.Sa-32?(a.M|=4,a.f[6]=4,L(a,4,38)):(a.M|=8,a.V|=64));return c}l.Qc=function(a,b){return gd(this,a,b)};l.Rc=function(a,b){return ed(this,gd(this,a,b),b)};
|
||||
function S(a,b){return b&56?a.Lb(gd(a,b,tb)):a.f[b&7]}function hd(a,b){return b&56?P(a,a.L(b,ub)):a.f[b&7]&255}function id(a,b,d,c){b&56?(b=a.L(b,F),M(a,b,c.call(a,d,a.ka(b)))):(b&=7,a.f[b]=c.call(a,d,a.f[b])&65535)}function jd(a,b,d,c){b&56?(b=a.L(b,G),Q(a,b,c.call(a,d,P(a,b)))):(b&=7,a.f[b]=a.f[b]&65280|c.call(a,d,a.f[b])&255)}function kd(a,b,d){b&56?M(a,a.L(b,E),d):a.f[b&7]=d&65535;return d}
|
||||
function ld(a,b,d,c){b&56?Q(a,a.L(b,vb),d):(b&=7,a.f[b]=c?c&1?a.f[b]&-256:d<<24>>24&65535:a.f[b]&-256|d&255);return d}function T(a,b){return((b&128?b|65280:b&255)<<1)+a&65535}
|
||||
function ld(a,b,d,c){b&56?Q(a,a.L(b,vb),d):(b&=7,a.f[b]=d?c&1?d<<24>>24&65535:a.f[b]&-256|d&255:a.f[b]&-256);return d}function T(a,b){return((b&128?b|65280:b&255)<<1)+a&65535}
|
||||
l.Ab=function(a){this.j.complete=!0;var b=this.j.Lc=this.I&&md(this.I),d=a?this.j.pc?0:1:-1;this.j.pc=!1;this.Y=this.b=a;this.pb&256?(Wc(this),a=!1):a=!0;if(a){do{if(b){if(nd(this.I,this.f[7],d)){this.pa();break}d=1}var c,e,f,g;this.V&112&&(this.V&32?L(this,168,52):this.V&64?L(this,4,54):this.V&16&&L(this,12,56),this.V&=-113);if(this.Ra)if(1===this.Ra)this.Ra=2;else{this.Ra=0;c=-1;e=this.dc&224;if(0<(a=this.u.length))for(;0<a--;){if(0<this.u[a].Ja){this.u[a].Ja--;this.Ra=2;break}if(this.u[a].uc){if(!this.u[a].uc()){this.u.splice(a,
|
||||
1);c--;continue}this.u[a].uc=null}this.u[a].Yc>e&&(e=this.u[a].Yc,c=a)}e>(this.N&224)&&(0>c?L(this,160,42):(L(this,this.u[c].kd,44),this.u.splice(c,1)))}this.ea&57344||(this.Ga=0,this.Eb=this.f[7]);this.V=this.N&16;this.g=a=this.na(this.f[7]);0<=a&&(this.f[7]=this.f[7]+2&65535);this.decode(a);if(0>this.g)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break;
|
||||
case 57344:break;default:switch(a&65024){case 2048:0<=(f=gd(this,a,0))&&(g=a>>6&7,0<=dd(this,this.f[g])&&(this.f[g]=this.f[7],this.f[7]=f&65535));break;case 28672:0<=(c=S(this,a))&&(g=a>>6&7,c&32768&&(c|=-65536),e=this.f[g],e&32768&&(e|=-65536),a=~~(c*e),this.f[g]=a>>16&65535,this.f[g|1]=a&65535,this.A=a>>16,this.F=this.A|a,this.D=this.C=0,-32768>a||32767<a)&&(this.D=65536);break;case 29184:0<=(c=S(this,a))&&(c?(g=a>>6&7,e=this.f[g]<<16|this.f[g|1],this.D=this.C=0,c&32768&&(c|=-65536),a=~~(e/c),-32768<=
|
||||
a&&32767>=a?(this.f[g]=a&65535,this.f[g|1]=e-a*c&65535,this.F=a>>16|a,this.A=a>>16):(this.C=32768,this.F=a>>15|a,this.A=e>>16,-1===c&&65534===this.f[g]&&(this.f[g]=this.f[g|1]=1))):(this.F=this.A=0,this.C=32768,this.D=65536));break;case 29696:0<=(c=S(this,a))&&(g=a>>6&7,a=this.f[g],a&32768&&(a|=4294901760),this.D=this.C=0,c&=63,c&32?(c=64-c,16<c&&(c=16),this.D=a<<17-c,a>>=c):c&&(16<c?(this.C=a,a=0):(this.D=a<<=c,(e=a>>15&65535)&&65535!==e&&(this.C=32768))),this.f[g]=a&65535,this.A=this.F=a);break;
|
||||
case 30208:if(0<=(c=S(this,a))){g=a>>6&7;e=this.f[g]<<16|this.f[g|1];this.D=this.C=0;c&=63;if(c&32)c=64-c,32<c&&(c=32),a=e>>c-1,this.D=a<<16,a>>=1,e&2147483648&&(a|=4294967295<<32-c);else if(c){if(a=e<<c-1,this.D=a>>15,a<<=1,32<c&&(c=32),e>>=32-c)e|=4294967295<<c&4294967295,4294967295!==e&&(this.C=32768)}else a=e;this.f[g]=a>>16&65535;this.f[g|1]=a&65535;this.A=a>>16;this.F=a>>16|a}break;case 30720:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(e^=this.f[a>>6&7],0<=M(this,c,e)&&(this.A=this.F=e,this.C=0)):
|
||||
(this.A=this.F=e=this.f[a&7]^=this.f[a>>6&7],this.C=0);break;case 32256:g=a>>6&7;if(this.f[g]=this.f[g]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.f[7]=T(this.f[7],a);break;case 512:this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 768:this.F&65535||(this.f[7]=T(this.f[7],a));break;case 1024:(this.A&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1280:(this.A&32768)!==(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1536:this.F&
|
||||
65535&&(this.A&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1792:this.F&65535&&(this.A&32768)===(this.C&32768)||(this.f[7]=T(this.f[7],a));break;case 32768:this.A&32768||(this.f[7]=T(this.f[7],a));break;case 33280:!(this.D&65536)&&this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 33024:this.A&32768&&(this.f[7]=T(this.f[7],a));break;case 33536:if(this.D&65536||!(this.F&65535))this.f[7]=T(this.f[7],a);break;case 33792:this.C&32768||(this.f[7]=T(this.f[7],a));break;case 34048:this.C&
|
||||
32768&&(this.f[7]=T(this.f[7],a));break;case 34304:this.D&65536||(this.f[7]=T(this.f[7],a));break;case 34560:this.D&65536&&(this.f[7]=T(this.f[7],a));break;case 34816:L(this,24,2);break;case 35072:L(this,28,4);break;default:switch(a&65472){case 64:0<=(f=gd(this,a,0))&&(this.f[7]=f&65535);break;case 192:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<8|e>>8,0<=M(this,c,a)&&(this.A=this.F=e&65280,this.C=this.D=0)):(g=a&7,e=this.f[g],this.f[g]=(e<<8|e>>8)&65535,this.A=this.F=e&65280,this.C=this.D=0);break;
|
||||
case 2560:break;case 2624:0<=(e=this.ka(c=this.L(a,F)))&&(a=~e,0<=M(this,c,a)&&(this.A=this.F=a,this.D=65536,this.C=0));break;case 2688:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e+1,0<=M(this,c,a)&&(this.A=this.F=a,this.C=a&(a^e))):(g=a&7,e=this.f[g],a=e+1,this.f[g]=a&65535,this.A=this.F=a,this.C=a&(a^e));break;case 2752:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e-1,0<=M(this,c,a)&&(this.A=this.F=a,this.C=(a^e)&e)):(g=a&7,e=this.f[g],a=e-1,this.f[g]=a&65535,this.A=this.F=a,this.C=(a^e)&e);break;case 2816:0<=
|
||||
(e=this.ka(c=this.L(a,F)))&&(a=-e,0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a&e));break;case 2880:0<=(e=this.ka(c=this.L(a,F)))&&(a=e+(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a&(a^e)));break;case 2944:0<=(e=this.ka(c=this.L(a,F)))&&(a=e-(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=(a^e)&e));break;case 3008:0<=(e=S(this,a))&&(this.A=this.F=e,this.D=this.C=0);break;case 3072:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=(this.D&65536|e)>>1,0<=M(this,c,a)&&(this.D=
|
||||
e<<16,this.A=this.F=a,this.C=a^this.D>>1)):(g=a&7,e=this.f[g],a=(this.D&65536|e)>>1,this.f[g]=a&65535,this.D=e<<16,this.A=this.F=a,this.C=a^this.D>>1);break;case 3136:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1|this.D>>16&1,0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1|this.D>>16&1,this.f[g]=a&65535,this.D=this.A=this.F=a,this.C=a^e);break;case 3200:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e&32768|e>>1,0<=M(this,c,a)&&(this.D=e<<16,this.A=this.F=a,this.C=this.A^this.D>>
|
||||
1)):(g=a&7,e=this.f[g],a=e&32768|e>>1,this.f[g]=a&65535,this.D=e<<16,this.A=this.F=a,this.C=this.A^this.D>>1);break;case 3264:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1,0<=M(this,c,a)&&(this.D=this.A=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1,this.f[g]=a&65535,this.D=this.A=this.F=a,this.C=a^e);break;case 3328:f=this.f[7]+((a&63)<<1)&65535;0<=(c=this.na(f|65536))&&(this.f[7]=this.f[5],this.f[5]=c,this.f[6]=f+2&65535);break;case 3392:a&56?0<=(f=gd(this,a,0))&&(61440!==(this.N&61440)&&(f&=65535),
|
||||
this.G=this.N>>12&3,0<=(c=this.na(f))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.A=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.va[this.N>>12&3],0<=dd(this,c)&&(this.A=this.F=c,this.C=0));break;case 3456:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(f&=65535,this.G=this.N>>12&3,0<=(c=ed(this,f,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.A=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]=e:this.va[this.N>>
|
||||
12&3]=e,this.A=this.F=e,this.C=0));break;case 3520:0<=(c=this.L(a,E))&&(a=-(this.A>>15&1),0<=M(this,c,a)&&(this.F=a,this.C=0));break;case 35328:break;case 35392:0<=(e=P(this,c=this.L(a,G)))&&(a=~e,0<=Q(this,c,a)&&(this.A=this.F=a<<8,this.D=65536,this.C=0));break;case 35456:0<=(e=P(this,c=this.L(a,G)))&&(a=e+1,0<=Q(this,c,a)&&(this.A=this.F=a<<8,this.C=(a&(a^e))<<8));break;case 35520:0<=(e=P(this,c=this.L(a,G)))&&(a=e-1,0<=Q(this,c,a)&&(this.A=this.F=a<<8,this.C=((a^e)&e)<<8));break;case 35584:0<=
|
||||
(e=P(this,c=this.L(a,G)))&&(a=-e,0<=Q(this,c,a)&&(this.D=this.A=this.F=a<<8,this.C=(a&e)<<8));break;case 35648:0<=(e=P(this,c=this.L(a,G)))&&(a=e+(this.D>>16&1),0<=Q(this,c,a)&&(this.A=this.F=this.D=a<<8,this.C=(a&(a^e))<<8));break;case 35712:0<=(e=P(this,c=this.L(a,G)))&&(a=e-(this.D>>16&1),0<=Q(this,c,a)&&(this.A=this.F=this.D=a<<8,this.C=((a^e)&e)<<8));break;case 35776:0<=(e=hd(this,a))&&(this.A=this.F=e<<8,this.D=this.C=0);break;case 35840:0<=(e=P(this,c=this.L(a,G)))&&(a=((this.D&65536)>>8|e)>>
|
||||
1,0<=Q(this,c,a)&&(this.D=e<<16,this.A=this.F=a<<8,this.C=this.A^this.D>>1));break;case 35904:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1|this.D>>16&1,0<=Q(this,c,a)&&(this.D=this.A=this.F=a<<8,this.C=(a^e)<<8));break;case 35968:0<=(e=P(this,c=this.L(a,G)))&&(a=e&128|e>>1,0<=Q(this,c,a)&&(this.D=e<<16,this.A=this.F=a<<8,this.C=this.A^this.D>>1));break;case 36032:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1,0<=Q(this,c,a)&&(this.D=this.A=this.F=a<<8,this.C=(a^e)<<8));break;case 36160:a&56?0<=(f=gd(this,a,0))&&
|
||||
(this.G=this.N>>12&3,0<=(c=this.na(f|65536))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.A=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.va[this.N>>12&3],0<=dd(this,c)&&(this.A=this.F=c,this.C=0));break;case 36224:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(this.G=this.N>>12&3,0<=(c=ed(this,f|65536,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.A=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]=
|
||||
e:this.va[this.N>>12&3]=e,this.A=this.F=e,this.C=0));break;default:switch(a&65528){case 128:0<=(c=fd(this))&&(g=a&7,this.f[7]=this.f[g],this.f[g]=c);break;case 152:this.N&49152||(this.N=this.N&63519|(a&7)<<5,this.Ra=1);break;case 160:case 168:break;case 176:case 184:break;default:switch(a){case 0:49152&this.N?(this.M|=128,L(this,4,46)):(this.qa=3,Wc(this),console.log("HALT at "+this.f[7].toString(8)));break;case 1:c=0;if(0<(a=this.u.length))for(;0<a--;)c+=this.u[a].Ja,this.u[a].Ja=0;0===c&&0===this.qa&&
|
||||
1);c--;continue}this.u[a].uc=null}this.u[a].Yc>e&&(e=this.u[a].Yc,c=a)}e>(this.N&224)&&(0>c?L(this,160,42):(L(this,this.u[c].ld,44),this.u.splice(c,1)))}this.ea&57344||(this.Ga=0,this.Eb=this.f[7]);this.V=this.N&16;this.g=a=this.na(this.f[7]);0<=a&&(this.f[7]=this.f[7]+2&65535);this.decode(a);if(0>this.g)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break;
|
||||
case 57344:break;default:switch(a&65024){case 2048:0<=(f=gd(this,a,0))&&(g=a>>6&7,0<=dd(this,this.f[g])&&(this.f[g]=this.f[7],this.f[7]=f&65535));break;case 28672:0<=(c=S(this,a))&&(g=a>>6&7,c&32768&&(c|=-65536),e=this.f[g],e&32768&&(e|=-65536),a=~~(c*e),this.f[g]=a>>16&65535,this.f[g|1]=a&65535,this.B=a>>16,this.F=this.B|a,this.D=this.C=0,-32768>a||32767<a)&&(this.D=65536);break;case 29184:0<=(c=S(this,a))&&(c?(g=a>>6&7,e=this.f[g]<<16|this.f[g|1],this.D=this.C=0,c&32768&&(c|=-65536),a=~~(e/c),-32768<=
|
||||
a&&32767>=a?(this.f[g]=a&65535,this.f[g|1]=e-a*c&65535,this.F=a>>16|a,this.B=a>>16):(this.C=32768,this.F=a>>15|a,this.B=e>>16,-1===c&&65534===this.f[g]&&(this.f[g]=this.f[g|1]=1))):(this.F=this.B=0,this.C=32768,this.D=65536));break;case 29696:0<=(c=S(this,a))&&(g=a>>6&7,a=this.f[g],a&32768&&(a|=4294901760),this.D=this.C=0,c&=63,c&32?(c=64-c,16<c&&(c=16),this.D=a<<17-c,a>>=c):c&&(16<c?(this.C=a,a=0):(this.D=a<<=c,(e=a>>15&65535)&&65535!==e&&(this.C=32768))),this.f[g]=a&65535,this.B=this.F=a);break;
|
||||
case 30208:if(0<=(c=S(this,a))){g=a>>6&7;e=this.f[g]<<16|this.f[g|1];this.D=this.C=0;c&=63;if(c&32)c=64-c,32<c&&(c=32),a=e>>c-1,this.D=a<<16,a>>=1,e&2147483648&&(a|=4294967295<<32-c);else if(c){if(a=e<<c-1,this.D=a>>15,a<<=1,32<c&&(c=32),e>>=32-c)e|=4294967295<<c&4294967295,4294967295!==e&&(this.C=32768)}else a=e;this.f[g]=a>>16&65535;this.f[g|1]=a&65535;this.B=a>>16;this.F=a>>16|a}break;case 30720:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(e^=this.f[a>>6&7],0<=M(this,c,e)&&(this.B=this.F=e,this.C=0)):
|
||||
(this.B=this.F=e=this.f[a&7]^=this.f[a>>6&7],this.C=0);break;case 32256:g=a>>6&7;if(this.f[g]=this.f[g]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.f[7]=T(this.f[7],a);break;case 512:this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 768:this.F&65535||(this.f[7]=T(this.f[7],a));break;case 1024:(this.B&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1280:(this.B&32768)!==(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1536:this.F&
|
||||
65535&&(this.B&32768)===(this.C&32768)&&(this.f[7]=T(this.f[7],a));break;case 1792:this.F&65535&&(this.B&32768)===(this.C&32768)||(this.f[7]=T(this.f[7],a));break;case 32768:this.B&32768||(this.f[7]=T(this.f[7],a));break;case 33280:!(this.D&65536)&&this.F&65535&&(this.f[7]=T(this.f[7],a));break;case 33024:this.B&32768&&(this.f[7]=T(this.f[7],a));break;case 33536:if(this.D&65536||!(this.F&65535))this.f[7]=T(this.f[7],a);break;case 33792:this.C&32768||(this.f[7]=T(this.f[7],a));break;case 34048:this.C&
|
||||
32768&&(this.f[7]=T(this.f[7],a));break;case 34304:this.D&65536||(this.f[7]=T(this.f[7],a));break;case 34560:this.D&65536&&(this.f[7]=T(this.f[7],a));break;case 34816:L(this,24,2);break;case 35072:L(this,28,4);break;default:switch(a&65472){case 64:0<=(f=gd(this,a,0))&&(this.f[7]=f&65535);break;case 192:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<8|e>>8,0<=M(this,c,a)&&(this.B=this.F=e&65280,this.C=this.D=0)):(g=a&7,e=this.f[g],this.f[g]=(e<<8|e>>8)&65535,this.B=this.F=e&65280,this.C=this.D=0);break;
|
||||
case 2560:break;case 2624:0<=(e=this.ka(c=this.L(a,F)))&&(a=~e,0<=M(this,c,a)&&(this.B=this.F=a,this.D=65536,this.C=0));break;case 2688:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e+1,0<=M(this,c,a)&&(this.B=this.F=a,this.C=a&(a^e))):(g=a&7,e=this.f[g],a=e+1,this.f[g]=a&65535,this.B=this.F=a,this.C=a&(a^e));break;case 2752:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e-1,0<=M(this,c,a)&&(this.B=this.F=a,this.C=(a^e)&e)):(g=a&7,e=this.f[g],a=e-1,this.f[g]=a&65535,this.B=this.F=a,this.C=(a^e)&e);break;case 2816:0<=
|
||||
(e=this.ka(c=this.L(a,F)))&&(a=-e,0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a&e));break;case 2880:0<=(e=this.ka(c=this.L(a,F)))&&(a=e+(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a&(a^e)));break;case 2944:0<=(e=this.ka(c=this.L(a,F)))&&(a=e-(this.D>>16&1),0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=(a^e)&e));break;case 3008:0<=(e=S(this,a))&&(this.B=this.F=e,this.D=this.C=0);break;case 3072:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=(this.D&65536|e)>>1,0<=M(this,c,a)&&(this.D=
|
||||
e<<16,this.B=this.F=a,this.C=a^this.D>>1)):(g=a&7,e=this.f[g],a=(this.D&65536|e)>>1,this.f[g]=a&65535,this.D=e<<16,this.B=this.F=a,this.C=a^this.D>>1);break;case 3136:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1|this.D>>16&1,0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1|this.D>>16&1,this.f[g]=a&65535,this.D=this.B=this.F=a,this.C=a^e);break;case 3200:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e&32768|e>>1,0<=M(this,c,a)&&(this.D=e<<16,this.B=this.F=a,this.C=this.B^this.D>>
|
||||
1)):(g=a&7,e=this.f[g],a=e&32768|e>>1,this.f[g]=a&65535,this.D=e<<16,this.B=this.F=a,this.C=this.B^this.D>>1);break;case 3264:a&56?0<=(e=this.ka(c=this.L(a,F)))&&(a=e<<1,0<=M(this,c,a)&&(this.D=this.B=this.F=a,this.C=a^e)):(g=a&7,e=this.f[g],a=e<<1,this.f[g]=a&65535,this.D=this.B=this.F=a,this.C=a^e);break;case 3328:f=this.f[7]+((a&63)<<1)&65535;0<=(c=this.na(f|65536))&&(this.f[7]=this.f[5],this.f[5]=c,this.f[6]=f+2&65535);break;case 3392:a&56?0<=(f=gd(this,a,0))&&(61440!==(this.N&61440)&&(f&=65535),
|
||||
this.G=this.N>>12&3,0<=(c=this.na(f))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.B=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.ua[this.N>>12&3],0<=dd(this,c)&&(this.B=this.F=c,this.C=0));break;case 3456:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(f&=65535,this.G=this.N>>12&3,0<=(c=ed(this,f,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.B=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]=e:this.ua[this.N>>
|
||||
12&3]=e,this.B=this.F=e,this.C=0));break;case 3520:0<=(c=this.L(a,E))&&(a=-(this.B>>15&1),0<=M(this,c,a)&&(this.F=a,this.C=0));break;case 35328:break;case 35392:0<=(e=P(this,c=this.L(a,G)))&&(a=~e,0<=Q(this,c,a)&&(this.B=this.F=a<<8,this.D=65536,this.C=0));break;case 35456:0<=(e=P(this,c=this.L(a,G)))&&(a=e+1,0<=Q(this,c,a)&&(this.B=this.F=a<<8,this.C=(a&(a^e))<<8));break;case 35520:0<=(e=P(this,c=this.L(a,G)))&&(a=e-1,0<=Q(this,c,a)&&(this.B=this.F=a<<8,this.C=((a^e)&e)<<8));break;case 35584:0<=
|
||||
(e=P(this,c=this.L(a,G)))&&(a=-e,0<=Q(this,c,a)&&(this.D=this.B=this.F=a<<8,this.C=(a&e)<<8));break;case 35648:0<=(e=P(this,c=this.L(a,G)))&&(a=e+(this.D>>16&1),0<=Q(this,c,a)&&(this.B=this.F=this.D=a<<8,this.C=(a&(a^e))<<8));break;case 35712:0<=(e=P(this,c=this.L(a,G)))&&(a=e-(this.D>>16&1),0<=Q(this,c,a)&&(this.B=this.F=this.D=a<<8,this.C=((a^e)&e)<<8));break;case 35776:0<=(e=hd(this,a))&&(this.B=this.F=e<<8,this.D=this.C=0);break;case 35840:0<=(e=P(this,c=this.L(a,G)))&&(a=((this.D&65536)>>8|e)>>
|
||||
1,0<=Q(this,c,a)&&(this.D=e<<16,this.B=this.F=a<<8,this.C=this.B^this.D>>1));break;case 35904:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1|this.D>>16&1,0<=Q(this,c,a)&&(this.D=this.B=this.F=a<<8,this.C=(a^e)<<8));break;case 35968:0<=(e=P(this,c=this.L(a,G)))&&(a=e&128|e>>1,0<=Q(this,c,a)&&(this.D=e<<16,this.B=this.F=a<<8,this.C=this.B^this.D>>1));break;case 36032:0<=(e=P(this,c=this.L(a,G)))&&(a=e<<1,0<=Q(this,c,a)&&(this.D=this.B=this.F=a<<8,this.C=(a^e)<<8));break;case 36160:a&56?0<=(f=gd(this,a,0))&&
|
||||
(this.G=this.N>>12&3,0<=(c=this.na(f|65536))&&(this.G=this.N>>14&3,0<=dd(this,c)&&(this.B=this.F=c,this.C=0))):(g=a&7,c=6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]:this.ua[this.N>>12&3],0<=dd(this,c)&&(this.B=this.F=c,this.C=0));break;case 36224:0<=(e=fd(this))&&((this.ea&57344||(this.Ga=22),a&56)?0<=(f=gd(this,a,0))&&(this.G=this.N>>12&3,0<=(c=ed(this,f|65536,E))&&(this.G=this.N>>14&3,0<=M(this,c,e)&&(this.B=this.F=e,this.C=0))):(g=a&7,6!==g||(this.N>>2&12288)===(this.N&12288)?this.f[g]=
|
||||
e:this.ua[this.N>>12&3]=e,this.B=this.F=e,this.C=0));break;default:switch(a&65528){case 128:0<=(c=fd(this))&&(g=a&7,this.f[7]=this.f[g],this.f[g]=c);break;case 152:this.N&49152||(this.N=this.N&63519|(a&7)<<5,this.Ra=1);break;case 160:case 168:break;case 176:case 184:break;default:switch(a){case 0:49152&this.N?(this.M|=128,L(this,4,46)):(this.qa=3,Wc(this),console.log("HALT at "+this.f[7].toString(8)));break;case 1:c=0;if(0<(a=this.u.length))for(;0<a--;)c+=this.u[a].Ja,this.u[a].Ja=0;0===c&&0===this.qa&&
|
||||
(this.qa=2,Wc(this));break;case 3:L(this,12,6);break;case 4:L(this,16,8);break;case 5:break;case 2:case 6:c=this.f[6];0<=(f=this.na(c|65536))&&(c=c+2&65535,0<=(e=this.na(c|65536))&&(this.f[6]=c+2&65535,e&=63743,this.N&49152&&(e=e&63519|this.N&63712),this.f[7]=f,Zb(this,e),this.V&=-17,2===a&&(this.V|=this.N&16)));break;default:L(this,8,48)}}}}}}}while(0<this.b)}return this.j.complete?this.Y-this.b:void 0===this.j.complete?0:-1};
|
||||
Oa(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Xc(c);bb(c,d)}});function od(a,b){var d=a+b;this.V&128||(this.A=this.F=this.D=d,this.C=(a^d)&(b^d));return d&65535}function pd(a,b){a=~a&b;bd(this,a);return a}function qd(a,b){a=~a&b;bd(this,a<<8);return a}function rd(a,b){a|=b;bd(this,a);return a}function sd(a,b){a|=b;bd(this,a<<8);return a}function td(a,b){var d=b-a;cd(this,d,a,b);return d&65535}function ud(){this.g=-1;--this.b}
|
||||
function vd(){this.g=-1;--this.b}function U(a){a&1&&(this.D=0);a&2&&(this.C=0);a&4&&(this.F=1);a&8&&(this.A=0);--this.b}function wd(){this.g=-1;--this.b}function xd(){this.g=-1;--this.b}function yd(){this.g=-1;--this.b}function zd(){--this.b}function V(a){a&1&&(this.D=65536);a&2&&(this.C=32768);a&4&&(this.F=0);a&8&&(this.A=32768);--this.b}function Ad(){this.g=-1;--this.b}function Bd(){this.g=-1;--this.b}function X(){L(this,8,48)}function Yc(a){Cd[a>>12].call(this,a)}
|
||||
var Cd=[function(a){Dd[a>>8&15].call(this,a)},function(a){bd(this,kd(this,a,S(this,a>>6)));--this.b},function(a){var b=S(this,a>>6);a=S(this,a);cd(this,b-a,a,b);--this.b},function(a){bd(this,S(this,a>>6)&S(this,a));--this.b},function(a){id(this,a,S(this,a>>6),pd);--this.b},function(a){id(this,a,S(this,a>>6),rd);--this.b},function(a){id(this,a,S(this,a>>6),od);--this.b},function(a){Ed[a>>8&15].call(this,a)},function(a){Fd[a>>8&15].call(this,a)},function(a){var b=hd(this,a>>6);bd(this,ld(this,a,b,2)<<
|
||||
Oa(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Xc(c);bb(c,d)}});function od(a,b){var d=a+b;this.V&128||(this.B=this.F=this.D=d,this.C=(a^d)&(b^d));return d&65535}function pd(a,b){a=~a&b;bd(this,a);return a}function qd(a,b){a=~a&b;bd(this,a<<8);return a}function rd(a,b){a|=b;bd(this,a);return a}function sd(a,b){a|=b;bd(this,a<<8);return a}function td(a,b){var d=b-a;cd(this,d,a,b);return d&65535}function ud(){this.g=-1;--this.b}
|
||||
function vd(){this.g=-1;--this.b}function U(a){a&1&&(this.D=0);a&2&&(this.C=0);a&4&&(this.F=1);a&8&&(this.B=0);--this.b}function wd(){this.g=-1;--this.b}function xd(){this.g=-1;--this.b}function yd(){this.g=-1;--this.b}function zd(){--this.b}function V(a){a&1&&(this.D=65536);a&2&&(this.C=32768);a&4&&(this.F=0);a&8&&(this.B=32768);--this.b}function Ad(){this.g=-1;--this.b}function Bd(){this.g=-1;--this.b}function X(){L(this,8,48)}function Yc(a){Cd[a>>12].call(this,a)}
|
||||
var Cd=[function(a){Dd[a>>8&15].call(this,a)},function(a){bd(this,kd(this,a,S(this,a>>6)));--this.b},function(a){var b=S(this,a>>6);a=S(this,a);cd(this,b-a,a,b);--this.b},function(a){bd(this,S(this,a>>6)&S(this,a));--this.b},function(a){id(this,a,S(this,a>>6),pd);--this.b},function(a){id(this,a,S(this,a>>6),rd);--this.b},function(a){id(this,a,S(this,a>>6),od);--this.b},function(a){Ed[a>>8&15].call(this,a)},function(a){Fd[a>>8&15].call(this,a)},function(a){var b=hd(this,a>>6);bd(this,ld(this,a,b,1)<<
|
||||
8);--this.b},function(a){var b=hd(this,a>>6)<<8;a=hd(this,a)<<8;cd(this,b-a,a,b);--this.b},function(a){bd(this,(hd(this,a>>6)&hd(this,a))<<8);--this.b},function(a){jd(this,a,hd(this,a>>6),qd);--this.b},function(a){jd(this,a,hd(this,a>>6),sd);--this.b},function(a){id(this,a,S(this,a>>6),td);--this.b},X],Dd=[function(a){Gd[a>>4&15].call(this,a)},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},
|
||||
function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},xd,xd,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],Gd=[function(a){Ld[a&15].call(this,a)},X,X,X,X,X,X,X,X,X,function(a){Md[a&15].call(this,a)},function(a){Nd[a&15].call(this,a)},X,X,X,X],Md=[zd,function(){this.D=0;--this.b},function(){this.C=0;--this.b},U,function(){this.F=1;--this.b},U,U,U,function(){this.A=0;--this.b},U,U,U,U,U,
|
||||
U,U],Nd=[zd,function(){this.D=65536;--this.b},function(){this.C=32768;--this.b},V,function(){this.F=0;--this.b},V,V,V,function(){this.A=32768;--this.b},V,V,V,V,V,V,V],Ld=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.N&49152||($c(this),this.H.reset());--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},X,X,X,X,X,X,X,X],Ed=[yd,yd,wd,wd,ud,ud,vd,vd,Bd,Bd,X,
|
||||
function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},xd,xd,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],Gd=[function(a){Ld[a&15].call(this,a)},X,X,X,X,X,X,X,X,X,function(a){Md[a&15].call(this,a)},function(a){Nd[a&15].call(this,a)},X,X,X,X],Md=[zd,function(){this.D=0;--this.b},function(){this.C=0;--this.b},U,function(){this.F=1;--this.b},U,U,U,function(){this.B=0;--this.b},U,U,U,U,U,
|
||||
U,U],Nd=[zd,function(){this.D=65536;--this.b},function(){this.C=32768;--this.b},V,function(){this.F=0;--this.b},V,V,V,function(){this.B=32768;--this.b},V,V,V,V,V,V,V],Ld=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.N&49152||($c(this),this.H.reset());--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},X,X,X,X,X,X,X,X],Ed=[yd,yd,wd,wd,ud,ud,vd,vd,Bd,Bd,X,
|
||||
X,X,X,Ad,Ad],Fd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(a){Od[a>>6&3].call(this,a)},function(a){Pd[a>>6&3].call(this,a)},function(a){Qd[a>>6&3].call(this,a)},function(a){Rd[a>>6&3].call(this,a)},X,X],Hd=[function(a){ad(this,
|
||||
kd(this,a,0));--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Id=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Jd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Kd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],
|
||||
Od=[function(a){ad(this,ld(this,a,0,1));--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Pd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Qd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Rd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=
|
||||
-1;--this.b}];function Sd(a){u.call(this,"ROM",a,Sd);this.g=null;this.J=a.addr;this.B=a.size;this.O=a.writable;this.u=a.alias;this.G=a.file;this.R=da(this.G);if(this.G){a=this.G;var b=ia(this.R);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var d=this;wa(a,null,!0,function(a,b,f){re(d,a,b,f)})}}w(Sd);Sd.prototype.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;se(this)};
|
||||
Sd.prototype.Qa=function(){if(this.Na){if(this.I){var a=this.I,b=this.id,d=this.J,c=this.B,e=this.Na,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var n=f,k=[k>>>0,g],q=qa(n,k,a.vc);0>q&&n.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.O.push({nd:b,w:d,Uc:c,Na:e,sc:f})}delete this.Na}return!0};Sd.prototype.Pa=function(){return!0};
|
||||
Od=[function(a){ad(this,ld(this,a,0));--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Pd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Qd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b}],Rd=[function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=-1;--this.b},function(){this.g=
|
||||
-1;--this.b}];function Sd(a){u.call(this,"ROM",a,Sd);this.g=null;this.J=a.addr;this.w=a.size;this.O=a.writable;this.u=a.alias;this.G=a.file;this.R=da(this.G);if(this.G){a=this.G;var b=ia(this.R);"json"!=b&&"hex"!=b&&(a=ka()+"/api/v1/dump?file="+this.G+"&format=bytes&decimal=true");var d=this;wa(a,null,!0,function(a,b,f){re(d,a,b,f)})}}w(Sd);Sd.prototype.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;se(this)};
|
||||
Sd.prototype.Qa=function(){if(this.Na){if(this.I){var a=this.I,b=this.id,d=this.J,c=this.w,e=this.Na,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var n=f,k=[k>>>0,g],q=qa(n,k,a.vc);0>q&&n.splice(-(q+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.O.push({pd:b,A:d,Uc:c,Na:e,sc:f})}delete this.Na}return!0};Sd.prototype.Pa=function(){return!0};
|
||||
function re(a,b,d,c){if(c)a.sa("Unable to load system ROM (error "+c+": "+b+")");else{Za(a.tc,b,d);var e;if("["==d.charAt(0)||"{"==d.charAt(0))try{var f,g,h=eval("("+d+")");if(f=h.bytes)a.g=f;else if(f=h.words)for(a.g=Array(2*f.length),g=e=0;e<f.length;e++)a.g[g++]=f[e]&255,a.g[g++]=f[e]>>8&255;else if(f=h.data)for(a.g=Array(4*f.length),g=e=0;e<f.length;e++)a.g[g++]=f[e]&255,a.g[g++]=f[e]>>8&255,a.g[g++]=f[e]>>16&255,a.g[g++]=f[e]>>24&255;else a.g=h;a.Na=h.symbols;if(!a.g.length){t("Empty ROM: "+
|
||||
b);return}if(1==a.g.length){t(a.g[0]);return}}catch(k){a.sa("ROM data error: "+k.message);return}else for(b=d.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.g=Array(b.length),e=0;e<b.length;e++)a.g[e]=ba(b[e],16);se(a)}}
|
||||
function se(a){if(!qb(a))if(!a.G)D(a);else if(a.g&&a.H){a.B||(a.B=a.g.length);if(a.g.length!=a.B)rb(a,"ROM size ("+r(a.g.length,8,!0)+") does not match specified size ("+r(a.B,8,!0)+")");else{var b;b=a.J;if(Eb(a.H,b,a.B,a.O?1:mc)){var d;for(d=0;d<a.g.length;d++){var c=a.H,e=b+d;c.S[(e&c.H)>>>c.Z].Cb(e&c.g,a.g[d]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.u?b.push(a.u):null!=a.u&&a.u.length&&(b=a.u);for(d=0;d<b.length;d++){for(var f=a,c=b[d],e=f.H,g=f.B,h=[],k=f.J>>>e.Z;0<g&&k<e.S.length;)h.push(e.S[k++]),
|
||||
g-=e.Da;e=f.H;f=f.B;g=0;for(c>>>=e.Z;0<f&&c<e.S.length;){k=h[g++];if(!k)break;e.S[c++]=k;f-=e.Da}}delete a.g}}D(a)}}Oa(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Sd(c);bb(c,d)}});function te(a){u.call(this,"RAM",a,te);this.u=a.addr;this.B=a.size;this.g=!1}w(te);l=te.prototype;l.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;D(this)};l.Qa=function(a,b){b||this.reset();return!0};l.Pa=function(a){return a?this.save():!0};
|
||||
l.reset=function(){!this.g&&this.B&&Eb(this.H,this.u,this.B,1)&&(this.g=!0);this.g||t("No RAM allocated")};l.save=function(){return null};l.restore=function(){return!0};Oa(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new te(c);bb(c,d)}});function ue(a){u.call(this,"Keyboard",a,ue,65536);D(this)}w(ue);ue.prototype.xa=function(){return!1};ue.prototype.$a=function(a,b,d,c){this.B=a;this.b=d;this.I=c;this.ha=null};
|
||||
function se(a){if(!qb(a))if(!a.G)D(a);else if(a.g&&a.H){a.w||(a.w=a.g.length);if(a.g.length!=a.w)rb(a,"ROM size ("+r(a.g.length,8,!0)+") does not match specified size ("+r(a.w,8,!0)+")");else{var b;b=a.J;if(Eb(a.H,b,a.w,a.O?1:mc)){var d;for(d=0;d<a.g.length;d++){var c=a.H,e=b+d;c.S[(e&c.H)>>>c.Z].Cb(e&c.g,a.g[d]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.u?b.push(a.u):null!=a.u&&a.u.length&&(b=a.u);for(d=0;d<b.length;d++){for(var f=a,c=b[d],e=f.H,g=f.w,h=[],k=f.J>>>e.Z;0<g&&k<e.S.length;)h.push(e.S[k++]),
|
||||
g-=e.Da;e=f.H;f=f.w;g=0;for(c>>>=e.Z;0<f&&c<e.S.length;){k=h[g++];if(!k)break;e.S[c++]=k;f-=e.Da}}delete a.g}}D(a)}}Oa(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Sd(c);bb(c,d)}});function te(a){u.call(this,"RAM",a,te);this.u=a.addr;this.w=a.size;this.g=!1}w(te);l=te.prototype;l.$a=function(a,b,d,c){this.H=b;this.b=d;this.I=c;D(this)};l.Qa=function(a,b){b||this.reset();return!0};l.Pa=function(a){return a?this.save():!0};
|
||||
l.reset=function(){!this.g&&this.w&&Eb(this.H,this.u,this.w,1)&&(this.g=!0);this.g||t("No RAM allocated")};l.save=function(){return null};l.restore=function(){return!0};Oa(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new te(c);bb(c,d)}});function ue(a){u.call(this,"Keyboard",a,ue,65536);D(this)}w(ue);ue.prototype.wa=function(){return!1};ue.prototype.$a=function(a,b,d,c){this.w=a;this.b=d;this.I=c;this.ha=null};
|
||||
Oa(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new ue(c);bb(c,d)}});function ve(a){u.call(this,"Debugger",a,ve);this.za=a.base||16;this.$=this.Ia=this.R=0;this.ca=!1;this.G=-1;this.u=[];this.ha={}}w(ve);var we={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function xe(a,b,d,c){if(d)if(b){0>a.G&&a.u.length&&(a.G=0);if(0>a.G||b!=a.u[a.G])a.u.splice(0,0,b),a.G=0;a.G--}else a.ca?b="end":b=a.u[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");d=0;var e=null;c=c||";";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==c&&!e||!g)a.push(pa(b.substring(d,f))),d=f+1}}return a}
|
||||
function xe(a,b,d,c){if(d)if(b){0>a.G&&a.u.length&&(a.G=0);if(0>a.G||b!=a.u[a.G])a.u.splice(0,0,b),a.G=0;a.G--}else a.ca?b="end":b=a.u[a.G+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");d=0;var e=null;c=c||";";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==c&&!e||!g)a.push(oa(b.substring(d,f))),d=f+1}}return a}
|
||||
function ye(a,b,d){for(d=d||-1;d--&&b.length;){var c=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(c){case "*":c=f*e;break;case "/":if(!e)return!1;c=f/e;break;case "%":if(!e)return!1;c=f%e;break;case "+":c=f+e;break;case "-":c=f-e;break;case "<<":c=f<<e;break;case ">>":c=f>>e;break;case ">>>":c=f>>>e;break;case "<":c=f<e?1:0;break;case "<=":c=f<=e?1:0;break;case ">":c=f>e?1:0;break;case ">=":c=f>=e?1:0;break;case "==":c=f==e?1:0;break;case "!=":c=f!=e?1:0;break;case "&":c=f&e;break;
|
||||
case "^":c=f^e;break;case "|":c=f|e;break;case "&&":c=f&&e?1:0;break;case "||":c=f||e?1:0;break;default:return!1}a.push(c|0)}return!0}
|
||||
function ze(a,b,d){var c;if(b){b=Ae(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],q=n.length,n=pa(n);if(!n){f=!0;break}n=Be(a,n,null,!1===d);if(void 0===n){f=!0;d=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],p=n.length;k.length&&we[n]<we[k[k.length-1]]&&ye(h,k,1);k.push(n);b=b.substr(q+p)}ye(h,k)&&1==h.length||(f=!0);f?d&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(c=h.pop(),d&&Ce(a,null,
|
||||
function ze(a,b,d){var c;if(b){b=Ae(a,b);for(var e=0,f=!1,g=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],q=n.length,n=oa(n);if(!n){f=!0;break}n=Be(a,n,null,!1===d);if(void 0===n){f=!0;d=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],p=n.length;k.length&&we[n]<we[k[k.length-1]]&&ye(h,k,1);k.push(n);b=b.substr(q+p)}ye(h,k)&&1==h.length||(f=!0);f?d&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(c=h.pop(),d&&Ce(a,null,
|
||||
c))}return c}function Ae(a,b){for(var d;(d=b.match(/\{(.*?)}/))&&!(0<=d[1].indexOf("{"));){var c=ze(a,d[1]);b=b.replace("{"+d[1]+"}",null!=c?r(c):"undefined")}for(;(d=b.match(/\[(.*?)]/))&&!(0<=d[1].indexOf("["));)b=b.replace("["+d[1]+"]","unimplemented");for(;d=b.match(/\$([a-z]+)/i);){c=null;switch(d[1].toLowerCase()){case "ops":c=a.$-a.Ia}if(null==c)break;b=b.replace(d[0],c.toString())}return b}
|
||||
function Be(a,b,d,c){var e;null!=b?(e=a.ha[b],null==e&&(e=ba(b,a.za)),null!=e||c||a.i("invalid "+(d?d:"value")+": "+b)):c||a.i("missing "+(d||"value"));return e}function Ce(a,b,d){var c,e=!1;if(void 0!==d){e=!0;c=d;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var k=c&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==k||isNaN(k))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(k&1?"1":"0")+n,k>>=1;g=n+g;c>>=8}c=r(d,0,!0)+" "+d+". "+ca(d,0,!0)+" "+("0b"+g)}a.i((null!=b?b+": ":"")+c);return e}
|
||||
function De(a,b){if(b)return Ce(a,b,a.ha[b]);var d=0;for(b in a.ha)Ce(a,b,a.ha[b]),d++;return 0<d}function Y(a,b,d){switch(a.za){case 8:return ca(b,d);case 10:return b.toString();default:return r(b,d)}}
|
||||
|
|
@ -139,69 +140,69 @@ var Je={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output
|
|||
Le={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]}};l=Ee.prototype;
|
||||
l.$a=function(a,b,d,c){this.H=b;this.b=d;this.B=a;(a=Nc(a,"messages"))&&He(this,a);this.Lb=Le;Me(this,function(a){a:{var b=c.H.S,d=a[0],e=a=0,k=b.length;if(d){a=c.L(Ne(c,d));if(-1===a){c.i("invalid address: "+d);break a}e=a>>>c.H.Z;k=1}c.i("blockid physical blockaddr used size type");c.i("-------- --------- ---------- ------ ------ ----");for(var d=-1,m=0;k--;){var n=b[e];n.type==d?m++||c.i("..."):(d=n.type,m=Hb[d],n&&c.i(r(n.id,8)+" %"+r(e<<c.H.Z,8)+" %%"+r(n.w,8)+" "+r(n.Zb,
|
||||
l.$a=function(a,b,d,c){this.H=b;this.b=d;this.w=a;(a=zc(a,"messages"))&&He(this,a);this.Lb=Le;Me(this,function(a){a:{var b=c.H.S,d=a[0],e=a=0,k=b.length;if(d){a=c.L(Ne(c,d));if(-1===a){c.i("invalid address: "+d);break a}e=a>>>c.H.Z;k=1}c.i("blockid physical blockaddr used size type");c.i("-------- --------- ---------- ------ ------ ----");for(var d=-1,m=0;k--;){var n=b[e];n.type==d?m++||c.i("..."):(d=n.type,m=Hb[d],n&&c.i(r(n.id,8)+" %"+r(e<<c.H.Z,8)+" %%"+r(n.A,8)+" "+r(n.Zb,
|
||||
4,!0)+" "+r(n.size,4,!0)+" "+m),d!=lc&&(d=-1),m=0);a+=c.H.Da;e++}}});D(this)};
|
||||
l.xa=function(a,b,d){var c=this;switch(b){case "debugInput":return this.ya=this.P[b]=d,d.onkeydown=function(a){var b;if(13==a.keyCode)b=d.value,d.value="",Ie(c,b,!0);else if(27==a.keyCode)d.value=b="";else if(38==a.keyCode?(b=null,c.G<c.u.length-1&&(b=c.u[++c.G])):40==a.keyCode&&(0<c.G?b=c.u[--c.G]:(b="",c.G=-1)),null!=b){var e=b.length;d.value=b;d.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.P[b]=d,Ea(d,function(){if(c.ya){var a=c.ya.value;
|
||||
c.ya.value="";Ie(c,a,!0);return!0}return!1}),!0;case "step":return this.P[b]=d,Ea(d,function(a){var b=!1;pb(c,!0)||(db(c,!0),b=c.Ab(a?1:0),db(c,!1));return b}),!0}return!1};l.Yb=function(){this.ya&&this.ya.focus()};l.L=function(a){a=a&&a.w;null==a&&(a=-1);return a};l.Nb=function(a,b){var d=255,c=this.L(a,!1,1);-1!==c&&(d=this.H,d=d.S[(c&d.H)>>>d.Z].Tb(c&d.g,c),b&&Oe(a,b));return d};l.La=function(a,b){var d=65535,c=this.L(a,!1,2);-1!==c&&(d=Ib(this.H,c),b&&Oe(a,b));return d};
|
||||
l.fc=function(a,b,d){var c=this.L(a,!0,1);if(-1!==c){var e=this.H;e.S[(c&e.H)>>>e.Z].Cb(c&e.g,b&255,c);d&&Oe(a,d);N(this.b,!0)}};l.oc=function(a,b,d){var c=this.L(a,!0,2);if(-1!==c){var e=this.H,f=c&e.g,g=(c&e.H)>>>e.Z;f!=e.g?e.S[g].qc(f,b&65535,c):(e.S[g++].Cb(f,b&255,c),e.S[g&e.B].Cb(0,b>>8&255,c+1));d&&Oe(a,d);N(this.b,!0)}};function Z(a){return{w:a,Ka:!1}}function Pe(a){return[a.w,a.Ka]}function Qe(a){return{w:a[0],Ka:a[1]}}
|
||||
function Ne(a,b,d){var c;d=(d?a.X:a.Db).w;if(void 0!==b){c=b=Ae(a,b);var e;if(c.match(/^[a-z_][a-z0-9_]*$/i))for(c=c.toUpperCase(),d=0;d<a.O.length;d++){var f=a.O[d].Na[c];if(void 0!==f){c=f.o;void 0!==c&&(e=Z(c));break}}if(c=e)return c;d=ze(a,b,void 0)}null!=d&&(c=Z(d));return c}function Re(a,b,d){d&&(d=d.match(/(['"])(.*?)\1/))&&(b.Jc=xe(a,b.Ec=d[2]))}function Oe(a,b){null!=a.w&&(a.w+=b||1)}
|
||||
l.wa=function(a,b,d){var c=this;switch(b){case "debugInput":return this.ya=this.P[b]=d,d.onkeydown=function(a){var b;if(13==a.keyCode)b=d.value,d.value="",Ie(c,b,!0);else if(27==a.keyCode)d.value=b="";else if(38==a.keyCode?(b=null,c.G<c.u.length-1&&(b=c.u[++c.G])):40==a.keyCode&&(0<c.G?b=c.u[--c.G]:(b="",c.G=-1)),null!=b){var e=b.length;d.value=b;d.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.P[b]=d,Ea(d,function(){if(c.ya){var a=c.ya.value;
|
||||
c.ya.value="";Ie(c,a,!0);return!0}return!1}),!0;case "step":return this.P[b]=d,Ea(d,function(a){var b=!1;pb(c,!0)||(db(c,!0),b=c.Ab(a?1:0),db(c,!1));return b}),!0}return!1};l.Yb=function(){this.ya&&this.ya.focus()};l.L=function(a){a=a&&a.A;null==a&&(a=-1);return a};l.Nb=function(a,b){var d=255,c=this.L(a,!1,1);-1!==c&&(d=this.H,d=d.S[(c&d.H)>>>d.Z].Tb(c&d.g,c),b&&Oe(a,b));return d};l.La=function(a,b){var d=65535,c=this.L(a,!1,2);-1!==c&&(d=Ib(this.H,c),b&&Oe(a,b));return d};
|
||||
l.fc=function(a,b,d){var c=this.L(a,!0,1);if(-1!==c){var e=this.H;e.S[(c&e.H)>>>e.Z].Cb(c&e.g,b&255,c);d&&Oe(a,d);N(this.b,!0)}};l.oc=function(a,b,d){var c=this.L(a,!0,2);if(-1!==c){var e=this.H,f=c&e.g,g=(c&e.H)>>>e.Z;f!=e.g?e.S[g].qc(f,b&65535,c):(e.S[g++].Cb(f,b&255,c),e.S[g&e.w].Cb(0,b>>8&255,c+1));d&&Oe(a,d);N(this.b,!0)}};function Z(a){return{A:a,Ka:!1}}function Pe(a){return[a.A,a.Ka]}function Qe(a){return{A:a[0],Ka:a[1]}}
|
||||
function Ne(a,b,d){var c;d=(d?a.X:a.Db).A;if(void 0!==b){c=b=Ae(a,b);var e;if(c.match(/^[a-z_][a-z0-9_]*$/i))for(c=c.toUpperCase(),d=0;d<a.O.length;d++){var f=a.O[d].Na[c];if(void 0!==f){c=f.o;void 0!==c&&(e=Z(c));break}}if(c=e)return c;d=ze(a,b,void 0)}null!=d&&(c=Z(d));return c}function Re(a,b,d){d&&(d=d.match(/(['"])(.*?)\1/))&&(b.Jc=xe(a,b.Ec=d[2]))}function Oe(a,b){null!=a.A&&(a.A+=b||1)}
|
||||
function He(a,b){a.I=a;a.ja=a.Kc=536870912;a.Ca=null;a.Ha=[];b=xe(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var d in H){var c;a:if(c=void 0,Array.prototype.indexOf)c=b.indexOf(d,c);else{c=c||0;0>c&&(c+=b.length);0>c&&(c=0);for(var e=b.length;c<e;c++)if(c in b&&b[c]===d)break a;c=-1}0<=c&&(a.ja|=H[d],a.i(d+" messages enabled"))}}function Me(a,b){for(var d in H)if(64==H[d]){a.Va[d]=b;break}}
|
||||
l.message=function(a,b){b&&(a+=" at "+Y(this,Z(this.b.f[7]).w));this.ja&1073741824?this.Ha.push(a):this.Ca&&a==this.Ca||(this.Ca=a,this.ja&-2147483648&&(this.pa(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,Wc(a),a.ca=0,N(a)))};l.Ob=function(){this.i("Type ? for help with PDP11 Debugger commands");this.Ba();if(this.pb){var a=this.pb;this.pb=null;Ie(this,a)}};
|
||||
l.message=function(a,b){b&&(a+=" at "+Y(this,Z(this.b.f[7]).A));this.ja&1073741824?this.Ha.push(a):this.Ca&&a==this.Ca||(this.Ca=a,this.ja&-2147483648&&(this.pa(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,Wc(a),a.ca=0,N(a)))};l.Ob=function(){this.i("Type ? for help with PDP11 Debugger commands");this.Ba();if(this.pb){var a=this.pb;this.pb=null;Ie(this,a)}};
|
||||
function Ge(a){var b;if(md(a)){if(!a.W||!a.W.length){a.W=Array(1E3);for(b=0;b<a.W.length;b++)a.W[b]=Z();a.qa=0;a.i("instruction history buffer allocated")}if(!a.ia||!a.ia.length)for(a.ia=Array(256),b=0;b<a.ia.length;b++)a.ia[b]=[b,0]}else a.W&&a.W.length&&a.i("instruction history buffer freed"),a.qa=0,a.W=[],a.ia=[]}l.ob=function(a){if(!Se(this))return!1;this.b.ob(a);return!0};
|
||||
l.Ab=function(a,b,d){if(!Se(this))return!1;this.R=0;a||md(this)&&nd(this,this.b.f[7],0);try{var c=this.b.Ab(a);0<c&&(this.R+=c,Uc(this.b,c,!0),Qc(this.b,c),this.$++)}catch(e){"number"!=typeof e&&(this.R=0,rb(this.b,e.stack||e.message))}!1!==d&&N(this.b);this.Ba(b||!1);return 0<this.R};l.pa=function(a){this.b&&this.b.pa(a)};l.Ba=function(a){void 0===a&&(a=!0);this.X=Z(this.b.f[7]);a&&1!=this.da?Te(this):Ue(this)};
|
||||
function Se(a){var b;if(b=a.b&&qb(a.b))b=a.b,b.j.ga?b=!0:(b.i(b.toString()+" not powered"),b=!1);b&&!pb(a.b)?(a=a.b,a.j.error?(a.i(a.toString()+" error"),a=!0):a=!1,a=!a):a=!1;return a}l.Qa=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};l.Pa=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){Ge(this);this.$=this.Ia=0;this.Ca=null;this.R=0;this.X=Z(this.b.f[7]);this.j.la=!1;Ve(this);a||this.Ba()};
|
||||
l.save=function(){var a=new O(this);a.set(0,Pe(this.X));a.set(1,Pe(this.ba));a.set(2,[this.u,this.ca,this.ja]);a.set(3,this.O);return a.data()};l.restore=function(a){var b=0;void 0!==a[2]&&(this.X=Qe(a[b++]),this.ba=Qe(a[b++]),this.u=a[b][0],"string"==typeof this.u&&(this.u=[this.u]),this.ca=a[b][1],this.ja|=a[b][2]);a[3]&&(this.O=a[3]);return!0};l.start=function(a,b){this.da||this.i("running");this.j.la=!0;this.kc=a;this.Oc=b};
|
||||
l.stop=function(a,b){if(this.j.la){this.j.la=!1;this.R=b-this.Oc;if(!this.da){b="stopped";if(this.R){a-=this.kc;var d=0<a?Math.round(1E3*this.R/a):0;b+=" (";md(this)&&(b+=this.$+" opcodes, ",this.Ia-=this.$,this.$=0);b+=this.R+" cycles, "+a+" ms, "+d+" hz)"}else cb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}this.Ba(!0);this.Yb();Ve(this,this.b.f[7])}};function md(a){return 1<a.g.length||!!a.Aa}
|
||||
function nd(a,b,d){var c=a.b;if(0<d&&(a.Aa&&!--a.Aa||uc(a,b,1,a.g)))return!0;0<=d&&a.ia.length&&(a.$++,null!=Ib(a.H,b)&&(b=a.W[a.qa],b.w=c.f[7],b.Ka=!1,++a.qa==a.W.length&&(a.qa=0)));return!1}function Fe(a){var b,d;a.g=["bp"];if(a.Y)for(b=1;b<a.Y.length;b++){d=a.Y[b];var c=a.H;d=a.L(d);vc(c.S[d>>>c.Z],!1)}a.Y=["br"];if(a.J)for(b=1;b<a.J.length;b++)d=a.J[b],c=a.H,d=a.L(d),vc(c.S[d>>>c.Z],!0);a.J=["bw"];a.Ib=0}
|
||||
l.hb=function(a,b,d){var c=!0;d||We(this,a,b,!1,!0);if(a!=this.g){var e=this.L(b);if(-1===e)this.i("invalid address: "+Y(this,b.w)),c=!1;else{var f=this.H;f.S[e>>>f.Z].hb(e&f.g,a==this.J)}}c&&(a.push(b),d?b.Ka=!0:(Xe(this,a,a.length-1,"set"),Ge(this)));return c};function We(a,b,d,c,e){var f=!1;d=a.L(d);for(var g=1;g<b.length;g++){var h=b[g];if(d==a.L(h)&&(!c||h.Ka)){f=!0;h.Ka||e||Xe(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(c=a.H,vc(c.S[d>>>c.Z],b==a.J));h.Ka||Ge(a);break}}return f}
|
||||
function Ye(a,b){for(var d=1;d<b.length;d++)Xe(a,b,d);return b.length-1}function Xe(a,b,d,c){d=b[d];a.i(b[0]+" "+Y(a,d.w)+(c?" "+c:d.Ec?' "'+d.Ec+'"':""))}function Ve(a,b){if(void 0!==b)uc(a,b,1,a.g,!0),a.da=0;else for(b=1;b<a.g.length;b++){var d=a.g[b];if(d.Ka){if(!We(a,a.g,d,!0))break;b=0}}}
|
||||
function nd(a,b,d){var c=a.b;if(0<d&&(a.Aa&&!--a.Aa||uc(a,b,1,a.g)))return!0;0<=d&&a.ia.length&&(a.$++,null!=Ib(a.H,b)&&(b=a.W[a.qa],b.A=c.f[7],b.Ka=!1,++a.qa==a.W.length&&(a.qa=0)));return!1}function Fe(a){var b,d;a.g=["bp"];if(a.Y)for(b=1;b<a.Y.length;b++){d=a.Y[b];var c=a.H;d=a.L(d);vc(c.S[d>>>c.Z],!1)}a.Y=["br"];if(a.J)for(b=1;b<a.J.length;b++)d=a.J[b],c=a.H,d=a.L(d),vc(c.S[d>>>c.Z],!0);a.J=["bw"];a.Ib=0}
|
||||
l.hb=function(a,b,d){var c=!0;d||We(this,a,b,!1,!0);if(a!=this.g){var e=this.L(b);if(-1===e)this.i("invalid address: "+Y(this,b.A)),c=!1;else{var f=this.H;f.S[e>>>f.Z].hb(e&f.g,a==this.J)}}c&&(a.push(b),d?b.Ka=!0:(Xe(this,a,a.length-1,"set"),Ge(this)));return c};function We(a,b,d,c,e){var f=!1;d=a.L(d);for(var g=1;g<b.length;g++){var h=b[g];if(d==a.L(h)&&(!c||h.Ka)){f=!0;h.Ka||e||Xe(a,b,g,"cleared");b.splice(g,1);b!=a.g&&(c=a.H,vc(c.S[d>>>c.Z],b==a.J));h.Ka||Ge(a);break}}return f}
|
||||
function Ye(a,b){for(var d=1;d<b.length;d++)Xe(a,b,d);return b.length-1}function Xe(a,b,d,c){d=b[d];a.i(b[0]+" "+Y(a,d.A)+(c?" "+c:d.Ec?' "'+d.Ec+'"':""))}function Ve(a,b){if(void 0!==b)uc(a,b,1,a.g,!0),a.da=0;else for(b=1;b<a.g.length;b++){var d=a.g[b];if(d.Ka){if(!We(a,a.g,d,!0))break;b=0}}}
|
||||
function uc(a,b,d,c,e){var f=!1;if(!a.Ib++)for(var g=1;!f&&g<c.length;g++){var h=c[g];if(!e||h.Ka)for(var k=a.L(h),m=0;m<d;m++)if(b+m==k){var n,f=!0;h.Ka&&(We(a,c,h,!0),e=!0);if(n=h.Jc){for(var f=!1,q=0;q<n.length;q++)if(!Ze(a,n[q],!0)){if(n[q].indexOf("if")){f=!0;break}for(var p=q+1;p<n.length&&n[p].indexOf("else");p++)q++;if(p==n.length){f=!0;break}}a.b.j.la||(f=!0)}if(f){e||Xe(a,c,g,"hit");break}}}a.Ib--;return f}
|
||||
function $e(a,b,d,c){var e=Z(b.w),f=a.La(b,2),g,h;for(h in a.Lb)if(g=a.Lb[h][f&h])break;g||(g=[0]);h="";for(var k=Ke[g[0]],m=g.length-1,n=1;n<=m;n++){var q=g[n];if(void 0!==q){var p;p=a;var z=q,q=b,x="",A=z&61440;if(4096==A)q=q.w+((f&255)<<24>>23)&65535,x=Y(p,q);else if(8192==A)q=q.w-((f&63)<<1)&65535,x=Y(p,q);else if(12288==A)x=Y(p,f&7,2);else if(24576==A)x=Y(p,f&63);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:x=af(z);break;case 8:x="@"+af(z);break;case 16:7>z?x="("+af(z)+
|
||||
")+":(A=p.La(q,2),x="#"+Y(p,A));break;case 24:7>z?x="@("+af(z)+")+":(A=p.La(q,2),x="@#"+Y(p,A));break;case 32:x="-("+af(z)+")";break;case 40:x="@-("+af(z)+")";break;case 48:A=p.La(q,2);x=Y(p,A)+"("+af(z)+")";7==z&&(x=[x,Y(p,A+q.w&65535)]);break;case 56:A=p.La(q,2),x="@"+Y(p,A)+"("+af(z)+")",7==z&&(x=[x,Y(p,A+q.w&65535)])}p=x;if(!p||!p.length){h="INVALID";break}"string"!=typeof p&&(d||(d=p[1]),p=p[0]);0<h.length&&(h+=",");h+=p||"???"}}f="";g=Y(a,e.w)+":";if(-1!==e.w&&-1!==b.w){do if(f+=" "+Y(a,a.La(e,
|
||||
2)),null==e.w)break;while(e.w!=b.w)}g+=na(f,24);g+=na(k,5);h&&(g+=" "+h);d&&(g=na(g,60)+";"+d,g=a.b.j.rb?g+("cycles="+Rc(a.b).toString()+" cs="+r(a.b.Qb)):g+(null!=c?"="+c.toString():""));return g}function bf(a,b){switch(b){case "N":a=a.b.A&32768?8:0;break;case "Z":a=a.b.F&65535?0:4;break;case "V":a=a.b.C&32768?2:0;break;case "C":a=a.b.D&65536?1:0;break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}function af(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
function cf(a,b){var d="",c=a.b;8>b?(d=af(b),d+="="+Y(a,c.f[b])):13>b?d="A"+(b-8)+"="+Y(a,c.bb[b-8]):16<=b&&20>b?d="S"+(b-16)+"="+Y(a,c.va[b-16]):20==b&&(d="PS="+Y(a,Yb(c)));d&&(d+=" ");return d}function df(a){var b,d="";for(b=0;6>b;b++)d+=cf(a,b);d=d+"\n"+(cf(a,6)+cf(a,7)+cf(a,20));return d+=bf(a,"T")+bf(a,"N")+bf(a,"Z")+bf(a,"V")+bf(a,"C")}l.vc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function ef(a,b,d){var c=[],e=a.L(b)>>>0;for(b=0;b<a.O.length;b++){var f=a.O[b],g=f.w>>>0,h=f.Uc;if(e>=g&&e<g+h){e=qa(f.sc,[e-g],a.vc);0<=e?ff(a,b,e,c):d&&(e=~e,ff(a,b,e-1,c),ff(a,b,e,c));break}}return c}function ff(a,b,d,c){var e={},f=a.O[b].sc,g=0,h=null;0<=d&&d<f.length&&(g=f[d][0],h=f[d][1]);h&&(e=a.O[b].Na[h],h="."==h.charAt(0)?null:e.l||h);c.push(h);c.push(g);c.push(e.a);c.push(e.c)}
|
||||
function $e(a,b,d,c){var e=Z(b.A),f=a.La(b,2),g,h;for(h in a.Lb)if(g=a.Lb[h][f&h])break;g||(g=[0]);h="";for(var k=Ke[g[0]],m=g.length-1,n=1;n<=m;n++){var q=g[n];if(void 0!==q){var p;p=a;var z=q,q=b,x="",A=z&61440;if(4096==A)q=q.A+((f&255)<<24>>23)&65535,x=Y(p,q);else if(8192==A)q=q.A-((f&63)<<1)&65535,x=Y(p,q);else if(12288==A)x=Y(p,f&7,2);else if(24576==A)x=Y(p,f&63);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:x=af(z);break;case 8:x="@"+af(z);break;case 16:7>z?x="("+af(z)+
|
||||
")+":(A=p.La(q,2),x="#"+Y(p,A));break;case 24:7>z?x="@("+af(z)+")+":(A=p.La(q,2),x="@#"+Y(p,A));break;case 32:x="-("+af(z)+")";break;case 40:x="@-("+af(z)+")";break;case 48:A=p.La(q,2);x=Y(p,A)+"("+af(z)+")";7==z&&(x=[x,Y(p,A+q.A&65535)]);break;case 56:A=p.La(q,2),x="@"+Y(p,A)+"("+af(z)+")",7==z&&(x=[x,Y(p,A+q.A&65535)])}p=x;if(!p||!p.length){h="INVALID";break}"string"!=typeof p&&(d||(d=p[1]),p=p[0]);0<h.length&&(h+=",");h+=p||"???"}}f="";g=Y(a,e.A)+":";if(-1!==e.A&&-1!==b.A){do if(f+=" "+Y(a,a.La(e,
|
||||
2)),null==e.A)break;while(e.A!=b.A)}g+=na(f,24);g+=na(k,5);h&&(g+=" "+h);d&&(g=na(g,60)+";"+d,g=a.b.j.rb?g+("cycles="+Rc(a.b).toString()+" cs="+r(a.b.Qb)):g+(null!=c?"="+c.toString():""));return g}function bf(a,b){switch(b){case "N":a=a.b.B&32768?8:0;break;case "Z":a=a.b.F&65535?0:4;break;case "V":a=a.b.C&32768?2:0;break;case "C":a=a.b.D&65536?1:0;break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}function af(a){return 6>a?"R"+a:6==a?"SP":"PC"}
|
||||
function cf(a,b){var d="",c=a.b;8>b?(d=af(b),d+="="+Y(a,c.f[b])):13>b?d="A"+(b-8)+"="+Y(a,c.bb[b-8]):16<=b&&20>b?d="S"+(b-16)+"="+Y(a,c.ua[b-16]):20==b&&(d="PS="+Y(a,Yb(c)));d&&(d+=" ");return d}function df(a){var b,d="";for(b=0;6>b;b++)d+=cf(a,b);d=d+"\n"+(cf(a,6)+cf(a,7)+cf(a,20));return d+=bf(a,"T")+bf(a,"N")+bf(a,"Z")+bf(a,"V")+bf(a,"C")}l.vc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function ef(a,b,d){var c=[],e=a.L(b)>>>0;for(b=0;b<a.O.length;b++){var f=a.O[b],g=f.A>>>0,h=f.Uc;if(e>=g&&e<g+h){e=qa(f.sc,[e-g],a.vc);0<=e?ff(a,b,e,c):d&&(e=~e,ff(a,b,e-1,c),ff(a,b,e,c));break}}return c}function ff(a,b,d,c){var e={},f=a.O[b].sc,g=0,h=null;0<=d&&d<f.length&&(g=f[d][0],h=f[d][1]);h&&(e=a.O[b].Na[h],h="."==h.charAt(0)?null:e.l||h);c.push(h);c.push(g);c.push(e.a);c.push(e.c)}
|
||||
function gf(a,b){var d=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(d){if(!d[1])return De(a)||a.i("no variables"),!0;if(!d[2])return De(a,d[1]);if(!d[3])return delete a.ha[d[1]],!0;b=ze(a,d[3]);return void 0!==b?(a.ha[d[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||
function hf(a,b,d){var c=null;if(b=Ne(a,b,!0)){a.L(b);var e=ef(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.w-e[1])&&(g=" + "+r(f,4,!0)),f=e[0]+" ("+Y(a,e[1])+")"+g,d&&a.i(f),c=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.w)&&(g=" - "+r(f,4,!0)),f=e[4]+" ("+Y(a,e[5])+")"+g,d&&a.i(f),c||(c=f))}else d&&a.i("no symbols")}return c}
|
||||
function Te(a,b){var d;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var c=a.b;null==d&&(d=!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.i("missing value for "+b[1]);return}var f=!1,g=ze(a,b);if(void 0!==g)switch(f=!0,e.toUpperCase()){case "PC":c.f[7]=g;a.X=Z(c.f[7]);break;case "NF":c.A=g?32768:0;break;case "ZF":c.F=g?0:1;break;case "VF":c.C=g?32768:
|
||||
0;break;case "CF":c.D=g?65536:0;break;default:a.i("unknown register: "+e);return}if(!f){a.i("invalid value: "+b);return}N(c);a.i("updated registers:")}a.i(df(a));d&&(a.X=Z(c.f[7]),Ue(a,Y(a,a.X.w)))}}function jf(a,b){b=pa(b);var d=b.match(/^(['"])(.*?)\1$/);d?a.i(d[2]):ze(a,b,!0)}function kf(a,b,d){var c="t"!=b;d=Be(a,d,null,!0)||1;var e=1==d?0:1;"tc"==b&&(e=d,d=1);Da(d,function(){return db(a,!0)&&a.Ab(e,c,!1)},function(){N(a.b);db(a,!1)})}
|
||||
function Ue(a,b,d,c){if(b=Ne(a,b,!0)){void 0===c&&(c=1);var e=256;if(void 0!==d){c=Ne(a,d,!0);if(!c||c.w<b.w)return;e=c.w-b.w;if(256<e){a.i("range too large");return}c=-1}d=0;for(var f;0<e&&c--;){f=pb(a,!1)||a.da?a.R:null;var g=null!=f?"cycles":null,h=ef(a,b),k=b.w;if(h[0]&&c&&(!d&&c||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=$e(a,b,g,f);a.i(f);a.X=b;e-=b.w-k;d++}}}
|
||||
function Ze(a,b,d){var c=!0;try{b.length&&"end"!=b?d||a.i(">> "+b):(a.ca&&(a.i("ended assemble at "+Y(a,a.ba.w)),a.X=a.ba,a.ca=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Ca=null;if(qb(a)&&0<b.length){a.ca&&(b="a "+Y(a,a.ba.w)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var g=f[0],h=g.charAt(0),k=1;k<g.length;k++){var m=g.charAt(k);if("?"==h||"r"==h||"a">m||"z"<m){f[0]=g.substr(k);f.unshift(g.substr(0,k));break}}switch(f[0].charAt(0)){case "a":var n=Ne(a,f[1],!0);
|
||||
if(n)if(a.ba=n,void 0===f[2])a.i("begin assemble at "+Y(a,n.w)),a.ca=!0,N(a.b);else{var q;a.i("not supported yet");q=[];if(q.length){for(var p=0;p<q.length;p++)a.fc(n,q[p],1);a.i($e(a,a.ba))}}break;case "b":a:{var z=f[0],x=f[1],A=b;if("?"==x)a.i("breakpoint commands:"),a.i("\tbp [a]\tset exec breakpoint at addr [a]"),a.i("\tbr [a]\tset read breakpoint at addr [a]"),a.i("\tbw [a]\tset write breakpoint at addr [a]"),a.i("\tbc [a]\tclear breakpoint at addr [a]"),a.i("\tbl\tlist all breakpoints"),a.i("\tbn [n]\tbreak after [n] instruction(s)");
|
||||
else{var sa=z.charAt(1);if("l"==sa){var zc;zc=0+Ye(a,a.g);zc+=Ye(a,a.Y);(zc+=Ye(a,a.J))||a.i("no breakpoints")}else if("n"==sa)a.Aa=Be(a,x),a.i("break after "+a.Aa+" instruction(s)");else if(void 0===x)a.i("missing breakpoint address");else{var R=Z();if("*"!=x&&(R=Ne(a,x,!0),!R))break a;"c"==sa?null==R.w?(Fe(a),a.i("all breakpoints cleared")):We(a,a.g,R)||We(a,a.Y,R)||We(a,a.J,R)||a.i("breakpoint missing: "+Y(a,R.w)):null!=R.w&&(Re(a,R,A),"p"==sa?a.hb(a.g,R):"r"==sa?a.hb(a.Y,R):"w"==sa?a.hb(a.J,R):
|
||||
a.i("unknown breakpoint command: "+sa))}}}break;case "c":a.ib&&(a.ib.value="");break;case "d":a:{var Fa,Ga=f[0],ea=f[1],ta=f[2],Df=f[3];if("?"==ea){var Ha="";for(Fa in H)a.Va[Fa]&&(Ha&&(Ha+=","),Ha+=Fa);Ha+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");Ha.length&&a.i("dump extension commands:\n\t"+
|
||||
Ha)}else if("state"==ea){var Td=lf(a.B,!0);"console"==ta?console.log(Td):(a.ib&&(a.ib.value=""),a.i(Td))}else if("symbols"==ea)for(var Ac=0;Ac<a.O.length;Ac++){var Bc=a.O[Ac],Ia;for(Ia in Bc.Na)if("."!=Ia.charAt(0)){var Ud=Bc.Na[Ia].o;if(void 0!==Ud){var Vd=Bc.Na[Ia].l;Vd&&(Ia=Vd);a.i(Y(a,Ud)+" "+Ia)}}}else{if("d"==Ga){for(Fa in H)if(f[1]==Fa){var Wd=a.Va[Fa];Wd?(f.shift(),f.shift(),Wd(f)):a.i("no dump registered for "+ea);break a}ea||(Ga=a.Sc||"db")}else a.Sc=Ga;if("dh"==Ga){var Xd=ea,Yd=ta,Zd="",
|
||||
$d=0,aa=a.qa,fa=a.W;if(fa.length){var W=+Xd||a.Kb,eb=+Yd||10;isNaN(W)?W=eb:Zd="more ";W>fa.length&&(a.i("note: only "+fa.length+" available"),W=fa.length);aa-=W;0>aa&&(null==fa[fa.length-1].w?(W=aa+W,aa=0):aa+=fa.length);var Cc=[];"call"==Yd&&(eb=1E5,Cc=["CALL"]);for(void 0!==Xd&&a.i(W+" instructions earlier:");0<eb&&aa!=a.qa;){var ae=fa[aa++];if(null==ae.w)break;var fb=Z(ae.w),Ef=W--,be=$e(a,fb,"history",Ef);(!Cc.length||0<=be.indexOf(Cc[0]))&&a.i(be);fb.ic&&(aa+=fb.ic,eb-=fb.ic,W-=fb.ic);aa>=fa.length&&
|
||||
(aa=0);a.Kb=W;$d++;eb--}}$d||(a.i("no "+Zd+"history available"),a.Kb=void 0)}else{var Kb=Ne(a,ea);if(Kb){var Lb=0;ta&&("l"==ta.charAt(0)&&(ta=ta.substr(1)||Df),Lb=Be(a,ta)>>>0,65536<Lb&&(Lb=65536));for(var gb="",Mb="dd"==Ga?4:"dw"==Ga?2:1,Nb=Mb*Lb||128,Ff=Nb+15>>4||1;Ff--&&0<Nb;){var Ob=0,Dc=0,hb,Ec="",ce="",ea=Y(a,Kb.w);for(hb=16;0<hb&&0<Nb;hb--){var Pb=a.Nb(Kb,1),Ob=Ob|Pb<<(Dc++<<3);Dc==Mb&&(Ec+=r(Ob,2*Mb),Ec+=1==Mb?9==hb?"-":" ":" ",Ob=Dc=0);ce+=32<=Pb&&128>Pb?String.fromCharCode(Pb):".";Nb--}gb&&
|
||||
(gb+="\n");gb+=ea+" "+Ec+(hb?"":" "+ce)}gb&&a.i(gb);a.Db=Kb}}}}break;case "e":if("else"==f[0])break;var Qb=1,de=255,ee=a.Nb,fe=a.fc;"ew"==f[0]&&(Qb=2,de=65535,ee=a.La,fe=a.oc);var ge=Qb<<1,he=f[1];if(null==he)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Rb=Ne(a,he);if(Rb)for(var Sb=2;Sb<f.length;Sb++){var ib=ze(a,f[Sb]);if(void 0===ib){a.i("unrecognized value: "+f[Sb]);break}ib&~de&&a.i("warning: "+r(ib)+" exceeds "+
|
||||
Qb+"-byte value");var Gf=ee.call(a,Rb);a.i("changing "+Y(a,Rb.w)+" from "+r(Gf,ge,!0)+" to "+r(ib,ge,!0));fe.call(a,Rb,ib,Qb)}}break;case "g":a:{var ie=f[1],Hf=b;if(void 0!==ie){var Fc=Ne(a,ie,!0);if(!Fc)break a;Re(a,Fc,Hf);a.hb(a.g,Fc,!0)}a.ob(!0)||d||a.i("cpu busy or unavailable, run command ignored")}break;case "h":a:{var Gc;if(a.j.la)Gc="halting",a.pa();else{if(pb(a,!0))break a;Gc="already halted"}d||a.i(Gc)}break;case "i":if("if"==f[0]){var Hc;var jb=b.substr(2),jb=pa(jb);ze(a,jb)?(d||a.i("true: "+
|
||||
jb),Hc=!0):(d||a.i("false: "+jb),Hc=!1);Hc||(c=!1)}break;case "k":var If=f[0];if("?"==f[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var Ic=0,je=Z(),kb=Z(a.b.f[6]);for(a.i("stack trace for "+Y(a,kb.w));10>Ic;){for(var ua=null,Jf=256;65536>kb.w>>>0;){je.w=a.La(kb,2);if(null==kb.w||!Jf--)break;for(var Kf=a,Tb=je,ke=null,lb=Tb.w,le=lb,Jc=1;6>=Jc&&lb;Jc++){if(2<Jc){Tb.w=lb;var Ub=$e(Kf,Tb);if(0<=Ub.indexOf("JSR")){var me=Ub.indexOf(" ");if(lb+
|
||||
(Ub.indexOf(" ",me+1)-me-1)/2==le){ke=Ub;break}}}lb--}Tb.w=le;if(ua=ke)break}if(!ua||null==ua)break;var ne=null;if("ks"==If){var oe=ua.match(/[0-9A-F]+$/);oe&&(ne=hf(a,oe[0]))}ua=na(ua,50)+" ;"+(ne||"stack="+Y(a,kb.w));a.i(ua);Ic++}Ic||a.i("no return addresses found")}break;case "l":"ln"==f[0]&&hf(a,f[1],!0);break;case "m":a:{var ga,ha=null,C=f[1];"?"==C&&(C=void 0);if(void 0!==C){var oa=0;if("all"==C)oa=1878917119,C=null;else if("on"==C)ha=!0,C=null;else if("off"==C)ha=!1,C=null;else{"keys"==C&&
|
||||
(C="key");"kbd"==C&&(C="keyboard");for(ga in H)if(C==ga){oa=H[ga];ha=!!(a.ja&oa);break}if(!oa){a.i("unknown message category: "+C);break a}}if(oa)if("on"==f[2])a.ja|=oa,ha=!0;else if("off"==f[2]&&(a.ja&=~oa,ha=!1,1073741824==oa)){for(var Kc=0;Kc<a.Ha.length;Kc++)a.i(a.Ha[Kc]);a.Ha=[]}}var Lf=0,mb="";for(ga in H)if(!C||C==ga){var Mf=!!(a.ja&H[ga]);if(null===ha||ha==Mf)mb&&(mb+=","),++Lf%10||(mb+="\n\t"),"key"==ga&&(ga="keys"),mb+=ga}void 0===C&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.i((null!==ha?ha?"messages on: ":"messages off: ":"message categories:\n\t")+(mb||"none"));Ge(a)}break;case "p":if("print"==f[0]){jf(a,b.substr(5));break}var Nf="pr"==f[0]?1:0;if(a.da)a.i("step in progress");else{var pe=Z(a.b.f[7]);a.Nb(pe);a.da?(a.hb(a.g,pe,!0),a.ob()||(a.B&&a.B.Yb(),a.da=0)):kf(a,Nf?"tr":"t")}break;case "r":if("reset"==b){a.B&&a.B.reset();break}Te(a,f);break;case "s":a:switch(f[1]){case "base":if(f[2]){var nb=+f[2];if(8==nb||10==nb||16==nb)a.za=nb;else{a.i("invalid base: "+nb);
|
||||
function hf(a,b,d){var c=null;if(b=Ne(a,b,!0)){a.L(b);var e=ef(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.A-e[1])&&(g=" + "+r(f,4,!0)),f=e[0]+" ("+Y(a,e[1])+")"+g,d&&a.i(f),c=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.A)&&(g=" - "+r(f,4,!0)),f=e[4]+" ("+Y(a,e[5])+")"+g,d&&a.i(f),c||(c=f))}else d&&a.i("no symbols")}return c}
|
||||
function Te(a,b){var d;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var c=a.b;null==d&&(d=!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.i("missing value for "+b[1]);return}var f=!1,g=ze(a,b);if(void 0!==g)switch(f=!0,e.toUpperCase()){case "PC":c.f[7]=g;a.X=Z(c.f[7]);break;case "NF":c.B=g?32768:0;break;case "ZF":c.F=g?0:1;break;case "VF":c.C=g?32768:
|
||||
0;break;case "CF":c.D=g?65536:0;break;default:a.i("unknown register: "+e);return}if(!f){a.i("invalid value: "+b);return}N(c);a.i("updated registers:")}a.i(df(a));d&&(a.X=Z(c.f[7]),Ue(a,Y(a,a.X.A)))}}function jf(a,b){b=oa(b);var d=b.match(/^(['"])(.*?)\1$/);d?a.i(d[2]):ze(a,b,!0)}function kf(a,b,d){var c="t"!=b;d=Be(a,d,null,!0)||1;var e=1==d?0:1;"tc"==b&&(e=d,d=1);Da(d,function(){return db(a,!0)&&a.Ab(e,c,!1)},function(){N(a.b);db(a,!1)})}
|
||||
function Ue(a,b,d,c){if(b=Ne(a,b,!0)){void 0===c&&(c=1);var e=256;if(void 0!==d){c=Ne(a,d,!0);if(!c||c.A<b.A)return;e=c.A-b.A;if(256<e){a.i("range too large");return}c=-1}d=0;for(var f;0<e&&c--;){f=pb(a,!1)||a.da?a.R:null;var g=null!=f?"cycles":null,h=ef(a,b),k=b.A;if(h[0]&&c&&(!d&&c||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=$e(a,b,g,f);a.i(f);a.X=b;e-=b.A-k;d++}}}
|
||||
function Ze(a,b,d){var c=!0;try{b.length&&"end"!=b?d||a.i(">> "+b):(a.ca&&(a.i("ended assemble at "+Y(a,a.ba.A)),a.X=a.ba,a.ca=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.Ca=null;if(qb(a)&&0<b.length){a.ca&&(b="a "+Y(a,a.ba.A)+" "+b);var f=b.replace(/ +/g," ").split(" ");if(f&&f.length)for(var g=f[0],h=g.charAt(0),k=1;k<g.length;k++){var m=g.charAt(k);if("?"==h||"r"==h||"a">m||"z"<m){f[0]=g.substr(k);f.unshift(g.substr(0,k));break}}switch(f[0].charAt(0)){case "a":var n=Ne(a,f[1],!0);
|
||||
if(n)if(a.ba=n,void 0===f[2])a.i("begin assemble at "+Y(a,n.A)),a.ca=!0,N(a.b);else{var q;a.i("not supported yet");q=[];if(q.length){for(var p=0;p<q.length;p++)a.fc(n,q[p],1);a.i($e(a,a.ba))}}break;case "b":a:{var z=f[0],x=f[1],A=b;if("?"==x)a.i("breakpoint commands:"),a.i("\tbp [a]\tset exec breakpoint at addr [a]"),a.i("\tbr [a]\tset read breakpoint at addr [a]"),a.i("\tbw [a]\tset write breakpoint at addr [a]"),a.i("\tbc [a]\tclear breakpoint at addr [a]"),a.i("\tbl\tlist all breakpoints"),a.i("\tbn [n]\tbreak after [n] instruction(s)");
|
||||
else{var ta=z.charAt(1);if("l"==ta){var Ac;Ac=0+Ye(a,a.g);Ac+=Ye(a,a.Y);(Ac+=Ye(a,a.J))||a.i("no breakpoints")}else if("n"==ta)a.Aa=Be(a,x),a.i("break after "+a.Aa+" instruction(s)");else if(void 0===x)a.i("missing breakpoint address");else{var R=Z();if("*"!=x&&(R=Ne(a,x,!0),!R))break a;"c"==ta?null==R.A?(Fe(a),a.i("all breakpoints cleared")):We(a,a.g,R)||We(a,a.Y,R)||We(a,a.J,R)||a.i("breakpoint missing: "+Y(a,R.A)):null!=R.A&&(Re(a,R,A),"p"==ta?a.hb(a.g,R):"r"==ta?a.hb(a.Y,R):"w"==ta?a.hb(a.J,R):
|
||||
a.i("unknown breakpoint command: "+ta))}}}break;case "c":a.ib&&(a.ib.value="");break;case "d":a:{var Fa,Ga=f[0],ea=f[1],ua=f[2],Df=f[3];if("?"==ea){var Ha="";for(Fa in H)a.Va[Fa]&&(Ha&&(Ha+=","),Ha+=Fa);Ha+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");Ha.length&&a.i("dump extension commands:\n\t"+
|
||||
Ha)}else if("state"==ea){var Td=lf(a.w,!0);"console"==ua?console.log(Td):(a.ib&&(a.ib.value=""),a.i(Td))}else if("symbols"==ea)for(var Bc=0;Bc<a.O.length;Bc++){var Cc=a.O[Bc],Ia;for(Ia in Cc.Na)if("."!=Ia.charAt(0)){var Ud=Cc.Na[Ia].o;if(void 0!==Ud){var Vd=Cc.Na[Ia].l;Vd&&(Ia=Vd);a.i(Y(a,Ud)+" "+Ia)}}}else{if("d"==Ga){for(Fa in H)if(f[1]==Fa){var Wd=a.Va[Fa];Wd?(f.shift(),f.shift(),Wd(f)):a.i("no dump registered for "+ea);break a}ea||(Ga=a.Sc||"db")}else a.Sc=Ga;if("dh"==Ga){var Xd=ea,Yd=ua,Zd="",
|
||||
$d=0,aa=a.qa,fa=a.W;if(fa.length){var W=+Xd||a.Kb,eb=+Yd||10;isNaN(W)?W=eb:Zd="more ";W>fa.length&&(a.i("note: only "+fa.length+" available"),W=fa.length);aa-=W;0>aa&&(null==fa[fa.length-1].A?(W=aa+W,aa=0):aa+=fa.length);var Dc=[];"call"==Yd&&(eb=1E5,Dc=["CALL"]);for(void 0!==Xd&&a.i(W+" instructions earlier:");0<eb&&aa!=a.qa;){var ae=fa[aa++];if(null==ae.A)break;var fb=Z(ae.A),Ef=W--,be=$e(a,fb,"history",Ef);(!Dc.length||0<=be.indexOf(Dc[0]))&&a.i(be);fb.ic&&(aa+=fb.ic,eb-=fb.ic,W-=fb.ic);aa>=fa.length&&
|
||||
(aa=0);a.Kb=W;$d++;eb--}}$d||(a.i("no "+Zd+"history available"),a.Kb=void 0)}else{var Kb=Ne(a,ea);if(Kb){var Lb=0;ua&&("l"==ua.charAt(0)&&(ua=ua.substr(1)||Df),Lb=Be(a,ua)>>>0,65536<Lb&&(Lb=65536));for(var gb="",Mb="dd"==Ga?4:"dw"==Ga?2:1,Nb=Mb*Lb||128,Ff=Nb+15>>4||1;Ff--&&0<Nb;){var Ob=0,Ec=0,hb,Fc="",ce="",ea=Y(a,Kb.A);for(hb=16;0<hb&&0<Nb;hb--){var Pb=a.Nb(Kb,1),Ob=Ob|Pb<<(Ec++<<3);Ec==Mb&&(Fc+=r(Ob,2*Mb),Fc+=1==Mb?9==hb?"-":" ":" ",Ob=Ec=0);ce+=32<=Pb&&128>Pb?String.fromCharCode(Pb):".";Nb--}gb&&
|
||||
(gb+="\n");gb+=ea+" "+Fc+(hb?"":" "+ce)}gb&&a.i(gb);a.Db=Kb}}}}break;case "e":if("else"==f[0])break;var Qb=1,de=255,ee=a.Nb,fe=a.fc;"ew"==f[0]&&(Qb=2,de=65535,ee=a.La,fe=a.oc);var ge=Qb<<1,he=f[1];if(null==he)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Rb=Ne(a,he);if(Rb)for(var Sb=2;Sb<f.length;Sb++){var ib=ze(a,f[Sb]);if(void 0===ib){a.i("unrecognized value: "+f[Sb]);break}ib&~de&&a.i("warning: "+r(ib)+" exceeds "+
|
||||
Qb+"-byte value");var Gf=ee.call(a,Rb);a.i("changing "+Y(a,Rb.A)+" from "+r(Gf,ge,!0)+" to "+r(ib,ge,!0));fe.call(a,Rb,ib,Qb)}}break;case "g":a:{var ie=f[1],Hf=b;if(void 0!==ie){var Gc=Ne(a,ie,!0);if(!Gc)break a;Re(a,Gc,Hf);a.hb(a.g,Gc,!0)}a.ob(!0)||d||a.i("cpu busy or unavailable, run command ignored")}break;case "h":a:{var Hc;if(a.j.la)Hc="halting",a.pa();else{if(pb(a,!0))break a;Hc="already halted"}d||a.i(Hc)}break;case "i":if("if"==f[0]){var Ic;var jb=b.substr(2),jb=oa(jb);ze(a,jb)?(d||a.i("true: "+
|
||||
jb),Ic=!0):(d||a.i("false: "+jb),Ic=!1);Ic||(c=!1)}break;case "k":var If=f[0];if("?"==f[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var Jc=0,je=Z(),kb=Z(a.b.f[6]);for(a.i("stack trace for "+Y(a,kb.A));10>Jc;){for(var va=null,Jf=256;65536>kb.A>>>0;){je.A=a.La(kb,2);if(null==kb.A||!Jf--)break;for(var Kf=a,Tb=je,ke=null,lb=Tb.A,le=lb,Kc=1;6>=Kc&&lb;Kc++){if(2<Kc){Tb.A=lb;var Ub=$e(Kf,Tb);if(0<=Ub.indexOf("JSR")){var me=Ub.indexOf(" ");if(lb+
|
||||
(Ub.indexOf(" ",me+1)-me-1)/2==le){ke=Ub;break}}}lb--}Tb.A=le;if(va=ke)break}if(!va||null==va)break;var ne=null;if("ks"==If){var oe=va.match(/[0-9A-F]+$/);oe&&(ne=hf(a,oe[0]))}va=na(va,50)+" ;"+(ne||"stack="+Y(a,kb.A));a.i(va);Jc++}Jc||a.i("no return addresses found")}break;case "l":"ln"==f[0]&&hf(a,f[1],!0);break;case "m":a:{var ga,ha=null,C=f[1];"?"==C&&(C=void 0);if(void 0!==C){var pa=0;if("all"==C)pa=1878917119,C=null;else if("on"==C)ha=!0,C=null;else if("off"==C)ha=!1,C=null;else{"keys"==C&&
|
||||
(C="key");"kbd"==C&&(C="keyboard");for(ga in H)if(C==ga){pa=H[ga];ha=!!(a.ja&pa);break}if(!pa){a.i("unknown message category: "+C);break a}}if(pa)if("on"==f[2])a.ja|=pa,ha=!0;else if("off"==f[2]&&(a.ja&=~pa,ha=!1,1073741824==pa)){for(var Lc=0;Lc<a.Ha.length;Lc++)a.i(a.Ha[Lc]);a.Ha=[]}}var Lf=0,mb="";for(ga in H)if(!C||C==ga){var Mf=!!(a.ja&H[ga]);if(null===ha||ha==Mf)mb&&(mb+=","),++Lf%10||(mb+="\n\t"),"key"==ga&&(ga="keys"),mb+=ga}void 0===C&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.i((null!==ha?ha?"messages on: ":"messages off: ":"message categories:\n\t")+(mb||"none"));Ge(a)}break;case "p":if("print"==f[0]){jf(a,b.substr(5));break}var Nf="pr"==f[0]?1:0;if(a.da)a.i("step in progress");else{var pe=Z(a.b.f[7]);a.Nb(pe);a.da?(a.hb(a.g,pe,!0),a.ob()||(a.w&&a.w.Yb(),a.da=0)):kf(a,Nf?"tr":"t")}break;case "r":if("reset"==b){a.w&&a.w.reset();break}Te(a,f);break;case "s":a:switch(f[1]){case "base":if(f[2]){var nb=+f[2];if(8==nb||10==nb||16==nb)a.za=nb;else{a.i("invalid base: "+nb);
|
||||
break}}a.i("default base: "+a.za);break;case "cs":var ob;void 0!==f[3]&&(ob=+f[3]);switch(f[2]){case "int":a.b.ub=ob;break;case "start":a.b.Rb=ob;break;case "stop":a.b.vb=ob;break;default:a.i("unknown cs option");break a}void 0!==ob&&Pc(a.b);a.i("checksums "+(a.b.j.rb?"enabled":"disabled"));break;case "sp":void 0!==f[2]&&(Tc(a.b,+f[2])||a.i("warning: using 1x multiplier, previous target not reached"));a.i("target speed: "+(a.b.kb.toFixed(2)+"Mhz")+" ("+a.b.mb+"x)");break;case "?":a.i("debugger options:");
|
||||
a.i("\tbase #\t\tset default base to #");a.i("\tcs int #\tset checksum cycle interval to #");a.i("\tcs start #\tset checksum cycle start count to #");a.i("\tcs stop #\tset checksum cycle stop count to #");a.i("\tsp #\t\tset speed multiplier to #");break;default:f[1]&&a.i("unknown option: "+f[1])}break;case "t":kf(a,f[0],f[1]);break;case "u":Ue(a,f[1],f[2],8);break;case "v":if("var"==f[0]){gf(a,b.substr(3))||(c=!1);break}a.i("PDP11js version 1.30.0 ("+a.b.Xc+",RELEASE"+(sb?",TYPEDARRAYS":",LONGARRAYS")+
|
||||
")");a.i(window?window.navigator.userAgent:"");break;case "?":if(f[1]){jf(a,b.substr(1));break}var Lc="commands:",Mc;for(Mc in Je)Lc+="\n"+na(Mc,9)+Je[Mc];md(a)||(Lc+="\nnote: history disabled if no exec breakpoints");a.i(Lc);break;default:a.i("unknown command: "+b),c=!1}}}catch(qe){a.i("debugger error: "+(qe.stack||qe.message)),c=!1}return c}function Ie(a,b,d){b=xe(a,b,d);for(var c in b)if(!Ze(a,b[+c]))return!1;return!0}
|
||||
")");a.i(window?window.navigator.userAgent:"");break;case "?":if(f[1]){jf(a,b.substr(1));break}var Mc="commands:",Nc;for(Nc in Je)Mc+="\n"+na(Nc,9)+Je[Nc];md(a)||(Mc+="\nnote: history disabled if no exec breakpoints");a.i(Mc);break;default:a.i("unknown command: "+b),c=!1}}}catch(qe){a.i("debugger error: "+(qe.stack||qe.message)),c=!1}return c}function Ie(a,b,d){b=xe(a,b,d);for(var c in b)if(!Ze(a,b[+c]))return!1;return!0}
|
||||
Oa(function(){for(var a=B(document,"pdp11","debugger"),b=0;b<a.length;b++){var d=a[b],c=y(d),c=new Ee(c);bb(c,d)}});
|
||||
function mf(a,b,d){u.call(this,"Computer",a,mf,67108864);this.j.ga=!1;nf(this,b);this.Y=Nc(this,"autoPower",a);this.u=0;this.ha=a.busWidth||a.buswidth;this.g=of;this.W=null;this.O=this.ca=!1;this.url=Nc(this,"url")||"";(Math.random()+.1).toString(36);this.B=pf(this);if(this.b=ab("CPU",this.id)){this.I=ab("Debugger",this.id);this.H=new yb({id:this.tc+".bus",busWidth:this.ha},this.b,this.I);var c,e=$a(this.id);if((this.G=ab("Panel",this.id))&&this.G.ib)for(b=0;b<e.length;b++)c=e[b],c.sa=this.G.sa,c.i=
|
||||
this.G.i,c.ib=this.G.ib;this.i("PDP11js v1.30.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)c=e[b],c.$a&&c.$a(this,this.H,this.b,this.I);b=null;c=a.resume;void 0!==c&&(1<c.length?b=this.R=c:this.g=parseInt(c,10));var f;if(a=Nc(this,"state")||(f=!0,a.state))b=this.$=a,f||(this.O=!0,this.g=of),this.g&&
|
||||
(this.X=new O(this,"1.30.0"),qf(this.X)?b=null:delete this.X);!b&&this.g&&(b=rf(this))&&(this.O=!0);if(b){var g=this;wa(b,null,!0,function(a,b,c){c?(g.R=null,g.O=!1,g.sa("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.W=b,g.ca=!0);D(g)})}else D(this);this.P.power||(this.Y=!0);!d&&this.Y&&sf(this,this.Sb)}else t("Unable to find CPU component")}w(mf);var of=0;
|
||||
function nf(a,b){if(!b){var d;if("object"==typeof resources&&(d=resources.parms))try{b=eval("("+d+")")}catch(c){t(c.message+" ("+d+")")}}a.da=b}function Nc(a,b,d){var c=b.toLowerCase(),c=Ta[b]||Ta[c];void 0===c&&a.da&&(c=a.da[b]);void 0===c&&d&&(c=d[b]);void 0===c&&"object"==typeof resources&&resources[b]&&(c=b);return c}function sf(a,b,d){for(var c=$a(a.id),e=0;e<=c.length;e++){var f=e<c.length?c[e]:a;if(!qb(f)){qb(f,function(){sf(a,b,d)});return}}b.call(a,d)}
|
||||
function mf(a,b,d){u.call(this,"Computer",a,mf,67108864);this.j.ga=!1;nf(this,b);this.Y=zc(this,"autoPower",a);this.u=0;this.ha=a.busWidth||a.buswidth;this.g=of;this.W=null;this.O=this.ca=!1;this.url=zc(this,"url")||"";(Math.random()+.1).toString(36);this.w=pf(this);if(this.b=ab("CPU",this.id)){this.I=ab("Debugger",this.id);this.H=new yb({id:this.tc+".bus",busWidth:this.ha},this.b,this.I);var c,e=$a(this.id);if((this.G=ab("Panel",this.id))&&this.G.ib)for(b=0;b<e.length;b++)c=e[b],c.sa=this.G.sa,c.i=
|
||||
this.G.i,c.ib=this.G.ib;this.i("PDP11js v1.30.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)c=e[b],c.$a&&c.$a(this,this.H,this.b,this.I);b=null;c=a.resume;void 0!==c&&(1<c.length?b=this.R=c:this.g=parseInt(c,10));var f;if(a=zc(this,"state")||(f=!0,a.state))b=this.$=a,f||(this.O=!0,this.g=of),this.g&&
|
||||
(this.X=new O(this,"1.30.0"),qf(this.X)?b=null:delete this.X);!b&&this.g&&(b=rf(this))&&(this.O=!0);if(b){var g=this;wa(b,null,!0,function(a,b,c){c?(g.R=null,g.O=!1,g.sa("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.W=b,g.ca=!0);D(g)})}else D(this);this.P.power||(this.Y=!0);!d&&this.Y&&sf(this,this.Sb)}else t("Unable to find CPU component")}w(mf);var of=0;
|
||||
function nf(a,b){if(!b){var d;if("object"==typeof resources&&(d=resources.parms))try{b=eval("("+d+")")}catch(c){t(c.message+" ("+d+")")}}a.da=b}function zc(a,b,d){var c=b.toLowerCase(),c=Ta[b]||Ta[c];void 0===c&&a.da&&(c=a.da[b]);void 0===c&&d&&(c=d[b]);void 0===c&&"object"==typeof resources&&resources[b]&&(c=b);return c}function sf(a,b,d){for(var c=$a(a.id),e=0;e<=c.length;e++){var f=e<c.length?c[e]:a;if(!qb(f)){qb(f,function(){sf(a,b,d)});return}}b.call(a,d)}
|
||||
function tf(a,b){var d=new O(a,"1.30.0","validate");if(qf(d)&&uf(d)){var c=d.get("timestamp"),e=b?b.get("timestamp"):"unknown";c!=e&&(a.sa("Machine state may be out-of-date\n("+c+" vs. "+e+")\nCheck your browser's local storage limits"),b||d.clear())}}l=mf.prototype;
|
||||
l.Sb=function(a){void 0===a&&(a=this.g||(this.W?1:of));if(!this.u){this.u++;var b=!1,d=!1;this.ba=!1;var c=this.X||new O(this,"1.30.0");if(-1==a)b=!0;else if(a>of){if(qf(c,this.W)){this.J=new O(this,"1.30.0","failsafe");qf(this.J)&&(vf(this,c),a=2,wf(this.J));this.J.set("timestamp",va());xf(this.J);var e=this.g&&!this.O;if(1==a||xa("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(d=uf(c)){var f=c.get("code"),g=c.get("data");f&&("ok"==f?qf(c,g):("error"==
|
||||
f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.B=null)):this.i(f+": "+g),wf(c),qf(c)?(d=uf(c),e=!0):d=!1))}e&&tf(this,d?c:null)}else 2==a&&c.clear()}else tf(this);delete this.W;delete this.X}e=$a(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(d=yf(this,g,c,b,d));b=[c,a,d];-1!=a?sf(this,this.xc,b):this.xc(b)}};
|
||||
l.Sb=function(a){void 0===a&&(a=this.g||(this.W?1:of));if(!this.u){this.u++;var b=!1,d=!1;this.ba=!1;var c=this.X||new O(this,"1.30.0");if(-1==a)b=!0;else if(a>of){if(qf(c,this.W)){this.J=new O(this,"1.30.0","failsafe");qf(this.J)&&(vf(this,c),a=2,wf(this.J));this.J.set("timestamp",sa());xf(this.J);var e=this.g&&!this.O;if(1==a||xa("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(d=uf(c)){var f=c.get("code"),g=c.get("data");f&&("ok"==f?qf(c,g):("error"==
|
||||
f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ba("user",""),this.w=null)):this.i(f+": "+g),wf(c),qf(c)?(d=uf(c),e=!0):d=!1))}e&&tf(this,d?c:null)}else 2==a&&c.clear()}else tf(this);delete this.W;delete this.X}e=$a(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(d=yf(this,g,c,b,d));b=[c,a,d];-1!=a?sf(this,this.xc,b):this.xc(b)}};
|
||||
function yf(a,b,d,c,e){if(!b.j.ga){b.j.ga=!0;if(b.Qa){var f=null;e&&((f=d.get(b.id))||(f=d.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Qa(f,c)&&f&&(t("Unable to restore state for "+b.type),a.$&&!a.ca?(d.clear(),a.g=of,window&&window.location.reload()):a.ba=!0,b.Qa(null),e=!1)}if(!c&&b.rc)for(a=b.rc.split("|"),d=0;d<a.length;d++)b.status(a[d])}return e}
|
||||
l.xc=function(a){var b=a[0],d=0>a[1];a=a[2];this.ia=!0;this.j.ga=!0;var c=this.P.power;c&&(c.textContent="Shutdown");this.b&&(yf(this,this.b,b,d,a),this.b.Hb());this.ba&&(vf(this,b),b.clear());!d&&this.J&&(this.J.clear(),delete this.J);this.u=0};
|
||||
function vf(a,b){if(xa("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var d=a.B||"";b=b.toString();var c={app:"PDP11js",ver:"1.30.0"};c.url=a.url;c.user=d;c.type="bug";c.data=b;wa("http://www.pcjs.org/api/v1/report",c,!0)}}
|
||||
function lf(a,b,d){var c,e="none";if(a.u)return null;a.u--;var f=new O(a,"1.30.0"),g=new O(a,"1.30.0","validate"),h=va();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Pa&&(d&&a.b.pa(),c=a.b.Pa(b,d),"object"===typeof c&&f.set(a.b.id,c),d&&(a.b.j.ga=!1,!1===c&&(e=null)));for(var h=$a(a.id),k=0;k<h.length;k++){var m=h[k];m.j.ga&&(m.Pa&&(c=m.Pa(b,d),"object"===typeof c&&f.set(m.id,
|
||||
c)),d&&(m.j.ga=!1,!1===c&&(e=null)))}e&&(d?(h=c=!1,b?(a.B&&zf(a,a.B,f.toString()),xf(g)&&xf(f)||(e=null,c=h=!0)):a.g&&(c=!0,h=3==a.g),c&&f.clear(h)):e=f.toString());d&&(a.j.ga=!1,b=a.P.power)&&(b.textContent="Power");a.u=0;return e}
|
||||
function vf(a,b){if(xa("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var d=a.w||"";b=b.toString();var c={app:"PDP11js",ver:"1.30.0"};c.url=a.url;c.user=d;c.type="bug";c.data=b;wa("http://www.pcjs.org/api/v1/report",c,!0)}}
|
||||
function lf(a,b,d){var c,e="none";if(a.u)return null;a.u--;var f=new O(a,"1.30.0"),g=new O(a,"1.30.0","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Pa&&(d&&a.b.pa(),c=a.b.Pa(b,d),"object"===typeof c&&f.set(a.b.id,c),d&&(a.b.j.ga=!1,!1===c&&(e=null)));for(var h=$a(a.id),k=0;k<h.length;k++){var m=h[k];m.j.ga&&(m.Pa&&(c=m.Pa(b,d),"object"===typeof c&&f.set(m.id,
|
||||
c)),d&&(m.j.ga=!1,!1===c&&(e=null)))}e&&(d?(h=c=!1,b?(a.w&&zf(a,a.w,f.toString()),xf(g)&&xf(f)||(e=null,c=h=!0)):a.g&&(c=!0,h=3==a.g),c&&f.clear(h)):e=f.toString());d&&(a.j.ga=!1,b=a.P.power)&&(b.textContent="Power");a.u=0;return e}
|
||||
l.reset=function(){this.H&&this.H.reset&&(this.I&&cb(this,0)&&this.I.message("Resetting "+this.H.type,void 0),this.H.reset());for(var a=$a(this.id),b=0;b<a.length;b++){var d=a[b];d!==this&&d!==this.H&&d.reset&&(this.I&&cb(this,0)&&this.I.message("Resetting "+d.type,void 0),d.reset())}};l.start=function(a,b){for(var d=$a(this.id),c=0;c<d.length;c++){var e=d[c];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
||||
l.stop=function(a,b){for(var d=$a(this.id),c=0;c<d.length;c++){var e=d[c];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||
l.xa=function(a,b,d){var c=this;switch(b){case "power":return this.P[b]=d,d.onclick=function(){c.u||(c.j.ga?lf(c,!1,!0):sf(c,c.Sb))},!0;case "reset":return this.P[b]=d,d.onclick=function(){if(c.j.ga&&!c.u)if(c.g&&!c.R){var a=xa("Click OK to save changes to this PDP11js machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");lf(c,a,!0);!a&&c.$?window&&window.location.reload():c.Sb(of)}else c.reset(),c.b&&c.b.Hb()},!0;case "save":if(ja())d.parentNode.removeChild(d);else return this.P[b]=
|
||||
l.wa=function(a,b,d){var c=this;switch(b){case "power":return this.P[b]=d,d.onclick=function(){c.u||(c.j.ga?lf(c,!1,!0):sf(c,c.Sb))},!0;case "reset":return this.P[b]=d,d.onclick=function(){if(c.j.ga&&!c.u)if(c.g&&!c.R){var a=xa("Click OK to save changes to this PDP11js machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");lf(c,a,!0);!a&&c.$?window&&window.location.reload():c.Sb(of)}else c.reset(),c.b&&c.b.Hb()},!0;case "save":if(ja())d.parentNode.removeChild(d);else return this.P[b]=
|
||||
d,d.onclick=function(){var a=pf(c,!0);if(a){var b=!!(c.g&&!c.R||c.$),d=lf(c,b);b?zf(c,a,d):c.sa("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function pf(a,b){var d=a.B;d||((d=Aa("user"),void 0!==d)?!d&&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.","")),d=b)&&((d=Af(a,d))||a.sa("The user ID is invalid.")):b&&a.sa("Browser local storage is not available"));return d}
|
||||
function Af(a,b){a.B=null;b=wa(ka()+"/api/v1/user?req=verify&user="+b);var d=b[1];if(!b[0]&&d)try{b=eval("("+d+")"),b.code&&"ok"==b.code&&(Ba("user",b.data),a.B=b.data)}catch(c){t(c.message+" ("+d+")")}return a.B}function rf(a){var b=null;a.B&&(b=ka()+"/api/v1/user?req=load&user="+a.B+"&state="+Bf(a,"1.30.0"));return b}
|
||||
function zf(a,b,d){if(d){var c={req:"store"};c.user=b;c.state=Bf(a,"1.30.0");c.data=d;b=wa(ka()+"/api/v1/user",c);c=b[0];if(b[1]){if(c){var e=c.indexOf("\n");0<e&&(c=c.substr(0,e));c.indexOf("Error: ")||(c=c.substr(7))}c='{"code":'+b[1]+',"data":"'+c+'"}'}b=JSON.parse(c);b&&"ok"==b.code?a.sa("Machine state saved to server"):d&&(d=b&&b.data||"unable to save machine state",d="error"==b.code?"Error: "+d:"Error "+b.code+": "+d,a.sa(d),Ba("user",""),a.B=null)}}l.Yb=function(){};
|
||||
function pf(a,b){var d=a.w;d||((d=Aa("user"),void 0!==d)?!d&&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.","")),d=b)&&((d=Af(a,d))||a.sa("The user ID is invalid.")):b&&a.sa("Browser local storage is not available"));return d}
|
||||
function Af(a,b){a.w=null;b=wa(ka()+"/api/v1/user?req=verify&user="+b);var d=b[1];if(!b[0]&&d)try{b=eval("("+d+")"),b.code&&"ok"==b.code&&(Ba("user",b.data),a.w=b.data)}catch(c){t(c.message+" ("+d+")")}return a.w}function rf(a){var b=null;a.w&&(b=ka()+"/api/v1/user?req=load&user="+a.w+"&state="+Bf(a,"1.30.0"));return b}
|
||||
function zf(a,b,d){if(d){var c={req:"store"};c.user=b;c.state=Bf(a,"1.30.0");c.data=d;b=wa(ka()+"/api/v1/user",c);c=b[0];if(b[1]){if(c){var e=c.indexOf("\n");0<e&&(c=c.substr(0,e));c.indexOf("Error: ")||(c=c.substr(7))}c='{"code":'+b[1]+',"data":"'+c+'"}'}b=JSON.parse(c);b&&"ok"==b.code?a.sa("Machine state saved to server"):d&&(d=b&&b.data||"unable to save machine state",d="error"==b.code?"Error: "+d:"Error "+b.code+": "+d,a.sa(d),Ba("user",""),a.w=null)}}l.Yb=function(){};
|
||||
l.Ba=function(a){this.b&&this.b.Ba(a);this.G&&this.G.Ba(a)};Oa(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var d=a[b],c=y(d),d=B(d,"pdp11","computer"),e=0;e<d.length;e++){var f=d[e],g=y(f),g=new mf(g,c,!0);bb(g,f);g.Y&&sf(g,g.Sb)}});Ja.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var d=y(a[b]);(d=ab("Computer",d.id))&&d.ia&&!d.j.ga&&d.Sb(-1)}});
|
||||
Ja.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var d=y(a[b]);(d=ab("Computer",d.id))&&d.j.ga&&lf(d,!(!d.g||d.R),!0)}});function O(a,b,d){this.id=a.id;this.key=Bf(a,b,d);this.I=a.I;wf(this,a.Pc)}function Bf(a,b,d){a=a.id;if(b){var c=b.indexOf(".");0<c&&(a+=".v"+b.substr(0,c))}d&&(a+="."+d);return a}
|
||||
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(d){}},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){wf(this);var b=[];try{for(var d=0,c=window.localStorage.length;d<c;d++)b.push(window.localStorage.key(d))}catch(e){}for(d=0;d<b.length;d++)if((c=b[d])&&(a||c.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(c)}catch(e){}b.splice(d,
|
||||
|
|
|
|||
|
|
@ -15,123 +15,124 @@ function A(a,b){b=B(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for
|
|||
function B(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var f=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)f.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},fa:function(a,b,c){switch(b){case "clear":return this.C[b]||(this.C[b]=c,c.onclick=function(a){return function(){a.C.print&&(a.C.print.value="")}}(this)),!0;case "print":return this.C[b]||(this.Db=this.C[b]=c,c.value="",this.$=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.L=function(a){this.$(a,this.yb)}),!0;default:return!1}},log:function(){},$:function(){},status:function(a){this.$(this.yb+": "+a)},L:function(a,b,c){c=c||this.type;b||r((c?c+": ":"")+a)},za:function(){return this.j.M=!0},ya:function(a,b){b&&(this.j.M=!1);return!0}};function Fa(a,b){if(a.j.Cb)return a.j.bb&&(a.j.bb=!1),a.j.Cb=!1;if(a.j.error)return a.$(a.toString()+" error"),!1;a.j.bb=b;return a.j.bb}function C(a){if(!a.j.error&&(a.j.ready=!0,a.j.ready)){var b=a.qb;a.qb=null;b&&b()}}
|
||||
function Ga(a,b){b&&(a.j.ready?b():a.qb=b);return a.j.ready}var Ha="undefined"!==typeof ArrayBuffer,D=2,E=4,F=6,D=0|D,Ia=1|D,E=0|E,Ja=1|E,F=0|F,G=1|F;function Ka(a){v.call(this,"Panel",a,Ka)}x(Ka);l=Ka.prototype;l.fa=function(a,b,c,d){return this.B&&this.B.fa(a,b,c,d)||this.a&&this.a.fa(a,b,c,d)?!0:this.parent.fa.call(this,a,b,c,d)};l.La=function(a,b,c,d){this.B=a;this.A=b;this.a=c;this.K=d};l.za=function(a,b){b||La();return!0};l.ya=function(){return!0};l.Pa=function(){};
|
||||
function La(){for(var a=!1,b=B(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],f=z(d),e;a:{e=f.id;if(void 0!==e){var g;for(g=0;g<w.length;g++)if(w[g].id===e){e=w[g];break a}}e=null}e||(a=!0,e=new Ka(f));A(e,d);a&&C(e)}}u(La);
|
||||
function Ma(a,b,c){v.call(this,"Bus",a,Ma);this.a=b;this.K=c;this.v=a.busWidth||16;this.o=Math.pow(2,this.v);this.i=this.o-1|0;this.f=(this.v>>1)+2;10>this.f&&(this.f=10);15<this.f&&(this.f=15);this.g=1<<this.f;this.B=this.g>>2;this.h=this.g-1;this.l=this.o/this.g|0;this.H=this.l-1;this.ta=[];this.A=null;this.cb=this.O;a=new H;Na(a,this.K);this.c=Array(this.l);for(b=0;b<this.l;b++)this.c[b]=a;this.Za=Array(4);this.Za[0]=Oa;this.Za[1]=Pa;this.Za[2]=Qa;this.Za[3]=Ra;Sa(this,this.o-8192,8192,Ta,this);
|
||||
Sa(this,57344,8192,Ta,this);C(this)}x(Ma);function Oa(a,b){var c=this.controller,d=c.ta[a];if(d){if(d[0])return d[0](b);if(d[2])return b&1?d[2](b&-2)>>8:d[2](b)&255}else if(b&1&&(d=c.ta[a&-2],d[2]))return d[2](b&-2)>>8;return c.cb(b,-1,1)}
|
||||
function Pa(a,b,c){var d=this.controller,f=d.ta[a];if(f){if(f[1]){f[1](b,c);return}if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);return}}else if(c&1&&(f=d.ta[a&-2],f[3])){c&=-2;a=f[2]?f[2](c):0;f[3](a&255|b<<8,c);return}d.cb(c,b,1)}function Qa(a,b){var c=this.controller;if(a=c.ta[a]){if(a[2])return a[2](b);if(a[0])return a[0](b)|a[0](b+1)<<8}return c.cb(b,-1,0)}
|
||||
function Ra(a,b,c){var d=this.controller;if(a=d.ta[a]){if(a[3]){a[3](b,c);return}if(a[1]){a[1](b&255,c);a[1](b>>8,c+1);return}}d.cb(c,b,0)}Ma.prototype.reset=function(){this.A&&this.A()};Ma.prototype.O=function(){return 0};Ma.prototype.za=function(a,b){b||this.reset();return!0};
|
||||
function Sa(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.f;0<g&&h<a.c.length;){var k=a.c[h],m=h*a.g,q=a.g-(e-m);q>g&&(q=g);if(k&&k.size){if(k.type==d&&k.controller==f){if(e+g<=k.Sa)return k.wb+=k.Sa-e,k.Sa=e,!0;if(e>=k.Sa+k.wb){q=k.size-(e-m);q>g&&(q=g);k.wb=e-k.Sa+q;e=m+a.g;g-=q;h++;continue}}return Ua(1,e,g)}e=new H(e,q,a.g,d,f);Na(e,a.K,k);a.c[h++]=e;e=m+a.g;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Va[d]+" at "+n(b,8,!0)),!0):Ua(2,b,c)}
|
||||
function Wa(a){for(var b=0,c=[],d=0;d<a.l;d++){var f=a.c[d];if(f.wa||f.fc){c[b++]=d;var e=b++;if(f=f.save()){for(var g=0,h=0,k=[];g<f.length;){for(var m=f[g],q=g+1;q<f.length&&f[q]===m;)q++;k[h++]=q-g;k[h++]=m;g=q}k.length<f.length&&(f=k)}c[e]=f}}return c}function Ua(a,b,c){r("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}
|
||||
function Xa(a){v.call(this,"Device",a,Xa);this.l={Gb:[],ia:0,V:128,c:127,ec:0};this.c={data:0,Dc:0,Ta:20,zc:0};this.f={Fb:0,m:0};this.g={ib:2496,S:0,w:128,jb:0,hb:0,X:0,Vb:0,T:[],Ja:[406,406,406,406],G:[12,12,12,12]};this.h={m:129,ab:0,J:0,xa:0,ua:0,Ba:0,T:[],G:[40,40,40,40],Ja:[1024,1024,512,512],cc:[157,157,29,29]};this.i={a:[8210,8208,8210,8226],G:[22,22,22,50],Ia:[19,19,19,32],xb:[815,411,815,630],T:[],D:2176,Xa:0,Va:0,ea:[0,0,0,0,0,0,0,0],da:0,U:[4544,4544,4544,4544,4544,4544,4544,4544],Wa:[0,
|
||||
0,0,0,0,0,0,0],Oa:0,xc:[0,0,0,0,0,0,0,0],Wb:0,Xb:[0,0,0,0,0,0,0,0],f:[0,0,0,0,0,0,0,0],yc:[1,2,3,4,5,6,7,8],Yb:[0,0,0,0,0,0,0,0],na:[0,0,0,0,0,0,0,0],vb:[0,0,0,0,0,0,0,0],vc:[0,0,0,0,0,0,0,0],wc:[0,0,0,0,0,0,0,0],tc:[0,0,0,0,0,0,0,0],uc:[0,0,0,0,0,0,0,0],Aa:0,Hb:0}}x(Xa);
|
||||
function Ga(a,b){b&&(a.j.ready?b():a.qb=b);return a.j.ready}var Ha="undefined"!==typeof ArrayBuffer,Ia=2,D=4,E=6,Ia=0|Ia,Ja=1|Ia,D=0|D,Ka=1|D,E=0|E,F=1|E;function La(a){v.call(this,"Panel",a,La)}x(La);l=La.prototype;l.fa=function(a,b,c,d){return this.B&&this.B.fa(a,b,c,d)||this.a&&this.a.fa(a,b,c,d)?!0:this.parent.fa.call(this,a,b,c,d)};l.La=function(a,b,c,d){this.B=a;this.A=b;this.a=c;this.K=d};l.za=function(a,b){b||Ma();return!0};l.ya=function(){return!0};l.Pa=function(){};
|
||||
function Ma(){for(var a=!1,b=B(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],f=z(d),e;a:{e=f.id;if(void 0!==e){var g;for(g=0;g<w.length;g++)if(w[g].id===e){e=w[g];break a}}e=null}e||(a=!0,e=new La(f));A(e,d);a&&C(e)}}u(Ma);
|
||||
function Na(a,b,c){v.call(this,"Bus",a,Na);this.a=b;this.K=c;this.v=a.busWidth||16;this.o=Math.pow(2,this.v);this.i=this.o-1|0;this.f=(this.v>>1)+2;10>this.f&&(this.f=10);15<this.f&&(this.f=15);this.g=1<<this.f;this.B=this.g>>2;this.h=this.g-1;this.l=this.o/this.g|0;this.H=this.l-1;this.ta=[];this.A=null;this.cb=this.O;a=new G;Oa(a,this.K);this.c=Array(this.l);for(b=0;b<this.l;b++)this.c[b]=a;this.Za=Array(4);this.Za[0]=Pa;this.Za[1]=Qa;this.Za[2]=Ra;this.Za[3]=Sa;Ta(this,this.o-8192,8192,Ua,this);
|
||||
Ta(this,57344,8192,Ua,this);C(this)}x(Na);function Pa(a,b){var c=this.controller,d=c.ta[a];if(d){if(d[0])return d[0](b);if(d[2])return b&1?d[2](b&-2)>>8:d[2](b)&255}else if(b&1&&(d=c.ta[a&-2],d[2]))return d[2](b&-2)>>8;return c.cb(b,-1,1)}
|
||||
function Qa(a,b,c){var d=this.controller,f=d.ta[a];if(f){if(f[1]){f[1](b,c);return}if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);return}}else if(c&1&&(f=d.ta[a&-2],f[3])){c&=-2;a=f[2]?f[2](c):0;f[3](a&255|b<<8,c);return}d.cb(c,b,1)}function Ra(a,b){var c=this.controller;if(a=c.ta[a]){if(a[2])return a[2](b);if(a[0])return a[0](b)|a[0](b+1)<<8}return c.cb(b,-1,0)}
|
||||
function Sa(a,b,c){var d=this.controller;if(a=d.ta[a]){if(a[3]){a[3](b,c);return}if(a[1]){a[1](b&255,c);a[1](b>>8,c+1);return}}d.cb(c,b,0)}Na.prototype.reset=function(){this.A&&this.A()};Na.prototype.O=function(){return 0};Na.prototype.za=function(a,b){b||this.reset();return!0};
|
||||
function Ta(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.f;0<g&&h<a.c.length;){var k=a.c[h],m=h*a.g,q=a.g-(e-m);q>g&&(q=g);if(k&&k.size){if(k.type==d&&k.controller==f){if(e+g<=k.Sa)return k.wb+=k.Sa-e,k.Sa=e,!0;if(e>=k.Sa+k.wb){q=k.size-(e-m);q>g&&(q=g);k.wb=e-k.Sa+q;e=m+a.g;g-=q;h++;continue}}return Va(1,e,g)}e=new G(e,q,a.g,d,f);Oa(e,a.K,k);a.c[h++]=e;e=m+a.g;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Wa[d]+" at "+n(b,8,!0)),!0):Va(2,b,c)}
|
||||
function Xa(a){for(var b=0,c=[],d=0;d<a.l;d++){var f=a.c[d];if(f.wa||f.fc){c[b++]=d;var e=b++;if(f=f.save()){for(var g=0,h=0,k=[];g<f.length;){for(var m=f[g],q=g+1;q<f.length&&f[q]===m;)q++;k[h++]=q-g;k[h++]=m;g=q}k.length<f.length&&(f=k)}c[e]=f}}return c}function Va(a,b,c){r("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}
|
||||
function H(a){v.call(this,"Device",a,H);this.c={Gb:[],ia:0,X:128,c:127,ec:0};this.f={data:0,Fc:0,Ta:20,Ac:0};this.g={Fb:0,m:0};this.h={ib:2496,S:0,w:128,jb:0,hb:0,W:0,Vb:0,T:[],Ja:[406,406,406,406],G:[12,12,12,12]};this.i={m:129,ab:0,J:0,xa:0,ua:0,Ba:0,T:[],G:[40,40,40,40],Ja:[1024,1024,512,512],cc:[157,157,29,29]};this.l={a:[8210,8208,8210,8226],G:[22,22,22,50],Ia:[19,19,19,32],xb:[815,411,815,630],T:[],D:2176,Xa:0,Va:0,ea:[0,0,0,0,0,0,0,0],da:0,U:[4544,4544,4544,4544,4544,4544,4544,4544],Wa:[0,
|
||||
0,0,0,0,0,0,0],Oa:0,yc:[0,0,0,0,0,0,0,0],Wb:0,Xb:[0,0,0,0,0,0,0,0],f:[0,0,0,0,0,0,0,0],zc:[1,2,3,4,5,6,7,8],Yb:[0,0,0,0,0,0,0,0],na:[0,0,0,0,0,0,0,0],vb:[0,0,0,0,0,0,0,0],wc:[0,0,0,0,0,0,0,0],xc:[0,0,0,0,0,0,0,0],uc:[0,0,0,0,0,0,0,0],vc:[0,0,0,0,0,0,0,0],Aa:0,Hb:0}}x(H);
|
||||
var Ya=[4127,448,4191,450,4383,452,2591,454,21983,32768,65534,13791,16384,65534,770,2719,454,2591,65534,257,0,2566,33028,34051,33282,1281,33537,0,2758,32771,770,1025,1793,0,3078,33794,34305,513,0,5574,43690,4480,4097,4162,4227,4292,4357,57665,1281,769,0,3138,34305,1281,0,24707,2691,2627,24769,34561,1793,0,3076,20739,24899,2691,34562,2753,1281,0,2624,33537,0,16385,24641,1537,1793,0,193,8279,21589,516,12549,1538,2629,513,0,38336,65281,32769,0,32258,2561,2689,32258,3008,514,3009,769,0,5574,510,2551,
|
||||
2,0,9678,208,769,0,5582,226,135,0,2598,5606,236,2,0,95,242,128,5573,57344,2591,6,5599,256,4,5574,510,3045,5599,460,76,2591,78,5571,65510,5579,12,5570,512,4224,4104,3024,8197,33788,4224,4609,8193,769,0,2640,8197,33785,6145,2625,8193,769,0,8194,761,2574,5572,43690,5579,24,5568,2048,5570,512,2628,4360,2632,2632,8708,769,0,3103,65514,34562,0,305,35406,754,258,119,65160,3024,32403,5579,36,5568,3072,35446,1,740,5570,512,4224,4104,3024,8197,33788,5569,3,2574,3039,454,528,5582,24,4224,2632,2632,8200,769,
|
||||
0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];l=Xa.prototype;
|
||||
l.La=function(a,b,c,d){this.A=b;this.a=c;this.K=d;a=Za;for(var f in a){var e=a[f];c=b;d=+f;for(var g=e[0]?e[0].bind(this):null,h=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,m=+f;m<=d;m+=2){var q=m&8191;void 0!==c.ta[q]?r("I/O address already registered: "+n(m,8,!0)):c.ta[q]=[g,h,k,e,!1]}}f=this.bc.bind(this);b.A=this.reset.bind(this);b.cb=f;C(this)};l.oc=function(){return $a(this.a)};l.Bc=function(a){ab(this.a,a&-1809|$a(this.a)&1808);this.a.F|=128};
|
||||
function bb(a){var b=a.g,c,d,f,e=b.X>>13&7;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.qc,drive:e,blocksize:256,mapped:0,maxblock:b.Ja[e]*b.G[e],url:"rk"+e+".dsk"});b.w&=-129;switch(b.w>>1&7){case 0:b.ib=2496;b.S=0;b.w=128;b.X=0;break;case 1:if((b.X>>4&511)>=b.Ja[e]){b.S|=32832;b.w|=49152;break}if((b.X&15)>=b.G[e]){b.S|=32800;b.w|=49152;break}c=(b.X>>4&511)*b.G[e]+(b.X&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;cb(a,b.T[e],c,d,f);return;case 2:if((b.X>>4&511)>=b.Ja[e])b.S|=32832,
|
||||
b.w|=49152;else if((b.X&15)>=b.G[e])b.S|=32800,b.w|=49152;else{c=(b.X>>4&511)*b.G[e]+(b.X&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;a.tb(b.T[e],c,d,f);return}}b.ib=e<<13|b.ib&8176|b.X%9&15;I(a.a,20,160,144,function(){b.w=b.w&65534|128;return!!(b.w&64)})}l.qc=function(a,b,c,d,f){var e=this.g;e.hb=d&65535;e.w=e.w&-49|d>>12&48;e.jb=65536-f&65535;switch(a){case 1:e.S|=33024;e.w|=49152;break;case 2:e.S|=33792,e.w|=49152}I(this.a,20,160,144,function(){e.w=e.w&65534|128;return!!(e.w&64)})};
|
||||
function db(a){var b=a.h,c,d,f,e=b.m>>8&3;b.m&=-2;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.rc,drive:e,blocksize:128,mapped:1,maxblock:b.Ja[e]*b.G[e],url:"rl"+e+".dsk"});switch(b.m>>1&7){case 2:b.xa&8&&(b.m&=63);b.xa=b.cc[e]|b.Ba&64;break;case 3:1==(b.J&3)&&(b.Ba=b.J&4?b.Ba+(b.J&65408)&65408|b.J<<2&64:b.Ba-(b.J&65408)&65408|b.J<<2&64,b.J=b.Ba);break;case 4:b.xa=b.Ba;break;case 5:if(b.J>>6>=b.Ja[e]){b.m|=37888;break}if((b.J&63)>=b.G[e]){b.m|=37888;break}c=(b.J>>6)*b.G[e]+(b.J&63);
|
||||
d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;cb(a,b.T[e],c,d,f);return;case 6:if(b.J>>6>=b.Ja[e])b.m|=37888;else if((b.J&63)>=b.G[e])b.m|=37888;else{c=(b.J>>6)*b.G[e]+(b.J&63);d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;a.tb(b.T[e],c,d,f);return}}I(a.a,20,160,112,function(){b.m|=129;return!!(b.m&64)})}
|
||||
l.rc=function(a,b,c,d,f){var e=this.h;e.ab=d&65535;e.m=e.m&-49|d>>12&48;e.ua=d>>16&63;e.J=~~(c/e.G[b.ka])<<6|c%e.G[b.ka];e.Ba=e.J;e.xa=65536-f&65535;switch(a){case 1:e.m|=33792;break;case 2:e.m|=40960}I(this.a,20,160,112,function(){e.m|=129;return!!(e.m&64)})};function eb(a){a=a.i;a.D=2176;a.da=0;a.U=[4544,4544,4544,4544,4544,4544,4544,4544];a.Wa=[0,0,0,0,0,0,0,0];a.Oa=a.Xa=a.Va=a.Aa=a.Hb=0}
|
||||
function fb(a,b){var c=a.i,d,f,e;c.D&=-16513;c.da&=-2049;c.U[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.sc,drive:b,blocksize:256,mapped:0,maxblock:c.xb[0]*c.Ia[0]*c.G[0],url:"rp"+b+".dsk"});switch(c.D&63){case 5:c.vb[b]=c.na[b];c.D|=32896;c.U[b]|=32896;c.Oa|=1<<b;break;case 9:eb(a);break;case 19:c.U[b]|=64;break;case 49:if(c.na[b]>=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0]){c.Wa[b]|=1024;c.D|=49152;break}d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+
|
||||
(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;cb(a,c.T[b],d,f,e);return;case 57:if(c.na[b]>=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0])c.Wa[b]|=1024,c.D|=49152;else{d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;a.tb(c.T[b],d,f,e);return}}I(a.a,3,160,172,function(){c.D=c.D&65534|128;c.U[b]|=128;return!!(c.D&64)})}
|
||||
l.sc=function(a,b,c,d,f){var e=this.i;e.Xa=65536-f&65535;e.Va=d&65535;e.D=e.D&-769|d>>8&768;e.Aa=d>>16&63;f=~~(c/e.G[0]);d=~~(f/e.Ia[0]);e.ea[b.ka]=f%e.Ia[0]<<8|c%e.G[0];e.vb[b.ka]=e.na[b.ka]=d;e.Oa|=1<<b.ka;c>=b.mc-1&&(e.U[b.ka]|=1024);switch(a){case 1:e.da|=512;e.D|=49152;break;case 2:e.da|=2048,e.D|=49152}I(this.a,20,160,172,function(){e.U[b.ka]|=128;e.D=e.D&65534|128;return!!(e.D&64)})};l.kc=function(){this.f.m|=128;this.f.m&64&&I(this.a,0,192,64)};
|
||||
0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];l=H.prototype;
|
||||
l.La=function(a,b,c,d){this.A=b;this.a=c;this.K=d;a=Za;for(var f in a){var e=a[f];c=b;d=+f;for(var g=e[0]?e[0].bind(this):null,h=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,m=+f;m<=d;m+=2){var q=m&8191;void 0!==c.ta[q]?r("I/O address already registered: "+n(m,8,!0)):c.ta[q]=[g,h,k,e,!1]}}f=this.bc.bind(this);b.A=this.reset.bind(this);b.cb=f;C(this)};l.oc=function(){return $a(this.a)};l.Cc=function(a){ab(this.a,a&-1809|$a(this.a)&1808);this.a.F|=128};l.qc=function(){return this.c.X};
|
||||
l.Ec=function(a){var b=this;128==(this.c.X&192)&&a&64&&I(this.a,8,4,52,function(){b.c.X|=128;return!!(b.c.X&64)});this.c.X=this.c.X&128|a&-129};
|
||||
function bb(a){var b=a.h,c,d,f,e=b.W>>13&7;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.rc,drive:e,blocksize:256,mapped:0,maxblock:b.Ja[e]*b.G[e],url:"rk"+e+".dsk"});b.w&=-129;switch(b.w>>1&7){case 0:b.ib=2496;b.S=0;b.w=128;b.W=0;break;case 1:if((b.W>>4&511)>=b.Ja[e]){b.S|=32832;b.w|=49152;break}if((b.W&15)>=b.G[e]){b.S|=32800;b.w|=49152;break}c=(b.W>>4&511)*b.G[e]+(b.W&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;cb(a,b.T[e],c,d,f);return;case 2:if((b.W>>4&511)>=b.Ja[e])b.S|=32832,
|
||||
b.w|=49152;else if((b.W&15)>=b.G[e])b.S|=32800,b.w|=49152;else{c=(b.W>>4&511)*b.G[e]+(b.W&15);d=(b.w&48)<<12|b.hb;f=65536-b.jb&65535;a.tb(b.T[e],c,d,f);return}}b.ib=e<<13|b.ib&8176|b.W%9&15;I(a.a,20,5,144,function(){b.w=b.w&65534|128;return!!(b.w&64)})}l.rc=function(a,b,c,d,f){var e=this.h;e.hb=d&65535;e.w=e.w&-49|d>>12&48;e.jb=65536-f&65535;switch(a){case 1:e.S|=33024;e.w|=49152;break;case 2:e.S|=33792,e.w|=49152}I(this.a,20,5,144,function(){e.w=e.w&65534|128;return!!(e.w&64)})};
|
||||
function db(a){var b=a.i,c,d,f,e=b.m>>8&3;b.m&=-2;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.sc,drive:e,blocksize:128,mapped:1,maxblock:b.Ja[e]*b.G[e],url:"rl"+e+".dsk"});switch(b.m>>1&7){case 2:b.xa&8&&(b.m&=63);b.xa=b.cc[e]|b.Ba&64;break;case 3:1==(b.J&3)&&(b.Ba=b.J&4?b.Ba+(b.J&65408)&65408|b.J<<2&64:b.Ba-(b.J&65408)&65408|b.J<<2&64,b.J=b.Ba);break;case 4:b.xa=b.Ba;break;case 5:if(b.J>>6>=b.Ja[e]){b.m|=37888;break}if((b.J&63)>=b.G[e]){b.m|=37888;break}c=(b.J>>6)*b.G[e]+(b.J&63);
|
||||
d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;cb(a,b.T[e],c,d,f);return;case 6:if(b.J>>6>=b.Ja[e])b.m|=37888;else if((b.J&63)>=b.G[e])b.m|=37888;else{c=(b.J>>6)*b.G[e]+(b.J&63);d=(b.ua&63)<<16|b.ab;f=65536-b.xa&65535;a.tb(b.T[e],c,d,f);return}}I(a.a,20,5,112,function(){b.m|=129;return!!(b.m&64)})}
|
||||
l.sc=function(a,b,c,d,f){var e=this.i;e.ab=d&65535;e.m=e.m&-49|d>>12&48;e.ua=d>>16&63;e.J=~~(c/e.G[b.ka])<<6|c%e.G[b.ka];e.Ba=e.J;e.xa=65536-f&65535;switch(a){case 1:e.m|=33792;break;case 2:e.m|=40960}I(this.a,20,5,112,function(){e.m|=129;return!!(e.m&64)})};function eb(a){a=a.l;a.D=2176;a.da=0;a.U=[4544,4544,4544,4544,4544,4544,4544,4544];a.Wa=[0,0,0,0,0,0,0,0];a.Oa=a.Xa=a.Va=a.Aa=a.Hb=0}
|
||||
function fb(a,b){var c=a.l,d,f,e;c.D&=-16513;c.da&=-2049;c.U[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.tc,drive:b,blocksize:256,mapped:0,maxblock:c.xb[0]*c.Ia[0]*c.G[0],url:"rp"+b+".dsk"});switch(c.D&63){case 5:c.vb[b]=c.na[b];c.D|=32896;c.U[b]|=32896;c.Oa|=1<<b;break;case 9:eb(a);break;case 19:c.U[b]|=64;break;case 49:if(c.na[b]>=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0]){c.Wa[b]|=1024;c.D|=49152;break}d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+
|
||||
(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;cb(a,c.T[b],d,f,e);return;case 57:if(c.na[b]>=c.xb[0]||c.ea[b]>>8>=c.Ia[0]||(c.ea[b]&255)>=c.G[0])c.Wa[b]|=1024,c.D|=49152;else{d=(c.na[b]*c.Ia[0]+(c.ea[b]>>8))*c.G[0]+(c.ea[b]&255);f=(c.Aa&63)<<16|c.Va;e=65536-c.Xa&65535;a.tb(c.T[b],d,f,e);return}}I(a.a,3,5,172,function(){c.D=c.D&65534|128;c.U[b]|=128;return!!(c.D&64)})}
|
||||
l.tc=function(a,b,c,d,f){var e=this.l;e.Xa=65536-f&65535;e.Va=d&65535;e.D=e.D&-769|d>>8&768;e.Aa=d>>16&63;f=~~(c/e.G[0]);d=~~(f/e.Ia[0]);e.ea[b.ka]=f%e.Ia[0]<<8|c%e.G[0];e.vb[b.ka]=e.na[b.ka]=d;e.Oa|=1<<b.ka;c>=b.mc-1&&(e.U[b.ka]|=1024);switch(a){case 1:e.da|=512;e.D|=49152;break;case 2:e.da|=2048,e.D|=49152}I(this.a,20,5,172,function(){e.U[b.ka]|=128;e.D=e.D&65534|128;return!!(e.D&64)})};l.kc=function(){this.g.m|=128;this.g.m&64&&I(this.a,0,6,64)};
|
||||
function gb(a,b,c,d,f,e){var g=~~((e+c.va-1)/c.va),h=new XMLHttpRequest;2048>g&&d+2048<c.mc&&(g=2048);h.open("GET",c.url,!0);h.setRequestHeader("Range","bytes="+(d*c.va<<1)+"-"+(((d+g)*c.va<<1)-1));h.responseType="arraybuffer";h.onreadystatechange=function(){if(4==h.readyState){var g=b.bind(a),m,q,L,N;m=h.response;if(h.status&&206!=h.status||!m)c.sb(1,c,d,f,e);else{m=new Uint8Array(m);q=d;for(N=0;N<m.length;){if("undefined"===typeof c.cache[q])for(c.cache[q]=[],L=0;L<c.va;L++)c.cache[q][L]=N<m.length?
|
||||
m[N]&255|m[N+1]<<8&65280:0,N+=2;else N+=c.va<<1;q++}g(c,d,f,e)}}};h.send(null)}function J(a,b,c,d,f){if(c&1){if(!f)return K(a.a,4,122);d=0<=d?d<<8&65280|b&255:b}else 0<=d?f&&(d=b&65280|d&255):d=b;return d}l.tb=function(a,b,c,d){for(var f;0<d;){if("undefined"===typeof a.cache[b]){gb(this,this.tb,a,b,c,d);return}for(f=0;f<a.va&&0<d;f++){if(0>M(this.a,a.lc?hb(this.a,c):c,a.cache[b][f])){a.sb(2,a,b,c,d);return}c+=2;--d}b++}a.sb(0,a,b,c,d)};
|
||||
function cb(a,b,c,d,f){for(var e,g;0<f;){if("undefined"===typeof b.cache[c])for(b.cache[c]=[],e=0;e<b.va;e++)b.cache[c][e]=0;for(e=0;e<b.va&&0<f;e++){g=a.a.N(b.lc?hb(a.a,d):d);if(0>g){b.sb(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.sb(0,b,c,d,f)}l.reset=function(){this.c.Ta=this.c.Ta&-120|20;this.l.ia=0;this.l.V=128;this.f.m=0;this.g.w=128;this.h.m=128;eb(this)};
|
||||
function cb(a,b,c,d,f){for(var e,g;0<f;){if("undefined"===typeof b.cache[c])for(b.cache[c]=[],e=0;e<b.va;e++)b.cache[c][e]=0;for(e=0;e<b.va&&0<f;e++){g=a.a.N(b.lc?hb(a.a,d):d);if(0>g){b.sb(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.sb(0,b,c,d,f)}l.reset=function(){this.f.Ta=this.f.Ta&-120|20;this.c.ia=0;this.c.X=128;this.g.m=0;this.h.w=128;this.i.m=128;eb(this)};
|
||||
l.bc=function(a,b,c){var d,f,e=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.ma&65280:(a&1&&(b<<=8),e.ma=b|255,d=0);break;case 4194298:if(0>b)d=e.ub;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.ub=d;e.la=2}break;case 4194294:if(70!==e.Ka)return K(e,4,222);0>b?d=e.s:d=e.s=0;break;case 4194292:if(70!==e.Ka)return K(e,4,224);d=1;break;case 4194290:if(70!==e.Ka)return K(e,4,226);d=0;break;case 4194288:if(70!==e.Ka)return K(e,4,228);d=61183;break;case 4194296:0<=
|
||||
b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==e.Ka)return K(e,4,232);f=a-4194272>>1;0>b?d=e.Eb[f]:(d=J(this,e.Eb[f],a,b,c),0<=d&&(e.Eb[f]=d));break;case 4194254:return a&1?e.u>>14&1?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[3]=b),d=e.aa[3]):e.u>>14&0?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[1]=b),d=e.aa[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.u&2048?(0<=b&&(e.b[f]=b),d=e.b[f]):(0<=b&&(e.Na[f]=
|
||||
b),d=e.Na[f]),d;case 4194246:return a&1?(0<=b&&(e.b[7]=b),d=e.b[7]):e.u>>14&0?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[0]=b),d=e.aa[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.u&2048?(0<=b&&(e.Na[f]=b),d=e.Na[f]):(0<=b&&(e.b[f]=b),d=e.b[f]),d;default:return e.s|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;d=J(this,e.P[3][f],a,b,c);0<=d&&(e.P[3][f]=d,e.P[3][f&15]&=65295);break;case 4194112:var g=this.l;f=this.f;switch(a&-2){case 4194174:d=J(this,e.Ya,a,b,c);0<=d&&(e.Ya=d);break;case 4194172:d=
|
||||
e.ga;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194170:e.I=e.I&62337|e.eb<<5|e.rb<<1;0>b?d=e.I:(d=J(this,e.I,a,b,c),0<=d&&(e.I=d&=62337,e.eb=d>>5&3,e.rb=d>>1&15,d&257?(f=2,e.sa&16&&(f=1),e.Ua=d&1?D|E:E):(e.Ua=0,f=4),this.c.Ta=this.c.Ta&-8|f));break;case 4194168:0>b?d=this.c.zc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;case 4194166:0<=b&&(b&127&&(g.ec=0),g.V&=-129,I(e,100,128,52,function(){g.V|=128;return!!(g.V&64)}));d=0;break;case 4194164:0>b?d=g.V:(d=J(this,g.V,a,b,c),0<=d&&
|
||||
(128==(g.V&192)&&d&64&&I(e,8,128,52,function(){g.V|=128;return!!(g.V&64)}),g.V=g.V&128|d&-129));break;case 4194162:d=0;0>b&&(g.ia&=-129,0<g.Gb.length&&(d=g.Gb.shift(),0<g.Gb.length&&setTimeout(function(){g.ia|=128;g.ia&64&&I(e,40,128,48)},50)));break;case 4194160:0>b?d=g.ia:(d=J(this,g.ia,a,b,c),0<=d&&(g.ia=g.ia&128|d&-129));break;case 4194150:0>b?(d=f.m,f.m&=-129):(d=J(this,f.m,a,b,c),0<=d&&(d&64&&!f.Fb&&(setInterval(this.kc.bind(this),25),f.Fb=1),f.m=d&-129));break;default:return e.s|=16,K(e,4,
|
||||
126)}break;case 4194048:f=this.g;switch(a&-2){case 4194048:d=J(this,f.ib,a,b,c);0<=d&&(f.ib=d);break;case 4194050:d=J(this,f.S,a,b,c);0<=d&&(f.S=d);break;case 4194052:d=J(this,f.w,a,b,c);0<=b&&0<=d&&(f.w=d&-36993|f.w&36992,f.w&1&&bb(this));break;case 4194054:d=J(this,f.jb,a,b,c);0<=d&&(f.jb=d);break;case 4194056:d=J(this,f.hb,a,b,c);0<=d&&(f.hb=d);break;case 4194058:d=J(this,f.X,a,b,c);0<=d&&(f.X=d);break;case 4194060:break;case 4194062:d=J(this,f.Vb,a,b,c);0<=d&&(f.Vb=d);break;default:return e.s|=
|
||||
16,K(e,4,128)}break;case 4193728:var h=this.i;f=h.da&7;switch(a&-2){case 4193728:d=J(this,h.D,a,b,c);0<=b&&0<=d&&(h.Aa=h.Aa&60|d>>8&3,h.D=d&17279|h.D&34944|2048,d&1&&h.D&128?fb(this,f):192==(d&192)&&I(e,0,160,172));break;case 4193730:d=J(this,h.Xa,a,b,c);0<=d&&(h.Xa=d);break;case 4193732:d=J(this,h.Va,a,b,c);0<=d&&(h.Va=d&65534);break;case 4193734:d=J(this,h.ea[f],a,b,c);0<=d&&(h.ea[f]=d&7967);break;case 4193736:d=J(this,h.da,a,b,c);0<=d&&(h.da=d&63|h.da&65472,d&128&&eb(this));break;case 4193738:d=
|
||||
h.U[f];break;case 4193740:d=h.Wa[f];break;case 4193742:d=J(this,h.Oa,a,b,c);0<=d&&(h.Oa=d&255);break;case 4193744:d=h.xc[f];break;case 4193746:d=J(this,h.Wb,a,b,c);0<=d&&(h.Wb=d);break;case 4193748:d=J(this,h.Xb[f],a,b,c);0<=d&&(h.Xb[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=h.yc[f];break;case 4193754:d=J(this,h.Yb[f],a,b,c);0<=d&&(h.Yb[f]=d);break;case 4193756:d=J(this,h.na[f],a,b,c);0<=d&&(h.na[f]=d&511);break;case 4193758:h.vb[f]=h.na[f];d=h.vb[f];break;case 4193760:d=h.vc[f];break;
|
||||
case 4193762:d=h.wc[f];break;case 4193764:d=h.tc[f];break;case 4193766:d=h.uc[f];break;case 4193768:d=J(this,h.Aa,a,b,c);0<=d&&(h.Aa=d&63,h.D=h.D&-769|(d&3)<<8);break;case 4193770:d=J(this,h.Hb,a,b,c);0<=d&&(h.Hb=d);break;default:return e.s|=16,K(e,4,132)}break;case 4192512:f=this.h;switch(a&-2){case 4192512:d=J(this,f.m,a,b,c);0<=b&&0<=d&&(f.ua=f.ua&60|d>>4&3,f.m=f.m&-1023|d&1022,f.m&128||db(this));break;case 4192514:d=J(this,f.ab,a,b,c);0<=d&&(f.ab=d&65534);break;case 4192516:d=J(this,f.J,a,b,c);
|
||||
0<=d&&(f.J=d);break;case 4192518:d=J(this,f.xa,a,b,c);0<=d&&(f.xa=d);break;case 4192520:d=J(this,f.ua,a,b,c);0<=d&&(f.ua=d&63,f.m=f.m&-49|(f.ua&3)<<4);break;default:return e.s|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.sa:(d=J(this,e.sa,a,b,c),0<=d&&(70!==e.Ka&&(d&=-49),e.sa=d,e.Ma[0]=d&4?15:7,e.Ma[1]=d&2?15:7,e.Ma[3]=d&1?15:7,e.Ua&&(f=2,e.sa&16&&(f=1),this.c.Ta=this.c.Ta&-8|f)));break;default:return e.s|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;d=J(this,e.P[0][f],a,b,c);
|
||||
0<=d&&(e.P[0][f]=d,e.P[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=J(this,e.P[1][f],a,b,c);0<=d&&(e.P[1][f]=d,e.P[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.Ka)return K(e,4,234);f=a>>2&31;d=e.kb[f];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.kb[f]=a&2?d<<16|e.kb[f]&65535:e.kb[f]&4294901760|d&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Ya[a>>1&255];else return e.s|=16,K(e,4,138);break;
|
||||
default:return e.s|=16,K(e,4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var ib={},Za=(ib[65534]=[null,null,Xa.prototype.oc,Xa.prototype.Bc],ib);u(function(){for(var a=B(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Xa(d);A(d,c)}});var jb;if(Ha){var kb=new ArrayBuffer(2);(new DataView(kb)).setUint16(0,256,!0);jb=256===(new Uint16Array(kb))[0]}else jb=!1;var lb=jb;
|
||||
function H(a,b,c,d,f){this.id=mb+=2;this.a=null;this.Sa=a;this.wb=b;this.size=c||0;this.type=d||nb;this.h=d==ob;this.controller=null;Na(this);this.wa=this.fc=!1;if(c)if(f)this.controller=f,this.a=null,pb(this,f.Za);else if(Ha)this.f=new ArrayBuffer(c),this.g=new DataView(this.f,0,c),this.c=new Uint8Array(this.f,0,c),this.o=new Uint16Array(this.f,0,c>>1),this.a=new Int32Array(this.f,0,c>>2),pb(this,lb?qb:rb);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;pb(this,sb)}else pb(this)}
|
||||
var nb=0,ob=2,Ta=4,Va=["NONE","RAM","ROM","VID","H/W"],mb=0;
|
||||
H.prototype={constructor:H,parent:null,Fb:function(a){this.Sa=a},save:function(){var a,b;if(this.controller)a=null;else if(Ha)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(Ha)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.wa=!0}return!1},C:function(){return 255},v:function(){},A:function(a,b){return this.gb(a++,b++)|this.gb(a,b)<<
|
||||
8},B:function(a,b,c){this.lb(a++,b&255,c++);this.lb(a,b>>8,c)},Z:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},qa:function(a){var 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.wa=!0},Ra:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.wa=!0},O:function(a,b){return this.W(a,
|
||||
b),d=e.Na[f]),d;case 4194246:return a&1?(0<=b&&(e.b[7]=b),d=e.b[7]):e.u>>14&0?(0<=b&&(e.b[6]=b),d=e.b[6]):(0<=b&&(e.aa[0]=b),d=e.aa[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.u&2048?(0<=b&&(e.Na[f]=b),d=e.Na[f]):(0<=b&&(e.b[f]=b),d=e.b[f]),d;default:return e.s|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;d=J(this,e.P[3][f],a,b,c);0<=d&&(e.P[3][f]=d,e.P[3][f&15]&=65295);break;case 4194112:var g=this.c;f=this.g;switch(a&-2){case 4194174:d=J(this,e.Ya,a,b,c);0<=d&&(e.Ya=d);break;case 4194172:d=
|
||||
e.ga;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194170:e.I=e.I&62337|e.eb<<5|e.rb<<1;0>b?d=e.I:(d=J(this,e.I,a,b,c),0<=d&&(e.I=d&=62337,e.eb=d>>5&3,e.rb=d>>1&15,d&257?(f=2,e.sa&16&&(f=1),e.Ua=d&1?Ia|D:D):(e.Ua=0,f=4),this.f.Ta=this.f.Ta&-8|f));break;case 4194168:0>b?d=this.f.Ac&65535:(d=J(this,this.f.data,a,b,c),0<=d&&(this.f.data=d));break;case 4194166:0<=b&&(b&127&&(g.ec=0),g.X&=-129,I(e,100,4,52,function(){g.X|=128;return!!(g.X&64)}));d=0;break;case 4194164:break;case 4194162:d=0;0>b&&(g.ia&=-129,
|
||||
0<g.Gb.length&&(d=g.Gb.shift(),0<g.Gb.length&&setTimeout(function(){g.ia|=128;g.ia&64&&I(e,40,4,48)},50)));break;case 4194160:0>b?d=g.ia:(d=J(this,g.ia,a,b,c),0<=d&&(g.ia=g.ia&128|d&-129));break;case 4194150:0>b?(d=f.m,f.m&=-129):(d=J(this,f.m,a,b,c),0<=d&&(d&64&&!f.Fb&&(setInterval(this.kc.bind(this),25),f.Fb=1),f.m=d&-129));break;default:return e.s|=16,K(e,4,126)}break;case 4194048:f=this.h;switch(a&-2){case 4194048:d=J(this,f.ib,a,b,c);0<=d&&(f.ib=d);break;case 4194050:d=J(this,f.S,a,b,c);0<=d&&
|
||||
(f.S=d);break;case 4194052:d=J(this,f.w,a,b,c);0<=b&&0<=d&&(f.w=d&-36993|f.w&36992,f.w&1&&bb(this));break;case 4194054:d=J(this,f.jb,a,b,c);0<=d&&(f.jb=d);break;case 4194056:d=J(this,f.hb,a,b,c);0<=d&&(f.hb=d);break;case 4194058:d=J(this,f.W,a,b,c);0<=d&&(f.W=d);break;case 4194060:break;case 4194062:d=J(this,f.Vb,a,b,c);0<=d&&(f.Vb=d);break;default:return e.s|=16,K(e,4,128)}break;case 4193728:var h=this.l;f=h.da&7;switch(a&-2){case 4193728:d=J(this,h.D,a,b,c);0<=b&&0<=d&&(h.Aa=h.Aa&60|d>>8&3,h.D=
|
||||
d&17279|h.D&34944|2048,d&1&&h.D&128?fb(this,f):192==(d&192)&&I(e,0,5,172));break;case 4193730:d=J(this,h.Xa,a,b,c);0<=d&&(h.Xa=d);break;case 4193732:d=J(this,h.Va,a,b,c);0<=d&&(h.Va=d&65534);break;case 4193734:d=J(this,h.ea[f],a,b,c);0<=d&&(h.ea[f]=d&7967);break;case 4193736:d=J(this,h.da,a,b,c);0<=d&&(h.da=d&63|h.da&65472,d&128&&eb(this));break;case 4193738:d=h.U[f];break;case 4193740:d=h.Wa[f];break;case 4193742:d=J(this,h.Oa,a,b,c);0<=d&&(h.Oa=d&255);break;case 4193744:d=h.yc[f];break;case 4193746:d=
|
||||
J(this,h.Wb,a,b,c);0<=d&&(h.Wb=d);break;case 4193748:d=J(this,h.Xb[f],a,b,c);0<=d&&(h.Xb[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=h.zc[f];break;case 4193754:d=J(this,h.Yb[f],a,b,c);0<=d&&(h.Yb[f]=d);break;case 4193756:d=J(this,h.na[f],a,b,c);0<=d&&(h.na[f]=d&511);break;case 4193758:h.vb[f]=h.na[f];d=h.vb[f];break;case 4193760:d=h.wc[f];break;case 4193762:d=h.xc[f];break;case 4193764:d=h.uc[f];break;case 4193766:d=h.vc[f];break;case 4193768:d=J(this,h.Aa,a,b,c);0<=d&&(h.Aa=d&63,h.D=
|
||||
h.D&-769|(d&3)<<8);break;case 4193770:d=J(this,h.Hb,a,b,c);0<=d&&(h.Hb=d);break;default:return e.s|=16,K(e,4,132)}break;case 4192512:f=this.i;switch(a&-2){case 4192512:d=J(this,f.m,a,b,c);0<=b&&0<=d&&(f.ua=f.ua&60|d>>4&3,f.m=f.m&-1023|d&1022,f.m&128||db(this));break;case 4192514:d=J(this,f.ab,a,b,c);0<=d&&(f.ab=d&65534);break;case 4192516:d=J(this,f.J,a,b,c);0<=d&&(f.J=d);break;case 4192518:d=J(this,f.xa,a,b,c);0<=d&&(f.xa=d);break;case 4192520:d=J(this,f.ua,a,b,c);0<=d&&(f.ua=d&63,f.m=f.m&-49|(f.ua&
|
||||
3)<<4);break;default:return e.s|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.sa:(d=J(this,e.sa,a,b,c),0<=d&&(70!==e.Ka&&(d&=-49),e.sa=d,e.Ma[0]=d&4?15:7,e.Ma[1]=d&2?15:7,e.Ma[3]=d&1?15:7,e.Ua&&(f=2,e.sa&16&&(f=1),this.f.Ta=this.f.Ta&-8|f)));break;default:return e.s|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;d=J(this,e.P[0][f],a,b,c);0<=d&&(e.P[0][f]=d,e.P[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=J(this,e.P[1][f],a,b,c);0<=d&&(e.P[1][f]=d,e.P[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==
|
||||
e.Ka)return K(e,4,234);f=a>>2&31;d=e.kb[f];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.kb[f]=a&2?d<<16|e.kb[f]&65535:e.kb[f]&4294901760|d&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Ya[a>>1&255];else return e.s|=16,K(e,4,138);break;default:return e.s|=16,K(e,4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};
|
||||
var ib={},Za=(ib[65534]=[null,null,H.prototype.oc,H.prototype.Cc],ib[65396]=[null,null,H.prototype.qc,H.prototype.Ec],ib);u(function(){for(var a=B(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new H(d);A(d,c)}});var jb;if(Ha){var kb=new ArrayBuffer(2);(new DataView(kb)).setUint16(0,256,!0);jb=256===(new Uint16Array(kb))[0]}else jb=!1;var lb=jb;
|
||||
function G(a,b,c,d,f){this.id=mb+=2;this.a=null;this.Sa=a;this.wb=b;this.size=c||0;this.type=d||nb;this.h=d==ob;this.controller=null;Oa(this);this.wa=this.fc=!1;if(c)if(f)this.controller=f,this.a=null,pb(this,f.Za);else if(Ha)this.f=new ArrayBuffer(c),this.g=new DataView(this.f,0,c),this.c=new Uint8Array(this.f,0,c),this.o=new Uint16Array(this.f,0,c>>1),this.a=new Int32Array(this.f,0,c>>2),pb(this,lb?qb:rb);else{this.a=Array(c>>2);for(a=0;a<this.a.length;a++)this.a[a]=0;pb(this,sb)}else pb(this)}
|
||||
var nb=0,ob=2,Ua=4,Wa=["NONE","RAM","ROM","VID","H/W"],mb=0;
|
||||
G.prototype={constructor:G,parent:null,Fb:function(a){this.Sa=a},save:function(){var a,b;if(this.controller)a=null;else if(Ha)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(Ha)for(b=0;b<a.length;b++)this.g.setInt32(b<<2,a[b],!0);else this.a=a;return this.wa=!0}return!1},C:function(){return 255},v:function(){},A:function(a,b){return this.gb(a++,b++)|this.gb(a,b)<<
|
||||
8},B:function(a,b,c){this.lb(a++,b&255,c++);this.lb(a,b>>8,c)},Z:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},qa:function(a){var 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.wa=!0},Ra:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.wa=!0},O:function(a,b){return this.V(a,
|
||||
b)},ca:function(a,b){return this.oa(a,b)},Ca:function(a,b,c){this.h||this.ac(a,b,c)},Ga:function(a,b,c){this.h||this.Ha(a,b,c)},H:function(a){return this.c[a]},Y:function(a){return this.c[a]},ba:function(a){return this.g.getUint16(a,!0)},pa:function(a){return a&1?this.c[a]|this.c[a+1]<<8:this.o[a>>1]},ra:function(a,b){this.c[a]=b;this.wa=!0},Da:function(a,b){this.c[a]=b;this.wa=!0},Fa:function(a,b){this.g.setUint16(a,b,!0);this.wa=!0},Qa:function(a,b){a&1?(this.c[a]=b,this.c[a+1]=b>>8):this.o[a>>
|
||||
1]=b;this.wa=!0}};function Na(a,b,c){a.K=b;a.i=a.l=0;c&&((a.i=c.i)&&tb(a,ub,!1),(a.l=c.l)&&vb(a,ub,!1))}function vb(a,b,c){c&&a.l||(a.lb=!a.h&&b[1]||a.v,a.Cc=!a.h&&b[3]||a.B);if(c||void 0===c)a.ac=b[1]||a.v,a.Ha=b[3]||a.B}function tb(a,b,c){c&&a.i||(a.gb=b[0]||a.C,a.pc=b[2]||a.A);if(c||void 0===c)a.W=b[0]||a.C,a.oa=b[2]||a.A}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)}
|
||||
var wb=[],sb=[H.prototype.Z,H.prototype.Ea,H.prototype.qa,H.prototype.Ra],ub=[H.prototype.O,H.prototype.Ca,H.prototype.ca,H.prototype.Ga];if(Ha)var rb=[H.prototype.H,H.prototype.ra,H.prototype.ba,H.prototype.Fa],qb=[H.prototype.Y,H.prototype.Da,H.prototype.pa,H.prototype.Qa];
|
||||
1]=b;this.wa=!0}};function Oa(a,b,c){a.K=b;a.i=a.l=0;c&&((a.i=c.i)&&tb(a,ub,!1),(a.l=c.l)&&vb(a,ub,!1))}function vb(a,b,c){c&&a.l||(a.lb=!a.h&&b[1]||a.v,a.Dc=!a.h&&b[3]||a.B);if(c||void 0===c)a.ac=b[1]||a.v,a.Ha=b[3]||a.B}function tb(a,b,c){c&&a.i||(a.gb=b[0]||a.C,a.pc=b[2]||a.A);if(c||void 0===c)a.V=b[0]||a.C,a.oa=b[2]||a.A}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)}
|
||||
var wb=[],sb=[G.prototype.Z,G.prototype.Ea,G.prototype.qa,G.prototype.Ra],ub=[G.prototype.O,G.prototype.Ca,G.prototype.ca,G.prototype.Ga];if(Ha)var rb=[G.prototype.H,G.prototype.ra,G.prototype.ba,G.prototype.Fa],qb=[G.prototype.Y,G.prototype.Da,G.prototype.pa,G.prototype.Qa];
|
||||
function xb(a,b){v.call(this,"CPU",a,xb);var c=a.multiplier||1;this.Ab=a.cycles||b;this.qa=c;this.zb=Math.round(this.Ab/1E4)/100;this.oa=this.zb*this.qa;this.j.ja=!1;this.j.Zb=!1;this.j.$a=a.autoStart;this.j.Pb=!1;this.j.pb=!1;this.mb=this.pa=0;this.nb=a.csStart;this.Da=a.csInterval;this.Ea=a.csStop;this.Qa=[];this.Sb=this.Ib.bind(this);C(this)}x(xb);var yb=["power","reset"];l=xb.prototype;
|
||||
l.La=function(a,b,c,d){this.B=a;this.A=b;this.K=d;for(b=0;b<yb.length;b++)(c=this.C[yb[b]])&&this.B.fa(null,yb[b],c);this.Ca=null;a=zb(a,"autoStart");null!=a&&(this.j.$a="true"==a?!0:"false"==a?!1:!!a);C(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.za=function(a,b){if(!b){if(a&&this.restore){Ab(this);if(!this.restore(a))return!1;Bb(this)}else this.reset();this.$("No debugger detected")}Cb(this);return!0};l.ya=function(a){return a?this.save():!0};
|
||||
l.$a=function(){return this.j.$a||void 0===this.C.run?(this.Ib(),!0):!1};l.Ub=function(){return 0};function Bb(a){void 0===a.nb&&(a.nb=0);void 0===a.Da&&(a.Da=-1);void 0===a.Ea&&(a.Ea=-1);a.j.pb=0<=a.nb&&0<a.Da;a.j.pb&&(a.mb=0,a.pa=a.nb-a.ca)}
|
||||
function Db(a,b,c,d){if(a.C[b]){void 0===c&&(a.j.error=!0,a.L("Value for "+b+" is invalid"),Eb(a));var f=a.K&&a.K.c||8;if(!a.j.ja||a.j.Pb)if(8==f){f="";d?11<d&&(d=11):d=c&-65536?11:6;if(null==c||isNaN(c))for(;0<d--;)f="?"+f;else for(;0<d--;)f=String.fromCharCode((c&7)+48)+f,c>>=3;d=""+f}else d=n(c,d);else d="--------".substr(0,d||4);a.C[b].textContent!=d&&(a.C[b].textContent=d)}}
|
||||
l.fa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.C[b]=c;a=!0;break;case "run":this.C[b]=c;c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.j.M)a=!0;else{var b=null,c,h=y(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.j.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.j.M);c++);c==h.length&&(b=a);r("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.qb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.ja?Eb(d):d.Ib())};a=!0;
|
||||
break;case "speed":this.C[b]=c;a=!0;break;case "setSpeed":this.C[b]=c,c.onclick=function(){Fb(d,d.qa<<1)},c.textContent=this.oa.toFixed(2)+"Mhz",a=!0}return a};function Gb(a,b,c){a.ca+=b;c&&(a.ba=a.a=0)}function Hb(a,b){var c=1;b&&1<a.qa&&a.Y&&(c=a.Y/a.zb);a.Ob=Math.round(1E3/30);a.ob=Math.floor(a.Ab/30*c);b||(a.Fa=a.ob);a.Bb=0}function Ib(a){return a.ca+a.W+a.ba-a.a}function Ab(a){a.Y=0;a.Rb=0;a.ca=a.W=a.ba=a.a=0;Bb(a);Fb(a,1)}
|
||||
function Fb(a,b){if(void 0!==b&&(.8>a.Y/a.oa&&(b=1),a.qa=b,b=a.zb*a.qa,a.oa!=b)){a.oa=b;b=a.oa.toFixed(2)+"Mhz";var c=a.C.setSpeed;c&&(c.textContent=b);a.$("target speed: "+b)}Gb(a,a.W);a.W=0;a.O=ha();a.Z=0;Hb(a)}function Jb(a){a.ba-=a.a;a.a=0}
|
||||
break;case "speed":this.C[b]=c;a=!0;break;case "setSpeed":this.C[b]=c,c.onclick=function(){Fb(d,d.qa<<1)},c.textContent=this.oa.toFixed(2)+"Mhz",a=!0}return a};function Gb(a,b,c){a.ca+=b;c&&(a.ba=a.a=0)}function Hb(a,b){var c=1;b&&1<a.qa&&a.Y&&(c=a.Y/a.zb);a.Ob=Math.round(1E3/30);a.ob=Math.floor(a.Ab/30*c);b||(a.Fa=a.ob);a.Bb=0}function Ib(a){return a.ca+a.V+a.ba-a.a}function Ab(a){a.Y=0;a.Rb=0;a.ca=a.V=a.ba=a.a=0;Bb(a);Fb(a,1)}
|
||||
function Fb(a,b){if(void 0!==b&&(.8>a.Y/a.oa&&(b=1),a.qa=b,b=a.zb*a.qa,a.oa!=b)){a.oa=b;b=a.oa.toFixed(2)+"Mhz";var c=a.C.setSpeed;c&&(c.textContent=b);a.$("target speed: "+b)}Gb(a,a.V);a.V=0;a.O=ha();a.Z=0;Hb(a)}function Jb(a){a.ba-=a.a;a.a=0}
|
||||
l.Ib=function(){if(Fa(this,!0)){if(!this.j.ja){Fb(this);this.B&&this.B.start(this.O,Ib(this));this.j.ja=!0;this.j.Zb=!0;this.Ca&&this.Ca.start();var a=this.C.run;a&&(a.textContent="Halt");this.B&&this.B.Pa(!0)}this.Bb>=this.Ab&&Hb(this,!0);this.Ga=0;this.Ra=ha();this.Z&&(a=this.Ra-this.Z,a>this.Ob&&(this.O+=a,this.O>this.Ra&&(this.O=this.Ra)));try{do{for(var b,c=this.j.pb?1:this.ob,d=this.Qa.length-1;0<=d;d--){var f=this.Qa[d];0>f[0]||c>f[0]&&(c=f[0])}b=c;try{this.$b(b)}catch(m){if("number"!=typeof m)throw m;
|
||||
}for(var e=this.ba-this.a,a=e,g=this.Qa.length-1;0<=g;g--){var h=this.Qa[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ga+=e;this.W+=e;Gb(this,0,!0);a=e;if(this.j.pb){var k=!1;this.mb=this.mb+this.Ub()|0;this.pa-=a;0>=this.pa&&(this.pa+=this.Da,k=!0);0<=this.Ea&&this.Ea<=Ib(this)&&(this.Da=this.Ea=-1,Bb(this),Eb(this),k=!0);k&&this.$(Ib(this)+" cycles: checksum="+n(this.mb))}this.Fa-=e;if(0>=this.Fa){this.Fa+=this.ob;15<=++this.Rb&&(this.B&&this.B.Pa(),this.Rb=0);break}}while(this.j.ja)}catch(m){Eb(this);
|
||||
Cb(this);this.B&&this.B.stop(ha(),Ib(this));Fa(this,!1);b=m.stack||m.message;this.j.error=!0;this.L(b);return}b=setTimeout;c=this.Sb;this.Z=ha();d=this.Ob;this.Ga&&(d=Math.round(d*this.Ga/this.ob));d-=this.Z-this.Ra;if(f=this.Z-this.O)this.Y=Math.round(this.W/(10*f))/100,864E5<=f&&(this.ca=0,Fb(this));if(0>d||this.Y<this.oa)-1E3>d&&(this.O-=d),d=0;this.Bb+=this.Ga;this.Z+=d;b(c,d)}else Cb(this),this.B&&this.B.stop(ha(),Ib(this))};l.$b=function(){return 0};
|
||||
function Eb(a){a.j.bb&&(a.j.Cb=!0);Jb(a);Gb(a,a.W);a.W=0;if(a.j.ja){a.j.ja=!1;a.Ca&&a.Ca.stop();var b=a.C.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Cb(a){a.B&&a.B.Pa(void 0)}
|
||||
}for(var e=this.ba-this.a,a=e,g=this.Qa.length-1;0<=g;g--){var h=this.Qa[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ga+=e;this.V+=e;Gb(this,0,!0);a=e;if(this.j.pb){var k=!1;this.mb=this.mb+this.Ub()|0;this.pa-=a;0>=this.pa&&(this.pa+=this.Da,k=!0);0<=this.Ea&&this.Ea<=Ib(this)&&(this.Da=this.Ea=-1,Bb(this),Eb(this),k=!0);k&&this.$(Ib(this)+" cycles: checksum="+n(this.mb))}this.Fa-=e;if(0>=this.Fa){this.Fa+=this.ob;15<=++this.Rb&&(this.B&&this.B.Pa(),this.Rb=0);break}}while(this.j.ja)}catch(m){Eb(this);
|
||||
Cb(this);this.B&&this.B.stop(ha(),Ib(this));Fa(this,!1);b=m.stack||m.message;this.j.error=!0;this.L(b);return}b=setTimeout;c=this.Sb;this.Z=ha();d=this.Ob;this.Ga&&(d=Math.round(d*this.Ga/this.ob));d-=this.Z-this.Ra;if(f=this.Z-this.O)this.Y=Math.round(this.V/(10*f))/100,864E5<=f&&(this.ca=0,Fb(this));if(0>d||this.Y<this.oa)-1E3>d&&(this.O-=d),d=0;this.Bb+=this.Ga;this.Z+=d;b(c,d)}else Cb(this),this.B&&this.B.stop(ha(),Ib(this))};l.$b=function(){return 0};
|
||||
function Eb(a){a.j.bb&&(a.j.Cb=!0);Jb(a);Gb(a,a.V);a.V=0;if(a.j.ja){a.j.ja=!1;a.Ca&&a.Ca.stop();var b=a.C.run;b&&(b.textContent="Run")}a.j.complete=void 0}function Cb(a){a.B&&a.B.Pa(void 0)}
|
||||
function Kb(a){this.jc=a.resetAddr||0;xb.call(this,a,1E6);this.Jb=0;this.decode=Lb.bind(this);this.g=65536;this.f=32768;this.h=65535;this.c=32768;this.b=[0,0,0,0,0,0,0,this.jc];this.Na=[0,0,0,0,0,0];this.aa=[0,0,0,0];this.ma=255;this.rb=this.eb=this.Ua=this.v=this.sa=this.Ya=this.ga=this.I=this.s=this.ub=0;this.Ma=[7,7,7,7];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],[65535,65535,65535,65535,65535,65535,
|
||||
65535,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.kb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.Eb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.i=-1;this.F=0;this.Ka=70;this.ra=-1;this.o=[];this.Ha=0;this.la=2;Mb(this);this.j.complete=this.j.dc=!1}x(Kb,xb);l=Kb.prototype;
|
||||
l.reset=function(){this.j.ja&&Eb(this);Nb(this);Ab(this);this.j.error=!1;this.parent.reset.call(this)};function Nb(a){a.ma=255;a.s=0;a.o=[];a.ub=0;a.I=a.ga=a.Ya=a.sa=a.Ua=0;a.Ma[0]=a.Ma[1]=a.Ma[3]=7;a.eb=0;Mb(a)}function Mb(a){a.Ua?(a.H=65536,a.l=a.hc,a.Tb=a.R):(a.H=0,a.l=a.gc,a.Tb=a.N)}l.Ub=function(){return 0};l.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.Mb,this.ca,this.qa]);a.set(2,Wa(this.A));return a.data()};
|
||||
l.reset=function(){this.j.ja&&Eb(this);Nb(this);Ab(this);this.j.error=!1;this.parent.reset.call(this)};function Nb(a){a.ma=255;a.s=0;a.o=[];a.ub=0;a.I=a.ga=a.Ya=a.sa=a.Ua=0;a.Ma[0]=a.Ma[1]=a.Ma[3]=7;a.eb=0;Mb(a)}function Mb(a){a.Ua?(a.H=65536,a.l=a.hc,a.Tb=a.R):(a.H=0,a.l=a.gc,a.Tb=a.N)}l.Ub=function(){return 0};l.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.Mb,this.ca,this.qa]);a.set(2,Xa(this.A));return a.data()};
|
||||
l.restore=function(a){var b=a[1];this.Mb=b[0];this.ca=b[1];Fb(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],f=a[c+1];if(f&&f.length<b.B){for(var e=0,g=Array(b.B),h=0;h<f.length-1;)for(var k=f[h++],m=f[h++];k--;)g[e++]=m;f=g}e=b.c[d];if(!e||!e.restore(f)){r("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
||||
l.fa=function(a,b,c){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":this.C[b]=c;this.Jb++;a=!0;break;default:a=this.parent.fa.call(this,a,b,c)}return a};
|
||||
l.Pa=function(a){if(this.Jb&&(a||!this.j.ja||this.j.Pb)){for(a=0;a<this.b.length;a++)Db(this,"R"+a,this.b[a]);a=$a(this);Db(this,"PS",a);Db(this,"NF",a&8?1:0,1);Db(this,"ZF",a&4?1:0,1);Db(this,"VF",a&2?1:0,1);Db(this,"CF",a&1?1:0,1)}if(a=this.C.speed)a.textContent=this.j.ja&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped"};
|
||||
function I(a,b,c,d,f){for(var e=a.o.length;0<e--;)if(a.o[e].Ac===d){0<e&&(a.o[e-1].ha+=a.o[e].ha);a.o.splice(e,1);break}if(0<=b){2===a.Ha&&(b=0,a.Ha=0,setTimeout(a.Sb,0));for(e=a.o.length;0<e--;){if(a.o[e].ha>b){a.o[e].ha-=b;break}b-=a.o[e].ha}a.o.splice(e+1,0,{delay:b,priority:c&224,vector:d,callback:f})}a.la=2}function $a(a){return a.u=a.u&63728|(a.c&32768?8:0)|(a.h&65535?0:4)|(a.f&32768?2:0)|(a.g&65536?1:0)}
|
||||
function I(a,b,c,d,f){for(var e=a.o.length;0<e--;)if(a.o[e].Bc===d){0<e&&(a.o[e-1].ha+=a.o[e].ha);a.o.splice(e,1);break}if(0<=b){2===a.Ha&&(b=0,a.Ha=0,setTimeout(a.Sb,0));for(e=a.o.length;0<e--;){if(a.o[e].ha>b){a.o[e].ha-=b;break}b-=a.o[e].ha}a.o.splice(e+1,0,{delay:b,priority:c<<5&224,vector:d,callback:f})}a.la=2}function $a(a){return a.u=a.u&63728|(a.c&32768?8:0)|(a.h&65535?0:4)|(a.f&32768?2:0)|(a.g&65536?1:0)}
|
||||
function ab(a,b){a.c=b<<12;a.h=~b&4;a.f=b<<14;a.g=b<<16;if((b^a.u)&2048)for(var c=a.Na.length;0<=--c;){var d=a.b[c];a.b[c]=a.Na[c];a.Na[c]=d}a.v=b>>14&3;c=a.u>>14&3;a.v!=c&&(a.aa[c]=a.b[6],a.b[6]=a.aa[a.v]);a.la=2;a.u=b}function Ob(a,b){a.F&128||(a.c=a.h=a.g=b,a.f=0)}function P(a,b){a.F&128||(a.c=a.h=b,a.f=0)}function Pb(a,b,c,d){a.F&128||(a.c=a.h=a.g=b,a.f=(c^d)&(d^b))}
|
||||
function K(a,b,c){var d,f,e=0;0>a.ra?a.ra=$a(a):a.v||(b=4,e=1);a.I&57344||(a.ga=63222,a.Ya=b);a.v=0;0<=(d=a.R(b|65536))&&0<=(f=a.R(b+2&65535|65536))&&(ab(a,f&53247|a.ra>>2&12288),e&&(a.s|=4,a.b[6]=4),0<=Q(a,a.ra)&&0<=Q(a,a.b[7])&&(a.b[7]=d));a.F&=-113;a.ra=-1;throw b|c<<8;}function hb(a,b){var c=b>>13&31;31>c?a.sa&32&&(b=a.kb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b}
|
||||
function Qb(a,b,c){var d,f,e,g=0;if(c&a.Ua){d=b>>13&a.Ma[a.v];f=a.P[a.v][d];e=(a.P[a.v][d+16]<<6)+(b&8191)&4194303;a.sa&16?3932160<=e&&4186112>e&&(e=hb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.s|=32,K(a,4,24)),e&1&&!(c&1)&&(a.s|=64,K(a,4,26)));switch(f&7){case 1:g=4096;case 2:f|=128;c&E&&(g=8192);break;case 4:g=4096;case 5:c&E&&(g=4096);case 6:f|=c&E?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2&8128)&&
|
||||
function Qb(a,b,c){var d,f,e,g=0;if(c&a.Ua){d=b>>13&a.Ma[a.v];f=a.P[a.v][d];e=(a.P[a.v][d+16]<<6)+(b&8191)&4194303;a.sa&16?3932160<=e&&4186112>e&&(e=hb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.s|=32,K(a,4,24)),e&1&&!(c&1)&&(a.s|=64,K(a,4,26)));switch(f&7){case 1:g=4096;case 2:f|=128;c&D&&(g=8192);break;case 4:g=4096;case 5:c&D&&(g=4096);case 6:f|=c&D?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2&8128)&&
|
||||
(g|=16384));a.P[a.v][d]=f;if(4194170!==e||a.v)a.eb=a.v,a.rb=d;g&&(g&57344&&(0<=a.ra&&(g|=128),a.I&57344||(a.I=a.I|g|a.eb<<5|a.rb<<1),K(a,168,28)),a.I&61440||!(4191360>e||4194239<e)||(a.I|=4096,a.I&512&&(a.F|=32)))}else e=b&65535,57344<=e?e|=4186112:e&1&&!(c&1)&&(a.s|=64,K(a,4,22));return e}l.N=function(a){if(4194304<=a)a=this.b[a-4194304];else if(0<=a){var b=this.A,c=a&b.h,d=(a&b.i)>>>b.f;a=c!=b.h?b.c[d].pc(c,a):b.c[d++].gb(c,a)|b.c[d&b.H].gb(0,a+1)<<8}return a};
|
||||
l.R=function(a){return this.N(Qb(this,a,D))};function M(a,b,c){c&=65535;if(4194304<=b)return a.b[b-4194304]=c;if(0<=b){a=a.A;var d=c,f=b&a.h,e=(b&a.i)>>>a.f;f!=a.h?a.c[e].Cc(f,d&65535,b):(a.c[e++].lb(f,d&255,b),a.c[e&a.H].lb(0,d>>8&255,b+1));return c}return b}function R(a,b){4194304<=b?b=a.b[b-4194304]&255:0<=b&&(a=a.A,b=a.c[(b&a.i)>>>a.f].gb(b&a.h,b));return b}function S(a,b,c){c&=255;return 4194304<=b?a.b[b-4194304]=a.b[b-4194304]&65280|c:0<=b?(a=a.A,a.c[(b&a.i)>>>a.f].lb(b&a.h,c&255,b),c):b}
|
||||
function Rb(a){var b=a.R(a.b[6]|65536);0<=b&&(a.b[6]=a.b[6]+2&65535);return b}function Q(a,b){var c,d;a.b[6]=d=a.b[6]-2&65535;a.I&57344||(a.ga=a.ga<<8|246);!a.v&&d<=a.ma&&4<d&&(d<=a.ma-32?(a.s|=4,a.b[6]=4,K(a,4,32)):(a.s|=8,a.F|=4));return 0<=(c=Qb(a,d|65536,E))?M(a,c,b):c}
|
||||
function T(a,b,c){var d,f,e=b&7;switch(b>>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.v&&c&E&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32||65534<=a.b[6]?(a.s|=4,a.b[6]=4,K(a,4,36)):(a.s|=8,a.F|=64)),7===e?a.b[e]:a.b[e]|a.H;case 2:f=2;d=a.b[e];7!==e&&(d|=a.H,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.b[e];7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d;d|=a.H;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.b[e]+f&65535;7!==e&&(d|=a.H);break;case 5:f=-2;d=a.b[e]-2&65535;7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d;
|
||||
d|=a.H;break;case 6:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return d|a.H;case 7:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return 0>(d=a.R(d|65536))?d:d|a.H}a.b[e]=a.b[e]+f&65535;!a.H||a.I&57344||(a.ga=a.ga<<8|f<<3&248|e);6===e&&!a.v&&c&E&&0>=f&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32?(a.s|=4,a.b[6]=4,K(a,4,38)):(a.s|=8,a.F|=64));return d}l.gc=function(a,b){return T(this,a,b)};l.hc=function(a,b){return Qb(this,T(this,a,b),b)};
|
||||
function U(a,b){return b&56?a.Tb(T(a,b,D)):a.b[b&7]}function V(a,b){return b&56?R(a,a.l(b,Ia)):a.b[b&7]&255}function Sb(a,b,c,d){b&56?(b=a.l(b,F),M(a,b,d.call(a,c,a.N(b)))):(b&=7,a.b[b]=d.call(a,c,a.b[b])&65535)}function Tb(a,b,c,d){b&56?(b=a.l(b,G),S(a,b,d.call(a,c,R(a,b)))):(b&=7,a.b[b]=a.b[b]&65280|d.call(a,c,a.b[b])&255)}function Ub(a,b,c){b&56?M(a,a.l(b,E),c):a.b[b&7]=c&65535;return c}
|
||||
function Vb(a,b,c,d){b&56?S(a,a.l(b,Ja),c):(b&=7,a.b[b]=d?d&1?a.b[b]&-256:c<<24>>24&65535:a.b[b]&-256|c&255);return c}function W(a,b){return((b&128?b|65280:b&255)<<1)+a&65535}
|
||||
l.R=function(a){return this.N(Qb(this,a,Ia))};function M(a,b,c){c&=65535;if(4194304<=b)return a.b[b-4194304]=c;if(0<=b){a=a.A;var d=c,f=b&a.h,e=(b&a.i)>>>a.f;f!=a.h?a.c[e].Dc(f,d&65535,b):(a.c[e++].lb(f,d&255,b),a.c[e&a.H].lb(0,d>>8&255,b+1));return c}return b}function R(a,b){4194304<=b?b=a.b[b-4194304]&255:0<=b&&(a=a.A,b=a.c[(b&a.i)>>>a.f].gb(b&a.h,b));return b}function S(a,b,c){c&=255;return 4194304<=b?a.b[b-4194304]=a.b[b-4194304]&65280|c:0<=b?(a=a.A,a.c[(b&a.i)>>>a.f].lb(b&a.h,c&255,b),c):b}
|
||||
function Rb(a){var b=a.R(a.b[6]|65536);0<=b&&(a.b[6]=a.b[6]+2&65535);return b}function Q(a,b){var c,d;a.b[6]=d=a.b[6]-2&65535;a.I&57344||(a.ga=a.ga<<8|246);!a.v&&d<=a.ma&&4<d&&(d<=a.ma-32?(a.s|=4,a.b[6]=4,K(a,4,32)):(a.s|=8,a.F|=4));return 0<=(c=Qb(a,d|65536,D))?M(a,c,b):c}
|
||||
function T(a,b,c){var d,f,e=b&7;switch(b>>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.v&&c&D&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32||65534<=a.b[6]?(a.s|=4,a.b[6]=4,K(a,4,36)):(a.s|=8,a.F|=64)),7===e?a.b[e]:a.b[e]|a.H;case 2:f=2;d=a.b[e];7!==e&&(d|=a.H,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.b[e];7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d;d|=a.H;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.b[e]+f&65535;7!==e&&(d|=a.H);break;case 5:f=-2;d=a.b[e]-2&65535;7!==e&&(d|=a.H);if(0>(d=a.R(d)))return d;
|
||||
d|=a.H;break;case 6:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return d|a.H;case 7:if(0>(d=a.R(a.b[7])))return d;a.b[7]=a.b[7]+2&65535;d=d+a.b[e]&65535;return 0>(d=a.R(d|65536))?d:d|a.H}a.b[e]=a.b[e]+f&65535;!a.H||a.I&57344||(a.ga=a.ga<<8|f<<3&248|e);6===e&&!a.v&&c&D&&0>=f&&(a.b[6]<=a.ma||65534<=a.b[6])&&(a.b[6]<=a.ma-32?(a.s|=4,a.b[6]=4,K(a,4,38)):(a.s|=8,a.F|=64));return d}l.gc=function(a,b){return T(this,a,b)};l.hc=function(a,b){return Qb(this,T(this,a,b),b)};
|
||||
function U(a,b){return b&56?a.Tb(T(a,b,Ia)):a.b[b&7]}function V(a,b){return b&56?R(a,a.l(b,Ja)):a.b[b&7]&255}function Sb(a,b,c,d){b&56?(b=a.l(b,E),M(a,b,d.call(a,c,a.N(b)))):(b&=7,a.b[b]=d.call(a,c,a.b[b])&65535)}function Tb(a,b,c,d){b&56?(b=a.l(b,F),S(a,b,d.call(a,c,R(a,b)))):(b&=7,a.b[b]=a.b[b]&65280|d.call(a,c,a.b[b])&255)}function Ub(a,b,c){b&56?M(a,a.l(b,D),c):a.b[b&7]=c&65535;return c}
|
||||
function Vb(a,b,c,d){b&56?S(a,a.l(b,Ka),c):(b&=7,a.b[b]=c?d&1?c<<24>>24&65535:a.b[b]&-256|c&255:a.b[b]&-256);return c}function W(a,b){return((b&128?b|65280:b&255)<<1)+a&65535}
|
||||
l.$b=function(a){this.j.complete=!0;this.j.dc=!1;this.j.Zb=!1;this.ba=this.a=a;this.Mb&256?(Jb(this),a=!1):a=!0;if(a){do{var b,c,d,f;this.F&112&&(this.F&32?K(this,168,52):this.F&64?K(this,4,54):this.F&16&&K(this,12,56),this.F&=-113);if(this.la)if(1===this.la)this.la=2;else{this.la=0;b=-1;c=this.ub&224;if(0<(a=this.o.length))for(;0<a--;){if(0<this.o[a].ha){this.o[a].ha--;this.la=2;break}if(this.o[a].Nb){if(!this.o[a].Nb()){this.o.splice(a,1);b--;continue}this.o[a].Nb=null}this.o[a].nc>c&&(c=this.o[a].nc,
|
||||
b=a)}c>(this.u&224)&&(0>b?K(this,160,42):(K(this,this.o[b].Ac,44),this.o.splice(b,1)))}this.I&57344||(this.ga=0,this.Ya=this.b[7]);this.F=this.u&16;this.i=a=this.R(this.b[7]);0<=a&&(this.b[7]=this.b[7]+2&65535);this.decode(a);if(0>this.i)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break;case 57344:break;default:switch(a&65024){case 2048:0<=(d=T(this,
|
||||
b=a)}c>(this.u&224)&&(0>b?K(this,160,42):(K(this,this.o[b].Bc,44),this.o.splice(b,1)))}this.I&57344||(this.ga=0,this.Ya=this.b[7]);this.F=this.u&16;this.i=a=this.R(this.b[7]);0<=a&&(this.b[7]=this.b[7]+2&65535);this.decode(a);if(0>this.i)switch(a&61440){case 4096:break;case 8192:break;case 12288:break;case 16384:break;case 20480:break;case 24576:break;case 36864:break;case 40960:break;case 45056:break;case 49152:break;case 53248:break;case 57344:break;default:switch(a&65024){case 2048:0<=(d=T(this,
|
||||
a,0))&&(f=a>>6&7,0<=Q(this,this.b[f])&&(this.b[f]=this.b[7],this.b[7]=d&65535));break;case 28672:0<=(b=U(this,a))&&(f=a>>6&7,b&32768&&(b|=-65536),c=this.b[f],c&32768&&(c|=-65536),a=~~(b*c),this.b[f]=a>>16&65535,this.b[f|1]=a&65535,this.c=a>>16,this.h=this.c|a,this.g=this.f=0,-32768>a||32767<a)&&(this.g=65536);break;case 29184:0<=(b=U(this,a))&&(b?(f=a>>6&7,c=this.b[f]<<16|this.b[f|1],this.g=this.f=0,b&32768&&(b|=-65536),a=~~(c/b),-32768<=a&&32767>=a?(this.b[f]=a&65535,this.b[f|1]=c-a*b&65535,this.h=
|
||||
a>>16|a,this.c=a>>16):(this.f=32768,this.h=a>>15|a,this.c=c>>16,-1===b&&65534===this.b[f]&&(this.b[f]=this.b[f|1]=1))):(this.h=this.c=0,this.f=32768,this.g=65536));break;case 29696:0<=(b=U(this,a))&&(f=a>>6&7,a=this.b[f],a&32768&&(a|=4294901760),this.g=this.f=0,b&=63,b&32?(b=64-b,16<b&&(b=16),this.g=a<<17-b,a>>=b):b&&(16<b?(this.f=a,a=0):(this.g=a<<=b,(c=a>>15&65535)&&65535!==c&&(this.f=32768))),this.b[f]=a&65535,this.c=this.h=a);break;case 30208:if(0<=(b=U(this,a))){f=a>>6&7;c=this.b[f]<<16|this.b[f|
|
||||
1];this.g=this.f=0;b&=63;if(b&32)b=64-b,32<b&&(b=32),a=c>>b-1,this.g=a<<16,a>>=1,c&2147483648&&(a|=4294967295<<32-b);else if(b){if(a=c<<b-1,this.g=a>>15,a<<=1,32<b&&(b=32),c>>=32-b)c|=4294967295<<b&4294967295,4294967295!==c&&(this.f=32768)}else a=c;this.b[f]=a>>16&65535;this.b[f|1]=a&65535;this.c=a>>16;this.h=a>>16|a}break;case 30720:a&56?0<=(c=this.N(b=this.l(a,F)))&&(c^=this.b[a>>6&7],0<=M(this,b,c)&&(this.c=this.h=c,this.f=0)):(this.c=this.h=c=this.b[a&7]^=this.b[a>>6&7],this.f=0);break;case 32256:f=
|
||||
1];this.g=this.f=0;b&=63;if(b&32)b=64-b,32<b&&(b=32),a=c>>b-1,this.g=a<<16,a>>=1,c&2147483648&&(a|=4294967295<<32-b);else if(b){if(a=c<<b-1,this.g=a>>15,a<<=1,32<b&&(b=32),c>>=32-b)c|=4294967295<<b&4294967295,4294967295!==c&&(this.f=32768)}else a=c;this.b[f]=a>>16&65535;this.b[f|1]=a&65535;this.c=a>>16;this.h=a>>16|a}break;case 30720:a&56?0<=(c=this.N(b=this.l(a,E)))&&(c^=this.b[a>>6&7],0<=M(this,b,c)&&(this.c=this.h=c,this.f=0)):(this.c=this.h=c=this.b[a&7]^=this.b[a>>6&7],this.f=0);break;case 32256:f=
|
||||
a>>6&7;if(this.b[f]=this.b[f]-1&65535)this.b[7]=this.b[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.b[7]=W(this.b[7],a);break;case 512:this.h&65535&&(this.b[7]=W(this.b[7],a));break;case 768:this.h&65535||(this.b[7]=W(this.b[7],a));break;case 1024:(this.c&32768)===(this.f&32768)&&(this.b[7]=W(this.b[7],a));break;case 1280:(this.c&32768)!==(this.f&32768)&&(this.b[7]=W(this.b[7],a));break;case 1536:this.h&65535&&(this.c&32768)===(this.f&32768)&&(this.b[7]=W(this.b[7],a));break;case 1792:this.h&
|
||||
65535&&(this.c&32768)===(this.f&32768)||(this.b[7]=W(this.b[7],a));break;case 32768:this.c&32768||(this.b[7]=W(this.b[7],a));break;case 33280:!(this.g&65536)&&this.h&65535&&(this.b[7]=W(this.b[7],a));break;case 33024:this.c&32768&&(this.b[7]=W(this.b[7],a));break;case 33536:if(this.g&65536||!(this.h&65535))this.b[7]=W(this.b[7],a);break;case 33792:this.f&32768||(this.b[7]=W(this.b[7],a));break;case 34048:this.f&32768&&(this.b[7]=W(this.b[7],a));break;case 34304:this.g&65536||(this.b[7]=W(this.b[7],
|
||||
a));break;case 34560:this.g&65536&&(this.b[7]=W(this.b[7],a));break;case 34816:K(this,24,2);break;case 35072:K(this,28,4);break;default:switch(a&65472){case 64:0<=(d=T(this,a,0))&&(this.b[7]=d&65535);break;case 192:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c<<8|c>>8,0<=M(this,b,a)&&(this.c=this.h=c&65280,this.f=this.g=0)):(f=a&7,c=this.b[f],this.b[f]=(c<<8|c>>8)&65535,this.c=this.h=c&65280,this.f=this.g=0);break;case 2560:break;case 2624:0<=(c=this.N(b=this.l(a,F)))&&(a=~c,0<=M(this,b,a)&&(this.c=this.h=
|
||||
a,this.g=65536,this.f=0));break;case 2688:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c+1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=a&(a^c))):(f=a&7,c=this.b[f],a=c+1,this.b[f]=a&65535,this.c=this.h=a,this.f=a&(a^c));break;case 2752:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c-1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=(a^c)&c)):(f=a&7,c=this.b[f],a=c-1,this.b[f]=a&65535,this.c=this.h=a,this.f=(a^c)&c);break;case 2816:0<=(c=this.N(b=this.l(a,F)))&&(a=-c,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&c));break;
|
||||
case 2880:0<=(c=this.N(b=this.l(a,F)))&&(a=c+(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&(a^c)));break;case 2944:0<=(c=this.N(b=this.l(a,F)))&&(a=c-(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=(a^c)&c));break;case 3008:0<=(c=U(this,a))&&(this.c=this.h=c,this.g=this.f=0);break;case 3072:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=(this.g&65536|c)>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1)):(f=a&7,c=this.b[f],a=(this.g&65536|c)>>1,this.b[f]=a&
|
||||
65535,this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1);break;case 3136:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c<<1|this.g>>16&1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1|this.g>>16&1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3200:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c&32768|c>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=this.c^this.g>>1)):(f=a&7,c=this.b[f],a=c&32768|c>>1,this.b[f]=a&65535,this.g=c<<16,this.c=this.h=a,this.f=this.c^
|
||||
this.g>>1);break;case 3264:a&56?0<=(c=this.N(b=this.l(a,F)))&&(a=c<<1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3328:d=this.b[7]+((a&63)<<1)&65535;0<=(b=this.R(d|65536))&&(this.b[7]=this.b[5],this.b[5]=b,this.b[6]=d+2&65535);break;case 3392:a&56?0<=(d=T(this,a,0))&&(61440!==(this.u&61440)&&(d&=65535),this.v=this.u>>12&3,0<=(b=this.R(d))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f=0))):
|
||||
(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 3456:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(d&=65535,this.v=this.u>>12&3,0<=(b=Qb(this,d,E))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;case 3520:0<=(b=this.l(a,E))&&(a=-(this.c>>15&1),0<=M(this,
|
||||
b,a)&&(this.h=a,this.f=0));break;case 35328:break;case 35392:0<=(c=R(this,b=this.l(a,G)))&&(a=~c,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.g=65536,this.f=0));break;case 35456:0<=(c=R(this,b=this.l(a,G)))&&(a=c+1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=(a&(a^c))<<8));break;case 35520:0<=(c=R(this,b=this.l(a,G)))&&(a=c-1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=((a^c)&c)<<8));break;case 35584:0<=(c=R(this,b=this.l(a,G)))&&(a=-c,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a&c)<<8));break;
|
||||
case 35648:0<=(c=R(this,b=this.l(a,G)))&&(a=c+(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=(a&(a^c))<<8));break;case 35712:0<=(c=R(this,b=this.l(a,G)))&&(a=c-(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=((a^c)&c)<<8));break;case 35776:0<=(c=V(this,a))&&(this.c=this.h=c<<8,this.g=this.f=0);break;case 35840:0<=(c=R(this,b=this.l(a,G)))&&(a=((this.g&65536)>>8|c)>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 35904:0<=(c=
|
||||
R(this,b=this.l(a,G)))&&(a=c<<1|this.g>>16&1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 35968:0<=(c=R(this,b=this.l(a,G)))&&(a=c&128|c>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 36032:0<=(c=R(this,b=this.l(a,G)))&&(a=c<<1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 36160:a&56?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=this.R(d|65536))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f=
|
||||
0))):(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 36224:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=Qb(this,d|65536,E))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;default:switch(a&65528){case 128:0<=(b=Rb(this))&&
|
||||
a));break;case 34560:this.g&65536&&(this.b[7]=W(this.b[7],a));break;case 34816:K(this,24,2);break;case 35072:K(this,28,4);break;default:switch(a&65472){case 64:0<=(d=T(this,a,0))&&(this.b[7]=d&65535);break;case 192:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c<<8|c>>8,0<=M(this,b,a)&&(this.c=this.h=c&65280,this.f=this.g=0)):(f=a&7,c=this.b[f],this.b[f]=(c<<8|c>>8)&65535,this.c=this.h=c&65280,this.f=this.g=0);break;case 2560:break;case 2624:0<=(c=this.N(b=this.l(a,E)))&&(a=~c,0<=M(this,b,a)&&(this.c=this.h=
|
||||
a,this.g=65536,this.f=0));break;case 2688:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c+1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=a&(a^c))):(f=a&7,c=this.b[f],a=c+1,this.b[f]=a&65535,this.c=this.h=a,this.f=a&(a^c));break;case 2752:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c-1,0<=M(this,b,a)&&(this.c=this.h=a,this.f=(a^c)&c)):(f=a&7,c=this.b[f],a=c-1,this.b[f]=a&65535,this.c=this.h=a,this.f=(a^c)&c);break;case 2816:0<=(c=this.N(b=this.l(a,E)))&&(a=-c,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&c));break;
|
||||
case 2880:0<=(c=this.N(b=this.l(a,E)))&&(a=c+(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a&(a^c)));break;case 2944:0<=(c=this.N(b=this.l(a,E)))&&(a=c-(this.g>>16&1),0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=(a^c)&c));break;case 3008:0<=(c=U(this,a))&&(this.c=this.h=c,this.g=this.f=0);break;case 3072:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=(this.g&65536|c)>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1)):(f=a&7,c=this.b[f],a=(this.g&65536|c)>>1,this.b[f]=a&
|
||||
65535,this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1);break;case 3136:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c<<1|this.g>>16&1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1|this.g>>16&1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3200:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c&32768|c>>1,0<=M(this,b,a)&&(this.g=c<<16,this.c=this.h=a,this.f=this.c^this.g>>1)):(f=a&7,c=this.b[f],a=c&32768|c>>1,this.b[f]=a&65535,this.g=c<<16,this.c=this.h=a,this.f=this.c^
|
||||
this.g>>1);break;case 3264:a&56?0<=(c=this.N(b=this.l(a,E)))&&(a=c<<1,0<=M(this,b,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(f=a&7,c=this.b[f],a=c<<1,this.b[f]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3328:d=this.b[7]+((a&63)<<1)&65535;0<=(b=this.R(d|65536))&&(this.b[7]=this.b[5],this.b[5]=b,this.b[6]=d+2&65535);break;case 3392:a&56?0<=(d=T(this,a,0))&&(61440!==(this.u&61440)&&(d&=65535),this.v=this.u>>12&3,0<=(b=this.R(d))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f=0))):
|
||||
(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 3456:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(d&=65535,this.v=this.u>>12&3,0<=(b=Qb(this,d,D))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;case 3520:0<=(b=this.l(a,D))&&(a=-(this.c>>15&1),0<=M(this,
|
||||
b,a)&&(this.h=a,this.f=0));break;case 35328:break;case 35392:0<=(c=R(this,b=this.l(a,F)))&&(a=~c,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.g=65536,this.f=0));break;case 35456:0<=(c=R(this,b=this.l(a,F)))&&(a=c+1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=(a&(a^c))<<8));break;case 35520:0<=(c=R(this,b=this.l(a,F)))&&(a=c-1,0<=S(this,b,a)&&(this.c=this.h=a<<8,this.f=((a^c)&c)<<8));break;case 35584:0<=(c=R(this,b=this.l(a,F)))&&(a=-c,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a&c)<<8));break;
|
||||
case 35648:0<=(c=R(this,b=this.l(a,F)))&&(a=c+(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=(a&(a^c))<<8));break;case 35712:0<=(c=R(this,b=this.l(a,F)))&&(a=c-(this.g>>16&1),0<=S(this,b,a)&&(this.c=this.h=this.g=a<<8,this.f=((a^c)&c)<<8));break;case 35776:0<=(c=V(this,a))&&(this.c=this.h=c<<8,this.g=this.f=0);break;case 35840:0<=(c=R(this,b=this.l(a,F)))&&(a=((this.g&65536)>>8|c)>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 35904:0<=(c=
|
||||
R(this,b=this.l(a,F)))&&(a=c<<1|this.g>>16&1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 35968:0<=(c=R(this,b=this.l(a,F)))&&(a=c&128|c>>1,0<=S(this,b,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 36032:0<=(c=R(this,b=this.l(a,F)))&&(a=c<<1,0<=S(this,b,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 36160:a&56?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=this.R(d|65536))&&(this.v=this.u>>14&3,0<=Q(this,b)&&(this.c=this.h=b,this.f=
|
||||
0))):(f=a&7,b=6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]:this.aa[this.u>>12&3],0<=Q(this,b)&&(this.c=this.h=b,this.f=0));break;case 36224:0<=(c=Rb(this))&&((this.I&57344||(this.ga=22),a&56)?0<=(d=T(this,a,0))&&(this.v=this.u>>12&3,0<=(b=Qb(this,d|65536,D))&&(this.v=this.u>>14&3,0<=M(this,b,c)&&(this.c=this.h=c,this.f=0))):(f=a&7,6!==f||(this.u>>2&12288)===(this.u&12288)?this.b[f]=c:this.aa[this.u>>12&3]=c,this.c=this.h=c,this.f=0));break;default:switch(a&65528){case 128:0<=(b=Rb(this))&&
|
||||
(f=a&7,this.b[7]=this.b[f],this.b[f]=b);break;case 152:this.u&49152||(this.u=this.u&63519|(a&7)<<5,this.la=1);break;case 160:case 168:break;case 176:case 184:break;default:switch(a){case 0:49152&this.u?(this.s|=128,K(this,4,46)):(this.Ha=3,Jb(this),console.log("HALT at "+this.b[7].toString(8)));break;case 1:b=0;if(0<(a=this.o.length))for(;0<a--;)b+=this.o[a].ha,this.o[a].ha=0;0===b&&0===this.Ha&&(this.Ha=2,Jb(this));break;case 3:K(this,12,6);break;case 4:K(this,16,8);break;case 5:break;case 2:case 6:b=
|
||||
this.b[6];0<=(d=this.R(b|65536))&&(b=b+2&65535,0<=(c=this.R(b|65536))&&(this.b[6]=b+2&65535,c&=63743,this.u&49152&&(c=c&63519|this.u&63712),this.b[7]=d,ab(this,c),this.F&=-17,2===a&&(this.F|=this.u&16)));break;default:K(this,8,48)}}}}}}}while(0<this.a)}return this.j.complete?this.ba-this.a:void 0===this.j.complete?0:-1};u(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Kb(d);A(d,c)}});
|
||||
function Wb(a,b){var c=a+b;this.F&128||(this.c=this.h=this.g=c,this.f=(a^c)&(b^c));return c&65535}function Xb(a,b){a=~a&b;P(this,a);return a}function Yb(a,b){a=~a&b;P(this,a<<8);return a}function Zb(a,b){a|=b;P(this,a);return a}function $b(a,b){a|=b;P(this,a<<8);return a}function ac(a,b){var c=b-a;Pb(this,c,a,b);return c&65535}function bc(){this.i=-1;--this.a}function cc(){this.i=-1;--this.a}function X(a){a&1&&(this.g=0);a&2&&(this.f=0);a&4&&(this.h=1);a&8&&(this.c=0);--this.a}
|
||||
function dc(){this.i=-1;--this.a}function ec(){this.i=-1;--this.a}function fc(){this.i=-1;--this.a}function gc(){--this.a}function Y(a){a&1&&(this.g=65536);a&2&&(this.f=32768);a&4&&(this.h=0);a&8&&(this.c=32768);--this.a}function hc(){this.i=-1;--this.a}function ic(){this.i=-1;--this.a}function Z(){K(this,8,48)}function Lb(a){jc[a>>12].call(this,a)}
|
||||
var jc=[function(a){kc[a>>8&15].call(this,a)},function(a){P(this,Ub(this,a,U(this,a>>6)));--this.a},function(a){var b=U(this,a>>6);a=U(this,a);Pb(this,b-a,a,b);--this.a},function(a){P(this,U(this,a>>6)&U(this,a));--this.a},function(a){Sb(this,a,U(this,a>>6),Xb);--this.a},function(a){Sb(this,a,U(this,a>>6),Zb);--this.a},function(a){Sb(this,a,U(this,a>>6),Wb);--this.a},function(a){lc[a>>8&15].call(this,a)},function(a){mc[a>>8&15].call(this,a)},function(a){var b=V(this,a>>6);P(this,Vb(this,a,b,2)<<8);
|
||||
var jc=[function(a){kc[a>>8&15].call(this,a)},function(a){P(this,Ub(this,a,U(this,a>>6)));--this.a},function(a){var b=U(this,a>>6);a=U(this,a);Pb(this,b-a,a,b);--this.a},function(a){P(this,U(this,a>>6)&U(this,a));--this.a},function(a){Sb(this,a,U(this,a>>6),Xb);--this.a},function(a){Sb(this,a,U(this,a>>6),Zb);--this.a},function(a){Sb(this,a,U(this,a>>6),Wb);--this.a},function(a){lc[a>>8&15].call(this,a)},function(a){mc[a>>8&15].call(this,a)},function(a){var b=V(this,a>>6);P(this,Vb(this,a,b,1)<<8);
|
||||
--this.a},function(a){var b=V(this,a>>6)<<8;a=V(this,a)<<8;Pb(this,b-a,a,b);--this.a},function(a){P(this,(V(this,a>>6)&V(this,a))<<8);--this.a},function(a){Tb(this,a,V(this,a>>6),Yb);--this.a},function(a){Tb(this,a,V(this,a>>6),$b);--this.a},function(a){Sb(this,a,U(this,a>>6),ac);--this.a},Z],kc=[function(a){nc[a>>4&15].call(this,a)},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=
|
||||
-1;--this.a},function(){this.i=-1;--this.a},ec,ec,function(a){oc[a>>6&3].call(this,a)},function(a){pc[a>>6&3].call(this,a)},function(a){qc[a>>6&3].call(this,a)},function(a){rc[a>>6&3].call(this,a)},Z,Z],nc=[function(a){sc[a&15].call(this,a)},Z,Z,Z,Z,Z,Z,Z,Z,Z,function(a){tc[a&15].call(this,a)},function(a){uc[a&15].call(this,a)},Z,Z,Z,Z],tc=[gc,function(){this.g=0;--this.a},function(){this.f=0;--this.a},X,function(){this.h=1;--this.a},X,X,X,function(){this.c=0;--this.a},X,X,X,X,X,X,X],uc=[gc,function(){this.g=
|
||||
65536;--this.a},function(){this.f=32768;--this.a},Y,function(){this.h=0;--this.a},Y,Y,Y,function(){this.c=32768;--this.a},Y,Y,Y,Y,Y,Y,Y],sc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.u&49152||(Nb(this),this.A.reset());--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},Z,Z,Z,Z,Z,Z,Z,Z],lc=[fc,fc,dc,dc,bc,bc,cc,cc,ic,ic,Z,Z,Z,Z,hc,hc],mc=[function(){this.i=
|
||||
-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(a){vc[a>>6&3].call(this,a)},function(a){wc[a>>6&3].call(this,a)},function(a){xc[a>>6&3].call(this,a)},function(a){yc[a>>6&3].call(this,a)},Z,Z],oc=[function(a){Ob(this,Ub(this,a,0));--this.a},function(){this.i=
|
||||
-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],pc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],qc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],rc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],vc=[function(a){Ob(this,Vb(this,a,0,1));
|
||||
-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],pc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],qc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],rc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],vc=[function(a){Ob(this,Vb(this,a,0));
|
||||
--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],wc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],xc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}],yc=[function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a},function(){this.i=-1;--this.a}];
|
||||
function zc(a){v.call(this,"ROM",a,zc);this.c=null;this.l=a.addr;this.f=a.size;this.o=a.writable;this.g=a.alias;this.h=a.file;this.v=ba(this.h);if(this.h){a=this.h;var b=ca(this.v);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,e){Ac(c,a,b,e)})}}x(zc);zc.prototype.La=function(a,b,c,d){this.A=b;this.a=c;this.K=d;Bc(this)};zc.prototype.za=function(){this.i&&(this.K&&this.K.a(this.id,this.l,this.f,this.i),delete this.i);return!0};
|
||||
zc.prototype.ya=function(){return!0};
|
||||
function Ac(a,b,c,d){if(d)a.L("Unable to load system ROM (error "+d+": "+b+")");else{Da(a.Lb,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,g,h=eval("("+c+")");if(e=h.bytes)a.c=e;else if(e=h.words)for(a.c=Array(2*e.length),g=f=0;f<e.length;f++)a.c[g++]=e[f]&255,a.c[g++]=e[f]>>8&255;else if(e=h.data)for(a.c=Array(4*e.length),g=f=0;f<e.length;f++)a.c[g++]=e[f]&255,a.c[g++]=e[f]>>8&255,a.c[g++]=e[f]>>16&255,a.c[g++]=e[f]>>24&255;else a.c=h;a.i=h.symbols;if(!a.c.length){r("Empty ROM: "+b);
|
||||
return}if(1==a.c.length){r(a.c[0]);return}}catch(k){a.L("ROM data error: "+k.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.c=Array(b.length),f=0;f<b.length;f++)a.c[f]=aa(b[f]);Bc(a)}}
|
||||
function Bc(a){if(!Ga(a))if(!a.h)C(a);else if(a.c&&a.A){a.f||(a.f=a.c.length);if(a.c.length!=a.f){var b="ROM size ("+n(a.c.length,8,!0)+") does not match specified size ("+n(a.f,8,!0)+")";a.j.error=!0;a.L(b)}else{b=a.l;if(Sa(a.A,b,a.f,a.o?1:ob)){var c;for(c=0;c<a.c.length;c++){var d=a.A,f=b+c;d.c[(f&d.i)>>>d.f].ac(f&d.h,a.c[c]&255,f)}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++){for(var e=a,d=b[c],f=e.A,g=e.f,h=[],k=e.l>>>f.f;0<g&&
|
||||
function Bc(a){if(!Ga(a))if(!a.h)C(a);else if(a.c&&a.A){a.f||(a.f=a.c.length);if(a.c.length!=a.f){var b="ROM size ("+n(a.c.length,8,!0)+") does not match specified size ("+n(a.f,8,!0)+")";a.j.error=!0;a.L(b)}else{b=a.l;if(Ta(a.A,b,a.f,a.o?1:ob)){var c;for(c=0;c<a.c.length;c++){var d=a.A,f=b+c;d.c[(f&d.i)>>>d.f].ac(f&d.h,a.c[c]&255,f)}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++){for(var e=a,d=b[c],f=e.A,g=e.f,h=[],k=e.l>>>f.f;0<g&&
|
||||
k<f.c.length;)h.push(f.c[k++]),g-=f.g;f=e.A;e=e.f;g=0;for(d>>>=f.f;0<e&&d<f.c.length;){k=h[g++];if(!k)break;f.c[d++]=k;e-=f.g}}delete a.c}}C(a)}}u(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zc(d);A(d,c)}});function Cc(a){v.call(this,"RAM",a,Cc);this.g=a.addr;this.f=a.size;this.c=!1}x(Cc);l=Cc.prototype;l.La=function(a,b,c,d){this.A=b;this.a=c;this.K=d;C(this)};l.za=function(a,b){b||this.reset();return!0};l.ya=function(a){return a?this.save():!0};
|
||||
l.reset=function(){!this.c&&this.f&&Sa(this.A,this.g,this.f,1)&&(this.c=!0);this.c||r("No RAM allocated")};l.save=function(){return null};l.restore=function(){return!0};u(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Cc(d);A(d,c)}});function Dc(a){v.call(this,"Keyboard",a,Dc);C(this)}x(Dc);Dc.prototype.fa=function(){return!1};Dc.prototype.La=function(a,b,c,d){this.B=a;this.a=c;this.K=d;this.Ca=null};
|
||||
l.reset=function(){!this.c&&this.f&&Ta(this.A,this.g,this.f,1)&&(this.c=!0);this.c||r("No RAM allocated")};l.save=function(){return null};l.restore=function(){return!0};u(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Cc(d);A(d,c)}});function Dc(a){v.call(this,"Keyboard",a,Dc);C(this)}x(Dc);Dc.prototype.fa=function(){return!1};Dc.prototype.La=function(a,b,c,d){this.B=a;this.a=c;this.K=d;this.Ca=null};
|
||||
u(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Dc(d);A(d,c)}});
|
||||
function Ec(a,b,c){v.call(this,"Computer",a,Ec);this.j.M=!1;Fc(this,b);this.H=zb(this,"autoPower",a);this.g=0;this.ba=a.busWidth||a.buswidth;this.c=Gc;this.v=null;this.l=this.Y=!1;this.url=zb(this,"url")||"";(Math.random()+.1).toString(36);this.f=Hc(this);if(this.a=Ea("CPU",this.id)){this.K=Ea("Debugger",this.id);this.A=new Ma({id:this.Lb+".bus",busWidth:this.ba},this.a,this.K);var d,f=y(this.id);if((this.h=Ea("Panel",this.id))&&this.h.Db)for(b=0;b<f.length;b++)d=f[b],d.L=this.h.L,d.$=this.h.$,d.Db=
|
||||
function Ec(a,b,c){v.call(this,"Computer",a,Ec);this.j.M=!1;Fc(this,b);this.H=zb(this,"autoPower",a);this.g=0;this.ba=a.busWidth||a.buswidth;this.c=Gc;this.v=null;this.l=this.Y=!1;this.url=zb(this,"url")||"";(Math.random()+.1).toString(36);this.f=Hc(this);if(this.a=Ea("CPU",this.id)){this.K=Ea("Debugger",this.id);this.A=new Na({id:this.Lb+".bus",busWidth:this.ba},this.a,this.K);var d,f=y(this.id);if((this.h=Ea("Panel",this.id))&&this.h.Db)for(b=0;b<f.length;b++)d=f[b],d.L=this.h.L,d.$=this.h.$,d.Db=
|
||||
this.h.Db;this.$("PDP11js v1.30.0\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.$("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<f.length;b++)d=f[b],d.La&&d.La(this,this.A,this.a,this.K);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.o=d:this.c=parseInt(d,10));var e;if(a=zb(this,"state")||(e=!0,a.state))b=this.O=a,e||(this.l=!0,this.c=Gc),this.c&&(this.B=
|
||||
new O(this,"1.30.0"),Ic(this.B)?b=null:delete this.B);!b&&this.c&&(b=Jc(this))&&(this.l=!0);if(b){var g=this;p(b,null,!0,function(a,b,c){c?(g.o=null,g.l=!1,g.L("Unable to load machine state from server (error "+c+(b?": "+(String.prototype.trim?b.trim():b.replace(/^\s+|\s+$/g,"")):"")+")")):(g.v=b,g.Y=!0);C(g)})}else C(this);this.C.power||(this.H=!0);!c&&this.H&&Kc(this,this.fb)}else r("Unable to find CPU component")}x(Ec);var Gc=0;
|
||||
function Fc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.Z=b}function zb(a,b,c){var d=b.toLowerCase(),d=xa[b]||xa[d];void 0===d&&a.Z&&(d=a.Z[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Kc(a,b,c){for(var d=y(a.id),f=0;f<=d.length;f++){var e=f<d.length?d[f]:a;if(!Ga(e)){Ga(e,function(){Kc(a,b,c)});return}}b.call(a,c)}
|
||||
function Lc(a,b){var c=new O(a,"1.30.0","validate");if(Ic(c)&&Mc(c)){var d=c.get("timestamp"),f=b?b.get("timestamp"):"unknown";d!=f&&(a.L("Machine state may be out-of-date\n("+d+" vs. "+f+")\nCheck your browser's local storage limits"),b||c.clear())}}l=Ec.prototype;
|
||||
l.fb=function(a){void 0===a&&(a=this.c||(this.v?1:Gc));if(!this.g){this.g++;var b=!1,c=!1;this.W=!1;var d=this.B||new O(this,"1.30.0");if(-1==a)b=!0;else if(a>Gc){if(Ic(d,this.v)){this.i=new O(this,"1.30.0","failsafe");Ic(this.i)&&(Nc(this,d),a=2,Oc(this.i));this.i.set("timestamp",ia());Pc(this.i);var f=this.c&&!this.l;if(1==a||ja("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Mc(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?Ic(d,g):("error"==
|
||||
l.fb=function(a){void 0===a&&(a=this.c||(this.v?1:Gc));if(!this.g){this.g++;var b=!1,c=!1;this.V=!1;var d=this.B||new O(this,"1.30.0");if(-1==a)b=!0;else if(a>Gc){if(Ic(d,this.v)){this.i=new O(this,"1.30.0","failsafe");Ic(this.i)&&(Nc(this,d),a=2,Oc(this.i));this.i.set("timestamp",ia());Pc(this.i);var f=this.c&&!this.l;if(1==a||ja("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Mc(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?Ic(d,g):("error"==
|
||||
e&&"no machine state"!=g?(this.L("Error: "+g),"unable to verify user"==g&&(na("user",""),this.f=null)):this.$(e+": "+g),Oc(d),Ic(d)?(c=Mc(d),f=!0):c=!1))}f&&Lc(this,c?d:null)}else 2==a&&d.clear()}else Lc(this);delete this.v;delete this.B}f=y(this.id);for(e=0;e<f.length;e++)g=f[e],g!==this&&g!=this.a&&(c=Qc(this,g,d,b,c));b=[d,a,c];-1!=a?Kc(this,this.Qb,b):this.Qb(b)}};
|
||||
function Qc(a,b,c,d,f){if(!b.j.M){b.j.M=!0;if(b.za){var e=null;f&&((e=c.get(b.id))||(e=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof e&&(e=null);!b.za(e,d)&&e&&(r("Unable to restore state for "+b.type),a.O&&!a.Y?(c.clear(),a.c=Gc,window&&window.location.reload()):a.W=!0,b.za(null),f=!1)}if(!d&&b.Kb)for(a=b.Kb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return f}
|
||||
l.Qb=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.j.M=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.a&&(Qc(this,this.a,b,c,a),this.a.$a());this.W&&(Nc(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.g=0};
|
||||
function Qc(a,b,c,d,f){if(!b.j.M){b.j.M=!0;if(b.za){var e=null;f&&((e=c.get(b.id))||(e=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof e&&(e=null);!b.za(e,d)&&e&&(r("Unable to restore state for "+b.type),a.O&&!a.Y?(c.clear(),a.c=Gc,window&&window.location.reload()):a.V=!0,b.za(null),f=!1)}if(!d&&b.Kb)for(a=b.Kb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return f}
|
||||
l.Qb=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.j.M=!0;var d=this.C.power;d&&(d.textContent="Shutdown");this.a&&(Qc(this,this.a,b,c,a),this.a.$a());this.V&&(Nc(this,b),b.clear());!c&&this.i&&(this.i.clear(),delete this.i);this.g=0};
|
||||
function Nc(a,b){if(ja("There may be a problem with your PDP11js machine.\n\nTo help us diagnose it, click OK to send this PDP11js machine state to http://www.pcjs.org.")){var c=a.f||"";b=b.toString();var d={app:"PDP11js",ver:"1.30.0"};d.url=a.url;d.user=c;d.type="bug";d.data=b;p("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function Rc(a,b,c){var d,f="none";if(a.g)return null;a.g--;var e=new O(a,"1.30.0"),g=new O(a,"1.30.0","validate"),h=ia();g.set("timestamp",h);e.set("timestamp",h);e.set("version","1.30.0");e.set("url",window?window.location.href:null);e.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ya&&(c&&Eb(a.a),d=a.a.ya(b,c),"object"===typeof d&&e.set(a.a.id,d),c&&(a.a.j.M=!1,!1===d&&(f=null)));for(var h=y(a.id),k=0;k<h.length;k++){var m=h[k];m.j.M&&(m.ya&&(d=m.ya(b,c),"object"===typeof d&&e.set(m.id,
|
||||
d)),c&&(m.j.M=!1,!1===d&&(f=null)))}f&&(c?(h=d=!1,b?(a.f&&Sc(a,a.f,e.toString()),Pc(g)&&Pc(e)||(f=null,d=h=!0)):a.c&&(d=!0,h=3==a.c),d&&e.clear(h)):f=e.toString());c&&(a.j.M=!1,b=a.C.power)&&(b.textContent="Power");a.g=0;return f}l.reset=function(){this.A&&this.A.reset&&this.A.reset();for(var a=y(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.A&&c.reset&&c.reset()}};l.start=function(a,b){for(var c=y(this.id),d=0;d<c.length;d++){var f=c[d];"CPU"!=f.type&&f!==this&&f.start&&f.start(a,b)}};
|
||||
|
|
|
|||
Loading…
Reference in a new issue