diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index 5a96f0fe1..19cdd5328 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -127,6 +127,34 @@ PDP11.fnSUB = function(src, dst) return result & 0xffff; }; +/** + * opADC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opADC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opADCB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opADCB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + /** * opADD(opCode) * @@ -139,6 +167,118 @@ PDP11.opADD = function(opCode) this.nStepCycles -= 1; }; +/** + * opASH(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opASH = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opASHC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opASHC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opASL(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opASL = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opASLB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opASLB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opASR(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opASR = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opASRB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opASRB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBCC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBCC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBCS(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBCS = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + /** * opBIC(opCode) * @@ -211,6 +351,244 @@ PDP11.opBITB = function(opCode) this.nStepCycles -= 1; }; +/** + * opBEQ(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBEQ = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBGE(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBGE = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBGT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBGT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBHI(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBHI = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBLE(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBLE = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBLOS(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBLOS = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBLT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBLT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBMI(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBMI = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBNE(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBNE = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBPL(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBPL = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBPT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBPT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBR(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBR = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBVC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBVC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opBVS(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opBVS = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opCLR(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opCLR = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opCLRB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opCLRB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opCLx(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opCLx = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + /** * opCMP(opCode) * @@ -249,6 +627,230 @@ PDP11.opCMPB = function(opCode) this.nStepCycles -= 1; }; +/** + * opCOM(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opCOM = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opCOMB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opCOMB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opDEC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opDEC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opDECB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opDECB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opDIV(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opDIV = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opEMT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opEMT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opHALT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opHALT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opINC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opINC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opINCB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opINCB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opIOT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opIOT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opJSR(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opJSR = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMARK(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMARK = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMFPD(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMFPD = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMFPI(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMFPI = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMFPS(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMFPS = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMFPT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMFPT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + /** * opMOV(opCode) * @@ -277,6 +879,90 @@ PDP11.opMOVB = function(opCode) this.nStepCycles -= 1; }; +/** + * opMTPD(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMTPD = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMTPI(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMTPI = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMTPS(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMTPS = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opMUL(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opMUL = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opNEG(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opNEG = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opNEGB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opNEGB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + /** * opNOP(opCode) * @@ -288,6 +974,160 @@ PDP11.opNOP = function(opCode) this.nStepCycles -= 1; }; +/** + * opRESET(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opRESET = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opROL(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opROL = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opROLB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opROLB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opROR(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opROR = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opRORB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opRORB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opRTI(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opRTI = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opRTT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opRTT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opSBC(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opSBC = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opSBCB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opSBCB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opSEx(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opSEx = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opSOB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opSOB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + /** * opSUB(opCode) * @@ -300,6 +1140,101 @@ PDP11.opSUB = function(opCode) this.nStepCycles -= 1; }; +/** + * opSXT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opSXT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opTRAP(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opTRAP = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opTST(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opTST = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opTSTB(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opTSTB = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opWAIT(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opWAIT = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opXOR(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opXOR = function(opCode) +{ + /* + * TODO: Implement + */ + this.nStepCycles -= 1; +}; + +/** + * opUndefined(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.opUndefined = function(opCode) +{ + this.trap(PDP11.TRAP.RESERVED, /*010*/ 48); +}; + /** * op1170(opCode) * @@ -308,35 +1243,318 @@ PDP11.opSUB = function(opCode) */ PDP11.op1170 = function(opCode) { - PDP11.aOpsF000_1170[opCode >> 12].call(this, opCode); + PDP11.aOpsXnnn_1170[opCode >> 12].call(this, opCode); }; /** - * op0XXX_1170(opCode) + * op0Xnn_1170(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op0XXX_1170 = function(opCode) +PDP11.op0Xnn_1170 = function(opCode) { - // PDP11.aOpsF000_1170[opCode >> 12].call(this, opCode); + PDP11.aOps0Xnn_1170[(opCode >> 8) & 0xf].call(this, opCode); }; -PDP11.aOpsF000_1170 = [ - PDP11.op0XXX_1170, - PDP11.opMOV, // MOV 01SSDD - PDP11.opCMP, // CMP 02SSDD - PDP11.opBIT, // BIT 03SSDD - PDP11.opBIC, // BIC 04SSDD - PDP11.opBIS, // BIS 05SSDD - PDP11.opADD, // ADD 06SSDD - PDP11.opNOP, // 0x7XXX - PDP11.opNOP, // 0x8XXX - PDP11.opMOVB, // MOVB 11SSDD - PDP11.opCMPB, // CMPB 12SSDD - PDP11.opBITB, // BITB 13SSDD - PDP11.opBICB, // BICB 14SSDD - PDP11.opBISB, // BISB 15SSDD - PDP11.opSUB, // SUB 16SSDD - PDP11.opNOP // 0xFXXX +/** + * op0Ann_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op0Ann_1170 = function(opCode) +{ + PDP11.aOps0AXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op0Bnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op0Bnn_1170 = function(opCode) +{ + PDP11.aOps0BXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op0Cnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op0Cnn_1170 = function(opCode) +{ + PDP11.aOps0CXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op0Dnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op0Dnn_1170 = function(opCode) +{ + PDP11.aOps0DXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op00Xn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op00Xn_1170 = function(opCode) +{ + PDP11.aOps00Xn_1170[(opCode >> 4) & 0xf].call(this, opCode); +}; + +/** + * op000X_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op000X_1170 = function(opCode) +{ + PDP11.aOps000X_1170[opCode & 0xf].call(this, opCode); +}; + +/** + * op7Xnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op7Xnn_1170 = function(opCode) +{ + PDP11.aOps7Xnn_1170[(opCode >> 8) & 0xf].call(this, opCode); +}; + +/** + * op8Xnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op8Xnn_1170 = function(opCode) +{ + PDP11.aOps8Xnn_1170[(opCode >> 8) & 0xf].call(this, opCode); +}; + +/** + * op8Ann_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op8Ann_1170 = function(opCode) +{ + PDP11.aOps8AXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op8Bnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op8Bnn_1170 = function(opCode) +{ + PDP11.aOps8BXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op8Cnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op8Cnn_1170 = function(opCode) +{ + PDP11.aOps8CXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +/** + * op8Dnn_1170(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + */ +PDP11.op8Dnn_1170 = function(opCode) +{ + PDP11.aOps8DXn_1170[(opCode >> 6) & 0x3].call(this, opCode); +}; + +PDP11.aOpsXnnn_1170 = [ + PDP11.op0Xnn_1170, // 0x0nnn + PDP11.opMOV, // 0x1nnn MOV 01SSDD + PDP11.opCMP, // 0x2nnn CMP 02SSDD + PDP11.opBIT, // 0x3nnn BIT 03SSDD + PDP11.opBIC, // 0x4nnn BIC 04SSDD + PDP11.opBIS, // 0x5nnn BIS 05SSDD + PDP11.opADD, // 0x6nnn ADD 06SSDD + PDP11.op7Xnn_1170, // 0x7nnn + PDP11.op8Xnn_1170, // 0x8nnn + PDP11.opMOVB, // 0x9nnn MOVB 11SSDD + PDP11.opCMPB, // 0xAnnn CMPB 12SSDD + PDP11.opBITB, // 0xBnnn BITB 13SSDD + PDP11.opBICB, // 0xCnnn BICB 14SSDD + PDP11.opBISB, // 0xDnnn BISB 15SSDD + PDP11.opSUB, // 0xEnnn SUB 16SSDD + PDP11.opUndefined // 0xFnnn +]; + +PDP11.aOps0Xnn_1170 = [ + PDP11.op00Xn_1170, // 0x00nn + PDP11.opBR, // 0x01nn + PDP11.opBNE, // 0x02nn + PDP11.opBEQ, // 0x03nn + PDP11.opBGE, // 0x04nn + PDP11.opBLT, // 0x05nn + PDP11.opBGT, // 0x06nn + PDP11.opBLE, // 0x07nn + PDP11.opJSR, // 0x08nn + PDP11.opJSR, // 0x09nn + PDP11.op0Ann_1170, // 0x0Ann + PDP11.op0Bnn_1170, // 0x0Bnn + PDP11.op0Cnn_1170, // 0x0Cnn + PDP11.op0Dnn_1170, // 0x0Dnn + PDP11.opUndefined, // 0x0Enn + PDP11.opUndefined // 0x0Fnn +]; + +PDP11.aOps00Xn_1170 = [ + PDP11.op000X_1170, // 0x000n + PDP11.opUndefined, // 0x001n + PDP11.opUndefined, // 0x002n + PDP11.opUndefined, // 0x003n + PDP11.opUndefined, // 0x004n + PDP11.opUndefined, // 0x005n + PDP11.opUndefined, // 0x006n + PDP11.opUndefined, // 0x007n + PDP11.opUndefined, // 0x008n + PDP11.opUndefined, // 0x009n + PDP11.opCLx, // 0x00An + PDP11.opSEx, // 0x00Bn + PDP11.opUndefined, // 0x00Cn + PDP11.opUndefined, // 0x00Dn + PDP11.opUndefined, // 0x00En + PDP11.opUndefined // 0x00Fn +]; + +PDP11.aOps000X_1170 = [ + PDP11.opHALT, // 0x0000 + PDP11.opWAIT, // 0x0001 + PDP11.opRTI, // 0x0002 + PDP11.opBPT, // 0x0003 + PDP11.opIOT, // 0x0004 + PDP11.opRESET, // 0x0005 + PDP11.opRTT, // 0x0006 + PDP11.opMFPT, // 0x0007 + PDP11.opUndefined, // 0x0008 + PDP11.opUndefined, // 0x0009 + PDP11.opUndefined, // 0x000A + PDP11.opUndefined, // 0x000B + PDP11.opUndefined, // 0x000C + PDP11.opUndefined, // 0x000D + PDP11.opUndefined, // 0x000E + PDP11.opUndefined // 0x000F +]; + +PDP11.aOps7Xnn_1170 = [ + PDP11.opMUL, // 0x70nn + PDP11.opMUL, // 0x71nn + PDP11.opDIV, // 0x72nn + PDP11.opDIV, // 0x73nn + PDP11.opASH, // 0x74nn + PDP11.opASH, // 0x75nn + PDP11.opASHC, // 0x76nn + PDP11.opASHC, // 0x77nn + PDP11.opXOR, // 0x78nn + PDP11.opXOR, // 0x79nn + PDP11.opUndefined, // 0x7Ann + PDP11.opUndefined, // 0x7Bnn + PDP11.opUndefined, // 0x7Cnn + PDP11.opUndefined, // 0x7Dnn + PDP11.opSOB, // 0x7Enn + PDP11.opSOB // 0x7Fnn +]; + +PDP11.aOps8Xnn_1170 = [ + PDP11.opBPL, // 0x80nn + PDP11.opBMI, // 0x81nn + PDP11.opBHI, // 0x82nn + PDP11.opBLOS, // 0x83nn + PDP11.opBVC, // 0x84nn + PDP11.opBVS, // 0x85nn + PDP11.opBCC, // 0x86nn + PDP11.opBCS, // 0x87nn + PDP11.opEMT, // 0x88nn + PDP11.opTRAP, // 0x89nn + PDP11.op8Ann_1170, // 0x8Ann + PDP11.op8Bnn_1170, // 0x8Bnn + PDP11.op8Cnn_1170, // 0x8Cnn + PDP11.op8Dnn_1170, // 0x8Dnn + PDP11.opUndefined, // 0x8Enn + PDP11.opUndefined // 0x8Fnn +]; + +PDP11.aOps0AXn_1170 = [ + PDP11.opCLR, // 0x0A0n + PDP11.opCOM, // 0x0A4n + PDP11.opINC, // 0x0A8n + PDP11.opDEC // 0x0ACn +]; + +PDP11.aOps0BXn_1170 = [ + PDP11.opNEG, // 0x0B0n + PDP11.opADC, // 0x0B4n + PDP11.opSBC, // 0x0B8n + PDP11.opTST // 0x0BCn +]; + +PDP11.aOps0CXn_1170 = [ + PDP11.opROR, // 0x0C0n + PDP11.opROL, // 0x0C4n + PDP11.opASR, // 0x0C8n + PDP11.opASL // 0x0CCn +]; + +PDP11.aOps0DXn_1170 = [ + PDP11.opMARK, // 0x0D0n + PDP11.opMFPI, // 0x0D4n + PDP11.opMTPI, // 0x0D8n + PDP11.opSXT // 0x0DCn +]; + +PDP11.aOps8AXn_1170 = [ + PDP11.opCLRB, // 0x8A0n + PDP11.opCOMB, // 0x8A4n + PDP11.opINCB, // 0x8A8n + PDP11.opDECB // 0x8ACn +]; + +PDP11.aOps8BXn_1170 = [ + PDP11.opNEGB, // 0x8B0n + PDP11.opADCB, // 0x8B4n + PDP11.opSBCB, // 0x8B8n + PDP11.opTSTB // 0x8BCn +]; + +PDP11.aOps8CXn_1170 = [ + PDP11.opRORB, // 0x8C0n + PDP11.opROLB, // 0x8C4n + PDP11.opASRB, // 0x8C8n + PDP11.opASLB // 0x8CCn +]; + +PDP11.aOps8DXn_1170 = [ + PDP11.opMTPS, // 0x8D0n + PDP11.opMFPD, // 0x8D4n + PDP11.opMTPD, // 0x8D8n + PDP11.opMFPS // 0x8DCn ]; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 19d5783fa..b5b30fbbb 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -1449,7 +1449,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) nDebugState = 1; } - var instruction, + var opCode, src, dst, dstAddr, @@ -1530,24 +1530,27 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) */ this.opFlags = this.PSW & PDP11.PSW.TF; - this.regOp = this.readWordByVirtual(this.regsGen[7]); + /* + * TODO: Determine (later) if this.regOp is a useful (internal) register to maintain; + * perhaps it would alleviate lots of opCode parameter-passing. + */ + this.regOp = opCode = this.readWordByVirtual(this.regsGen[7]); this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff; - this.decode(this.regOp); - if (this.regOp >= 0) { - instruction = this.regOp; - this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff; + this.decode(opCode); - switch (instruction & 0xF000) /*0170000*/ { // Double operand instructions xxSSDD + if (opCode >= 0) { + // this.regsGen[7] = (this.regsGen[7] + 2) & 0xffff; + switch (opCode & 0xF000) /*0170000*/ { // Double operand instructions xxSSDD // case 0x1000: /*0010000*/ // MOV 01SSDD - // //LOG_INSTRUCTION(instruction, 2, "MOV"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if (!(instruction & 0x38)) { - // this.regsGen[instruction & 7] = src; + // //LOG_INSTRUCTION(opCode, 2, "MOV"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if (!(opCode & 0x38)) { + // this.regsGen[opCode & 7] = src; // this.flagN = this.flagZ = src; // this.flagV = 0; // } else { - // if ((dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.WRITE)) >= 0) { + // if ((dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.WRITE)) >= 0) { // if (this.writeWordByAddr(dstAddr, src) >= 0) { // this.flagN = this.flagZ = src; // this.flagV = 0; @@ -1557,9 +1560,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0x2000: /*0020000*/ // CMP 02SSDD - // //LOG_INSTRUCTION(instruction, 2, "CMP"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if ((dst = this.readWordByMode(instruction)) >= 0) { + // //LOG_INSTRUCTION(opCode, 2, "CMP"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if ((dst = this.readWordByMode(opCode)) >= 0) { // result = src - dst; // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ dst) & (src ^ result); @@ -1567,23 +1570,23 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0x3000: /*0030000*/ // BIT 03SSDD - // //LOG_INSTRUCTION(instruction, 2, "BIT"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if ((dst = this.readWordByMode(instruction)) >= 0) { + // //LOG_INSTRUCTION(opCode, 2, "BIT"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if ((dst = this.readWordByMode(opCode)) >= 0) { // this.flagN = this.flagZ = src & dst; // this.flagV = 0; // } // } // break; // case 0x4000: /*0040000*/ // BIC 04SSDD - // //LOG_INSTRUCTION(instruction, 2, "BIC"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if (!(instruction & 0x38)) { - // result = this.regsGen[instruction & 7] &= ~src; + // //LOG_INSTRUCTION(opCode, 2, "BIC"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if (!(opCode & 0x38)) { + // result = this.regsGen[opCode & 7] &= ~src; // this.flagN = this.flagZ = result; // this.flagV = 0; // } else { - // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = dst & ~src; // if (this.writeWordByAddr(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result; @@ -1594,14 +1597,14 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0x5000: /*0050000*/ // BIS 05SSDD - // //LOG_INSTRUCTION(instruction, 2, "BIS"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if (!(instruction & 0x38)) { - // result = this.regsGen[instruction & 7] |= src; + // //LOG_INSTRUCTION(opCode, 2, "BIS"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if (!(opCode & 0x38)) { + // result = this.regsGen[opCode & 7] |= src; // this.flagN = this.flagZ = result; // this.flagV = 0; // } else { - // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = dst | src; // if (this.writeWordByAddr(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result; @@ -1612,16 +1615,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0x6000: /*0060000*/ // ADD 06SSDD - // //LOG_INSTRUCTION(instruction, 2, "ADD"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if (!(instruction & 0x38)) { - // reg = instruction & 7; + // //LOG_INSTRUCTION(opCode, 2, "ADD"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if (!(opCode & 0x38)) { + // reg = opCode & 7; // dst = this.regsGen[reg]; // this.regsGen[reg] = (result = src + dst) & 0xffff; // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ result) & (dst ^ result); // } else { - // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = src + dst; // if (this.writeWordByAddr(dstAddr, result) >= 0) { // this.flagN = this.flagZ = this.flagC = result; @@ -1632,15 +1635,15 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0x9000: /*0110000*/ // MOVB 11SSDD - // //LOG_INSTRUCTION(instruction, 2, "MOVB"); - // if ((src = this.readByteByMode(instruction >> 6)) >= 0) { - // if (!(instruction & 0x38)) { + // //LOG_INSTRUCTION(opCode, 2, "MOVB"); + // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { + // if (!(opCode & 0x38)) { // if (src & 0x80) /*0200*/ src |= 0xff00; // movb sign extends register to word size - // this.regsGen[instruction & 7] = src; + // this.regsGen[opCode & 7] = src; // this.flagN = this.flagZ = src; // this.flagV = 0; // } else { - // if ((dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte + // if ((dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte // if (this.writeByteByAddr(dstAddr, src) >= 0) { // this.flagN = this.flagZ = src << 8; // this.flagV = 0; @@ -1650,9 +1653,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0xA000: /*0120000*/ // CMPB 12SSDD - // //LOG_INSTRUCTION(instruction, 2, "CMPB"); - // if ((src = this.readByteByMode(instruction >> 6)) >= 0) { - // if ((dst = this.readByteByMode(instruction)) >= 0) { + // //LOG_INSTRUCTION(opCode, 2, "CMPB"); + // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { + // if ((dst = this.readByteByMode(opCode)) >= 0) { // result = src - dst; // this.flagN = this.flagZ = this.flagC = result << 8; // this.flagV = ((src ^ dst) & (src ^ result)) << 8; @@ -1660,18 +1663,18 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0xB000: /*0130000*/ // BITB 13SSDD - // //LOG_INSTRUCTION(instruction, 2, "BITB"); - // if ((src = this.readByteByMode(instruction >> 6)) >= 0) { - // if ((dst = this.readByteByMode(instruction)) >= 0) { + // //LOG_INSTRUCTION(opCode, 2, "BITB"); + // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { + // if ((dst = this.readByteByMode(opCode)) >= 0) { // this.flagN = this.flagZ = (src & dst) << 8; // this.flagV = 0; // } // } // break; // case 0xC000: /*0140000*/ // BICB 14SSDD - // //LOG_INSTRUCTION(instruction, 2, "BICB"); - // if ((src = this.readByteByMode(instruction >> 6)) >= 0) { - // if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { + // //LOG_INSTRUCTION(opCode, 2, "BICB"); + // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { + // if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { // result = dst & ~src; // if (this.writeByteByAddr(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result << 8; @@ -1681,9 +1684,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0xD000: /*0150000*/ // BISB 15SSDD - // //LOG_INSTRUCTION(instruction, 2, "BISB"); - // if ((src = this.readByteByMode(instruction >> 6)) >= 0) { - // if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { + // //LOG_INSTRUCTION(opCode, 2, "BISB"); + // if ((src = this.readByteByMode(opCode >> 6)) >= 0) { + // if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { // result = dst | src; // if (this.writeByteByAddr(dstAddr, result) >= 0) { // this.flagN = this.flagZ = result << 8; @@ -1693,16 +1696,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; // case 0xE000: /*0160000*/ // SUB 16SSDD - // //LOG_INSTRUCTION(instruction, 2, "SUB"); - // if ((src = this.readWordByMode(instruction >> 6)) >= 0) { - // if (!(instruction & 0x38)) { - // reg = instruction & 7; + // //LOG_INSTRUCTION(opCode, 2, "SUB"); + // if ((src = this.readWordByMode(opCode >> 6)) >= 0) { + // if (!(opCode & 0x38)) { + // reg = opCode & 7; // dst = this.regsGen[reg]; // this.regsGen[reg] = (result = dst - src) & 0xffff; // this.flagN = this.flagZ = this.flagC = result; // this.flagV = (src ^ dst) & (dst ^ result); // } else { - // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= 0) { + // if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { // result = dst - src; // if (this.writeWordByAddr(dstAddr, result) >= 0) { // this.flagN = this.flagZ = this.flagC = result; @@ -1713,11 +1716,11 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // break; default: - switch (instruction & 0xFE00) /*0177000*/ { // Misc instructions xxRDD + switch (opCode & 0xFE00) /*0177000*/ { // Misc instructions xxRDD case 0x800: /*04000*/ // JSR 004RDD - //LOG_INSTRUCTION(instruction, 3, "JSR"); - if ((virtualAddress = this.getVirtualByMode(instruction, 0)) >= 0) { - reg = (instruction >> 6) & 7; + //LOG_INSTRUCTION(opCode, 3, "JSR"); + if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { + reg = (opCode >> 6) & 7; if (this.pushWord(this.regsGen[reg]) >= 0) { this.regsGen[reg] = this.regsGen[7]; this.regsGen[7] = virtualAddress & 0xffff; @@ -1725,9 +1728,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x7000: /*0070000*/ // MUL 070RSS - //LOG_INSTRUCTION(instruction, 3, "MUL"); - if ((src = this.readWordByMode(instruction)) >= 0) { - reg = (instruction >> 6) & 7; + //LOG_INSTRUCTION(opCode, 3, "MUL"); + if ((src = this.readWordByMode(opCode)) >= 0) { + reg = (opCode >> 6) & 7; if (src & 0x8000) src |= ~0xffff; dst = this.regsGen[reg]; if (dst & 0x8000) dst |= ~0xffff; @@ -1741,15 +1744,15 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x7200: /*0071000*/ // DIV 071RSS - //LOG_INSTRUCTION(instruction, 3, "DIV"); - if ((src = this.readWordByMode(instruction)) >= 0) { + //LOG_INSTRUCTION(opCode, 3, "DIV"); + if ((src = this.readWordByMode(opCode)) >= 0) { if (!src) { this.flagN = 0; // NZVC this.flagZ = 0; this.flagV = 0x8000; this.flagC = 0x10000; // divide by zero } else { - reg = (instruction >> 6) & 7; + reg = (opCode >> 6) & 7; dst = (this.regsGen[reg] << 16) | this.regsGen[reg | 1]; this.flagC = this.flagV = 0; if (src & 0x8000) src |= ~0xffff; @@ -1770,9 +1773,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x7400: /*072000*/ // ASH 072RSS - //LOG_INSTRUCTION(instruction, 3, "ASH"); - if ((src = this.readWordByMode(instruction)) >= 0) { - reg = (instruction >> 6) & 7; + //LOG_INSTRUCTION(opCode, 3, "ASH"); + if ((src = this.readWordByMode(opCode)) >= 0) { + reg = (opCode >> 6) & 7; result = this.regsGen[reg]; if (result & 0x8000) result |= 0xffff0000; this.flagC = this.flagV = 0; @@ -1800,9 +1803,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x7600: /*073000*/ // ASHC 073RSS - //LOG_INSTRUCTION(instruction, 3, "ASHC"); - if ((src = this.readWordByMode(instruction)) >= 0) { - reg = (instruction >> 6) & 7; + //LOG_INSTRUCTION(opCode, 3, "ASHC"); + if ((src = this.readWordByMode(opCode)) >= 0) { + reg = (opCode >> 6) & 7; dst = (this.regsGen[reg] << 16) | this.regsGen[reg | 1]; this.flagC = this.flagV = 0; src &= 0x3F; /*077*/ @@ -1835,14 +1838,14 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x7800: /*0074000*/ // XOR 074RSS - //LOG_INSTRUCTION(instruction, 3, "XOR"); - if (!(instruction & 0x38)) { - dst = this.regsGen[instruction & 7] ^= this.regsGen[(instruction >> 6) & 7]; + //LOG_INSTRUCTION(opCode, 3, "XOR"); + if (!(opCode & 0x38)) { + dst = this.regsGen[opCode & 7] ^= this.regsGen[(opCode >> 6) & 7]; this.flagN = this.flagZ = dst; this.flagV = 0; } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= 0) { - dst ^= this.regsGen[(instruction >> 6) & 7]; + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { + dst ^= this.regsGen[(opCode >> 6) & 7]; if (this.writeWordByAddr(dstAddr, dst) >= 0) { this.flagN = this.flagZ = dst; this.flagV = 0; @@ -1851,107 +1854,107 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x7E00: /*0077000*/ // SOB 077Rnn - //LOG_INSTRUCTION(instruction, 5, "SOB"); - reg = (instruction >> 6) & 7; + //LOG_INSTRUCTION(opCode, 5, "SOB"); + reg = (opCode >> 6) & 7; if ((this.regsGen[reg] = ((this.regsGen[reg] - 1) & 0xffff))) { - this.regsGen[7] = (this.regsGen[7] - ((instruction & 0x3F) /*077*/ << 1)) & 0xffff; + this.regsGen[7] = (this.regsGen[7] - ((opCode & 0x3F) /*077*/ << 1)) & 0xffff; } break; default: - switch (instruction & 0xFF00) /*0177400*/ { // Program control instructions & traps + switch (opCode & 0xFF00) /*0177400*/ { // Program control instructions & traps case 0x100: /*0000400*/ // BR - //LOG_INSTRUCTION(instruction, 4, "BR"); - this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BR"); + this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x200: /*0001000*/ // BNE - //LOG_INSTRUCTION(instruction, 4, "BNE"); - if (this.flagZ & 0xffff) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BNE"); + if (this.flagZ & 0xffff) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x300: /*0001400*/ // BEQ - //LOG_INSTRUCTION(instruction, 4, "BEQ"); - if (!(this.flagZ & 0xffff)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BEQ"); + if (!(this.flagZ & 0xffff)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x400: /*0002000*/ // BGE - //LOG_INSTRUCTION(instruction, 4, "BGE"); + //LOG_INSTRUCTION(opCode, 4, "BGE"); if ((this.flagN & 0x8000) === - (this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + (this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x500: /*0002400*/ // BLT - //LOG_INSTRUCTION(instruction, 4, "BLT"); + //LOG_INSTRUCTION(opCode, 4, "BLT"); if ((this.flagN & 0x8000) !== - (this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + (this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x600: /*0003000*/ // BGT - //LOG_INSTRUCTION(instruction, 4, "BGT"); + //LOG_INSTRUCTION(opCode, 4, "BGT"); if ((this.flagZ & 0xffff) && ((this.flagN & 0x8000) === - (this.flagV & 0x8000))) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + (this.flagV & 0x8000))) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x700: /*0003400*/ // BLE - //LOG_INSTRUCTION(instruction, 4, "BLE"); + //LOG_INSTRUCTION(opCode, 4, "BLE"); if (!(this.flagZ & 0xffff) || ((this.flagN & 0x8000) !== - (this.flagV & 0x8000))) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + (this.flagV & 0x8000))) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8000: /*0100000*/ // BPL - //LOG_INSTRUCTION(instruction, 4, "BPL"); - if (!(this.flagN & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BPL"); + if (!(this.flagN & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8200: /*0101000*/ // BHI - //LOG_INSTRUCTION(instruction, 4, "BHI"); + //LOG_INSTRUCTION(opCode, 4, "BHI"); if (!(this.flagC & 0x10000) && - (this.flagZ & 0xffff)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + (this.flagZ & 0xffff)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8100: /*0100400*/ // BMI - //LOG_INSTRUCTION(instruction, 4, "BMI"); - if ((this.flagN & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BMI"); + if ((this.flagN & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8300: /*0101400*/ // BLOS - //LOG_INSTRUCTION(instruction, 4, "BLOS"); + //LOG_INSTRUCTION(opCode, 4, "BLOS"); if ((this.flagC & 0x10000) || - !(this.flagZ & 0xffff)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + !(this.flagZ & 0xffff)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8400: /*0102000*/ // BVC - //LOG_INSTRUCTION(instruction, 4, "BVC"); - if (!(this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BVC"); + if (!(this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8500: /*0102400*/ // BVS - //LOG_INSTRUCTION(instruction, 4, "BVS"); - if ((this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BVS"); + if ((this.flagV & 0x8000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8600: /*0103000*/ // BCC - //LOG_INSTRUCTION(instruction, 4, "BCC"); + //LOG_INSTRUCTION(opCode, 4, "BCC"); if (!(this.flagC & - 0x10000)) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + 0x10000)) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8700: /*0103400*/ // BCS - //LOG_INSTRUCTION(instruction, 4, "BCS"); - if (this.flagC & 0x10000) this.regsGen[7] = this.branch(this.regsGen[7], instruction); + //LOG_INSTRUCTION(opCode, 4, "BCS"); + if (this.flagC & 0x10000) this.regsGen[7] = this.branch(this.regsGen[7], opCode); break; case 0x8800: /*0104000*/ // EMT 104000 -> 104377 - //LOG_INSTRUCTION(instruction, 7, "EMT"); + //LOG_INSTRUCTION(opCode, 7, "EMT"); this.trap(PDP11.TRAP.EMULATOR, /*030*/ 2); break; case 0x8900: /*0104400*/ // TRAP 104400 -> 104777 - //LOG_INSTRUCTION(instruction, 7, "TRAP"); + //LOG_INSTRUCTION(opCode, 7, "TRAP"); this.trap(PDP11.TRAP.TRAP, /*034*/ 4); break; default: - switch (instruction & 0xFFC0) /*0177700*/ { // Single operand instructions xxxxDD + switch (opCode & 0xFFC0) /*0177700*/ { // Single operand instructions xxxxDD case 0x40: /*0000100*/ // JMP 0001DD - //LOG_INSTRUCTION(instruction, 1, "JMP"); - if ((virtualAddress = this.getVirtualByMode(instruction, 0)) >= 0) { + //LOG_INSTRUCTION(opCode, 1, "JMP"); + if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { this.regsGen[7] = virtualAddress & 0xffff; } break; case 0xC0: /*0000300*/ // SWAB 0003DD - //LOG_INSTRUCTION(instruction, 1, "SWAB"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "SWAB"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; this.regsGen[reg] = ((dst << 8) | (dst >> 8)) & 0xffff; this.flagN = this.flagZ = dst & 0xff00; this.flagV = this.flagC = 0; } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = (dst << 8) | (dst >> 8); if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -1962,12 +1965,12 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xA00: /*0005000*/ // CLR 0050DD - //LOG_INSTRUCTION(instruction, 1, "CLR"); - if (!(instruction & 0x38)) { - this.regsGen[instruction & 7] = 0; + //LOG_INSTRUCTION(opCode, 1, "CLR"); + if (!(opCode & 0x38)) { + this.regsGen[opCode & 7] = 0; this.flagN = this.flagC = this.flagV = this.flagZ = 0; } else { - if ((dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.WRITE)) >= 0) { // write word + if ((dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.WRITE)) >= 0) { // write word if (this.writeWordByAddr(dstAddr, 0) >= 0) { this.flagN = this.flagC = this.flagV = this.flagZ = 0; } @@ -1975,8 +1978,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xA40: /*0005100*/ // COM 0051DD - //LOG_INSTRUCTION(instruction, 1, "COM"); - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + //LOG_INSTRUCTION(opCode, 1, "COM"); + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = ~dst; if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -1987,16 +1990,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xA80: /*0005200*/ // INC 0052DD - //LOG_INSTRUCTION(instruction, 1, "INC"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "INC"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; result = dst + 1; this.regsGen[reg] = result & 0xffff; this.flagN = this.flagZ = result; this.flagV = result & (result ^ dst); } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst + 1; if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2007,16 +2010,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xAC0: /*0005300*/ // DEC 0053DD - //LOG_INSTRUCTION(instruction, 1, "DEC"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "DEC"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; result = dst - 1; this.regsGen[reg] = result & 0xffff; this.flagN = this.flagZ = result; this.flagV = (result ^ dst) & dst; } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst - 1; if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2027,8 +2030,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xB00: /*0005400*/ // NEG 0054DD - //LOG_INSTRUCTION(instruction, 1, "NEG"); - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + //LOG_INSTRUCTION(opCode, 1, "NEG"); + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = -dst; if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2038,8 +2041,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xB40: /*0005500*/ // ADC 0055DD - //LOG_INSTRUCTION(instruction, 1, "ADC"); - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + //LOG_INSTRUCTION(opCode, 1, "ADC"); + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst + ((this.flagC >> 16) & 1); if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2049,8 +2052,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xB80: /*0005600*/ // SBC 0056DD - //LOG_INSTRUCTION(instruction, 1, "SBC"); - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + //LOG_INSTRUCTION(opCode, 1, "SBC"); + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst - ((this.flagC >> 16) & 1); if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2060,16 +2063,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xBC0: /*0005700*/ // TST 0057DD - //LOG_INSTRUCTION(instruction, 1, "TST"); - if ((dst = this.readWordByMode(instruction)) >= 0) { + //LOG_INSTRUCTION(opCode, 1, "TST"); + if ((dst = this.readWordByMode(opCode)) >= 0) { this.flagN = this.flagZ = dst; this.flagC = this.flagV = 0; } break; case 0xC00: /*0006000*/ // ROR 0060DD - //LOG_INSTRUCTION(instruction, 1, "ROR"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "ROR"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; result = ((this.flagC & 0x10000) | dst) >> 1; this.regsGen[reg] = result & 0xffff; @@ -2077,7 +2080,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = result; this.flagV = result ^ (this.flagC >> 1); } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = ((this.flagC & 0x10000) | dst) >> 1; if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2089,16 +2092,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xC40: /*0006100*/ // ROL 0061DD - //LOG_INSTRUCTION(instruction, 1, "ROL"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "ROL"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; result = (dst << 1) | ((this.flagC >> 16) & 1); this.regsGen[reg] = result & 0xffff; this.flagC = this.flagN = this.flagZ = result; this.flagV = result ^ dst; } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = (dst << 1) | ((this.flagC >> 16) & 1); if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2109,9 +2112,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xC80: /*0006200*/ // ASR 0062DD - //LOG_INSTRUCTION(instruction, 1, "ASR"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "ASR"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; result = (dst & 0x8000) | (dst >> 1); this.regsGen[reg] = result & 0xffff; @@ -2119,7 +2122,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = result; this.flagV = this.flagN ^ (this.flagC >> 1); } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = (dst & 0x8000) | (dst >> 1); if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2131,16 +2134,16 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xCC0: /*0006300*/ // ASL 0063DD - //LOG_INSTRUCTION(instruction, 1, "ASL"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "ASL"); + if (!(opCode & 0x38)) { + reg = opCode & 7; dst = this.regsGen[reg]; result = dst << 1; this.regsGen[reg] = result & 0xffff; this.flagC = this.flagN = this.flagZ = result; this.flagV = result ^ dst; } else { - if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE))) >= + if ((dst = this.readWordByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE))) >= 0) { result = dst << 1; if (this.writeWordByAddr(dstAddr, result) >= 0) { @@ -2151,8 +2154,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xD00: /*0006400*/ // MARK 0064nn - //LOG_INSTRUCTION(instruction, 8, "MARK"); - virtualAddress = (this.regsGen[7] + ((instruction & 0x3F) /*077*/ << 1)) & 0xffff; + //LOG_INSTRUCTION(opCode, 8, "MARK"); + virtualAddress = (this.regsGen[7] + ((opCode & 0x3F) /*077*/ << 1)) & 0xffff; if ((src = this.readWordByVirtual(virtualAddress | 0x10000)) >= 0) { this.regsGen[7] = this.regsGen[5]; this.regsGen[5] = src; @@ -2160,9 +2163,9 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xD40: /*0006500*/ // MFPI 0065SS - //LOG_INSTRUCTION(instruction, 1, "MFPI"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "MFPI"); + if (!(opCode & 0x38)) { + reg = opCode & 7; if (6 !== reg || ((this.PSW >> 2) & 0x3000) === (this.PSW & 0x3000)) { src = this.regsGen[reg]; } else { @@ -2173,7 +2176,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagV = 0; } } else { - if ((virtualAddress = this.getVirtualByMode(instruction, 0)) >= 0) { + 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) { @@ -2187,11 +2190,11 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xD80: /*0006600*/ // MTPI 0066DD - //LOG_INSTRUCTION(instruction, 1, "MTPI"); + //LOG_INSTRUCTION(opCode, 1, "MTPI"); if ((dst = this.popWord()) >= 0) { if (!(this.MMR0 & 0xe000)) this.MMR1 = 0x16; /*026*/ - if (!(instruction & 0x38)) { - reg = instruction & 7; + if (!(opCode & 0x38)) { + reg = opCode & 7; if (6 !== reg || ((this.PSW >> 2) & 0x3000) === (this.PSW & 0x3000)) { this.regsGen[reg] = dst; } else { @@ -2200,7 +2203,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = dst; this.flagV = 0; } else { - if ((virtualAddress = this.getVirtualByMode(instruction, 0)) >= 0) { + if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { virtualAddress &= 0xffff; this.mmuMode = (this.PSW >> 12) & 3; if ((dstAddr = this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.WRITE)) >= 0) { @@ -2215,8 +2218,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0xDC0: /*0006700*/ // SXT 0067DD - //LOG_INSTRUCTION(instruction, 1, "SXT"); - if ((dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.WRITE)) >= 0) { // write word + //LOG_INSTRUCTION(opCode, 1, "SXT"); + if ((dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.WRITE)) >= 0) { // write word result = -((this.flagN >> 15) & 1); if (this.writeWordByAddr(dstAddr, result) >= 0) { this.flagZ = result; @@ -2225,12 +2228,12 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8A00: /*0105000*/ // CLRB 1050DD - //LOG_INSTRUCTION(instruction, 1, "CLRB"); - if (!(instruction & 0x38)) { - this.regsGen[instruction & 7] &= 0xff00; + //LOG_INSTRUCTION(opCode, 1, "CLRB"); + if (!(opCode & 0x38)) { + this.regsGen[opCode & 7] &= 0xff00; this.flagN = this.flagC = this.flagV = this.flagZ = 0; } else { - if ((dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte + if ((dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte if (this.writeByteByAddr(dstAddr, 0) >= 0) { this.flagN = this.flagC = this.flagV = this.flagZ = 0; } @@ -2238,8 +2241,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8A40: /*0105100*/ // COMB 1051DD - //LOG_INSTRUCTION(instruction, 1, "COMB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "COMB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = ~dst; if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2250,8 +2253,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8A80: /*0105200*/ // INCB 1052DD - //LOG_INSTRUCTION(instruction, 1, "INCB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "INCB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst + 1; if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2261,8 +2264,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8AC0: /*0105300*/ // DECB 1053DD - //LOG_INSTRUCTION(instruction, 1, "DECB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "DECB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst - 1; if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2272,8 +2275,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8B00: /*0105400*/ // NEGB 1054DD - //LOG_INSTRUCTION(instruction, 1, "NEGB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "NEGB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = -dst; if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2283,8 +2286,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8B40: /*0105500*/ // ADCB 01055DD - //LOG_INSTRUCTION(instruction, 1, "ADCB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "ADCB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst + ((this.flagC >> 16) & 1); if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2294,8 +2297,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8B80: /*0105600*/ // SBCB 01056DD - //LOG_INSTRUCTION(instruction, 1, "SBCB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "SBCB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst - ((this.flagC >> 16) & 1); if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2305,15 +2308,15 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8BC0: /*0105700*/ // TSTB 1057DD - //LOG_INSTRUCTION(instruction, 1, "TSTB"); - if ((dst = this.readByteByMode(instruction)) >= 0) { + //LOG_INSTRUCTION(opCode, 1, "TSTB"); + if ((dst = this.readByteByMode(opCode)) >= 0) { this.flagN = this.flagZ = dst << 8; this.flagC = this.flagV = 0; } break; case 0x8C00: /*0106000*/ // RORB 1060DD - //LOG_INSTRUCTION(instruction, 1, "RORB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "RORB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = (((this.flagC & 0x10000) >> 8) | dst) >> 1; if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2324,8 +2327,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8C40: /*0106100*/ // ROLB 1061DD - //LOG_INSTRUCTION(instruction, 1, "ROLB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "ROLB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = (dst << 1) | ((this.flagC >> 16) & 1); if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2335,8 +2338,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8C80: /*0106200*/ // ASRB 1062DD - //LOG_INSTRUCTION(instruction, 1, "ASRB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "ASRB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = (dst & 0x80) | (dst >> 1); if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2347,8 +2350,8 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8CC0: /*0106300*/ // ASLB 1063DD - //LOG_INSTRUCTION(instruction, 1, "ASLB"); - if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.UPDATE_BYTE))) >= + //LOG_INSTRUCTION(opCode, 1, "ASLB"); + if ((dst = this.readByteByAddr(dstAddr = this.getAddrByMode(opCode, PDP11.ACCESS.UPDATE_BYTE))) >= 0) { result = dst << 1; if (this.writeByteByAddr(dstAddr, result) >= 0) { @@ -2358,15 +2361,15 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; //case 0106400: // MTPS 1064SS - // //LOG_INSTRUCTION(instruction, 1, "MTPS"); + // //LOG_INSTRUCTION(opCode, 1, "MTPS"); // if ((src = this.readByteByMode(instruction)) >= 0) { // this.setPSW((this.PSW & 0xff00) | (src & 0xef)); // } // Temporary PDP 11/34A // break; case 0x8D40: /*0106500*/ // MFPD 1065DD - //LOG_INSTRUCTION(instruction, 1, "MFPD"); - if (!(instruction & 0x38)) { - reg = instruction & 7; + //LOG_INSTRUCTION(opCode, 1, "MFPD"); + if (!(opCode & 0x38)) { + reg = opCode & 7; if (6 !== reg || ((this.PSW >> 2) & 0x3000) === (this.PSW & 0x3000)) { src = this.regsGen[reg]; } else { @@ -2377,7 +2380,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagV = 0; } } else { - if ((virtualAddress = this.getVirtualByMode(instruction, 0)) >= 0) { + if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { this.mmuMode = (this.PSW >> 12) & 3; if ((src = this.readWordByVirtual(virtualAddress | 0x10000)) >= 0) { this.mmuMode = (this.PSW >> 14) & 3; @@ -2390,11 +2393,11 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x8D80: /*0106600*/ // MTPD 1066DD - //LOG_INSTRUCTION(instruction, 1, "MTPD"); + //LOG_INSTRUCTION(opCode, 1, "MTPD"); if ((dst = this.popWord()) >= 0) { if (!(this.MMR0 & 0xe000)) this.MMR1 = 0x16; /*026*/ - if (!(instruction & 0x38)) { - reg = instruction & 7; + if (!(opCode & 0x38)) { + reg = opCode & 7; if (6 !== reg || ((this.PSW >> 2) & 0x3000) === (this.PSW & 0x3000)) { this.regsGen[reg] = dst; } else { @@ -2403,7 +2406,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.flagN = this.flagZ = dst; this.flagV = 0; } else { - if ((virtualAddress = this.getVirtualByMode(instruction, 0)) >= 0) { + if ((virtualAddress = this.getVirtualByMode(opCode, 0)) >= 0) { this.mmuMode = (this.PSW >> 12) & 3; if ((dstAddr = this.mapVirtualToPhysical(virtualAddress | 0x10000, PDP11.ACCESS.WRITE)) >= 0) { @@ -2418,7 +2421,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; //case 0106700: // MTFS 1064SS - // //LOG_INSTRUCTION(instruction, 1, "MFPS"); + // //LOG_INSTRUCTION(opCode, 1, "MFPS"); // src = this.getPSW() & 0xff; // if (instruction & 0x38) { // if ((dstAddr = this.getAddrByMode(instruction, PDP11.ACCESS.WRITE_BYTE)) >= 0) { // write byte @@ -2435,40 +2438,40 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) // } // Temporary PDP 11/34A // break; default: - switch (instruction & 0xFFF8) /*0177770*/ { // Single register instructions xxxxxR (and CC) + switch (opCode & 0xFFF8) /*0177770*/ { // Single register instructions xxxxxR (and CC) case 0x80: /*0000200*/ // RTS 00020R - //LOG_INSTRUCTION(instruction, 6, "RTS"); + //LOG_INSTRUCTION(opCode, 6, "RTS"); if ((src = this.popWord()) >= 0) { - reg = instruction & 7; + reg = opCode & 7; this.regsGen[7] = this.regsGen[reg]; this.regsGen[reg] = src; } break; case 0x98: /*0000230*/ // SPL 00023N - //LOG_INSTRUCTION(instruction, 9, "SPL"); + //LOG_INSTRUCTION(opCode, 9, "SPL"); if (!(this.PSW & 0xc000)) { - this.PSW = (this.PSW & 0xf81f) | ((instruction & 7) << 5); + this.PSW = (this.PSW & 0xf81f) | ((opCode & 7) << 5); this.priorityReview = 1; } break; case 0xA0: /*0000240*/ // CLR CC 00024M Part 1 without N case 0xA8: /*0000250*/ // CLR CC 00025M Part 2 with N - if (instruction & 1) this.clearCF(); // CLC - if (instruction & 2) this.clearVF(); // CLV - if (instruction & 4) this.clearZF(); // CLZ - if (instruction & 8) this.clearNF(); // CLN + if (opCode & 1) this.clearCF(); // CLC + if (opCode & 2) this.clearVF(); // CLV + if (opCode & 4) this.clearZF(); // CLZ + if (opCode & 8) this.clearNF(); // CLN break; case 0xB0: /*0000260*/ // SET CC 00026M Part 1 without N case 0xB8: /*0000270*/ // SET CC 00026M Part 2 with N - if (instruction & 1) this.setCF(); // SEC - if (instruction & 2) this.setVF(); // SEV - if (instruction & 4) this.setZF(); // SEZ - if (instruction & 8) this.setNF(); // SEN + if (opCode & 1) this.setCF(); // SEC + if (opCode & 2) this.setVF(); // SEV + if (opCode & 4) this.setZF(); // SEZ + if (opCode & 8) this.setNF(); // SEN break; default: // Misc instructions (decode ALL remaining bits) xxxxxx - switch (instruction) { + switch (opCode) { case 0x0: /*0000000*/ // HALT 000000 - //LOG_INSTRUCTION(instruction, 0, "HALT"); + //LOG_INSTRUCTION(opCode, 0, "HALT"); if (0xc000 & this.PSW) { this.CPU_Error |= 0x80; /*0200*/ this.trap(PDP11.TRAP.BUS_ERROR, 46); @@ -2480,7 +2483,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x1: /*0000001*/ // WAIT 000001 - //LOG_INSTRUCTION(instruction, 0, "WAIT"); + //LOG_INSTRUCTION(opCode, 0, "WAIT"); j = 0; if ((i = this.interruptQueue.length) > 0) { while (i-- > 0) { @@ -2494,15 +2497,15 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) } break; case 0x3: /*0000003*/ // BPT 000003 - //LOG_INSTRUCTION(instruction, 0, "BPT"); + //LOG_INSTRUCTION(opCode, 0, "BPT"); this.trap(PDP11.TRAP.BREAKPOINT, /*014*/ 6); break; case 0x4: /*0000004*/ // IOT 000004 - //LOG_INSTRUCTION(instruction, 0, "IOT"); + //LOG_INSTRUCTION(opCode, 0, "IOT"); this.trap(PDP11.TRAP.IOT, /*020*/ 8); break; case 0x5: /*0000005*/ // RESET 000005 - //LOG_INSTRUCTION(instruction, 0, "RESET"); + //LOG_INSTRUCTION(opCode, 0, "RESET"); if (!(this.PSW & 0xc000)) { this.resetRegs(); this.bus.reset(); @@ -2511,7 +2514,7 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) break; case 0x2: /*0000002*/ // RTI 000002 case 0x6: /*0000006*/ // RTT 000006 - //LOG_INSTRUCTION(instruction, 0, "RTT"); + //LOG_INSTRUCTION(opCode, 0, "RTT"); dstAddr = this.regsGen[6]; if ((virtualAddress = this.readWordByVirtual(dstAddr | 0x10000)) >= 0) { dstAddr = (dstAddr + 2) & 0xffff; @@ -2525,18 +2528,18 @@ CPUStatePDP11.prototype.stepCPU = function(nMinCycles) this.regsGen[7] = virtualAddress; this.setPSW(savePSW); this.opFlags &= ~PDP11.OPFLAG.TRAP_TF; - if (instruction === 2) { // RTI enables immediate trace + if (opCode === 2) { // RTI enables immediate trace this.opFlags |= (this.PSW & PDP11.PSW.TF); } } } break; //case 0000007: // MFPT 000007 - // //LOG_INSTRUCTION(instruction, 0, "MFPT"); + // //LOG_INSTRUCTION(opCode, 0, "MFPT"); // this.regsGen[0] = 1; // break; // Exists on pdp 11/44 & KB11-EM default: // We don't know this instruction - //LOG_INSTRUCTION(instruction, 11, "-unknown-"); + //LOG_INSTRUCTION(opCode, 11, "-unknown-"); this.trap(PDP11.TRAP.RESERVED, /*010*/ 48); // reserved instruction break; } diff --git a/versions/pdp11/1.30.0/pdp11-dbg.js b/versions/pdp11/1.30.0/pdp11-dbg.js index efe424414..2d14f5d0d 100644 --- a/versions/pdp11/1.30.0/pdp11-dbg.js +++ b/versions/pdp11/1.30.0/pdp11-dbg.js @@ -1,211 +1,214 @@ (function(){var m; function aa(a,b){var d;if(a){b||(b=10);var c=a.charAt(0),f=0>=3;return(d?"0o":"")+c}function r(a,b,d){var c="";b?8=f?48:55),c=String.fromCharCode(f)+c;a>>=4}return(d?"0x":"")+c} -function ca(a){var b=a,d=a.lastIndexOf("/");0<=d&&(b=a.substr(d+1));d=b.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function na(a,b){return(a+" ").slice(0,b)} -function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function pa(a,b,d){var c=0,f=a.length,e=0;for(void 0===d&&(d=function(a,b){return a>b?1:a>1,g;g=d(b,a[h]);0a?"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 ca(a){var b=a,d=a.lastIndexOf("/");0<=d&&(b=a.substr(d+1));d=b.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}function na(a,b){return(a+" ").slice(0,b)} +function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function pa(a,b,d){var c=0,f=a.length,e=0;for(void 0===d&&(d=function(a,b){return a>b?1:a>1,g;g=d(b,a[h]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function ua(a,b,d,c){var f=0,e=null,h=null;if("object"==typeof resources&&(e=resources[a]))return c&&c(a,e,f),[e,f];if(d&&"function"==typeof resources)return resources(a,function(b,d){c&&c(a,b,d)}),h;var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");d&&(g.onreadystatechange=function(){4===g.readyState&&(e=g.responseText,200==g.status||!g.status&&e.length&&"file:"==(window?window.location.protocol:"file:")||(f=g.status||-1),c&&c(a,e,f))});if(b&&"object"== typeof b){var k="",l;for(l in b)b.hasOwnProperty(l)&&(k&&(k+="&"),k+=l+"="+encodeURIComponent(b[l]));k=k.replace(/%20/g,"+");g.open("POST",a,!!d);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(k)}else g.open("GET",a,!!d),"bytes"==b&&g.overrideMimeType("text/plain; charset=x-user-defined"),g.send();d||(e=g.responseText,200!=g.status&&(f=g.status||-1),c&&c(a,e,f),h=[e,f]);return h}function fa(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function t(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function Aa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(d){}return b} +function t(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(d){}return b} function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(d){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,d){function c(){--a;0<=a&&(b()||(a=0));0b?this.Bb=this.id:(this.oc=this.id.substr(0,b),this.Bb=this.id.substr(b+1));this[a]=d;this.j={ready:!1,nb:!1,dc:!1,fa:!1,error:!1};this.Wb=null;this.j.error=!1;this.O={};this.H=null;this.ha=c||0;v.push(this)}var Ua=void 0,Va={}; +function Fa(a,b){function d(){b(100===c)&&(f=setTimeout(d,c),c=100)}var c=0,f=null,e=!1;a.onmousedown=function(){e||f||(c=500,d())};a.ontouchstart=function(){f||(c=500,d())};a.onmouseup=a.onmouseout=function(){f&&(clearTimeout(f),f=null)};a.ontouchend=a.ontouchcancel=function(){f&&(clearTimeout(f),f=null);e=!0}}var Ga={init:[],show:[],exit:[]},Ha=!1,Ia=!1,Ja=!0;function Ka(a,b){if(window){var d=window[a];window[a]="function"!==typeof d?b:function(){d&&d();b()}}}function Qa(a){Ga.init.push(a)} +function Ra(a){if(Ja)try{for(var b=0;bb?this.Bb=this.id:(this.nc=this.id.substr(0,b),this.Bb=this.id.substr(b+1));this[a]=d;this.u={ready:!1,nb:!1,cc:!1,fa:!1,error:!1};this.Vb=null;this.u.error=!1;this.O={};this.H=null;this.ha=c||0;v.push(this)}var Ua=void 0,Va={}; if(window){Ua||(Ua=window.location.search.substr(1));for(var Wa,Xa=/\+/g,Ya=/([^&=]+)=?([^&]*)/g;Wa=Ya.exec(Ua);)Va[decodeURIComponent(Wa[1].replace(Xa," "))]=decodeURIComponent(Wa[2].replace(Xa," "))}function Za(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=Za(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var $a=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else $a={},v=[];function ab(a,b,d){$a[a]&&b&&($a[a][b]=d)}function bb(a){var b,d=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.X&&(this.X=10);15>2;this.G=this.Aa-1;this.C=this.I/this.Aa|0;this.u=this.C-1;this.Ta=[];this.J=null;this.Gb=this.Dc;a=new H;Cb(a,this.H);this.R=Array(this.C);for(b=0;b>8:d[2](b)&255}else if(b&1&&(d=this.controller.Ta[a&-2],d[2]))return d[2](b&-2)>>8;return this.controller.Gb(b,-1,1)} -function Eb(a,b,d){var c=this.controller.Ta[a];if(c){if(c[1]){c[1](b,d);return}if(c[3]){a=c[2]?c[2](d):0;if(d&1)c[3](a&255|b<<8,d&-2);else c[3](a&-256|b,d);return}}else if(d&1&&(c=this.controller.Ta[a&-2],c[3])){d&=-2;a=c[2]?c[2](d):0;c[3](a&255|b<<8,d);return}this.controller.Gb(d,b,1)}function Fb(a,b){var d=this.controller.Ta[a];if(d){if(d[2])return d[2](b);if(d[0])return d[0](b)|d[0](b+1)<<8}return this.controller.Gb(b,-1,0)} -function Gb(a,b,d){if(a=this.controller.Ta[a]){if(a[3]){a[3](b,d);return}if(a[1]){a[1](b&255,d);a[1](b>>8,d+1);return}}this.controller.Gb(d,b,0)}m=Bb.prototype;m.reset=function(){this.J&&this.J()};m.Dc=function(){return 0};m.Na=function(a,b){b||this.reset();return!0}; -function Hb(a,b,d,c,f){for(var e=b,h=d,g=e>>>a.X;0h&&(n=h);if(k&&k.size){if(k.type==c&&k.controller==f){if(e+h<=k.A)return k.Ub+=k.A-e,k.A=e,!0;if(e>=k.A+k.Ub){n=k.size-(e-l);n>h&&(n=h);k.Ub=e-k.A+n;e=l+a.Aa;h-=n;g++;continue}}return Jb(1,e,h)}e=new H(e,n,a.Aa,c,f);Cb(e,a.H,k);a.R[g++]=e;e=l+a.Aa;h-=n}return 0>=h?(a.status(Math.floor(d/1024)+"Kb "+Kb[c]+" at "+r(b,8,!0)),!0):Jb(2,b,d)} -m.Hb=function(a){return this.R[(a&this.i)>>>this.X].sb(a&this.G,a)};m.Ha=function(a){var b=a&this.G,d=(a&this.i)>>>this.X;return b!=this.G?this.R[d].wc(b,a):this.R[d++].sb(b,a)|this.R[d&this.u].sb(0,a+1)<<8};function Lb(a,b){var d=b&a.G,c=(b&a.i)>>>a.X;return d!=a.G?a.R[c].hc(d,b):a.R[c++].Ob(d,b)|a.R[c&a.u].Ob(0,b+1)<<8}m.bc=function(a,b){this.R[(a&this.i)>>>this.X].xb(a&this.G,b&255,a)}; -m.jc=function(a,b){var d=a&this.G,c=(a&this.i)>>>this.X;d!=this.G?this.R[c].Cc(d,b&65535,a):(this.R[c++].xb(d,b&255,a),this.R[c&this.u].xb(0,b>>8&255,a+1))};function Jb(a,b,d){t("Memory block error ("+a+": "+r(b)+","+r(d)+")");return!1} -function Mb(a){u.call(this,"Device",a,Mb);this.P=a.name;this.N={gc:[],Ia:0,qa:128,H:127,Jc:0};this.i={data:0,gd:0,pb:20,dd:0};this.u={Ib:0,K:0};this.C={Qb:2496,la:0,S:128,Rb:0,Pb:0,ta:0,xc:0,na:[],cb:[406,406,406,406],Z:[12,12,12,12]};this.I={K:129,Fb:0,ca:0,Ya:0,Ua:0,ab:0,na:[],Z:[40,40,40,40],cb:[1024,1024,512,512],Fc:[157,157,29,29]};this.J={f:[8210,8208,8210,8226],Z:[22,22,22,50],bb:[19,19,19,32],cc:[815,411,815,630],na:[],U:2176,vb:0,tb:0,Ca:[0,0,0,0,0,0,0,0],Ba:0,pa:[4544,4544,4544,4544,4544, -4544,4544,4544],ub:[0,0,0,0,0,0,0,0],kb:0,bd:[0,0,0,0,0,0,0,0],yc:0,zc:[0,0,0,0,0,0,0,0],G:[0,0,0,0,0,0,0,0],cd:[1,2,3,4,5,6,7,8],Ac:[0,0,0,0,0,0,0,0],Pa:[0,0,0,0,0,0,0,0],ac:[0,0,0,0,0,0,0,0],$c:[0,0,0,0,0,0,0,0],ad:[0,0,0,0,0,0,0,0],Yc:[0,0,0,0,0,0,0,0],Zc:[0,0,0,0,0,0,0,0],$a:0,ic:0}}w(Mb); -var Nb=[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, +this.oa=function(a){this.g(a,this.Bb)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.Bb+": "+a)},oa:function(a,b,d){d=d||this.type;b||t((d?d+": ":"")+a)},Na:function(){return this.u.fa=!0},Ma:function(a,b){b&&(this.u.fa=!1);return!0}};function fb(a,b){if(a.H){a===a.H?b|=0:b=b||a.ha;var d=a.H.ha&b;return!!b&&d===b||!!(d&a.H.Hc)}return!1} +function gb(a,b){if(a.u.cc)return a.u.nb&&(a.u.nb=!1),a.u.cc=!1;if(a.u.error)return a.g(a.toString()+" error"),!1;a.u.nb=b;return a.u.nb}function hb(a,b){a.u.nb&&(b?a.u.cc=!0:void 0===b&&a.g(a.toString()+" busy"));return a.u.nb}function A(a){if(!a.u.error&&(a.u.ready=!0,a.u.ready)){var b=a.Vb;a.Vb=null;b&&b()}}function ib(a,b){b&&(a.u.ready?b():a.Vb=b);return a.u.ready}function jb(a,b){a.u.error=!0;a.oa(b)} +var kb="undefined"!==typeof ArrayBuffer,lb=2,B=4,F=6,lb=0|lb,wb=1|lb,B=0|B,xb=1|B,F=0|F,yb=1|F,zb={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 Ab(a){u.call(this,"Panel",a,Ab)}$a(Ab);m=Ab.prototype;m.ua=function(a,b,d,c){return this.i&&this.i.ua(a,b,d,c)||this.b&&this.b.ua(a,b,d,c)||this.H&&this.H.ua(a,b,d,c)?!0:this.parent.ua.call(this,a,b,d,c)}; +m.Xa=function(a,b,d,c){this.i=a;this.G=b;this.b=d;this.H=c};m.Na=function(a,b){b||Bb();return!0};m.Ma=function(){return!0};m.wa=function(){};function Bb(){for(var a=!1,b=x(document,"pdp11","panel"),d=0;d>1)+2;10>this.X&&(this.X=10);15>2;this.G=this.Aa-1;this.C=this.I/this.Aa|0;this.j=this.C-1;this.Ta=[];this.J=null;this.Fb=this.Dc;a=new G;Db(a,this.H);this.R=Array(this.C);for(b=0;b>8:d[2](b)&255}else if(b&1&&(d=this.controller.Ta[a&-2],d[2]))return d[2](b&-2)>>8;return this.controller.Fb(b,-1,1)} +function Fb(a,b,d){var c=this.controller.Ta[a];if(c){if(c[1]){c[1](b,d);return}if(c[3]){a=c[2]?c[2](d):0;if(d&1)c[3](a&255|b<<8,d&-2);else c[3](a&-256|b,d);return}}else if(d&1&&(c=this.controller.Ta[a&-2],c[3])){d&=-2;a=c[2]?c[2](d):0;c[3](a&255|b<<8,d);return}this.controller.Fb(d,b,1)}function Gb(a,b){var d=this.controller.Ta[a];if(d){if(d[2])return d[2](b);if(d[0])return d[0](b)|d[0](b+1)<<8}return this.controller.Fb(b,-1,0)} +function Hb(a,b,d){if(a=this.controller.Ta[a]){if(a[3]){a[3](b,d);return}if(a[1]){a[1](b&255,d);a[1](b>>8,d+1);return}}this.controller.Fb(d,b,0)}m=Cb.prototype;m.reset=function(){this.J&&this.J()};m.Dc=function(){return 0};m.Na=function(a,b){b||this.reset();return!0}; +function Ib(a,b,d,c,f){for(var e=b,h=d,g=e>>>a.X;0h&&(n=h);if(k&&k.size){if(k.type==c&&k.controller==f){if(e+h<=k.A)return k.Tb+=k.A-e,k.A=e,!0;if(e>=k.A+k.Tb){n=k.size-(e-l);n>h&&(n=h);k.Tb=e-k.A+n;e=l+a.Aa;h-=n;g++;continue}}return Kb(1,e,h)}e=new G(e,n,a.Aa,c,f);Db(e,a.H,k);a.R[g++]=e;e=l+a.Aa;h-=n}return 0>=h?(a.status(Math.floor(d/1024)+"Kb "+Lb[c]+" at "+r(b,8,!0)),!0):Kb(2,b,d)} +m.Gb=function(a){return this.R[(a&this.i)>>>this.X].sb(a&this.G,a)};m.Ga=function(a){var b=a&this.G,d=(a&this.i)>>>this.X;return b!=this.G?this.R[d].wc(b,a):this.R[d++].sb(b,a)|this.R[d&this.j].sb(0,a+1)<<8};function Mb(a,b){var d=b&a.G,c=(b&a.i)>>>a.X;return d!=a.G?a.R[c].gc(d,b):a.R[c++].Nb(d,b)|a.R[c&a.j].Nb(0,b+1)<<8}m.ac=function(a,b){this.R[(a&this.i)>>>this.X].xb(a&this.G,b&255,a)}; +m.ic=function(a,b){var d=a&this.G,c=(a&this.i)>>>this.X;d!=this.G?this.R[c].Cc(d,b&65535,a):(this.R[c++].xb(d,b&255,a),this.R[c&this.j].xb(0,b>>8&255,a+1))};function Kb(a,b,d){t("Memory block error ("+a+": "+r(b)+","+r(d)+")");return!1} +function Nb(a){u.call(this,"Device",a,Nb);this.P=a.name;this.N={fc:[],Ha:0,qa:128,H:127,Jc:0};this.i={data:0,gd:0,pb:20,dd:0};this.j={Hb:0,K:0};this.C={Pb:2496,la:0,S:128,Qb:0,Ob:0,ta:0,xc:0,na:[],cb:[406,406,406,406],Z:[12,12,12,12]};this.I={K:129,Eb:0,ca:0,Ya:0,Ua:0,ab:0,na:[],Z:[40,40,40,40],cb:[1024,1024,512,512],Fc:[157,157,29,29]};this.J={b:[8210,8208,8210,8226],Z:[22,22,22,50],bb:[19,19,19,32],bc:[815,411,815,630],na:[],U:2176,vb:0,tb:0,Ca:[0,0,0,0,0,0,0,0],Ba:0,pa:[4544,4544,4544,4544,4544, +4544,4544,4544],ub:[0,0,0,0,0,0,0,0],kb:0,bd:[0,0,0,0,0,0,0,0],yc:0,zc:[0,0,0,0,0,0,0,0],G:[0,0,0,0,0,0,0,0],cd:[1,2,3,4,5,6,7,8],Ac:[0,0,0,0,0,0,0,0],Pa:[0,0,0,0,0,0,0,0],$b:[0,0,0,0,0,0,0,0],$c:[0,0,0,0,0,0,0,0],ad:[0,0,0,0,0,0,0,0],Yc:[0,0,0,0,0,0,0,0],Zc:[0,0,0,0,0,0,0,0],$a:0,hc:0}}$a(Nb); +var Ob=[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];m=Mb.prototype; -m.Xa=function(a,b,d,c){this.G=b;this.f=d;this.H=c;switch(this.P){default:a=Ob;for(var f in a){var e=a[f];d=b;c=+f;for(var h=e[0]?e[0].bind(this):null,g=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,l=+f;l<=c;l+=2){var n=l&8191;void 0!==d.Ta[n]?t("I/O address already registered: "+r(d.P+n,8,!0)):d.Ta[n]=[h,g,k,e,!1]}}f=this.Ec.bind(this);b.J=this.reset.bind(this);b.Gb=f}E(this)};m.Uc=function(){return $b(this.f)}; -m.fd=function(a){ac(this.f,a&-1809|$b(this.f)&1808);this.f.W|=128}; -function bc(a){var b=a.C,d,c,f,e=b.ta>>13&7;"undefined"===typeof b.na[e]&&(b.na[e]={cache:[],postProcess:a.Vc,drive:e,blocksize:256,mapped:0,maxblock:b.cb[e]*b.Z[e],url:"rk"+e+".dsk"});b.S&=-129;switch(b.S>>1&7){case 0:b.Qb=2496;b.la=0;b.S=128;b.ta=0;break;case 1:if((b.ta>>4&511)>=b.cb[e]){b.la|=32832;b.S|=49152;break}if((b.ta&15)>=b.Z[e]){b.la|=32800;b.S|=49152;break}d=(b.ta>>4&511)*b.Z[e]+(b.ta&15);c=(b.S&48)<<12|b.Pb;f=65536-b.Rb&65535;cc(a,b.na[e],d,c,f);return;case 2:if((b.ta>>4&511)>=b.cb[e]){b.la|= -32832;b.S|=49152;break}if((b.ta&15)>=b.Z[e]){b.la|=32800;b.S|=49152;break}d=(b.ta>>4&511)*b.Z[e]+(b.ta&15);c=(b.S&48)<<12|b.Pb;f=65536-b.Rb&65535;a.$b(b.na[e],d,c,f);return}b.Qb=e<<13|b.Qb&8176|b.ta%9&15;I(a.f,20,160,144,function(){b.S=b.S&65534|128;return!!(b.S&64)})}m.Vc=function(a,b,d,c,f){var e=this.C;e.Pb=c&65535;e.S=e.S&-49|c>>12&48;e.Rb=65536-f&65535;switch(a){case 1:e.la|=33024;e.S|=49152;break;case 2:e.la|=33792,e.S|=49152}I(this.f,20,160,144,function(){e.S=e.S&65534|128;return!!(e.S&64)})}; -function dc(a){var b=a.I,d,c,f,e=b.K>>8&3;b.K&=-2;"undefined"===typeof b.na[e]&&(b.na[e]={cache:[],postProcess:a.Wc,drive:e,blocksize:128,mapped:1,maxblock:b.cb[e]*b.Z[e],url:"rl"+e+".dsk"});switch(b.K>>1&7){case 2:b.Ya&8&&(b.K&=63);b.Ya=b.Fc[e]|b.ab&64;break;case 3:1==(b.ca&3)&&(b.ab=b.ca&4?b.ab+(b.ca&65408)&65408|b.ca<<2&64:b.ab-(b.ca&65408)&65408|b.ca<<2&64,b.ca=b.ab);break;case 4:b.Ya=b.ab;break;case 5:if(b.ca>>6>=b.cb[e]){b.K|=37888;break}if((b.ca&63)>=b.Z[e]){b.K|=37888;break}d=(b.ca>>6)*b.Z[e]+ -(b.ca&63);c=(b.Ua&63)<<16|b.Fb;f=65536-b.Ya&65535;cc(a,b.na[e],d,c,f);return;case 6:if(b.ca>>6>=b.cb[e]){b.K|=37888;break}if((b.ca&63)>=b.Z[e]){b.K|=37888;break}d=(b.ca>>6)*b.Z[e]+(b.ca&63);c=(b.Ua&63)<<16|b.Fb;f=65536-b.Ya&65535;a.$b(b.na[e],d,c,f);return}I(a.f,20,160,112,function(){b.K|=129;return!!(b.K&64)})} -m.Wc=function(a,b,d,c,f){var e=this.I;e.Fb=c&65535;e.K=e.K&-49|c>>12&48;e.Ua=c>>16&63;e.ca=~~(d/e.Z[b.La])<<6|d%e.Z[b.La];e.ab=e.ca;e.Ya=65536-f&65535;switch(a){case 1:e.K|=33792;break;case 2:e.K|=40960}I(this.f,20,160,112,function(){e.K|=129;return!!(e.K&64)})};function ec(a){a=a.J;a.U=2176;a.Ba=0;a.pa=[4544,4544,4544,4544,4544,4544,4544,4544];a.ub=[0,0,0,0,0,0,0,0];a.kb=a.vb=a.tb=a.$a=a.ic=0} -function fc(a,b){var d=a.J,c,f,e;d.U&=-16513;d.Ba&=-2049;d.pa[b]&=-1153;I(a.f,-1,0,172);"undefined"===typeof d.na[b]&&(d.na[b]={cache:[],postProcess:a.Xc,drive:b,blocksize:256,mapped:0,maxblock:d.cc[0]*d.bb[0]*d.Z[0],url:"rp"+b+".dsk"});switch(d.U&63){case 5:d.ac[b]=d.Pa[b];d.U|=32896;d.pa[b]|=32896;d.kb|=1<=d.cc[0]||d.Ca[b]>>8>=d.bb[0]||(d.Ca[b]&255)>=d.Z[0]){d.ub[b]|=1024;d.U|=49152;break}c=(d.Pa[b]*d.bb[0]+(d.Ca[b]>>8))*d.Z[0]+ -(d.Ca[b]&255);f=(d.$a&63)<<16|d.tb;e=65536-d.vb&65535;cc(a,d.na[b],c,f,e);return;case 57:if(d.Pa[b]>=d.cc[0]||d.Ca[b]>>8>=d.bb[0]||(d.Ca[b]&255)>=d.Z[0]){d.ub[b]|=1024;d.U|=49152;break}c=(d.Pa[b]*d.bb[0]+(d.Ca[b]>>8))*d.Z[0]+(d.Ca[b]&255);f=(d.$a&63)<<16|d.tb;e=65536-d.vb&65535;a.$b(d.na[b],c,f,e);return}I(a.f,3,160,172,function(){d.U=d.U&65534|128;d.pa[b]|=128;return!!(d.U&64)})} -m.Xc=function(a,b,d,c,f){var e=this.J;e.vb=65536-f&65535;e.tb=c&65535;e.U=e.U&-769|c>>8&768;e.$a=c>>16&63;f=~~(d/e.Z[0]);c=~~(f/e.bb[0]);e.Ca[b.La]=f%e.bb[0]<<8|d%e.Z[0];e.ac[b.La]=e.Pa[b.La]=c;e.kb|=1<=b.Sc-1&&(e.pa[b.La]|=1024);switch(a){case 1:e.Ba|=512;e.U|=49152;break;case 2:e.Ba|=2048,e.U|=49152}I(this.f,20,160,172,function(){e.pa[b.La]|=128;e.U=e.U&65534|128;return!!(e.U&64)})};m.Pc=function(){this.u.K|=128;this.u.K&64&&I(this.f,0,192,64)}; -function gc(a,b,d,c,f,e){var h=~~((e+d.Va-1)/d.Va),g=new XMLHttpRequest;2048>h&&c+2048L(this.f,a.Rc?hc(this.f,d):d,a.cache[b][f])){a.Zb(2,a,b,d,c);return}d+=2;--c}b++}a.Zb(0,a,b,d,c)}; -function cc(a,b,d,c,f){for(var e,h;0h){b.Zb(2,b,d,c,f);return}b.cache[d][e]=h;c+=2;--f}d++}b.Zb(0,b,d,c,f)}m.reset=function(){this.i.pb=this.i.pb&-120|20;this.N.Ia=0;this.N.qa=128;this.u.K=0;this.C.S=128;this.I.K=128;ec(this)}; -m.Ec=function(a,b,d){var c,f,e=this.f;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?c=e.Qa&65280:(a&1&&(b<<=8),e.Qa=b|255,c=0);break;case 4194298:if(0>b)c=e.Yb;else{a&1&&(b<<=8);if(c=b&65024){f=c>>9;do c+=34;while(f>>=1)}e.Yb=c;e.Oa=2}break;case 4194294:if(70!==e.gb)return K(e,4,222);0>b?c=e.L:c=e.L=0;break;case 4194292:if(70!==e.gb)return K(e,4,224);c=1;break;case 4194290:if(70!==e.gb)return K(e,4,226);c=0;break;case 4194288:if(70!==e.gb)return K(e,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!==e.gb)return K(e,4,232);f=a-4194272>>1;0>b?c=e.fc[f]:(c=J(this,e.fc[f],a,b,d),0<=c&&(e.fc[f]=c));break;case 4194254:return a&1?e.M>>14&1?(0<=b&&(e.b[6]=b),c=e.b[6]):(0<=b&&(e.sa[3]=b),c=e.sa[3]):e.M>>14&0?(0<=b&&(e.b[6]=b),c=e.b[6]):(0<=b&&(e.sa[1]=b),c=e.sa[1]),c;case 4194252:case 4194250:case 4194248:return f=a&7,e.M&2048?(0<=b&&(e.b[f]=b),c=e.b[f]):(0<=b&&(e.Za[f]= -b),c=e.Za[f]),c;case 4194246:return a&1?(0<=b&&(e.b[7]=b),c=e.b[7]):e.M>>14&0?(0<=b&&(e.b[6]=b),c=e.b[6]):(0<=b&&(e.sa[0]=b),c=e.sa[0]),c;case 4194244:case 4194242:case 4194240:return f=a&7,e.M&2048?(0<=b&&(e.Za[f]=b),c=e.Za[f]):(0<=b&&(e.b[f]=b),c=e.b[f]),c;default:return e.L|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;c=J(this,e.ka[3][f],a,b,d);0<=c&&(e.ka[3][f]=c,e.ka[3][f&15]&=65295);break;case 4194112:var h=this.N;f=this.u;switch(a&-2){case 4194174:c=J(this,e.Ab,a,b,d);0<=c&&(e.Ab=c);break;case 4194172:c= -e.Da;c&65280&&(c=(c<<8|c>>8)&65535);break;case 4194170:e.ba=e.ba&62337|e.Kb<<5|e.Xb<<1;0>b?c=e.ba:(c=J(this,e.ba,a,b,d),0<=c&&(e.ba=c&=62337,e.Kb=c>>5&3,e.Xb=c>>1&15,c&257?(f=2,e.Ra&16&&(f=1),e.Jb=c&1?kb|F:F):(e.Jb=0,f=4),this.i.pb=this.i.pb&-8|f));break;case 4194168:0>b?c=this.i.dd&65535:(c=J(this,this.i.data,a,b,d),0<=c&&(this.i.data=c));break;case 4194166:0<=b&&(b&127&&(h.Jc=0),h.qa&=-129,I(e,100,128,52,function(){h.qa|=128;return!!(h.qa&64)}));c=0;break;case 4194164:0>b?c=h.qa:(c=J(this,h.qa, -a,b,d),0<=c&&(128==(h.qa&192)&&c&64&&I(e,8,128,52,function(){h.qa|=128;return!!(h.qa&64)}),h.qa=h.qa&128|c&-129));break;case 4194162:c=0;0>b&&(h.Ia&=-129,0b?c=h.Ia:(c=J(this,h.Ia,a,b,d),0<=c&&(h.Ia=h.Ia&128|c&-129));break;case 4194150:0>b?(c=f.K,f.K&=-129):(c=J(this,f.K,a,b,d),0<=c&&(c&64&&!f.Ib&&(setInterval(this.Pc.bind(this),25),f.Ib=1),f.K=c&-129));break;default:return e.L|= -16,K(e,4,126)}break;case 4194048:f=this.C;switch(a&-2){case 4194048:c=J(this,f.Qb,a,b,d);0<=c&&(f.Qb=c);break;case 4194050:c=J(this,f.la,a,b,d);0<=c&&(f.la=c);break;case 4194052:c=J(this,f.S,a,b,d);0<=b&&0<=c&&(f.S=c&-36993|f.S&36992,f.S&1&&bc(this));break;case 4194054:c=J(this,f.Rb,a,b,d);0<=c&&(f.Rb=c);break;case 4194056:c=J(this,f.Pb,a,b,d);0<=c&&(f.Pb=c);break;case 4194058:c=J(this,f.ta,a,b,d);0<=c&&(f.ta=c);break;case 4194060:break;case 4194062:c=J(this,f.xc,a,b,d);0<=c&&(f.xc=c);break;default:return e.L|= -16,K(e,4,128)}break;case 4193728:var g=this.J;f=g.Ba&7;switch(a&-2){case 4193728:c=J(this,g.U,a,b,d);0<=b&&0<=c&&(g.$a=g.$a&60|c>>8&3,g.U=c&17279|g.U&34944|2048,c&1&&g.U&128?fc(this,f):192==(c&192)&&I(e,0,160,172));break;case 4193730:c=J(this,g.vb,a,b,d);0<=c&&(g.vb=c);break;case 4193732:c=J(this,g.tb,a,b,d);0<=c&&(g.tb=c&65534);break;case 4193734:c=J(this,g.Ca[f],a,b,d);0<=c&&(g.Ca[f]=c&7967);break;case 4193736:c=J(this,g.Ba,a,b,d);0<=c&&(g.Ba=c&63|g.Ba&65472,c&128&&ec(this));break;case 4193738:c= -g.pa[f];break;case 4193740:c=g.ub[f];break;case 4193742:c=J(this,g.kb,a,b,d);0<=c&&(g.kb=c&255);break;case 4193744:c=g.bd[f];break;case 4193746:c=J(this,g.yc,a,b,d);0<=c&&(g.yc=c);break;case 4193748:c=J(this,g.zc[f],a,b,d);0<=c&&(g.zc[f]=c&1023);break;case 4193750:c=8210;break;case 4193752:c=g.cd[f];break;case 4193754:c=J(this,g.Ac[f],a,b,d);0<=c&&(g.Ac[f]=c);break;case 4193756:c=J(this,g.Pa[f],a,b,d);0<=c&&(g.Pa[f]=c&511);break;case 4193758:g.ac[f]=g.Pa[f];c=g.ac[f];break;case 4193760:c=g.$c[f]; -break;case 4193762:c=g.ad[f];break;case 4193764:c=g.Yc[f];break;case 4193766:c=g.Zc[f];break;case 4193768:c=J(this,g.$a,a,b,d);0<=c&&(g.$a=c&63,g.U=g.U&-769|(c&3)<<8);break;case 4193770:c=J(this,g.ic,a,b,d);0<=c&&(g.ic=c);break;default:return e.L|=16,K(e,4,132)}break;case 4192512:f=this.I;switch(a&-2){case 4192512:c=J(this,f.K,a,b,d);0<=b&&0<=c&&(f.Ua=f.Ua&60|c>>4&3,f.K=f.K&-1023|c&1022,f.K&128||dc(this));break;case 4192514:c=J(this,f.Fb,a,b,d);0<=c&&(f.Fb=c&65534);break;case 4192516:c=J(this,f.ca, -a,b,d);0<=c&&(f.ca=c);break;case 4192518:c=J(this,f.Ya,a,b,d);0<=c&&(f.Ya=c);break;case 4192520:c=J(this,f.Ua,a,b,d);0<=c&&(f.Ua=c&63,f.K=f.K&-49|(f.Ua&3)<<4);break;default:return e.L|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?c=e.Ra:(c=J(this,e.Ra,a,b,d),0<=c&&(70!==e.gb&&(c&=-49),e.Ra=c,e.ib[0]=c&4?15:7,e.ib[1]=c&2?15:7,e.ib[3]=c&1?15:7,e.Jb&&(f=2,e.Ra&16&&(f=1),this.i.pb=this.i.pb&-8|f)));break;default:return e.L|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;c=J(this,e.ka[0][f], -a,b,d);0<=c&&(e.ka[0][f]=c,e.ka[0][f&15]&=65295);break;case 4191360:f=a>>1&31;c=J(this,e.ka[1][f],a,b,d);0<=c&&(e.ka[1][f]=c,e.ka[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.gb)return K(e,4,234);f=a>>2&31;c=e.Sb[f];a&2&&(c=c>>16);c&=65535;0<=b&&(c=J(this,c,a,b,d),0<=c&&(e.Sb[f]=a&2?c<<16|e.Sb[f]&65535:e.Sb[f]&4294901760|c&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)c=Nb[a>>1&255];else return e.L|=16,K(e, -4,138);break;default:return e.L|=16,K(e,4,142)}d&&0<=c&&(a&1?c=c>>8:c&=255);"undefined"===typeof c&&console.log("panic(76)");return c};var Ob={};Ob[4194302]=[null,null,Mb.prototype.Uc,Mb.prototype.fd];Qa(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.f=new Int32Array(this.I,0,d>>2),oc(this,kc?pc:qc);else{this.f=Array(d>>2);for(a=0;a>2),b=0;b>8,d)},da:function(a){return this.f[a>>2]>>>((a&3)<<3)&255},ra:function(a){var b=a>>2;a=(a&3)<<3;var d=this.f[b]>>a;return 24>a?d&65535:d&255|(this.f[b+1]&255)<<8},za:function(a, -b){var d=a>>2,c=(a&3)<<3;this.f[d]=this.f[d]&~(255<>2,c=(a&3)<<3;24>c?this.f[d]=this.f[d]&~(65535<>8);this.Wa=!0},$:function(a,b){if(this.H&&null!=this.A){var d=this.H;vc(d,this.A+a,1,d.Y)&&d.ma(!0)}return this.Ob(a,b)},ga:function(a,b){if(this.H&&null!=this.A){var d=this.H;vc(d,this.A+a,2,d.Y)&&d.ma(!0)}return this.hc(a,b)},wa:function(a,b,d){if(this.H&&null!=this.A){var c=this.H; -vc(c,this.A+a,1,c.J)&&c.ma(!0)}this.O?this.C(a,b,d):this.yb(a,b,d)},Ja:function(a,b,d){if(this.H&&null!=this.A){var c=this.H;vc(c,this.A+a,2,c.J)&&c.ma(!0)}this.O?this.C(a,b,d):this.lc(a,b,d)},Y:function(a){return this.G[a]},aa:function(a){return this.G[a]},ea:function(a){return this.J.getUint16(a,!0)},ja:function(a){return a&1?this.G[a]|this.G[a+1]<<8:this.P[a>>1]},va:function(a,b){this.G[a]=b;this.Wa=!0},ya:function(a,b){this.G[a]=b;this.Wa=!0},Ea:function(a,b){this.J.setUint16(a,b,!0);this.Wa= -!0},Sa:function(a,b){a&1?(this.G[a]=b,this.G[a+1]=b>>8):this.P[a>>1]=b;this.Wa=!0}};function Cb(a,b,d){a.H=b;a.i=a.u=0;d&&((a.i=d.i)&&uc(a,tc,!1),(a.u=d.u)&&sc(a,tc,!1))}function wc(a,b){b?0===--a.u&&(a.xb=a.O?a.C:a.yb,a.Cc=a.O?a.N:a.lc):0===--a.i&&(a.sb=a.Ob,a.wc=a.hc)}function sc(a,b,d){d&&a.u||(a.xb=!a.O&&b[1]||a.C,a.Cc=!a.O&&b[3]||a.N);if(d||void 0===d)a.yb=b[1]||a.C,a.lc=b[3]||a.N}function uc(a,b,d){d&&a.i||(a.sb=b[0]||a.T,a.wc=b[2]||a.V);if(d||void 0===d)a.Ob=b[0]||a.T,a.hc=b[2]||a.V} -function oc(a,b){b||(b=xc);uc(a,b,void 0);sc(a,b,void 0)}var xc=[],rc=[H.prototype.da,H.prototype.za,H.prototype.ra,H.prototype.Bb],tc=[H.prototype.$,H.prototype.wa,H.prototype.ga,H.prototype.Ja];if(jb)var qc=[H.prototype.Y,H.prototype.va,H.prototype.ea,H.prototype.Ea],pc=[H.prototype.aa,H.prototype.ya,H.prototype.ja,H.prototype.Sa]; -function yc(a,b){u.call(this,"CPU",a,yc,1);var d=a.multiplier||1;this.za=a.cycles||b;this.jb=d;this.ya=Math.round(this.za/1E4)/100;this.hb=this.ya*this.jb;this.j.ia=!1;this.j.kc=!1;this.j.Db=a.autoStart;this.j.sc=!1;this.j.ob=!1;this.Lb=this.Y=0;this.Mb=a.csStart;this.qb=a.csInterval;this.rb=a.csStop;this.ja=[];this.Eb=this.lb.bind(this);E(this)}w(yc);var zc=["power","reset"];m=yc.prototype; -m.Xa=function(a,b,d,c){this.i=a;this.G=b;this.H=c;for(b=0;b=a.Y&&(a.Y+=a.qb,d=!0);0<=a.rb&&a.rb<=Fc(a)&&(a.qb=a.rb=-1,Cc(a),a.ma(),d=!0);d&&a.g(Fc(a)+" cycles: checksum="+r(a.Lb))}} -function Sc(a,b,d,c){if(a.O[b]){void 0===d&&(ib(a,"Value for "+b+" is invalid"),a.ma());var f=a.H&&a.H.wa||8;d=!a.j.ia||a.j.sc?8==f?ba(d,c):r(d,c):"--------".substr(0,c||4);a.O[b].textContent!=d&&(a.O[b].textContent=d)}} -m.ua=function(a,b,d){var c=this;a=!1;switch(b){case "power":case "reset":this.O[b]=d;a=!0;break;case "run":this.O[b]=d;d.onclick=function(){var a;if(a=c.i)if(a=c.i,a.j.fa)a=!0;else{var b=null,d,g=bb(a.id);for(d=0;da.N/a.hb?b=1:c=!0;a.jb=b;b=a.ya*a.jb;if(a.hb!=b){a.hb=b;b=a.hb.toFixed(2)+"Mhz";var f=a.O.setSpeed;f&&(f.textContent=b);a.g("target speed: "+b)}d&&a.i&&a.i.Tb()}Uc(a,a.J);a.J=0;a.I=qa();a.P=0;Vc(a);return c}function Wc(a){a.T-=a.C;a.C=0} -m.lb=function(a){if(fb(this,!0)){if(!this.j.ia){Tc(this);this.i&&this.i.start(this.I,Fc(this));this.j.ia=!0;this.j.kc=!0;this.da&&this.da.start();var b=this.O.run;b&&(b.textContent="Halt");this.i&&(this.i.xa(!0),a&&this.i.Tb(!0))}this.Ea>=this.za&&Vc(this,!0);this.ea=0;this.ra=qa();this.P&&(a=this.ra-this.P,a>this.mb&&(this.I+=a,this.I>this.ra&&(this.I=this.ra)));try{do{for(var d,c=this.j.ob?1:this.va,f=this.ja.length-1;0<=f;f--){var e=this.ja[f];0>e[0]||c>e[0]&&(c=e[0])}d=c;try{this.wb(d)}catch(l){if("number"!= -typeof l)throw l;}var h=this.T-this.C;a=h;for(var g=this.ja.length-1;0<=g;g--){var k=this.ja[g];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.ea+=h;this.J+=h;Uc(this,0,!0);Ec(this,h);this.$-=h;if(0>=this.$){this.$+=this.va;15<=++this.zb&&(this.i&&this.i.xa(),this.zb=0);break}}while(this.j.ia)}catch(l){this.ma();Dc(this);this.i&&this.i.stop(qa(),Fc(this));fb(this,!1);ib(this,l.stack||l.message);return}d=setTimeout;c=this.Eb;this.P=qa();f=this.mb;this.ea&&(f=Math.round(f*this.ea/this.va));f=f-(this.P- -this.ra);if(e=this.P-this.I)this.N=Math.round(this.J/(10*e))/100,864E5<=e&&(this.V=0,Tc(this));if(0>f||this.Nf&&(this.I-=f),f=0;this.Ea+=this.ea;this.P+=f;d(c,f)}else Dc(this),this.i&&this.i.stop(qa(),Fc(this))};m.wb=function(){return 0};m.ma=function(a){gb(this,!0);Wc(this);Uc(this,this.J);this.J=0;if(this.j.ia){this.j.ia=!1;this.da&&this.da.stop();var b=this.O.run;b&&(b.textContent="Run")}this.j.complete=a};function Dc(a,b){a.i&&a.i.xa(b)} -function Xc(a){this.vc=+a.model||1170;this.Vb=a.resetAddr||0;yc.call(this,a,1E6);this.Ja=0;this.decode=Yc.bind(this);this.D=65536;this.B=32768;this.F=65535;this.w=32768;this.wa=-1;this.b=[0,0,0,0,0,0,0,this.Vb];this.Za=[0,0,0,0,0,0];this.sa=[0,0,0,0];this.memory=[];this.f=[];this.ga=this.Yb=0;this.Oa=2;this.Qa=255;this.W=0;this.aa=-1;this.L=0;this.gb=70;this.Xb=this.Kb=this.Jb=this.u=this.Ra=this.Ab=this.Da=this.ba=0;this.ib=[7,7,7,7];this.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Sb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.fc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.j.complete=this.j.Ic=!1}w(Xc,yc);m=Xc.prototype; -m.reset=function(){this.j.ia&&this.ma();Zc(this);Bc(this);this.j.error=!1;this.parent.reset.call(this)};function Zc(a){a.Qa=255;a.L=0;a.f=[];a.Yb=0;a.ba=a.Da=a.Ab=a.Ra=a.Jb=0;a.ib[0]=a.ib[1]=a.ib[3]=7;a.Kb=0}m.uc=function(){return 0}; -m.save=function(){var a=new $c(this);N(a,0,[]);N(a,1,[this.Sa,this.V,this.jb]);for(var b=this.G,d=0,c=[],f=0;fb){a.f[e].Fa-=b;break}b-=a.f[e].Fa}a.f.splice(e+1,0,{delay:b,priority:d&224,vector:c,callback:f})}a.Oa=2}function $b(a){return a.M=a.M&63728|(a.w&32768?8:0)|(a.F&65535?0:4)|(a.B&32768?2:0)|(a.D&65536?1:0)} -function ac(a,b){a.w=b<<12;a.F=~b&4;a.B=b<<14;a.D=b<<16;if((b^a.M)&2048)for(var d=a.Za.length;0<=--d;){var c=a.b[d];a.b[d]=a.Za[d];a.Za[d]=c}a.u=b>>14&3;d=a.M>>14&3;a.u!=d&&(a.sa[d]=a.b[6],a.b[6]=a.sa[a.u]);a.Oa=2;a.M=b}function ad(a,b){!a.W&128&&(a.w=a.F=b,a.B=0)}function bd(a,b,d,c){!a.W&128&&(a.w=a.F=a.D=b,a.B=(d^c)&(c^b))} -function K(a,b,d){var c,f,e=0;0>a.aa?a.aa=$b(a):a.u||(b=4,e=1);a.ba&57344||(a.Da=63222,a.Ab=b);a.u=0;0<=(c=O(a,b|65536))&&0<=(f=O(a,b+2&65535|65536))&&(ac(a,f&53247|a.aa>>2&12288),e&&(a.L|=4,a.b[6]=4),0<=cd(a,a.aa)&&0<=cd(a,a.b[7])&&(a.b[7]=c));a.W&=-113;a.aa=-1;throw b|d<<8;}function hc(a,b){var d=b>>13&31;31>d?a.Ra&32&&(b=a.Sb[d]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function dd(a,b,d){var c,f,e,h=0;if(d&a.Jb){c=b>>13&a.ib[a.u];f=a.ka[a.u][c];e=(a.ka[a.u][c+16]<<6)+(b&8191)&4194303;a.Ra&16?3932160<=e&&4186112>e&&(e=hc(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.L|=32,K(a,4,24)),e&1&&!(d&1)&&(a.L|=64,K(a,4,26)));switch(f&7){case 1:h=4096;case 2:f|=128;d&F&&(h=8192);break;case 4:h=4096;case 5:d&F&&(h=4096);case 6:f|=d&F?192:128;break;default:h=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(h|=16384):(b&8128)>(f>>2& -8128)&&(h|=16384));a.ka[a.u][c]=f;if(4194170!==e||a.u)a.Kb=a.u,a.Xb=c;h&&(h&57344&&(0<=a.aa&&(h|=128),a.ba&57344||(a.ba=a.ba|h|a.Kb<<5|a.Xb<<1),K(a,168,28)),a.ba&61440||!(4191360>e||4194239>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.u&&d&F&&(a.b[6]<=a.Qa||65534<=a.b[6])&&(a.b[6]<=a.Qa-32||65534<=a.b[6]?(a.L|=4,a.b[6]=4,K(a,4,36)):(a.L|=8,a.W|=64)),7===e?a.b[e]:a.b[e]|65536;case 2:f=2;c=a.b[e];7!==e&&(c|=65536,6>e&&d&1&&(f=1));break;case 3:f=2;c=a.b[e];7!==e&&(c|=65536);if(0>(c=O(a,c)))return c;c|=65536;break;case 4:f=-2;6>e&&d&1&&(f=-1);c=a.b[e]+f&65535;7!==e&&(c|=65536);break;case 5:f=-2;c=a.b[e]-2&65535;7!==e&&(c|=65536);if(0>(c= -O(a,c)))return c;c|=65536;break;case 6:if(0>(c=O(a,a.b[7])))return c;a.b[7]=a.b[7]+2&65535;c=c+a.b[e]&65535;return c|65536;case 7:if(0>(c=O(a,a.b[7])))return c;a.b[7]=a.b[7]+2&65535;c=c+a.b[e]&65535;return 0>(c=O(a,c|65536))?c:c|65536}a.b[e]=a.b[e]+f&65535;a.ba&57344||(a.Da=a.Da<<8|f<<3&248|e);6===e&&!a.u&&d&F&&0>=f&&(a.b[6]<=a.Qa||65534<=a.b[6])&&(a.b[6]<=a.Qa-32?(a.L|=4,a.b[6]=4,K(a,4,38)):(a.L|=8,a.W|=64));return c} -function S(a,b,d){var c;return b&56?(0<=(c=fd(a,b,d))&&(c=dd(a,c,d)),c):4194304+(b&7)}function T(a,b){var d;b&56?(d=S(a,b,kb),d=M(a,d)):d=a.b[b&7];return d}function gd(a,b){var d;b&56?(d=S(a,b,vb),d=Q(a,d)):d=a.b[b&7]&255;return d}function hd(a,b,d,c){b&56?(b=S(a,b,G),L(a,b,c.call(a,d,M(a,b)))):(b&=7,a.b[b]=c.call(a,d,a.b[b]))}function id(a,b,d,c){b&56?(b=S(a,b,xb),R(a,b,c.call(a,d,Q(a,b)))):(b&=7,a.b[b]=c.call(a,d,a.b[b]))}function U(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} -m.wb=function(a){this.j.complete=!0;var b=this.j.Ic=this.H&&jd(this.H),d=a?this.j.kc?0:1:-1;this.j.kc=!1;this.T=this.C=a;this.Sa&256?(Wc(this),a=!1):a=!0;if(a){do{if(b){if(kd(this.H,this.b[7],d)){this.ma();break}d=1}var c,f,e,h,g;this.W&112&&(this.W&32?K(this,168,52):this.W&64?K(this,4,54):this.W&16&&K(this,12,56),this.W&=-113);if(this.Oa)if(1===this.Oa)this.Oa=2;else{this.Oa=0;f=-1;c=this.Yb&224;if(0<(a=this.f.length))for(;0c&&(c=this.f[a].Tc,f=a)}c>(this.M&224)&&(0>f?K(this,160,42):(K(this,this.f[f].ed,44),this.f.splice(f,1)))}this.ba&57344||(this.Da=0,this.Ab=this.b[7]);this.W=this.M&16;this.wa=O(this,this.b[7]);this.b[7]=this.b[7]+2&65535;this.decode(this.wa);if(0<=this.wa)switch(a=this.wa,this.b[7]=this.b[7]+2&65535,a&61440){default:switch(a&65024){case 2048:0<=(h=fd(this,a,0))&&(g=a>>6&7,0<=cd(this,this.b[g])&&(this.b[g]=this.b[7],this.b[7]=h&65535));break;case 28672:0<= -(c=T(this,a))&&(g=a>>6&7,c&32768&&(c|=-65536),f=this.b[g],f&32768&&(f|=-65536),a=~~(c*f),this.b[g]=a>>16&65535,this.b[g|1]=a&65535,this.w=a>>16,this.F=this.w|a,this.D=this.B=0,-32768>a||32767>6&7,f=this.b[g]<<16|this.b[g|1],this.D=this.B=0,c&32768&&(c|=-65536),a=~~(f/c),-32768<=a&&32767>=a?(this.b[g]=a&65535,this.b[g|1]=f-a*c&65535,this.F=a>>16|a,this.w=a>>16):(this.B=32768,this.F=a>>15|a,this.w=f>>16,-1===c&&65534===this.b[g]&&(this.b[g]= -this.b[g|1]=1))):(this.F=this.w=0,this.B=32768,this.D=65536));break;case 29696:0<=(c=T(this,a))&&(g=a>>6&7,a=this.b[g],a&32768&&(a|=4294901760),this.D=this.B=0,c&=63,c&32?(c=64-c,16>c):c&&(16>15&65535)&&65535!==f&&(this.B=32768))),this.b[g]=a&65535,this.w=this.F=a);break;case 30208:if(0<=(c=T(this,a))){g=a>>6&7;f=this.b[g]<<16|this.b[g|1];this.D=this.B=0;c&=63;if(c&32)c=64-c,32>c-1,this.D=a<<16,a>>=1,f&2147483648&& -(a|=4294967295<<32-c);else if(c){if(a=f<>15,a<<=1,32>=32-c)f|=4294967295<>16&65535;this.b[g|1]=a&65535;this.w=a>>16;this.F=a>>16|a}break;case 30720:a&56?0<=(f=M(this,e=S(this,a,G)))&&(f^=this.b[a>>6&7],0<=L(this,e,f)&&(this.w=this.F=f,this.B=0)):(this.w=this.F=f=this.b[a&7]^=this.b[a>>6&7],this.B=0);break;case 32256:g=a>>6&7;if(this.b[g]=this.b[g]-1&65535)this.b[7]=this.b[7]-((a&63)<<1)&65535;break;default:switch(a& -65280){case 256:this.b[7]=U(this.b[7],a);break;case 512:this.F&65535&&(this.b[7]=U(this.b[7],a));break;case 768:this.F&65535||(this.b[7]=U(this.b[7],a));break;case 1024:(this.w&32768)===(this.B&32768)&&(this.b[7]=U(this.b[7],a));break;case 1280:(this.w&32768)!==(this.B&32768)&&(this.b[7]=U(this.b[7],a));break;case 1536:this.F&65535&&(this.w&32768)===(this.B&32768)&&(this.b[7]=U(this.b[7],a));break;case 1792:this.F&65535&&(this.w&32768)===(this.B&32768)||(this.b[7]=U(this.b[7],a));break;case 32768:this.w& -32768||(this.b[7]=U(this.b[7],a));break;case 33280:!(this.D&65536)&&this.F&65535&&(this.b[7]=U(this.b[7],a));break;case 33024:this.w&32768&&(this.b[7]=U(this.b[7],a));break;case 33536:if(this.D&65536||!(this.F&65535))this.b[7]=U(this.b[7],a);break;case 33792:this.B&32768||(this.b[7]=U(this.b[7],a));break;case 34048:this.B&32768&&(this.b[7]=U(this.b[7],a));break;case 34304:this.D&65536||(this.b[7]=U(this.b[7],a));break;case 34560:this.D&65536&&(this.b[7]=U(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<=(h=fd(this,a,0))&&(this.b[7]=h&65535);break;case 192:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=f<<8|f>>8,0<=L(this,e,a)&&(this.w=this.F=f&65280,this.B=this.D=0)):(g=a&7,f=this.b[g],this.b[g]=(f<<8|f>>8)&65535,this.w=this.F=f&65280,this.B=this.D=0);break;case 2560:a&56?0<=(e=S(this,a,F))&&0<=L(this,e,0)&&(this.w=this.D=this.B=this.F=0):this.w=this.D=this.B=this.F=this.b[a&7]=0;break;case 2624:0<=(f=M(this,e=S(this,a,G)))&&(a=~f, -0<=L(this,e,a)&&(this.w=this.F=a,this.D=65536,this.B=0));break;case 2688:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=f+1,0<=L(this,e,a)&&(this.w=this.F=a,this.B=a&(a^f))):(g=a&7,f=this.b[g],a=f+1,this.b[g]=a&65535,this.w=this.F=a,this.B=a&(a^f));break;case 2752:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=f-1,0<=L(this,e,a)&&(this.w=this.F=a,this.B=(a^f)&f)):(g=a&7,f=this.b[g],a=f-1,this.b[g]=a&65535,this.w=this.F=a,this.B=(a^f)&f);break;case 2816:0<=(f=M(this,e=S(this,a,G)))&&(a=-f,0<=L(this,e,a)&&(this.D=this.w= -this.F=a,this.B=a&f));break;case 2880:0<=(f=M(this,e=S(this,a,G)))&&(a=f+(this.D>>16&1),0<=L(this,e,a)&&(this.D=this.w=this.F=a,this.B=a&(a^f)));break;case 2944:0<=(f=M(this,e=S(this,a,G)))&&(a=f-(this.D>>16&1),0<=L(this,e,a)&&(this.D=this.w=this.F=a,this.B=(a^f)&f));break;case 3008:0<=(f=T(this,a))&&(this.w=this.F=f,this.D=this.B=0);break;case 3072:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=(this.D&65536|f)>>1,0<=L(this,e,a)&&(this.D=f<<16,this.w=this.F=a,this.B=a^this.D>>1)):(g=a&7,f=this.b[g],a=(this.D& -65536|f)>>1,this.b[g]=a&65535,this.D=f<<16,this.w=this.F=a,this.B=a^this.D>>1);break;case 3136:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=f<<1|this.D>>16&1,0<=L(this,e,a)&&(this.D=this.w=this.F=a,this.B=a^f)):(g=a&7,f=this.b[g],a=f<<1|this.D>>16&1,this.b[g]=a&65535,this.D=this.w=this.F=a,this.B=a^f);break;case 3200:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=f&32768|f>>1,0<=L(this,e,a)&&(this.D=f<<16,this.w=this.F=a,this.B=this.w^this.D>>1)):(g=a&7,f=this.b[g],a=f&32768|f>>1,this.b[g]=a&65535,this.D=f<<16,this.w= -this.F=a,this.B=this.w^this.D>>1);break;case 3264:a&56?0<=(f=M(this,e=S(this,a,G)))&&(a=f<<1,0<=L(this,e,a)&&(this.D=this.w=this.F=a,this.B=a^f)):(g=a&7,f=this.b[g],a=f<<1,this.b[g]=a&65535,this.D=this.w=this.F=a,this.B=a^f);break;case 3328:h=this.b[7]+((a&63)<<1)&65535;0<=(c=O(this,h|65536))&&(this.b[7]=this.b[5],this.b[5]=c,this.b[6]=h+2&65535);break;case 3392:a&56?0<=(h=fd(this,a,0))&&(61440!==(this.M&61440)&&(h&=65535),this.u=this.M>>12&3,0<=(c=O(this,h))&&(this.u=this.M>>14&3,0<=cd(this,c)&& -(this.w=this.F=c,this.B=0))):(g=a&7,c=6!==g||(this.M>>2&12288)===(this.M&12288)?this.b[g]:this.sa[this.M>>12&3],0<=cd(this,c)&&(this.w=this.F=c,this.B=0));break;case 3456:0<=(f=ed(this))&&((this.ba&57344||(this.Da=22),a&56)?0<=(h=fd(this,a,0))&&(h&=65535,this.u=this.M>>12&3,0<=(e=dd(this,h,F))&&(this.u=this.M>>14&3,0<=L(this,e,f)&&(this.w=this.F=f,this.B=0))):(g=a&7,6!==g||(this.M>>2&12288)===(this.M&12288)?this.b[g]=f:this.sa[this.M>>12&3]=f,this.w=this.F=f,this.B=0));break;case 3520:0<=(e=S(this, -a,F))&&(a=-(this.w>>15&1),0<=L(this,e,a)&&(this.F=a,this.B=0));break;case 35328:a&56?0<=(e=S(this,a,wb))&&0<=R(this,e,0)&&(this.w=this.D=this.B=this.F=0):(this.b[a&7]&=65280,this.w=this.D=this.B=this.F=0);break;case 35392:0<=(f=Q(this,e=S(this,a,xb)))&&(a=~f,0<=R(this,e,a)&&(this.w=this.F=a<<8,this.D=65536,this.B=0));break;case 35456:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f+1,0<=R(this,e,a)&&(this.w=this.F=a<<8,this.B=(a&(a^f))<<8));break;case 35520:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f-1,0<=R(this,e,a)&& -(this.w=this.F=a<<8,this.B=((a^f)&f)<<8));break;case 35584:0<=(f=Q(this,e=S(this,a,xb)))&&(a=-f,0<=R(this,e,a)&&(this.D=this.w=this.F=a<<8,this.B=(a&f)<<8));break;case 35648:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f+(this.D>>16&1),0<=R(this,e,a)&&(this.w=this.F=this.D=a<<8,this.B=(a&(a^f))<<8));break;case 35712:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f-(this.D>>16&1),0<=R(this,e,a)&&(this.w=this.F=this.D=a<<8,this.B=((a^f)&f)<<8));break;case 35776:0<=(f=gd(this,a))&&(this.w=this.F=f<<8,this.D=this.B=0);break; -case 35840:0<=(f=Q(this,e=S(this,a,xb)))&&(a=((this.D&65536)>>8|f)>>1,0<=R(this,e,a)&&(this.D=f<<16,this.w=this.F=a<<8,this.B=this.w^this.D>>1));break;case 35904:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f<<1|this.D>>16&1,0<=R(this,e,a)&&(this.D=this.w=this.F=a<<8,this.B=(a^f)<<8));break;case 35968:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f&128|f>>1,0<=R(this,e,a)&&(this.D=f<<16,this.w=this.F=a<<8,this.B=this.w^this.D>>1));break;case 36032:0<=(f=Q(this,e=S(this,a,xb)))&&(a=f<<1,0<=R(this,e,a)&&(this.D=this.w=this.F= -a<<8,this.B=(a^f)<<8));break;case 36160:a&56?0<=(h=fd(this,a,0))&&(this.u=this.M>>12&3,0<=(c=O(this,h|65536))&&(this.u=this.M>>14&3,0<=cd(this,c)&&(this.w=this.F=c,this.B=0))):(g=a&7,c=6!==g||(this.M>>2&12288)===(this.M&12288)?this.b[g]:this.sa[this.M>>12&3],0<=cd(this,c)&&(this.w=this.F=c,this.B=0));break;case 36224:0<=(f=ed(this))&&((this.ba&57344||(this.Da=22),a&56)?0<=(h=fd(this,a,0))&&(this.u=this.M>>12&3,0<=(e=dd(this,h|65536,F))&&(this.u=this.M>>14&3,0<=L(this,e,f)&&(this.w=this.F=f,this.B= -0))):(g=a&7,6!==g||(this.M>>2&12288)===(this.M&12288)?this.b[g]=f:this.sa[this.M>>12&3]=f,this.w=this.F=f,this.B=0));break;default:switch(a&65528){case 128:0<=(c=ed(this))&&(g=a&7,this.b[7]=this.b[g],this.b[g]=c);break;case 152:this.M&49152||(this.M=this.M&63519|(a&7)<<5,this.Oa=1);break;case 160:case 168:a&1&&(this.D=0);a&2&&(this.B=0);a&4&&(this.F=1);a&8&&(this.w=0);break;case 176:case 184:a&1&&(this.D=65536);a&2&&(this.B=32768);a&4&&(this.F=0);a&8&&(this.w=32768);break;default:switch(a){case 0:49152& -this.M?(this.L|=128,K(this,4,46)):(this.ga=3,Wc(this),console.log("HALT at "+this.b[7].toString(8)));break;case 1:f=0;if(0<(a=this.f.length))for(;0>12].call(this,a)}function sd(){--this.C} -var rd=[function(){},function(a){var b=T(this,a>>6);a&56?L(this,S(this,a,F),b):this.b[a&7]=b;ad(this,b);--this.C},function(a){var b=T(this,a>>6);a=T(this,a);bd(this,b-a,a,b);--this.C},function(a){ad(this,T(this,a>>6)&T(this,a));--this.C},function(a){hd(this,a,T(this,a>>6),md);--this.C},function(a){hd(this,a,T(this,a>>6),od);--this.C},function(a){hd(this,a,T(this,a>>6),ld);--this.C},sd,sd,function(a){var b=gd(this,a>>6),b=b&128?b|65280:b;a&56?(b&=255,R(this,S(this,a,wb),b)):this.b[a&7]=b;ad(this,b<< -8);--this.C},function(a){var b=gd(this,a>>6)<<8;a=gd(this,a)<<8;bd(this,b-a,a,b);--this.C},function(a){ad(this,(gd(this,a>>6)&gd(this,a))<<8);--this.C},function(a){id(this,a,gd(this,a>>6),nd);--this.C},function(a){id(this,a,gd(this,a>>6),pd);--this.C},function(a){hd(this,a,T(this,a>>6),qd);--this.C},sd]; -function td(a){u.call(this,"ROM",a,td);this.i=null;this.J=a.addr;this.u=a.size;this.N=a.writable;this.C=a.alias;this.I=a.file;this.P=ca(this.I);if(this.I){a=this.I;var b=da(this.P);"json"!=b&&"hex"!=b&&(a=fa()+"/api/v1/dump?file="+this.I+"&format=bytes&decimal=true");var d=this;ua(a,null,!0,function(a,b,e){ud(d,a,b,e)})}}w(td);td.prototype.Xa=function(a,b,d,c){this.G=b;this.f=d;this.H=c;vd(this)}; -td.prototype.Na=function(){if(this.Ka){if(this.H){var a=this.H,b=this.id,d=this.J,c=this.u,f=this.Ka,e=[],h;for(h in f){var g=f[h];"number"==typeof g&&(f[h]=g={o:g});var k=g.o,l=g.a;if(void 0!==k){var n=e,k=[k>>>0,h],p=pa(n,k,a.qc);0>p&&n.splice(-(p+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.N.push({hd:b,A:d,Qc:c,Ka:f,nc:e})}delete this.Ka}return!0};td.prototype.Ma=function(){return!0}; -function ud(a,b,d,c){if(c)a.oa("Unable to load system ROM (error "+c+": "+b+")");else{ab(a.oc,b,d);var f;if("["==d.charAt(0)||"{"==d.charAt(0))try{var e,h,g=eval("("+d+")");if(e=g.bytes)a.i=e;else if(e=g.words)for(a.i=Array(2*e.length),h=f=0;f>8&255;else if(e=g.data)for(a.i=Array(4*e.length),h=f=0;f>8&255,a.i[h++]=e[f]>>16&255,a.i[h++]=e[f]>>24&255;else a.i=g;a.Ka=g.symbols;if(!a.i.length){t("Empty ROM: "+ -b);return}if(1==a.i.length){t(a.i[0]);return}}catch(k){a.oa("ROM data error: "+k.message);return}else for(b=d.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.i=Array(b.length),f=0;f>>c.X].yb(f&c.G,a.i[d]&255,f)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.C?b.push(a.C):null!=a.C&&a.C.length&&(b=a.C);for(d=0;d>>f.X;0>>=f.X;0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function Ad(a,b,d,c){if(d)if(b){0>a.I&&a.C.length&&(a.I=0);if(0>a.I||b!=a.C[a.I])a.C.splice(0,0,b),a.I=0;a.I--}else a.da?b="end":b=a.C[a.I+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");d=0;var f=null;c=c||";";for(var e=0;e<=b.length;e++){var h=b.charAt(e);if('"'==h||"'"==h)f?h==f&&(f=null):f=h;else if(h==c&&!f||!h)a.push(oa(b.substring(d,e))),d=e+1}}return a} -function Bd(a,b,d){for(d=d||-1;d--&&b.length;){var c=b.pop();if(2>a.length)return!1;var f=a.pop(),e=a.pop();switch(c){case "*":c=e*f;break;case "/":if(!f)return!1;c=e/f;break;case "%":if(!f)return!1;c=e%f;break;case "+":c=e+f;break;case "-":c=e-f;break;case "<<":c=e<>":c=e>>f;break;case ">>>":c=e>>>f;break;case "<":c=e":c=e>f?1:0;break;case ">=":c=e>=f?1:0;break;case "==":c=e==f?1:0;break;case "!=":c=e!=f?1:0;break;case "&":c=e&f;break; +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];m=Nb.prototype; +m.Xa=function(a,b,d,c){this.G=b;this.b=d;this.H=c;switch(this.P){default:a=Pb;for(var f in a){var e=a[f];d=b;c=+f;for(var h=e[0]?e[0].bind(this):null,g=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,l=+f;l<=c;l+=2){var n=l&8191;void 0!==d.Ta[n]?t("I/O address already registered: "+r(d.P+n,8,!0)):d.Ta[n]=[h,g,k,e,!1]}}f=this.Ec.bind(this);b.J=this.reset.bind(this);b.Fb=f}A(this)};m.Uc=function(){return ac(this.b)}; +m.fd=function(a){bc(this.b,a&-1809|ac(this.b)&1808);this.b.W|=128}; +function cc(a){var b=a.C,d,c,f,e=b.ta>>13&7;"undefined"===typeof b.na[e]&&(b.na[e]={cache:[],postProcess:a.Vc,drive:e,blocksize:256,mapped:0,maxblock:b.cb[e]*b.Z[e],url:"rk"+e+".dsk"});b.S&=-129;switch(b.S>>1&7){case 0:b.Pb=2496;b.la=0;b.S=128;b.ta=0;break;case 1:if((b.ta>>4&511)>=b.cb[e]){b.la|=32832;b.S|=49152;break}if((b.ta&15)>=b.Z[e]){b.la|=32800;b.S|=49152;break}d=(b.ta>>4&511)*b.Z[e]+(b.ta&15);c=(b.S&48)<<12|b.Ob;f=65536-b.Qb&65535;dc(a,b.na[e],d,c,f);return;case 2:if((b.ta>>4&511)>=b.cb[e]){b.la|= +32832;b.S|=49152;break}if((b.ta&15)>=b.Z[e]){b.la|=32800;b.S|=49152;break}d=(b.ta>>4&511)*b.Z[e]+(b.ta&15);c=(b.S&48)<<12|b.Ob;f=65536-b.Qb&65535;a.Zb(b.na[e],d,c,f);return}b.Pb=e<<13|b.Pb&8176|b.ta%9&15;H(a.b,20,160,144,function(){b.S=b.S&65534|128;return!!(b.S&64)})}m.Vc=function(a,b,d,c,f){var e=this.C;e.Ob=c&65535;e.S=e.S&-49|c>>12&48;e.Qb=65536-f&65535;switch(a){case 1:e.la|=33024;e.S|=49152;break;case 2:e.la|=33792,e.S|=49152}H(this.b,20,160,144,function(){e.S=e.S&65534|128;return!!(e.S&64)})}; +function ec(a){var b=a.I,d,c,f,e=b.K>>8&3;b.K&=-2;"undefined"===typeof b.na[e]&&(b.na[e]={cache:[],postProcess:a.Wc,drive:e,blocksize:128,mapped:1,maxblock:b.cb[e]*b.Z[e],url:"rl"+e+".dsk"});switch(b.K>>1&7){case 2:b.Ya&8&&(b.K&=63);b.Ya=b.Fc[e]|b.ab&64;break;case 3:1==(b.ca&3)&&(b.ab=b.ca&4?b.ab+(b.ca&65408)&65408|b.ca<<2&64:b.ab-(b.ca&65408)&65408|b.ca<<2&64,b.ca=b.ab);break;case 4:b.Ya=b.ab;break;case 5:if(b.ca>>6>=b.cb[e]){b.K|=37888;break}if((b.ca&63)>=b.Z[e]){b.K|=37888;break}d=(b.ca>>6)*b.Z[e]+ +(b.ca&63);c=(b.Ua&63)<<16|b.Eb;f=65536-b.Ya&65535;dc(a,b.na[e],d,c,f);return;case 6:if(b.ca>>6>=b.cb[e]){b.K|=37888;break}if((b.ca&63)>=b.Z[e]){b.K|=37888;break}d=(b.ca>>6)*b.Z[e]+(b.ca&63);c=(b.Ua&63)<<16|b.Eb;f=65536-b.Ya&65535;a.Zb(b.na[e],d,c,f);return}H(a.b,20,160,112,function(){b.K|=129;return!!(b.K&64)})} +m.Wc=function(a,b,d,c,f){var e=this.I;e.Eb=c&65535;e.K=e.K&-49|c>>12&48;e.Ua=c>>16&63;e.ca=~~(d/e.Z[b.La])<<6|d%e.Z[b.La];e.ab=e.ca;e.Ya=65536-f&65535;switch(a){case 1:e.K|=33792;break;case 2:e.K|=40960}H(this.b,20,160,112,function(){e.K|=129;return!!(e.K&64)})};function fc(a){a=a.J;a.U=2176;a.Ba=0;a.pa=[4544,4544,4544,4544,4544,4544,4544,4544];a.ub=[0,0,0,0,0,0,0,0];a.kb=a.vb=a.tb=a.$a=a.hc=0} +function gc(a,b){var d=a.J,c,f,e;d.U&=-16513;d.Ba&=-2049;d.pa[b]&=-1153;H(a.b,-1,0,172);"undefined"===typeof d.na[b]&&(d.na[b]={cache:[],postProcess:a.Xc,drive:b,blocksize:256,mapped:0,maxblock:d.bc[0]*d.bb[0]*d.Z[0],url:"rp"+b+".dsk"});switch(d.U&63){case 5:d.$b[b]=d.Pa[b];d.U|=32896;d.pa[b]|=32896;d.kb|=1<=d.bc[0]||d.Ca[b]>>8>=d.bb[0]||(d.Ca[b]&255)>=d.Z[0]){d.ub[b]|=1024;d.U|=49152;break}c=(d.Pa[b]*d.bb[0]+(d.Ca[b]>>8))*d.Z[0]+ +(d.Ca[b]&255);f=(d.$a&63)<<16|d.tb;e=65536-d.vb&65535;dc(a,d.na[b],c,f,e);return;case 57:if(d.Pa[b]>=d.bc[0]||d.Ca[b]>>8>=d.bb[0]||(d.Ca[b]&255)>=d.Z[0]){d.ub[b]|=1024;d.U|=49152;break}c=(d.Pa[b]*d.bb[0]+(d.Ca[b]>>8))*d.Z[0]+(d.Ca[b]&255);f=(d.$a&63)<<16|d.tb;e=65536-d.vb&65535;a.Zb(d.na[b],c,f,e);return}H(a.b,3,160,172,function(){d.U=d.U&65534|128;d.pa[b]|=128;return!!(d.U&64)})} +m.Xc=function(a,b,d,c,f){var e=this.J;e.vb=65536-f&65535;e.tb=c&65535;e.U=e.U&-769|c>>8&768;e.$a=c>>16&63;f=~~(d/e.Z[0]);c=~~(f/e.bb[0]);e.Ca[b.La]=f%e.bb[0]<<8|d%e.Z[0];e.$b[b.La]=e.Pa[b.La]=c;e.kb|=1<=b.Sc-1&&(e.pa[b.La]|=1024);switch(a){case 1:e.Ba|=512;e.U|=49152;break;case 2:e.Ba|=2048,e.U|=49152}H(this.b,20,160,172,function(){e.pa[b.La]|=128;e.U=e.U&65534|128;return!!(e.U&64)})};m.Pc=function(){this.j.K|=128;this.j.K&64&&H(this.b,0,192,64)}; +function hc(a,b,d,c,f,e){var h=~~((e+d.Va-1)/d.Va),g=new XMLHttpRequest;2048>h&&c+2048K(this.b,a.Rc?ic(this.b,d):d,a.cache[b][f])){a.Yb(2,a,b,d,c);return}d+=2;--c}b++}a.Yb(0,a,b,d,c)}; +function dc(a,b,d,c,f){for(var e,h;0h){b.Yb(2,b,d,c,f);return}b.cache[d][e]=h;c+=2;--f}d++}b.Yb(0,b,d,c,f)}m.reset=function(){this.i.pb=this.i.pb&-120|20;this.N.Ha=0;this.N.qa=128;this.j.K=0;this.C.S=128;this.I.K=128;fc(this)}; +m.Ec=function(a,b,d){var c,f,e=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?c=e.Qa&65280:(a&1&&(b<<=8),e.Qa=b|255,c=0);break;case 4194298:if(0>b)c=e.Xb;else{a&1&&(b<<=8);if(c=b&65024){f=c>>9;do c+=34;while(f>>=1)}e.Xb=c;e.Oa=2}break;case 4194294:if(70!==e.gb)return J(e,4,222);0>b?c=e.L:c=e.L=0;break;case 4194292:if(70!==e.gb)return J(e,4,224);c=1;break;case 4194290:if(70!==e.gb)return J(e,4,226);c=0;break;case 4194288:if(70!==e.gb)return J(e,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!==e.gb)return J(e,4,232);f=a-4194272>>1;0>b?c=e.ec[f]:(c=I(this,e.ec[f],a,b,d),0<=c&&(e.ec[f]=c));break;case 4194254:return a&1?e.M>>14&1?(0<=b&&(e.f[6]=b),c=e.f[6]):(0<=b&&(e.sa[3]=b),c=e.sa[3]):e.M>>14&0?(0<=b&&(e.f[6]=b),c=e.f[6]):(0<=b&&(e.sa[1]=b),c=e.sa[1]),c;case 4194252:case 4194250:case 4194248:return f=a&7,e.M&2048?(0<=b&&(e.f[f]=b),c=e.f[f]):(0<=b&&(e.Za[f]= +b),c=e.Za[f]),c;case 4194246:return a&1?(0<=b&&(e.f[7]=b),c=e.f[7]):e.M>>14&0?(0<=b&&(e.f[6]=b),c=e.f[6]):(0<=b&&(e.sa[0]=b),c=e.sa[0]),c;case 4194244:case 4194242:case 4194240:return f=a&7,e.M&2048?(0<=b&&(e.Za[f]=b),c=e.Za[f]):(0<=b&&(e.f[f]=b),c=e.f[f]),c;default:return e.L|=16,J(e,4,124)}break;case 4194176:f=a>>1&31;c=I(this,e.ka[3][f],a,b,d);0<=c&&(e.ka[3][f]=c,e.ka[3][f&15]&=65295);break;case 4194112:var h=this.N;f=this.j;switch(a&-2){case 4194174:c=I(this,e.Ab,a,b,d);0<=c&&(e.Ab=c);break;case 4194172:c= +e.Da;c&65280&&(c=(c<<8|c>>8)&65535);break;case 4194170:e.ba=e.ba&62337|e.Jb<<5|e.Wb<<1;0>b?c=e.ba:(c=I(this,e.ba,a,b,d),0<=c&&(e.ba=c&=62337,e.Jb=c>>5&3,e.Wb=c>>1&15,c&257?(f=2,e.Ra&16&&(f=1),e.Ib=c&1?lb|B:B):(e.Ib=0,f=4),this.i.pb=this.i.pb&-8|f));break;case 4194168:0>b?c=this.i.dd&65535:(c=I(this,this.i.data,a,b,d),0<=c&&(this.i.data=c));break;case 4194166:0<=b&&(b&127&&(h.Jc=0),h.qa&=-129,H(e,100,128,52,function(){h.qa|=128;return!!(h.qa&64)}));c=0;break;case 4194164:0>b?c=h.qa:(c=I(this,h.qa, +a,b,d),0<=c&&(128==(h.qa&192)&&c&64&&H(e,8,128,52,function(){h.qa|=128;return!!(h.qa&64)}),h.qa=h.qa&128|c&-129));break;case 4194162:c=0;0>b&&(h.Ha&=-129,0b?c=h.Ha:(c=I(this,h.Ha,a,b,d),0<=c&&(h.Ha=h.Ha&128|c&-129));break;case 4194150:0>b?(c=f.K,f.K&=-129):(c=I(this,f.K,a,b,d),0<=c&&(c&64&&!f.Hb&&(setInterval(this.Pc.bind(this),25),f.Hb=1),f.K=c&-129));break;default:return e.L|= +16,J(e,4,126)}break;case 4194048:f=this.C;switch(a&-2){case 4194048:c=I(this,f.Pb,a,b,d);0<=c&&(f.Pb=c);break;case 4194050:c=I(this,f.la,a,b,d);0<=c&&(f.la=c);break;case 4194052:c=I(this,f.S,a,b,d);0<=b&&0<=c&&(f.S=c&-36993|f.S&36992,f.S&1&&cc(this));break;case 4194054:c=I(this,f.Qb,a,b,d);0<=c&&(f.Qb=c);break;case 4194056:c=I(this,f.Ob,a,b,d);0<=c&&(f.Ob=c);break;case 4194058:c=I(this,f.ta,a,b,d);0<=c&&(f.ta=c);break;case 4194060:break;case 4194062:c=I(this,f.xc,a,b,d);0<=c&&(f.xc=c);break;default:return e.L|= +16,J(e,4,128)}break;case 4193728:var g=this.J;f=g.Ba&7;switch(a&-2){case 4193728:c=I(this,g.U,a,b,d);0<=b&&0<=c&&(g.$a=g.$a&60|c>>8&3,g.U=c&17279|g.U&34944|2048,c&1&&g.U&128?gc(this,f):192==(c&192)&&H(e,0,160,172));break;case 4193730:c=I(this,g.vb,a,b,d);0<=c&&(g.vb=c);break;case 4193732:c=I(this,g.tb,a,b,d);0<=c&&(g.tb=c&65534);break;case 4193734:c=I(this,g.Ca[f],a,b,d);0<=c&&(g.Ca[f]=c&7967);break;case 4193736:c=I(this,g.Ba,a,b,d);0<=c&&(g.Ba=c&63|g.Ba&65472,c&128&&fc(this));break;case 4193738:c= +g.pa[f];break;case 4193740:c=g.ub[f];break;case 4193742:c=I(this,g.kb,a,b,d);0<=c&&(g.kb=c&255);break;case 4193744:c=g.bd[f];break;case 4193746:c=I(this,g.yc,a,b,d);0<=c&&(g.yc=c);break;case 4193748:c=I(this,g.zc[f],a,b,d);0<=c&&(g.zc[f]=c&1023);break;case 4193750:c=8210;break;case 4193752:c=g.cd[f];break;case 4193754:c=I(this,g.Ac[f],a,b,d);0<=c&&(g.Ac[f]=c);break;case 4193756:c=I(this,g.Pa[f],a,b,d);0<=c&&(g.Pa[f]=c&511);break;case 4193758:g.$b[f]=g.Pa[f];c=g.$b[f];break;case 4193760:c=g.$c[f]; +break;case 4193762:c=g.ad[f];break;case 4193764:c=g.Yc[f];break;case 4193766:c=g.Zc[f];break;case 4193768:c=I(this,g.$a,a,b,d);0<=c&&(g.$a=c&63,g.U=g.U&-769|(c&3)<<8);break;case 4193770:c=I(this,g.hc,a,b,d);0<=c&&(g.hc=c);break;default:return e.L|=16,J(e,4,132)}break;case 4192512:f=this.I;switch(a&-2){case 4192512:c=I(this,f.K,a,b,d);0<=b&&0<=c&&(f.Ua=f.Ua&60|c>>4&3,f.K=f.K&-1023|c&1022,f.K&128||ec(this));break;case 4192514:c=I(this,f.Eb,a,b,d);0<=c&&(f.Eb=c&65534);break;case 4192516:c=I(this,f.ca, +a,b,d);0<=c&&(f.ca=c);break;case 4192518:c=I(this,f.Ya,a,b,d);0<=c&&(f.Ya=c);break;case 4192520:c=I(this,f.Ua,a,b,d);0<=c&&(f.Ua=c&63,f.K=f.K&-49|(f.Ua&3)<<4);break;default:return e.L|=16,J(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?c=e.Ra:(c=I(this,e.Ra,a,b,d),0<=c&&(70!==e.gb&&(c&=-49),e.Ra=c,e.ib[0]=c&4?15:7,e.ib[1]=c&2?15:7,e.ib[3]=c&1?15:7,e.Ib&&(f=2,e.Ra&16&&(f=1),this.i.pb=this.i.pb&-8|f)));break;default:return e.L|=16,J(e,4,136)}break;case 4191424:f=a>>1&31;c=I(this,e.ka[0][f], +a,b,d);0<=c&&(e.ka[0][f]=c,e.ka[0][f&15]&=65295);break;case 4191360:f=a>>1&31;c=I(this,e.ka[1][f],a,b,d);0<=c&&(e.ka[1][f]=c,e.ka[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.gb)return J(e,4,234);f=a>>2&31;c=e.Rb[f];a&2&&(c=c>>16);c&=65535;0<=b&&(c=I(this,c,a,b,d),0<=c&&(e.Rb[f]=a&2?c<<16|e.Rb[f]&65535:e.Rb[f]&4294901760|c&65534));break;case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)c=Ob[a>>1&255];else return e.L|=16,J(e, +4,138);break;default:return e.L|=16,J(e,4,142)}d&&0<=c&&(a&1?c=c>>8:c&=255);"undefined"===typeof c&&console.log("panic(76)");return c};var Pb={};Pb[4194302]=[null,null,Nb.prototype.Uc,Nb.prototype.fd];Qa(function(){for(var a=x(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.I,0,d>>2),pc(this,lc?qc:rc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,d)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ra: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},za:function(a, +b){var d=a>>2,c=(a&3)<<3;this.b[d]=this.b[d]&~(255<>2,c=(a&3)<<3;24>c?this.b[d]=this.b[d]&~(65535<>8);this.Wa=!0},$:function(a,b){if(this.H&&null!=this.A){var d=this.H;wc(d,this.A+a,1,d.Y)&&d.ma(!0)}return this.Nb(a,b)},ga:function(a,b){if(this.H&&null!=this.A){var d=this.H;wc(d,this.A+a,2,d.Y)&&d.ma(!0)}return this.gc(a,b)},xa:function(a,b,d){if(this.H&&null!=this.A){var c=this.H; +wc(c,this.A+a,1,c.J)&&c.ma(!0)}this.O?this.C(a,b,d):this.yb(a,b,d)},Ja:function(a,b,d){if(this.H&&null!=this.A){var c=this.H;wc(c,this.A+a,2,c.J)&&c.ma(!0)}this.O?this.C(a,b,d):this.kc(a,b,d)},Y:function(a){return this.G[a]},aa:function(a){return this.G[a]},ea:function(a){return this.J.getUint16(a,!0)},ja:function(a){return a&1?this.G[a]|this.G[a+1]<<8:this.P[a>>1]},va:function(a,b){this.G[a]=b;this.Wa=!0},ya:function(a,b){this.G[a]=b;this.Wa=!0},Ia:function(a,b){this.J.setUint16(a,b,!0);this.Wa= +!0},Sa:function(a,b){a&1?(this.G[a]=b,this.G[a+1]=b>>8):this.P[a>>1]=b;this.Wa=!0}};function Db(a,b,d){a.H=b;a.i=a.j=0;d&&((a.i=d.i)&&vc(a,uc,!1),(a.j=d.j)&&tc(a,uc,!1))}function xc(a,b){b?0===--a.j&&(a.xb=a.O?a.C:a.yb,a.Cc=a.O?a.N:a.kc):0===--a.i&&(a.sb=a.Nb,a.wc=a.gc)}function tc(a,b,d){d&&a.j||(a.xb=!a.O&&b[1]||a.C,a.Cc=!a.O&&b[3]||a.N);if(d||void 0===d)a.yb=b[1]||a.C,a.kc=b[3]||a.N}function vc(a,b,d){d&&a.i||(a.sb=b[0]||a.T,a.wc=b[2]||a.V);if(d||void 0===d)a.Nb=b[0]||a.T,a.gc=b[2]||a.V} +function pc(a,b){b||(b=yc);vc(a,b,void 0);tc(a,b,void 0)}var yc=[],sc=[G.prototype.da,G.prototype.za,G.prototype.ra,G.prototype.Bb],uc=[G.prototype.$,G.prototype.xa,G.prototype.ga,G.prototype.Ja];if(kb)var rc=[G.prototype.Y,G.prototype.va,G.prototype.ea,G.prototype.Ia],qc=[G.prototype.aa,G.prototype.ya,G.prototype.ja,G.prototype.Sa]; +function zc(a,b){u.call(this,"CPU",a,zc,1);var d=a.multiplier||1;this.ya=a.cycles||b;this.jb=d;this.xa=Math.round(this.ya/1E4)/100;this.hb=this.xa*this.jb;this.u.ia=!1;this.u.jc=!1;this.u.Db=a.autoStart;this.u.sc=!1;this.u.ob=!1;this.Kb=this.Y=0;this.Lb=a.csStart;this.qb=a.csInterval;this.rb=a.csStop;this.ja=[];this.zb=this.lb.bind(this);A(this)}$a(zc);var Ac=["power","reset"];m=zc.prototype; +m.Xa=function(a,b,d,c){this.i=a;this.G=b;this.H=c;for(b=0;b=a.Y&&(a.Y+=a.qb,d=!0);0<=a.rb&&a.rb<=Sc(a)&&(a.qb=a.rb=-1,Dc(a),a.ma(),d=!0);d&&a.g(Sc(a)+" cycles: checksum="+r(a.Kb))}} +function Tc(a,b,d,c){if(a.O[b]){void 0===d&&(jb(a,"Value for "+b+" is invalid"),a.ma());var f=a.H&&a.H.xa||8;d=!a.u.ia||a.u.sc?8==f?ba(d,c):r(d,c):"--------".substr(0,c||4);a.O[b].textContent!=d&&(a.O[b].textContent=d)}} +m.ua=function(a,b,d){var c=this;a=!1;switch(b){case "power":case "reset":this.O[b]=d;a=!0;break;case "run":this.O[b]=d;d.onclick=function(){var a;if(a=c.i)if(a=c.i,a.u.fa)a=!0;else{var b=null,d,g=cb(a.id);for(d=0;da.N/a.hb?b=1:c=!0;a.jb=b;b=a.xa*a.jb;if(a.hb!=b){a.hb=b;b=a.hb.toFixed(2)+"Mhz";var f=a.O.setSpeed;f&&(f.textContent=b);a.g("target speed: "+b)}d&&a.i&&a.i.Sb()}Vc(a,a.J);a.J=0;a.I=qa();a.P=0;Wc(a);return c}function Xc(a){a.T-=a.b;a.b=0} +m.lb=function(a){if(gb(this,!0)){if(!this.u.ia){Uc(this);this.i&&this.i.start(this.I,Sc(this));this.u.ia=!0;this.u.jc=!0;this.da&&this.da.start();var b=this.O.run;b&&(b.textContent="Halt");this.i&&(this.i.wa(!0),a&&this.i.Sb(!0))}this.za>=this.ya&&Wc(this,!0);this.ea=0;this.ra=qa();this.P&&(a=this.ra-this.P,a>this.Sa&&(this.I+=a,this.I>this.ra&&(this.I=this.ra)));try{do{for(var d,c=this.u.ob?1:this.va,f=this.ja.length-1;0<=f;f--){var e=this.ja[f];0>e[0]||c>e[0]&&(c=e[0])}d=c;try{this.wb(d)}catch(l){if("number"!= +typeof l)throw l;}var h=this.T-this.b;a=h;for(var g=this.ja.length-1;0<=g;g--){var k=this.ja[g];0>k[0]||(k[0]-=a,0>=k[0]&&(k[0]=-1,k[1]()))}this.ea+=h;this.J+=h;Vc(this,0,!0);Fc(this,h);this.$-=h;if(0>=this.$){this.$+=this.va;15<=++this.mb&&(this.i&&this.i.wa(),this.mb=0);break}}while(this.u.ia)}catch(l){this.ma();Ec(this);this.i&&this.i.stop(qa(),Sc(this));gb(this,!1);jb(this,l.stack||l.message);return}d=setTimeout;c=this.zb;this.P=qa();f=this.Sa;this.ea&&(f=Math.round(f*this.ea/this.va));f=f-(this.P- +this.ra);if(e=this.P-this.I)this.N=Math.round(this.J/(10*e))/100,864E5<=e&&(this.V=0,Uc(this));if(0>f||this.Nf&&(this.I-=f),f=0;this.za+=this.ea;this.P+=f;d(c,f)}else Ec(this),this.i&&this.i.stop(qa(),Sc(this))};m.wb=function(){return 0};m.ma=function(a){hb(this,!0);Xc(this);Vc(this,this.J);this.J=0;if(this.u.ia){this.u.ia=!1;this.da&&this.da.stop();var b=this.O.run;b&&(b.textContent="Run")}this.u.complete=a};function Ec(a,b){a.i&&a.i.wa(b)} +function Yc(a){this.vc=+a.model||1170;this.Ub=a.resetAddr||0;zc.call(this,a,1E6);this.Ia=0;this.decode=Zc.bind(this);this.D=65536;this.B=32768;this.F=65535;this.w=32768;this.f=[0,0,0,0,0,0,0,this.Ub];this.Za=[0,0,0,0,0,0];this.sa=[0,0,0,0];this.memory=[];this.j=[];this.ga=this.Xb=0;this.Oa=2;this.Qa=255;this.W=0;this.aa=-1;this.L=0;this.gb=70;this.Wb=this.Jb=this.Ib=this.C=this.Ra=this.Ab=this.Da=this.ba=0;this.ib=[7,7,7,7];this.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], +[0,0,0,0,0,0,0,0,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.Rb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.ec=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.u.complete=this.u.Ic=!1}$a(Yc,zc);m=Yc.prototype; +m.reset=function(){this.u.ia&&this.ma();$c(this);Cc(this);this.u.error=!1;this.parent.reset.call(this)};function $c(a){a.Qa=255;a.L=0;a.j=[];a.Xb=0;a.ba=a.Da=a.Ab=a.Ra=a.Ib=0;a.ib[0]=a.ib[1]=a.ib[3]=7;a.Jb=0}m.uc=function(){return 0}; +m.save=function(){var a=new ad(this);M(a,0,[]);M(a,1,[this.Ja,this.V,this.jb]);for(var b=this.G,d=0,c=[],f=0;fb){a.j[e].Ea-=b;break}b-=a.j[e].Ea}a.j.splice(e+1,0,{delay:b,priority:d&224,vector:c,callback:f})}a.Oa=2}function ac(a){return a.M=a.M&63728|(a.w&32768?8:0)|(a.F&65535?0:4)|(a.B&32768?2:0)|(a.D&65536?1:0)} +function bc(a,b){a.w=b<<12;a.F=~b&4;a.B=b<<14;a.D=b<<16;if((b^a.M)&2048)for(var d=a.Za.length;0<=--d;){var c=a.f[d];a.f[d]=a.Za[d];a.Za[d]=c}a.C=b>>14&3;d=a.M>>14&3;a.C!=d&&(a.sa[d]=a.f[6],a.f[6]=a.sa[a.C]);a.Oa=2;a.M=b}function bd(a,b){a.W&128||(a.w=a.F=b,a.B=0)}function cd(a,b,d,c){a.W&128||(a.w=a.F=a.D=b,a.B=(d^c)&(c^b))} +function J(a,b,d){var c,f,e=0;0>a.aa?a.aa=ac(a):a.C||(b=4,e=1);a.ba&57344||(a.Da=63222,a.Ab=b);a.C=0;0<=(c=N(a,b|65536))&&0<=(f=N(a,b+2&65535|65536))&&(bc(a,f&53247|a.aa>>2&12288),e&&(a.L|=4,a.f[6]=4),0<=dd(a,a.aa)&&0<=dd(a,a.f[7])&&(a.f[7]=c));a.W&=-113;a.aa=-1;throw b|d<<8;}function ic(a,b){var d=b>>13&31;31>d?a.Ra&32&&(b=a.Rb[d]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} +function ed(a,b,d){var c,f,e,h=0;if(d&a.Ib){c=b>>13&a.ib[a.C];f=a.ka[a.C][c];e=(a.ka[a.C][c+16]<<6)+(b&8191)&4194303;a.Ra&16?3932160<=e&&4186112>e&&(e=ic(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.L|=32,J(a,4,24)),e&1&&!(d&1)&&(a.L|=64,J(a,4,26)));switch(f&7){case 1:h=4096;case 2:f|=128;d&B&&(h=8192);break;case 4:h=4096;case 5:d&B&&(h=4096);case 6:f|=d&B?192:128;break;default:h=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(h|=16384):(b&8128)>(f>>2& +8128)&&(h|=16384));a.ka[a.C][c]=f;if(4194170!==e||a.C)a.Jb=a.C,a.Wb=c;h&&(h&57344&&(0<=a.aa&&(h|=128),a.ba&57344||(a.ba=a.ba|h|a.Jb<<5|a.Wb<<1),J(a,168,28)),a.ba&61440||!(4191360>e||4194239>3&7){case 0:J(a,4,34);break;case 1:return 6===e&&!a.C&&d&B&&(a.f[6]<=a.Qa||65534<=a.f[6])&&(a.f[6]<=a.Qa-32||65534<=a.f[6]?(a.L|=4,a.f[6]=4,J(a,4,36)):(a.L|=8,a.W|=64)),7===e?a.f[e]:a.f[e]|65536;case 2:f=2;c=a.f[e];7!==e&&(c|=65536,6>e&&d&1&&(f=1));break;case 3:f=2;c=a.f[e];7!==e&&(c|=65536);if(0>(c=N(a,c)))return c;c|=65536;break;case 4:f=-2;6>e&&d&1&&(f=-1);c=a.f[e]+f&65535;7!==e&&(c|=65536);break;case 5:f=-2;c=a.f[e]-2&65535;7!==e&&(c|=65536);if(0>(c= +N(a,c)))return c;c|=65536;break;case 6:if(0>(c=N(a,a.f[7])))return c;a.f[7]=a.f[7]+2&65535;c=c+a.f[e]&65535;return c|65536;case 7:if(0>(c=N(a,a.f[7])))return c;a.f[7]=a.f[7]+2&65535;c=c+a.f[e]&65535;return 0>(c=N(a,c|65536))?c:c|65536}a.f[e]=a.f[e]+f&65535;a.ba&57344||(a.Da=a.Da<<8|f<<3&248|e);6===e&&!a.C&&d&B&&0>=f&&(a.f[6]<=a.Qa||65534<=a.f[6])&&(a.f[6]<=a.Qa-32?(a.L|=4,a.f[6]=4,J(a,4,38)):(a.L|=8,a.W|=64));return c} +function R(a,b,d){var c;return b&56?(0<=(c=gd(a,b,d))&&(c=ed(a,c,d)),c):4194304+(b&7)}function S(a,b){var d;b&56?(d=R(a,b,lb),d=L(a,d)):d=a.f[b&7];return d}function hd(a,b){var d;b&56?(d=R(a,b,wb),d=O(a,d)):d=a.f[b&7]&255;return d}function id(a,b,d,c){b&56?(b=R(a,b,F),K(a,b,c.call(a,d,L(a,b)))):(b&=7,a.f[b]=c.call(a,d,a.f[b]))}function jd(a,b,d,c){b&56?(b=R(a,b,yb),P(a,b,c.call(a,d,O(a,b)))):(b&=7,a.f[b]=c.call(a,d,a.f[b]))}function T(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} +m.wb=function(a){this.u.complete=!0;var b=this.u.Ic=this.H&&kd(this.H),d=a?this.u.jc?0:1:-1;this.u.jc=!1;this.T=this.b=a;this.Ja&256?(Xc(this),a=!1):a=!0;if(a){do{if(b){if(ld(this.H,this.f[7],d)){this.ma();break}d=1}var c,f,e,h,g;this.W&112&&(this.W&32?J(this,168,52):this.W&64?J(this,4,54):this.W&16&&J(this,12,56),this.W&=-113);if(this.Oa)if(1===this.Oa)this.Oa=2;else{this.Oa=0;f=-1;c=this.Xb&224;if(0<(a=this.j.length))for(;0c&&(c=this.j[a].Tc,f=a)}c>(this.M&224)&&(0>f?J(this,160,42):(J(this,this.j[f].ed,44),this.j.splice(f,1)))}this.ba&57344||(this.Da=0,this.Ab=this.f[7]);this.W=this.M&16;a=N(this,this.f[7]);this.f[7]=this.f[7]+2&65535;this.decode(a);if(0<=a)switch(a&61440){default:switch(a&65024){case 2048:0<=(h=gd(this,a,0))&&(g=a>>6&7,0<=dd(this,this.f[g])&&(this.f[g]=this.f[7],this.f[7]=h&65535));break;case 28672:0<=(c=S(this,a))&&(g=a>>6&7,c&32768&&(c|=-65536),f=this.f[g], +f&32768&&(f|=-65536),a=~~(c*f),this.f[g]=a>>16&65535,this.f[g|1]=a&65535,this.w=a>>16,this.F=this.w|a,this.D=this.B=0,-32768>a||32767>6&7,f=this.f[g]<<16|this.f[g|1],this.D=this.B=0,c&32768&&(c|=-65536),a=~~(f/c),-32768<=a&&32767>=a?(this.f[g]=a&65535,this.f[g|1]=f-a*c&65535,this.F=a>>16|a,this.w=a>>16):(this.B=32768,this.F=a>>15|a,this.w=f>>16,-1===c&&65534===this.f[g]&&(this.f[g]=this.f[g|1]=1))):(this.F=this.w=0,this.B=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.B=0,c&=63,c&32?(c=64-c,16>c):c&&(16>15&65535)&&65535!==f&&(this.B=32768))),this.f[g]=a&65535,this.w=this.F=a);break;case 30208:if(0<=(c=S(this,a))){g=a>>6&7;f=this.f[g]<<16|this.f[g|1];this.D=this.B=0;c&=63;if(c&32)c=64-c,32>c-1,this.D=a<<16,a>>=1,f&2147483648&&(a|=4294967295<<32-c);else if(c){if(a=f<> +15,a<<=1,32>=32-c)f|=4294967295<>16&65535;this.f[g|1]=a&65535;this.w=a>>16;this.F=a>>16|a}break;case 30720:a&56?0<=(f=L(this,e=R(this,a,F)))&&(f^=this.f[a>>6&7],0<=K(this,e,f)&&(this.w=this.F=f,this.B=0)):(this.w=this.F=f=this.f[a&7]^=this.f[a>>6&7],this.B=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.w&32768)===(this.B&32768)&&(this.f[7]=T(this.f[7],a));break;case 1280:(this.w&32768)!==(this.B&32768)&&(this.f[7]=T(this.f[7],a));break;case 1536:this.F&65535&&(this.w&32768)===(this.B&32768)&&(this.f[7]=T(this.f[7],a));break;case 1792:this.F&65535&&(this.w&32768)===(this.B&32768)||(this.f[7]=T(this.f[7],a));break;case 32768:this.w&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.w&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.B&32768||(this.f[7]=T(this.f[7],a));break;case 34048:this.B&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:J(this,24,2);break;case 35072:J(this,28,4);break;default:switch(a& +65472){case 64:0<=(h=gd(this,a,0))&&(this.f[7]=h&65535);break;case 192:a&56?0<=(f=L(this,e=R(this,a,F)))&&(a=f<<8|f>>8,0<=K(this,e,a)&&(this.w=this.F=f&65280,this.B=this.D=0)):(g=a&7,f=this.f[g],this.f[g]=(f<<8|f>>8)&65535,this.w=this.F=f&65280,this.B=this.D=0);break;case 2560:a&56?0<=(e=R(this,a,B))&&0<=K(this,e,0)&&(this.w=this.D=this.B=this.F=0):this.w=this.D=this.B=this.F=this.f[a&7]=0;break;case 2624:0<=(f=L(this,e=R(this,a,F)))&&(a=~f,0<=K(this,e,a)&&(this.w=this.F=a,this.D=65536,this.B=0)); +break;case 2688:a&56?0<=(f=L(this,e=R(this,a,F)))&&(a=f+1,0<=K(this,e,a)&&(this.w=this.F=a,this.B=a&(a^f))):(g=a&7,f=this.f[g],a=f+1,this.f[g]=a&65535,this.w=this.F=a,this.B=a&(a^f));break;case 2752:a&56?0<=(f=L(this,e=R(this,a,F)))&&(a=f-1,0<=K(this,e,a)&&(this.w=this.F=a,this.B=(a^f)&f)):(g=a&7,f=this.f[g],a=f-1,this.f[g]=a&65535,this.w=this.F=a,this.B=(a^f)&f);break;case 2816:0<=(f=L(this,e=R(this,a,F)))&&(a=-f,0<=K(this,e,a)&&(this.D=this.w=this.F=a,this.B=a&f));break;case 2880:0<=(f=L(this,e= +R(this,a,F)))&&(a=f+(this.D>>16&1),0<=K(this,e,a)&&(this.D=this.w=this.F=a,this.B=a&(a^f)));break;case 2944:0<=(f=L(this,e=R(this,a,F)))&&(a=f-(this.D>>16&1),0<=K(this,e,a)&&(this.D=this.w=this.F=a,this.B=(a^f)&f));break;case 3008:0<=(f=S(this,a))&&(this.w=this.F=f,this.D=this.B=0);break;case 3072:a&56?0<=(f=L(this,e=R(this,a,F)))&&(a=(this.D&65536|f)>>1,0<=K(this,e,a)&&(this.D=f<<16,this.w=this.F=a,this.B=a^this.D>>1)):(g=a&7,f=this.f[g],a=(this.D&65536|f)>>1,this.f[g]=a&65535,this.D=f<<16,this.w= +this.F=a,this.B=a^this.D>>1);break;case 3136:a&56?0<=(f=L(this,e=R(this,a,F)))&&(a=f<<1|this.D>>16&1,0<=K(this,e,a)&&(this.D=this.w=this.F=a,this.B=a^f)):(g=a&7,f=this.f[g],a=f<<1|this.D>>16&1,this.f[g]=a&65535,this.D=this.w=this.F=a,this.B=a^f);break;case 3200:a&56?0<=(f=L(this,e=R(this,a,F)))&&(a=f&32768|f>>1,0<=K(this,e,a)&&(this.D=f<<16,this.w=this.F=a,this.B=this.w^this.D>>1)):(g=a&7,f=this.f[g],a=f&32768|f>>1,this.f[g]=a&65535,this.D=f<<16,this.w=this.F=a,this.B=this.w^this.D>>1);break;case 3264:a& +56?0<=(f=L(this,e=R(this,a,F)))&&(a=f<<1,0<=K(this,e,a)&&(this.D=this.w=this.F=a,this.B=a^f)):(g=a&7,f=this.f[g],a=f<<1,this.f[g]=a&65535,this.D=this.w=this.F=a,this.B=a^f);break;case 3328:h=this.f[7]+((a&63)<<1)&65535;0<=(c=N(this,h|65536))&&(this.f[7]=this.f[5],this.f[5]=c,this.f[6]=h+2&65535);break;case 3392:a&56?0<=(h=gd(this,a,0))&&(61440!==(this.M&61440)&&(h&=65535),this.C=this.M>>12&3,0<=(c=N(this,h))&&(this.C=this.M>>14&3,0<=dd(this,c)&&(this.w=this.F=c,this.B=0))):(g=a&7,c=6!==g||(this.M>> +2&12288)===(this.M&12288)?this.f[g]:this.sa[this.M>>12&3],0<=dd(this,c)&&(this.w=this.F=c,this.B=0));break;case 3456:0<=(f=fd(this))&&((this.ba&57344||(this.Da=22),a&56)?0<=(h=gd(this,a,0))&&(h&=65535,this.C=this.M>>12&3,0<=(e=ed(this,h,B))&&(this.C=this.M>>14&3,0<=K(this,e,f)&&(this.w=this.F=f,this.B=0))):(g=a&7,6!==g||(this.M>>2&12288)===(this.M&12288)?this.f[g]=f:this.sa[this.M>>12&3]=f,this.w=this.F=f,this.B=0));break;case 3520:0<=(e=R(this,a,B))&&(a=-(this.w>>15&1),0<=K(this,e,a)&&(this.F=a, +this.B=0));break;case 35328:a&56?0<=(e=R(this,a,xb))&&0<=P(this,e,0)&&(this.w=this.D=this.B=this.F=0):(this.f[a&7]&=65280,this.w=this.D=this.B=this.F=0);break;case 35392:0<=(f=O(this,e=R(this,a,yb)))&&(a=~f,0<=P(this,e,a)&&(this.w=this.F=a<<8,this.D=65536,this.B=0));break;case 35456:0<=(f=O(this,e=R(this,a,yb)))&&(a=f+1,0<=P(this,e,a)&&(this.w=this.F=a<<8,this.B=(a&(a^f))<<8));break;case 35520:0<=(f=O(this,e=R(this,a,yb)))&&(a=f-1,0<=P(this,e,a)&&(this.w=this.F=a<<8,this.B=((a^f)&f)<<8));break;case 35584:0<= +(f=O(this,e=R(this,a,yb)))&&(a=-f,0<=P(this,e,a)&&(this.D=this.w=this.F=a<<8,this.B=(a&f)<<8));break;case 35648:0<=(f=O(this,e=R(this,a,yb)))&&(a=f+(this.D>>16&1),0<=P(this,e,a)&&(this.w=this.F=this.D=a<<8,this.B=(a&(a^f))<<8));break;case 35712:0<=(f=O(this,e=R(this,a,yb)))&&(a=f-(this.D>>16&1),0<=P(this,e,a)&&(this.w=this.F=this.D=a<<8,this.B=((a^f)&f)<<8));break;case 35776:0<=(f=hd(this,a))&&(this.w=this.F=f<<8,this.D=this.B=0);break;case 35840:0<=(f=O(this,e=R(this,a,yb)))&&(a=((this.D&65536)>> +8|f)>>1,0<=P(this,e,a)&&(this.D=f<<16,this.w=this.F=a<<8,this.B=this.w^this.D>>1));break;case 35904:0<=(f=O(this,e=R(this,a,yb)))&&(a=f<<1|this.D>>16&1,0<=P(this,e,a)&&(this.D=this.w=this.F=a<<8,this.B=(a^f)<<8));break;case 35968:0<=(f=O(this,e=R(this,a,yb)))&&(a=f&128|f>>1,0<=P(this,e,a)&&(this.D=f<<16,this.w=this.F=a<<8,this.B=this.w^this.D>>1));break;case 36032:0<=(f=O(this,e=R(this,a,yb)))&&(a=f<<1,0<=P(this,e,a)&&(this.D=this.w=this.F=a<<8,this.B=(a^f)<<8));break;case 36160:a&56?0<=(h=gd(this, +a,0))&&(this.C=this.M>>12&3,0<=(c=N(this,h|65536))&&(this.C=this.M>>14&3,0<=dd(this,c)&&(this.w=this.F=c,this.B=0))):(g=a&7,c=6!==g||(this.M>>2&12288)===(this.M&12288)?this.f[g]:this.sa[this.M>>12&3],0<=dd(this,c)&&(this.w=this.F=c,this.B=0));break;case 36224:0<=(f=fd(this))&&((this.ba&57344||(this.Da=22),a&56)?0<=(h=gd(this,a,0))&&(this.C=this.M>>12&3,0<=(e=ed(this,h|65536,B))&&(this.C=this.M>>14&3,0<=K(this,e,f)&&(this.w=this.F=f,this.B=0))):(g=a&7,6!==g||(this.M>>2&12288)===(this.M&12288)?this.f[g]= +f:this.sa[this.M>>12&3]=f,this.w=this.F=f,this.B=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.M&49152||(this.M=this.M&63519|(a&7)<<5,this.Oa=1);break;case 160:case 168:a&1&&(this.D=0);a&2&&(this.B=0);a&4&&(this.F=1);a&8&&(this.w=0);break;case 176:case 184:a&1&&(this.D=65536);a&2&&(this.B=32768);a&4&&(this.F=0);a&8&&(this.w=32768);break;default:switch(a){case 0:49152&this.M?(this.L|=128,J(this,4,46)):(this.ga=3,Xc(this),console.log("HALT at "+ +this.f[7].toString(8)));break;case 1:f=0;if(0<(a=this.j.length))for(;0>12].call(this,a)} +var zd=[function(a){Ad[a>>8&15].call(this,a)},function(a){var b=S(this,a>>6);a&56?K(this,R(this,a,B),b):this.f[a&7]=b;bd(this,b);--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),nd);--this.b},function(a){id(this,a,S(this,a>>6),pd);--this.b},function(a){id(this,a,S(this,a>>6),md);--this.b},function(a){Bd[a>>8&15].call(this,a)},function(a){Cd[a>>8&15].call(this,a)},function(a){var b= +hd(this,a>>6),b=b&128?b|65280:b;a&56?(b&=255,P(this,R(this,a,xb),b)):this.f[a&7]=b;bd(this,b<<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),od);--this.b},function(a){jd(this,a,hd(this,a>>6),qd);--this.b},function(a){id(this,a,S(this,a>>6),rd);--this.b},U],Ad=[function(a){Dd[a>>4&15].call(this,a)},function(){--this.b},function(){--this.b},function(){--this.b}, +function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},vd,vd,function(a){Ed[a>>6&3].call(this,a)},function(a){Fd[a>>6&3].call(this,a)},function(a){Gd[a>>6&3].call(this,a)},function(a){Hd[a>>6&3].call(this,a)},U,U],Dd=[function(a){Id[a&15].call(this,a)},U,U,U,U,U,U,U,U,U,function(){--this.b},function(){--this.b},U,U,U,U],Id=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}, +function(){--this.b},U,U,U,U,U,U,U,U],Bd=[wd,wd,ud,ud,sd,sd,td,td,yd,yd,U,U,U,U,xd,xd],Cd=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(a){Jd[a>>6&3].call(this,a)},function(a){Kd[a>>6&3].call(this,a)},function(a){Ld[a>>6&3].call(this,a)},function(a){Md[a>>6&3].call(this,a)},U,U],Ed=[function(){--this.b},function(){--this.b},function(){--this.b}, +function(){--this.b}],Fd=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],Gd=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],Hd=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],Jd=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],Kd=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],Ld=[function(){--this.b},function(){--this.b}, +function(){--this.b},function(){--this.b}],Md=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}];function Nd(a){u.call(this,"ROM",a,Nd);this.i=null;this.J=a.addr;this.j=a.size;this.N=a.writable;this.C=a.alias;this.I=a.file;this.P=ca(this.I);if(this.I){a=this.I;var b=da(this.P);"json"!=b&&"hex"!=b&&(a=fa()+"/api/v1/dump?file="+this.I+"&format=bytes&decimal=true");var d=this;ua(a,null,!0,function(a,b,e){Od(d,a,b,e)})}}$a(Nd); +Nd.prototype.Xa=function(a,b,d,c){this.G=b;this.b=d;this.H=c;Pd(this)};Nd.prototype.Na=function(){if(this.Ka){if(this.H){var a=this.H,b=this.id,d=this.J,c=this.j,f=this.Ka,e=[],h;for(h in f){var g=f[h];"number"==typeof g&&(f[h]=g={o:g});var k=g.o,l=g.a;if(void 0!==k){var n=e,k=[k>>>0,h],p=pa(n,k,a.qc);0>p&&n.splice(-(p+1),0,k)}l&&(g.a=l.replace(/''/g,'"'))}a.N.push({hd:b,A:d,Qc:c,Ka:f,mc:e})}delete this.Ka}return!0};Nd.prototype.Ma=function(){return!0}; +function Od(a,b,d,c){if(c)a.oa("Unable to load system ROM (error "+c+": "+b+")");else{bb(a.nc,b,d);var f;if("["==d.charAt(0)||"{"==d.charAt(0))try{var e,h,g=eval("("+d+")");if(e=g.bytes)a.i=e;else if(e=g.words)for(a.i=Array(2*e.length),h=f=0;f>8&255;else if(e=g.data)for(a.i=Array(4*e.length),h=f=0;f>8&255,a.i[h++]=e[f]>>16&255,a.i[h++]=e[f]>>24&255;else a.i=g;a.Ka=g.symbols;if(!a.i.length){t("Empty ROM: "+ +b);return}if(1==a.i.length){t(a.i[0]);return}}catch(k){a.oa("ROM data error: "+k.message);return}else for(b=d.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.i=Array(b.length),f=0;f>>c.X].yb(f&c.G,a.i[d]&255,f)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.C?b.push(a.C):null!=a.C&&a.C.length&&(b=a.C);for(d=0;d>>f.X;0>>=f.X;0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function re(a,b,d,c){if(d)if(b){0>a.I&&a.C.length&&(a.I=0);if(0>a.I||b!=a.C[a.I])a.C.splice(0,0,b),a.I=0;a.I--}else a.da?b="end":b=a.C[a.I+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");d=0;var f=null;c=c||";";for(var e=0;e<=b.length;e++){var h=b.charAt(e);if('"'==h||"'"==h)f?h==f&&(f=null):f=h;else if(h==c&&!f||!h)a.push(oa(b.substring(d,e))),d=e+1}}return a} +function se(a,b,d){for(d=d||-1;d--&&b.length;){var c=b.pop();if(2>a.length)return!1;var f=a.pop(),e=a.pop();switch(c){case "*":c=e*f;break;case "/":if(!f)return!1;c=e/f;break;case "%":if(!f)return!1;c=e%f;break;case "+":c=e+f;break;case "-":c=e-f;break;case "<<":c=e<>":c=e>>f;break;case ">>>":c=e>>>f;break;case "<":c=e":c=e>f?1:0;break;case ">=":c=e>=f?1:0;break;case "==":c=e==f?1:0;break;case "!=":c=e!=f?1:0;break;case "&":c=e&f;break; case "^":c=e^f;break;case "|":c=e|f;break;case "&&":c=e&&f?1:0;break;case "||":c=e||f?1:0;break;default:return!1}a.push(c|0)}return!0} -function Cd(a,b,d){var c;if(b){b=Dd(a,b);for(var f=0,e=!1,h=b,g=[],k=[],l=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);f>=1;h=n+h;c>>=8}c=r(d,0,!0)+" "+d+". "+ba(d,0,!0)+" "+("0b"+h)}a.g((null!=b?b+": ":"")+c);return f} -function Gd(a,b){if(b)return Fd(a,b,a.ga[b]);var d=0;for(b in a.ga)Fd(a,b,a.ga[b]),d++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);f>=1;h=n+h;c>>=8}c=r(d,0,!0)+" "+d+". "+ba(d,0,!0)+" "+("0b"+h)}a.g((null!=b?b+": ":"")+c);return f} +function xe(a,b){if(b)return we(a,b,a.ga[b]);var d=0;for(b in a.ga)we(a,b,a.ga[b]),d++;return 0>>c.G.X;k=1}c.g("blockid physical blockaddr used size type");c.g("-------- --------- ---------- ------ ------ ----");for(var d=-1,l=0;k--;){var n=b[g];n.type==d?l++||c.g("..."):(d=n.type,l=Kb[d],n&&c.g(r(n.id,8)+" %"+r(g<>>d.X].Ob(c&d.G,c),b&&oe(a,b));return d};m.Ha=function(a,b){var d=65535,c=Z(a);-1!==c&&(d=Lb(this.G,c),b&&oe(a,b));return d}; -m.bc=function(a,b,d){var c=Z(a);if(-1!==c){var f=this.G;f.R[(c&f.i)>>>f.X].yb(c&f.G,b&255,c);d&&oe(a,d);Dc(this.f,!0)}};m.jc=function(a,b,d){var c=Z(a);if(-1!==c){var f=this.G,e=c&f.G,h=(c&f.i)>>>f.X;e!=f.G?f.R[h].lc(e,b&65535,c):(f.R[h++].yb(e,b&255,c),f.R[h&f.u].yb(0,b>>8&255,c+1));d&&oe(a,d);Dc(this.f,!0)}};function W(a){return{A:a,Ga:!1}}function pe(a){return[a.A,a.Ga]}function qe(a){return{A:a[0],Ga:a[1]}} -function ne(a,b,d){var c;d=(d?a.V:a.zb).A;if(void 0!==b){c=b=Dd(a,b);var f;if(c.match(/^[a-z_][a-z0-9_]*$/i))for(c=c.toUpperCase(),d=0;df&&(f+=d.length);0>f&&(f=0);for(var e=d.length;f>>c.X],!1)}a.Y=["br"];if(void 0!==a.J)for(b=1;b>>c.X],!0);a.J=["bw"];a.Eb=0} -m.eb=function(a,b,d){var c=!0;d||we(this,a,b,!1,!0);if(a!=this.u){var f=Z(b);if(-1===f)this.g("invalid address: "+V(this,b.A)),c=!1;else{var e=this.G;e.R[f>>>e.X].eb(f&e.G,a==this.J)}}c&&(a.push(b),d?b.Ga=!0:(xe(this,a,a.length-1,"set"),Jd(this)));return c};function we(a,b,d,c,f){var e=!1;d=Z(d);for(var h=1;h>>c.X],b==a.J));g.Ga||Jd(a);break}}return e} -function ye(a,b){for(var d=1;d>23,y=p.A+y&65535,x=V(q,y);else if(8192==y)y=(e&63)<<1,y=p.A-y&65535,x=V(q,y);else if(12288==y)y=e&7,x=V(q,y,2);else if(24576==y)y=e&63,x=V(q,y);else if(y=e&C,C&4032&&(y>>=6,C>>=6),C&63){var C=void 0,B=y&7;switch(y&56){case 0:x=Be(B);break;case 8:x= -"@"+Be(B);break;case 16:7>B?x="("+Be(B)+")+":(C=q.Ha(p,2),x="#"+V(q,C));break;case 24:7>B?x="@("+Be(B)+")+":(C=q.Ha(p,2),x="@#"+V(q,C));break;case 32:x="-("+Be(B)+")";break;case 40:x="@-("+Be(B)+")";break;case 48:C=q.Ha(p,2);x=V(q,C)+"("+Be(B)+")";7==B&&(x=[x,V(q,C+p.A&65535)]);break;case 56:C=q.Ha(p,2),x="@"+V(q,C)+"("+Be(B)+")",7==B&&(x=[x,V(q,C+p.A&65535)])}}q=x;if(!q||!q.length){g="INVALID";break}"string"!=typeof q&&(d||(d=q[1]),q=q[0]);0a?"R"+a:6==a?"SP":"PC"} -function De(a,b){var d="",c=a.f;8>b?(d=Be(b),d+="="+V(a,c.b[b])):13>b?d="A"+(b-8)+"="+V(a,c.Za[b-8]):16<=b&&20>b?d="S"+(b-16)+"="+V(a,c.sa[b-16]):20==b&&(d="PS="+V(a,$b(c)));d&&(d+=" ");return d}function Ee(a){var b,d="";for(b=0;6>b;b++)d+=De(a,b);d=d+"\n"+(De(a,6)+De(a,7)+De(a,20));return d+=Ce(a,"T")+Ce(a,"N")+Ce(a,"Z")+Ce(a,"V")+Ce(a,"C")}m.qc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,g=e.Qc;if(f>=h&&fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],e=null);e=Ae(a,b,h,e);a.g(e);a.V=b;f-=b.A-k;d++}}} -function ze(a,b,d){var c=!0;try{b.length&&"end"!=b?d||a.g(">> "+b):(a.da&&(a.g("ended assemble at "+V(a,a.aa.A)),a.V=a.aa,a.da=!1),b="");var f=b.charAt(0);if('"'==f||"'"==f)return!0;a.za=null;if(hb(a)&&0l||"z"ia.length&&(a.g("note: only "+ia.length+" available"),Y=ia.length);P-=Y;0>P&&(null==ia[ia.length-1].A?(Y=P+Y,P=0):P+=ia.length);var Ic=[];"call"==Sd&&(Oa=1E5,Ic=["CALL"]);for(void 0!==Rd&&a.g(Y+" instructions earlier:");0=ia.length&& -(P=0);a.Vb=Y;Ud++;Oa--}}Ud||(a.g("no "+Td+"history available"),a.Vb=void 0)}else{var Pb=ne(a,ga);if(Pb){var Qb=0;xa&&("l"==xa.charAt(0)&&(xa=xa.substr(1)||df),Qb=Ed(a,xa)>>>0,65536>4||1;ff--&&0Ub?String.fromCharCode(Ub):".";Sb--}ya&& -(ya+="\n");ya+=ga+" "+nb+(0==mb?" "+Kc:"")}ya&&a.g(ya);a.zb=Pb}}}}break;case "e":if("else"==e[0])break;var Vb=1,Xd=255,Yd=a.Hb,Zd=a.bc;"ew"==e[0]&&(Vb=2,Xd=65535,Yd=a.Ha,Zd=a.jc);var $d=Vb<<1,ae=e[1];if(null==ae)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var Wb=ne(a,ae);if(Wb)for(var Xb=2;XbOc;){for(var za=null,kf=256;65536>qb.A>>>0;){ce.A=a.Ha(qb,2);if(null==qb.A||!kf--)break;for(var lf=a,Yb=ce,de=null,rb=Yb.A,ee=rb,Pc=1;6>=Pc&&rb;Pc++){if(2\nLicense: GPL version 3 or later ");this.g("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bOe){if(Qe(c,this.T)){this.J=new $c(this,"1.30.0","failsafe");Qe(this.J)&&(We(this,c),a=2,Xe(this.J));N(this.J,"timestamp",ta());Ye(this.J);var f=this.i&&!this.N;if(1==a||va("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(d=Ue(c)){var e=Ve(c,"code"),h=Ve(c,"data");e&&("ok"==e?Qe(c,h):("error"== -e&&"no machine state"!=h?(this.oa("Error: "+h),"unable to verify user"==h&&(Ca("user",""),this.u=null)):this.g(e+": "+h),Xe(c),Qe(c)?(d=Ue(c),f=!0):d=!1))}f&&Te(this,d?c:null)}else 2==a&&c.clear()}else Te(this);delete this.T;delete this.V}f=bb(this.id);for(e=0;ea[1];a=a[2];this.ja=!0;this.j.fa=!0;var c=this.O.power;c&&(c.textContent="Shutdown");this.f&&(Ze(this,this.f,b,d,a),this.f.Db());this.aa&&(We(this,b),b.clear());!d&&this.J&&(this.J.clear(),delete this.J);this.C=0}; -function We(a,b){if(va("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.u||"",c=b.toString(),f={app:"PDP11js",ver:"1.30.0"};f.url=a.url;f.user=d;f.type="bug";f.data=c;ua("http://www.pcjs.org/api/v1/report",f,!0)}} -function Le(a,b,d){var c,f="none";if(a.C)return null;a.C--;var e=new $c(a,"1.30.0"),h=new $c(a,"1.30.0","validate"),g=ta();N(h,"timestamp",g);N(e,"timestamp",g);N(e,"version","1.30.0");N(e,"url",window?window.location.href:null);N(e,"browser",window?window.navigator.userAgent:"");a.f&&a.f.Ma&&(d&&a.f.ma(),c=a.f.Ma(b,d),"object"===typeof c&&N(e,a.f.id,c),d&&(a.f.j.fa=!1,!1===c&&(f=null)));for(var g=bb(a.id),k=0;kg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);c?"}"==c.slice(-1)?(c=c.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+d+"$2"+(c?" parms='"+c+"'":"")+(g?' url="'+g+'"':""))}f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=c[2];b("Loading "+f+"...");ua(f,null,!0,function(e,h,g){if(g||!h)d(a,"unable to resolve XML reference: "+c[0]+" ("+g+")");else{if(e=c[3])if(g=h.match(new RegExp("<"+c[1]+"[^>]*>"))){for(var k=g[0],l,n=/( [a-z]+=)(['"])(.*?)\2/g;l=n.exec(e);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{d(a,"missing <"+c[1]+"> in "+f);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(c[0],h);rf(a,b,d)}})}else d(a,null)} -function sf(a,b,d,c){function f(a){if(void 0===g){var b=h&&A(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ma(a))}function e(a){f("Error: "+a);k&&(--cf||Sa(!0));k=!1}var h,g,k=!0;cf++;$a[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=l:p.appendChild(document.createTextNode(l));n.appendChild(p)}d|| -(d="/versions/pdp11/1.30.0/components.xsl");l=function(c,g){g?pf(d,null,null,!1,f,function(c,k){if(k)if(ab(a,d,c),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--cf||Sa(!0)):e("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--cf||Sa(!0)):e("invalid machine element: "+ -a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser");else e(c)}):e(c)};"<"!=b.charAt(0)?pf(b,a,c,!0,f,l):qf(b,null,a,c,!1,f,l)}else e("missing machine element: "+a)}catch(q){e(q.message)}return k}window.embedPDP11=function(a,b,d,c){Sa(!1);return sf(a,b,d,c)};window.enableEvents=Sa;window.sendEvent=Ta;})(); +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]}};m=ye.prototype; +m.Xa=function(a,b,d,c){this.G=b;this.b=d;this.i=a;(a=Bc(a,"messages"))&&Be(this,a);this.rc=Fe;Ge(this,function(a){a:{var b=c.G.R,d=a[0],g=a=0,k=b.length;if(d){a=X(He(c,d));if(-1===a){c.g("invalid address: "+d);break a}g=a>>>c.G.X;k=1}c.g("blockid physical blockaddr used size type");c.g("-------- --------- ---------- ------ ------ ----");for(var d=-1,l=0;k--;){var n=b[g];n.type==d?l++||c.g("..."):(d=n.type,l=Lb[d],n&&c.g(r(n.id,8)+" %"+r(g<>>d.X].Nb(c&d.G,c),b&&Ie(a,b));return d};m.Ga=function(a,b){var d=65535,c=X(a);-1!==c&&(d=Mb(this.G,c),b&&Ie(a,b));return d}; +m.ac=function(a,b,d){var c=X(a);if(-1!==c){var f=this.G;f.R[(c&f.i)>>>f.X].yb(c&f.G,b&255,c);d&&Ie(a,d);Ec(this.b,!0)}};m.ic=function(a,b,d){var c=X(a);if(-1!==c){var f=this.G,e=c&f.G,h=(c&f.i)>>>f.X;e!=f.G?f.R[h].kc(e,b&65535,c):(f.R[h++].yb(e,b&255,c),f.R[h&f.j].yb(0,b>>8&255,c+1));d&&Ie(a,d);Ec(this.b,!0)}};function W(a){return{A:a,Fa:!1}}function Je(a){return[a.A,a.Fa]}function Ke(a){return{A:a[0],Fa:a[1]}} +function He(a,b,d){var c;d=(d?a.V:a.zb).A;if(void 0!==b){c=b=ue(a,b);var f;if(c.match(/^[a-z_][a-z0-9_]*$/i))for(c=c.toUpperCase(),d=0;df&&(f+=d.length);0>f&&(f=0);for(var e=d.length;f>>c.X],!1)}a.Y=["br"];if(void 0!==a.J)for(b=1;b>>c.X],!0);a.J=["bw"];a.Ub=0} +m.eb=function(a,b,d){var c=!0;d||Qe(this,a,b,!1,!0);if(a!=this.j){var f=X(b);if(-1===f)this.g("invalid address: "+V(this,b.A)),c=!1;else{var e=this.G;e.R[f>>>e.X].eb(f&e.G,a==this.J)}}c&&(a.push(b),d?b.Fa=!0:(Re(this,a,a.length-1,"set"),Ae(this)));return c};function Qe(a,b,d,c,f){var e=!1;d=X(d);for(var h=1;h>>c.X],b==a.J));g.Fa||Ae(a);break}}return e} +function Se(a,b){for(var d=1;d>23,z=p.A+z&65535,y=V(q,z);else if(8192==z)z=(e&63)<<1,z=p.A-z&65535,y=V(q,z);else if(12288==z)z=e&7,y=V(q,z,2);else if(24576==z)z=e&63,y=V(q,z);else if(z=e&D,D&4032&&(z>>=6,D>>=6),D&63){var D=void 0,C=z&7;switch(z&56){case 0:y=Ve(C);break;case 8:y= +"@"+Ve(C);break;case 16:7>C?y="("+Ve(C)+")+":(D=q.Ga(p,2),y="#"+V(q,D));break;case 24:7>C?y="@("+Ve(C)+")+":(D=q.Ga(p,2),y="@#"+V(q,D));break;case 32:y="-("+Ve(C)+")";break;case 40:y="@-("+Ve(C)+")";break;case 48:D=q.Ga(p,2);y=V(q,D)+"("+Ve(C)+")";7==C&&(y=[y,V(q,D+p.A&65535)]);break;case 56:D=q.Ga(p,2),y="@"+V(q,D)+"("+Ve(C)+")",7==C&&(y=[y,V(q,D+p.A&65535)])}}q=y;if(!q||!q.length){g="INVALID";break}"string"!=typeof q&&(d||(d=q[1]),q=q[0]);0a?"R"+a:6==a?"SP":"PC"} +function Xe(a,b){var d="",c=a.b;8>b?(d=Ve(b),d+="="+V(a,c.f[b])):13>b?d="A"+(b-8)+"="+V(a,c.Za[b-8]):16<=b&&20>b?d="S"+(b-16)+"="+V(a,c.sa[b-16]):20==b&&(d="PS="+V(a,ac(c)));d&&(d+=" ");return d}function Ye(a){var b,d="";for(b=0;6>b;b++)d+=Xe(a,b);d=d+"\n"+(Xe(a,6)+Xe(a,7)+Xe(a,20));return d+=We(a,"T")+We(a,"N")+We(a,"Z")+We(a,"V")+We(a,"C")}m.qc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,g=e.Qc;if(f>=h&&fg[0].indexOf("+"))){var l=g[0]+":";g[2]&&(l+=" "+g[2]);a.g(l)}g[3]&&(h=g[3],e=null);e=Ue(a,b,h,e);a.g(e);a.V=b;f-=b.A-k;d++}}} +function Te(a,b,d){var c=!0;try{b.length&&"end"!=b?d||a.g(">> "+b):(a.da&&(a.g("ended assemble at "+V(a,a.aa.A)),a.V=a.aa,a.da=!1),b="");var f=b.charAt(0);if('"'==f||"'"==f)return!0;a.za=null;if(ib(a)&&0l||"z"ja.length&&(a.g("note: only "+ja.length+" available"),Z=ja.length);Q-=Z;0>Q&&(null==ja[ja.length-1].A?(Z=Q+Z,Q=0):Q+=ja.length);var Ic=[];"call"==Zd&&(Pa=1E5,Ic=["CALL"]);for(void 0!==Yd&&a.g(Z+" instructions earlier:");0=ja.length&& +(Q=0);a.oc=Z;ae++;Pa--}}ae||(a.g("no "+$d+"history available"),a.oc=void 0)}else{var Qb=He(a,ha);if(Qb){var Rb=0;ya&&("l"==ya.charAt(0)&&(ya=ya.substr(1)||yf),Rb=ve(a,ya)>>>0,65536>4||1;Af--&&0Vb?String.fromCharCode(Vb):".";Tb--}za&& +(za+="\n");za+=ha+" "+ob+(0==nb?" "+Kc:"")}za&&a.g(za);a.zb=Qb}}}}break;case "e":if("else"==e[0])break;var Wb=1,de=255,ee=a.Gb,fe=a.ac;"ew"==e[0]&&(Wb=2,de=65535,ee=a.Ga,fe=a.ic);var ge=Wb<<1,he=e[1];if(null==he)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var Xb=He(a,he);if(Xb)for(var Yb=2;YbOc;){for(var Aa=null,Ef=256;65536>rb.A>>>0;){je.A=a.Ga(rb,2);if(null==rb.A||!Ef--)break;for(var Ff=a,Zb=je,ke=null,sb=Zb.A,le=sb,Pc=1;6>=Pc&&sb;Pc++){if(2\nLicense: GPL version 3 or later ");this.g("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bhf){if(kf(c,this.T)){this.J=new ad(this,"1.30.0","failsafe");kf(this.J)&&(qf(this,c),a=2,rf(this.J));M(this.J,"timestamp",ra());sf(this.J);var f=this.i&&!this.N;if(1==a||va("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(d=of(c)){var e=pf(c,"code"),h=pf(c,"data");e&&("ok"==e?kf(c,h):("error"== +e&&"no machine state"!=h?(this.oa("Error: "+h),"unable to verify user"==h&&(Ca("user",""),this.j=null)):this.g(e+": "+h),rf(c),kf(c)?(d=of(c),f=!0):d=!1))}f&&nf(this,d?c:null)}else 2==a&&c.clear()}else nf(this);delete this.T;delete this.V}f=cb(this.id);for(e=0;ea[1];a=a[2];this.ja=!0;this.u.fa=!0;var c=this.O.power;c&&(c.textContent="Shutdown");this.b&&(tf(this,this.b,b,d,a),this.b.Db());this.aa&&(qf(this,b),b.clear());!d&&this.J&&(this.J.clear(),delete this.J);this.C=0}; +function qf(a,b){if(va("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.j||"",c=b.toString(),f={app:"PDP11js",ver:"1.30.0"};f.url=a.url;f.user=d;f.type="bug";f.data=c;ua("http://www.pcjs.org/api/v1/report",f,!0)}} +function ef(a,b,d){var c,f="none";if(a.C)return null;a.C--;var e=new ad(a,"1.30.0"),h=new ad(a,"1.30.0","validate"),g=ra();M(h,"timestamp",g);M(e,"timestamp",g);M(e,"version","1.30.0");M(e,"url",window?window.location.href:null);M(e,"browser",window?window.navigator.userAgent:"");a.b&&a.b.Ma&&(d&&a.b.ma(),c=a.b.Ma(b,d),"object"===typeof c&&M(e,a.b.id,c),d&&(a.b.u.fa=!1,!1===c&&(f=null)));for(var g=cb(a.id),k=0;kg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);c?"}"==c.slice(-1)?(c=c.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+d+"$2"+(c?" parms='"+c+"'":"")+(g?' url="'+g+'"':""))}f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){g=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=c[2];b("Loading "+f+"...");ua(f,null,!0,function(e,h,g){if(g||!h)d(a,"unable to resolve XML reference: "+c[0]+" ("+g+")");else{if(e=c[3])if(g=h.match(new RegExp("<"+c[1]+"[^>]*>"))){for(var k=g[0],l,n=/( [a-z]+=)(['"])(.*?)\2/g;l=n.exec(e);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{d(a,"missing <"+c[1]+"> in "+f);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(c[0],h);Lf(a,b,d)}})}else d(a,null)} +function Mf(a,b,d,c){function f(a){if(void 0===g){var b=h&&x(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ma(a))}function e(a){f("Error: "+a);k&&(--xf||Sa(!0));k=!1}var h,g,k=!0;xf++;ab[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css";p.styleSheet?p.styleSheet.cssText=l:p.appendChild(document.createTextNode(l));n.appendChild(p)}d|| +(d="/versions/pdp11/1.30.0/components.xsl");l=function(c,g){g?Jf(d,null,null,!1,f,function(c,k){if(k)if(bb(a,d,c),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--xf||Sa(!0)):e("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--xf||Sa(!0)):e("invalid machine element: "+ +a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser");else e(c)}):e(c)};"<"!=b.charAt(0)?Jf(b,a,c,!0,f,l):Kf(b,null,a,c,!1,f,l)}else e("missing machine element: "+a)}catch(q){e(q.message)}return k}window.embedPDP11=function(a,b,d,c){Sa(!1);return Mf(a,b,d,c)};window.enableEvents=Sa;window.sendEvent=Ta;})(); diff --git a/versions/pdp11/1.30.0/pdp11.js b/versions/pdp11/1.30.0/pdp11.js index 3337690fd..a7de7446b 100644 --- a/versions/pdp11/1.30.0/pdp11.js +++ b/versions/pdp11/1.30.0/pdp11.js @@ -6,147 +6,150 @@ function ia(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFul function p(a,b,c,d){var f=0,e=null,h=null;if("object"==typeof resources&&(e=resources[a]))return d&&d(a,e,f),[e,f];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),h;var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(g.onreadystatechange=function(){4===g.readyState&&(e=g.responseText,200==g.status||!g.status&&e.length&&"file:"==(window?window.location.protocol:"file:")||(f=g.status||-1),d&&d(a,e,f))});if(b&&"object"== typeof b){var k="",l;for(l in b)b.hasOwnProperty(l)&&(k&&(k+="&"),k+=l+"="+encodeURIComponent(b[l]));k=k.replace(/%20/g,"+");g.open("POST",a,!!c);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.send(k)}else g.open("GET",a,!!c),"bytes"==b&&g.overrideMimeType("text/plain; charset=x-user-defined"),g.send();c||(e=g.responseText,200!=g.status&&(f=g.status||-1),d&&d(a,e,f),h=[e,f]);return h}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} function q(a){window&&window.alert(a)}function ja(a){var b=!1;window&&(b=window.confirm(a));return b}var ka=null;function la(){if(null==ka){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}ka=a}return ka}function ma(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} -function na(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function oa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var t={init:[],show:[],exit:[]},pa=!1,qa=!1,ra=!0;function sa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){t.init.push(a)} -function ta(a){if(ra)try{for(var b=0;bb?this.ub=this.id:(this.Fb=this.id.substr(0,b),this.ub=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Za:!1,yb:!1,L:!1,error:!1};this.mb=null;this.h.error=!1;this.A={};this.I=null;x.push(this)}var wa=void 0,xa={}; +function na(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function oa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},pa=!1,qa=!1,ra=!0;function sa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){r.init.push(a)} +function ta(a){if(ra)try{for(var b=0;bb?this.tb=this.id:(this.Hb=this.id.substr(0,b),this.tb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Za:!1,xb:!1,L:!1,error:!1};this.lb=null;this.i.error=!1;this.A={};this.I=null;x.push(this)}var wa=void 0,xa={}; if(window){wa||(wa=window.location.search.substr(1));for(var ya,za=/\+/g,Aa=/([^&=]+)=?([^&]*)/g;ya=Aa.exec(wa);)xa[decodeURIComponent(ya[1].replace(za," "))]=decodeURIComponent(ya[2].replace(za," "))}function Ba(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function y(a,b){b||(b=w);a.prototype=Ba(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ca=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else Ca={},x=[];function Da(a,b,c){Ca[a]&&b&&(Ca[a][b]=c)}function z(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.f&&(this.f=10);15>2;this.i=this.g-1;this.j=this.o/this.g|0;this.N=this.j-1;this.oa=[];this.u=null;this.$a=this.R;a=new H;Oa(a,this.I);this.b=Array(this.j);for(b=0;b>1)+2;10>this.f&&(this.f=10);15>2;this.h=this.g-1;this.v=this.m/this.g|0;this.N=this.v-1;this.oa=[];this.u=null;this.$a=this.R;a=new H;Oa(a,this.I);this.c=Array(this.v);for(b=0;b>8:c[2](b)&255}else if(b&1&&(c=this.controller.oa[a&-2],c[2]))return c[2](b&-2)>>8;return this.controller.$a(b,-1,1)} function Qa(a,b,c){var d=this.controller.oa[a];if(d){if(d[1]){d[1](b,c);return}if(d[3]){a=d[2]?d[2](c):0;if(c&1)d[3](a&255|b<<8,c&-2);else d[3](a&-256|b,c);return}}else if(c&1&&(d=this.controller.oa[a&-2],d[3])){c&=-2;a=d[2]?d[2](c):0;d[3](a&255|b<<8,c);return}this.controller.$a(c,b,1)}function Ra(a,b){var c=this.controller.oa[a];if(c){if(c[2])return c[2](b);if(c[0])return c[0](b)|c[0](b+1)<<8}return this.controller.$a(b,-1,0)} function Sa(a,b,c){if(a=this.controller.oa[a]){if(a[3]){a[3](b,c);return}if(a[1]){a[1](b&255,c);a[1](b>>8,c+1);return}}this.controller.$a(c,b,0)}Na.prototype.reset=function(){this.u&&this.u()};Na.prototype.R=function(){return 0};Na.prototype.ua=function(a,b){b||this.reset();return!0}; -function Ta(a,b,c,d,f){for(var e=b,h=c,g=e>>>a.f;0h&&(r=h);if(k&&k.size){if(k.type==d&&k.controller==f){if(e+h<=k.Qa)return k.sb+=k.Qa-e,k.Qa=e,!0;if(e>=k.Qa+k.sb){r=k.size-(e-l);r>h&&(r=h);k.sb=e-k.Qa+r;e=l+a.g;h-=r;g++;continue}}return Va(1,e,h)}e=new H(e,r,a.g,d,f);Oa(e,a.I,k);a.b[g++]=e;e=l+a.g;h-=r}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+Wa[d]+" at "+n(b,8,!0)),!0):Va(2,b,c)} +function Ta(a,b,c,d,f){for(var e=b,h=c,g=e>>>a.f;0h&&(t=h);if(k&&k.size){if(k.type==d&&k.controller==f){if(e+h<=k.Qa)return k.rb+=k.Qa-e,k.Qa=e,!0;if(e>=k.Qa+k.rb){t=k.size-(e-l);t>h&&(t=h);k.rb=e-k.Qa+t;e=l+a.g;h-=t;g++;continue}}return Va(1,e,h)}e=new H(e,t,a.g,d,f);Oa(e,a.I,k);a.c[g++]=e;e=l+a.g;h-=t}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+Wa[d]+" at "+n(b,8,!0)),!0):Va(2,b,c)} function Va(a,b,c){q("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1} -function Xa(a){w.call(this,"Device",a,Xa);this.u=a.name;this.o={Cb:[],ga:0,U:128,b:127,$b:0};this.b={data:0,xc:0,Ra:20,tc:0};this.f={Bb:0,l:0};this.g={gb:2496,P:0,w:128,hb:0,fb:0,V:0,Qb:0,S:[],Ea:[406,406,406,406],D:[12,12,12,12]};this.i={l:129,Ya:0,H:0,sa:0,pa:0,wa:0,S:[],D:[40,40,40,40],Ea:[1024,1024,512,512],Yb:[157,157,29,29]};this.j={c:[8210,8208,8210,8226],D:[22,22,22,50],Da:[19,19,19,32],tb:[815,411,815,630],S:[],B:2176,Ua:0,Sa:0,aa:[0,0,0,0,0,0,0,0],$:0,T:[4544,4544,4544,4544,4544,4544,4544, -4544],Ta:[0,0,0,0,0,0,0,0],Ja:0,rc:[0,0,0,0,0,0,0,0],Rb:0,Sb:[0,0,0,0,0,0,0,0],f:[0,0,0,0,0,0,0,0],sc:[1,2,3,4,5,6,7,8],Tb:[0,0,0,0,0,0,0,0],ka:[0,0,0,0,0,0,0,0],rb:[0,0,0,0,0,0,0,0],pc:[0,0,0,0,0,0,0,0],qc:[0,0,0,0,0,0,0,0],nc:[0,0,0,0,0,0,0,0],oc:[0,0,0,0,0,0,0,0],va:0,Db:0}}y(Xa); +function Xa(a){v.call(this,"Device",a,Xa);this.u=a.name;this.m={Bb:[],ga:0,U:128,c:127,$b:0};this.c={data:0,wc:0,Ra:20,sc:0};this.f={Ab:0,l:0};this.g={gb:2496,P:0,w:128,hb:0,fb:0,V:0,Pb:0,S:[],Ea:[406,406,406,406],D:[12,12,12,12]};this.h={l:129,Ya:0,H:0,sa:0,pa:0,wa:0,S:[],D:[40,40,40,40],Ea:[1024,1024,512,512],Xb:[157,157,29,29]};this.j={b:[8210,8208,8210,8226],D:[22,22,22,50],Da:[19,19,19,32],sb:[815,411,815,630],S:[],B:2176,Ua:0,Sa:0,aa:[0,0,0,0,0,0,0,0],$:0,T:[4544,4544,4544,4544,4544,4544,4544, +4544],Ta:[0,0,0,0,0,0,0,0],Ja:0,qc:[0,0,0,0,0,0,0,0],Qb:0,Rb:[0,0,0,0,0,0,0,0],f:[0,0,0,0,0,0,0,0],rc:[1,2,3,4,5,6,7,8],Sb:[0,0,0,0,0,0,0,0],ka:[0,0,0,0,0,0,0,0],qb:[0,0,0,0,0,0,0,0],oc:[0,0,0,0,0,0,0,0],pc:[0,0,0,0,0,0,0,0],mc:[0,0,0,0,0,0,0,0],nc:[0,0,0,0,0,0,0,0],va:0,Cb:0}}y(Xa); 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];m=Xa.prototype; -m.Ga=function(a,b,c,d){this.v=b;this.c=c;this.I=d;switch(this.u){default:a=Za;for(var f in a){var e=a[f];c=b;d=+f;for(var h=e[0]?e[0].bind(this):null,g=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,l=+f;l<=d;l+=2){var r=l&8191;void 0!==c.oa[r]?q("I/O address already registered: "+n(c.J+r,8,!0)):c.oa[r]=[h,g,k,e,!1]}}f=this.Xb.bind(this);b.u=this.reset.bind(this);b.$a=f}D(this)};m.ic=function(){return $a(this.c)}; -m.vc=function(a){ab(this.c,a&-1809|$a(this.c)&1808);this.c.C|=128}; -function bb(a){var b=a.g,c,d,f,e=b.V>>13&7;"undefined"===typeof b.S[e]&&(b.S[e]={cache:[],postProcess:a.kc,drive:e,blocksize:256,mapped:0,maxblock:b.Ea[e]*b.D[e],url:"rk"+e+".dsk"});b.w&=-129;switch(b.w>>1&7){case 0:b.gb=2496;b.P=0;b.w=128;b.V=0;break;case 1:if((b.V>>4&511)>=b.Ea[e]){b.P|=32832;b.w|=49152;break}if((b.V&15)>=b.D[e]){b.P|=32800;b.w|=49152;break}c=(b.V>>4&511)*b.D[e]+(b.V&15);d=(b.w&48)<<12|b.fb;f=65536-b.hb&65535;cb(a,b.S[e],c,d,f);return;case 2:if((b.V>>4&511)>=b.Ea[e]){b.P|=32832; -b.w|=49152;break}if((b.V&15)>=b.D[e]){b.P|=32800;b.w|=49152;break}c=(b.V>>4&511)*b.D[e]+(b.V&15);d=(b.w&48)<<12|b.fb;f=65536-b.hb&65535;a.qb(b.S[e],c,d,f);return}b.gb=e<<13|b.gb&8176|b.V%9&15;I(a.c,20,160,144,function(){b.w=b.w&65534|128;return!!(b.w&64)})}m.kc=function(a,b,c,d,f){var e=this.g;e.fb=d&65535;e.w=e.w&-49|d>>12&48;e.hb=65536-f&65535;switch(a){case 1:e.P|=33024;e.w|=49152;break;case 2:e.P|=33792,e.w|=49152}I(this.c,20,160,144,function(){e.w=e.w&65534|128;return!!(e.w&64)})}; -function db(a){var b=a.i,c,d,f,e=b.l>>8&3;b.l&=-2;"undefined"===typeof b.S[e]&&(b.S[e]={cache:[],postProcess:a.lc,drive:e,blocksize:128,mapped:1,maxblock:b.Ea[e]*b.D[e],url:"rl"+e+".dsk"});switch(b.l>>1&7){case 2:b.sa&8&&(b.l&=63);b.sa=b.Yb[e]|b.wa&64;break;case 3:1==(b.H&3)&&(b.wa=b.H&4?b.wa+(b.H&65408)&65408|b.H<<2&64:b.wa-(b.H&65408)&65408|b.H<<2&64,b.H=b.wa);break;case 4:b.sa=b.wa;break;case 5:if(b.H>>6>=b.Ea[e]){b.l|=37888;break}if((b.H&63)>=b.D[e]){b.l|=37888;break}c=(b.H>>6)*b.D[e]+(b.H&63); -d=(b.pa&63)<<16|b.Ya;f=65536-b.sa&65535;cb(a,b.S[e],c,d,f);return;case 6:if(b.H>>6>=b.Ea[e]){b.l|=37888;break}if((b.H&63)>=b.D[e]){b.l|=37888;break}c=(b.H>>6)*b.D[e]+(b.H&63);d=(b.pa&63)<<16|b.Ya;f=65536-b.sa&65535;a.qb(b.S[e],c,d,f);return}I(a.c,20,160,112,function(){b.l|=129;return!!(b.l&64)})} -m.lc=function(a,b,c,d,f){var e=this.i;e.Ya=d&65535;e.l=e.l&-49|d>>12&48;e.pa=d>>16&63;e.H=~~(c/e.D[b.ia])<<6|c%e.D[b.ia];e.wa=e.H;e.sa=65536-f&65535;switch(a){case 1:e.l|=33792;break;case 2:e.l|=40960}I(this.c,20,160,112,function(){e.l|=129;return!!(e.l&64)})};function eb(a){a=a.j;a.B=2176;a.$=0;a.T=[4544,4544,4544,4544,4544,4544,4544,4544];a.Ta=[0,0,0,0,0,0,0,0];a.Ja=a.Ua=a.Sa=a.va=a.Db=0} -function fb(a,b){var c=a.j,d,f,e;c.B&=-16513;c.$&=-2049;c.T[b]&=-1153;I(a.c,-1,0,172);"undefined"===typeof c.S[b]&&(c.S[b]={cache:[],postProcess:a.mc,drive:b,blocksize:256,mapped:0,maxblock:c.tb[0]*c.Da[0]*c.D[0],url:"rp"+b+".dsk"});switch(c.B&63){case 5:c.rb[b]=c.ka[b];c.B|=32896;c.T[b]|=32896;c.Ja|=1<=c.tb[0]||c.aa[b]>>8>=c.Da[0]||(c.aa[b]&255)>=c.D[0]){c.Ta[b]|=1024;c.B|=49152;break}d=(c.ka[b]*c.Da[0]+(c.aa[b]>>8))*c.D[0]+ -(c.aa[b]&255);f=(c.va&63)<<16|c.Sa;e=65536-c.Ua&65535;cb(a,c.S[b],d,f,e);return;case 57:if(c.ka[b]>=c.tb[0]||c.aa[b]>>8>=c.Da[0]||(c.aa[b]&255)>=c.D[0]){c.Ta[b]|=1024;c.B|=49152;break}d=(c.ka[b]*c.Da[0]+(c.aa[b]>>8))*c.D[0]+(c.aa[b]&255);f=(c.va&63)<<16|c.Sa;e=65536-c.Ua&65535;a.qb(c.S[b],d,f,e);return}I(a.c,3,160,172,function(){c.B=c.B&65534|128;c.T[b]|=128;return!!(c.B&64)})} -m.mc=function(a,b,c,d,f){var e=this.j;e.Ua=65536-f&65535;e.Sa=d&65535;e.B=e.B&-769|d>>8&768;e.va=d>>16&63;f=~~(c/e.D[0]);d=~~(f/e.Da[0]);e.aa[b.ia]=f%e.Da[0]<<8|c%e.D[0];e.rb[b.ia]=e.ka[b.ia]=d;e.Ja|=1<=b.gc-1&&(e.T[b.ia]|=1024);switch(a){case 1:e.$|=512;e.B|=49152;break;case 2:e.$|=2048,e.B|=49152}I(this.c,20,160,172,function(){e.T[b.ia]|=128;e.B=e.B&65534|128;return!!(e.B&64)})};m.ec=function(){this.f.l|=128;this.f.l&64&&I(this.c,0,192,64)}; -function gb(a,b,c,d,f,e){var h=~~((e+c.qa-1)/c.qa),g=new XMLHttpRequest;2048>h&&d+2048L(this.c,a.fc?hb(this.c,c):c,a.cache[b][f])){a.pb(2,a,b,c,d);return}c+=2;--d}b++}a.pb(0,a,b,c,d)}; -function cb(a,b,c,d,f){for(var e,h;0h){b.pb(2,b,c,d,f);return}b.cache[c][e]=h;d+=2;--f}c++}b.pb(0,b,c,d,f)}m.reset=function(){this.b.Ra=this.b.Ra&-120|20;this.o.ga=0;this.o.U=128;this.f.l=0;this.g.w=128;this.i.l=128;eb(this)}; -m.Xb=function(a,b,c){var d,f,e=this.c;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.la&65280:(a&1&&(b<<=8),e.la=b|255,d=0);break;case 4194298:if(0>b)d=e.ob;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.ob=d;e.ja=2}break;case 4194294:if(70!==e.Fa)return K(e,4,222);0>b?d=e.m:d=e.m=0;break;case 4194292:if(70!==e.Fa)return K(e,4,224);d=1;break;case 4194290:if(70!==e.Fa)return K(e,4,226);d=0;break;case 4194288:if(70!==e.Fa)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.Fa)return K(e,4,232);f=a-4194272>>1;0>b?d=e.Ab[f]:(d=J(this,e.Ab[f],a,b,c),0<=d&&(e.Ab[f]=d));break;case 4194254:return a&1?e.s>>14&1?(0<=b&&(e.a[6]=b),d=e.a[6]):(0<=b&&(e.Y[3]=b),d=e.Y[3]):e.s>>14&0?(0<=b&&(e.a[6]=b),d=e.a[6]):(0<=b&&(e.Y[1]=b),d=e.Y[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.s&2048?(0<=b&&(e.a[f]=b),d=e.a[f]):(0<=b&&(e.Ia[f]=b),d= -e.Ia[f]),d;case 4194246:return a&1?(0<=b&&(e.a[7]=b),d=e.a[7]):e.s>>14&0?(0<=b&&(e.a[6]=b),d=e.a[6]):(0<=b&&(e.Y[0]=b),d=e.Y[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.s&2048?(0<=b&&(e.Ia[f]=b),d=e.Ia[f]):(0<=b&&(e.a[f]=b),d=e.a[f]),d;default:return e.m|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;d=J(this,e.O[3][f],a,b,c);0<=d&&(e.O[3][f]=d,e.O[3][f&15]&=65295);break;case 4194112:var h=this.o;f=this.f;switch(a&-2){case 4194174:d=J(this,e.Va,a,b,c);0<=d&&(e.Va=d);break;case 4194172:d= -e.ea;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194170:e.G=e.G&62337|e.bb<<5|e.nb<<1;0>b?d=e.G:(d=J(this,e.G,a,b,c),0<=d&&(e.G=d&=62337,e.bb=d>>5&3,e.nb=d>>1&15,d&257?(f=2,e.na&16&&(f=1),e.ab=d&1?Ia|E:E):(e.ab=0,f=4),this.b.Ra=this.b.Ra&-8|f));break;case 4194168:0>b?d=this.b.tc&65535:(d=J(this,this.b.data,a,b,c),0<=d&&(this.b.data=d));break;case 4194166:0<=b&&(b&127&&(h.$b=0),h.U&=-129,I(e,100,128,52,function(){h.U|=128;return!!(h.U&64)}));d=0;break;case 4194164:0>b?d=h.U:(d=J(this,h.U,a,b,c),0<= -d&&(128==(h.U&192)&&d&64&&I(e,8,128,52,function(){h.U|=128;return!!(h.U&64)}),h.U=h.U&128|d&-129));break;case 4194162:d=0;0>b&&(h.ga&=-129,0b?d=h.ga:(d=J(this,h.ga,a,b,c),0<=d&&(h.ga=h.ga&128|d&-129));break;case 4194150:0>b?(d=f.l,f.l&=-129):(d=J(this,f.l,a,b,c),0<=d&&(d&64&&!f.Bb&&(setInterval(this.ec.bind(this),25),f.Bb=1),f.l=d&-129));break;default:return e.m|=16,K(e, -4,126)}break;case 4194048:f=this.g;switch(a&-2){case 4194048:d=J(this,f.gb,a,b,c);0<=d&&(f.gb=d);break;case 4194050:d=J(this,f.P,a,b,c);0<=d&&(f.P=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.hb,a,b,c);0<=d&&(f.hb=d);break;case 4194056:d=J(this,f.fb,a,b,c);0<=d&&(f.fb=d);break;case 4194058:d=J(this,f.V,a,b,c);0<=d&&(f.V=d);break;case 4194060:break;case 4194062:d=J(this,f.Qb,a,b,c);0<=d&&(f.Qb=d);break;default:return e.m|= +m.Ga=function(a,b,c,d){this.v=b;this.b=c;this.I=d;switch(this.u){default:a=Za;for(var f in a){var e=a[f];c=b;d=+f;for(var h=e[0]?e[0].bind(this):null,g=e[1]?e[1].bind(this):null,k=e[2]?e[2].bind(this):null,e=e[3]?e[3].bind(this):null,l=+f;l<=d;l+=2){var t=l&8191;void 0!==c.oa[t]?q("I/O address already registered: "+n(c.J+t,8,!0)):c.oa[t]=[h,g,k,e,!1]}}f=this.Wb.bind(this);b.u=this.reset.bind(this);b.$a=f}D(this)};m.hc=function(){return $a(this.b)}; +m.uc=function(a){ab(this.b,a&-1809|$a(this.b)&1808);this.b.C|=128}; +function bb(a){var b=a.g,c,d,f,e=b.V>>13&7;"undefined"===typeof b.S[e]&&(b.S[e]={cache:[],postProcess:a.jc,drive:e,blocksize:256,mapped:0,maxblock:b.Ea[e]*b.D[e],url:"rk"+e+".dsk"});b.w&=-129;switch(b.w>>1&7){case 0:b.gb=2496;b.P=0;b.w=128;b.V=0;break;case 1:if((b.V>>4&511)>=b.Ea[e]){b.P|=32832;b.w|=49152;break}if((b.V&15)>=b.D[e]){b.P|=32800;b.w|=49152;break}c=(b.V>>4&511)*b.D[e]+(b.V&15);d=(b.w&48)<<12|b.fb;f=65536-b.hb&65535;cb(a,b.S[e],c,d,f);return;case 2:if((b.V>>4&511)>=b.Ea[e]){b.P|=32832; +b.w|=49152;break}if((b.V&15)>=b.D[e]){b.P|=32800;b.w|=49152;break}c=(b.V>>4&511)*b.D[e]+(b.V&15);d=(b.w&48)<<12|b.fb;f=65536-b.hb&65535;a.pb(b.S[e],c,d,f);return}b.gb=e<<13|b.gb&8176|b.V%9&15;I(a.b,20,160,144,function(){b.w=b.w&65534|128;return!!(b.w&64)})}m.jc=function(a,b,c,d,f){var e=this.g;e.fb=d&65535;e.w=e.w&-49|d>>12&48;e.hb=65536-f&65535;switch(a){case 1:e.P|=33024;e.w|=49152;break;case 2:e.P|=33792,e.w|=49152}I(this.b,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.l>>8&3;b.l&=-2;"undefined"===typeof b.S[e]&&(b.S[e]={cache:[],postProcess:a.kc,drive:e,blocksize:128,mapped:1,maxblock:b.Ea[e]*b.D[e],url:"rl"+e+".dsk"});switch(b.l>>1&7){case 2:b.sa&8&&(b.l&=63);b.sa=b.Xb[e]|b.wa&64;break;case 3:1==(b.H&3)&&(b.wa=b.H&4?b.wa+(b.H&65408)&65408|b.H<<2&64:b.wa-(b.H&65408)&65408|b.H<<2&64,b.H=b.wa);break;case 4:b.sa=b.wa;break;case 5:if(b.H>>6>=b.Ea[e]){b.l|=37888;break}if((b.H&63)>=b.D[e]){b.l|=37888;break}c=(b.H>>6)*b.D[e]+(b.H&63); +d=(b.pa&63)<<16|b.Ya;f=65536-b.sa&65535;cb(a,b.S[e],c,d,f);return;case 6:if(b.H>>6>=b.Ea[e]){b.l|=37888;break}if((b.H&63)>=b.D[e]){b.l|=37888;break}c=(b.H>>6)*b.D[e]+(b.H&63);d=(b.pa&63)<<16|b.Ya;f=65536-b.sa&65535;a.pb(b.S[e],c,d,f);return}I(a.b,20,160,112,function(){b.l|=129;return!!(b.l&64)})} +m.kc=function(a,b,c,d,f){var e=this.h;e.Ya=d&65535;e.l=e.l&-49|d>>12&48;e.pa=d>>16&63;e.H=~~(c/e.D[b.ia])<<6|c%e.D[b.ia];e.wa=e.H;e.sa=65536-f&65535;switch(a){case 1:e.l|=33792;break;case 2:e.l|=40960}I(this.b,20,160,112,function(){e.l|=129;return!!(e.l&64)})};function eb(a){a=a.j;a.B=2176;a.$=0;a.T=[4544,4544,4544,4544,4544,4544,4544,4544];a.Ta=[0,0,0,0,0,0,0,0];a.Ja=a.Ua=a.Sa=a.va=a.Cb=0} +function fb(a,b){var c=a.j,d,f,e;c.B&=-16513;c.$&=-2049;c.T[b]&=-1153;I(a.b,-1,0,172);"undefined"===typeof c.S[b]&&(c.S[b]={cache:[],postProcess:a.lc,drive:b,blocksize:256,mapped:0,maxblock:c.sb[0]*c.Da[0]*c.D[0],url:"rp"+b+".dsk"});switch(c.B&63){case 5:c.qb[b]=c.ka[b];c.B|=32896;c.T[b]|=32896;c.Ja|=1<=c.sb[0]||c.aa[b]>>8>=c.Da[0]||(c.aa[b]&255)>=c.D[0]){c.Ta[b]|=1024;c.B|=49152;break}d=(c.ka[b]*c.Da[0]+(c.aa[b]>>8))*c.D[0]+ +(c.aa[b]&255);f=(c.va&63)<<16|c.Sa;e=65536-c.Ua&65535;cb(a,c.S[b],d,f,e);return;case 57:if(c.ka[b]>=c.sb[0]||c.aa[b]>>8>=c.Da[0]||(c.aa[b]&255)>=c.D[0]){c.Ta[b]|=1024;c.B|=49152;break}d=(c.ka[b]*c.Da[0]+(c.aa[b]>>8))*c.D[0]+(c.aa[b]&255);f=(c.va&63)<<16|c.Sa;e=65536-c.Ua&65535;a.pb(c.S[b],d,f,e);return}I(a.b,3,160,172,function(){c.B=c.B&65534|128;c.T[b]|=128;return!!(c.B&64)})} +m.lc=function(a,b,c,d,f){var e=this.j;e.Ua=65536-f&65535;e.Sa=d&65535;e.B=e.B&-769|d>>8&768;e.va=d>>16&63;f=~~(c/e.D[0]);d=~~(f/e.Da[0]);e.aa[b.ia]=f%e.Da[0]<<8|c%e.D[0];e.qb[b.ia]=e.ka[b.ia]=d;e.Ja|=1<=b.fc-1&&(e.T[b.ia]|=1024);switch(a){case 1:e.$|=512;e.B|=49152;break;case 2:e.$|=2048,e.B|=49152}I(this.b,20,160,172,function(){e.T[b.ia]|=128;e.B=e.B&65534|128;return!!(e.B&64)})};m.dc=function(){this.f.l|=128;this.f.l&64&&I(this.b,0,192,64)}; +function gb(a,b,c,d,f,e){var h=~~((e+c.qa-1)/c.qa),g=new XMLHttpRequest;2048>h&&d+2048L(this.b,a.ec?hb(this.b,c):c,a.cache[b][f])){a.ob(2,a,b,c,d);return}c+=2;--d}b++}a.ob(0,a,b,c,d)}; +function cb(a,b,c,d,f){for(var e,h;0h){b.ob(2,b,c,d,f);return}b.cache[c][e]=h;d+=2;--f}c++}b.ob(0,b,c,d,f)}m.reset=function(){this.c.Ra=this.c.Ra&-120|20;this.m.ga=0;this.m.U=128;this.f.l=0;this.g.w=128;this.h.l=128;eb(this)}; +m.Wb=function(a,b,c){var d,f,e=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.la&65280:(a&1&&(b<<=8),e.la=b|255,d=0);break;case 4194298:if(0>b)d=e.nb;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.nb=d;e.ja=2}break;case 4194294:if(70!==e.Fa)return K(e,4,222);0>b?d=e.o:d=e.o=0;break;case 4194292:if(70!==e.Fa)return K(e,4,224);d=1;break;case 4194290:if(70!==e.Fa)return K(e,4,226);d=0;break;case 4194288:if(70!==e.Fa)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.Fa)return K(e,4,232);f=a-4194272>>1;0>b?d=e.zb[f]:(d=J(this,e.zb[f],a,b,c),0<=d&&(e.zb[f]=d));break;case 4194254:return a&1?e.s>>14&1?(0<=b&&(e.a[6]=b),d=e.a[6]):(0<=b&&(e.Y[3]=b),d=e.Y[3]):e.s>>14&0?(0<=b&&(e.a[6]=b),d=e.a[6]):(0<=b&&(e.Y[1]=b),d=e.Y[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.s&2048?(0<=b&&(e.a[f]=b),d=e.a[f]):(0<=b&&(e.Ia[f]=b),d= +e.Ia[f]),d;case 4194246:return a&1?(0<=b&&(e.a[7]=b),d=e.a[7]):e.s>>14&0?(0<=b&&(e.a[6]=b),d=e.a[6]):(0<=b&&(e.Y[0]=b),d=e.Y[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.s&2048?(0<=b&&(e.Ia[f]=b),d=e.Ia[f]):(0<=b&&(e.a[f]=b),d=e.a[f]),d;default:return e.o|=16,K(e,4,124)}break;case 4194176:f=a>>1&31;d=J(this,e.O[3][f],a,b,c);0<=d&&(e.O[3][f]=d,e.O[3][f&15]&=65295);break;case 4194112:var h=this.m;f=this.f;switch(a&-2){case 4194174:d=J(this,e.Va,a,b,c);0<=d&&(e.Va=d);break;case 4194172:d= +e.ea;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194170:e.G=e.G&62337|e.bb<<5|e.mb<<1;0>b?d=e.G:(d=J(this,e.G,a,b,c),0<=d&&(e.G=d&=62337,e.bb=d>>5&3,e.mb=d>>1&15,d&257?(f=2,e.na&16&&(f=1),e.ab=d&1?Ia|E:E):(e.ab=0,f=4),this.c.Ra=this.c.Ra&-8|f));break;case 4194168:0>b?d=this.c.sc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;case 4194166:0<=b&&(b&127&&(h.$b=0),h.U&=-129,I(e,100,128,52,function(){h.U|=128;return!!(h.U&64)}));d=0;break;case 4194164:0>b?d=h.U:(d=J(this,h.U,a,b,c),0<= +d&&(128==(h.U&192)&&d&64&&I(e,8,128,52,function(){h.U|=128;return!!(h.U&64)}),h.U=h.U&128|d&-129));break;case 4194162:d=0;0>b&&(h.ga&=-129,0b?d=h.ga:(d=J(this,h.ga,a,b,c),0<=d&&(h.ga=h.ga&128|d&-129));break;case 4194150:0>b?(d=f.l,f.l&=-129):(d=J(this,f.l,a,b,c),0<=d&&(d&64&&!f.Ab&&(setInterval(this.dc.bind(this),25),f.Ab=1),f.l=d&-129));break;default:return e.o|=16,K(e, +4,126)}break;case 4194048:f=this.g;switch(a&-2){case 4194048:d=J(this,f.gb,a,b,c);0<=d&&(f.gb=d);break;case 4194050:d=J(this,f.P,a,b,c);0<=d&&(f.P=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.hb,a,b,c);0<=d&&(f.hb=d);break;case 4194056:d=J(this,f.fb,a,b,c);0<=d&&(f.fb=d);break;case 4194058:d=J(this,f.V,a,b,c);0<=d&&(f.V=d);break;case 4194060:break;case 4194062:d=J(this,f.Pb,a,b,c);0<=d&&(f.Pb=d);break;default:return e.o|= 16,K(e,4,128)}break;case 4193728:var g=this.j;f=g.$&7;switch(a&-2){case 4193728:d=J(this,g.B,a,b,c);0<=b&&0<=d&&(g.va=g.va&60|d>>8&3,g.B=d&17279|g.B&34944|2048,d&1&&g.B&128?fb(this,f):192==(d&192)&&I(e,0,160,172));break;case 4193730:d=J(this,g.Ua,a,b,c);0<=d&&(g.Ua=d);break;case 4193732:d=J(this,g.Sa,a,b,c);0<=d&&(g.Sa=d&65534);break;case 4193734:d=J(this,g.aa[f],a,b,c);0<=d&&(g.aa[f]=d&7967);break;case 4193736:d=J(this,g.$,a,b,c);0<=d&&(g.$=d&63|g.$&65472,d&128&&eb(this));break;case 4193738:d=g.T[f]; -break;case 4193740:d=g.Ta[f];break;case 4193742:d=J(this,g.Ja,a,b,c);0<=d&&(g.Ja=d&255);break;case 4193744:d=g.rc[f];break;case 4193746:d=J(this,g.Rb,a,b,c);0<=d&&(g.Rb=d);break;case 4193748:d=J(this,g.Sb[f],a,b,c);0<=d&&(g.Sb[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.sc[f];break;case 4193754:d=J(this,g.Tb[f],a,b,c);0<=d&&(g.Tb[f]=d);break;case 4193756:d=J(this,g.ka[f],a,b,c);0<=d&&(g.ka[f]=d&511);break;case 4193758:g.rb[f]=g.ka[f];d=g.rb[f];break;case 4193760:d=g.pc[f];break;case 4193762:d= -g.qc[f];break;case 4193764:d=g.nc[f];break;case 4193766:d=g.oc[f];break;case 4193768:d=J(this,g.va,a,b,c);0<=d&&(g.va=d&63,g.B=g.B&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Db,a,b,c);0<=d&&(g.Db=d);break;default:return e.m|=16,K(e,4,132)}break;case 4192512:f=this.i;switch(a&-2){case 4192512:d=J(this,f.l,a,b,c);0<=b&&0<=d&&(f.pa=f.pa&60|d>>4&3,f.l=f.l&-1023|d&1022,f.l&128||db(this));break;case 4192514:d=J(this,f.Ya,a,b,c);0<=d&&(f.Ya=d&65534);break;case 4192516:d=J(this,f.H,a,b,c);0<=d&&(f.H=d); -break;case 4192518:d=J(this,f.sa,a,b,c);0<=d&&(f.sa=d);break;case 4192520:d=J(this,f.pa,a,b,c);0<=d&&(f.pa=d&63,f.l=f.l&-49|(f.pa&3)<<4);break;default:return e.m|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.na:(d=J(this,e.na,a,b,c),0<=d&&(70!==e.Fa&&(d&=-49),e.na=d,e.Ha[0]=d&4?15:7,e.Ha[1]=d&2?15:7,e.Ha[3]=d&1?15:7,e.ab&&(f=2,e.na&16&&(f=1),this.b.Ra=this.b.Ra&-8|f)));break;default:return e.m|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;d=J(this,e.O[0][f],a,b,c);0<=d&&(e.O[0][f]= -d,e.O[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=J(this,e.O[1][f],a,b,c);0<=d&&(e.O[1][f]=d,e.O[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.Fa)return K(e,4,234);f=a>>2&31;d=e.ib[f];a&2&&(d=d>>16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.ib[f]=a&2?d<<16|e.ib[f]&65535:e.ib[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.m|=16,K(e,4,138);break;default:return e.m|= -16,K(e,4,142)}c&&0<=d&&(a&1?d=d>>8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var Za={};Za[4194302]=[null,null,Xa.prototype.ic,Xa.prototype.vc];u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.c=new Int32Array(this.f,0,c>>2),ob(this,kb?pb:qb);else{this.c=Array(c>>2);for(a=0;a>4&3,f.l=f.l&-1023|d&1022,f.l&128||db(this));break;case 4192514:d=J(this,f.Ya,a,b,c);0<=d&&(f.Ya=d&65534);break;case 4192516:d=J(this,f.H,a,b,c);0<=d&&(f.H=d); +break;case 4192518:d=J(this,f.sa,a,b,c);0<=d&&(f.sa=d);break;case 4192520:d=J(this,f.pa,a,b,c);0<=d&&(f.pa=d&63,f.l=f.l&-49|(f.pa&3)<<4);break;default:return e.o|=16,K(e,4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.na:(d=J(this,e.na,a,b,c),0<=d&&(70!==e.Fa&&(d&=-49),e.na=d,e.Ha[0]=d&4?15:7,e.Ha[1]=d&2?15:7,e.Ha[3]=d&1?15:7,e.ab&&(f=2,e.na&16&&(f=1),this.c.Ra=this.c.Ra&-8|f)));break;default:return e.o|=16,K(e,4,136)}break;case 4191424:f=a>>1&31;d=J(this,e.O[0][f],a,b,c);0<=d&&(e.O[0][f]= +d,e.O[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=J(this,e.O[1][f],a,b,c);0<=d&&(e.O[1][f]=d,e.O[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.Fa)return K(e,4,234);f=a>>2&31;d=e.ib[f];a&2&&(d=d>>16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.ib[f]=a&2?d<<16|e.ib[f]&65535:e.ib[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.o|=16,K(e,4,138);break;default:return e.o|= +16,K(e,4,142)}c&&0<=d&&(a&1?d=d>>8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var Za={};Za[4194302]=[null,null,Xa.prototype.hc,Xa.prototype.uc];u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.f,0,c>>2),ob(this,kb?pb:qb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Z:function(a){return this.c[a>>2]>>>((a&3)<<3)&255},ya:function(a){var b=a>>2;a=(a&3)<<3;var c=this.c[b]>>a;return 24>a?c&65535:c&255|(this.c[b+1]&255)<<8},Ca:function(a,b){var c=a>>2,d=(a&3)<<3;this.c[c]=this.c[c]&~(255<>2,d=(a&3)<<3;24>d?this.c[c]=this.c[c]&~(65535<>8);this.ra=!0},N:function(a,b){return this.R(a, -b)},da:function(a,b){return this.ma(a,b)},Aa:function(a,b,c){this.i||this.Wb(a,b,c)},Ma:function(a,b,c){this.i||this.Na(a,b,c)},M:function(a){return this.b[a]},W:function(a){return this.b[a]},ca:function(a){return this.g.getUint16(a,!0)},xa:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.j[a>>1]},za:function(a,b){this.b[a]=b;this.ra=!0},Ba:function(a,b){this.b[a]=b;this.ra=!0},La:function(a,b){this.g.setUint16(a,b,!0);this.ra=!0},Oa:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.j[a>> -1]=b;this.ra=!0}};function Oa(a,b,c){a.I=b;a.A=a.v=0;c&&((a.A=c.A)&&sb(a,tb,!1),(a.v=c.v)&&ub(a,tb,!1))}function ub(a,b,c){c&&a.v||(a.jb=!a.i&&b[1]||a.F,a.wc=!a.i&&b[3]||a.J);if(c||void 0===c)a.Wb=b[1]||a.F,a.Na=b[3]||a.J}function sb(a,b,c){c&&a.A||(a.eb=b[0]||a.o,a.jc=b[2]||a.u);if(c||void 0===c)a.R=b[0]||a.o,a.ma=b[2]||a.u}function ob(a,b){b||(b=vb);sb(a,b,void 0);ub(a,b,void 0)} +H.prototype={constructor:H,parent:null,Ab:function(a){this.Qa=a},save:function(){var a,b;if(this.controller)a=null;else if(Ha)for(a=Array(this.size>>2),b=0;b>8,c)},Z:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ya:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},Ca:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.ra=!0},N:function(a,b){return this.R(a, +b)},da:function(a,b){return this.ma(a,b)},Aa:function(a,b,c){this.h||this.Vb(a,b,c)},Ma:function(a,b,c){this.h||this.Na(a,b,c)},M:function(a){return this.c[a]},W:function(a){return this.c[a]},ca:function(a){return this.g.getUint16(a,!0)},xa:function(a){return a&1?this.c[a]|this.c[a+1]<<8:this.v[a>>1]},za:function(a,b){this.c[a]=b;this.ra=!0},Ba:function(a,b){this.c[a]=b;this.ra=!0},La:function(a,b){this.g.setUint16(a,b,!0);this.ra=!0},Oa:function(a,b){a&1?(this.c[a]=b,this.c[a+1]=b>>8):this.v[a>> +1]=b;this.ra=!0}};function Oa(a,b,c){a.I=b;a.j=a.A=0;c&&((a.j=c.j)&&sb(a,tb,!1),(a.A=c.A)&&ub(a,tb,!1))}function ub(a,b,c){c&&a.A||(a.jb=!a.h&&b[1]||a.F,a.vc=!a.h&&b[3]||a.J);if(c||void 0===c)a.Vb=b[1]||a.F,a.Na=b[3]||a.J}function sb(a,b,c){c&&a.j||(a.eb=b[0]||a.m,a.ic=b[2]||a.u);if(c||void 0===c)a.R=b[0]||a.m,a.ma=b[2]||a.u}function ob(a,b){b||(b=vb);sb(a,b,void 0);ub(a,b,void 0)} var vb=[],rb=[H.prototype.Z,H.prototype.Ca,H.prototype.ya,H.prototype.Pa],tb=[H.prototype.N,H.prototype.Aa,H.prototype.da,H.prototype.Ma];if(Ha)var qb=[H.prototype.M,H.prototype.za,H.prototype.ca,H.prototype.La],pb=[H.prototype.W,H.prototype.Ba,H.prototype.xa,H.prototype.Oa]; -function wb(a,b){w.call(this,"CPU",a,wb);var c=a.multiplier||1;this.wb=a.cycles||b;this.da=c;this.vb=Math.round(this.wb/1E4)/100;this.Z=this.vb*this.da;this.h.ha=!1;this.h.Ub=!1;this.h.Xa=a.autoStart;this.h.Nb=!1;this.h.lb=!1;this.Na=this.ca=0;this.Oa=a.csStart;this.ya=a.csInterval;this.za=a.csStop;this.La=[];this.Mb=this.Eb.bind(this);D(this)}y(wb);var xb=["power","reset"];m=wb.prototype; -m.Ga=function(a,b,c,d){this.u=a;this.v=b;this.I=d;for(b=0;b>=3;d=""+f}else d=n(c,d);else d="--------".substr(0,d||4);a.A[b].textContent!=d&&(a.A[b].textContent=d)}} -m.ba=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.A[b]=c;a=!0;break;case "run":this.A[b]=c;c.onclick=function(){var a;if(a=d.u)if(a=d.u,a.h.L)a=!0;else{var b=null,c,g=z(a.id);for(c=0;ca.M/a.Z&&(b=1);a.da=b;var c=a.vb*a.da;if(a.Z!=c){a.Z=c;var c=a.Z.toFixed(2)+"Mhz",d=a.A.setSpeed;d&&(d.textContent=c);a.X("target speed: "+c)}}Fb(a,a.J);a.J=0;a.F=ha();a.N=0;Gb(a)}function Ib(a){a.R-=a.o;a.o=0} -m.Eb=function(){if(Fa(this,!0)){if(!this.h.ha){Eb(this);this.u&&this.u.start(this.F,Hb(this));this.h.ha=!0;this.h.Ub=!0;this.xa&&this.xa.start();var a=this.A.run;a&&(a.textContent="Halt");this.u&&this.u.Ka(!0)}this.xb>=this.wb&&Gb(this,!0);this.Ba=0;this.Ma=ha();this.N&&(a=this.Ma-this.N,a>this.Jb&&(this.F+=a,this.F>this.Ma&&(this.F=this.Ma)));try{do{for(var b,c=this.h.lb?1:this.Pa,d=this.La.length-1;0<=d;d--){var f=this.La[d];0>f[0]||c>f[0]&&(c=f[0])}b=c;try{this.Vb(b)}catch(l){if("number"!=typeof l)throw l; -}for(var e=this.R-this.o,a=e,h=this.La.length-1;0<=h;h--){var g=this.La[h];0>g[0]||(g[0]-=a,0>=g[0]&&(g[0]=-1,g[1]()))}this.Ba+=e;this.J+=e;Fb(this,0,!0);a=e;if(this.h.lb){var k=!1;this.Na=this.Na+this.Pb()|0;this.ca-=a;0>=this.ca&&(this.ca+=this.ya,k=!0);0<=this.za&&this.za<=Hb(this)&&(this.ya=this.za=-1,Ab(this),Db(this),k=!0);k&&this.X(Hb(this)+" cycles: checksum="+n(this.Na))}this.Aa-=e;if(0>=this.Aa){this.Aa+=this.Pa;15<=++this.Kb&&(this.u&&this.u.Ka(),this.Kb=0);break}}while(this.h.ha)}catch(l){Db(this); -Bb(this);this.u&&this.u.stop(ha(),Hb(this));Fa(this,!1);b=l.stack||l.message;this.h.error=!0;this.K(b);return}b=setTimeout;c=this.Mb;this.N=ha();d=this.Jb;this.Ba&&(d=Math.round(d*this.Ba/this.Pa));d=d-(this.N-this.Ma);if(f=this.N-this.F)this.M=Math.round(this.J/(10*f))/100,864E5<=f&&(this.W=0,Eb(this));if(0>d||this.Md&&(this.F-=d),d=0;this.xb+=this.Ba;this.N+=d;b(c,d)}else Bb(this),this.u&&this.u.stop(ha(),Hb(this))};m.Vb=function(){return 0}; -function Db(a){a.h.Za&&(a.h.yb=!0);Ib(a);Fb(a,a.J);a.J=0;if(a.h.ha){a.h.ha=!1;a.xa&&a.xa.stop();var b=a.A.run;b&&(b.textContent="Run")}a.h.complete=void 0}function Bb(a){a.u&&a.u.Ka(void 0)} -function Jb(a){this.ac=+a.model||1170;this.dc=a.resetAddr||0;wb.call(this,a,1E6);this.Gb=0;this.decode=Kb.bind(this);this.f=65536;this.b=32768;this.g=65535;this.c=32768;this.kb=-1;this.a=[0,0,0,0,0,0,0,this.dc];this.Ia=[0,0,0,0,0,0];this.Y=[0,0,0,0];this.memory=[];this.i=[];this.Ca=this.ob=0;this.ja=2;this.la=255;this.C=0;this.ma=-1;this.m=0;this.Fa=70;this.nb=this.bb=this.ab=this.j=this.na=this.Va=this.ea=this.G=0;this.Ha=[7,7,7,7];this.O=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0],[0,0,0,0,0,0,0,0,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.ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.Ab=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h.complete=this.h.Zb=!1}y(Jb,wb);m=Jb.prototype; -m.reset=function(){this.h.ha&&Db(this);Lb(this);zb(this);this.h.error=!1;this.parent.reset.call(this)};function Lb(a){a.la=255;a.m=0;a.i=[];a.ob=0;a.G=a.ea=a.Va=a.na=a.ab=0;a.Ha[0]=a.Ha[1]=a.Ha[3]=7;a.bb=0}m.Pb=function(){return 0}; -m.save=function(){var a=new O(this);P(a,0,[]);P(a,1,[this.Ib,this.W,this.da]);for(var b=this.v,c=0,d=[],f=0;fb){a.i[e].fa-=b;break}b-=a.i[e].fa}a.i.splice(e+1,0,{delay:b,priority:c&224,vector:d,callback:f})}a.ja=2}function $a(a){return a.s=a.s&63728|(a.c&32768?8:0)|(a.g&65535?0:4)|(a.b&32768?2:0)|(a.f&65536?1:0)} -function ab(a,b){a.c=b<<12;a.g=~b&4;a.b=b<<14;a.f=b<<16;if((b^a.s)&2048)for(var c=a.Ia.length;0<=--c;){var d=a.a[c];a.a[c]=a.Ia[c];a.Ia[c]=d}a.j=b>>14&3;c=a.s>>14&3;a.j!=c&&(a.Y[c]=a.a[6],a.a[6]=a.Y[a.j]);a.ja=2;a.s=b}function Q(a,b){!a.C&128&&(a.c=a.g=b,a.b=0)}function Mb(a,b,c,d){!a.C&128&&(a.c=a.g=a.f=b,a.b=(c^d)&(d^b))} -function K(a,b,c){var d,f,e=0;0>a.ma?a.ma=$a(a):a.j||(b=4,e=1);a.G&57344||(a.ea=63222,a.Va=b);a.j=0;0<=(d=R(a,b|65536))&&0<=(f=R(a,b+2&65535|65536))&&(ab(a,f&53247|a.ma>>2&12288),e&&(a.m|=4,a.a[6]=4),0<=S(a,a.ma)&&0<=S(a,a.a[7])&&(a.a[7]=d));a.C&=-113;a.ma=-1;throw b|c<<8;}function hb(a,b){var c=b>>13&31;31>c?a.na&32&&(b=a.ib[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function Nb(a,b,c){var d,f,e,h=0;if(c&a.ab){d=b>>13&a.Ha[a.j];f=a.O[a.j][d];e=(a.O[a.j][d+16]<<6)+(b&8191)&4194303;a.na&16?3932160<=e&&4186112>e&&(e=hb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.m|=32,K(a,4,24)),e&1&&!(c&1)&&(a.m|=64,K(a,4,26)));switch(f&7){case 1:h=4096;case 2:f|=128;c&E&&(h=8192);break;case 4:h=4096;case 5:c&E&&(h=4096);case 6:f|=c&E?192:128;break;default:h=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(h|=16384):(b&8128)>(f>>2&8128)&& -(h|=16384));a.O[a.j][d]=f;if(4194170!==e||a.j)a.bb=a.j,a.nb=d;h&&(h&57344&&(0<=a.ma&&(h|=128),a.G&57344||(a.G=a.G|h|a.bb<<5|a.nb<<1),K(a,168,28)),a.G&61440||!(4191360>e||4194239>>c.f;c=d!=c.i?c.b[f].jc(d,b):c.b[f++].eb(d,b)|c.b[f&c.N].eb(0,b+1)<<8}else c=b;return c} -function L(a,b,c){c&=65535;if(4194304<=b)return a.a[b-4194304]=c;if(0<=b){a=a.v;var d=c,f=b&a.i,e=(b&a.v)>>>a.f;f!=a.i?a.b[e].wc(f,d&65535,b):(a.b[e++].jb(f,d&255,b),a.b[e&a.N].jb(0,d>>8&255,b+1));return c}return b}function T(a,b){var c;4194304<=b?c=a.a[b-4194304]&255:0<=b?(c=a.v,c=c.b[(b&c.v)>>>c.f].eb(b&c.i,b)):c=b;return c}function U(a,b,c){c&=255;return 4194304<=b?a.a[b-4194304]=a.a[b-4194304]&65280|c:0<=b?(a=a.v,a.b[(b&a.v)>>>a.f].jb(b&a.i,c&255,b),c):b} -function R(a,b){return M(a,Nb(a,b,Ia))}function Ob(a){var b=R(a,a.a[6]|65536);0<=b&&(a.a[6]=a.a[6]+2&65535);return b}function S(a,b){var c,d;a.a[6]=d=a.a[6]-2&65535;a.G&57344||(a.ea=a.ea<<8|246);!a.j&&d<=a.la&&4>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.j&&c&E&&(a.a[6]<=a.la||65534<=a.a[6])&&(a.a[6]<=a.la-32||65534<=a.a[6]?(a.m|=4,a.a[6]=4,K(a,4,36)):(a.m|=8,a.C|=64)),7===e?a.a[e]:a.a[e]|65536;case 2:f=2;d=a.a[e];7!==e&&(d|=65536,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.a[e];7!==e&&(d|=65536);if(0>(d=R(a,d)))return d;d|=65536;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.a[e]+f&65535;7!==e&&(d|=65536);break;case 5:f=-2;d=a.a[e]-2&65535;7!==e&&(d|=65536);if(0>(d=R(a, -d)))return d;d|=65536;break;case 6:if(0>(d=R(a,a.a[7])))return d;a.a[7]=a.a[7]+2&65535;d=d+a.a[e]&65535;return d|65536;case 7:if(0>(d=R(a,a.a[7])))return d;a.a[7]=a.a[7]+2&65535;d=d+a.a[e]&65535;return 0>(d=R(a,d|65536))?d:d|65536}a.a[e]=a.a[e]+f&65535;a.G&57344||(a.ea=a.ea<<8|f<<3&248|e);6===e&&!a.j&&c&E&&0>=f&&(a.a[6]<=a.la||65534<=a.a[6])&&(a.a[6]<=a.la-32?(a.m|=4,a.a[6]=4,K(a,4,38)):(a.m|=8,a.C|=64));return d} -function W(a,b,c){var d;return b&56?(0<=(d=V(a,b,c))&&(d=Nb(a,d,c)),d):4194304+(b&7)}function X(a,b){var c;b&56?(c=W(a,b,Ia),c=M(a,c)):c=a.a[b&7];return c}function Y(a,b){var c;b&56?(c=W(a,b,Ja),c=T(a,c)):c=a.a[b&7]&255;return c}function Pb(a,b,c,d){b&56?(b=W(a,b,F),L(a,b,d.call(a,c,M(a,b)))):(b&=7,a.a[b]=d.call(a,c,a.a[b]))}function Qb(a,b,c,d){b&56?(b=W(a,b,G),U(a,b,d.call(a,c,T(a,b)))):(b&=7,a.a[b]=d.call(a,c,a.a[b]))}function Z(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} -m.Vb=function(a){this.h.complete=!0;this.h.Zb=!1;this.h.Ub=!1;this.R=this.o=a;this.Ib&256?(Ib(this),a=!1):a=!0;if(a){do{var b,c,d,f,e;this.C&112&&(this.C&32?K(this,168,52):this.C&64?K(this,4,54):this.C&16&&K(this,12,56),this.C&=-113);if(this.ja)if(1===this.ja)this.ja=2;else{this.ja=0;c=-1;b=this.ob&224;if(0<(a=this.i.length))for(;0b&&(b=this.i[a].hc, -c=a)}b>(this.s&224)&&(0>c?K(this,160,42):(K(this,this.i[c].uc,44),this.i.splice(c,1)))}this.G&57344||(this.ea=0,this.Va=this.a[7]);this.C=this.s&16;this.kb=R(this,this.a[7]);this.a[7]=this.a[7]+2&65535;this.decode(this.kb);if(0<=this.kb)switch(a=this.kb,this.a[7]=this.a[7]+2&65535,a&61440){default:switch(a&65024){case 2048:0<=(f=V(this,a,0))&&(e=a>>6&7,0<=S(this,this.a[e])&&(this.a[e]=this.a[7],this.a[7]=f&65535));break;case 28672:0<=(b=X(this,a))&&(e=a>>6&7,b&32768&&(b|=-65536),c=this.a[e],c&32768&& -(c|=-65536),a=~~(b*c),this.a[e]=a>>16&65535,this.a[e|1]=a&65535,this.c=a>>16,this.g=this.c|a,this.f=this.b=0,-32768>a||32767>6&7,c=this.a[e]<<16|this.a[e|1],this.f=this.b=0,b&32768&&(b|=-65536),a=~~(c/b),-32768<=a&&32767>=a?(this.a[e]=a&65535,this.a[e|1]=c-a*b&65535,this.g=a>>16|a,this.c=a>>16):(this.b=32768,this.g=a>>15|a,this.c=c>>16,-1===b&&65534===this.a[e]&&(this.a[e]=this.a[e|1]=1))):(this.g=this.c=0,this.b=32768,this.f=65536)); -break;case 29696:0<=(b=X(this,a))&&(e=a>>6&7,a=this.a[e],a&32768&&(a|=4294901760),this.f=this.b=0,b&=63,b&32?(b=64-b,16>b):b&&(16>15&65535)&&65535!==c&&(this.b=32768))),this.a[e]=a&65535,this.c=this.g=a);break;case 30208:if(0<=(b=X(this,a))){e=a>>6&7;c=this.a[e]<<16|this.a[e|1];this.f=this.b=0;b&=63;if(b&32)b=64-b,32>b-1,this.f=a<<16,a>>=1,c&2147483648&&(a|=4294967295<<32-b);else if(b){if(a=c<>15,a<<= -1,32>=32-b)c|=4294967295<>16&65535;this.a[e|1]=a&65535;this.c=a>>16;this.g=a>>16|a}break;case 30720:a&56?0<=(c=M(this,d=W(this,a,F)))&&(c^=this.a[a>>6&7],0<=L(this,d,c)&&(this.c=this.g=c,this.b=0)):(this.c=this.g=c=this.a[a&7]^=this.a[a>>6&7],this.b=0);break;case 32256:e=a>>6&7;if(this.a[e]=this.a[e]-1&65535)this.a[7]=this.a[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.a[7]=Z(this.a[7],a);break;case 512:this.g& -65535&&(this.a[7]=Z(this.a[7],a));break;case 768:this.g&65535||(this.a[7]=Z(this.a[7],a));break;case 1024:(this.c&32768)===(this.b&32768)&&(this.a[7]=Z(this.a[7],a));break;case 1280:(this.c&32768)!==(this.b&32768)&&(this.a[7]=Z(this.a[7],a));break;case 1536:this.g&65535&&(this.c&32768)===(this.b&32768)&&(this.a[7]=Z(this.a[7],a));break;case 1792:this.g&65535&&(this.c&32768)===(this.b&32768)||(this.a[7]=Z(this.a[7],a));break;case 32768:this.c&32768||(this.a[7]=Z(this.a[7],a));break;case 33280:!(this.f& -65536)&&this.g&65535&&(this.a[7]=Z(this.a[7],a));break;case 33024:this.c&32768&&(this.a[7]=Z(this.a[7],a));break;case 33536:if(this.f&65536||!(this.g&65535))this.a[7]=Z(this.a[7],a);break;case 33792:this.b&32768||(this.a[7]=Z(this.a[7],a));break;case 34048:this.b&32768&&(this.a[7]=Z(this.a[7],a));break;case 34304:this.f&65536||(this.a[7]=Z(this.a[7],a));break;case 34560:this.f&65536&&(this.a[7]=Z(this.a[7],a));break;case 34816:K(this,24,2);break;case 35072:K(this,28,4);break;default:switch(a&65472){case 64:0<= -(f=V(this,a,0))&&(this.a[7]=f&65535);break;case 192:a&56?0<=(c=M(this,d=W(this,a,F)))&&(a=c<<8|c>>8,0<=L(this,d,a)&&(this.c=this.g=c&65280,this.b=this.f=0)):(e=a&7,c=this.a[e],this.a[e]=(c<<8|c>>8)&65535,this.c=this.g=c&65280,this.b=this.f=0);break;case 2560:a&56?0<=(d=W(this,a,E))&&0<=L(this,d,0)&&(this.c=this.f=this.b=this.g=0):this.c=this.f=this.b=this.g=this.a[a&7]=0;break;case 2624:0<=(c=M(this,d=W(this,a,F)))&&(a=~c,0<=L(this,d,a)&&(this.c=this.g=a,this.f=65536,this.b=0));break;case 2688:a& -56?0<=(c=M(this,d=W(this,a,F)))&&(a=c+1,0<=L(this,d,a)&&(this.c=this.g=a,this.b=a&(a^c))):(e=a&7,c=this.a[e],a=c+1,this.a[e]=a&65535,this.c=this.g=a,this.b=a&(a^c));break;case 2752:a&56?0<=(c=M(this,d=W(this,a,F)))&&(a=c-1,0<=L(this,d,a)&&(this.c=this.g=a,this.b=(a^c)&c)):(e=a&7,c=this.a[e],a=c-1,this.a[e]=a&65535,this.c=this.g=a,this.b=(a^c)&c);break;case 2816:0<=(c=M(this,d=W(this,a,F)))&&(a=-c,0<=L(this,d,a)&&(this.f=this.c=this.g=a,this.b=a&c));break;case 2880:0<=(c=M(this,d=W(this,a,F)))&&(a= -c+(this.f>>16&1),0<=L(this,d,a)&&(this.f=this.c=this.g=a,this.b=a&(a^c)));break;case 2944:0<=(c=M(this,d=W(this,a,F)))&&(a=c-(this.f>>16&1),0<=L(this,d,a)&&(this.f=this.c=this.g=a,this.b=(a^c)&c));break;case 3008:0<=(c=X(this,a))&&(this.c=this.g=c,this.f=this.b=0);break;case 3072:a&56?0<=(c=M(this,d=W(this,a,F)))&&(a=(this.f&65536|c)>>1,0<=L(this,d,a)&&(this.f=c<<16,this.c=this.g=a,this.b=a^this.f>>1)):(e=a&7,c=this.a[e],a=(this.f&65536|c)>>1,this.a[e]=a&65535,this.f=c<<16,this.c=this.g=a,this.b= -a^this.f>>1);break;case 3136:a&56?0<=(c=M(this,d=W(this,a,F)))&&(a=c<<1|this.f>>16&1,0<=L(this,d,a)&&(this.f=this.c=this.g=a,this.b=a^c)):(e=a&7,c=this.a[e],a=c<<1|this.f>>16&1,this.a[e]=a&65535,this.f=this.c=this.g=a,this.b=a^c);break;case 3200:a&56?0<=(c=M(this,d=W(this,a,F)))&&(a=c&32768|c>>1,0<=L(this,d,a)&&(this.f=c<<16,this.c=this.g=a,this.b=this.c^this.f>>1)):(e=a&7,c=this.a[e],a=c&32768|c>>1,this.a[e]=a&65535,this.f=c<<16,this.c=this.g=a,this.b=this.c^this.f>>1);break;case 3264:a&56?0<=(c= -M(this,d=W(this,a,F)))&&(a=c<<1,0<=L(this,d,a)&&(this.f=this.c=this.g=a,this.b=a^c)):(e=a&7,c=this.a[e],a=c<<1,this.a[e]=a&65535,this.f=this.c=this.g=a,this.b=a^c);break;case 3328:f=this.a[7]+((a&63)<<1)&65535;0<=(b=R(this,f|65536))&&(this.a[7]=this.a[5],this.a[5]=b,this.a[6]=f+2&65535);break;case 3392:a&56?0<=(f=V(this,a,0))&&(61440!==(this.s&61440)&&(f&=65535),this.j=this.s>>12&3,0<=(b=R(this,f))&&(this.j=this.s>>14&3,0<=S(this,b)&&(this.c=this.g=b,this.b=0))):(e=a&7,b=6!==e||(this.s>>2&12288)=== -(this.s&12288)?this.a[e]:this.Y[this.s>>12&3],0<=S(this,b)&&(this.c=this.g=b,this.b=0));break;case 3456:0<=(c=Ob(this))&&((this.G&57344||(this.ea=22),a&56)?0<=(f=V(this,a,0))&&(f&=65535,this.j=this.s>>12&3,0<=(d=Nb(this,f,E))&&(this.j=this.s>>14&3,0<=L(this,d,c)&&(this.c=this.g=c,this.b=0))):(e=a&7,6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]=c:this.Y[this.s>>12&3]=c,this.c=this.g=c,this.b=0));break;case 3520:0<=(d=W(this,a,E))&&(a=-(this.c>>15&1),0<=L(this,d,a)&&(this.g=a,this.b=0));break; -case 35328:a&56?0<=(d=W(this,a,Ka))&&0<=U(this,d,0)&&(this.c=this.f=this.b=this.g=0):(this.a[a&7]&=65280,this.c=this.f=this.b=this.g=0);break;case 35392:0<=(c=T(this,d=W(this,a,G)))&&(a=~c,0<=U(this,d,a)&&(this.c=this.g=a<<8,this.f=65536,this.b=0));break;case 35456:0<=(c=T(this,d=W(this,a,G)))&&(a=c+1,0<=U(this,d,a)&&(this.c=this.g=a<<8,this.b=(a&(a^c))<<8));break;case 35520:0<=(c=T(this,d=W(this,a,G)))&&(a=c-1,0<=U(this,d,a)&&(this.c=this.g=a<<8,this.b=((a^c)&c)<<8));break;case 35584:0<=(c=T(this, -d=W(this,a,G)))&&(a=-c,0<=U(this,d,a)&&(this.f=this.c=this.g=a<<8,this.b=(a&c)<<8));break;case 35648:0<=(c=T(this,d=W(this,a,G)))&&(a=c+(this.f>>16&1),0<=U(this,d,a)&&(this.c=this.g=this.f=a<<8,this.b=(a&(a^c))<<8));break;case 35712:0<=(c=T(this,d=W(this,a,G)))&&(a=c-(this.f>>16&1),0<=U(this,d,a)&&(this.c=this.g=this.f=a<<8,this.b=((a^c)&c)<<8));break;case 35776:0<=(c=Y(this,a))&&(this.c=this.g=c<<8,this.f=this.b=0);break;case 35840:0<=(c=T(this,d=W(this,a,G)))&&(a=((this.f&65536)>>8|c)>>1,0<=U(this, -d,a)&&(this.f=c<<16,this.c=this.g=a<<8,this.b=this.c^this.f>>1));break;case 35904:0<=(c=T(this,d=W(this,a,G)))&&(a=c<<1|this.f>>16&1,0<=U(this,d,a)&&(this.f=this.c=this.g=a<<8,this.b=(a^c)<<8));break;case 35968:0<=(c=T(this,d=W(this,a,G)))&&(a=c&128|c>>1,0<=U(this,d,a)&&(this.f=c<<16,this.c=this.g=a<<8,this.b=this.c^this.f>>1));break;case 36032:0<=(c=T(this,d=W(this,a,G)))&&(a=c<<1,0<=U(this,d,a)&&(this.f=this.c=this.g=a<<8,this.b=(a^c)<<8));break;case 36160:a&56?0<=(f=V(this,a,0))&&(this.j=this.s>> -12&3,0<=(b=R(this,f|65536))&&(this.j=this.s>>14&3,0<=S(this,b)&&(this.c=this.g=b,this.b=0))):(e=a&7,b=6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]:this.Y[this.s>>12&3],0<=S(this,b)&&(this.c=this.g=b,this.b=0));break;case 36224:0<=(c=Ob(this))&&((this.G&57344||(this.ea=22),a&56)?0<=(f=V(this,a,0))&&(this.j=this.s>>12&3,0<=(d=Nb(this,f|65536,E))&&(this.j=this.s>>14&3,0<=L(this,d,c)&&(this.c=this.g=c,this.b=0))):(e=a&7,6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]=c:this.Y[this.s>>12&3]= -c,this.c=this.g=c,this.b=0));break;default:switch(a&65528){case 128:0<=(b=Ob(this))&&(e=a&7,this.a[7]=this.a[e],this.a[e]=b);break;case 152:this.s&49152||(this.s=this.s&63519|(a&7)<<5,this.ja=1);break;case 160:case 168:a&1&&(this.f=0);a&2&&(this.b=0);a&4&&(this.g=1);a&8&&(this.c=0);break;case 176:case 184:a&1&&(this.f=65536);a&2&&(this.b=32768);a&4&&(this.g=0);a&8&&(this.c=32768);break;default:switch(a){case 0:49152&this.s?(this.m|=128,K(this,4,46)):(this.Ca=3,Ib(this),console.log("HALT at "+this.a[7].toString(8))); -break;case 1:c=0;if(0<(a=this.i.length))for(;0>12].call(this,a)}function Yb(){--this.o} -var Xb=[function(){},function(a){var b=X(this,a>>6);a&56?L(this,W(this,a,E),b):this.a[a&7]=b;Q(this,b);--this.o},function(a){var b=X(this,a>>6);a=X(this,a);Mb(this,b-a,a,b);--this.o},function(a){Q(this,X(this,a>>6)&X(this,a));--this.o},function(a){Pb(this,a,X(this,a>>6),Sb);--this.o},function(a){Pb(this,a,X(this,a>>6),Ub);--this.o},function(a){Pb(this,a,X(this,a>>6),Rb);--this.o},Yb,Yb,function(a){var b=Y(this,a>>6),b=b&128?b|65280:b;a&56?(b&=255,U(this,W(this,a,Ka),b)):this.a[a&7]=b;Q(this,b<<8); ---this.o},function(a){var b=Y(this,a>>6)<<8;a=Y(this,a)<<8;Mb(this,b-a,a,b);--this.o},function(a){Q(this,(Y(this,a>>6)&Y(this,a))<<8);--this.o},function(a){Qb(this,a,Y(this,a>>6),Tb);--this.o},function(a){Qb(this,a,Y(this,a>>6),Vb);--this.o},function(a){Pb(this,a,X(this,a>>6),Wb);--this.o},Yb]; -function Zb(a){w.call(this,"ROM",a,Zb);this.b=null;this.o=a.addr;this.f=a.size;this.u=a.writable;this.g=a.alias;this.i=a.file;this.F=ba(this.i);if(this.i){a=this.i;var b=ca(this.F);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;p(a,null,!0,function(a,b,e){$b(c,a,b,e)})}}y(Zb);Zb.prototype.Ga=function(a,b,c,d){this.v=b;this.c=c;this.I=d;ac(this)};Zb.prototype.ua=function(){this.j&&(this.I&&this.I.c(this.id,this.o,this.f,this.j),delete this.j);return!0}; -Zb.prototype.ta=function(){return!0}; -function $b(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Da(a.Fb,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,h,g=eval("("+c+")");if(e=g.bytes)a.b=e;else if(e=g.words)for(a.b=Array(2*e.length),h=f=0;f>8&255;else if(e=g.data)for(a.b=Array(4*e.length),h=f=0;f>8&255,a.b[h++]=e[f]>>16&255,a.b[h++]=e[f]>>24&255;else a.b=g;a.j=g.symbols;if(!a.b.length){q("Empty ROM: "+b); -return}if(1==a.b.length){q(a.b[0]);return}}catch(k){a.K("ROM data error: "+k.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),f=0;f>>d.f].Wb(f&d.i,a.b[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>>f.f;0>>=f.f;0\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bfc){if(hc(d,this.F)){this.j=new O(this,"1.30.0","failsafe");hc(this.j)&&(nc(this,d),a=2,oc(this.j));P(this.j,"timestamp",ia());pc(this.j);var f=this.b&&!this.o;if(1==a||ja("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=lc(d)){var e=mc(d,"code"),h=mc(d,"data");e&&("ok"==e?hc(d,h):("error"==e&& -"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(na("user",""),this.f=null)):this.X(e+": "+h),oc(d),hc(d)?(c=lc(d),f=!0):c=!1))}f&&kc(this,c?d:null)}else 2==a&&d.clear()}else kc(this);delete this.F;delete this.J}f=z(this.id);for(e=0;ea[1];a=a[2];this.da=!0;this.h.L=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.c&&(qc(this,this.c,b,c,a),this.c.Xa());this.R&&(nc(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);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||"",d=b.toString(),f={app:"PDP11js",ver:"1.30.0"};f.url=a.url;f.user=c;f.type="bug";f.data=d;p("http://www.pcjs.org/api/v1/report",f,!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"),h=new O(a,"1.30.0","validate"),g=ia();P(h,"timestamp",g);P(e,"timestamp",g);P(e,"version","1.30.0");P(e,"url",window?window.location.href:null);P(e,"browser",window?window.navigator.userAgent:"");a.c&&a.c.ta&&(c&&Db(a.c),d=a.c.ta(b,c),"object"===typeof d&&P(e,a.c.id,d),c&&(a.c.h.L=!1,!1===d&&(f=null)));for(var g=z(a.id),k=0;k>=3;d=""+f}else d=n(c,d);else d="--------".substr(0,d||4);a.A[b].textContent!=d&&(a.A[b].textContent=d)}} +m.ba=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.A[b]=c;a=!0;break;case "run":this.A[b]=c;c.onclick=function(){var a;if(a=d.u)if(a=d.u,a.i.L)a=!0;else{var b=null,c,g=z(a.id);for(c=0;ca.M/a.Z&&(b=1);a.da=b;var c=a.ub*a.da;if(a.Z!=c){a.Z=c;var c=a.Z.toFixed(2)+"Mhz",d=a.A.setSpeed;d&&(d.textContent=c);a.X("target speed: "+c)}}Fb(a,a.J);a.J=0;a.F=ha();a.N=0;Gb(a)}function Ib(a){a.R-=a.b;a.b=0} +m.Db=function(){if(Fa(this,!0)){if(!this.i.ha){Eb(this);this.u&&this.u.start(this.F,Hb(this));this.i.ha=!0;this.i.Tb=!0;this.xa&&this.xa.start();var a=this.A.run;a&&(a.textContent="Halt");this.u&&this.u.Ka(!0)}this.wb>=this.vb&&Gb(this,!0);this.Ba=0;this.Ma=ha();this.N&&(a=this.Ma-this.N,a>this.Ib&&(this.F+=a,this.F>this.Ma&&(this.F=this.Ma)));try{do{for(var b,c=this.i.kb?1:this.Pa,d=this.La.length-1;0<=d;d--){var f=this.La[d];0>f[0]||c>f[0]&&(c=f[0])}b=c;try{this.Ub(b)}catch(l){if("number"!=typeof l)throw l; +}for(var e=this.R-this.b,a=e,h=this.La.length-1;0<=h;h--){var g=this.La[h];0>g[0]||(g[0]-=a,0>=g[0]&&(g[0]=-1,g[1]()))}this.Ba+=e;this.J+=e;Fb(this,0,!0);a=e;if(this.i.kb){var k=!1;this.Na=this.Na+this.Ob()|0;this.ca-=a;0>=this.ca&&(this.ca+=this.ya,k=!0);0<=this.za&&this.za<=Hb(this)&&(this.ya=this.za=-1,Ab(this),Db(this),k=!0);k&&this.X(Hb(this)+" cycles: checksum="+n(this.Na))}this.Aa-=e;if(0>=this.Aa){this.Aa+=this.Pa;15<=++this.Jb&&(this.u&&this.u.Ka(),this.Jb=0);break}}while(this.i.ha)}catch(l){Db(this); +Bb(this);this.u&&this.u.stop(ha(),Hb(this));Fa(this,!1);b=l.stack||l.message;this.i.error=!0;this.K(b);return}b=setTimeout;c=this.Kb;this.N=ha();d=this.Ib;this.Ba&&(d=Math.round(d*this.Ba/this.Pa));d=d-(this.N-this.Ma);if(f=this.N-this.F)this.M=Math.round(this.J/(10*f))/100,864E5<=f&&(this.W=0,Eb(this));if(0>d||this.Md&&(this.F-=d),d=0;this.wb+=this.Ba;this.N+=d;b(c,d)}else Bb(this),this.u&&this.u.stop(ha(),Hb(this))};m.Ub=function(){return 0}; +function Db(a){a.i.Za&&(a.i.xb=!0);Ib(a);Fb(a,a.J);a.J=0;if(a.i.ha){a.i.ha=!1;a.xa&&a.xa.stop();var b=a.A.run;b&&(b.textContent="Run")}a.i.complete=void 0}function Bb(a){a.u&&a.u.Ka(void 0)} +function Jb(a){this.Yb=+a.model||1170;this.cc=a.resetAddr||0;wb.call(this,a,1E6);this.Fb=0;this.decode=Kb.bind(this);this.g=65536;this.f=32768;this.h=65535;this.c=32768;this.a=[0,0,0,0,0,0,0,this.cc];this.Ia=[0,0,0,0,0,0];this.Y=[0,0,0,0];this.memory=[];this.j=[];this.Ca=this.nb=0;this.ja=2;this.la=255;this.C=0;this.ma=-1;this.o=0;this.Fa=70;this.mb=this.bb=this.ab=this.m=this.na=this.Va=this.ea=this.G=0;this.Ha=[7,7,7,7];this.O=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0, +0,0,0,0,0,0,0,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.ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.zb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.i.complete=this.i.Zb=!1}y(Jb,wb);m=Jb.prototype; +m.reset=function(){this.i.ha&&Db(this);Lb(this);zb(this);this.i.error=!1;this.parent.reset.call(this)};function Lb(a){a.la=255;a.o=0;a.j=[];a.nb=0;a.G=a.ea=a.Va=a.na=a.ab=0;a.Ha[0]=a.Ha[1]=a.Ha[3]=7;a.bb=0}m.Ob=function(){return 0}; +m.save=function(){var a=new N(this);P(a,0,[]);P(a,1,[this.Eb,this.W,this.da]);for(var b=this.v,c=0,d=[],f=0;fb){a.j[e].fa-=b;break}b-=a.j[e].fa}a.j.splice(e+1,0,{delay:b,priority:c&224,vector:d,callback:f})}a.ja=2}function $a(a){return a.s=a.s&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.s)&2048)for(var c=a.Ia.length;0<=--c;){var d=a.a[c];a.a[c]=a.Ia[c];a.Ia[c]=d}a.m=b>>14&3;c=a.s>>14&3;a.m!=c&&(a.Y[c]=a.a[6],a.a[6]=a.Y[a.m]);a.ja=2;a.s=b}function Q(a,b){a.C&128||(a.c=a.h=b,a.f=0)}function Mb(a,b,c,d){a.C&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.ma?a.ma=$a(a):a.m||(b=4,e=1);a.G&57344||(a.ea=63222,a.Va=b);a.m=0;0<=(d=R(a,b|65536))&&0<=(f=R(a,b+2&65535|65536))&&(ab(a,f&53247|a.ma>>2&12288),e&&(a.o|=4,a.a[6]=4),0<=S(a,a.ma)&&0<=S(a,a.a[7])&&(a.a[7]=d));a.C&=-113;a.ma=-1;throw b|c<<8;}function hb(a,b){var c=b>>13&31;31>c?a.na&32&&(b=a.ib[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} +function Nb(a,b,c){var d,f,e,h=0;if(c&a.ab){d=b>>13&a.Ha[a.m];f=a.O[a.m][d];e=(a.O[a.m][d+16]<<6)+(b&8191)&4194303;a.na&16?3932160<=e&&4186112>e&&(e=hb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.o|=32,K(a,4,24)),e&1&&!(c&1)&&(a.o|=64,K(a,4,26)));switch(f&7){case 1:h=4096;case 2:f|=128;c&E&&(h=8192);break;case 4:h=4096;case 5:c&E&&(h=4096);case 6:f|=c&E?192:128;break;default:h=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(h|=16384):(b&8128)>(f>>2&8128)&& +(h|=16384));a.O[a.m][d]=f;if(4194170!==e||a.m)a.bb=a.m,a.mb=d;h&&(h&57344&&(0<=a.ma&&(h|=128),a.G&57344||(a.G=a.G|h|a.bb<<5|a.mb<<1),K(a,168,28)),a.G&61440||!(4191360>e||4194239>>c.f;c=d!=c.h?c.c[f].ic(d,b):c.c[f++].eb(d,b)|c.c[f&c.N].eb(0,b+1)<<8}else c=b;return c} +function L(a,b,c){c&=65535;if(4194304<=b)return a.a[b-4194304]=c;if(0<=b){a=a.v;var d=c,f=b&a.h,e=(b&a.j)>>>a.f;f!=a.h?a.c[e].vc(f,d&65535,b):(a.c[e++].jb(f,d&255,b),a.c[e&a.N].jb(0,d>>8&255,b+1));return c}return b}function T(a,b){var c;4194304<=b?c=a.a[b-4194304]&255:0<=b?(c=a.v,c=c.c[(b&c.j)>>>c.f].eb(b&c.h,b)):c=b;return c}function U(a,b,c){c&=255;return 4194304<=b?a.a[b-4194304]=a.a[b-4194304]&65280|c:0<=b?(a=a.v,a.c[(b&a.j)>>>a.f].jb(b&a.h,c&255,b),c):b} +function R(a,b){return M(a,Nb(a,b,Ia))}function Ob(a){var b=R(a,a.a[6]|65536);0<=b&&(a.a[6]=a.a[6]+2&65535);return b}function S(a,b){var c,d;a.a[6]=d=a.a[6]-2&65535;a.G&57344||(a.ea=a.ea<<8|246);!a.m&&d<=a.la&&4>3&7){case 0:K(a,4,34);break;case 1:return 6===e&&!a.m&&c&E&&(a.a[6]<=a.la||65534<=a.a[6])&&(a.a[6]<=a.la-32||65534<=a.a[6]?(a.o|=4,a.a[6]=4,K(a,4,36)):(a.o|=8,a.C|=64)),7===e?a.a[e]:a.a[e]|65536;case 2:f=2;d=a.a[e];7!==e&&(d|=65536,6>e&&c&1&&(f=1));break;case 3:f=2;d=a.a[e];7!==e&&(d|=65536);if(0>(d=R(a,d)))return d;d|=65536;break;case 4:f=-2;6>e&&c&1&&(f=-1);d=a.a[e]+f&65535;7!==e&&(d|=65536);break;case 5:f=-2;d=a.a[e]-2&65535;7!==e&&(d|=65536);if(0>(d= +R(a,d)))return d;d|=65536;break;case 6:if(0>(d=R(a,a.a[7])))return d;a.a[7]=a.a[7]+2&65535;d=d+a.a[e]&65535;return d|65536;case 7:if(0>(d=R(a,a.a[7])))return d;a.a[7]=a.a[7]+2&65535;d=d+a.a[e]&65535;return 0>(d=R(a,d|65536))?d:d|65536}a.a[e]=a.a[e]+f&65535;a.G&57344||(a.ea=a.ea<<8|f<<3&248|e);6===e&&!a.m&&c&E&&0>=f&&(a.a[6]<=a.la||65534<=a.a[6])&&(a.a[6]<=a.la-32?(a.o|=4,a.a[6]=4,K(a,4,38)):(a.o|=8,a.C|=64));return d} +function V(a,b,c){var d;return b&56?(0<=(d=Pb(a,b,c))&&(d=Nb(a,d,c)),d):4194304+(b&7)}function W(a,b){var c;b&56?(c=V(a,b,Ia),c=M(a,c)):c=a.a[b&7];return c}function X(a,b){var c;b&56?(c=V(a,b,Ja),c=T(a,c)):c=a.a[b&7]&255;return c}function Qb(a,b,c,d){b&56?(b=V(a,b,F),L(a,b,d.call(a,c,M(a,b)))):(b&=7,a.a[b]=d.call(a,c,a.a[b]))}function Rb(a,b,c,d){b&56?(b=V(a,b,G),U(a,b,d.call(a,c,T(a,b)))):(b&=7,a.a[b]=d.call(a,c,a.a[b]))}function Y(a,b){return((b&128?b|65280:b&255)<<1)+a&65535} +m.Ub=function(a){this.i.complete=!0;this.i.Zb=!1;this.i.Tb=!1;this.R=this.b=a;this.Eb&256?(Ib(this),a=!1):a=!0;if(a){do{var b,c,d,f,e;this.C&112&&(this.C&32?K(this,168,52):this.C&64?K(this,4,54):this.C&16&&K(this,12,56),this.C&=-113);if(this.ja)if(1===this.ja)this.ja=2;else{this.ja=0;c=-1;b=this.nb&224;if(0<(a=this.j.length))for(;0b&&(b=this.j[a].gc, +c=a)}b>(this.s&224)&&(0>c?K(this,160,42):(K(this,this.j[c].tc,44),this.j.splice(c,1)))}this.G&57344||(this.ea=0,this.Va=this.a[7]);this.C=this.s&16;a=R(this,this.a[7]);this.a[7]=this.a[7]+2&65535;this.decode(a);if(0<=a)switch(a&61440){default:switch(a&65024){case 2048:0<=(f=Pb(this,a,0))&&(e=a>>6&7,0<=S(this,this.a[e])&&(this.a[e]=this.a[7],this.a[7]=f&65535));break;case 28672:0<=(b=W(this,a))&&(e=a>>6&7,b&32768&&(b|=-65536),c=this.a[e],c&32768&&(c|=-65536),a=~~(b*c),this.a[e]=a>>16&65535,this.a[e| +1]=a&65535,this.c=a>>16,this.h=this.c|a,this.g=this.f=0,-32768>a||32767>6&7,c=this.a[e]<<16|this.a[e|1],this.g=this.f=0,b&32768&&(b|=-65536),a=~~(c/b),-32768<=a&&32767>=a?(this.a[e]=a&65535,this.a[e|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.a[e]&&(this.a[e]=this.a[e|1]=1))):(this.h=this.c=0,this.f=32768,this.g=65536));break;case 29696:0<=(b=W(this,a))&&(e=a>>6&7,a=this.a[e], +a&32768&&(a|=4294901760),this.g=this.f=0,b&=63,b&32?(b=64-b,16>b):b&&(16>15&65535)&&65535!==c&&(this.f=32768))),this.a[e]=a&65535,this.c=this.h=a);break;case 30208:if(0<=(b=W(this,a))){e=a>>6&7;c=this.a[e]<<16|this.a[e|1];this.g=this.f=0;b&=63;if(b&32)b=64-b,32>b-1,this.g=a<<16,a>>=1,c&2147483648&&(a|=4294967295<<32-b);else if(b){if(a=c<>15,a<<=1,32>=32-b)c|=4294967295<>16&65535;this.a[e|1]=a&65535;this.c=a>>16;this.h=a>>16|a}break;case 30720:a&56?0<=(c=M(this,d=V(this,a,F)))&&(c^=this.a[a>>6&7],0<=L(this,d,c)&&(this.c=this.h=c,this.f=0)):(this.c=this.h=c=this.a[a&7]^=this.a[a>>6&7],this.f=0);break;case 32256:e=a>>6&7;if(this.a[e]=this.a[e]-1&65535)this.a[7]=this.a[7]-((a&63)<<1)&65535;break;default:switch(a&65280){case 256:this.a[7]=Y(this.a[7],a);break;case 512:this.h&65535&&(this.a[7]=Y(this.a[7],a));break;case 768:this.h& +65535||(this.a[7]=Y(this.a[7],a));break;case 1024:(this.c&32768)===(this.f&32768)&&(this.a[7]=Y(this.a[7],a));break;case 1280:(this.c&32768)!==(this.f&32768)&&(this.a[7]=Y(this.a[7],a));break;case 1536:this.h&65535&&(this.c&32768)===(this.f&32768)&&(this.a[7]=Y(this.a[7],a));break;case 1792:this.h&65535&&(this.c&32768)===(this.f&32768)||(this.a[7]=Y(this.a[7],a));break;case 32768:this.c&32768||(this.a[7]=Y(this.a[7],a));break;case 33280:!(this.g&65536)&&this.h&65535&&(this.a[7]=Y(this.a[7],a));break; +case 33024:this.c&32768&&(this.a[7]=Y(this.a[7],a));break;case 33536:if(this.g&65536||!(this.h&65535))this.a[7]=Y(this.a[7],a);break;case 33792:this.f&32768||(this.a[7]=Y(this.a[7],a));break;case 34048:this.f&32768&&(this.a[7]=Y(this.a[7],a));break;case 34304:this.g&65536||(this.a[7]=Y(this.a[7],a));break;case 34560:this.g&65536&&(this.a[7]=Y(this.a[7],a));break;case 34816:K(this,24,2);break;case 35072:K(this,28,4);break;default:switch(a&65472){case 64:0<=(f=Pb(this,a,0))&&(this.a[7]=f&65535);break; +case 192:a&56?0<=(c=M(this,d=V(this,a,F)))&&(a=c<<8|c>>8,0<=L(this,d,a)&&(this.c=this.h=c&65280,this.f=this.g=0)):(e=a&7,c=this.a[e],this.a[e]=(c<<8|c>>8)&65535,this.c=this.h=c&65280,this.f=this.g=0);break;case 2560:a&56?0<=(d=V(this,a,E))&&0<=L(this,d,0)&&(this.c=this.g=this.f=this.h=0):this.c=this.g=this.f=this.h=this.a[a&7]=0;break;case 2624:0<=(c=M(this,d=V(this,a,F)))&&(a=~c,0<=L(this,d,a)&&(this.c=this.h=a,this.g=65536,this.f=0));break;case 2688:a&56?0<=(c=M(this,d=V(this,a,F)))&&(a=c+1,0<= +L(this,d,a)&&(this.c=this.h=a,this.f=a&(a^c))):(e=a&7,c=this.a[e],a=c+1,this.a[e]=a&65535,this.c=this.h=a,this.f=a&(a^c));break;case 2752:a&56?0<=(c=M(this,d=V(this,a,F)))&&(a=c-1,0<=L(this,d,a)&&(this.c=this.h=a,this.f=(a^c)&c)):(e=a&7,c=this.a[e],a=c-1,this.a[e]=a&65535,this.c=this.h=a,this.f=(a^c)&c);break;case 2816:0<=(c=M(this,d=V(this,a,F)))&&(a=-c,0<=L(this,d,a)&&(this.g=this.c=this.h=a,this.f=a&c));break;case 2880:0<=(c=M(this,d=V(this,a,F)))&&(a=c+(this.g>>16&1),0<=L(this,d,a)&&(this.g=this.c= +this.h=a,this.f=a&(a^c)));break;case 2944:0<=(c=M(this,d=V(this,a,F)))&&(a=c-(this.g>>16&1),0<=L(this,d,a)&&(this.g=this.c=this.h=a,this.f=(a^c)&c));break;case 3008:0<=(c=W(this,a))&&(this.c=this.h=c,this.g=this.f=0);break;case 3072:a&56?0<=(c=M(this,d=V(this,a,F)))&&(a=(this.g&65536|c)>>1,0<=L(this,d,a)&&(this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1)):(e=a&7,c=this.a[e],a=(this.g&65536|c)>>1,this.a[e]=a&65535,this.g=c<<16,this.c=this.h=a,this.f=a^this.g>>1);break;case 3136:a&56?0<=(c=M(this,d= +V(this,a,F)))&&(a=c<<1|this.g>>16&1,0<=L(this,d,a)&&(this.g=this.c=this.h=a,this.f=a^c)):(e=a&7,c=this.a[e],a=c<<1|this.g>>16&1,this.a[e]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3200:a&56?0<=(c=M(this,d=V(this,a,F)))&&(a=c&32768|c>>1,0<=L(this,d,a)&&(this.g=c<<16,this.c=this.h=a,this.f=this.c^this.g>>1)):(e=a&7,c=this.a[e],a=c&32768|c>>1,this.a[e]=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=M(this,d=V(this,a,F)))&&(a=c<<1,0<=L(this,d,a)&& +(this.g=this.c=this.h=a,this.f=a^c)):(e=a&7,c=this.a[e],a=c<<1,this.a[e]=a&65535,this.g=this.c=this.h=a,this.f=a^c);break;case 3328:f=this.a[7]+((a&63)<<1)&65535;0<=(b=R(this,f|65536))&&(this.a[7]=this.a[5],this.a[5]=b,this.a[6]=f+2&65535);break;case 3392:a&56?0<=(f=Pb(this,a,0))&&(61440!==(this.s&61440)&&(f&=65535),this.m=this.s>>12&3,0<=(b=R(this,f))&&(this.m=this.s>>14&3,0<=S(this,b)&&(this.c=this.h=b,this.f=0))):(e=a&7,b=6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]:this.Y[this.s>>12&3], +0<=S(this,b)&&(this.c=this.h=b,this.f=0));break;case 3456:0<=(c=Ob(this))&&((this.G&57344||(this.ea=22),a&56)?0<=(f=Pb(this,a,0))&&(f&=65535,this.m=this.s>>12&3,0<=(d=Nb(this,f,E))&&(this.m=this.s>>14&3,0<=L(this,d,c)&&(this.c=this.h=c,this.f=0))):(e=a&7,6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]=c:this.Y[this.s>>12&3]=c,this.c=this.h=c,this.f=0));break;case 3520:0<=(d=V(this,a,E))&&(a=-(this.c>>15&1),0<=L(this,d,a)&&(this.h=a,this.f=0));break;case 35328:a&56?0<=(d=V(this,a,Ka))&&0<=U(this, +d,0)&&(this.c=this.g=this.f=this.h=0):(this.a[a&7]&=65280,this.c=this.g=this.f=this.h=0);break;case 35392:0<=(c=T(this,d=V(this,a,G)))&&(a=~c,0<=U(this,d,a)&&(this.c=this.h=a<<8,this.g=65536,this.f=0));break;case 35456:0<=(c=T(this,d=V(this,a,G)))&&(a=c+1,0<=U(this,d,a)&&(this.c=this.h=a<<8,this.f=(a&(a^c))<<8));break;case 35520:0<=(c=T(this,d=V(this,a,G)))&&(a=c-1,0<=U(this,d,a)&&(this.c=this.h=a<<8,this.f=((a^c)&c)<<8));break;case 35584:0<=(c=T(this,d=V(this,a,G)))&&(a=-c,0<=U(this,d,a)&&(this.g= +this.c=this.h=a<<8,this.f=(a&c)<<8));break;case 35648:0<=(c=T(this,d=V(this,a,G)))&&(a=c+(this.g>>16&1),0<=U(this,d,a)&&(this.c=this.h=this.g=a<<8,this.f=(a&(a^c))<<8));break;case 35712:0<=(c=T(this,d=V(this,a,G)))&&(a=c-(this.g>>16&1),0<=U(this,d,a)&&(this.c=this.h=this.g=a<<8,this.f=((a^c)&c)<<8));break;case 35776:0<=(c=X(this,a))&&(this.c=this.h=c<<8,this.g=this.f=0);break;case 35840:0<=(c=T(this,d=V(this,a,G)))&&(a=((this.g&65536)>>8|c)>>1,0<=U(this,d,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f= +this.c^this.g>>1));break;case 35904:0<=(c=T(this,d=V(this,a,G)))&&(a=c<<1|this.g>>16&1,0<=U(this,d,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 35968:0<=(c=T(this,d=V(this,a,G)))&&(a=c&128|c>>1,0<=U(this,d,a)&&(this.g=c<<16,this.c=this.h=a<<8,this.f=this.c^this.g>>1));break;case 36032:0<=(c=T(this,d=V(this,a,G)))&&(a=c<<1,0<=U(this,d,a)&&(this.g=this.c=this.h=a<<8,this.f=(a^c)<<8));break;case 36160:a&56?0<=(f=Pb(this,a,0))&&(this.m=this.s>>12&3,0<=(b=R(this,f|65536))&&(this.m=this.s>> +14&3,0<=S(this,b)&&(this.c=this.h=b,this.f=0))):(e=a&7,b=6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]:this.Y[this.s>>12&3],0<=S(this,b)&&(this.c=this.h=b,this.f=0));break;case 36224:0<=(c=Ob(this))&&((this.G&57344||(this.ea=22),a&56)?0<=(f=Pb(this,a,0))&&(this.m=this.s>>12&3,0<=(d=Nb(this,f|65536,E))&&(this.m=this.s>>14&3,0<=L(this,d,c)&&(this.c=this.h=c,this.f=0))):(e=a&7,6!==e||(this.s>>2&12288)===(this.s&12288)?this.a[e]=c:this.Y[this.s>>12&3]=c,this.c=this.h=c,this.f=0));break;default:switch(a& +65528){case 128:0<=(b=Ob(this))&&(e=a&7,this.a[7]=this.a[e],this.a[e]=b);break;case 152:this.s&49152||(this.s=this.s&63519|(a&7)<<5,this.ja=1);break;case 160:case 168:a&1&&(this.g=0);a&2&&(this.f=0);a&4&&(this.h=1);a&8&&(this.c=0);break;case 176:case 184:a&1&&(this.g=65536);a&2&&(this.f=32768);a&4&&(this.h=0);a&8&&(this.c=32768);break;default:switch(a){case 0:49152&this.s?(this.o|=128,K(this,4,46)):(this.Ca=3,Ib(this),console.log("HALT at "+this.a[7].toString(8)));break;case 1:c=0;if(0<(a=this.j.length))for(;0< +a--;)c+=this.j[a].fa,this.j[a].fa=0;0===c&&0===this.Ca&&(this.Ca=2,Ib(this));break;case 3:K(this,12,6);break;case 4:K(this,16,8);break;case 5:this.s&49152||(Lb(this),this.v.reset());break;case 2:case 6:d=this.a[6];0<=(f=R(this,d|65536))&&(d=d+2&65535,0<=(b=R(this,d|65536))&&(this.a[6]=d+2&65535,b&=63743,this.s&49152&&(b=b&63519|this.s&63712),this.a[7]=f,ab(this,b),this.C&=-17,2===a&&(this.C|=this.s&16)));break;default:K(this,8,48)}}}}}}}while(0>12].call(this,a)} +var ec=[function(a){fc[a>>8&15].call(this,a)},function(a){var b=W(this,a>>6);a&56?L(this,V(this,a,E),b):this.a[a&7]=b;Q(this,b);--this.b},function(a){var b=W(this,a>>6);a=W(this,a);Mb(this,b-a,a,b);--this.b},function(a){Q(this,W(this,a>>6)&W(this,a));--this.b},function(a){Qb(this,a,W(this,a>>6),Tb);--this.b},function(a){Qb(this,a,W(this,a>>6),Vb);--this.b},function(a){Qb(this,a,W(this,a>>6),Sb);--this.b},function(a){gc[a>>8&15].call(this,a)},function(a){hc[a>>8&15].call(this,a)},function(a){var b= +X(this,a>>6),b=b&128?b|65280:b;a&56?(b&=255,U(this,V(this,a,Ka),b)):this.a[a&7]=b;Q(this,b<<8);--this.b},function(a){var b=X(this,a>>6)<<8;a=X(this,a)<<8;Mb(this,b-a,a,b);--this.b},function(a){Q(this,(X(this,a>>6)&X(this,a))<<8);--this.b},function(a){Rb(this,a,X(this,a>>6),Ub);--this.b},function(a){Rb(this,a,X(this,a>>6),Wb);--this.b},function(a){Qb(this,a,W(this,a>>6),Xb);--this.b},Z],fc=[function(a){ic[a>>4&15].call(this,a)},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}, +function(){--this.b},function(){--this.b},function(){--this.b},ac,ac,function(a){jc[a>>6&3].call(this,a)},function(a){kc[a>>6&3].call(this,a)},function(a){lc[a>>6&3].call(this,a)},function(a){mc[a>>6&3].call(this,a)},Z,Z],ic=[function(a){nc[a&15].call(this,a)},Z,Z,Z,Z,Z,Z,Z,Z,Z,function(){--this.b},function(){--this.b},Z,Z,Z,Z],nc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}, +Z,Z,Z,Z,Z,Z,Z,Z],gc=[bc,bc,$b,$b,Yb,Yb,Zb,Zb,dc,dc,Z,Z,Z,Z,cc,cc],hc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b},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],jc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}], +kc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],lc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],mc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],oc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],pc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}],qc=[function(){--this.b},function(){--this.b},function(){--this.b}, +function(){--this.b}],rc=[function(){--this.b},function(){--this.b},function(){--this.b},function(){--this.b}];function sc(a){v.call(this,"ROM",a,sc);this.c=null;this.m=a.addr;this.f=a.size;this.u=a.writable;this.g=a.alias;this.h=a.file;this.F=ba(this.h);if(this.h){a=this.h;var b=ca(this.F);"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){tc(c,a,b,e)})}}y(sc);sc.prototype.Ga=function(a,b,c,d){this.v=b;this.b=c;this.I=d;uc(this)}; +sc.prototype.ua=function(){this.j&&(this.I&&this.I.b(this.id,this.m,this.f,this.j),delete this.j);return!0};sc.prototype.ta=function(){return!0}; +function tc(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Da(a.Hb,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,h,g=eval("("+c+")");if(e=g.bytes)a.c=e;else if(e=g.words)for(a.c=Array(2*e.length),h=f=0;f>8&255;else if(e=g.data)for(a.c=Array(4*e.length),h=f=0;f>8&255,a.c[h++]=e[f]>>16&255,a.c[h++]=e[f]>>24&255;else a.c=g;a.j=g.symbols;if(!a.c.length){q("Empty ROM: "+b); +return}if(1==a.c.length){q(a.c[0]);return}}catch(k){a.K("ROM data error: "+k.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.c=Array(b.length),f=0;f>>d.f].Vb(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>>f.f;0>>=f.f;0\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bzc){if(Bc(d,this.F)){this.j=new N(this,"1.30.0","failsafe");Bc(this.j)&&(Hc(this,d),a=2,Ic(this.j));P(this.j,"timestamp",ia());Jc(this.j);var f=this.c&&!this.m;if(1==a||ja("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Fc(d)){var e=Gc(d,"code"),h=Gc(d,"data");e&&("ok"==e?Bc(d,h):("error"==e&& +"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(na("user",""),this.f=null)):this.X(e+": "+h),Ic(d),Bc(d)?(c=Fc(d),f=!0):c=!1))}f&&Ec(this,c?d:null)}else 2==a&&d.clear()}else Ec(this);delete this.F;delete this.J}f=z(this.id);for(e=0;ea[1];a=a[2];this.da=!0;this.i.L=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.b&&(Kc(this,this.b,b,c,a),this.b.Xa());this.R&&(Hc(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +function Hc(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||"",d=b.toString(),f={app:"PDP11js",ver:"1.30.0"};f.url=a.url;f.user=c;f.type="bug";f.data=d;p("http://www.pcjs.org/api/v1/report",f,!0)}} +function Lc(a,b,c){var d,f="none";if(a.g)return null;a.g--;var e=new N(a,"1.30.0"),h=new N(a,"1.30.0","validate"),g=ia();P(h,"timestamp",g);P(e,"timestamp",g);P(e,"version","1.30.0");P(e,"url",window?window.location.href:null);P(e,"browser",window?window.navigator.userAgent:"");a.b&&a.b.ta&&(c&&Db(a.b),d=a.b.ta(b,c),"object"===typeof d&&P(e,a.b.id,d),c&&(a.b.i.L=!1,!1===d&&(f=null)));for(var g=z(a.id),k=0;kg.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(v){g=null,a=v.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=d[2];b("Loading "+f+"...");p(f,null,!0,function(e,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(e=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,r=/( [a-z]+=)(['"])(.*?)\2/g;l=r.exec(e);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+f);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],h);yc(a,b,c)}})}else c(a,null)} -function zc(a,b,c,d){function f(a){if(void 0===g){var b=h&&C(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function e(a){f("Error: "+a);k&&(--vc||ua(!0));k=!1}var h,g,k=!0;vc++;Ca[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var r=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=l:v.appendChild(document.createTextNode(l));r.appendChild(v)}c|| -(c="/versions/pdp11/1.30.0/components.xsl");l=function(d,g){g?wc(c,null,null,!1,f,function(d,k){if(k)if(Da(a,c,d),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--vc||ua(!0)):e("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--vc||ua(!0)):e("invalid machine element: "+ -a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser");else e(d)}):e(d)};"<"!=b.charAt(0)?wc(b,a,d,!0,f,l):xc(b,null,a,d,!1,f,l)}else e("missing machine element: "+a)}catch(N){e(N.message)}return k}window.embedPDP11=function(a,b,c,d){ua(!1);return zc(a,b,c,d)};window.enableEvents=ua;window.sendEvent=va;})(); +m.ba=function(a,b,c){var d=this;switch(b){case "power":return this.A[b]=c,c.onclick=function(){d.g||(d.i.L?Lc(d,!1,!0):Dc(d,d.cb))},!0;case "reset":return this.A[b]=c,c.onclick=function(){if(d.i.L&&!d.g)if(d.c&&!d.u){var a=ja("Click OK to save changes to this PDP11js machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Lc(d,a,!0);!a&&d.N?window&&window.location.reload():d.cb(zc)}else d.reset(),d.b&&d.b.Xa()},!0;case "save":if(da()){c.parentNode.removeChild(c);break}this.A[b]= +c;c.onclick=function(){var a=Ac(d,!0);if(a){var b=!!(d.c&&!d.u||d.N),c=Lc(d,b);b?Mc(d,a,c):d.K("Resume disabled, machine state not saved")}};return!0}return!1}; +function Ac(a,b){var c=a.f;c||(c=ma("user"),void 0!==c?!c&&b&&(c=null,window&&(c=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c&&((c=Nc(a,c))||a.K("The user ID is invalid."))):b&&a.K("Browser local storage is not available"));return c} +function Nc(a,b){a.f=null;var c=p(ea()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(na("user",c.data),a.f=c.data)}catch(f){q(f.message+" ("+d+")")}return a.f}function Cc(a){var b=null;a.f&&(b=ea()+"/api/v1/user?req=load&user="+a.f+"&state="+Oc(a,"1.30.0"));return b} +function Mc(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Oc(a,"1.30.0");d.data=c;b=p(ea()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var f=d.indexOf("\n");0g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':""))}f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(w){g=null,a=w.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=d[2];b("Loading "+f+"...");p(f,null,!0,function(e,h,g){if(g||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+g+")");else{if(e=d[3])if(g=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=g[0],l,t=/( [a-z]+=)(['"])(.*?)\2/g;l=t.exec(e);)k=0>k.indexOf(l[1])?k.replace(">",l[0]+">"):k.replace(new RegExp(l[1]+"(['\"])(.*?)\\1"),l[0]);g[0]!=k&&(h=h.replace(g[0],k))}else{c(a,"missing <"+d[1]+"> in "+f);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],h);Sc(a,b,c)}})}else c(a,null)} +function Tc(a,b,c,d){function f(a){if(void 0===g){var b=h&&C(h,"machine-warning");g=b&&b[0]||h}g&&(g.innerHTML=ga(a))}function e(a){f("Error: "+a);k&&(--Pc||ua(!0));k=!1}var h,g,k=!0;Pc++;Ca[a]={};try{if(h=document.getElementById(a)){var l;if("object"==typeof resources&&(l=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],w=document.createElement("style");w.type="text/css";w.styleSheet?w.styleSheet.cssText=l:w.appendChild(document.createTextNode(l));t.appendChild(w)}c|| +(c="/versions/pdp11/1.30.0/components.xsl");l=function(d,g){g?Qc(c,null,null,!1,f,function(d,k){if(k)if(Da(a,c,d),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=g.transformNode(k);l?(h.outerHTML=l,--Pc||ua(!0)):e("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(k),(l=l.transformToFragment(g,document))?h.parentNode?(h.parentNode.replaceChild(l,h),--Pc||ua(!0)):e("invalid machine element: "+ +a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser");else e(d)}):e(d)};"<"!=b.charAt(0)?Qc(b,a,d,!0,f,l):Rc(b,null,a,d,!1,f,l)}else e("missing machine element: "+a)}catch(O){e(O.message)}return k}window.embedPDP11=function(a,b,c,d){ua(!1);return Tc(a,b,c,d)};window.enableEvents=ua;window.sendEvent=va;})();