From 795d57839bfe15378dfae3cefe4d30af0803a2a2 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 4 Oct 2016 17:22:25 -0700 Subject: [PATCH] Cleaned up the decoding SRCMODE and DSTMODE operands, should be less confusing now --- modules/pdp11/lib/cpuops.js | 190 +++++-------- modules/pdp11/lib/cpustate.js | 241 +++++++++------- modules/pdp11/lib/debugger.js | 15 +- modules/pdp11/lib/defines.js | 3 +- versions/pdp11/1.30.0/pdp11-dbg.js | 432 ++++++++++++++--------------- versions/pdp11/1.30.0/pdp11.js | 263 +++++++++--------- 6 files changed, 573 insertions(+), 571 deletions(-) diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index acd9d0fb0..b859c6d5a 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -461,7 +461,7 @@ PDP11.fnXOR = function(src, dst) */ PDP11.opADC = function(opCode) { - this.updateWordByMode(opCode, this.getCF()? 1 : 0, PDP11.fnADD); + this.updateDstWord(opCode, this.getCF()? 1 : 0, PDP11.fnADD); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -473,7 +473,7 @@ PDP11.opADC = function(opCode) */ PDP11.opADCB = function(opCode) { - this.updateByteByMode(opCode, this.getCF()? 1 : 0, PDP11.fnADDB); + this.updateDstByte(opCode, this.getCF()? 1 : 0, PDP11.fnADDB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -485,7 +485,7 @@ PDP11.opADCB = function(opCode) */ PDP11.opADD = function(opCode) { - this.updateWordByMode(opCode, this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT), PDP11.fnADD); + this.updateDstWord(opCode, this.readSrcWord(opCode), PDP11.fnADD); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -497,11 +497,7 @@ PDP11.opADD = function(opCode) */ PDP11.opASH = function(opCode) { - /* - * NOTE: Because readWordByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var src = this.readWordByMode(opCode); + var src = this.readDstWord(opCode); var reg = (opCode >> 6) & 7; var result = this.regsGen[reg]; if (result & 0x8000) result |= 0xffff0000; @@ -525,7 +521,7 @@ PDP11.opASH = function(opCode) } this.regsGen[reg] = result & 0xffff; this.flagN = this.flagZ = result; - this.nStepCycles -= (this.srcMode? (5 + 1) : (6 + 1)) + src; + this.nStepCycles -= (this.dstMode? (5 + 1) : (6 + 1)) + src; }; /** @@ -536,11 +532,7 @@ PDP11.opASH = function(opCode) */ PDP11.opASHC = function(opCode) { - /* - * NOTE: Because readWordByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var src = this.readWordByMode(opCode); + var src = this.readDstWord(opCode); var reg = (opCode >> 6) & 7; var dst = (this.regsGen[reg] << 16) | this.regsGen[reg | 1]; this.flagC = this.flagV = 0; @@ -571,7 +563,7 @@ PDP11.opASHC = function(opCode) this.regsGen[reg | 1] = result & 0xffff; this.flagN = result >> 16; this.flagZ = result >> 16 | result; - this.nStepCycles -= (this.srcMode? (5 + 1) : (6 + 1)) + src; + this.nStepCycles -= (this.dstMode? (5 + 1) : (6 + 1)) + src; }; /** @@ -582,7 +574,7 @@ PDP11.opASHC = function(opCode) */ PDP11.opASL = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnASL); + this.updateDstWord(opCode, 0, PDP11.fnASL); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -594,7 +586,7 @@ PDP11.opASL = function(opCode) */ PDP11.opASLB = function(opCode) { - this.updateByteByMode(opCode, 0, PDP11.fnASLB); + this.updateDstByte(opCode, 0, PDP11.fnASLB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -606,7 +598,7 @@ PDP11.opASLB = function(opCode) */ PDP11.opASR = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnASR); + this.updateDstWord(opCode, 0, PDP11.fnASR); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -618,7 +610,7 @@ PDP11.opASR = function(opCode) */ PDP11.opASRB = function(opCode) { - this.updateByteByMode(opCode, 0, PDP11.fnASRB); + this.updateDstByte(opCode, 0, PDP11.fnASRB); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.dstAddr & 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -652,7 +644,7 @@ PDP11.opBCS = function(opCode) */ PDP11.opBIC = function(opCode) { - this.updateWordByMode(opCode, this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT), PDP11.fnBIC); + this.updateDstWord(opCode, this.readSrcWord(opCode), PDP11.fnBIC); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -664,7 +656,7 @@ PDP11.opBIC = function(opCode) */ PDP11.opBICB = function(opCode) { - this.updateByteByMode(opCode, this.readByteByMode(opCode >> PDP11.SRCMODE.SHIFT), PDP11.fnBICB); + this.updateDstByte(opCode, this.readSrcByte(opCode), PDP11.fnBICB); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -676,7 +668,7 @@ PDP11.opBICB = function(opCode) */ PDP11.opBIS = function(opCode) { - this.updateWordByMode(opCode, this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT), PDP11.fnBIS); + this.updateDstWord(opCode, this.readSrcWord(opCode), PDP11.fnBIS); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -688,7 +680,7 @@ PDP11.opBIS = function(opCode) */ PDP11.opBISB = function(opCode) { - this.updateByteByMode(opCode, this.readByteByMode(opCode >> PDP11.SRCMODE.SHIFT), PDP11.fnBISB); + this.updateDstByte(opCode, this.readSrcByte(opCode), PDP11.fnBISB); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -700,20 +692,8 @@ PDP11.opBISB = function(opCode) */ PDP11.opBIT = function(opCode) { - /* - * NOTE: Because readWordByMode() will be used to READ (not WRITE) the DSTMODE field of opCode, - * the srcMode and srcReg properties need to be copied before they get overwritten. - */ - var src = this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT); - var srcMode = this.srcMode; - var srcReg = this.srcReg; - /* - * NOTE: Because readWordByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var dst = this.readWordByMode(opCode); - this.updateNZVFlags(src & dst); - this.nStepCycles -= (this.srcMode? (3 + 1) + (srcReg && this.srcReg >= 6? 1 : 0) : (srcMode? (3 + 1) : (2 + 1)) + (this.srcReg == 7? 2 : 0)); + this.updateNZVFlags(this.readSrcWord(opCode) & this.readDstWord(opCode)); + this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; /** @@ -724,20 +704,8 @@ PDP11.opBIT = function(opCode) */ PDP11.opBITB = function(opCode) { - /* - * NOTE: Because readByteByMode() will be used to READ (not WRITE) the DSTMODE field of opCode, - * the srcMode and srcReg properties need to be copied before they get overwritten. - */ - var src = this.readByteByMode(opCode >> PDP11.SRCMODE.SHIFT); - var srcMode = this.srcMode; - var srcReg = this.srcReg; - /* - * NOTE: Because readByteByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var dst = this.readByteByMode(opCode); - this.updateNZVFlags((src & dst) << 8); - this.nStepCycles -= (this.srcMode? (3 + 1) + (srcReg && this.srcReg >= 6? 1 : 0) : (srcMode? (3 + 1) : (2 + 1)) + (this.srcReg == 7? 2 : 0)); + this.updateNZVFlags((this.readSrcByte(opCode) & this.readDstByte(opCode)) << 8); + this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; /** @@ -903,7 +871,7 @@ PDP11.opBVS = function(opCode) */ PDP11.opCLR = function(opCode) { - this.updateAllFlags(this.writeWordByMode(opCode, 0)); + this.updateAllFlags(this.writeDstWord(opCode, 0)); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -915,7 +883,7 @@ PDP11.opCLR = function(opCode) */ PDP11.opCLRB = function(opCode) { - this.updateAllFlags(this.writeByteByMode(opCode, 0)); + this.updateAllFlags(this.writeDstByte(opCode, 0)); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -993,25 +961,14 @@ PDP11.opCLx = function(opCode) */ PDP11.opCMP = function(opCode) { - /* - * NOTE: Because readWordByMode() will be used to READ (not WRITE) the DSTMODE field of opCode, - * the srcMode and srcReg properties need to be copied before they get overwritten. - */ - var src = this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT); - var srcMode = this.srcMode; - var srcReg = this.srcReg; - /* - * NOTE: Because readWordByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var dst = this.readWordByMode(opCode); + var src = this.readSrcWord(opCode); + var dst = this.readDstWord(opCode); var result = src - dst; /* - * NOTE: CMP calculates (src - dst) rather than (dst - src), so when we call updateSubFlags(), - * we must reverse the order of the src and dst parameters. + * NOTE: CMP calculates (src - dst) rather than (dst - src), so src and dst updateSubFlags() parms must be reversed. */ this.updateSubFlags(result, dst, src); - this.nStepCycles -= (this.srcMode? (3 + 1) + (srcReg && this.srcReg >= 6? 1 : 0) : (srcMode? (3 + 1) : (2 + 1)) + (this.srcReg == 7? 2 : 0)); + this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; /** @@ -1022,25 +979,14 @@ PDP11.opCMP = function(opCode) */ PDP11.opCMPB = function(opCode) { - /* - * NOTE: Because readByteByMode() will be used to READ (not WRITE) the DSTMODE field of opCode, - * the srcMode and srcReg properties need to be copied before they get overwritten. - */ - var src = this.readByteByMode(opCode >> PDP11.SRCMODE.SHIFT) << 8; - var srcMode = this.srcMode; - var srcReg = this.srcReg; - /* - * NOTE: Because readByteByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var dst = this.readByteByMode(opCode) << 8; + var src = this.readSrcByte(opCode) << 8; + var dst = this.readDstByte(opCode) << 8; var result = src - dst; /* - * NOTE: CMP calculates (src - dst) rather than (dst - src), so when we call updateSubFlags(), - * we must reverse the order of the src and dst parameters. + * NOTE: CMP calculates (src - dst) rather than (dst - src), so src and dst updateSubFlags() parms must be reversed. */ this.updateSubFlags(result, dst, src); - this.nStepCycles -= (this.srcMode? (3 + 1) + (srcReg && this.srcReg >= 6? 1 : 0) : (srcMode? (3 + 1) : (2 + 1)) + (this.srcReg == 7? 2 : 0)); + this.nStepCycles -= (this.dstMode? (3 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 1) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; /** @@ -1051,7 +997,7 @@ PDP11.opCMPB = function(opCode) */ PDP11.opCOM = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnCOM); + this.updateDstWord(opCode, 0, PDP11.fnCOM); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1063,7 +1009,7 @@ PDP11.opCOM = function(opCode) */ PDP11.opCOMB = function(opCode) { - this.updateByteByMode(opCode, 0, PDP11.fnCOMB); + this.updateDstByte(opCode, 0, PDP11.fnCOMB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1075,7 +1021,7 @@ PDP11.opCOMB = function(opCode) */ PDP11.opDEC = function(opCode) { - this.updateWordByMode(opCode, 1, PDP11.fnDEC); + this.updateDstWord(opCode, 1, PDP11.fnDEC); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1087,7 +1033,7 @@ PDP11.opDEC = function(opCode) */ PDP11.opDECB = function(opCode) { - this.updateByteByMode(opCode, 1, PDP11.fnDECB); + this.updateDstByte(opCode, 1, PDP11.fnDECB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1102,7 +1048,7 @@ PDP11.opDIV = function(opCode) /* * TODO: Review and determine if flag updates can be encapsulated in an updateDivFlags() function. */ - var src = this.readWordByMode(opCode); + var src = this.readDstWord(opCode); if (!src) { this.flagN = 0; // NZVC this.flagZ = 0; @@ -1169,7 +1115,7 @@ PDP11.opHALT = function(opCode) */ PDP11.opINC = function(opCode) { - this.updateWordByMode(opCode, 1, PDP11.fnINC); + this.updateDstWord(opCode, 1, PDP11.fnINC); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1181,7 +1127,7 @@ PDP11.opINC = function(opCode) */ PDP11.opINCB = function(opCode) { - this.updateByteByMode(opCode, 1, PDP11.fnINCB); + this.updateDstByte(opCode, 1, PDP11.fnINCB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1211,12 +1157,11 @@ PDP11.opJMP = function(opCode) { /* * Since JMP and JSR opcodes have their own unique timings for the various dst modes, we must snapshot - * nStepCycles before decoding the mode, and then use that to update nStepCycles. Moreover, we must use - * srcMode rather than dstMode, because JMP does not WRITE the dst operand; it merely READs it. + * nStepCycles before decoding the mode, and then use that to update nStepCycles. */ var nSnapCycles = this.nStepCycles; - this.setPC(this.getVirtualByMode(opCode, PDP11.ACCESS.VIRT)); - this.nStepCycles = nSnapCycles - PDP11.JMP_CYCLES[this.srcMode]; + this.setPC(this.readDstAddr(opCode)); + this.nStepCycles = nSnapCycles - PDP11.JMP_CYCLES[this.dstMode]; }; PDP11.JSR_CYCLES = [ @@ -1233,20 +1178,19 @@ PDP11.opJSR = function(opCode) { /* * Since JMP and JSR opcodes have their own unique timings for the various dst modes, we must snapshot - * nStepCycles before decoding the mode, and then use that to update nStepCycles. Moreover, we must use - * srcMode rather than dstMode, because JSR does not WRITE the dst operand; it merely READs it. + * nStepCycles before decoding the mode, and then use that to update nStepCycles. */ var nSnapCycles = this.nStepCycles; /* * TODO: Determine whether or not the SRCMODE operand (regsGen[reg]) should be snapped BEFORE or AFTER we * decode the DSTMODE operand. Doing it AFTER seems a bit risky. */ - var addr = this.getVirtualByMode(opCode, PDP11.ACCESS.VIRT); + var addr = this.readDstAddr(opCode); var reg = (opCode >> PDP11.SRCMODE.SHIFT) & PDP11.OPREG.MASK; this.pushWord(this.regsGen[reg]); this.regsGen[reg] = this.getPC(); this.setPC(addr); - this.nStepCycles = nSnapCycles - PDP11.JSR_CYCLES[this.srcMode]; + this.nStepCycles = nSnapCycles - PDP11.JSR_CYCLES[this.dstMode]; }; /** @@ -1310,9 +1254,9 @@ PDP11.opMOV = function(opCode) * Since MOV opcodes have their own unique timings for the various dst modes, we must snapshot * nStepCycles after decoding the src mode, and then use that to update nStepCycles. */ - var data = this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT); + var data = this.readSrcWord(opCode); var nSnapCycles = this.nStepCycles; - this.updateNZVFlags(this.writeWordByMode(opCode, data)); + this.updateNZVFlags(this.writeDstWord(opCode, data)); this.nStepCycles = nSnapCycles - PDP11.MOV_CYCLES[(this.srcMode? 8 : 0) + this.dstMode] + (this.dstReg == 7 && !this.dstMode? 2 : 0); }; @@ -1324,8 +1268,8 @@ PDP11.opMOV = function(opCode) */ PDP11.opMOVB = function(opCode) { - var data = this.readByteByMode(opCode >> PDP11.SRCMODE.SHIFT); - this.updateNZVFlags(this.writeByteByMode(opCode, data, PDP11.WRITE.SIGNEXT) << 8); + var data = this.readSrcByte(opCode); + this.updateNZVFlags(this.writeDstByte(opCode, data, PDP11.WRITE.SIGNEXT) << 8); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -1379,7 +1323,7 @@ PDP11.opMTPI = function(opCode) */ PDP11.opMUL = function(opCode) { - var src = this.readWordByMode(opCode); + var src = this.readDstWord(opCode); var reg = (opCode >> 6) & 7; if (src & 0x8000) src |= ~0xffff; var dst = this.regsGen[reg]; @@ -1399,7 +1343,7 @@ PDP11.opMUL = function(opCode) */ PDP11.opNEG = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnNEG); + this.updateDstWord(opCode, 0, PDP11.fnNEG); this.nStepCycles -= (this.dstMode? (10 + 1) : (5 + 1)); }; @@ -1411,7 +1355,7 @@ PDP11.opNEG = function(opCode) */ PDP11.opNEGB = function(opCode) { - this.updateByteByMode(opCode, 0, PDP11.fnNEGB); + this.updateDstByte(opCode, 0, PDP11.fnNEGB); this.nStepCycles -= (this.dstMode? (10 + 1) : (5 + 1)); }; @@ -1450,7 +1394,7 @@ PDP11.opRESET = function(opCode) */ PDP11.opROL = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnROL); + this.updateDstWord(opCode, 0, PDP11.fnROL); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1462,7 +1406,7 @@ PDP11.opROL = function(opCode) */ PDP11.opROLB = function(opCode) { - this.updateByteByMode(opCode, 0, PDP11.fnROLB); + this.updateDstByte(opCode, 0, PDP11.fnROLB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1474,7 +1418,7 @@ PDP11.opROLB = function(opCode) */ PDP11.opROR = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnROR); + this.updateDstWord(opCode, 0, PDP11.fnROR); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1486,7 +1430,7 @@ PDP11.opROR = function(opCode) */ PDP11.opRORB = function(opCode) { - this.updateByteByMode(opCode, 0, PDP11.fnRORB); + this.updateDstByte(opCode, 0, PDP11.fnRORB); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.dstAddr & 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1545,7 +1489,7 @@ PDP11.opRTT = function(opCode) */ PDP11.opSBC = function(opCode) { - this.updateWordByMode(opCode, this.getCF()? 1 : 0, PDP11.fnSUB); + this.updateDstWord(opCode, this.getCF()? 1 : 0, PDP11.fnSUB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1557,7 +1501,7 @@ PDP11.opSBC = function(opCode) */ PDP11.opSBCB = function(opCode) { - this.updateByteByMode(opCode, this.getCF()? 1 : 0, PDP11.fnSUBB); + this.updateDstByte(opCode, this.getCF()? 1 : 0, PDP11.fnSUBB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1670,7 +1614,7 @@ PDP11.opSPL = function(opCode) */ PDP11.opSUB = function(opCode) { - this.updateWordByMode(opCode, this.readWordByMode(opCode >> PDP11.SRCMODE.SHIFT), PDP11.fnSUB); + this.updateDstWord(opCode, this.readSrcWord(opCode), PDP11.fnSUB); this.nStepCycles -= (this.dstMode? (8 + 1) + (this.srcReg && this.dstReg >= 6? 1 : 0) : (this.srcMode? (3 + 2) : (2 + 1)) + (this.dstReg == 7? 2 : 0)); }; @@ -1682,7 +1626,7 @@ PDP11.opSUB = function(opCode) */ PDP11.opSWAB = function(opCode) { - this.updateWordByMode(opCode, 0, PDP11.fnSWAB); + this.updateDstWord(opCode, 0, PDP11.fnSWAB); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1694,7 +1638,7 @@ PDP11.opSWAB = function(opCode) */ PDP11.opSXT = function(opCode) { - this.updateNZVFlags(this.writeWordByMode(opCode, this.getNF? 0xffff : 0)); + this.updateNZVFlags(this.writeDstWord(opCode, this.getNF? 0xffff : 0)); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; @@ -1718,14 +1662,10 @@ PDP11.opTRAP = function(opCode) */ PDP11.opTST = function(opCode) { - /* - * NOTE: Because readWordByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var result = this.readWordByMode(opCode); + var result = this.readDstWord(opCode); this.assert(!(result & ~0xffff)); // assert that C flag will be clear this.updateAllFlags(result); - this.nStepCycles -= (this.srcMode? (3 + 1) : (2 + 1) + (this.srcReg == 7? 2 : 0)); + this.nStepCycles -= (this.dstMode? (3 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; /** @@ -1736,14 +1676,10 @@ PDP11.opTST = function(opCode) */ PDP11.opTSTB = function(opCode) { - /* - * NOTE: Because readByteByMode() is being used to READ (not WRITE) the DSTMODE field of opCode, - * this.srcMode and this.srcReg must be used instead of this.dstMode and this.dstReg. - */ - var result = this.readByteByMode(opCode); + var result = this.readDstByte(opCode); this.assert(!(result & ~0xff)); // assert that C flag will be clear this.updateAllFlags(result << 8); - this.nStepCycles -= (this.srcMode? (3 + 1) : (2 + 1) + (this.srcReg == 7? 2 : 0)); + this.nStepCycles -= (this.dstMode? (3 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; /** @@ -1794,7 +1730,7 @@ PDP11.opWAIT = function(opCode) */ PDP11.opXOR = function(opCode) { - this.updateWordByMode(opCode, this.readWordByMode((opCode & PDP11.SRCMODE.REG) >> PDP11.SRCMODE.SHIFT), PDP11.fnXOR); + this.updateDstWord(opCode, this.readSrcWord(opCode), PDP11.fnXOR); this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0)); }; diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 891e9d72b..b0c25d332 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -172,13 +172,13 @@ CPUStatePDP11.prototype.initRegs = function() this.opFlags = 0; /* - * srcMode and srcReg are set by getVirtualByMode() for reads, and dstMode and dstReg are set for writes/updates. - * indicating to the opcode handlers the mode(s) and register(s) used as part of the current opcode, so that they - * can calculate the correct number of cycles. dstAddr is set for byte operations that also need to know the - * effective address for their cycle calculation. + * srcMode and srcReg are set by SRCMODE decodes, and dstMode and dstReg are set for DSTMODE decodes, + * indicating to the opcode handlers the mode(s) and register(s) used as part of the current opcode, so + * that they can calculate the correct number of cycles. dstAddr is set for byte operations that also + * need to know the effective address for their cycle calculation. */ - this.srcMode = this.dstMode = this.dstAddr = 0; - this.srcReg = this.dstReg = 0; + this.srcMode = this.srcReg = 0; + this.dstMode = this.dstReg = this.dstAddr = 0; this.cpuType = 70; this.trapPSW = -1; @@ -1281,9 +1281,9 @@ CPUStatePDP11.prototype.pushWord = function(data) /** - * getVirtualByMode(addressMode, accessFlags) + * getVirtual(mode, reg, accessFlags) * - * getVirtualByMode() maps a six bit operand to a 17 bit I/D virtual address space. + * getVirtual() maps a six bit operand to a 17 bit I/D virtual address space. * * Instruction operands are six bits in length - three bits for the mode and three * for the register. The 17th I/D bit in the resulting virtual address represents @@ -1305,24 +1305,16 @@ CPUStatePDP11.prototype.pushWord = function(data) * if a page fault occurs. * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} mode + * @param {number} reg * @param {number} accessFlags * @return {number} */ -CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) +CPUStatePDP11.prototype.getVirtual = function(mode, reg, accessFlags) { var virtualAddress, stepSize; var addrDSpace = (accessFlags & PDP11.ACCESS.VIRT)? 0 : this.addrDSpace; - var mode = (addressMode >> 3) & 7; - var reg = addressMode & PDP11.OPREG.MASK; - - if (accessFlags & PDP11.ACCESS.WRITE) { - this.dstMode = mode; this.dstReg = reg; - } else { - this.srcMode = mode; this.srcReg = reg; - } - /* * Modes that need to auto-increment or auto-decrement will break, in order to perform the * update; others will return an address immediately. @@ -1331,7 +1323,7 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) /* * Mode 0: Registers don't have a virtual address, so trap. * - * NOTE: Most instruction code paths never call getVirtualByMode() when the mode is zero; + * NOTE: Most instruction code paths never call getVirtual() when the mode is zero; * JMP and JSR instructions are exceptions, but that's OK, because those are documented to * "cause an 'illegal' instruction" condition", which we interpret to mean a BUS_ERROR trap. */ @@ -1447,31 +1439,31 @@ CPUStatePDP11.prototype.getVirtualByMode = function(addressMode, accessFlags) }; /** - * getAddrPhysical(addressMode, accessFlags) + * getAddrPhysical(mode, reg, accessFlags) * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} mode + * @param {number} reg * @param {number} accessFlags * @return {number} */ -CPUStatePDP11.prototype.getAddrPhysical = function(addressMode, accessFlags) +CPUStatePDP11.prototype.getAddrPhysical = function(mode, reg, accessFlags) { - this.assert(addressMode & PDP11.OPMODE.MASK); - return this.getVirtualByMode(addressMode, accessFlags); + return this.getVirtual(mode, reg, accessFlags); }; /** - * getAddrVirtual(addressMode, accessFlags) + * getAddrVirtual(mode, reg, accessFlags) * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} mode + * @param {number} reg * @param {number} accessFlags * @return {number} */ -CPUStatePDP11.prototype.getAddrVirtual = function(addressMode, accessFlags) +CPUStatePDP11.prototype.getAddrVirtual = function(mode, reg, accessFlags) { - this.assert(addressMode & PDP11.OPMODE.MASK); - return this.mapVirtualToPhysical(this.getVirtualByMode(addressMode, accessFlags), accessFlags); + return this.mapVirtualToPhysical(this.getVirtual(mode, reg, accessFlags), accessFlags); }; /** @@ -1485,16 +1477,16 @@ CPUStatePDP11.prototype.getAddrVirtual = function(addressMode, accessFlags) CPUStatePDP11.prototype.readWordFromPrevSpace = function(opCode, accessFlags) { var src; - if (!(opCode & PDP11.OPMODE.MASK)) { - this.srcMode = 0; - var reg = this.srcReg = opCode & PDP11.OPREG.MASK; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { if (reg != 6 || ((this.regPSW >> 2) & PDP11.PSW.PMODE) === (this.regPSW & PDP11.PSW.PMODE)) { src = this.regsGen[reg]; } else { src = this.regsAltStack[(this.regPSW >> 12) & 3]; } } else { - var addr = this.getVirtualByMode(opCode, PDP11.ACCESS.READ_WORD); + var addr = this.getVirtual(mode, reg, PDP11.ACCESS.READ_WORD); if (!(accessFlags & PDP11.ACCESS.DSPACE)) { if ((this.regPSW & 0xf000) !== 0xf000) addr &= 0xffff; } @@ -1518,16 +1510,16 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat if (!(this.regMMR0 & 0xe000)) { this.regMMR1 = 0x16; } - if (!(opCode & PDP11.OPMODE.MASK)) { - this.dstMode = 0; - var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { if (reg != 6 || ((this.regPSW >> 2) & PDP11.PSW.PMODE) === (this.regPSW & PDP11.PSW.PMODE)) { this.regsGen[reg] = data; } else { this.regsAltStack[(this.regPSW >> 12) & 3] = data; } } else { - var addr = this.getVirtualByMode(opCode, PDP11.ACCESS.WRITE_WORD); + var addr = this.getVirtual(mode, reg, PDP11.ACCESS.WRITE_WORD); if (!(accessFlags & PDP11.ACCESS.DSPACE)) addr &= 0xffff; this.mmuMode = (this.regPSW >> 12) & 3; addr = this.mapVirtualToPhysical(addr | (accessFlags & PDP11.ACCESS.DSPACE), PDP11.ACCESS.WRITE); @@ -1537,124 +1529,161 @@ CPUStatePDP11.prototype.writeWordToPrevSpace = function(opCode, accessFlags, dat }; /** - * readWordByMode(addressMode) + * readSrcByte(opCode) * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} opCode * @return {number} */ -CPUStatePDP11.prototype.readWordByMode = function(addressMode) +CPUStatePDP11.prototype.readSrcByte = function(opCode) { var result; - if (!(addressMode & PDP11.OPMODE.MASK)) { - this.srcMode = 0; - result = this.regsGen[this.srcReg = addressMode & PDP11.OPREG.MASK]; + opCode >>= PDP11.SRCMODE.SHIFT; + var reg = this.srcReg = opCode & PDP11.OPREG.MASK; + var mode = this.srcMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { + result = this.regsGen[reg] & 0xff; } else { - result = this.readWordFromPhysical(this.getAddr(addressMode, PDP11.ACCESS.READ_WORD)); + result = this.readByteFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_BYTE)); } return result; }; /** - * readByteByMode(addressMode) + * readSrcWord(opCode) * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} opCode * @return {number} */ -CPUStatePDP11.prototype.readByteByMode = function(addressMode) +CPUStatePDP11.prototype.readSrcWord = function(opCode) { var result; - if (!(addressMode & PDP11.OPMODE.MASK)) { - this.srcMode = 0; - result = this.regsGen[this.srcReg = addressMode & PDP11.OPREG.MASK] & 0xff; + opCode >>= PDP11.SRCMODE.SHIFT; + var reg = this.srcReg = opCode & PDP11.OPREG.MASK; + var mode = this.srcMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { + result = this.regsGen[reg]; } else { - result = this.readByteFromPhysical(this.getAddr(addressMode, PDP11.ACCESS.READ_BYTE)); + result = this.readWordFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_WORD)); } return result; }; /** - * updateWordByMode(addressMode, src, fnOp) - * - * Used whenever the dst operand (as described by addressMode) DOES need to be read before writing. + * readDstAddr(opCode) * * @this {CPUStatePDP11} - * @param {number} addressMode - * @param {number} src - * @param {function(number,number)} fnOp + * @param {number} opCode + * @return {number} */ -CPUStatePDP11.prototype.updateWordByMode = function(addressMode, src, fnOp) +CPUStatePDP11.prototype.readDstAddr = function(opCode) { - if (!(addressMode & PDP11.OPMODE.MASK)) { - this.dstMode = 0; - var reg = this.dstReg = addressMode & PDP11.OPREG.MASK; - this.regsGen[reg] = fnOp.call(this, src, this.regsGen[reg]); - } else { - var addr = this.getAddr(addressMode, PDP11.ACCESS.UPDATE_WORD); - this.writeWordToPhysical(addr, fnOp.call(this, src, this.readWordFromPhysical(addr))); - } + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + return this.getVirtual(mode, reg, PDP11.ACCESS.VIRT); }; /** - * updateByteByMode(addressMode, src, fnOp) - * - * Used whenever the dst operand (as described by addressMode) DOES need to be read before writing. + * readDstByte(opCode) * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} opCode + * @return {number} + */ +CPUStatePDP11.prototype.readDstByte = function(opCode) +{ + var result; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { + result = this.regsGen[reg] & 0xff; + } else { + result = this.readByteFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_BYTE)); + } + return result; +}; + +/** + * readDstWord(opCode) + * + * @this {CPUStatePDP11} + * @param {number} opCode + * @return {number} + */ +CPUStatePDP11.prototype.readDstWord = function(opCode) +{ + var result; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { + result = this.regsGen[reg]; + } else { + result = this.readWordFromPhysical(this.getAddr(mode, reg, PDP11.ACCESS.READ_WORD)); + } + return result; +}; + +/** + * updateDstByte(opCode, src, fnOp) + * + * Used whenever the dst operand (as described by opCode) needs to be read before writing. + * + * @this {CPUStatePDP11} + * @param {number} opCode * @param {number} src * @param {function(number,number)} fnOp */ -CPUStatePDP11.prototype.updateByteByMode = function(addressMode, src, fnOp) +CPUStatePDP11.prototype.updateDstByte = function(opCode, src, fnOp) { - if (!(addressMode & PDP11.OPMODE.MASK)) { - this.dstMode = 0; - var reg = this.dstReg = addressMode & PDP11.OPREG.MASK; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { this.regsGen[reg] = (this.regsGen[reg] & 0xff00) | fnOp.call(this, src, this.regsGen[reg]); } else { - var addr = this.dstAddr = this.getAddr(addressMode, PDP11.ACCESS.UPDATE_BYTE); + var addr = this.dstAddr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_BYTE); this.writeByteToPhysical(addr, fnOp.call(this, src, this.readByteFromPhysical(addr))); } }; /** - * writeWordByMode(addressMode, data) + * updateDstWord(opCode, src, fnOp) * - * Used whenever the dst operand (as described by addressMode) does NOT need to be read before writing. + * Used whenever the dst operand (as described by opCode) needs to be read before writing. * * @this {CPUStatePDP11} - * @param {number} addressMode - * @param {number} data - * @return {number} + * @param {number} opCode + * @param {number} src + * @param {function(number,number)} fnOp */ -CPUStatePDP11.prototype.writeWordByMode = function(addressMode, data) +CPUStatePDP11.prototype.updateDstWord = function(opCode, src, fnOp) { - if (!(addressMode & PDP11.OPMODE.MASK)) { - this.dstMode = 0; - this.regsGen[this.dstReg = addressMode & PDP11.OPREG.MASK] = data & 0xffff; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { + this.regsGen[reg] = fnOp.call(this, src, this.regsGen[reg]); } else { - this.writeWordToPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE_WORD), data); + var addr = this.getAddr(mode, reg, PDP11.ACCESS.UPDATE_WORD); + this.writeWordToPhysical(addr, fnOp.call(this, src, this.readWordFromPhysical(addr))); } - return data; }; /** - * writeByteByMode(addressMode, data, writeFlags) + * writeDstByte(opCode, data, writeFlags) * - * Used whenever the dst operand (as described by addressMode) does NOT need to be read before writing. + * Used whenever the dst operand (as described by opCode) does NOT need to be read before writing. * * @this {CPUStatePDP11} - * @param {number} addressMode + * @param {number} opCode * @param {number} data * @param {number} [writeFlags] * @return {number} */ -CPUStatePDP11.prototype.writeByteByMode = function(addressMode, data, writeFlags) +CPUStatePDP11.prototype.writeDstByte = function(opCode, data, writeFlags) { - if (!(addressMode & PDP11.OPMODE.MASK)) { - this.dstMode = 0; - var reg = this.dstReg = addressMode & PDP11.OPREG.MASK; + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { if (!data) { this.regsGen[reg] &= ~0xff; // TODO: Profile to determine if this is a win } else if (writeFlags & PDP11.WRITE.SIGNEXT) { @@ -1663,7 +1692,29 @@ CPUStatePDP11.prototype.writeByteByMode = function(addressMode, data, writeFlags this.regsGen[reg] = (this.regsGen[reg] & ~0xff) | (data & 0xff); } } else { - this.writeByteToPhysical(this.getAddr(addressMode, PDP11.ACCESS.WRITE_BYTE), data); + this.writeByteToPhysical(this.getAddr(mode, reg, PDP11.ACCESS.WRITE_BYTE), data); + } + return data; +}; + +/** + * writeDstWord(opCode, data) + * + * Used whenever the dst operand (as described by opCode) does NOT need to be read before writing. + * + * @this {CPUStatePDP11} + * @param {number} opCode + * @param {number} data + * @return {number} + */ +CPUStatePDP11.prototype.writeDstWord = function(opCode, data) +{ + var reg = this.dstReg = opCode & PDP11.OPREG.MASK; + var mode = this.dstMode = (opCode & PDP11.OPMODE.MASK) >> PDP11.OPMODE.SHIFT; + if (!mode) { + this.regsGen[reg] = data & 0xffff; + } else { + this.writeWordToPhysical(this.getAddr(mode, reg, PDP11.ACCESS.WRITE_WORD), data); } return data; }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index efedaf210..32b95bfea 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -589,6 +589,9 @@ if (DEBUGGER) { var addr = this.getAddr(dbgAddr, false, 1); if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; + /* + * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + */ b = this.bus.getByteDirect(addr); this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); @@ -610,6 +613,9 @@ if (DEBUGGER) { var addr = this.getAddr(dbgAddr, false, 2); if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; + /* + * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + */ w = this.bus.getWordDirect(addr); this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); @@ -630,6 +636,9 @@ if (DEBUGGER) { var addr = this.getAddr(dbgAddr, true, 1); if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; + /* + * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + */ this.bus.setByteDirect(addr, b); this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); @@ -650,6 +659,9 @@ if (DEBUGGER) { var addr = this.getAddr(dbgAddr, true, 2); if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; + /* + * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + */ this.bus.setWordDirect(addr, w); this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); @@ -3425,7 +3437,7 @@ if (DEBUGGER) { } } } - addr--; + addr -= 2; } dbgAddr.addr = addrOrig; return sCall; @@ -3463,6 +3475,7 @@ if (DEBUGGER) { * wrap the offset around the end of the segment, we must also check the addr property to detect the wrap. */ if (dbgAddrStack.addr == null || !cTests--) break; + if (dbgAddrCall.addr & 0x1) continue; // an odd address on the PDP-11 is not a valid instruction boundary sCall = this.getCall(dbgAddrCall); if (sCall) break; } diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 48fa8ab44..70e1768e2 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -189,7 +189,8 @@ var PDP11 = { PREDECD: 0x28, // AUTO-DECREMENT DEFERRED (register decremented, register is address of address of operand) INDEX: 0x30, // INDEX (register + next word is address of operand) INDEXD: 0x38, // INDEX DEFERRED (register + next word is address of address of operand) - MASK: 0x38 + MASK: 0x38, + SHIFT: 3 }, DSTMODE: { REG: 0x0007, diff --git a/versions/pdp11/1.30.0/pdp11-dbg.js b/versions/pdp11/1.30.0/pdp11-dbg.js index 809200220..d4a68d3a7 100644 --- a/versions/pdp11/1.30.0/pdp11-dbg.js +++ b/versions/pdp11/1.30.0/pdp11-dbg.js @@ -1,229 +1,229 @@ (function(){var k; -function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),f=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=f?48:55),d=String.fromCharCode(f)+d;a>>=4}return(c?"0x":"")+d} -function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ia(a){return a.replace(/[&<>"']/g,function(a){return ha[a]})}function na(a,b){return(a+" ").slice(0,b)} +function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} +function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return ha[a]})}function na(a,b){return(a+" ").slice(0,b)} function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; -function qa(a,b,c){var d=0,f=a.length,e=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);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 ta(a,b,c,d){var f=0,e=null,g=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)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(e=h.responseText,200==h.status||!h.status&&e.length&&"file:"==(window?window.location.protocol:"file:")||(f=h.status||-1),d&&d(a,e,f))});if(b&&"object"== -typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(e=h.responseText,200!=h.status&&(f=h.status||-1),d&&d(a,e,f),g=[e,f]);return g}function ga(){return"http://"+(window?window.location.host:"www.pcjs.org")} +function qa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);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,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ga(){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 xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.pb=this.id:(this.fc=this.id.substr(0,b),this.pb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Ib:!1,gc:!1,ia:!1,error:!1};this.Yb=null;this.v.error=!1;this.K={};this.i=null;this.ka=d||0;x.push(this)}var Va=void 0,Wa={}; +function Fa(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ga={init:[],show:[],exit:[]},Ha=!1,Ia=!1,Ja=!0;function Ka(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function La(a){Ga.init.push(a)} +function Ma(a){if(Ja)try{for(var b=0;bb?this.qb=this.id:(this.fc=this.id.substr(0,b),this.qb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Ib:!1,gc:!1,ia:!1,error:!1};this.Yb=null;this.v.error=!1;this.K={};this.j=null;this.ka=d||0;x.push(this)}var Va=void 0,Wa={}; if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function $a(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function y(a,b){b||(b=w);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},x=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.Z&&(this.Z=10);15>2;this.f=this.Da-1;this.w=this.A/this.Da|0;this.C=this.w-1;this.Ra=[];this.F=null;this.Kb=this.Jc;a=new I;Bb(a,this.i);this.N=Array(this.w);for(b=0;b>8:f[2](b)&255):b&1&&(f=d.Ra[a&-2])&&f[2]&&(c=f[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,64)&&E(this.i,f[5]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=d.Kb(b|4186112,-1,1);this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c));return c} -function Db(a,b,c){var d=!1,f=this.controller,e=f.Ra[a];if(e)if(e[1])e[1](b,c),d=!0;else{if(e[3]){a=e[2]?e[2](c):0;if(c&1)e[3](a&255|b<<8,c&-2);else e[3](a&-256|b,c);d=!0}}else c&1&&(e=f.Ra[a&-2])&&e[3]&&(c&=-2,a=e[2]?e[2](c):0,e[3](a&255|b<<8,c),d=!0);d?this.i&&F(this.i,64)&&E(this.i,e[5]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(f.Kb(c|4186112,b,1),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b)))} -function Eb(a,b){var c=-1,d=this.controller;(a=d.Ra[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&F(this.i,64)&&E(this.i,a[5]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=d.Kb(b|4186112,-1,0);this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c));return c} -function Fb(a,b,c){var d=!1,f=this.controller;if(a=f.Ra[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&F(this.i,64)&&E(this.i,a[5]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(f.Kb(c|4186112,b,0),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b)))}k=Ab.prototype;k.reset=function(){this.F&&this.F()}; -k.Jc=function(a,b,c){this.i&&F(this.i,64)&&E(this.i,"warning: unrecognized access("+J(this.i,a)+","+J(this.i,b)+","+c+")");return 0};k.Ka=function(a,b){b||this.reset();return!0}; -function Gb(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.Z;0g&&(n=g);if(l&&l.size){if(l.type==d&&l.controller==f){if(e+g<=l.B)return l.Vb+=l.B-e,l.B=e,!0;if(e>=l.B+l.Vb){n=l.size-(e-m);n>g&&(n=g);l.Vb=e-l.B+n;e=m+a.Da;g-=n;h++;continue}}return Ib(1,e,g)}e=new I(e,n,a.Da,d,f);Bb(e,a.i,l);a.N[h++]=e;e=m+a.Da;g-=n}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Jb[d]+" at "+p(b,8,!0)),!0):Ib(2,b,c)} -k.rb=function(a){return this.N[(a&this.j)>>>this.Z].vb(a&this.f,a)};k.Ia=function(a){var b=a&this.f,c=(a&this.j)>>>this.Z;return b!=this.f?this.N[c].Cc(b,a):this.N[c++].vb(b,a)|this.N[c&this.C].vb(0,a+1)<<8};function Kb(a,b){var c=b&a.f,d=(b&a.j)>>>a.Z;return c!=a.f?a.N[d].lc(c,b):a.N[d++].Ob(c,b)|a.N[d&a.C].Ob(0,b+1)<<8}k.Sb=function(a,b){this.N[(a&this.j)>>>this.Z].Bb(a&this.f,b&255,a)}; -k.nb=function(a,b){var c=a&this.f,d=(a&this.j)>>>this.Z;c!=this.f?this.N[d].Ic(c,b&65535,a):(this.N[d++].Bb(c,b&255,a),this.N[d&this.C].Bb(0,b>>8&255,a+1))};function Lb(a){for(var b=0,c=[],d=0;d>1)+2;10>this.$&&(this.$=10);15>2;this.f=this.Da-1;this.w=this.B/this.Da|0;this.C=this.w-1;this.Ra=[];this.F=null;this.Kb=this.Jc;a=new I;Bb(a,this.j);this.N=Array(this.w);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ra[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&F(this.j,64)&&E(this.j,e[5]+".readByte("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=d.Kb(b|4186112,-1,1);this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to byte @"+J(this.j,b)+": "+J(this.j,c));return c} +function Db(a,b,c){var d=!1,e=this.controller,f=e.Ra[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ra[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&F(this.j,64)&&E(this.j,f[5]+".writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(e.Kb(c|4186112,b,1),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to byte @"+J(this.j,c)+": "+J(this.j,b)))} +function Eb(a,b){var c=-1,d=this.controller;(a=d.Ra[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&F(this.j,64)&&E(this.j,a[5]+".readWord("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=d.Kb(b|4186112,-1,0);this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to word @"+J(this.j,b)+": "+J(this.j,c));return c} +function Fb(a,b,c){var d=!1,e=this.controller;if(a=e.Ra[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.j&&F(this.j,64)&&E(this.j,a[5]+".writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(e.Kb(c|4186112,b,0),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to word @"+J(this.j,c)+": "+J(this.j,b)))}k=Ab.prototype;k.reset=function(){this.F&&this.F()}; +k.Jc=function(a,b,c){this.j&&F(this.j,64)&&E(this.j,"warning: unrecognized access("+J(this.j,a)+","+J(this.j,b)+","+c+")");return 0};k.Ka=function(a,b){b||this.reset();return!0}; +function Gb(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.$;0g&&(n=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.A)return l.Vb+=l.A-f,l.A=f,!0;if(f>=l.A+l.Vb){n=l.size-(f-m);n>g&&(n=g);l.Vb=f-l.A+n;f=m+a.Da;g-=n;h++;continue}}return Ib(1,f,g)}f=new I(f,n,a.Da,d,e);Bb(f,a.j,l);a.N[h++]=f;f=m+a.Da;g-=n}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Jb[d]+" at "+p(b,8,!0)),!0):Ib(2,b,c)} +k.kb=function(a){return this.N[(a&this.g)>>>this.$].vb(a&this.f,a)};k.Ia=function(a){var b=a&this.f,c=(a&this.g)>>>this.$;return b!=this.f?this.N[c].Cc(b,a):this.N[c++].vb(b,a)|this.N[c&this.C].vb(0,a+1)<<8};function Kb(a,b){var c=b&a.f,d=(b&a.g)>>>a.$;return c!=a.f?a.N[d].lc(c,b):a.N[d++].Ob(c,b)|a.N[d&a.C].Ob(0,b+1)<<8}k.Sb=function(a,b){this.N[(a&this.g)>>>this.$].Bb(a&this.f,b&255,a)}; +k.ob=function(a,b){var c=a&this.f,d=(a&this.g)>>>this.$;c!=this.f?this.N[d].Ic(c,b&65535,a):(this.N[d++].Bb(c,b&255,a),this.N[d&this.C].Bb(0,b>>8&255,a+1))};function Lb(a){for(var b=0,c=[],d=0;d>5&3;c.ya=a>>1&15;c.Zb=a&257?a&1?6:4:0;Tb(c);a=c.I;a&1|256&&(b=this.b.lb&16?1:2);this.j.sb=this.j.sb&-8|b};k.$c=function(){return Ub(this.b)};k.td=function(a){Vb(this.b,a&-1809|Ub(this.b)&1808);this.b.D|=128}; -function Wb(a){var b=a.C,c,d,f,e=b.va>>13&7;"undefined"===typeof b.ra[e]&&(b.ra[e]={cache:[],postProcess:a.ed,drive:e,blocksize:256,mapped:0,maxblock:b.eb[e]*b.$[e],url:"rk"+e+".dsk"});b.R&=-129;switch(b.R>>1&7){case 0:b.Qb=2496;b.oa=0;b.R=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.eb[e]){b.oa|=32832;b.R|=49152;break}if((b.va&15)>=b.$[e]){b.oa|=32800;b.R|=49152;break}c=(b.va>>4&511)*b.$[e]+(b.va&15);d=(b.R&48)<<12|b.Pb;f=65536-b.Rb&65535;ec(a,b.ra[e],c,d,f);return;case 2:if((b.va>>4&511)>=b.eb[e])b.oa|= -32832,b.R|=49152;else if((b.va&15)>=b.$[e])b.oa|=32800,b.R|=49152;else{c=(b.va>>4&511)*b.$[e]+(b.va&15);d=(b.R&48)<<12|b.Pb;f=65536-b.Rb&65535;a.bc(b.ra[e],c,d,f);return}}b.Qb=e<<13|b.Qb&8176|b.va%9&15;K(a.b,20,5,144,function(){b.R=b.R&65534|128;return!!(b.R&64)})}k.ed=function(a,b,c,d,f){var e=this.C;e.Pb=d&65535;e.R=e.R&-49|d>>12&48;e.Rb=65536-f&65535;switch(a){case 1:e.oa|=33024;e.R|=49152;break;case 2:e.oa|=33792,e.R|=49152}K(this.b,20,5,144,function(){e.R=e.R&65534|128;return!!(e.R&64)})}; -function fc(a){var b=a.w,c,d,f,e=b.M>>8&3;b.M&=-2;"undefined"===typeof b.ra[e]&&(b.ra[e]={cache:[],postProcess:a.fd,drive:e,blocksize:128,mapped:1,maxblock:b.eb[e]*b.$[e],url:"rl"+e+".dsk"});switch(b.M>>1&7){case 2:b.Xa&8&&(b.M&=63);b.Xa=b.Lc[e]|b.bb&64;break;case 3:1==(b.fa&3)&&(b.bb=b.fa&4?b.bb+(b.fa&65408)&65408|b.fa<<2&64:b.bb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.bb);break;case 4:b.Xa=b.bb;break;case 5:if(b.fa>>6>=b.eb[e]){b.M|=37888;break}if((b.fa&63)>=b.$[e]){b.M|=37888;break}c=(b.fa>>6)*b.$[e]+ -(b.fa&63);d=(b.Sa&63)<<16|b.Hb;f=65536-b.Xa&65535;ec(a,b.ra[e],c,d,f);return;case 6:if(b.fa>>6>=b.eb[e])b.M|=37888;else if((b.fa&63)>=b.$[e])b.M|=37888;else{c=(b.fa>>6)*b.$[e]+(b.fa&63);d=(b.Sa&63)<<16|b.Hb;f=65536-b.Xa&65535;a.bc(b.ra[e],c,d,f);return}}K(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})} -k.fd=function(a,b,c,d,f){var e=this.w;e.Hb=d&65535;e.M=e.M&-49|d>>12&48;e.Sa=d>>16&63;e.fa=~~(c/e.$[b.Ma])<<6|c%e.$[b.Ma];e.bb=e.fa;e.Xa=65536-f&65535;switch(a){case 1:e.M|=33792;break;case 2:e.M|=40960}K(this.b,20,5,112,function(){e.M|=129;return!!(e.M&64)})};function gc(a){a=a.A;a.T=2176;a.Ea=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.xb=[0,0,0,0,0,0,0,0];a.mb=a.yb=a.wb=a.ab=a.oc=0} -function hc(a,b){var c=a.A,d,f,e;c.T&=-16513;c.Ea&=-2049;c.ta[b]&=-1153;K(a.b,-1,0,172);"undefined"===typeof c.ra[b]&&(c.ra[b]={cache:[],postProcess:a.gd,drive:b,blocksize:256,mapped:0,maxblock:c.ec[0]*c.cb[0]*c.$[0],url:"rp"+b+".dsk"});switch(c.T&63){case 5:c.dc[b]=c.Qa[b];c.T|=32896;c.ta[b]|=32896;c.mb|=1<=c.ec[0]||c.Fa[b]>>8>=c.cb[0]||(c.Fa[b]&255)>=c.$[0]){c.xb[b]|=1024;c.T|=49152;break}d=(c.Qa[b]*c.cb[0]+(c.Fa[b]>>8))*c.$[0]+ -(c.Fa[b]&255);f=(c.ab&63)<<16|c.wb;e=65536-c.yb&65535;ec(a,c.ra[b],d,f,e);return;case 57:if(c.Qa[b]>=c.ec[0]||c.Fa[b]>>8>=c.cb[0]||(c.Fa[b]&255)>=c.$[0])c.xb[b]|=1024,c.T|=49152;else{d=(c.Qa[b]*c.cb[0]+(c.Fa[b]>>8))*c.$[0]+(c.Fa[b]&255);f=(c.ab&63)<<16|c.wb;e=65536-c.yb&65535;a.bc(c.ra[b],d,f,e);return}}K(a.b,3,5,172,function(){c.T=c.T&65534|128;c.ta[b]|=128;return!!(c.T&64)})} -k.gd=function(a,b,c,d,f){var e=this.A;e.yb=65536-f&65535;e.wb=d&65535;e.T=e.T&-769|d>>8&768;e.ab=d>>16&63;f=~~(c/e.$[0]);d=~~(f/e.cb[0]);e.Fa[b.Ma]=f%e.cb[0]<<8|c%e.$[0];e.dc[b.Ma]=e.Qa[b.Ma]=d;e.mb|=1<=b.Vc-1&&(e.ta[b.Ma]|=1024);switch(a){case 1:e.Ea|=512;e.T|=49152;break;case 2:e.Ea|=2048,e.T|=49152}K(this.b,20,5,172,function(){e.ta[b.Ma]|=128;e.T=e.T&65534|128;return!!(e.T&64)})}; -function ic(a,b,c,d,f,e){var g=~~((e+c.Ta-1)/c.Ta),h=new XMLHttpRequest;2048>g&&d+2048g){b.kc(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.kc(0,b,c,d,f)}k.reset=function(){this.j.sb=this.j.sb&-120|20;this.f.Wa=0;this.C.R=128;this.w.M=128;gc(this)}; -k.Kc=function(a,b,c){var d,f,e=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.$a&65280:(a&1&&(b<<=8),e.$a=b|255,d=0);break;case 4194298:if(0>b)d=e.nc;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.nc=d;e.D|=2}break;case 4194294:if(70!==e.jb)return e.L(4,222);0>b?d=e.J:d=e.J=0;break;case 4194292:if(70!==e.jb)return e.L(4,224);d=1;break;case 4194290:if(70!==e.jb)return e.L(4,226);d=0;break;case 4194288:if(70!==e.jb)return e.L(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.jb)return e.L(4,232);f=a-4194272>>1;0>b?d=e.ic[f]:(d=L(this,e.ic[f],a,b,c),0<=d&&(e.ic[f]=d));break;case 4194254:return a&1?e.P>>14&1?(0<=b&&(e.u[6]=b),d=e.u[6]):(0<=b&&(e.za[3]=b),d=e.za[3]):e.P>>14&0?(0<=b&&(e.u[6]=b),d=e.u[6]):(0<=b&&(e.za[1]=b),d=e.za[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.P&2048?(0<=b&&(e.u[f]=b),d=e.u[f]):(0<=b&&(e.Pa[f]= -b),d=e.Pa[f]),d;case 4194246:return a&1?(0<=b&&(e.u[7]=b),d=e.u[7]):e.P>>14&0?(0<=b&&(e.u[6]=b),d=e.u[6]):(0<=b&&(e.za[0]=b),d=e.za[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.P&2048?(0<=b&&(e.Pa[f]=b),d=e.Pa[f]):(0<=b&&(e.u[f]=b),d=e.u[f]),d;default:return e.J|=16,e.L(4,124)}break;case 4194176:f=a>>1&31;d=L(this,e.na[3][f],a,b,c);0<=d&&(e.na[3][f]=d,e.na[3][f&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=L(this,e.cc,a,b,c);0<=d&&(e.cc=d);break;case 4194172:d=e.Za;d&65280&& -(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.j.pd&65535:(d=L(this,this.j.data,a,b,c),0<=d&&(this.j.data=d));break;default:return e.J|=16,e.L(4,126)}break;case 4194048:f=this.C;switch(a&-2){case 4194048:d=L(this,f.Qb,a,b,c);0<=d&&(f.Qb=d);break;case 4194050:d=L(this,f.oa,a,b,c);0<=d&&(f.oa=d);break;case 4194052:d=L(this,f.R,a,b,c);0<=b&&0<=d&&(f.R=d&-36993|f.R&36992,f.R&1&&Wb(this));break;case 4194054:d=L(this,f.Rb,a,b,c);0<=d&&(f.Rb=d);break;case 4194056:d=L(this,f.Pb,a,b,c);0<=d&&(f.Pb=d); -break;case 4194058:d=L(this,f.va,a,b,c);0<=d&&(f.va=d);break;case 4194060:break;case 4194062:d=L(this,f.Dc,a,b,c);0<=d&&(f.Dc=d);break;default:return e.J|=16,e.L(4,128)}break;case 4193728:var g=this.A;f=g.Ea&7;switch(a&-2){case 4193728:d=L(this,g.T,a,b,c);0<=b&&0<=d&&(g.ab=g.ab&60|d>>8&3,g.T=d&17279|g.T&34944|2048,d&1&&g.T&128?hc(this,f):192==(d&192)&&K(e,0,5,172));break;case 4193730:d=L(this,g.yb,a,b,c);0<=d&&(g.yb=d);break;case 4193732:d=L(this,g.wb,a,b,c);0<=d&&(g.wb=d&65534);break;case 4193734:d= -L(this,g.Fa[f],a,b,c);0<=d&&(g.Fa[f]=d&7967);break;case 4193736:d=L(this,g.Ea,a,b,c);0<=d&&(g.Ea=d&63|g.Ea&65472,d&128&&gc(this));break;case 4193738:d=g.ta[f];break;case 4193740:d=g.xb[f];break;case 4193742:d=L(this,g.mb,a,b,c);0<=d&&(g.mb=d&255);break;case 4193744:d=g.md[f];break;case 4193746:d=L(this,g.Ec,a,b,c);0<=d&&(g.Ec=d);break;case 4193748:d=L(this,g.Fc[f],a,b,c);0<=d&&(g.Fc[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.nd[f];break;case 4193754:d=L(this,g.Gc[f],a,b,c);0<=d&& -(g.Gc[f]=d);break;case 4193756:d=L(this,g.Qa[f],a,b,c);0<=d&&(g.Qa[f]=d&511);break;case 4193758:g.dc[f]=g.Qa[f];d=g.dc[f];break;case 4193760:d=g.kd[f];break;case 4193762:d=g.ld[f];break;case 4193764:d=g.hd[f];break;case 4193766:d=g.jd[f];break;case 4193768:d=L(this,g.ab,a,b,c);0<=d&&(g.ab=d&63,g.T=g.T&-769|(d&3)<<8);break;case 4193770:d=L(this,g.oc,a,b,c);0<=d&&(g.oc=d);break;default:return e.J|=16,e.L(4,132)}break;case 4192512:f=this.w;switch(a&-2){case 4192512:d=L(this,f.M,a,b,c);0<=b&&0<=d&&(f.Sa= -f.Sa&60|d>>4&3,f.M=f.M&-1023|d&1022,f.M&128||fc(this));break;case 4192514:d=L(this,f.Hb,a,b,c);0<=d&&(f.Hb=d&65534);break;case 4192516:d=L(this,f.fa,a,b,c);0<=d&&(f.fa=d);break;case 4192518:d=L(this,f.Xa,a,b,c);0<=d&&(f.Xa=d);break;case 4192520:d=L(this,f.Sa,a,b,c);0<=d&&(f.Sa=d&63,f.M=f.M&-49|(f.Sa&3)<<4);break;default:return e.J|=16,e.L(4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.lb:(d=L(this,e.lb,a,b,c),0<=d&&(70!==e.jb&&(d&=-49),e.lb=d,e.$b[0]=d&4?15:7,e.$b[1]=d&2?15:7,e.$b[3]= -d&1?15:7,e.Zb&&(f=2,e.lb&16&&(f=1),this.j.sb=this.j.sb&-8|f)));break;default:return e.J|=16,e.L(4,136)}break;case 4191424:f=a>>1&31;d=L(this,e.na[0][f],a,b,c);0<=d&&(e.na[0][f]=d,e.na[0][f&15]&=65295);break;case 4191360:f=a>>1&31;d=L(this,e.na[1][f],a,b,c);0<=d&&(e.na[1][f]=d,e.na[1][f&15]&=65295);break;case 4190400:case 4190336:if(70!==e.jb)return e.L(4,234);f=a>>2&31;d=e.Tb[f];a&2&&(d>>=16);d&=65535;0<=b&&(d=L(this,d,a,b,c),0<=d&&(e.Tb[f]=a&2?d<<16|e.Tb[f]&65535:e.Tb[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=Pb[a>>1&255];else return e.J|=16,e.L(4,138);break;default:return e.J|=16,e.L(4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var lc={},Sb=(lc[65382]=[null,null,Ob.prototype.Yc,Ob.prototype.rd,"LKS"],lc[65402]=[null,null,Ob.prototype.Zc,Ob.prototype.sd,"MMR0"],lc[65534]=[null,null,Ob.prototype.$c,Ob.prototype.td,"PSW"],lc); -La(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.A,0,c>>2),sc(this,oc?tc:uc);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma: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},ya:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]& -~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Va=!0},ba:function(a,b){if(this.i&&null!=this.B){var c=this.i;zc(c,this.B+a,1,c.X)&&c.ja(!0)}return this.Ob(a,b)},ha:function(a,b){if(this.i&&null!=this.B){var c=this.i;zc(c,this.B+a,2,c.X)&&c.ja(!0)}return this.lc(a,b)},ua:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;zc(d,this.B+a,1,d.F)&&d.ja(!0)}this.j?this.w(a, -b,c):this.Cb(a,b,c)},Ba:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;zc(d,this.B+a,2,d.F)&&d.ja(!0)}this.j?this.w(a,b,c):this.rc(a,b,c)},X:function(a){return this.f[a]},ca:function(a,b){a=this.f[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ea:function(a){return this.F.getUint16(a,!0)},la:function(a,b){a=a&1?this.f[a]|this.f[a+1]<<8:this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a}, -qa:function(a,b){this.f[a]=b;this.Va=!0},xa:function(a,b,c){this.f[a]=b;this.Va=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},Aa:function(a,b){this.F.setUint16(a,b,!0);this.Va=!0},Ca:function(a,b,c){a&1?(this.f[a]=b,this.f[a+1]=b>>8):this.I[a>>1]=b;this.Va=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}};function Bb(a,b,c){a.i=b;a.K=a.C=0;c&&((a.K=c.K)&&yc(a,xc,!1),(a.C=c.C)&&wc(a,xc,!1))} -function Ac(a,b){b?--a.C||(a.Bb=a.j?a.w:a.Cb,a.Ic=a.j?a.G:a.rc):--a.K||(a.vb=a.Ob,a.Cc=a.lc)}function wc(a,b,c){c&&a.C||(a.Bb=!a.j&&b[1]||a.w,a.Ic=!a.j&&b[3]||a.G);if(c||void 0===c)a.Cb=b[1]||a.w,a.rc=b[3]||a.G}function yc(a,b,c){c&&a.K||(a.vb=b[0]||a.O,a.Cc=b[2]||a.S);if(c||void 0===c)a.Ob=b[0]||a.O,a.lc=b[2]||a.S}function sc(a,b){b||(b=Bc);yc(a,b,void 0);wc(a,b,void 0)}var Bc=[],vc=[I.prototype.da,I.prototype.ya,I.prototype.ma,I.prototype.pb],xc=[I.prototype.ba,I.prototype.ua,I.prototype.ha,I.prototype.Ba]; -if(xb)var uc=[I.prototype.X,I.prototype.qa,I.prototype.ea,I.prototype.Aa],tc=[I.prototype.ca,I.prototype.xa,I.prototype.la,I.prototype.Ca];function Cc(a,b){w.call(this,"CPU",a,Cc,1);var c=a.multiplier||1;this.Ba=a.cycles||b;this.Ya=c;this.gb=Math.round(this.Ba/1E4)/100;this.kb=this.gb*this.Ya;this.v.ga=!1;this.v.pc=!1;this.v.Fb=a.autoStart;this.v.wc=!1;this.v.qb=!1;this.Lb=this.ha=0;this.Mb=a.csStart;this.tb=a.csInterval;this.ub=a.csStop;this.O=[];this.Xb=this.od.bind(this);G(this)}y(Cc); -var Dc=["power","reset"];k=Cc.prototype;k.Oa=function(a,b,c,d){this.C=a;this.H=b;this.i=d;for(b=0;b=a.ha&&(a.ha+=a.tb,c=!0);0<=a.ub&&a.ub<=Jc(a)&&(a.tb=a.ub=-1,Gc(a),a.ja(),c=!0);c&&a.g(Jc(a)+" cycles: checksum="+p(a.Lb))}} -function bd(a,b,c,d){if(a.K[b]){void 0===c&&(wb(a,"Value for "+b+" is invalid"),a.ja());var f=a.i&&a.i.ea||8;c=!a.v.ga||a.v.wc?8==f?ba(c,d):p(c,d):"--------".substr(0,d||4);a.K[b].textContent!=c&&(a.K[b].textContent=c)}} +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];k=K.prototype;k.Oa=function(a,b,c,d){this.G=b;this.b=c;this.j=d;var e=this;this.f.qc=Pb(this.b,function(){e.f.Wa|=128;e.f.Wa&64&&(L(e.b,0,6,64),Qb(e.b,e.f.qc))});Mb(b,this,Rb);Nb(b,this.reset.bind(this),this.Kc.bind(this));G(this)};k.Yc=function(){var a=this.f.Wa;this.f.Wa&=-129;return a}; +k.rd=function(a){this.f.Wa=a;a&64&&Qb(this.b,this.f.qc);this.f.Wa=a&-129};k.Zc=function(){var a=this.b;return a.F&62337|a.xa<<5|a.ya<<1};k.sd=function(a){var b=4,c=this.b;c.F=a&=62337;c.xa=a>>5&3;c.ya=a>>1&15;c.Zb=a&257?a&1?6:4:0;Sb(c);a=c.F;a&1|256&&(b=this.b.mb&16?1:2);this.g.sb=this.g.sb&-8|b};k.$c=function(){return Tb(this.b)};k.td=function(a){Ub(this.b,a&-1809|Tb(this.b)&1808);this.b.D|=128}; +function Vb(a){var b=a.C,c,d,e,f=b.va>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.ed,drive:f,blocksize:256,mapped:0,maxblock:b.eb[f]*b.aa[f],url:"rk"+f+".dsk"});b.R&=-129;switch(b.R>>1&7){case 0:b.Qb=2496;b.oa=0;b.R=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.eb[f]){b.oa|=32832;b.R|=49152;break}if((b.va&15)>=b.aa[f]){b.oa|=32800;b.R|=49152;break}c=(b.va>>4&511)*b.aa[f]+(b.va&15);d=(b.R&48)<<12|b.Pb;e=65536-b.Rb&65535;Wb(a,b.ra[f],c,d,e);return;case 2:if((b.va>>4&511)>=b.eb[f])b.oa|= +32832,b.R|=49152;else if((b.va&15)>=b.aa[f])b.oa|=32800,b.R|=49152;else{c=(b.va>>4&511)*b.aa[f]+(b.va&15);d=(b.R&48)<<12|b.Pb;e=65536-b.Rb&65535;a.bc(b.ra[f],c,d,e);return}}b.Qb=f<<13|b.Qb&8176|b.va%9&15;L(a.b,20,5,144,function(){b.R=b.R&65534|128;return!!(b.R&64)})}k.ed=function(a,b,c,d,e){var f=this.C;f.Pb=d&65535;f.R=f.R&-49|d>>12&48;f.Rb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.R|=49152;break;case 2:f.oa|=33792,f.R|=49152}L(this.b,20,5,144,function(){f.R=f.R&65534|128;return!!(f.R&64)})}; +function Xb(a){var b=a.w,c,d,e,f=b.M>>8&3;b.M&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.fd,drive:f,blocksize:128,mapped:1,maxblock:b.eb[f]*b.aa[f],url:"rl"+f+".dsk"});switch(b.M>>1&7){case 2:b.Xa&8&&(b.M&=63);b.Xa=b.Lc[f]|b.bb&64;break;case 3:1==(b.fa&3)&&(b.bb=b.fa&4?b.bb+(b.fa&65408)&65408|b.fa<<2&64:b.bb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.bb);break;case 4:b.Xa=b.bb;break;case 5:if(b.fa>>6>=b.eb[f]){b.M|=37888;break}if((b.fa&63)>=b.aa[f]){b.M|=37888;break}c=(b.fa>>6)* +b.aa[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Hb;e=65536-b.Xa&65535;Wb(a,b.ra[f],c,d,e);return;case 6:if(b.fa>>6>=b.eb[f])b.M|=37888;else if((b.fa&63)>=b.aa[f])b.M|=37888;else{c=(b.fa>>6)*b.aa[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Hb;e=65536-b.Xa&65535;a.bc(b.ra[f],c,d,e);return}}L(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})} +k.fd=function(a,b,c,d,e){var f=this.w;f.Hb=d&65535;f.M=f.M&-49|d>>12&48;f.Sa=d>>16&63;f.fa=~~(c/f.aa[b.Ma])<<6|c%f.aa[b.Ma];f.bb=f.fa;f.Xa=65536-e&65535;switch(a){case 1:f.M|=33792;break;case 2:f.M|=40960}L(this.b,20,5,112,function(){f.M|=129;return!!(f.M&64)})};function fc(a){a=a.B;a.T=2176;a.Ea=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.xb=[0,0,0,0,0,0,0,0];a.nb=a.yb=a.wb=a.ab=a.oc=0} +function gc(a,b){var c=a.B,d,e,f;c.T&=-16513;c.Ea&=-2049;c.ta[b]&=-1153;L(a.b,-1,0,172);"undefined"===typeof c.ra[b]&&(c.ra[b]={cache:[],postProcess:a.gd,drive:b,blocksize:256,mapped:0,maxblock:c.ec[0]*c.cb[0]*c.aa[0],url:"rp"+b+".dsk"});switch(c.T&63){case 5:c.dc[b]=c.Qa[b];c.T|=32896;c.ta[b]|=32896;c.nb|=1<=c.ec[0]||c.Fa[b]>>8>=c.cb[0]||(c.Fa[b]&255)>=c.aa[0]){c.xb[b]|=1024;c.T|=49152;break}d=(c.Qa[b]*c.cb[0]+(c.Fa[b]>>8))* +c.aa[0]+(c.Fa[b]&255);e=(c.ab&63)<<16|c.wb;f=65536-c.yb&65535;Wb(a,c.ra[b],d,e,f);return;case 57:if(c.Qa[b]>=c.ec[0]||c.Fa[b]>>8>=c.cb[0]||(c.Fa[b]&255)>=c.aa[0])c.xb[b]|=1024,c.T|=49152;else{d=(c.Qa[b]*c.cb[0]+(c.Fa[b]>>8))*c.aa[0]+(c.Fa[b]&255);e=(c.ab&63)<<16|c.wb;f=65536-c.yb&65535;a.bc(c.ra[b],d,e,f);return}}L(a.b,3,5,172,function(){c.T=c.T&65534|128;c.ta[b]|=128;return!!(c.T&64)})} +k.gd=function(a,b,c,d,e){var f=this.B;f.yb=65536-e&65535;f.wb=d&65535;f.T=f.T&-769|d>>8&768;f.ab=d>>16&63;e=~~(c/f.aa[0]);d=~~(e/f.cb[0]);f.Fa[b.Ma]=e%f.cb[0]<<8|c%f.aa[0];f.dc[b.Ma]=f.Qa[b.Ma]=d;f.nb|=1<=b.Vc-1&&(f.ta[b.Ma]|=1024);switch(a){case 1:f.Ea|=512;f.T|=49152;break;case 2:f.Ea|=2048,f.T|=49152}L(this.b,20,5,172,function(){f.ta[b.Ma]|=128;f.T=f.T&65534|128;return!!(f.T&64)})}; +function hc(a,b,c,d,e,f){var g=~~((f+c.Ta-1)/c.Ta),h=new XMLHttpRequest;2048>g&&d+2048g){b.kc(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.kc(0,b,c,d,e)}k.reset=function(){this.g.sb=this.g.sb&-120|20;this.f.Wa=0;this.C.R=128;this.w.M=128;fc(this)}; +k.Kc=function(a,b,c){var d,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.$a&65280:(a&1&&(b<<=8),f.$a=b|255,d=0);break;case 4194298:if(0>b)d=f.nc;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.nc=d;f.D|=2}break;case 4194294:if(70!==f.jb)return f.L(4,222);0>b?d=f.J:d=f.J=0;break;case 4194292:if(70!==f.jb)return f.L(4,224);d=1;break;case 4194290:if(70!==f.jb)return f.L(4,226);d=0;break;case 4194288:if(70!==f.jb)return f.L(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!==f.jb)return f.L(4,232);e=a-4194272>>1;0>b?d=f.ic[e]:(d=M(this,f.ic[e],a,b,c),0<=d&&(f.ic[e]=d));break;case 4194254:return a&1?f.P>>14&1?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.za[3]=b),d=f.za[3]):f.P>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.za[1]=b),d=f.za[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.P&2048?(0<=b&&(f.u[e]=b),d=f.u[e]):(0<=b&&(f.Pa[e]= +b),d=f.Pa[e]),d;case 4194246:return a&1?(0<=b&&(f.u[7]=b),d=f.u[7]):f.P>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.za[0]=b),d=f.za[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.P&2048?(0<=b&&(f.Pa[e]=b),d=f.Pa[e]):(0<=b&&(f.u[e]=b),d=f.u[e]),d;default:return f.J|=16,f.L(4,124)}break;case 4194176:e=a>>1&31;d=M(this,f.na[3][e],a,b,c);0<=d&&(f.na[3][e]=d,f.na[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=M(this,f.cc,a,b,c);0<=d&&(f.cc=d);break;case 4194172:d=f.Za;d&65280&& +(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.g.pd&65535:(d=M(this,this.g.data,a,b,c),0<=d&&(this.g.data=d));break;default:return f.J|=16,f.L(4,126)}break;case 4194048:e=this.C;switch(a&-2){case 4194048:d=M(this,e.Qb,a,b,c);0<=d&&(e.Qb=d);break;case 4194050:d=M(this,e.oa,a,b,c);0<=d&&(e.oa=d);break;case 4194052:d=M(this,e.R,a,b,c);0<=b&&0<=d&&(e.R=d&-36993|e.R&36992,e.R&1&&Vb(this));break;case 4194054:d=M(this,e.Rb,a,b,c);0<=d&&(e.Rb=d);break;case 4194056:d=M(this,e.Pb,a,b,c);0<=d&&(e.Pb=d); +break;case 4194058:d=M(this,e.va,a,b,c);0<=d&&(e.va=d);break;case 4194060:break;case 4194062:d=M(this,e.Dc,a,b,c);0<=d&&(e.Dc=d);break;default:return f.J|=16,f.L(4,128)}break;case 4193728:var g=this.B;e=g.Ea&7;switch(a&-2){case 4193728:d=M(this,g.T,a,b,c);0<=b&&0<=d&&(g.ab=g.ab&60|d>>8&3,g.T=d&17279|g.T&34944|2048,d&1&&g.T&128?gc(this,e):192==(d&192)&&L(f,0,5,172));break;case 4193730:d=M(this,g.yb,a,b,c);0<=d&&(g.yb=d);break;case 4193732:d=M(this,g.wb,a,b,c);0<=d&&(g.wb=d&65534);break;case 4193734:d= +M(this,g.Fa[e],a,b,c);0<=d&&(g.Fa[e]=d&7967);break;case 4193736:d=M(this,g.Ea,a,b,c);0<=d&&(g.Ea=d&63|g.Ea&65472,d&128&&fc(this));break;case 4193738:d=g.ta[e];break;case 4193740:d=g.xb[e];break;case 4193742:d=M(this,g.nb,a,b,c);0<=d&&(g.nb=d&255);break;case 4193744:d=g.md[e];break;case 4193746:d=M(this,g.Ec,a,b,c);0<=d&&(g.Ec=d);break;case 4193748:d=M(this,g.Fc[e],a,b,c);0<=d&&(g.Fc[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.nd[e];break;case 4193754:d=M(this,g.Gc[e],a,b,c);0<=d&& +(g.Gc[e]=d);break;case 4193756:d=M(this,g.Qa[e],a,b,c);0<=d&&(g.Qa[e]=d&511);break;case 4193758:g.dc[e]=g.Qa[e];d=g.dc[e];break;case 4193760:d=g.kd[e];break;case 4193762:d=g.ld[e];break;case 4193764:d=g.hd[e];break;case 4193766:d=g.jd[e];break;case 4193768:d=M(this,g.ab,a,b,c);0<=d&&(g.ab=d&63,g.T=g.T&-769|(d&3)<<8);break;case 4193770:d=M(this,g.oc,a,b,c);0<=d&&(g.oc=d);break;default:return f.J|=16,f.L(4,132)}break;case 4192512:e=this.w;switch(a&-2){case 4192512:d=M(this,e.M,a,b,c);0<=b&&0<=d&&(e.Sa= +e.Sa&60|d>>4&3,e.M=e.M&-1023|d&1022,e.M&128||Xb(this));break;case 4192514:d=M(this,e.Hb,a,b,c);0<=d&&(e.Hb=d&65534);break;case 4192516:d=M(this,e.fa,a,b,c);0<=d&&(e.fa=d);break;case 4192518:d=M(this,e.Xa,a,b,c);0<=d&&(e.Xa=d);break;case 4192520:d=M(this,e.Sa,a,b,c);0<=d&&(e.Sa=d&63,e.M=e.M&-49|(e.Sa&3)<<4);break;default:return f.J|=16,f.L(4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.mb:(d=M(this,f.mb,a,b,c),0<=d&&(70!==f.jb&&(d&=-49),f.mb=d,f.$b[0]=d&4?15:7,f.$b[1]=d&2?15:7,f.$b[3]= +d&1?15:7,f.Zb&&(e=2,f.mb&16&&(e=1),this.g.sb=this.g.sb&-8|e)));break;default:return f.J|=16,f.L(4,136)}break;case 4191424:e=a>>1&31;d=M(this,f.na[0][e],a,b,c);0<=d&&(f.na[0][e]=d,f.na[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=M(this,f.na[1][e],a,b,c);0<=d&&(f.na[1][e]=d,f.na[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.jb)return f.L(4,234);e=a>>2&31;d=f.Tb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=M(this,d,a,b,c),0<=d&&(f.Tb[e]=a&2?d<<16|f.Tb[e]&65535:f.Tb[e]&4294901760|d&65534));break; +case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Ob[a>>1&255];else return f.J|=16,f.L(4,138);break;default:return f.J|=16,f.L(4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var kc={},Rb=(kc[65382]=[null,null,K.prototype.Yc,K.prototype.rd,"LKS"],kc[65402]=[null,null,K.prototype.Zc,K.prototype.sd,"MMR0"],kc[65534]=[null,null,K.prototype.$c,K.prototype.td,"PSW"],kc); +La(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,c>>2),rc(this,nc?sc:tc);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},da:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma: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},ya:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]& +~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Va=!0},ba:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,1,c.X)&&c.ja(!0)}return this.Ob(a,b)},ha:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,2,c.X)&&c.ja(!0)}return this.lc(a,b)},ua:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;yc(d,this.A+a,1,d.F)&&d.ja(!0)}this.g?this.w(a, +b,c):this.Cb(a,b,c)},Ba:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;yc(d,this.A+a,2,d.F)&&d.ja(!0)}this.g?this.w(a,b,c):this.rc(a,b,c)},X:function(a){return this.f[a]},ca:function(a,b){a=this.f[a];this.j&&F(this.j,128)&&E(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ea:function(a){return this.F.getUint16(a,!0)},la:function(a,b){a=a&1?this.f[a]|this.f[a+1]<<8:this.I[a>>1];this.j&&F(this.j,128)&&E(this.j,"Memory.readWord("+J(this.j,b)+"): "+J(this.j,a),!0);return a}, +qa:function(a,b){this.f[a]=b;this.Va=!0},xa:function(a,b,c){this.f[a]=b;this.Va=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},Aa:function(a,b){this.F.setUint16(a,b,!0);this.Va=!0},Ca:function(a,b,c){a&1?(this.f[a]=b,this.f[a+1]=b>>8):this.I[a>>1]=b;this.Va=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0)}};function Bb(a,b,c){a.j=b;a.K=a.C=0;c&&((a.K=c.K)&&xc(a,wc,!1),(a.C=c.C)&&vc(a,wc,!1))} +function zc(a,b){b?--a.C||(a.Bb=a.g?a.w:a.Cb,a.Ic=a.g?a.H:a.rc):--a.K||(a.vb=a.Ob,a.Cc=a.lc)}function vc(a,b,c){c&&a.C||(a.Bb=!a.g&&b[1]||a.w,a.Ic=!a.g&&b[3]||a.H);if(c||void 0===c)a.Cb=b[1]||a.w,a.rc=b[3]||a.H}function xc(a,b,c){c&&a.K||(a.vb=b[0]||a.O,a.Cc=b[2]||a.S);if(c||void 0===c)a.Ob=b[0]||a.O,a.lc=b[2]||a.S}function rc(a,b){b||(b=Ac);xc(a,b,void 0);vc(a,b,void 0)}var Ac=[],uc=[I.prototype.da,I.prototype.ya,I.prototype.ma,I.prototype.qb],wc=[I.prototype.ba,I.prototype.ua,I.prototype.ha,I.prototype.Ba]; +if(xb)var tc=[I.prototype.X,I.prototype.qa,I.prototype.ea,I.prototype.Aa],sc=[I.prototype.ca,I.prototype.xa,I.prototype.la,I.prototype.Ca];function Bc(a,b){w.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Ba=a.cycles||b;this.Ya=c;this.gb=Math.round(this.Ba/1E4)/100;this.lb=this.gb*this.Ya;this.v.ga=!1;this.v.pc=!1;this.v.Fb=a.autoStart;this.v.wc=!1;this.v.rb=!1;this.Lb=this.ha=0;this.Mb=a.csStart;this.tb=a.csInterval;this.ub=a.csStop;this.O=[];this.Xb=this.od.bind(this);G(this)}y(Bc); +var Cc=["power","reset"];k=Bc.prototype;k.Oa=function(a,b,c,d){this.C=a;this.G=b;this.j=d;for(b=0;b=a.ha&&(a.ha+=a.tb,c=!0);0<=a.ub&&a.ub<=Ic(a)&&(a.tb=a.ub=-1,Fc(a),a.ja(),c=!0);c&&a.i(Ic(a)+" cycles: checksum="+p(a.Lb))}} +function Jc(a,b,c,d){if(a.K[b]){void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.ja());var e=a.j&&a.j.ea||8;c=!a.v.ga||a.v.wc?8==e?ca(c,d):p(c,d):"--------".substr(0,d||4);a.K[b].textContent!=c&&(a.K[b].textContent=c)}} k.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.K[b]=c;a=!0;break;case "run":this.K[b]=c;c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.v.ia)a=!0;else{var b=null,c,h=cb(a.id);for(c=0;ca.ba/a.kb?b=1:d=!0;a.Ya=b;b=a.gb*a.Ya;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var f=a.K.setSpeed;f&&(f.textContent=b);a.g("target speed: "+b)}c&&a.C&&a.C.Ub()}dd(a,a.X);a.X=0;a.S=ra();a.ca=0;ed(a);return d}function Qb(a,b){var c=a.O.length;a.O.push([-1,b]);return c}function Rb(a,b){var c;0<=b&&ba.O[b][0]&&(c=a.Ba*a.Ya/1E3*(1E3/60),a.O[b][0]=c)} +a=!0;break;case "speed":this.K[b]=c;a=!0;break;case "setSpeed":this.K[b]=c,c.onclick=function(){Kc(d,d.Ya<<1,!0)},c.textContent=this.lb.toFixed(2)+"Mhz",a=!0}return a};function Lc(a,b,c){a.ea+=b;c&&(a.da=a.b=0)}function ed(a,b){var c=1;b&&1a.ba/a.lb?b=1:d=!0;a.Ya=b;b=a.gb*a.Ya;if(a.lb!=b){a.lb=b;b=a.lb.toFixed(2)+"Mhz";var e=a.K.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.C&&a.C.Ub()}Lc(a,a.X);a.X=0;a.S=ra();a.ca=0;ed(a);return d}function Pb(a,b){var c=a.O.length;a.O.push([-1,b]);return c}function Qb(a,b){var c;0<=b&&ba.O[b][0]&&(c=a.Ba*a.Ya/1E3*(1E3/60),a.O[b][0]=c)} function fd(a,b){for(var c=a.O.length-1;0<=c;c--){var d=a.O[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function gd(a,b){for(var c=a.O.length-1;0<=c;c--){var d=a.O[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function hd(a){a.da-=a.b;a.b=0} -k.od=function(){if(this.v.ga){this.ob>=this.Ba&&ed(this,!0);this.ua=0;this.Aa=ra();if(this.ca){var a=this.Aa-this.ca;a>this.Jb&&(this.S+=a,this.S>this.Aa&&(this.S=this.Aa))}try{do{var b=fd(this,this.v.qb?1:this.Ca);try{this.Ab(b)}catch(f){if("number"!=typeof f)throw f;}var c=this.da-this.b;gd(this,c);this.ua+=c;this.X+=c;dd(this,0,!0);Ic(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ca;15<=++this.Wb&&(this.C&&this.C.Ga(),this.Wb=0);break}}while(this.v.ga)}catch(f){this.ja();M(this);this.C&&this.C.stop(ra(), -Jc(this));wb(this,f.stack||f.message);return}if(this.v.ga){a=setTimeout;b=this.Xb;this.ca=ra();c=this.Jb;this.ua&&(c=Math.round(c*this.ua/this.Ca));var c=c-(this.ca-this.Aa),d=this.ca-this.S;d&&(this.ba=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ea=0,cd(this)));if(0>c||this.bac&&(this.S-=c),c=0;this.ob+=this.ua;this.ca+=c;a(b,c)}}}; -k.zb=function(a){if(vb(this))return!1;if(this.v.ga)return this.g(this.toString()+" busy"),!1;cd(this);this.v.ga=!0;this.v.pc=!0;this.qa&&this.qa.start();var b=this.K.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.Ub(!0),this.C.start(this.S,Jc(this)));M(this,!0);setTimeout(this.Xb,0);return!0};k.Ab=function(){return 0}; -k.ja=function(a){if(this.v.ga){hd(this);dd(this,this.X);this.X=0;this.v.ga=!1;this.qa&&this.qa.stop();var b=this.K.run;b&&(b.textContent="Run");this.C&&this.C.stop(ra(),Jc(this));M(this)}this.v.complete=a};function M(a,b){a.C&&a.C.Ga(b)} -function id(a){this.Wc=+a.model||1170;this.jc=a.resetAddr||0;Cc.call(this,a,6666667);this.Gb=0;this.decode=jd.bind(this);this.U=65536;this.V=32768;this.Y=65535;this.W=32768;this.P=15;this.u=[0,0,0,0,0,0,0,this.jc];this.Pa=[0,0,0,0,0,0];this.za=[0,0,0,0];this.ya=this.G=0;this.na=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Tb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.ic=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.A=this.f=this.w=this.j=this.fb=this.D=0;this.jb=70;this.ma=-1;kd(this);this.v.complete=this.v.Oc=!1}y(id,Cc);k=id.prototype;k.reset=function(){this.v.ga&&this.ja();kd(this);Fc(this);this.v.error=!1;this.parent.reset.call(this)}; -function kd(a){a.$a=255;a.J=0;a.nc=0;a.I=0;a.Za=0;a.cc=0;a.lb=0;a.Zb=0;a.xa=0;a.$b=[7,7,7,7];a.F=[];a.D|=2;Tb(a)}function Tb(a){a.Zb?(a.Db=65536,a.aa=a.Sc):(a.Db=0,a.aa=a.Rc)}k.yc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ea,this.Ya]);a.set(2,Lb(this.H));return a.data()}; -k.restore=function(a){var b=a[1];this.ea=b[1];cd(this,b[3]);a:{b=this.H;a=a[2];var c;for(c=0;c=this.Ba&&ed(this,!0);this.ua=0;this.Aa=ra();if(this.ca){var a=this.Aa-this.ca;a>this.Jb&&(this.S+=a,this.S>this.Aa&&(this.S=this.Aa))}try{do{var b=fd(this,this.v.rb?1:this.Ca);try{this.Ab(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.da-this.b;gd(this,c);this.ua+=c;this.X+=c;Lc(this,0,!0);Hc(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ca;15<=++this.Wb&&(this.C&&this.C.Ga(),this.Wb=0);break}}while(this.v.ga)}catch(e){this.ja();N(this);this.C&&this.C.stop(ra(), +Ic(this));kb(this,e.stack||e.message);return}if(this.v.ga){a=setTimeout;b=this.Xb;this.ca=ra();c=this.Jb;this.ua&&(c=Math.round(c*this.ua/this.Ca));var c=c-(this.ca-this.Aa),d=this.ca-this.S;d&&(this.ba=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ea=0,Kc(this)));if(0>c||this.bac&&(this.S-=c),c=0;this.pb+=this.ua;this.ca+=c;a(b,c)}}}; +k.zb=function(a){if(jb(this))return!1;if(this.v.ga)return this.i(this.toString()+" busy"),!1;Kc(this);this.v.ga=!0;this.v.pc=!0;this.qa&&this.qa.start();var b=this.K.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.Ub(!0),this.C.start(this.S,Ic(this)));N(this,!0);setTimeout(this.Xb,0);return!0};k.Ab=function(){return 0}; +k.ja=function(a){if(this.v.ga){hd(this);Lc(this,this.X);this.X=0;this.v.ga=!1;this.qa&&this.qa.stop();var b=this.K.run;b&&(b.textContent="Run");this.C&&this.C.stop(ra(),Ic(this));N(this)}this.v.complete=a};function N(a,b){a.C&&a.C.Ga(b)} +function id(a){this.Wc=+a.model||1170;this.jc=a.resetAddr||0;Bc.call(this,a,6666667);this.Gb=0;this.decode=jd.bind(this);this.U=65536;this.V=32768;this.Y=65535;this.W=32768;this.P=15;this.u=[0,0,0,0,0,0,0,this.jc];this.Pa=[0,0,0,0,0,0];this.za=[0,0,0,0];this.ya=this.B=0;this.na=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Tb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.ic=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=this.f=this.fb=this.H=this.I=this.D=0;this.jb=70;this.ma=-1;kd(this);this.v.complete=this.v.Oc=!1}y(id,Bc);k=id.prototype;k.reset=function(){this.v.ga&&this.ja();kd(this);Ec(this);this.v.error=!1;this.parent.reset.call(this)}; +function kd(a){a.$a=255;a.J=0;a.nc=0;a.F=0;a.Za=0;a.cc=0;a.mb=0;a.Zb=0;a.xa=0;a.$b=[7,7,7,7];a.w=[];a.D|=2;Sb(a)}function Sb(a){a.Zb?(a.Db=65536,a.Z=a.Sc):(a.Db=0,a.Z=a.Rc)}k.yc=function(){return 0};k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ea,this.Ya]);a.set(2,Lb(this.G));return a.data()}; +k.restore=function(a){var b=a[1];this.ea=b[1];Kc(this,b[3]);a:{b=this.G;a=a[2];var c;for(c=0;cb){a.F[e].Ua-=b;break}b-=a.F[e].Ua}a.F.splice(e+1,0,{delay:b,priority:c<<5&224,vector:d,callback:f})}a.D|=2}function Ub(a){return a.P=a.P&63728|a.Na()|nd(a)|md(a)|ld(a)} -function Vb(a,b){a.W=b<<12;a.Y=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.P)&2048)for(var c=a.Pa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Pa[c];a.Pa[c]=d}a.G=b>>14&3;c=a.P>>14&3;a.G!=c&&(a.za[c]=a.u[6],a.u[6]=a.za[a.G]);a.D|=2;a.P=b}function O(a,b){a.D&128||(a.W=a.Y=b,a.V=0)}function rd(a,b,c){a.D&128||(a.W=a.Y=a.U=b,a.V=c||0)}function sd(a,b,c,d){a.D&128||(a.W=a.Y=a.U=b,a.V=(c^b)&(d^b))}function td(a,b){a.D&128||(a.W=a.Y=a.U=b,a.V=a.W^a.U>>1)}function ud(a,b,c,d){a.D&128||(a.W=a.Y=a.U=b,a.V=(c^d)&(d^b))} -k.L=function(a){var b=!1;0>this.ma?this.ma=Ub(this):this.G||(a=4,b=!0);this.I&57344||(this.Za=63222,this.cc=a);this.G=0;var c=pd(this,a|65536),d=pd(this,a+2&65535|65536);Vb(this,d&-12289|this.ma>>2&12288);b&&(this.J|=4,this.u[6]=4);vd(this,this.ma);vd(this,this.u[7]);qd(this,c);this.D&=-113;this.ma=-1;throw a;};function wd(a){var b=xd(a),c=xd(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);qd(a,b);Vb(a,c);a.D&=-17} -function jc(a,b){var c=b>>13&31;31>c?a.lb&32&&(b=a.Tb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function yd(a,b,c){var d,f,e,g=0;if(c&a.Zb){d=b>>13&a.$b[a.G];f=a.na[a.G][d];e=(a.na[a.G][d+16]<<6)+(b&8191)&4194303;a.lb&16?3932160<=e&&4186112>e&&(e=jc(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.J|=32,a.L(4,12)),e&1&&!(c&1)&&(a.J|=64,a.L(4,14)));switch(f&7){case 1:g=4096;case 2:f|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:f|=c&4?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2& -8128)&&(g|=16384));a.na[a.G][d]=f;if(4194170!==e||a.G)a.xa=a.G,a.ya=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.I&57344||(a.I=a.I|g|a.xa<<5|a.ya<<1),a.L(168,16)),a.I&61440||!(4191360>e||4194239>3&7;b&=7;c&4?(a.j=g,a.f=b):(a.w=g,a.A=b);switch(g){case 0:return a.L(4,20),0;case 1:return 6===b&&!a.G&&c&4&&(a.u[6]<=a.$a||65534<=a.u[6])&&(a.u[6]<=a.$a-32||65534<=a.u[6]?(a.J|=4,a.u[6]=4,a.L(4,22)):(a.J|=8,a.D|=64)),a.b-=3,7===b?a.u[b]:a.u[b]|e;case 2:f=2;d=a.u[b];7!==b&&(d|=e,6>b&&c&1&&(f=1));a.b-=3;break;case 3:f=2;d=a.u[b];7!==b&&(d|=e);d=pd(a,d);d|=e;a.b-=7;break;case 4:f=-2;6>b&&c&1&&(f=-1);d=a.u[b]+f&65535;7!==b&&(d|=e);a.b-=4;break;case 5:f=-2; -d=a.u[b]-2&65535;7!==b&&(d|=e);d=pd(a,d)|e;a.b-=8;break;case 6:return d=od(a),d=d+a.u[b]&65535|e,a.b-=6,d;case 7:return d=od(a),d=d+a.u[b]&65535,d=pd(a,d|65536)|e,a.b-=10,d}a.u[b]=a.u[b]+f&65535;!e||a.I&57344||(a.Za=a.Za<<8|f<<3&248|b);6==b&&!a.G&&c&4&&0>=f&&(a.u[6]<=a.$a||65534<=a.u[6])&&(a.u[6]<=a.$a-32?(a.J|=4,a.u[6]=4,a.L(4,24)):(a.J|=8,a.D|=64));return d}k.Rc=function(a,b){return zd(this,a,b)};k.Sc=function(a,b){return yd(this,zd(this,a,b),b)}; -function Ad(a,b,c){b&56?(b=zd(a,b,2),c&65536||61440!==(a.P&61440)&&(b&=65535),a.G=a.P>>12&3,c=pd(a,b|c&65536),a.G=a.P>>14&3):(a.w=0,c=a.A=b&7,c=6!=c||(a.P>>2&12288)===(a.P&12288)?a.u[c]:a.za[a.P>>12&3]);return c}function Bd(a,b,c,d){a.I&57344||(a.Za=22);b&56?(b=zd(a,b,4),c&65536||(b&=65535),a.G=a.P>>12&3,b=yd(a,b|c&65536,4),a.G=a.P>>14&3,a.H.nb(b,d&65535)):(a.j=0,c=a.f=b&7,6!=c||(a.P>>2&12288)===(a.P&12288)?a.u[c]=d:a.za[a.P>>12&3]=d)} -function P(a,b){b&56?a=kc(a,a.aa(b,2)):(a.w=0,a=a.u[a.A=b&7]);return a}function Cd(a,b){b&56?(b=a.aa(b,3),a=a.H.rb(b)):(a.w=0,a=a.u[a.A=b&7]&255);return a}function Q(a,b,c,d){b&56?(b=a.aa(b,6),c=d.call(a,c,kc(a,b)),a.H.nb(b,c&65535)):(a.j=0,b=a.f=b&7,a.u[b]=d.call(a,c,a.u[b]))}function R(a,b,c,d){b&56?(b=a.fb=a.aa(b,7),c=d.call(a,c,a.H.rb(b)),b&1&&a.b--,a.H.Sb(b,c&255)):(a.j=0,b=a.f=b&7,a.u[b]=a.u[b]&65280|d.call(a,c,a.u[b]))} -function Dd(a,b,c){b&56?(b=a.aa(b,4),a.H.nb(b,c&65535)):(a.j=0,a.u[a.f=b&7]=c&65535);return c}function Ed(a,b,c,d){b&56?(d=a.aa(b,5),d&1&&a.b--,a.H.Sb(d,c&255)):(a.j=0,b=a.f=b&7,a.u[b]=c?d&1?c<<24>>24&65535:a.u[b]&-256|c&255:a.u[b]&-256);return c}function T(a,b,c){c&&(qd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.Ab=function(a){this.v.complete=!0;var b=this.v.Oc=this.i&&Fd(this.i),c=a?this.v.pc?0:1:-1;this.v.pc=!1;this.da=this.b=a;do{if(b){if(Gd(this.i,this.u[7],c)){this.ja();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.L(168,28):this.D&64?this.L(4,30):this.D&16&&this.L(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;a=null;for(var d=this.nc&224,f=this.F.length;0<=--f;){if(0d&&(d=this.F[f].Xc,a=this.F[f],this.F.splice(f,1))}d>(this.P&224)&&(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),a?this.L(a.qd,26):this.L(160,26))}else this.D&1&&this.D++;this.I&57344||(this.Za=0,this.cc=this.u[7]);this.D=this.D&7|this.P&16;this.decode(od(this))}while(0>1|b<<16;td(this,a);return a&65535}function Md(a,b){a=b&2048|b>>1|b<<8;td(this,a<<8);return a&255}function Nd(a,b){a=b&~a;O(this,a);return a}function Od(a,b){a=b&~a;O(this,a<<8);return a}function Pd(a,b){a|=b;O(this,a);return a} -function Qd(a,b){a|=b;O(this,a<<8);return a}function Rd(a,b){a=~b|65536;rd(this,a);return a&65535}function Sd(a,b){a=~b|256;rd(this,a<<8);return a&255}function Td(a,b){a=b-a;this.D&128||(this.W=this.Y=a,this.V=b&(b^a));return a&65535}function Ud(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.W=this.Y=c,this.V=b&(b^c));return a&255}function Vd(a,b){a=b+a;this.D&128||(this.W=this.Y=a,this.V=a&(b^a));return a&65535} -function Wd(a,b){a=b+a;var c=a<<8;this.D&128||(this.W=this.Y=c,this.V=c&(b<<8^c));return a&255}function Xd(a,b){a=-b;rd(this,a,a&b&32768);return a&65535}function Yd(a,b){a=-b;rd(this,a<<8,(a&b&128)<<8);return a&255}function Zd(a,b){a=b<<1|this.U>>16&1;td(this,a);return a&65535}function $d(a,b){a=b<<1|this.U>>16&1;td(this,a<<8);return a&255}function ae(a,b){a=(this.U&65536|b)>>1|b<<16;td(this,a);return a&65535}function be(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;td(this,a<<8);return a&255} -function ce(a,b){var c=b-a;ud(this,c,a,b);return c&65535}function de(a,b){var c=b-a;ud(this,c<<8,a<<8,b<<8);return c&255}function ee(a,b){this.D&128||(this.W=this.Y=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function fe(a,b){a^=b;O(this,a);return a&65535} -function ge(a){var b=P(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.W=this.Y=c;this.b-=(this.w?6:7)+b} -function he(a){var b=P(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.W=d>>16;this.Y=d>>16|d;this.b-=(this.w?6:7)+b}function U(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Y=1);a&8&&(this.W=0);this.b-=5} -function ie(a){var b=P(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Y=d>>16|d,this.W=d>>16):(this.V=32768,this.Y=d>>15|d,this.W=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Y=this.W=0,this.V=32768,this.U=65536,this.b-=7}var je=[0,7,7,10,7,11,9,13];function ke(a){var b=this.b;qd(this,zd(this,a,8));this.b=b-je[this.w]} -var le=[0,14,14,17,14,18,16,20];function me(a){var b=this.b,c=zd(this,a,8);a=a>>6&7;vd(this,this.u[a]);this.u[a]=this.u[7];qd(this,c);this.b=b-le[this.w]}var ne=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],oe=[7,13,13,17,14,18,17,21];function pe(a){var b=P(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.D&128||(this.W=b>>16,this.Y=this.W|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)qd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Me(a){Q(this,a,0,ee);this.b-=this.j?9:3+(7==this.f?2:0)}function Ne(a){Q(this,a,P(this,(a&448)>>6),fe);this.b-=this.j?9:3+(7==this.f?2:0)}function W(){this.L(8,6)}function jd(a){Oe[a>>12].call(this,a)} -var Oe=[function(a){Pe[a>>8&15].call(this,a)},function(a){var b=P(this,a>>6),c=this.b;O(this,Dd(this,a,b));this.b=c-ne[(this.w?8:0)+this.j]+(7!=this.f||this.j?0:2)},function(a){var b=P(this,a>>6),c=this.w,d=this.A;a=P(this,a);ud(this,b-a,a,b);this.b-=this.w?4+(d&&6<=this.A?1:0):(c?4:3)+(7==this.A?2:0)},function(a){var b=P(this,a>>6),c=this.w,d=this.A;a=P(this,a);O(this,b&a);this.b-=this.w?4+(d&&6<=this.A?1:0):(c?4:3)+(7==this.A?2:0)},function(a){Q(this,a,P(this,a>>6),Nd);this.b-=this.j?9+(this.A&& -6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},function(a){Q(this,a,P(this,a>>6),Pd);this.b-=this.j?9+(this.A&&6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},function(a){Q(this,a,P(this,a>>6),Hd);this.b-=this.j?9+(this.A&&6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},function(a){Qe[a>>8&15].call(this,a)},function(a){Re[a>>8&15].call(this,a)},function(a){var b=Cd(this,a>>6);O(this,Ed(this,a,b,1)<<8);this.b-=this.j?9+(this.A&&6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a>>6)<< -8,c=this.w,d=this.A;a=Cd(this,a)<<8;ud(this,b-a,a,b);this.b-=this.w?4+(d&&6<=this.A?1:0):(c?4:3)+(7==this.A?2:0)},function(a){var b=Cd(this,a>>6),c=this.w,d=this.A;a=Cd(this,a);O(this,(b&a)<<8);this.b-=this.w?4+(d&&6<=this.A?1:0):(c?4:3)+(7==this.A?2:0)},function(a){R(this,a,Cd(this,a>>6),Od);this.b-=this.j?9+(this.A&&6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},function(a){R(this,a,Cd(this,a>>6),Qd);this.b-=this.j?9+(this.A&&6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},function(a){Q(this,a,P(this, -a>>6),ce);this.b-=this.j?9+(this.A&&6<=this.f?1:0):(this.w?5:3)+(7==this.f?2:0)},W],Pe=[function(a){Se[a>>4&15].call(this,a)},function(a){T(this,a,!0)},function(a){T(this,a,!nd(this))},function(a){T(this,a,nd(this))},function(a){T(this,a,!this.Na()==!md(this))},function(a){T(this,a,!this.Na()!=!md(this))},function(a){T(this,a,!nd(this)&&!this.Na()==!md(this))},function(a){T(this,a,nd(this)||!this.Na()!=!md(this))},me,me,function(a){Te[a>>6&3].call(this,a)},function(a){Ue[a>>6&3].call(this,a)},function(a){Ve[a>> -6&3].call(this,a)},function(a){We[a>>6&3].call(this,a)},W,W],Te=[function(a){rd(this,Dd(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Rd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Vd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Td);this.b-=this.j?9:3+(7==this.f?2:0)}],Ue=[function(a){Q(this,a,0,Xd);this.b-=this.j?11:6},function(a){Q(this,a,ld(this)?1:0,Hd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,ld(this)?1:0,ce);this.b-=this.j? -9:3+(7==this.f?2:0)},function(a){a=P(this,a);rd(this,a);this.b-=this.w?4:3+(7==this.A?2:0)}],Ve=[function(a){Q(this,a,0,ae);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Zd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Ld);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Jd);this.b-=this.j?9:3+(7==this.f?2:0)}],We=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=pd(this,a|65536);qd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this, -a,0);vd(this,a);O(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,0,b);O(this,b);this.b=c-oe[this.j]},function(a){O(this,Dd(this,a,this.Na?65535:0));this.b-=this.j?9:3+(7==this.f?2:0)}],Se=[function(a){Xe[a&15].call(this,a)},W,W,W,ke,ke,ke,ke,function(a){if(a&8)this.L(8,6);else{var b=xd(this);a&=7;qd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.L(8,6)},function(a){Ye[a&15].call(this,a)},function(a){Ze[a& -15].call(this,a)},Me,Me,Me,Me],Xe=[function(){this.P&49152?(this.J|=128,this.L(4,3)):hd(this);this.b-=7},function(){this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){wd(this);this.D|=this.P&16;this.b-=13},function(){this.L(12,1);this.b-=5},function(){this.L(16,4);this.b-=25},function(){this.P&49152||(kd(this),this.H.reset());this.b-=667},function(){wd(this);this.b-=13},W,W,W,W,W,W,W,W,W],Ye=[Ke,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},U,function(){this.Y=1;this.b-= -5},U,U,U,function(){this.W=0;this.b-=5},U,U,U,U,U,U,U],Ze=[Ke,function(){this.U=65536;this.b-=5},function(){this.V=32768;this.b-=5},V,function(){this.Y=0;this.b-=5},V,V,V,function(){this.W=32768;this.b-=5},V,V,V,V,V,V,V],Qe=[pe,pe,ie,ie,ge,ge,he,he,Ne,Ne,W,W,W,W,Le,Le],Re=[function(a){T(this,a,!this.Na())},function(a){T(this,a,this.Na())},function(a){T(this,a,!ld(this)&&!nd(this))},function(a){T(this,a,ld(this)||nd(this))},function(a){T(this,a,!md(this))},function(a){T(this,a,md(this))},function(a){T(this, -a,!ld(this))},function(a){T(this,a,ld(this))},function(){this.L(24,2);this.b-=25},function(){this.L(28,5);this.b-=5},function(a){$e[a>>6&3].call(this,a)},function(a){af[a>>6&3].call(this,a)},function(a){bf[a>>6&3].call(this,a)},function(a){cf[a>>6&3].call(this,a)},W,W],$e=[function(a){rd(this,Ed(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Sd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Wd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ud);this.b-= -this.j?9:3+(7==this.f?2:0)}],af=[function(a){R(this,a,0,Yd);this.b-=this.j?11:6},function(a){R(this,a,ld(this)?1:0,Id);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,ld(this)?1:0,de);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Cd(this,a);rd(this,a<<8);this.b-=this.w?4:3+(7==this.A?2:0)}],bf=[function(a){R(this,a,0,be);this.b-=this.j?9+(this.fb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,$d);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Md);this.b-=this.j?9+(this.fb&1): -3+(7==this.f?2:0)},function(a){R(this,a,0,Kd);this.b-=this.j?9:3+(7==this.f?2:0)}],cf=[W,function(a){a=Ad(this,a,65536);vd(this,a);O(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,65536,b);O(this,b);this.b=c-oe[this.j]},W]; -function df(a){w.call(this,"ROM",a,df);this.f=null;this.A=a.addr;this.j=a.size;this.F=a.writable;this.C=a.alias;this.w=a.file;this.G=da(this.w);if(this.w){a=this.w;var b=ea(this.G);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.w+"&format=bytes&decimal=true");var c=this;ta(a,null,!0,function(a,b,e){ef(c,a,b,e)})}}y(df);df.prototype.Oa=function(a,b,c,d){this.H=b;this.b=c;this.i=d;ff(this)}; -df.prototype.Ka=function(){if(this.La){if(this.i){var a=this.i,b=this.id,c=this.A,d=this.j,f=this.La,e=[],g;for(g in f){var h=f[g];"number"==typeof h&&(f[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=e,l=[l>>>0,g],r=qa(n,l,a.vc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.G.push({zd:b,B:c,Tc:d,La:f,sc:e})}delete this.La}return!0};df.prototype.Ja=function(){return!0}; -function ef(a,b,c,d){if(d)a.sa("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.fc,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,g,h=eval("("+c+")");if(e=h.bytes)a.f=e;else if(e=h.words)for(a.f=Array(2*e.length),g=f=0;f>8&255;else if(e=h.data)for(a.f=Array(4*e.length),g=f=0;f>8&255,a.f[g++]=e[f]>>16&255,a.f[g++]=e[f]>>24&255;else a.f=h;a.La=h.symbols;if(!a.f.length){t("Empty ROM: "+ -b);return}if(1==a.f.length){t(a.f[0]);return}}catch(l){a.sa("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),f=0;f>>d.Z].Cb(f&d.f,a.f[c]&255,f);a.i&&a.i.j--}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(c=0;c>> -f.Z;0>>=f.Z;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.pb)return;b=oa(b[1]);if(this.F=db(b)){var d=this.F.exports;if(d){var f=d.connect;f&&f.call(this.F);if(this.G=d.receiveData){this.status(this.fc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.Bc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ja=function(a){return a?this.save():!0};k.reset=function(){this.f.ac=0;this.f.wa=128};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.mc=function(a){if("number"==typeof a)this.I.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(b);var d=c.length;32>b&&1==d&&(d=0);9==b&&(b=a.S||8,d=b-a.A%b,a.S&&(c=na("",d)));a.O&&!a.A&&d&&(c=String.fromCharCode(a.O)+c);a.j.value+=c;a.j.scrollTop=a.j.scrollHeight;a.A+=d}else if(null!=a.w){if(10==b||1024<=a.w.length)a.g(a.w),a.w="";10!=b&&(a.w+=String.fromCharCode(b))}} -var mf={},kf=(mf[65392]=[null,null,X.prototype.bd,X.prototype.vd,"RCSR"],mf[65394]=[null,null,X.prototype.ad,X.prototype.ud,"RBUF"],mf[65396]=[null,null,X.prototype.dd,X.prototype.xd,"XCSR"],mf[65398]=[null,null,X.prototype.cd,X.prototype.wd,"XBUF"],mf);La(function(){for(var a=D(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};nf.prototype.zc=function(){return-1};nf.prototype.Ac=function(){}; -function pf(a,b,c,d){if(c)if(b){0>a.A&&a.w.length&&(a.A=0);if(0>a.A||b!=a.w[a.A])a.w.splice(0,0,b),a.A=0;a.A--}else a.da?b="end":b=a.w[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var f=null;d=d||";";for(var e=0;e<=b.length;e++){var g=b.charAt(e);if('"'==g||"'"==g)f?g==f&&(f=null):f=g;else if(g==d&&!f||!g)a.push(oa(b.substring(c,e))),c=e+1}}return a} -function qf(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var f=a.pop(),e=a.pop();switch(d){case "*":d=e*f;break;case "/":if(!f)return!1;d=e/f;break;case "%":if(!f)return!1;d=e%f;break;case "+":d=e+f;break;case "-":d=e-f;break;case "<<":d=e<>":d=e>>f;break;case ">>>":d=e>>>f;break;case "<":d=e":d=e>f?1:0;break;case ">=":d=e>=f?1:0;break;case "==":d=e==f?1:0;break;case "!=":d=e!=f?1:0;break;case "&":d=e&f;break; -case "^":d=e^f;break;case "|":d=e|f;break;case "&&":d=e&&f?1:0;break;case "||":d=e||f?1:0;break;default:return!1}a.push(d|0)}return!0} -function rf(a,b,c){var d;if(b){b=sf(a,b);for(var f=0,e=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);f>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return f}function vf(a,b){if(b)return uf(a,b,a.la[b]);var c=0;for(b in a.la)uf(a,b,a.la[b]),c++;return 0b){a.w[f].Ua-=b;break}b-=a.w[f].Ua}a.w.splice(f+1,0,{delay:b,priority:c<<5&224,vector:d,callback:e})}a.D|=2}function Tb(a){return a.P=a.P&63728|a.Na()|nd(a)|md(a)|ld(a)} +function Ub(a,b){a.W=b<<12;a.Y=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.P)&2048)for(var c=a.Pa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Pa[c];a.Pa[c]=d}a.B=b>>14&3;c=a.P>>14&3;a.B!=c&&(a.za[c]=a.u[6],a.u[6]=a.za[a.B]);a.D|=2;a.P=b}function P(a,b){a.D&128||(a.W=a.Y=b,a.V=0)}function rd(a,b,c){a.D&128||(a.W=a.Y=a.U=b,a.V=c||0)}function sd(a,b,c,d){a.D&128||(a.W=a.Y=a.U=b,a.V=(c^b)&(d^b))}function td(a,b){a.D&128||(a.W=a.Y=a.U=b,a.V=a.W^a.U>>1)}function ud(a,b,c,d){a.D&128||(a.W=a.Y=a.U=b,a.V=(c^d)&(d^b))} +k.L=function(a){var b=!1;0>this.ma?this.ma=Tb(this):this.B||(a=4,b=!0);this.F&57344||(this.Za=63222,this.cc=a);this.B=0;var c=pd(this,a|65536),d=pd(this,a+2&65535|65536);Ub(this,d&-12289|this.ma>>2&12288);b&&(this.J|=4,this.u[6]=4);vd(this,this.ma);vd(this,this.u[7]);qd(this,c);this.D&=-113;this.ma=-1;throw a;};function wd(a){var b=xd(a),c=xd(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);qd(a,b);Ub(a,c);a.D&=-17} +function ic(a,b){var c=b>>13&31;31>c?a.mb&32&&(b=a.Tb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} +function yd(a,b,c){var d,e,f,g=0;if(c&a.Zb){d=b>>13&a.$b[a.B];e=a.na[a.B][d];f=(a.na[a.B][d+16]<<6)+(b&8191)&4194303;a.mb&16?3932160<=f&&4186112>f&&(f=ic(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&(3915776<=f&&(a.J|=32,a.L(4,12)),f&1&&!(c&1)&&(a.J|=64,a.L(4,14)));switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2& +8128)&&(g|=16384));a.na[a.B][d]=e;if(4194170!==f||a.B)a.xa=a.B,a.ya=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.F&57344||(a.F=a.F|g|a.xa<<5|a.ya<<1),a.L(168,16)),a.F&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=pd(a,e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=pd(a,e)|g; +a.b-=8;break;case 6:return e=od(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=od(a),e=e+a.u[c]&65535,e=pd(a,e|65536)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Za=a.Za<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.$a||65534<=a.u[6])&&(a.u[6]<=a.$a-32?(a.J|=4,a.u[6]=4,a.L(4,24)):(a.J|=8,a.D|=64));return e}k.Rc=function(a,b,c){return zd(this,a,b,c)};k.Sc=function(a,b,c){return yd(this,zd(this,a,b,c),c)}; +function Ad(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=zd(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.B=a.P>>12&3,c=pd(a,d|c&65536),a.B=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.za[a.P>>12&3];return c}function Bd(a,b,c,d){a.F&57344||(a.Za=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=zd(a,b,e,4),c&65536||(e&=65535),a.B=a.P>>12&3,e=yd(a,e|c&65536,4),a.B=a.P>>14&3,a.G.ob(e,d&65535)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.za[a.P>>12&3]=d} +function Cd(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.Z(b,c,3),a=a.G.kb(c)):a=a.u[c]&255;return a}function Dd(a,b){var c;b>>=6;var d=a.I=b&7;(b=a.H=(b&56)>>3)?c=jc(a,a.Z(b,d,2)):c=a.u[d];return c}function Ed(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return zd(a,b,c,8)}function Fd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.Z(b,c,3),a=a.G.kb(c)):a=a.u[c]&255;return a}function Gd(a,b){var c,d=a.f=b&7;(b=a.g=(b&56)>>3)?c=jc(a,a.Z(b,d,2)):c=a.u[d];return c} +function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.fb=a.Z(b,e,7),c=d.call(a,c,a.G.kb(e)),e&1&&a.b--,a.G.Sb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Z(b,e,6),c=d.call(a,c,jc(a,e)),a.G.ob(e,c&65535)):a.u[e]=d.call(a,c,a.u[e])}function Hd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.Z(b,e,5),d&1&&a.b--,a.G.Sb(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c} +function Id(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.Z(b,d,4),a.G.ob(d,c&65535)):a.u[d]=c&65535;return c}function T(a,b,c){c&&(qd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.Ab=function(a){this.v.complete=!0;var b=this.v.Oc=this.j&&Jd(this.j),c=a?this.v.pc?0:1:-1;this.v.pc=!1;this.da=this.b=a;do{if(b){if(Kd(this.j,this.u[7],c)){this.ja();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.L(168,28):this.D&64?this.L(4,30):this.D&16&&this.L(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;a=null;for(var d=this.nc&224,e=this.w.length;0<=--e;){if(0d&&(d=this.w[e].Xc,a=this.w[e],this.w.splice(e,1))}d>(this.P&224)&&(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),a?this.L(a.qd,26):this.L(160,26))}else this.D&1&&this.D++;this.F&57344||(this.Za=0,this.cc=this.u[7]);this.D=this.D&7|this.P&16;this.decode(od(this))}while(0>1|b<<16;td(this,a);return a&65535}function Qd(a,b){a=b&2048|b>>1|b<<8;td(this,a<<8);return a&255}function Rd(a,b){a=b&~a;P(this,a);return a}function Sd(a,b){a=b&~a;P(this,a<<8);return a}function Td(a,b){a|=b;P(this,a);return a} +function Ud(a,b){a|=b;P(this,a<<8);return a}function Vd(a,b){a=~b|65536;rd(this,a);return a&65535}function Wd(a,b){a=~b|256;rd(this,a<<8);return a&255}function Xd(a,b){a=b-a;this.D&128||(this.W=this.Y=a,this.V=b&(b^a));return a&65535}function Yd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.W=this.Y=c,this.V=b&(b^c));return a&255}function Zd(a,b){a=b+a;this.D&128||(this.W=this.Y=a,this.V=a&(b^a));return a&65535} +function $d(a,b){a=b+a;var c=a<<8;this.D&128||(this.W=this.Y=c,this.V=c&(b<<8^c));return a&255}function ae(a,b){a=-b;rd(this,a,a&b&32768);return a&65535}function be(a,b){a=-b;rd(this,a<<8,(a&b&128)<<8);return a&255}function ce(a,b){a=b<<1|this.U>>16&1;td(this,a);return a&65535}function de(a,b){a=b<<1|this.U>>16&1;td(this,a<<8);return a&255}function ee(a,b){a=(this.U&65536|b)>>1|b<<16;td(this,a);return a&65535}function fe(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;td(this,a<<8);return a&255} +function ge(a,b){var c=b-a;ud(this,c,a,b);return c&65535}function he(a,b){var c=b-a;ud(this,c<<8,a<<8,b<<8);return c&255}function ie(a,b){this.D&128||(this.W=this.Y=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function je(a,b){a^=b;P(this,a);return a&65535} +function ke(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.W=this.Y=c;this.b-=(this.g?6:7)+b} +function le(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.W=d>>16;this.Y=d>>16|d;this.b-=(this.g?6:7)+b}function U(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.Y=1);a&8&&(this.W=0);this.b-=5} +function me(a){var b=Gd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Y=d>>16|d,this.W=d>>16):(this.V=32768,this.Y=d>>15|d,this.W=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Y=this.W=0,this.V=32768,this.U=65536,this.b-=7}var ne=[0,7,7,10,7,11,9,13];function oe(a){var b=this.b;qd(this,Ed(this,a));this.b=b-ne[this.g]} +var pe=[0,14,14,17,14,18,16,20];function qe(a){var b=this.b,c=Ed(this,a);a=a>>6&7;vd(this,this.u[a]);this.u[a]=this.u[7];qd(this,c);this.b=b-pe[this.g]}var re=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],se=[7,13,13,17,14,18,17,21];function te(a){var b=Gd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.D&128||(this.W=b>>16,this.Y=this.W|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)qd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Pe(a){S(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)}function Qe(a){S(this,a,Dd(this,a),je);this.b-=this.g?9:3+(7==this.f?2:0)}function W(){this.L(8,6)}function jd(a){Re[a>>12].call(this,a)} +var Re=[function(a){Se[a>>8&15].call(this,a)},function(a){var b=Dd(this,a),c=this.b;P(this,Id(this,a,b));this.b=c-re[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=Dd(this,a);a=Gd(this,a);ud(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,Dd(this,a)&Gd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){S(this,a,Dd(this,a),Rd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? +2:0)},function(a){S(this,a,Dd(this,a),Td);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){S(this,a,Dd(this,a),Ld);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);P(this,Hd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;ud(this,b-a,a,b);this.b-=this.g? +4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,(Cd(this,a)&Fd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Sd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Ud);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){S(this,a,Dd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},W],Se= +[function(a){Ve[a>>4&15].call(this,a)},function(a){T(this,a,!0)},function(a){T(this,a,!nd(this))},function(a){T(this,a,nd(this))},function(a){T(this,a,!this.Na()==!md(this))},function(a){T(this,a,!this.Na()!=!md(this))},function(a){T(this,a,!nd(this)&&!this.Na()==!md(this))},function(a){T(this,a,nd(this)||!this.Na()!=!md(this))},qe,qe,function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},W,W],We=[function(a){rd(this, +Id(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Vd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Xd);this.b-=this.g?9:3+(7==this.f?2:0)}],Xe=[function(a){S(this,a,0,ae);this.b-=this.g?11:6},function(a){S(this,a,ld(this)?1:0,Ld);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,ld(this)?1:0,ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);rd(this,a);this.b-=this.g?4:3+(7==this.f? +2:0)}],Ye=[function(a){S(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Pd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)}],Ze=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=pd(this,a|65536);qd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this,a,0);vd(this,a);P(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a, +0,b);P(this,b);this.b=c-se[this.g]},function(a){P(this,Id(this,a,this.Na?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ve=[function(a){$e[a&15].call(this,a)},W,W,W,oe,oe,oe,oe,function(a){if(a&8)this.L(8,6);else{var b=xd(this);a&=7;qd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.L(8,6)},function(a){af[a&15].call(this,a)},function(a){bf[a&15].call(this,a)},Pe,Pe,Pe,Pe],$e=[function(){this.P&49152?(this.J|=128,this.L(4, +3)):hd(this);this.b-=7},function(){this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){wd(this);this.D|=this.P&16;this.b-=13},function(){this.L(12,1);this.b-=5},function(){this.L(16,4);this.b-=25},function(){this.P&49152||(kd(this),this.G.reset());this.b-=667},function(){wd(this);this.b-=13},W,W,W,W,W,W,W,W,W],af=[Ne,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},U,function(){this.Y=1;this.b-=5},U,U,U,function(){this.W=0;this.b-=5},U,U,U,U,U,U,U],bf=[Ne,function(){this.U=65536; +this.b-=5},function(){this.V=32768;this.b-=5},V,function(){this.Y=0;this.b-=5},V,V,V,function(){this.W=32768;this.b-=5},V,V,V,V,V,V,V],Te=[te,te,me,me,ke,ke,le,le,Qe,Qe,W,W,W,W,Oe,Oe],Ue=[function(a){T(this,a,!this.Na())},function(a){T(this,a,this.Na())},function(a){T(this,a,!ld(this)&&!nd(this))},function(a){T(this,a,ld(this)||nd(this))},function(a){T(this,a,!md(this))},function(a){T(this,a,md(this))},function(a){T(this,a,!ld(this))},function(a){T(this,a,ld(this))},function(){this.L(24,2);this.b-= +25},function(){this.L(28,5);this.b-=5},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},W,W],cf=[function(a){rd(this,Hd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Yd);this.b-=this.g?9:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,be);this.b-=this.g? +11:6},function(a){Q(this,a,ld(this)?1:0,Md);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,ld(this)?1:0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Fd(this,a);rd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,fe);this.b-=this.g?9+(this.fb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Qd);this.b-=this.g?9+(this.fb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Od);this.b-=this.g?9:3+(7==this.f? +2:0)}],ff=[W,function(a){a=Ad(this,a,65536);vd(this,a);P(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,65536,b);P(this,b);this.b=c-se[this.g]},W];function gf(a){w.call(this,"ROM",a,gf);this.f=null;this.B=a.addr;this.g=a.size;this.F=a.writable;this.C=a.alias;this.w=a.file;this.H=da(this.w);if(this.w){a=this.w;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.w+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf); +gf.prototype.Oa=function(a,b,c,d){this.G=b;this.b=c;this.j=d;jf(this)};gf.prototype.Ka=function(){if(this.La){if(this.j){var a=this.j,b=this.id,c=this.B,d=this.g,e=this.La,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=qa(n,l,a.vc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({zd:b,A:c,Tc:d,La:e,sc:f})}delete this.La}return!0};gf.prototype.Ja=function(){return!0}; +function hf(a,b,c,d){if(d)a.sa("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.fc,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,h=eval("("+c+")");if(f=h.bytes)a.f=f;else if(f=h.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=h.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=h;a.La=h.symbols;if(!a.f.length){t("Empty ROM: "+ +b);return}if(1==a.f.length){t(a.f[0]);return}}catch(l){a.sa("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e>>d.$].Cb(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}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(c=0;c>> +e.$;0>>=e.$;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.qb)return;b=oa(b[1]);if(this.F=db(b)){var d=this.F.exports;if(d){var e=d.connect;e&&e.call(this.F);if(this.H=d.receiveData){this.status(this.fc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.Bc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Ja=function(a){return a?this.save():!0};k.reset=function(){this.f.ac=0;this.f.wa=128};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.mc=function(a){if("number"==typeof a)this.I.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(b);var d=c.length;32>b&&1==d&&(d=0);9==b&&(b=a.S||8,d=b-a.B%b,a.S&&(c=na("",d)));a.O&&!a.B&&d&&(c=String.fromCharCode(a.O)+c);a.g.value+=c;a.g.scrollTop=a.g.scrollHeight;a.B+=d}else if(null!=a.w){if(10==b||1024<=a.w.length)a.i(a.w),a.w="";10!=b&&(a.w+=String.fromCharCode(b))}} +var pf={},nf=(pf[65392]=[null,null,Y.prototype.bd,Y.prototype.vd,"RCSR"],pf[65394]=[null,null,Y.prototype.ad,Y.prototype.ud,"RBUF"],pf[65396]=[null,null,Y.prototype.dd,Y.prototype.xd,"XCSR"],pf[65398]=[null,null,Y.prototype.cd,Y.prototype.wd,"XBUF"],pf);La(function(){for(var a=D(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};qf.prototype.zc=function(){return-1};qf.prototype.Ac=function(){}; +function sf(a,b,c,d){if(c)if(b){0>a.B&&a.w.length&&(a.B=0);if(0>a.B||b!=a.w[a.B])a.w.splice(0,0,b),a.B=0;a.B--}else a.da?b="end":b=a.w[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(oa(b.substring(c,f))),c=f+1}}return a} +function tf(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} +function uf(a,b,c){var d;if(b){b=vf(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function yf(a,b){if(b)return xf(a,b,a.la[b]);var c=0;for(b in a.la)xf(a,b,a.la[b]),c++;return 0>>d.H.Z;l=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[f];n.type==c?m++||d.g("..."):(c=n.type,m=Jb[c],n&&d.g(p(n.id,8)+" %"+p(f<>>c.Z].Ob(d&c.f,d),this.j--,b&&Ff(a,b));return c}; -k.Ia=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(this.j++,c=Kb(this.H,d),this.j--,b&&Ff(a,b));return c};k.Sb=function(a,b,c){var d=this.aa(a,!0,1);if(-1!==d){this.j++;var f=this.H;f.N[(d&f.j)>>>f.Z].Cb(d&f.f,b&255,d);this.j--;c&&Ff(a,c);M(this.b,!0)}};k.nb=function(a,b,c){var d=this.aa(a,!0,2);if(-1!==d){this.j++;var f=this.H,e=d&f.f,g=(d&f.j)>>>f.Z;e!=f.f?f.N[g].rc(e,b&65535,d):(f.N[g++].Cb(e,b&255,d),f.N[g&f.C].Cb(0,b>>8&255,d+1));this.j--;c&&Ff(a,c);M(this.b,!0)}}; -function Z(a){return{B:a,Ha:!1}}function Gf(a){return[a.B,a.Ha]}function Hf(a){return{B:a[0],Ha:a[1]}}function Ef(a,b,c){var d;c=(c?a.S:a.ob).B;if(void 0!==b){d=b=sf(a,b);var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cd&&(d+=b.length);0>d&&(d=0);for(var f=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.Ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Pa[a-8]:20>a?b=this.b.za[a-16]:20==a&&(b=Ub(this.b)));return b}; -k.message=function(a,b){this.j||(b&&(a+=" @"+J(this,Z(this.b.u[7]).B)),this.ka&1073741824?this.Aa.push(a):this.ya&&a==this.ya||(this.ya=a,this.ka&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,hd(a),a.la=0,M(a))))}; -function yf(a){var b;if(Fd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.Z],!1)}a.X=["br"];if(a.F)for(b=1;b>>d.Z],!0);a.F=["bw"];a.Db=0} -k.hb=function(a,b,c){var d=!0;c||Of(this,a,b,!1,!0);if(a!=this.f){var f=this.aa(b);if(-1===f)this.g("invalid address: "+J(this,b.B)),d=!1;else{var e=this.H;e.N[f>>>e.Z].hb(f&e.f,a==this.F)}}d&&(a.push(b),c?b.Ha=!0:(Pf(this,a,a.length-1,"set"),yf(this)));return d};function Of(a,b,c,d,f){var e=!1;c=a.aa(c);for(var g=1;g>>d.Z],b==a.F));h.Ha||yf(a);break}}return e} -function Qf(a,b){for(var c=1;c>23)&65535,v=J(u,q);else if(8192==A)q=q.B-((e&63)<<1)&65535,v=J(u,q);else if(12288==A)v=J(u,e&7,1);else if(24576==A)v=J(u,e&63,1);else if(A=e&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:v=Jf(z);break;case 8:v="@"+Jf(z);break;case 16:7>z?v="("+Jf(z)+ -")+":(A=u.Ia(q,2),v="#"+J(u,A,0,!0));break;case 24:7>z?v="@("+Jf(z)+")+":(A=u.Ia(q,2),v="@#"+J(u,A,0,!0));break;case 32:v="-("+Jf(z)+")";break;case 40:v="@-("+Jf(z)+")";break;case 48:A=u.Ia(q,2);v=J(u,A,0,!0)+"("+Jf(z)+")";7==z&&(v=[v,J(u,A+q.B&65535)]);break;case 56:A=u.Ia(q,2),v="@"+J(u,A)+"("+Jf(z)+")",7==z&&(v=[v,J(u,A+q.B&65535)])}u=v;if(!u||!u.length){h="INVALID";break}"string"!=typeof u&&(l=u[1],u=u[0]);0b?(c=Jf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Pa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.za[b-16]):20==b&&(c="PS="+J(a,Ub(d)));c&&(c+=" ");return c}function Vf(a){var b,c="";for(b=0;6>b;b++)c+=Uf(a,b);c=c+"\n"+(Uf(a,6)+Uf(a,7)+Uf(a,20));return c+=Tf(a,"T")+Tf(a,"N")+Tf(a,"Z")+Tf(a,"V")+Tf(a,"C")}k.vc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,h=e.Tc;if(f>=g&&fb)){d.u[b]=e&65535;break}a.g("unknown register: "+f);return}M(d);a.g("updated registers:")}a.g(Vf(a));c&&(a.S=Z(d.u[7]),Mf(a,J(a,a.S.B)))}}function $f(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.g(m)}h[3]&&(g=h[3],e=null);e=Sf(a,b,g,e);a.g(e);a.S=b;f-=b.B-l;c++}}} -function Rf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.da&&(a.g("ended assemble at "+J(a,a.ca.B)),a.S=a.ca,a.da=!1),b="");var f=b.charAt(0);if('"'==f||"'"==f)return!0;a.ya=null;if(ib(a)&&0n||"z"ka.length&&(a.g("note: only "+ka.length+" available"),Y=ka.length);ca-=Y;0>ca&&(null==ka[ka.length-1].B?(Y=ca+Y,ca=0):ca+=ka.length);var Nc=[];"call"==ve&&(jb=1E5,Nc=["CALL"]);for(void 0!==ue&&a.g(Y+" instructions earlier:");0=ka.length&&(ca=0);a.Gb=Y;xe++;jb--}}xe||(a.g("no "+we+"history available"),a.Gb=void 0)}else{var Xb=Ef(a,ja);if(Xb){var Yb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||tg),Yb=tf(a,za)>>>0,65536>4||1;vg--&&0$b?String.fromCharCode($b):".";Zb--}lb&&(lb+="\n");lb+=ja+" "+Pc+(0==nb?" "+Ae:"")}lb&&a.g(lb);a.ob=Xb}}}}break;case "e":if("else"==g[0])break;var Ta,Qc,Rc,Sc,Tc=g[0],Uc=g[1];"eb"==Tc?(Ta=1,Qc=255,Rc=a.rb,Sc=a.Sb):"e"==Tc||"ew"==Tc?(Ta=2,Qc=65535,Rc=a.Ia,Sc=a.nb):Uc=null;if(null==Uc)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 ac=Ef(a,Uc);if(ac)for(var bc=2;bcXc;){for(var Aa=null,zg=256;65536>qb.B>>>0;){Ce.B=a.Ia(qb,2);if(null==qb.B||!zg--)break;for(var Ag=a,cc=Ce,De=null,rb=cc.B,Ee=rb,Yc=1;6>= -Yc&&rb;Yc++){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;beg){if(gg(d,this.I)){this.A=new N(this,"1.30.0","failsafe");gg(this.A)&&(lg(this,d),a=2,mg(this.A));this.A.set("timestamp",sa());ng(this.A);var f=this.f&&!this.F;if(1==a||va("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=kg(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?gg(d,g):("error"== -e&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.j=null)):this.g(e+": "+g),mg(d),gg(d)?(c=kg(d),f=!0):c=!1))}f&&jg(this,c?d:null)}else 2==a&&d.clear()}else jg(this);delete this.I;delete this.O}f=cb(this.id);for(e=0;ea[1];a=a[2];this.ha=!0;this.v.ia=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(og(this,this.b,b,c,a),this.b.Fb());this.ba&&(lg(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.C=0}; -function lg(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 c=a.j||"";b=b.toString();var d={app:"PDP11js",ver:"1.30.0"};d.url=a.url;d.user=c;d.type="bug";d.data=b;ta("http://www.pcjs.org/api/v1/report",d,!0)}} -function bg(a,b,c){var d,f="none";if(a.C)return null;a.C--;var e=new N(a,"1.30.0"),g=new N(a,"1.30.0","validate"),h=sa();g.set("timestamp",h);e.set("timestamp",h);e.set("version","1.30.0");e.set("url",window?window.location.href:null);e.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.ja(),d=a.b.Ja(b,c),"object"===typeof d&&e.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(f=null)));for(var h=cb(a.id),l=0;le.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(e=window.location.pathname+e),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(e?' url="'+e+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));e=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.loadXML(a)):e=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){e=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=d[2];b("Loading "+f+"...");ta(f,null,!0,function(e,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(e=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(e);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Gg(a,b,c)}})}else c(a,null)} -function Hg(a,b,c,d){function f(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ia(a))}function e(a){f("Error: "+a);l&&(--sg||Na(!0));l=!1}var g,h,l=!0;sg++;ab[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| -(c="/versions/pdp11/1.30.0/components.xsl");m=function(d,h){h?Eg(c,null,null,!1,f,function(d,l){l?(bb(a,c,d),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--sg||Na(!0)):e("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--sg||Na(!0)):e("invalid machine element: "+ -a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser")):e(d)}):e(d)};"<"!=b.charAt(0)?Eg(b,a,d,!0,f,m):Fg(b,null,a,d,!1,f,m)}else e("missing machine element: "+a)}catch(q){e(q.message)}return l}window.embedPDP11=function(a,b,c,d){Na(!1);return Hg(a,b,c,d)};window.enableEvents=Na;window.sendEvent=Ua;})(); +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]}};k=zf.prototype; +k.Oa=function(a,b,c,d){this.G=b;this.b=c;this.C=a;(a=Dc(a,"messages"))&&Cf(this,a);this.Jb=Ff;Gf(this,function(a){a:{var b=d.G.N,c=a[0],e=a=0,l=b.length;if(c){a=d.Z(Hf(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.G.$;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Jb[c],n&&d.i(p(n.id,8)+" %"+p(e<>>c.$].Ob(d&c.f,d),this.g--,b&&If(a,b));return c}; +k.Ia=function(a,b){var c=65535,d=this.Z(a,!1,2);-1!==d&&(this.g++,c=Kb(this.G,d),this.g--,b&&If(a,b));return c};k.Sb=function(a,b,c){var d=this.Z(a,!0,1);if(-1!==d){this.g++;var e=this.G;e.N[(d&e.g)>>>e.$].Cb(d&e.f,b&255,d);this.g--;c&&If(a,c);N(this.b,!0)}};k.ob=function(a,b,c){var d=this.Z(a,!0,2);if(-1!==d){this.g++;var e=this.G,f=d&e.f,g=(d&e.g)>>>e.$;f!=e.f?e.N[g].rc(f,b&65535,d):(e.N[g++].Cb(f,b&255,d),e.N[g&e.C].Cb(0,b>>8&255,d+1));this.g--;c&&If(a,c);N(this.b,!0)}}; +function Z(a){return{A:a,Ha:!1}}function Jf(a){return[a.A,a.Ha]}function Kf(a){return{A:a[0],Ha:a[1]}}function Hf(a,b,c){var d;c=(c?a.S:a.pb).A;if(void 0!==b){d=b=vf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.Ac=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Pa[a-8]:20>a?b=this.b.za[a-16]:20==a&&(b=Tb(this.b)));return b}; +k.message=function(a,b){this.g||(b&&(a+=" @"+J(this,Z(this.b.u[7]).A)),this.ka&1073741824?this.Aa.push(a):this.ya&&a==this.ya||(this.ya=a,this.ka&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,hd(a),a.la=0,N(a))))}; +function Bf(a){var b;if(Jd(a)){if(!a.O||!a.O.length){a.O=Array(1E3);for(b=0;b>>d.$],!1)}a.X=["br"];if(a.F)for(b=1;b>>d.$],!0);a.F=["bw"];a.Db=0} +k.hb=function(a,b,c){var d=!0;c||Rf(this,a,b,!1,!0);if(a!=this.f){var e=this.Z(b);if(-1===e)this.i("invalid address: "+J(this,b.A)),d=!1;else{var f=this.G;f.N[e>>>f.$].hb(e&f.f,a==this.F)}}d&&(a.push(b),c?b.Ha=!0:(Sf(this,a,a.length-1,"set"),Bf(this)));return d};function Rf(a,b,c,d,e){var f=!1;c=a.Z(c);for(var g=1;g>>d.$],b==a.F));h.Ha||Bf(a);break}}return f} +function Tf(a,b){for(var c=1;c>23)&65535,v=J(u,q);else if(8192==A)q=q.A-((f&63)<<1)&65535,v=J(u,q);else if(12288==A)v=J(u,f&7,1);else if(24576==A)v=J(u,f&63,1);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:v=Mf(z);break;case 8:v="@"+Mf(z);break;case 16:7>z?v="("+Mf(z)+ +")+":(A=u.Ia(q,2),v="#"+J(u,A,0,!0));break;case 24:7>z?v="@("+Mf(z)+")+":(A=u.Ia(q,2),v="@#"+J(u,A,0,!0));break;case 32:v="-("+Mf(z)+")";break;case 40:v="@-("+Mf(z)+")";break;case 48:A=u.Ia(q,2);v=J(u,A,0,!0)+"("+Mf(z)+")";7==z&&(v=[v,J(u,A+q.A&65535)]);break;case 56:A=u.Ia(q,2),v="@"+J(u,A)+"("+Mf(z)+")",7==z&&(v=[v,J(u,A+q.A&65535)])}u=v;if(!u||!u.length){h="INVALID";break}"string"!=typeof u&&(l=u[1],u=u[0]);0b?(c=Mf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Pa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.za[b-16]):20==b&&(c="PS="+J(a,Tb(d)));c&&(c+=" ");return c}function Yf(a){var b,c="";for(b=0;6>b;b++)c+=Xf(a,b);c=c+"\n"+(Xf(a,6)+Xf(a,7)+Xf(a,20));return c+=Wf(a,"T")+Wf(a,"N")+Wf(a,"Z")+Wf(a,"V")+Wf(a,"C")}k.vc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Tc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}N(d);a.i("updated registers:")}a.i(Yf(a));c&&(a.S=Z(d.u[7]),Pf(a,J(a,a.S.A)))}}function cg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Vf(a,b,g,f);a.i(f);a.S=b;e-=b.A-l;c++}}} +function Uf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.da&&(a.i("ended assemble at "+J(a,a.ca.A)),a.S=a.ca,a.da=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ya=null;if(ib(a)&&0n||"z"ja.length&&(a.i("note: only "+ja.length+" available"),X=ja.length);ba-=X;0>ba&&(null==ja[ja.length-1].A?(X=ba+X,ba=0):ba+=ja.length);var Pc=[];"call"==ze&&(lb=1E5,Pc=["CALL"]);for(void 0!==ye&&a.i(X+" instructions earlier:");0=ja.length&&(ba=0);a.Gb=X;Be++;lb--}}Be||(a.i("no "+Ae+"history available"),a.Gb=void 0)}else{var Yb=Hf(a,ia);if(Yb){var Zb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),Zb=wf(a,za)>>>0,65536>4||1;yg--&&0<$b;){var ob=0,Qc=0,pb,Rc="",Ee="",ia=J(a,Yb.A);for(pb=4==Ra?16:a.ea;0ac?String.fromCharCode(ac):".";$b--}nb&&(nb+="\n");nb+=ia+" "+Rc+(0==pb?" "+Ee:"")}nb&&a.i(nb);a.pb=Yb}}}}break;case "e":if("else"==g[0])break;var Sa,Sc,Tc,Uc,Vc=g[0],Wc=g[1];"eb"==Vc?(Sa=1,Sc=255,Tc=a.kb,Uc=a.Sb):"e"==Vc||"ew"==Vc?(Sa=2,Sc=65535,Tc=a.Ia,Uc=a.ob):Wc=null;if(null==Wc)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var bc=Hf(a,Wc);if(bc)for(var cc=2;ccZc;){for(var Aa=null,Cg=256;65536>sb.A>>>0;){$c.A=a.Ia(sb,2);if(null==sb.A||!Cg--)break;if(!($c.A&1)){for(var Dg=a,dc=$c,Ge=null,tb=dc.A, +He=tb,ad=1;6>=ad&&tb;ad++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bhg){if(jg(d,this.I)){this.B=new O(this,"1.30.0","failsafe");jg(this.B)&&(og(this,d),a=2,pg(this.B));this.B.set("timestamp",sa());qg(this.B);var e=this.f&&!this.F;if(1==a||va("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== +f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.g=null)):this.i(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.I;delete this.O}e=cb(this.id);for(f=0;fa[1];a=a[2];this.ha=!0;this.v.ia=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(rg(this,this.b,b,c,a),this.b.Fb());this.ba&&(og(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0}; +function og(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 c=a.g||"";b=b.toString();var d={app:"PDP11js",ver:"1.30.0"};d.url=a.url;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} +function eg(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new O(a,"1.30.0"),g=new O(a,"1.30.0","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.ja(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var h=cb(a.id),l=0;lf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Jg(a,b,c)}})}else c(a,null)} +function Kg(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ma(a))}function f(a){e("Error: "+a);l&&(--vg||Ta(!0));l=!1}var g,h,l=!0;vg++;ab[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| +(c="/versions/pdp11/1.30.0/components.xsl");m=function(d,h){h?Hg(c,null,null,!1,e,function(d,l){l?(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--vg||Ta(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--vg||Ta(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Hg(b,a,d,!0,e,m):Ig(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(q){f(q.message)}return l}window.embedPDP11=function(a,b,c,d){Ta(!1);return Kg(a,b,c,d)};window.enableEvents=Ta;window.sendEvent=Ua;})(); diff --git a/versions/pdp11/1.30.0/pdp11.js b/versions/pdp11/1.30.0/pdp11.js index 424914bcf..9d4f9f6e5 100644 --- a/versions/pdp11/1.30.0/pdp11.js +++ b/versions/pdp11/1.30.0/pdp11.js @@ -9,150 +9,151 @@ typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encod function r(a){window&&window.alert(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}var ma=null;function na(){if(null==ma){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}ma=a}return ma}function oa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} function pa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function qa(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:[]},ra=!1,sa=!1,ta=!0;function ua(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 va(a){if(ta)try{for(var b=0;bb?this.gb=this.id:(this.yb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Nc:!1,Oc:!1,N:!1,error:!1};this.ob=null;this.i.error=!1;this.A={};this.K=null;x.push(this)}var ya=void 0,za={}; +function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Nb=b.comment;this.fc=b;b=this.id.indexOf(".");0>b?this.gb=this.id:(this.yb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Nc:!1,Oc:!1,N:!1,error:!1};this.ob=null;this.i.error=!1;this.v={};this.J=null;x.push(this)}var ya=void 0,za={}; if(window){ya||(ya=window.location.search.substr(1));for(var Aa,Ba=/\+/g,Ca=/([^&=]+)=?([^&]*)/g;Aa=Ca.exec(ya);)za[decodeURIComponent(Aa[1].replace(Ba," "))]=decodeURIComponent(Aa[2].replace(Ba," "))}function Da(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=v);a.prototype=Da(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Ea=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else Ea={},x=[];function Fa(a,b,c){Ea[a]&&b&&(Ea[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.c&&(this.c=10);15>2;this.h=this.g-1;this.m=this.o/this.g|0;this.H=this.m-1;this.qa=[];this.s=null;this.Ya=this.I;a=new G;Ma(a,this.K);this.b=Array(this.m);for(b=0;b>8:f[2](b)&255):b&1&&(f=d.qa[a&-2])&&f[2]&&(c=f[2](b&-2)>>8);return 0<=c?c:c=d.Ya(b|4186112,-1,1)} +k.Y=function(a,b,c,d){return this.w&&this.w.Y(a,b,c,d)||this.a&&this.a.Y(a,b,c,d)?!0:this.parent.Y.call(this,a,b,c,d)};k.wa=function(a,b,c,d){this.w=a;this.B=b;this.a=c;this.J=d};k.la=function(a,b){b||Ka();return!0};k.ka=function(){return!0};k.Sa=function(){};function Ka(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c>1)+2;10>this.c&&(this.c=10);15>2;this.h=this.g-1;this.m=this.o/this.g|0;this.H=this.m-1;this.qa=[];this.w=null;this.Ya=this.K;a=new G;Ma(a,this.J);this.b=Array(this.m);for(b=0;b>8:f[2](b)&255):b&1&&(f=d.qa[a&-2])&&f[2]&&(c=f[2](b&-2)>>8);return 0<=c?c:c=d.Ya(b|4186112,-1,1)} function Oa(a,b,c){var d=!1,f=this.controller,e=f.qa[a];if(e)if(e[1])e[1](b,c),d=!0;else{if(e[3]){a=e[2]?e[2](c):0;if(c&1)e[3](a&255|b<<8,c&-2);else e[3](a&-256|b,c);d=!0}}else c&1&&(e=f.qa[a&-2])&&e[3]&&(c&=-2,a=e[2]?e[2](c):0,e[3](a&255|b<<8,c),d=!0);d||f.Ya(c|4186112,b,1)}function Pa(a,b){var c=-1,d=this.controller;(a=d.qa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=d.Ya(b|4186112,-1,0)} -function Qa(a,b,c){var d=!1,f=this.controller;if(a=f.qa[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||f.Ya(c|4186112,b,0)}La.prototype.reset=function(){this.s&&this.s()};La.prototype.I=function(){return 0};La.prototype.la=function(a,b){b||this.reset();return!0}; -function Ra(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.c;0g&&(q=g);if(l&&l.size){if(l.type==d&&l.controller==f){if(e+g<=l.Ua)return l.vb+=l.Ua-e,l.Ua=e,!0;if(e>=l.Ua+l.vb){q=l.size-(e-m);q>g&&(q=g);l.vb=e-l.Ua+q;e=m+a.g;g-=q;h++;continue}}return Ta(1,e,g)}e=new G(e,q,a.g,d,f);Ma(e,a.K,l);a.b[h++]=e;e=m+a.g;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Ua[d]+" at "+n(b,8,!0)),!0):Ta(2,b,c)}function Va(a,b){return a.b[(b&a.j)>>>a.c].$a(b&a.h,b)} +function Qa(a,b,c){var d=!1,f=this.controller;if(a=f.qa[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||f.Ya(c|4186112,b,0)}La.prototype.reset=function(){this.w&&this.w()};La.prototype.K=function(){return 0};La.prototype.la=function(a,b){b||this.reset();return!0}; +function Ra(a,b,c,d,f){for(var e=b,g=c,h=e>>>a.c;0g&&(q=g);if(l&&l.size){if(l.type==d&&l.controller==f){if(e+g<=l.Ua)return l.vb+=l.Ua-e,l.Ua=e,!0;if(e>=l.Ua+l.vb){q=l.size-(e-m);q>g&&(q=g);l.vb=e-l.Ua+q;e=m+a.g;g-=q;h++;continue}}return Ta(1,e,g)}e=new G(e,q,a.g,d,f);Ma(e,a.J,l);a.b[h++]=e;e=m+a.g;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Ua[d]+" at "+n(b,8,!0)),!0):Ta(2,b,c)}function Va(a,b){return a.b[(b&a.j)>>>a.c].$a(b&a.h,b)} function Wa(a,b,c){var d=b&a.h,f=(b&a.j)>>>a.c;d!=a.h?a.b[f].Jc(d,c&65535,b):(a.b[f++].Ta(d,c&255,b),a.b[f&a.H].Ta(0,c>>8&255,b+1))}function Xa(a){for(var b=0,c=[],d=0;d>5&3;c.ib=a>>1&15;c.pb=a&257?a&1?6:4:0;db(c);a=c.I;a&1|256&&(b=this.a.La&16?1:2);this.c.Oa=this.c.Oa&-8|b};k.mc=function(){return eb(this.a)};k.Gc=function(a){fb(this.a,a&-1809|eb(this.a)&1808);this.a.l|=128}; -function gb(a){var b=a.g,c,d,f,e=b.W>>13&7;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.sc,drive:e,blocksize:256,mapped:0,maxblock:b.Ja[e]*b.J[e],url:"rk"+e+".dsk"});b.C&=-129;switch(b.C>>1&7){case 0:b.bb=2496;b.P=0;b.C=128;b.W=0;break;case 1:if((b.W>>4&511)>=b.Ja[e]){b.P|=32832;b.C|=49152;break}if((b.W&15)>=b.J[e]){b.P|=32800;b.C|=49152;break}c=(b.W>>4&511)*b.J[e]+(b.W&15);d=(b.C&48)<<12|b.ab;f=65536-b.cb&65535;hb(a,b.T[e],c,d,f);return;case 2:if((b.W>>4&511)>=b.Ja[e])b.P|=32832, -b.C|=49152;else if((b.W&15)>=b.J[e])b.P|=32800,b.C|=49152;else{c=(b.W>>4&511)*b.J[e]+(b.W&15);d=(b.C&48)<<12|b.ab;f=65536-b.cb&65535;a.sb(b.T[e],c,d,f);return}}b.bb=e<<13|b.bb&8176|b.W%9&15;I(a.a,20,5,144,function(){b.C=b.C&65534|128;return!!(b.C&64)})}k.sc=function(a,b,c,d,f){var e=this.g;e.ab=d&65535;e.C=e.C&-49|d>>12&48;e.cb=65536-f&65535;switch(a){case 1:e.P|=33024;e.C|=49152;break;case 2:e.P|=33792,e.C|=49152}I(this.a,20,5,144,function(){e.C=e.C&65534|128;return!!(e.C&64)})}; -function ib(a){var b=a.h,c,d,f,e=b.w>>8&3;b.w&=-2;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.tc,drive:e,blocksize:128,mapped:1,maxblock:b.Ja[e]*b.J[e],url:"rl"+e+".dsk"});switch(b.w>>1&7){case 2:b.ya&8&&(b.w&=63);b.ya=b.ac[e]|b.Ca&64;break;case 3:1==(b.L&3)&&(b.Ca=b.L&4?b.Ca+(b.L&65408)&65408|b.L<<2&64:b.Ca-(b.L&65408)&65408|b.L<<2&64,b.L=b.Ca);break;case 4:b.ya=b.Ca;break;case 5:if(b.L>>6>=b.Ja[e]){b.w|=37888;break}if((b.L&63)>=b.J[e]){b.w|=37888;break}c=(b.L>>6)*b.J[e]+(b.L&63); -d=(b.ra&63)<<16|b.Xa;f=65536-b.ya&65535;hb(a,b.T[e],c,d,f);return;case 6:if(b.L>>6>=b.Ja[e])b.w|=37888;else if((b.L&63)>=b.J[e])b.w|=37888;else{c=(b.L>>6)*b.J[e]+(b.L&63);d=(b.ra&63)<<16|b.Xa;f=65536-b.ya&65535;a.sb(b.T[e],c,d,f);return}}I(a.a,20,5,112,function(){b.w|=129;return!!(b.w&64)})} -k.tc=function(a,b,c,d,f){var e=this.h;e.Xa=d&65535;e.w=e.w&-49|d>>12&48;e.ra=d>>16&63;e.L=~~(c/e.J[b.ja])<<6|c%e.J[b.ja];e.Ca=e.L;e.ya=65536-f&65535;switch(a){case 1:e.w|=33792;break;case 2:e.w|=40960}I(this.a,20,5,112,function(){e.w|=129;return!!(e.w&64)})};function jb(a){a=a.j;a.G=2176;a.ba=0;a.V=[4544,4544,4544,4544,4544,4544,4544,4544];a.Qa=[0,0,0,0,0,0,0,0];a.Na=a.Ra=a.Pa=a.Ba=a.Gb=0} -function kb(a,b){var c=a.j,d,f,e;c.G&=-16513;c.ba&=-2049;c.V[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.uc,drive:b,blocksize:256,mapped:0,maxblock:c.wb[0]*c.Ia[0]*c.J[0],url:"rp"+b+".dsk"});switch(c.G&63){case 5:c.ub[b]=c.ma[b];c.G|=32896;c.V[b]|=32896;c.Na|=1<=c.wb[0]||c.ca[b]>>8>=c.Ia[0]||(c.ca[b]&255)>=c.J[0]){c.Qa[b]|=1024;c.G|=49152;break}d=(c.ma[b]*c.Ia[0]+(c.ca[b]>>8))*c.J[0]+ -(c.ca[b]&255);f=(c.Ba&63)<<16|c.Pa;e=65536-c.Ra&65535;hb(a,c.T[b],d,f,e);return;case 57:if(c.ma[b]>=c.wb[0]||c.ca[b]>>8>=c.Ia[0]||(c.ca[b]&255)>=c.J[0])c.Qa[b]|=1024,c.G|=49152;else{d=(c.ma[b]*c.Ia[0]+(c.ca[b]>>8))*c.J[0]+(c.ca[b]&255);f=(c.Ba&63)<<16|c.Pa;e=65536-c.Ra&65535;a.sb(c.T[b],d,f,e);return}}I(a.a,3,5,172,function(){c.G=c.G&65534|128;c.V[b]|=128;return!!(c.G&64)})} -k.uc=function(a,b,c,d,f){var e=this.j;e.Ra=65536-f&65535;e.Pa=d&65535;e.G=e.G&-769|d>>8&768;e.Ba=d>>16&63;f=~~(c/e.J[0]);d=~~(f/e.Ia[0]);e.ca[b.ja]=f%e.Ia[0]<<8|c%e.J[0];e.ub[b.ja]=e.ma[b.ja]=d;e.Na|=1<=b.ic-1&&(e.V[b.ja]|=1024);switch(a){case 1:e.ba|=512;e.G|=49152;break;case 2:e.ba|=2048,e.G|=49152}I(this.a,20,5,172,function(){e.V[b.ja]|=128;e.G=e.G&65534|128;return!!(e.G&64)})}; -function lb(a,b,c,d,f,e){var g=~~((e+c.sa-1)/c.sa),h=new XMLHttpRequest;2048>g&&d+2048g){b.Db(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.Db(0,b,c,d,f)}k.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.xa=0;this.g.C=128;this.h.w=128;jb(this)}; -k.$b=function(a,b,c){var d,f,e=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.Aa&65280:(a&1&&(b<<=8),e.Aa=b|255,d=0);break;case 4194298:if(0>b)d=e.Fb;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.Fb=d;e.l|=2}break;case 4194294:if(70!==e.Ka)return K(e,4);0>b?d=e.u:d=e.u=0;break;case 4194292:if(70!==e.Ka)return K(e,4);d=1;break;case 4194290:if(70!==e.Ka)return K(e,4);d=0;break;case 4194288:if(70!==e.Ka)return K(e,4);d=61183;break;case 4194296:0<=b&&!(a&1)&&(b&= -255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==e.Ka)return K(e,4);f=a-4194272>>1;0>b?d=e.Bb[f]:(d=J(this,e.Bb[f],a,b,c),0<=d&&(e.Bb[f]=d));break;case 4194254:return a&1?e.B>>14&1?(0<=b&&(e.f[6]=b),d=e.f[6]):(0<=b&&(e.da[3]=b),d=e.da[3]):e.B>>14&0?(0<=b&&(e.f[6]=b),d=e.f[6]):(0<=b&&(e.da[1]=b),d=e.da[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.B&2048?(0<=b&&(e.f[f]=b),d=e.f[f]):(0<=b&&(e.Ma[f]=b),d=e.Ma[f]),d;case 4194246:return a& -1?(0<=b&&(e.f[7]=b),d=e.f[7]):e.B>>14&0?(0<=b&&(e.f[6]=b),d=e.f[6]):(0<=b&&(e.da[0]=b),d=e.da[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.B&2048?(0<=b&&(e.Ma[f]=b),d=e.Ma[f]):(0<=b&&(e.f[f]=b),d=e.f[f]),d;default:return e.u|=16,K(e,4)}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:switch(a&-2){case 4194174:d=J(this,e.tb,a,b,c);0<=d&&(e.tb=d);break;case 4194172:d=e.za;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194168:0> -b?d=this.c.Cc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;default:return e.u|=16,K(e,4)}break;case 4194048:f=this.g;switch(a&-2){case 4194048:d=J(this,f.bb,a,b,c);0<=d&&(f.bb=d);break;case 4194050:d=J(this,f.P,a,b,c);0<=d&&(f.P=d);break;case 4194052:d=J(this,f.C,a,b,c);0<=b&&0<=d&&(f.C=d&-36993|f.C&36992,f.C&1&&gb(this));break;case 4194054:d=J(this,f.cb,a,b,c);0<=d&&(f.cb=d);break;case 4194056:d=J(this,f.ab,a,b,c);0<=d&&(f.ab=d);break;case 4194058:d=J(this,f.W,a,b,c);0<=d&&(f.W= -d);break;case 4194060:break;case 4194062:d=J(this,f.Tb,a,b,c);0<=d&&(f.Tb=d);break;default:return e.u|=16,K(e,4)}break;case 4193728:var g=this.j;f=g.ba&7;switch(a&-2){case 4193728:d=J(this,g.G,a,b,c);0<=b&&0<=d&&(g.Ba=g.Ba&60|d>>8&3,g.G=d&17279|g.G&34944|2048,d&1&&g.G&128?kb(this,f):192==(d&192)&&I(e,0,5,172));break;case 4193730:d=J(this,g.Ra,a,b,c);0<=d&&(g.Ra=d);break;case 4193732:d=J(this,g.Pa,a,b,c);0<=d&&(g.Pa=d&65534);break;case 4193734:d=J(this,g.ca[f],a,b,c);0<=d&&(g.ca[f]=d&7967);break;case 4193736:d= +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];k=H.prototype;k.wa=function(a,b,c,d){this.B=b;this.a=c;this.J=d;var f=this;this.b.Hb=ab(this.a,function(){f.b.xa|=128;f.b.xa&64&&(I(f.a,0,6,64),bb(f.a,f.b.Hb))});Ya(b,this,cb);Za(b,this.reset.bind(this),this.$b.bind(this));F(this)};k.kc=function(){var a=this.b.xa;this.b.xa&=-129;return a}; +k.Ec=function(a){this.b.xa=a;a&64&&bb(this.a,this.b.Hb);this.b.xa=a&-129};k.lc=function(){var a=this.a;return a.G&62337|a.hb<<5|a.ib<<1};k.Fc=function(a){var b=4,c=this.a;c.G=a&=62337;c.hb=a>>5&3;c.ib=a>>1&15;c.pb=a&257?a&1?6:4:0;db(c);a=c.G;a&1|256&&(b=this.a.La&16?1:2);this.c.Oa=this.c.Oa&-8|b};k.mc=function(){return eb(this.a)};k.Gc=function(a){fb(this.a,a&-1809|eb(this.a)&1808);this.a.l|=128}; +function gb(a){var b=a.g,c,d,f,e=b.X>>13&7;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.sc,drive:e,blocksize:256,mapped:0,maxblock:b.Ja[e]*b.I[e],url:"rk"+e+".dsk"});b.D&=-129;switch(b.D>>1&7){case 0:b.bb=2496;b.P=0;b.D=128;b.X=0;break;case 1:if((b.X>>4&511)>=b.Ja[e]){b.P|=32832;b.D|=49152;break}if((b.X&15)>=b.I[e]){b.P|=32800;b.D|=49152;break}c=(b.X>>4&511)*b.I[e]+(b.X&15);d=(b.D&48)<<12|b.ab;f=65536-b.cb&65535;hb(a,b.T[e],c,d,f);return;case 2:if((b.X>>4&511)>=b.Ja[e])b.P|=32832, +b.D|=49152;else if((b.X&15)>=b.I[e])b.P|=32800,b.D|=49152;else{c=(b.X>>4&511)*b.I[e]+(b.X&15);d=(b.D&48)<<12|b.ab;f=65536-b.cb&65535;a.sb(b.T[e],c,d,f);return}}b.bb=e<<13|b.bb&8176|b.X%9&15;I(a.a,20,5,144,function(){b.D=b.D&65534|128;return!!(b.D&64)})}k.sc=function(a,b,c,d,f){var e=this.g;e.ab=d&65535;e.D=e.D&-49|d>>12&48;e.cb=65536-f&65535;switch(a){case 1:e.P|=33024;e.D|=49152;break;case 2:e.P|=33792,e.D|=49152}I(this.a,20,5,144,function(){e.D=e.D&65534|128;return!!(e.D&64)})}; +function ib(a){var b=a.h,c,d,f,e=b.u>>8&3;b.u&=-2;"undefined"===typeof b.T[e]&&(b.T[e]={cache:[],postProcess:a.tc,drive:e,blocksize:128,mapped:1,maxblock:b.Ja[e]*b.I[e],url:"rl"+e+".dsk"});switch(b.u>>1&7){case 2:b.ya&8&&(b.u&=63);b.ya=b.ac[e]|b.Ca&64;break;case 3:1==(b.L&3)&&(b.Ca=b.L&4?b.Ca+(b.L&65408)&65408|b.L<<2&64:b.Ca-(b.L&65408)&65408|b.L<<2&64,b.L=b.Ca);break;case 4:b.ya=b.Ca;break;case 5:if(b.L>>6>=b.Ja[e]){b.u|=37888;break}if((b.L&63)>=b.I[e]){b.u|=37888;break}c=(b.L>>6)*b.I[e]+(b.L&63); +d=(b.ra&63)<<16|b.Xa;f=65536-b.ya&65535;hb(a,b.T[e],c,d,f);return;case 6:if(b.L>>6>=b.Ja[e])b.u|=37888;else if((b.L&63)>=b.I[e])b.u|=37888;else{c=(b.L>>6)*b.I[e]+(b.L&63);d=(b.ra&63)<<16|b.Xa;f=65536-b.ya&65535;a.sb(b.T[e],c,d,f);return}}I(a.a,20,5,112,function(){b.u|=129;return!!(b.u&64)})} +k.tc=function(a,b,c,d,f){var e=this.h;e.Xa=d&65535;e.u=e.u&-49|d>>12&48;e.ra=d>>16&63;e.L=~~(c/e.I[b.ja])<<6|c%e.I[b.ja];e.Ca=e.L;e.ya=65536-f&65535;switch(a){case 1:e.u|=33792;break;case 2:e.u|=40960}I(this.a,20,5,112,function(){e.u|=129;return!!(e.u&64)})};function jb(a){a=a.j;a.F=2176;a.ba=0;a.V=[4544,4544,4544,4544,4544,4544,4544,4544];a.Qa=[0,0,0,0,0,0,0,0];a.Na=a.Ra=a.Pa=a.Ba=a.Gb=0} +function kb(a,b){var c=a.j,d,f,e;c.F&=-16513;c.ba&=-2049;c.V[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.uc,drive:b,blocksize:256,mapped:0,maxblock:c.wb[0]*c.Ia[0]*c.I[0],url:"rp"+b+".dsk"});switch(c.F&63){case 5:c.ub[b]=c.ma[b];c.F|=32896;c.V[b]|=32896;c.Na|=1<=c.wb[0]||c.ca[b]>>8>=c.Ia[0]||(c.ca[b]&255)>=c.I[0]){c.Qa[b]|=1024;c.F|=49152;break}d=(c.ma[b]*c.Ia[0]+(c.ca[b]>>8))*c.I[0]+ +(c.ca[b]&255);f=(c.Ba&63)<<16|c.Pa;e=65536-c.Ra&65535;hb(a,c.T[b],d,f,e);return;case 57:if(c.ma[b]>=c.wb[0]||c.ca[b]>>8>=c.Ia[0]||(c.ca[b]&255)>=c.I[0])c.Qa[b]|=1024,c.F|=49152;else{d=(c.ma[b]*c.Ia[0]+(c.ca[b]>>8))*c.I[0]+(c.ca[b]&255);f=(c.Ba&63)<<16|c.Pa;e=65536-c.Ra&65535;a.sb(c.T[b],d,f,e);return}}I(a.a,3,5,172,function(){c.F=c.F&65534|128;c.V[b]|=128;return!!(c.F&64)})} +k.uc=function(a,b,c,d,f){var e=this.j;e.Ra=65536-f&65535;e.Pa=d&65535;e.F=e.F&-769|d>>8&768;e.Ba=d>>16&63;f=~~(c/e.I[0]);d=~~(f/e.Ia[0]);e.ca[b.ja]=f%e.Ia[0]<<8|c%e.I[0];e.ub[b.ja]=e.ma[b.ja]=d;e.Na|=1<=b.ic-1&&(e.V[b.ja]|=1024);switch(a){case 1:e.ba|=512;e.F|=49152;break;case 2:e.ba|=2048,e.F|=49152}I(this.a,20,5,172,function(){e.V[b.ja]|=128;e.F=e.F&65534|128;return!!(e.F&64)})}; +function lb(a,b,c,d,f,e){var g=~~((e+c.sa-1)/c.sa),h=new XMLHttpRequest;2048>g&&d+2048g){b.Db(2,b,c,d,f);return}b.cache[c][e]=g;d+=2;--f}c++}b.Db(0,b,c,d,f)}k.reset=function(){this.c.Oa=this.c.Oa&-120|20;this.b.xa=0;this.g.D=128;this.h.u=128;jb(this)}; +k.$b=function(a,b,c){var d,f,e=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=e.Aa&65280:(a&1&&(b<<=8),e.Aa=b|255,d=0);break;case 4194298:if(0>b)d=e.Fb;else{a&1&&(b<<=8);if(d=b&65024){f=d>>9;do d+=34;while(f>>=1)}e.Fb=d;e.l|=2}break;case 4194294:if(70!==e.Ka)return K(e,4);0>b?d=e.s:d=e.s=0;break;case 4194292:if(70!==e.Ka)return K(e,4);d=1;break;case 4194290:if(70!==e.Ka)return K(e,4);d=0;break;case 4194288:if(70!==e.Ka)return K(e,4);d=61183;break;case 4194296:0<=b&&!(a&1)&&(b&= +255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==e.Ka)return K(e,4);f=a-4194272>>1;0>b?d=e.Bb[f]:(d=J(this,e.Bb[f],a,b,c),0<=d&&(e.Bb[f]=d));break;case 4194254:return a&1?e.C>>14&1?(0<=b&&(e.f[6]=b),d=e.f[6]):(0<=b&&(e.ea[3]=b),d=e.ea[3]):e.C>>14&0?(0<=b&&(e.f[6]=b),d=e.f[6]):(0<=b&&(e.ea[1]=b),d=e.ea[1]),d;case 4194252:case 4194250:case 4194248:return f=a&7,e.C&2048?(0<=b&&(e.f[f]=b),d=e.f[f]):(0<=b&&(e.Ma[f]=b),d=e.Ma[f]),d;case 4194246:return a& +1?(0<=b&&(e.f[7]=b),d=e.f[7]):e.C>>14&0?(0<=b&&(e.f[6]=b),d=e.f[6]):(0<=b&&(e.ea[0]=b),d=e.ea[0]),d;case 4194244:case 4194242:case 4194240:return f=a&7,e.C&2048?(0<=b&&(e.Ma[f]=b),d=e.Ma[f]):(0<=b&&(e.f[f]=b),d=e.f[f]),d;default:return e.s|=16,K(e,4)}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:switch(a&-2){case 4194174:d=J(this,e.tb,a,b,c);0<=d&&(e.tb=d);break;case 4194172:d=e.za;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194168:0> +b?d=this.c.Cc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;default:return e.s|=16,K(e,4)}break;case 4194048:f=this.g;switch(a&-2){case 4194048:d=J(this,f.bb,a,b,c);0<=d&&(f.bb=d);break;case 4194050:d=J(this,f.P,a,b,c);0<=d&&(f.P=d);break;case 4194052:d=J(this,f.D,a,b,c);0<=b&&0<=d&&(f.D=d&-36993|f.D&36992,f.D&1&&gb(this));break;case 4194054:d=J(this,f.cb,a,b,c);0<=d&&(f.cb=d);break;case 4194056:d=J(this,f.ab,a,b,c);0<=d&&(f.ab=d);break;case 4194058:d=J(this,f.X,a,b,c);0<=d&&(f.X= +d);break;case 4194060:break;case 4194062:d=J(this,f.Tb,a,b,c);0<=d&&(f.Tb=d);break;default:return e.s|=16,K(e,4)}break;case 4193728:var g=this.j;f=g.ba&7;switch(a&-2){case 4193728:d=J(this,g.F,a,b,c);0<=b&&0<=d&&(g.Ba=g.Ba&60|d>>8&3,g.F=d&17279|g.F&34944|2048,d&1&&g.F&128?kb(this,f):192==(d&192)&&I(e,0,5,172));break;case 4193730:d=J(this,g.Ra,a,b,c);0<=d&&(g.Ra=d);break;case 4193732:d=J(this,g.Pa,a,b,c);0<=d&&(g.Pa=d&65534);break;case 4193734:d=J(this,g.ca[f],a,b,c);0<=d&&(g.ca[f]=d&7967);break;case 4193736:d= J(this,g.ba,a,b,c);0<=d&&(g.ba=d&63|g.ba&65472,d&128&&jb(this));break;case 4193738:d=g.V[f];break;case 4193740:d=g.Qa[f];break;case 4193742:d=J(this,g.Na,a,b,c);0<=d&&(g.Na=d&255);break;case 4193744:d=g.zc[f];break;case 4193746:d=J(this,g.Ub,a,b,c);0<=d&&(g.Ub=d);break;case 4193748:d=J(this,g.Vb[f],a,b,c);0<=d&&(g.Vb[f]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.Ac[f];break;case 4193754:d=J(this,g.Wb[f],a,b,c);0<=d&&(g.Wb[f]=d);break;case 4193756:d=J(this,g.ma[f],a,b,c);0<=d&&(g.ma[f]= -d&511);break;case 4193758:g.ub[f]=g.ma[f];d=g.ub[f];break;case 4193760:d=g.xc[f];break;case 4193762:d=g.yc[f];break;case 4193764:d=g.vc[f];break;case 4193766:d=g.wc[f];break;case 4193768:d=J(this,g.Ba,a,b,c);0<=d&&(g.Ba=d&63,g.G=g.G&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Gb,a,b,c);0<=d&&(g.Gb=d);break;default:return e.u|=16,K(e,4)}break;case 4192512:f=this.h;switch(a&-2){case 4192512:d=J(this,f.w,a,b,c);0<=b&&0<=d&&(f.ra=f.ra&60|d>>4&3,f.w=f.w&-1023|d&1022,f.w&128||ib(this));break;case 4192514:d= -J(this,f.Xa,a,b,c);0<=d&&(f.Xa=d&65534);break;case 4192516:d=J(this,f.L,a,b,c);0<=d&&(f.L=d);break;case 4192518:d=J(this,f.ya,a,b,c);0<=d&&(f.ya=d);break;case 4192520:d=J(this,f.ra,a,b,c);0<=d&&(f.ra=d&63,f.w=f.w&-49|(f.ra&3)<<4);break;default:return e.u|=16,K(e,4)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.La:(d=J(this,e.La,a,b,c),0<=d&&(70!==e.Ka&&(d&=-49),e.La=d,e.qb[0]=d&4?15:7,e.qb[1]=d&2?15:7,e.qb[3]=d&1?15:7,e.pb&&(f=2,e.La&16&&(f=1),this.c.Oa=this.c.Oa&-8|f)));break;default:return e.u|= +d&511);break;case 4193758:g.ub[f]=g.ma[f];d=g.ub[f];break;case 4193760:d=g.xc[f];break;case 4193762:d=g.yc[f];break;case 4193764:d=g.vc[f];break;case 4193766:d=g.wc[f];break;case 4193768:d=J(this,g.Ba,a,b,c);0<=d&&(g.Ba=d&63,g.F=g.F&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Gb,a,b,c);0<=d&&(g.Gb=d);break;default:return e.s|=16,K(e,4)}break;case 4192512:f=this.h;switch(a&-2){case 4192512:d=J(this,f.u,a,b,c);0<=b&&0<=d&&(f.ra=f.ra&60|d>>4&3,f.u=f.u&-1023|d&1022,f.u&128||ib(this));break;case 4192514:d= +J(this,f.Xa,a,b,c);0<=d&&(f.Xa=d&65534);break;case 4192516:d=J(this,f.L,a,b,c);0<=d&&(f.L=d);break;case 4192518:d=J(this,f.ya,a,b,c);0<=d&&(f.ya=d);break;case 4192520:d=J(this,f.ra,a,b,c);0<=d&&(f.ra=d&63,f.u=f.u&-49|(f.ra&3)<<4);break;default:return e.s|=16,K(e,4)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=e.La:(d=J(this,e.La,a,b,c),0<=d&&(70!==e.Ka&&(d&=-49),e.La=d,e.qb[0]=d&4?15:7,e.qb[1]=d&2?15:7,e.qb[3]=d&1?15:7,e.pb&&(f=2,e.La&16&&(f=1),this.c.Oa=this.c.Oa&-8|f)));break;default:return e.s|= 16,K(e,4)}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.Ka)return K(e,4);f=a>>2&31;d=e.eb[f];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(e.eb[f]=a&2?d<<16|e.eb[f]&65535:e.eb[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=$a[a>>1&255];else return e.u|=16,K(e,4);break;default:return e.u|=16,K(e,4)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var ob={},cb=(ob[65382]=[null,null,H.prototype.kc,H.prototype.Ec,"LKS"],ob[65402]=[null,null,H.prototype.lc,H.prototype.Fc,"MMR0"],ob[65534]=[null,null,H.prototype.mc,H.prototype.Gc,"PSW"],ob);u(function(){for(var a=D(document,"pdp11","device"),b=0;b>1&255];else return e.s|=16,K(e,4);break;default:return e.s|=16,K(e,4)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var ob={},cb=(ob[65382]=[null,null,H.prototype.kc,H.prototype.Ec,"LKS"],ob[65402]=[null,null,H.prototype.lc,H.prototype.Fc,"MMR0"],ob[65534]=[null,null,H.prototype.mc,H.prototype.Gc,"PSW"],ob);u(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.c,0,c>>2),vb(this,rb?wb:xb);else{this.a=Array(c>>2);for(a=0;a>1),this.a=new Int32Array(this.c,0,c>>2),vb(this,rb?wb:xb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Z:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ha:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ua=!0},I:function(a,b){return this.R(a,b)},ea:function(a,b){return this.fa(a, -b)},na:function(a,b,c){this.A||this.Zb(a,b,c)},Ea:function(a,b,c){this.A||this.Fa(a,b,c)},H:function(a){return this.b[a]},S:function(a){return this.b[a]},$:function(a){return this.g.getUint16(a,!0)},ga:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.m[a>>1]},ia:function(a,b){this.b[a]=b;this.ua=!0},oa:function(a,b){this.b[a]=b;this.ua=!0},Da:function(a,b){this.g.setUint16(a,b,!0);this.ua=!0},Ga:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.m[a>>1]=b;this.ua=!0}}; -function Ma(a,b,c){a.K=b;a.h=a.j=0;c&&((a.h=c.h)&&zb(a,Ab,!1),(a.j=c.j)&&Bb(a,Ab,!1))}function Bb(a,b,c){c&&a.j||(a.Ta=!a.A&&b[1]||a.v,a.Jc=!a.A&&b[3]||a.F);if(c||void 0===c)a.Zb=b[1]||a.v,a.Fa=b[3]||a.F}function zb(a,b,c){c&&a.h||(a.$a=b[0]||a.o,a.pc=b[2]||a.s);if(c||void 0===c)a.R=b[0]||a.o,a.fa=b[2]||a.s}function vb(a,b){b||(b=Cb);zb(a,b,void 0);Bb(a,b,void 0)}var Cb=[],yb=[G.prototype.Z,G.prototype.pa,G.prototype.ha,G.prototype.Ha],Ab=[G.prototype.I,G.prototype.na,G.prototype.ea,G.prototype.Ea]; -if(Ia)var xb=[G.prototype.H,G.prototype.ia,G.prototype.$,G.prototype.Da],wb=[G.prototype.S,G.prototype.oa,G.prototype.ga,G.prototype.Ga];function Db(a,b){v.call(this,"CPU",a,Db);var c=a.multiplier||1;this.mb=a.cycles||b;this.ha=c;this.zb=Math.round(this.mb/1E4)/100;this.na=this.zb*this.ha;this.i.aa=!1;this.i.Xb=!1;this.i.Wa=a.autoStart;this.i.Jb=!1;this.i.nb=!1;this.kb=this.oa=0;this.lb=a.csStart;this.Ea=a.csInterval;this.Fa=a.csStop;this.R=[];this.Sb=this.Bc.bind(this);E(this)}y(Db); -var Eb=["power","reset"];k=Db.prototype;k.wa=function(a,b,c,d){this.F=a;this.D=b;this.K=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)}} -k.X=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.F)if(a=d.F,a.i.N)a=!0;else{var b=null,c,h=z(a.id);for(c=0;ca.fa/a.na&&(b=1),a.ha=b,b=a.zb*a.ha,a.na!=b)){a.na=b;b=a.na.toFixed(2)+"Mhz";var c=a.A.setSpeed;c&&(c.textContent=b);a.U("target speed: "+b)}Nb(a,a.$);a.$=0;a.Z=ja();a.ga=0;Ob(a)}function ab(a,b){var c=a.R.length;a.R.push([-1,b]);return c}function bb(a,b){var c;0<=b&&ba.R[b][0]&&(c=a.mb*a.ha/1E3*(1E3/60),a.R[b][0]=c)} -k.Bc=function(){if(this.i.aa){this.Cb>=this.mb&&Ob(this,!0);this.Ha=0;this.jb=ja();if(this.ga){var a=this.jb-this.ga;a>this.Pb&&(this.Z+=a,this.Z>this.jb&&(this.Z=this.jb))}try{do{for(var b,c=this.i.nb?1:this.fb,d=this.R.length-1;0<=d;d--){var f=this.R[d];0>f[0]||c>f[0]&&(c=f[0])}b=c;try{this.Yb(b)}catch(m){if("number"!=typeof m)throw m;}for(var e=this.S-this.a,a=e,g=this.R.length-1;0<=g;g--){var h=this.R[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ha+=e;this.$+=e;Nb(this,0,!0);a=e;if(this.i.nb){var l= -!1;this.kb=this.kb+this.Ob()|0;this.oa-=a;0>=this.oa&&(this.oa+=this.Ea,l=!0);0<=this.Fa&&this.Fa<=Pb(this)&&(this.Ea=this.Fa=-1,Hb(this),Lb(this),l=!0);l&&this.U(Pb(this)+" cycles: checksum="+n(this.kb))}this.Ga-=e;if(0>=this.Ga){this.Ga+=this.fb;15<=++this.Qb&&(this.F&&this.F.Sa(),this.Qb=0);break}}while(this.i.aa)}catch(m){Lb(this);Ib(this);this.F&&this.F.stop(ja(),Pb(this));b=m.stack||m.message;this.i.error=!0;this.M(b);return}if(this.i.aa){b=setTimeout;c=this.Sb;this.ga=ja();d=this.Pb;this.Ha&& -(d=Math.round(d*this.Ha/this.fb));d-=this.ga-this.jb;if(f=this.ga-this.Z)this.fa=Math.round(this.$/(10*f))/100,864E5<=f&&(this.ia=0,Mb(this));if(0>d||this.fad&&(this.Z-=d),d=0;this.Cb+=this.Ha;this.ga+=d;b(c,d)}}};function Jb(a){var b;a.i.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.aa)a.U(a.toString()+" busy");else{Mb(a);a.i.aa=!0;a.i.Xb=!0;a.Da&&a.Da.start();if(b=a.A.run)b.textContent="Halt";a.F&&a.F.start(a.Z,Pb(a));Ib(a,!0);setTimeout(a.Sb,0)}}k.Yb=function(){return 0}; -function Lb(a){if(a.i.aa){a.S-=a.a;a.a=0;Nb(a,a.$);a.$=0;a.i.aa=!1;a.Da&&a.Da.stop();var b=a.A.run;b&&(b.textContent="Run");a.F&&a.F.stop(ja(),Pb(a));Ib(a)}a.i.complete=void 0}function Ib(a,b){a.F&&a.F.Sa(b)} -function Qb(a){this.gc=a.resetAddr||0;Db.call(this,a,6666667);this.Mb=0;this.decode=Rb.bind(this);this.m=65536;this.g=32768;this.h=65535;this.s=32768;this.B=15;this.f=[0,0,0,0,0,0,0,this.gc];this.Ma=[0,0,0,0,0,0];this.da=[0,0,0,0];this.ib=this.H=0;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.eb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.Bb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.o=this.b=this.j=this.c=this.xb=this.l=0;this.Ka=70;this.pa=-1;Sb(this);this.i.complete=this.i.bc=!1}y(Qb,Db);k=Qb.prototype;k.reset=function(){this.i.aa&&Lb(this);Sb(this);Gb(this);this.i.error=!1;this.parent.reset.call(this)}; -function Sb(a){a.Aa=255;a.u=0;a.Fb=0;a.I=0;a.za=0;a.tb=0;a.La=0;a.pb=0;a.hb=0;a.qb=[7,7,7,7];a.v=[];a.l|=2;db(a)}function db(a){a.pb?(a.Lb=65536,a.ea=a.ec):(a.Lb=0,a.ea=a.dc)}k.Ob=function(){return 0};k.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.ia,this.ha]);a.set(2,Xa(this.D));return a.data()}; -k.restore=function(a){var b=a[1];this.ia=b[1];Mb(this,b[3]);a:{b=this.D;a=a[2];var c;for(c=0;cb){a.v[e].ta-=b;break}b-=a.v[e].ta}a.v.splice(e+1,0,{delay:b,priority:c<<5&224,vector:d,callback:f})}a.l|=2}function eb(a){return a.B=a.B&63728|a.va()|(a.h&65535?0:4)|(a.g&32768?2:0)|M(a)} -function fb(a,b){a.s=b<<12;a.h=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ma.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ma[c];a.Ma[c]=d}a.H=b>>14&3;c=a.B>>14&3;a.H!=c&&(a.da[c]=a.f[6],a.f[6]=a.da[a.H]);a.l|=2;a.B=b}function O(a,b){a.l&128||(a.s=a.h=b,a.g=0)}function P(a,b,c){a.l&128||(a.s=a.h=a.m=b,a.g=c||0)}function Ub(a,b,c,d){a.l&128||(a.s=a.h=a.m=b,a.g=(c^b)&(d^b))}function Q(a,b){a.l&128||(a.s=a.h=a.m=b,a.g=a.s^a.m>>1)}function Vb(a,b,c,d){a.l&128||(a.s=a.h=a.m=b,a.g=(c^d)&(d^b))} -function K(a,b){var c=!1;0>a.pa?a.pa=eb(a):a.H||(b=4,c=!0);a.I&57344||(a.za=63222,a.tb=b);a.H=0;var d=N(a,b|65536),f=N(a,b+2&65535|65536);fb(a,f&-12289|a.pa>>2&12288);c&&(a.u|=4,a.f[6]=4);Wb(a,a.pa);Wb(a,a.f[7]);a.f[7]=d&65535;a.l&=-113;a.pa=-1;throw b;}function Xb(a){var b=Yb(a),c=Yb(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);a.f[7]=b&65535;fb(a,c);a.l&=-17} +G.prototype={constructor:G,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ia)for(a=Array(this.size>>2),b=0;b>8,c)},W:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ha:function(a){var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ua=!0},K:function(a,b){return this.R(a,b)},da:function(a,b){return this.fa(a, +b)},na:function(a,b,c){this.v||this.Zb(a,b,c)},Ea:function(a,b,c){this.v||this.Fa(a,b,c)},H:function(a){return this.b[a]},S:function(a){return this.b[a]},$:function(a){return this.g.getUint16(a,!0)},ga:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.m[a>>1]},ia:function(a,b){this.b[a]=b;this.ua=!0},oa:function(a,b){this.b[a]=b;this.ua=!0},Da:function(a,b){this.g.setUint16(a,b,!0);this.ua=!0},Ga:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.m[a>>1]=b;this.ua=!0}}; +function Ma(a,b,c){a.J=b;a.h=a.j=0;c&&((a.h=c.h)&&zb(a,Ab,!1),(a.j=c.j)&&Bb(a,Ab,!1))}function Bb(a,b,c){c&&a.j||(a.Ta=!a.v&&b[1]||a.A,a.Jc=!a.v&&b[3]||a.G);if(c||void 0===c)a.Zb=b[1]||a.A,a.Fa=b[3]||a.G}function zb(a,b,c){c&&a.h||(a.$a=b[0]||a.o,a.pc=b[2]||a.w);if(c||void 0===c)a.R=b[0]||a.o,a.fa=b[2]||a.w}function vb(a,b){b||(b=Cb);zb(a,b,void 0);Bb(a,b,void 0)}var Cb=[],yb=[G.prototype.W,G.prototype.pa,G.prototype.ha,G.prototype.Ha],Ab=[G.prototype.K,G.prototype.na,G.prototype.da,G.prototype.Ea]; +if(Ia)var xb=[G.prototype.H,G.prototype.ia,G.prototype.$,G.prototype.Da],wb=[G.prototype.S,G.prototype.oa,G.prototype.ga,G.prototype.Ga];function Db(a,b){v.call(this,"CPU",a,Db);var c=a.multiplier||1;this.mb=a.cycles||b;this.ha=c;this.zb=Math.round(this.mb/1E4)/100;this.na=this.zb*this.ha;this.i.aa=!1;this.i.Xb=!1;this.i.Wa=a.autoStart;this.i.Jb=!1;this.i.nb=!1;this.kb=this.oa=0;this.lb=a.csStart;this.Ea=a.csInterval;this.Fa=a.csStop;this.R=[];this.Sb=this.Bc.bind(this);F(this)}y(Db); +var Eb=["power","reset"];k=Db.prototype;k.wa=function(a,b,c,d){this.w=a;this.B=b;this.J=d;for(b=0;b>=3;d=""+f}else d=n(c,d);else d="--------".substr(0,d||4);a.v[b].textContent!=d&&(a.v[b].textContent=d)}} +k.Y=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.v[b]=c;a=!0;break;case "run":this.v[b]=c;c.onclick=function(){var a;if(a=d.w)if(a=d.w,a.i.N)a=!0;else{var b=null,c,h=z(a.id);for(c=0;ca.fa/a.na&&(b=1),a.ha=b,b=a.zb*a.ha,a.na!=b)){a.na=b;b=a.na.toFixed(2)+"Mhz";var c=a.v.setSpeed;c&&(c.textContent=b);a.U("target speed: "+b)}Nb(a,a.da);a.da=0;a.$=ja();a.ga=0;Ob(a)}function ab(a,b){var c=a.R.length;a.R.push([-1,b]);return c}function bb(a,b){var c;0<=b&&ba.R[b][0]&&(c=a.mb*a.ha/1E3*(1E3/60),a.R[b][0]=c)} +k.Bc=function(){if(this.i.aa){this.Cb>=this.mb&&Ob(this,!0);this.Ha=0;this.jb=ja();if(this.ga){var a=this.jb-this.ga;a>this.Pb&&(this.$+=a,this.$>this.jb&&(this.$=this.jb))}try{do{for(var b,c=this.i.nb?1:this.fb,d=this.R.length-1;0<=d;d--){var f=this.R[d];0>f[0]||c>f[0]&&(c=f[0])}b=c;try{this.Yb(b)}catch(m){if("number"!=typeof m)throw m;}for(var e=this.W-this.a,a=e,g=this.R.length-1;0<=g;g--){var h=this.R[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ha+=e;this.da+=e;Nb(this,0,!0);a=e;if(this.i.nb){var l= +!1;this.kb=this.kb+this.Ob()|0;this.oa-=a;0>=this.oa&&(this.oa+=this.Ea,l=!0);0<=this.Fa&&this.Fa<=Pb(this)&&(this.Ea=this.Fa=-1,Hb(this),Lb(this),l=!0);l&&this.U(Pb(this)+" cycles: checksum="+n(this.kb))}this.Ga-=e;if(0>=this.Ga){this.Ga+=this.fb;15<=++this.Qb&&(this.w&&this.w.Sa(),this.Qb=0);break}}while(this.i.aa)}catch(m){Lb(this);Ib(this);this.w&&this.w.stop(ja(),Pb(this));b=m.stack||m.message;this.i.error=!0;this.M(b);return}if(this.i.aa){b=setTimeout;c=this.Sb;this.ga=ja();d=this.Pb;this.Ha&& +(d=Math.round(d*this.Ha/this.fb));d-=this.ga-this.jb;if(f=this.ga-this.$)this.fa=Math.round(this.da/(10*f))/100,864E5<=f&&(this.ia=0,Mb(this));if(0>d||this.fad&&(this.$-=d),d=0;this.Cb+=this.Ha;this.ga+=d;b(c,d)}}};function Jb(a){var b;a.i.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.aa)a.U(a.toString()+" busy");else{Mb(a);a.i.aa=!0;a.i.Xb=!0;a.Da&&a.Da.start();if(b=a.v.run)b.textContent="Halt";a.w&&a.w.start(a.$,Pb(a));Ib(a,!0);setTimeout(a.Sb,0)}}k.Yb=function(){return 0}; +function Lb(a){if(a.i.aa){a.W-=a.a;a.a=0;Nb(a,a.da);a.da=0;a.i.aa=!1;a.Da&&a.Da.stop();var b=a.v.run;b&&(b.textContent="Run");a.w&&a.w.stop(ja(),Pb(a));Ib(a)}a.i.complete=void 0}function Ib(a,b){a.w&&a.w.Sa(b)} +function Qb(a){this.gc=a.resetAddr||0;Db.call(this,a,6666667);this.Mb=0;this.decode=Rb.bind(this);this.j=65536;this.g=32768;this.h=65535;this.m=32768;this.C=15;this.f=[0,0,0,0,0,0,0,this.gc];this.Ma=[0,0,0,0,0,0];this.ea=[0,0,0,0];this.ib=this.A=0;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.eb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.Bb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.c=this.b=this.xb=this.H=this.K=this.l=0;this.Ka=70;this.pa=-1;Sb(this);this.i.complete=this.i.bc=!1}y(Qb,Db);k=Qb.prototype;k.reset=function(){this.i.aa&&Lb(this);Sb(this);Gb(this);this.i.error=!1;this.parent.reset.call(this)}; +function Sb(a){a.Aa=255;a.s=0;a.Fb=0;a.G=0;a.za=0;a.tb=0;a.La=0;a.pb=0;a.hb=0;a.qb=[7,7,7,7];a.o=[];a.l|=2;db(a)}function db(a){a.pb?(a.Lb=65536,a.S=a.ec):(a.Lb=0,a.S=a.dc)}k.Ob=function(){return 0};k.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.ia,this.ha]);a.set(2,Xa(this.B));return a.data()}; +k.restore=function(a){var b=a[1];this.ia=b[1];Mb(this,b[3]);a:{b=this.B;a=a[2];var c;for(c=0;cb){a.o[e].ta-=b;break}b-=a.o[e].ta}a.o.splice(e+1,0,{delay:b,priority:c<<5&224,vector:d,callback:f})}a.l|=2}function eb(a){return a.C=a.C&63728|a.va()|(a.h&65535?0:4)|(a.g&32768?2:0)|M(a)} +function fb(a,b){a.m=b<<12;a.h=~b&4;a.g=b<<14;a.j=b<<16;if((b^a.C)&2048)for(var c=a.Ma.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ma[c];a.Ma[c]=d}a.A=b>>14&3;c=a.C>>14&3;a.A!=c&&(a.ea[c]=a.f[6],a.f[6]=a.ea[a.A]);a.l|=2;a.C=b}function O(a,b){a.l&128||(a.m=a.h=b,a.g=0)}function P(a,b,c){a.l&128||(a.m=a.h=a.j=b,a.g=c||0)}function Ub(a,b,c,d){a.l&128||(a.m=a.h=a.j=b,a.g=(c^b)&(d^b))}function Q(a,b){a.l&128||(a.m=a.h=a.j=b,a.g=a.m^a.j>>1)}function Vb(a,b,c,d){a.l&128||(a.m=a.h=a.j=b,a.g=(c^d)&(d^b))} +function K(a,b){var c=!1;0>a.pa?a.pa=eb(a):a.A||(b=4,c=!0);a.G&57344||(a.za=63222,a.tb=b);a.A=0;var d=N(a,b|65536),f=N(a,b+2&65535|65536);fb(a,f&-12289|a.pa>>2&12288);c&&(a.s|=4,a.f[6]=4);Wb(a,a.pa);Wb(a,a.f[7]);a.f[7]=d&65535;a.l&=-113;a.pa=-1;throw b;}function Xb(a){var b=Yb(a),c=Yb(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);a.f[7]=b&65535;fb(a,c);a.l&=-17} function mb(a,b){var c=b>>13&31;31>c?a.La&32&&(b=a.eb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function Zb(a,b,c){var d,f,e,g=0;if(c&a.pb){d=b>>13&a.qb[a.H];f=a.O[a.H][d];e=(a.O[a.H][d+16]<<6)+(b&8191)&4194303;a.La&16?3932160<=e&&4186112>e&&(e=mb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.u|=32,K(a,4)),e&1&&!(c&1)&&(a.u|=64,K(a,4)));switch(f&7){case 1:g=4096;case 2:f|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:f|=c&4?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2&8128)&&(g|= -16384));a.O[a.H][d]=f;if(4194170!==e||a.H)a.hb=a.H,a.ib=d;g&&(g&57344&&(0<=a.pa&&(g|=128),a.I&57344||(a.I=a.I|g|a.hb<<5|a.ib<<1),K(a,168)),a.I&61440||!(4191360>e||4194239>>a.c;return c!=a.h?a.b[d].pc(c,b):a.b[d++].$a(c,b)|a.b[d&a.H].$a(0,b+1)<<8}function N(a,b){return nb(a,Zb(a,b,2))} -function Yb(a){var b=N(a,a.f[6]|65536);a.f[6]=a.f[6]+2&65535;return b}function Wb(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.I&57344||(a.za=a.za<<8|246);!a.H&&c<=a.Aa&&4>3&7;b&=7;c&4?(a.c=g,a.b=b):(a.j=g,a.o=b);switch(g){case 0:return K(a,4),0;case 1:return 6===b&&!a.H&&c&4&&(a.f[6]<=a.Aa||65534<=a.f[6])&&(a.f[6]<=a.Aa-32||65534<=a.f[6]?(a.u|=4,a.f[6]=4,K(a,4)):(a.u|=8,a.l|=64)),a.a-=3,7===b?a.f[b]:a.f[b]|e;case 2:f=2;d=a.f[b];7!==b&&(d|=e,6>b&&c&1&&(f=1));a.a-=3;break;case 3:f=2;d=a.f[b];7!==b&&(d|=e);d=N(a,d);d|=e;a.a-=7;break;case 4:f=-2;6>b&&c&1&&(f=-1);d=a.f[b]+f&65535;7!==b&&(d|=e);a.a-=4;break;case 5:f=-2;d=a.f[b]- -2&65535;7!==b&&(d|=e);d=N(a,d)|e;a.a-=8;break;case 6:return d=Tb(a),d=d+a.f[b]&65535|e,a.a-=6,d;case 7:return d=Tb(a),d=d+a.f[b]&65535,d=N(a,d|65536)|e,a.a-=10,d}a.f[b]=a.f[b]+f&65535;!e||a.I&57344||(a.za=a.za<<8|f<<3&248|b);6==b&&!a.H&&c&4&&0>=f&&(a.f[6]<=a.Aa||65534<=a.f[6])&&(a.f[6]<=a.Aa-32?(a.u|=4,a.f[6]=4,K(a,4)):(a.u|=8,a.l|=64));return d}k.dc=function(a,b){return $b(this,a,b)};k.ec=function(a,b){return Zb(this,$b(this,a,b),b)}; -function ac(a,b,c){b&56?(b=$b(a,b,2),c&65536||61440!==(a.B&61440)&&(b&=65535),a.H=a.B>>12&3,c=N(a,b|c&65536),a.H=a.B>>14&3):(a.j=0,c=a.o=b&7,c=6!=c||(a.B>>2&12288)===(a.B&12288)?a.f[c]:a.da[a.B>>12&3]);return c}function bc(a,b,c,d){a.I&57344||(a.za=22);b&56?(b=$b(a,b,4),c&65536||(b&=65535),a.H=a.B>>12&3,b=Zb(a,b|c&65536,4),a.H=a.B>>14&3,Wa(a.D,b,d&65535)):(a.c=0,c=a.b=b&7,6!=c||(a.B>>2&12288)===(a.B&12288)?a.f[c]=d:a.da[a.B>>12&3]=d)} -function R(a,b){b&56?a=nb(a,a.ea(b,2)):(a.j=0,a=a.f[a.o=b&7]);return a}function S(a,b){b&56?(b=a.ea(b,3),a=Va(a.D,b)):(a.j=0,a=a.f[a.o=b&7]&255);return a}function T(a,b,c,d){b&56?(b=a.ea(b,6),c=d.call(a,c,nb(a,b)),Wa(a.D,b,c&65535)):(a.c=0,b=a.b=b&7,a.f[b]=d.call(a,c,a.f[b]))}function U(a,b,c,d){b&56?(b=a.xb=a.ea(b,7),c=d.call(a,c,Va(a.D,b)),b&1&&a.a--,a=a.D,a.b[(b&a.j)>>>a.c].Ta(b&a.h,c&255,b)):(a.c=0,b=a.b=b&7,a.f[b]=a.f[b]&65280|d.call(a,c,a.f[b]))} -function cc(a,b,c){b&56?(b=a.ea(b,4),Wa(a.D,b,c&65535)):(a.c=0,a.f[a.b=b&7]=c&65535);return c}function dc(a,b,c,d){b&56?(d=a.ea(b,5),d&1&&a.a--,a=a.D,a.b[(d&a.j)>>>a.c].Ta(d&a.h,c&255,d)):(a.c=0,b=a.b=b&7,a.f[b]=c?d&1?c<<24>>24&65535:a.f[b]&-256|c&255:a.f[b]&-256);return c}function V(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} -k.Yb=function(a){this.i.complete=!0;this.i.bc=!1;this.i.Xb=!1;this.S=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?K(this,168):this.l&64?K(this,4):this.l&16&&K(this,12),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;a=null;for(var b=this.Fb&224,c=this.v.length;0<=--c;){if(0b&&(b=this.v[c].jc,a=this.v[c],this.v.splice(c,1))}b>(this.B&224)&&(this.l&4&&(this.f[7]= -this.f[7]+2&65535,this.l&=-5),a?K(this,a.Dc):K(this,160))}else this.l&1&&this.l++;this.I&57344||(this.za=0,this.tb=this.f[7]);this.l=this.l&7|this.B&16;this.decode(Tb(this))}while(0>1|b<<16;Q(this,a);return a&65535}function jc(a,b){a=b&2048|b>>1|b<<8;Q(this,a<<8);return a&255}function kc(a,b){a=b&~a;O(this,a);return a}function lc(a,b){a=b&~a;O(this,a<<8);return a}function mc(a,b){a|=b;O(this,a);return a}function nc(a,b){a|=b;O(this,a<<8);return a}function oc(a,b){a=~b|65536;P(this,a);return a&65535} -function pc(a,b){a=~b|256;P(this,a<<8);return a&255}function qc(a,b){a=b-a;this.l&128||(this.s=this.h=a,this.g=b&(b^a));return a&65535}function rc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.s=this.h=c,this.g=b&(b^c));return a&255}function sc(a,b){a=b+a;this.l&128||(this.s=this.h=a,this.g=a&(b^a));return a&65535}function tc(a,b){a=b+a;var c=a<<8;this.l&128||(this.s=this.h=c,this.g=c&(b<<8^c));return a&255}function uc(a,b){a=-b;P(this,a,a&b&32768);return a&65535} -function vc(a,b){a=-b;P(this,a<<8,(a&b&128)<<8);return a&255}function wc(a,b){a=b<<1|this.m>>16&1;Q(this,a);return a&65535}function xc(a,b){a=b<<1|this.m>>16&1;Q(this,a<<8);return a&255}function yc(a,b){a=(this.m&65536|b)>>1|b<<16;Q(this,a);return a&65535}function zc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Q(this,a<<8);return a&255}function Ac(a,b){var c=b-a;Vb(this,c,a,b);return c&65535}function Bc(a,b){var c=b-a;Vb(this,c<<8,a<<8,b<<8);return c&255} -function Cc(a,b){this.l&128||(this.s=this.h=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Dc(a,b){a^=b;O(this,a);return a&65535}function Ec(a){var b=R(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.h=c;this.a-=(this.j?6:7)+b} -function Fc(a){var b=R(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.h=d>>16|d;this.a-=(this.j?6:7)+b}function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.s=0);this.a-=5} -function Gc(a){var b=R(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.s=d>>16):(this.g=32768,this.h=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.s=0,this.g=32768,this.m=65536,this.a-=7}var Hc=[0,7,7,10,7,11,9,13];function Ic(a){var b=this.a;a=$b(this,a,8);this.f[7]=a&65535;this.a=b-Hc[this.j]} -var Jc=[0,14,14,17,14,18,16,20];function Kc(a){var b=this.a,c=$b(this,a,8);a=a>>6&7;Wb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Jc[this.j]}var Lc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Mc=[7,13,13,17,14,18,17,21];function Nc(a){var b=R(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.s=b>>16,this.h=this.s|b,this.g=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Qc(a){T(this,a,0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)}function Rc(a){T(this,a,R(this,(a&448)>>6),Dc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8)}function Rb(a){Sc[a>>12].call(this,a)} -var Sc=[function(a){Tc[a>>8&15].call(this,a)},function(a){var b=R(this,a>>6),c=this.a;O(this,cc(this,a,b));this.a=c-Lc[(this.j?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=R(this,a>>6),c=this.j,d=this.o;a=R(this,a);Vb(this,b-a,a,b);this.a-=this.j?4+(d&&6<=this.o?1:0):(c?4:3)+(7==this.o?2:0)},function(a){var b=R(this,a>>6),c=this.j,d=this.o;a=R(this,a);O(this,b&a);this.a-=this.j?4+(d&&6<=this.o?1:0):(c?4:3)+(7==this.o?2:0)},function(a){T(this,a,R(this,a>>6),kc);this.a-=this.c?9+(this.o&& -6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},function(a){T(this,a,R(this,a>>6),mc);this.a-=this.c?9+(this.o&&6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},function(a){T(this,a,R(this,a>>6),ec);this.a-=this.c?9+(this.o&&6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},function(a){Uc[a>>8&15].call(this,a)},function(a){Vc[a>>8&15].call(this,a)},function(a){var b=S(this,a>>6);O(this,dc(this,a,b,1)<<8);this.a-=this.c?9+(this.o&&6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},function(a){var b=S(this,a>>6)<<8, -c=this.j,d=this.o;a=S(this,a)<<8;Vb(this,b-a,a,b);this.a-=this.j?4+(d&&6<=this.o?1:0):(c?4:3)+(7==this.o?2:0)},function(a){var b=S(this,a>>6),c=this.j,d=this.o;a=S(this,a);O(this,(b&a)<<8);this.a-=this.j?4+(d&&6<=this.o?1:0):(c?4:3)+(7==this.o?2:0)},function(a){U(this,a,S(this,a>>6),lc);this.a-=this.c?9+(this.o&&6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},function(a){U(this,a,S(this,a>>6),nc);this.a-=this.c?9+(this.o&&6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},function(a){T(this,a,R(this,a>>6), -Ac);this.a-=this.c?9+(this.o&&6<=this.b?1:0):(this.j?5:3)+(7==this.b?2:0)},Y],Tc=[function(a){Wc[a>>4&15].call(this,a)},function(a){V(this,a,!0)},function(a){V(this,a,!!(this.h&65535))},function(a){V(this,a,this.h&65535?0:4)},function(a){V(this,a,!this.va()==!(this.g&32768))},function(a){V(this,a,!this.va()!=!(this.g&32768))},function(a){V(this,a,!!(this.h&65535)&&!this.va()==!(this.g&32768))},function(a){V(this,a,(this.h&65535?0:4)||!this.va()!=!(this.g&32768))},Kc,Kc,function(a){Xc[a>>6&3].call(this, -a)},function(a){Yc[a>>6&3].call(this,a)},function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>>6&3].call(this,a)},Y,Y],Xc=[function(a){P(this,cc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qc);this.a-=this.c?9:3+(7==this.b?2:0)}],Yc=[function(a){T(this,a,0,uc);this.a-=this.c?11:6},function(a){T(this,a,M(this)?1:0,ec);this.a-=this.c?9:3+(7==this.b? -2:0)},function(a){T(this,a,M(this)?1:0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=R(this,a);P(this,a);this.a-=this.j?4:3+(7==this.o?2:0)}],Zc=[function(a){T(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,gc);this.a-=this.c?9:3+(7==this.b?2:0)}],$c=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=N(this,a|65536);this.f[7]=this.f[5]&65535; -this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=ac(this,a,0);Wb(this,a);O(this,a);this.a-=11},function(a){var b=Yb(this),c=this.a;bc(this,a,0,b);O(this,b);this.a=c-Mc[this.c]},function(a){O(this,cc(this,a,this.va?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Wc=[function(a){ad[a&15].call(this,a)},Y,Y,Y,Ic,Ic,Ic,Ic,function(a){if(a&8)K(this,8);else{var b=Yb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.l|=1), -this.a-=5):K(this,8)},function(a){bd[a&15].call(this,a)},function(a){cd[a&15].call(this,a)},Qc,Qc,Qc,Qc],ad=[function(){this.B&49152?(this.u|=128,K(this,4)):(this.S-=this.a,this.a=0);this.a-=7},function(){this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Xb(this);this.l|=this.B&16;this.a-=13},function(){K(this,12);this.a-=5},function(){K(this,16);this.a-=25},function(){this.B&49152||(Sb(this),this.D.reset());this.a-=667},function(){Xb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],bd=[Oc,function(){this.m= -0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],cd=[Oc,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Uc=[Nc,Nc,Gc,Gc,Ec,Ec,Fc,Fc,Rc,Rc,Y,Y,Y,Y,Pc,Pc],Vc=[function(a){V(this,a,!this.va())},function(a){V(this,a,this.va())},function(a){V(this,a,!M(this)&&!!(this.h&65535))},function(a){V(this,a,M(this)||(this.h& -65535?0:4))},function(a){V(this,a,!(this.g&32768))},function(a){V(this,a,this.g&32768?2:0)},function(a){V(this,a,!M(this))},function(a){V(this,a,M(this))},function(){K(this,24);this.a-=25},function(){K(this,28);this.a-=5},function(a){dd[a>>6&3].call(this,a)},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)},Y,Y],dd=[function(a){P(this,dc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,pc);this.a-=this.c?9:3+(7==this.b? -2:0)},function(a){U(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rc);this.a-=this.c?9:3+(7==this.b?2:0)}],ed=[function(a){U(this,a,0,vc);this.a-=this.c?11:6},function(a){U(this,a,M(this)?1:0,fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,M(this)?1:0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=S(this,a);P(this,a<<8);this.a-=this.j?4:3+(7==this.o?2:0)}],fd=[function(a){U(this,a,0,zc);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){U(this, -a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,jc);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){U(this,a,0,hc);this.a-=this.c?9:3+(7==this.b?2:0)}],gd=[Y,function(a){a=ac(this,a,65536);Wb(this,a);O(this,a);this.a-=11},function(a){var b=Yb(this),c=this.a;bc(this,a,65536,b);O(this,b);this.a=c-Mc[this.c]},Y]; -function hd(a){v.call(this,"ROM",a,hd);this.b=null;this.m=a.addr;this.c=a.size;this.o=a.writable;this.g=a.alias;this.h=a.file;this.s=ba(this.h);if(this.h){a=this.h;var b=ca(this.s);"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){id(c,a,b,e)})}}y(hd);hd.prototype.wa=function(a,b,c,d){this.D=b;this.a=c;this.K=d;jd(this)};hd.prototype.la=function(){this.j&&(this.K&&this.K.a(this.id,this.m,this.c,this.j),delete this.j);return!0}; -hd.prototype.ka=function(){return!0}; -function id(a,b,c,d){if(d)a.M("Unable to load system ROM (error "+d+": "+b+")");else{Fa(a.yb,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,g,h=eval("("+c+")");if(e=h.bytes)a.b=e;else if(e=h.words)for(a.b=Array(2*e.length),g=f=0;f>8&255;else if(e=h.data)for(a.b=Array(4*e.length),g=f=0;f>8&255,a.b[g++]=e[f]>>16&255,a.b[g++]=e[f]>>24&255;else a.b=h;a.j=h.symbols;if(!a.b.length){r("Empty ROM: "+b); -return}if(1==a.b.length){r(a.b[0]);return}}catch(l){a.M("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),f=0;f>>d.c].Zb(f&d.h,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.c;0>>=f.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.gb)return;b=ha(b[1]);if(this.j=Ga(b)){var d=this.j.exports;if(d){var f=d.connect;f&&f.call(this.j);if(this.m=d.receiveData){this.status(this.yb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.la=function(a,b){if(!b)if(this.Rb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.ka=function(a){return a?this.save():!0};k.reset=function(){this.b.rb=0;this.b.Y=128};k.save=function(){var a=new L(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.Eb=function(a){if("number"==typeof a)this.o.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(b);var d=c.length;32>b&&1==d&&(d=0);9==b&&(b=a.v||8,d=b-a.h%b,a.v&&(c=" ".slice(0,d)));a.s&&!a.h&&d&&(c=String.fromCharCode(a.s)+c);a.c.value+=c;a.c.scrollTop=a.c.scrollHeight;a.h+=d}else if(null!=a.g){if(10==b||1024<=a.g.length)a.U(a.g),a.g="";10!=b&&(a.g+=String.fromCharCode(b))}} -var pd={},nd=(pd[65392]=[null,null,Z.prototype.oc,Z.prototype.Ic,"RCSR"],pd[65394]=[null,null,Z.prototype.nc,Z.prototype.Hc,"RBUF"],pd[65396]=[null,null,Z.prototype.rc,Z.prototype.Lc,"XCSR"],pd[65398]=[null,null,Z.prototype.qc,Z.prototype.Kc,"XBUF"],pd);u(function(){for(var a=D(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.U("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bsd){if(ud(d,this.s)){this.j=new L(this,"1.30.0","failsafe");ud(this.j)&&(zd(this,d),a=2,Ad(this.j));this.j.set("timestamp",ka());Bd(this.j);var f=this.b&&!this.m;if(1==a||la("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=yd(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?ud(d,g):("error"== -e&&"no machine state"!=g?(this.M("Error: "+g),"unable to verify user"==g&&(pa("user",""),this.c=null)):this.U(e+": "+g),Ad(d),ud(d)?(c=yd(d),f=!0):c=!1))}f&&xd(this,c?d:null)}else 2==a&&d.clear()}else xd(this);delete this.s;delete this.v}f=z(this.id);for(e=0;ea[1];a=a[2];this.$=!0;this.i.N=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(Cd(this,this.a,b,c,a),this.a.Wa());this.I&&(zd(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; -function zd(a,b){if(la("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.c||"";b=b.toString();var d={app:"PDP11js",ver:"1.30.0"};d.url=a.url;d.user=c;d.type="bug";d.data=b;p("http://www.pcjs.org/api/v1/report",d,!0)}} -function Dd(a,b,c){var d,f="none";if(a.g)return null;a.g--;var e=new L(a,"1.30.0"),g=new L(a,"1.30.0","validate"),h=ka();g.set("timestamp",h);e.set("timestamp",h);e.set("version","1.30.0");e.set("url",window?window.location.href:null);e.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ka&&(c&&Lb(a.a),d=a.a.ka(b,c),"object"===typeof d&&e.set(a.a.id,d),c&&(a.a.i.N=!1,!1===d&&(f=null)));for(var h=z(a.id),l=0;l>13&a.qb[a.A];f=a.O[a.A][d];e=(a.O[a.A][d+16]<<6)+(b&8191)&4194303;a.La&16?3932160<=e&&4186112>e&&(e=mb(a,e&262143)):(e&=262143,253952<=e&&(e|=4186112));3932160>e&&(3915776<=e&&(a.s|=32,K(a,4)),e&1&&!(c&1)&&(a.s|=64,K(a,4)));switch(f&7){case 1:g=4096;case 2:f|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:f|=c&4?192:128;break;default:g=32768}32512!==(f&32520)&&(f&8?f&32512&&(b&8128)<(f>>2&8128)&&(g|=16384):(b&8128)>(f>>2&8128)&&(g|= +16384));a.O[a.A][d]=f;if(4194170!==e||a.A)a.hb=a.A,a.ib=d;g&&(g&57344&&(0<=a.pa&&(g|=128),a.G&57344||(a.G=a.G|g|a.hb<<5|a.ib<<1),K(a,168)),a.G&61440||!(4191360>e||4194239>>a.c;return c!=a.h?a.b[d].pc(c,b):a.b[d++].$a(c,b)|a.b[d&a.H].$a(0,b+1)<<8}function N(a,b){return nb(a,Zb(a,b,2))} +function Yb(a){var b=N(a,a.f[6]|65536);a.f[6]=a.f[6]+2&65535;return b}function Wb(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.G&57344||(a.za=a.za<<8|246);!a.A&&c<=a.Aa&&4c&&d&1&&(e=1));a.a-=3;break;case 3:e=2;f=a.f[c];7!==c&&(f|=g);f=N(a,f);f|=g;a.a-=7;break;case 4:e=-2;6>c&&d&1&&(e=-1);f=a.f[c]+e&65535;7!==c&&(f|=g);a.a-=4;break;case 5:e=-2;f=a.f[c]-2&65535;7!==c&&(f|=g);f=N(a,f)|g;a.a-=8;break; +case 6:return f=Tb(a),f=f+a.f[c]&65535|g,a.a-=6,f;case 7:return f=Tb(a),f=f+a.f[c]&65535,f=N(a,f|65536)|g,a.a-=10,f}a.f[c]=a.f[c]+e&65535;!g||a.G&57344||(a.za=a.za<<8|e<<3&248|c);6==c&&!a.A&&d&4&&0>=e&&(a.f[6]<=a.Aa||65534<=a.f[6])&&(a.f[6]<=a.Aa-32?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.l|=64));return f}k.dc=function(a,b,c){return $b(this,a,b,c)};k.ec=function(a,b,c){return Zb(this,$b(this,a,b,c),c)}; +function ac(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=$b(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.A=a.C>>12&3,c=N(a,d|c&65536),a.A=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.ea[a.C>>12&3];return c}function bc(a,b,c,d){a.G&57344||(a.za=22);var f=a.b=b&7;(b=a.c=(b&56)>>3)?(f=$b(a,b,f,4),c&65536||(f&=65535),a.A=a.C>>12&3,f=Zb(a,f|c&65536,4),a.A=a.C>>14&3,Wa(a.B,f,d&65535)):6!=f||(a.C>>2&12288)===(a.C&12288)?a.f[f]=d:a.ea[a.C>>12&3]=d} +function cc(a,b){b>>=6;var c=a.K=b&7;(b=a.H=(b&56)>>3)?(c=a.S(b,c,3),a=Va(a.B,c)):a=a.f[c]&255;return a}function R(a,b){var c;b>>=6;var d=a.K=b&7;(b=a.H=(b&56)>>3)?c=nb(a,a.S(b,d,2)):c=a.f[d];return c}function dc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return $b(a,b,c,8)}function ec(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.S(b,c,3),a=Va(a.B,c)):a=a.f[c]&255;return a}function S(a,b){var c,d=a.b=b&7;(b=a.c=(b&56)>>3)?c=nb(a,a.S(b,d,2)):c=a.f[d];return c} +function T(a,b,c,d){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(f=a.xb=a.S(b,f,7),c=d.call(a,c,Va(a.B,f)),f&1&&a.a--,a=a.B,a.b[(f&a.j)>>>a.c].Ta(f&a.h,c&255,f)):a.f[f]=a.f[f]&65280|d.call(a,c,a.f[f])}function U(a,b,c,d){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(f=a.S(b,f,6),c=d.call(a,c,nb(a,f)),Wa(a.B,f,c&65535)):a.f[f]=d.call(a,c,a.f[f])} +function fc(a,b,c,d){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,f,5),d&1&&a.a--,a=a.B,a.b[(d&a.j)>>>a.c].Ta(d&a.h,c&255,d)):a.f[f]=c?d&1?c<<24>>24&65535:a.f[f]&-256|c&255:a.f[f]&-256;return c}function gc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,d,4),Wa(a.B,d,c&65535)):a.f[d]=c&65535;return c}function V(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} +k.Yb=function(a){this.i.complete=!0;this.i.bc=!1;this.i.Xb=!1;this.W=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?K(this,168):this.l&64?K(this,4):this.l&16&&K(this,12),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;a=null;for(var b=this.Fb&224,c=this.o.length;0<=--c;){if(0b&&(b=this.o[c].jc,a=this.o[c],this.o.splice(c,1))}b>(this.C&224)&&(this.l&4&&(this.f[7]= +this.f[7]+2&65535,this.l&=-5),a?K(this,a.Dc):K(this,160))}else this.l&1&&this.l++;this.G&57344||(this.za=0,this.tb=this.f[7]);this.l=this.l&7|this.C&16;this.decode(Tb(this))}while(0>1|b<<16;Q(this,a);return a&65535}function mc(a,b){a=b&2048|b>>1|b<<8;Q(this,a<<8);return a&255}function nc(a,b){a=b&~a;O(this,a);return a}function oc(a,b){a=b&~a;O(this,a<<8);return a}function pc(a,b){a|=b;O(this,a);return a}function qc(a,b){a|=b;O(this,a<<8);return a}function rc(a,b){a=~b|65536;P(this,a);return a&65535} +function sc(a,b){a=~b|256;P(this,a<<8);return a&255}function tc(a,b){a=b-a;this.l&128||(this.m=this.h=a,this.g=b&(b^a));return a&65535}function uc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.m=this.h=c,this.g=b&(b^c));return a&255}function vc(a,b){a=b+a;this.l&128||(this.m=this.h=a,this.g=a&(b^a));return a&65535}function wc(a,b){a=b+a;var c=a<<8;this.l&128||(this.m=this.h=c,this.g=c&(b<<8^c));return a&255}function xc(a,b){a=-b;P(this,a,a&b&32768);return a&65535} +function yc(a,b){a=-b;P(this,a<<8,(a&b&128)<<8);return a&255}function zc(a,b){a=b<<1|this.j>>16&1;Q(this,a);return a&65535}function Ac(a,b){a=b<<1|this.j>>16&1;Q(this,a<<8);return a&255}function Bc(a,b){a=(this.j&65536|b)>>1|b<<16;Q(this,a);return a&65535}function Cc(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;Q(this,a<<8);return a&255}function Dc(a,b){var c=b-a;Vb(this,c,a,b);return c&65535}function Ec(a,b){var c=b-a;Vb(this,c<<8,a<<8,b<<8);return c&255} +function Fc(a,b){this.l&128||(this.m=this.h=b&65280,this.g=this.j=0);return(b<<8|b>>8)&65535}function Gc(a,b){a^=b;O(this,a);return a&65535}function Hc(a){var b=S(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.j=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.m=this.h=c;this.a-=(this.c?6:7)+b} +function Ic(a){var b=S(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.m=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function W(a){a&1&&(this.j=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.m=0);this.a-=5} +function Jc(a){var b=S(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.j=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.m=d>>16):(this.g=32768,this.h=d>>15|d,this.m=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.m=0,this.g=32768,this.j=65536,this.a-=7}var Kc=[0,7,7,10,7,11,9,13];function Lc(a){var b=this.a;a=dc(this,a);this.f[7]=a&65535;this.a=b-Kc[this.c]} +var Mc=[0,14,14,17,14,18,16,20];function Nc(a){var b=this.a,c=dc(this,a);a=a>>6&7;Wb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Mc[this.c]}var Oc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Pc=[7,13,13,17,14,18,17,21];function Qc(a){var b=S(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.m=b>>16,this.h=this.m|b,this.g=0,this.j=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Tc(a){U(this,a,0,Fc);this.a-=this.c?9:3+(7==this.b?2:0)}function Uc(a){U(this,a,R(this,a),Gc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8)}function Rb(a){Vc[a>>12].call(this,a)} +var Vc=[function(a){Wc[a>>8&15].call(this,a)},function(a){var b=R(this,a),c=this.a;O(this,gc(this,a,b));this.a=c-Oc[(this.H?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=R(this,a);a=S(this,a);Vb(this,b-a,a,b);this.a-=this.c?4+(this.K&&6<=this.b?1:0):(this.H?4:3)+(7==this.b?2:0)},function(a){O(this,R(this,a)&S(this,a));this.a-=this.c?4+(this.K&&6<=this.b?1:0):(this.H?4:3)+(7==this.b?2:0)},function(a){U(this,a,R(this,a),nc);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b? +2:0)},function(a){U(this,a,R(this,a),pc);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b?2:0)},function(a){U(this,a,R(this,a),hc);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b?2:0)},function(a){Xc[a>>8&15].call(this,a)},function(a){Yc[a>>8&15].call(this,a)},function(a){var b=cc(this,a);O(this,fc(this,a,b,1)<<8);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b?2:0)},function(a){var b=cc(this,a)<<8;a=ec(this,a)<<8;Vb(this,b-a,a,b);this.a-=this.c?4+ +(this.K&&6<=this.b?1:0):(this.H?4:3)+(7==this.b?2:0)},function(a){O(this,(cc(this,a)&ec(this,a))<<8);this.a-=this.c?4+(this.K&&6<=this.b?1:0):(this.H?4:3)+(7==this.b?2:0)},function(a){T(this,a,cc(this,a),oc);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b?2:0)},function(a){T(this,a,cc(this,a),qc);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b?2:0)},function(a){U(this,a,R(this,a),Dc);this.a-=this.c?9+(this.K&&6<=this.b?1:0):(this.H?5:3)+(7==this.b?2:0)},Y],Wc=[function(a){Zc[a>> +4&15].call(this,a)},function(a){V(this,a,!0)},function(a){V(this,a,!!(this.h&65535))},function(a){V(this,a,this.h&65535?0:4)},function(a){V(this,a,!this.va()==!(this.g&32768))},function(a){V(this,a,!this.va()!=!(this.g&32768))},function(a){V(this,a,!!(this.h&65535)&&!this.va()==!(this.g&32768))},function(a){V(this,a,(this.h&65535?0:4)||!this.va()!=!(this.g&32768))},Nc,Nc,function(a){$c[a>>6&3].call(this,a)},function(a){ad[a>>6&3].call(this,a)},function(a){bd[a>>6&3].call(this,a)},function(a){cd[a>> +6&3].call(this,a)},Y,Y],$c=[function(a){P(this,gc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)}],ad=[function(a){U(this,a,0,xc);this.a-=this.c?11:6},function(a){U(this,a,M(this)?1:0,hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,M(this)?1:0,Dc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=S(this, +a);P(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],bd=[function(a){U(this,a,0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,jc);this.a-=this.c?9:3+(7==this.b?2:0)}],cd=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=N(this,a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=ac(this,a,0);Wb(this,a);O(this,a);this.a-=11}, +function(a){var b=Yb(this),c=this.a;bc(this,a,0,b);O(this,b);this.a=c-Pc[this.c]},function(a){O(this,gc(this,a,this.va?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Zc=[function(a){dd[a&15].call(this,a)},Y,Y,Y,Lc,Lc,Lc,Lc,function(a){if(a&8)K(this,8);else{var b=Yb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.C&49152||(this.C=this.C&-2017|(a&7)<<5,this.l|=1),this.a-=5):K(this,8)},function(a){ed[a&15].call(this,a)},function(a){fd[a&15].call(this,a)},Tc,Tc,Tc,Tc], +dd=[function(){this.C&49152?(this.s|=128,K(this,4)):(this.W-=this.a,this.a=0);this.a-=7},function(){this.l|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Xb(this);this.l|=this.C&16;this.a-=13},function(){K(this,12);this.a-=5},function(){K(this,16);this.a-=25},function(){this.C&49152||(Sb(this),this.B.reset());this.a-=667},function(){Xb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],ed=[Rc,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.m= +0;this.a-=5},W,W,W,W,W,W,W],fd=[Rc,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.m=32768;this.a-=5},X,X,X,X,X,X,X],Xc=[Qc,Qc,Jc,Jc,Hc,Hc,Ic,Ic,Uc,Uc,Y,Y,Y,Y,Sc,Sc],Yc=[function(a){V(this,a,!this.va())},function(a){V(this,a,this.va())},function(a){V(this,a,!M(this)&&!!(this.h&65535))},function(a){V(this,a,M(this)||(this.h&65535?0:4))},function(a){V(this,a,!(this.g&32768))},function(a){V(this,a,this.g&32768?2:0)},function(a){V(this, +a,!M(this))},function(a){V(this,a,M(this))},function(){K(this,24);this.a-=25},function(){K(this,28);this.a-=5},function(a){gd[a>>6&3].call(this,a)},function(a){hd[a>>6&3].call(this,a)},function(a){id[a>>6&3].call(this,a)},function(a){jd[a>>6&3].call(this,a)},Y,Y],gd=[function(a){P(this,fc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,uc);this.a-=this.c? +9:3+(7==this.b?2:0)}],hd=[function(a){T(this,a,0,yc);this.a-=this.c?11:6},function(a){T(this,a,M(this)?1:0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,M(this)?1:0,Ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ec(this,a);P(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],id=[function(a){T(this,a,0,Cc);this.a-=this.c?9+(this.xb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,mc);this.a-=this.c?9+(this.xb&1):3+(7==this.b? +2:0)},function(a){T(this,a,0,kc);this.a-=this.c?9:3+(7==this.b?2:0)}],jd=[Y,function(a){a=ac(this,a,65536);Wb(this,a);O(this,a);this.a-=11},function(a){var b=Yb(this),c=this.a;bc(this,a,65536,b);O(this,b);this.a=c-Pc[this.c]},Y]; +function kd(a){v.call(this,"ROM",a,kd);this.b=null;this.m=a.addr;this.c=a.size;this.o=a.writable;this.g=a.alias;this.h=a.file;this.w=ba(this.h);if(this.h){a=this.h;var b=ca(this.w);"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){ld(c,a,b,e)})}}y(kd);kd.prototype.wa=function(a,b,c,d){this.B=b;this.a=c;this.J=d;md(this)};kd.prototype.la=function(){this.j&&(this.J&&this.J.a(this.id,this.m,this.c,this.j),delete this.j);return!0}; +kd.prototype.ka=function(){return!0}; +function ld(a,b,c,d){if(d)a.M("Unable to load system ROM (error "+d+": "+b+")");else{Fa(a.yb,b,c);var f;if("["==c.charAt(0)||"{"==c.charAt(0))try{var e,g,h=eval("("+c+")");if(e=h.bytes)a.b=e;else if(e=h.words)for(a.b=Array(2*e.length),g=f=0;f>8&255;else if(e=h.data)for(a.b=Array(4*e.length),g=f=0;f>8&255,a.b[g++]=e[f]>>16&255,a.b[g++]=e[f]>>24&255;else a.b=h;a.j=h.symbols;if(!a.b.length){r("Empty ROM: "+b); +return}if(1==a.b.length){r(a.b[0]);return}}catch(l){a.M("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),f=0;f>>d.c].Zb(f&d.h,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.c;0>>=f.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.gb)return;b=ha(b[1]);if(this.j=Ga(b)){var d=this.j.exports;if(d){var f=d.connect;f&&f.call(this.j);if(this.m=d.receiveData){this.status(this.yb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.la=function(a,b){if(!b)if(this.Rb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.ka=function(a){return a?this.save():!0};k.reset=function(){this.b.rb=0;this.b.Z=128};k.save=function(){var a=new L(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.Eb=function(a){if("number"==typeof a)this.o.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(b);var d=c.length;32>b&&1==d&&(d=0);9==b&&(b=a.G||8,d=b-a.h%b,a.G&&(c=" ".slice(0,d)));a.A&&!a.h&&d&&(c=String.fromCharCode(a.A)+c);a.c.value+=c;a.c.scrollTop=a.c.scrollHeight;a.h+=d}else if(null!=a.g){if(10==b||1024<=a.g.length)a.U(a.g),a.g="";10!=b&&(a.g+=String.fromCharCode(b))}} +var sd={},qd=(sd[65392]=[null,null,Z.prototype.oc,Z.prototype.Ic,"RCSR"],sd[65394]=[null,null,Z.prototype.nc,Z.prototype.Hc,"RBUF"],sd[65396]=[null,null,Z.prototype.rc,Z.prototype.Lc,"XCSR"],sd[65398]=[null,null,Z.prototype.qc,Z.prototype.Kc,"XBUF"],sd);u(function(){for(var a=D(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.U("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bvd){if(xd(d,this.w)){this.j=new L(this,"1.30.0","failsafe");xd(this.j)&&(Cd(this,d),a=2,Dd(this.j));this.j.set("timestamp",ka());Ed(this.j);var f=this.b&&!this.m;if(1==a||la("Click OK to restore the previous PDP11js machine state, or CANCEL to reset the machine.")){if(c=Bd(d)){var e=d.get("code"),g=d.get("data");e&&("ok"==e?xd(d,g):("error"== +e&&"no machine state"!=g?(this.M("Error: "+g),"unable to verify user"==g&&(pa("user",""),this.c=null)):this.U(e+": "+g),Dd(d),xd(d)?(c=Bd(d),f=!0):c=!1))}f&&Ad(this,c?d:null)}else 2==a&&d.clear()}else Ad(this);delete this.w;delete this.A}f=z(this.id);for(e=0;ea[1];a=a[2];this.$=!0;this.i.N=!0;var d=this.v.power;d&&(d.textContent="Shutdown");this.a&&(Fd(this,this.a,b,c,a),this.a.Wa());this.K&&(Cd(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +function Cd(a,b){if(la("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.c||"";b=b.toString();var d={app:"PDP11js",ver:"1.30.0"};d.url=a.url;d.user=c;d.type="bug";d.data=b;p("http://www.pcjs.org/api/v1/report",d,!0)}} +function Gd(a,b,c){var d,f="none";if(a.g)return null;a.g--;var e=new L(a,"1.30.0"),g=new L(a,"1.30.0","validate"),h=ka();g.set("timestamp",h);e.set("timestamp",h);e.set("version","1.30.0");e.set("url",window?window.location.href:null);e.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ka&&(c&&Lb(a.a),d=a.a.ka(b,c),"object"===typeof d&&e.set(a.a.id,d),c&&(a.a.i.N=!1,!1===d&&(f=null)));for(var h=z(a.id),l=0;le.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(e=window.location.pathname+e),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(e?' url="'+e+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));e=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.loadXML(a)):e=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){e=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=d[2];b("Loading "+f+"...");p(f,null,!0,function(e,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(e=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,q=/( [a-z]+=)(['"])(.*?)\2/g;m=q.exec(e);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Kd(a,b,c)}})}else c(a,null)} -function Ld(a,b,c,d){function f(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function e(a){f("Error: "+a);l&&(--Hd||wa(!0));l=!1}var g,h,l=!0;Hd++;Ea[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],w=document.createElement("style");w.type="text/css";w.styleSheet?w.styleSheet.cssText=m:w.appendChild(document.createTextNode(m));q.appendChild(w)}c|| -(c="/versions/pdp11/1.30.0/components.xsl");m=function(d,h){h?Id(c,null,null,!1,f,function(d,l){l?(Fa(a,c,d),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Hd||wa(!0)):e("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Hd||wa(!0)):e("invalid machine element: "+ -a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser")):e(d)}):e(d)};"<"!=b.charAt(0)?Id(b,a,d,!0,f,m):Jd(b,null,a,d,!1,f,m)}else e("missing machine element: "+a)}catch(F){e(F.message)}return l}window.embedPDP11=function(a,b,c,d){wa(!1);return Ld(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})(); +k.Y=function(a,b,c){var d=this;switch(b){case "power":return this.v[b]=c,c.onclick=function(){d.g||(d.i.N?Gd(d,!1,!0):zd(d,d.Za))},!0;case "reset":return this.v[b]=c,c.onclick=function(){if(d.i.N&&!d.g)if(d.b&&!d.o){var a=la("Click OK to save changes to this PDP11js machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Gd(d,a,!0);!a&&d.H?window&&window.location.reload():d.Za(vd)}else d.reset(),d.a&&d.a.Wa()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.v[b]= +c,c.onclick=function(){var a=wd(d,!0);if(a){var b=!!(d.b&&!d.o||d.H),c=Gd(d,b);b?Hd(d,a,c):d.M("Resume disabled, machine state not saved")}},!0}return!1}; +function wd(a,b){var c=a.c;c||((c=oa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Id(a,c))||a.M("The user ID is invalid.")):b&&a.M("Browser local storage is not available"));return c} +function Id(a,b){a.c=null;b=p(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(pa("user",b.data),a.c=b.data)}catch(d){r(d.message+" ("+c+")")}return a.c}function yd(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+Jd(a,"1.30.0"));return b} +function Hd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Jd(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");0e.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(e=window.location.pathname+e),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(e?' url="'+e+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDP11js$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));e=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.loadXML(a)):e=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){e=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var f=d[2];b("Loading "+f+"...");p(f,null,!0,function(e,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(e=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,q=/( [a-z]+=)(['"])(.*?)\2/g;m=q.exec(e);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+f);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Nd(a,b,c)}})}else c(a,null)} +function Od(a,b,c,d){function f(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ga(a))}function e(a){f("Error: "+a);l&&(--Kd||wa(!0));l=!1}var g,h,l=!0;Kd++;Ea[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],w=document.createElement("style");w.type="text/css";w.styleSheet?w.styleSheet.cssText=m:w.appendChild(document.createTextNode(m));q.appendChild(w)}c|| +(c="/versions/pdp11/1.30.0/components.xsl");m=function(d,h){h?Ld(c,null,null,!1,f,function(d,l){l?(Fa(a,c,d),f("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Kd||wa(!0)):e("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--Kd||wa(!0)):e("invalid machine element: "+ +a):e("transformToFragment failed")):e("unable to transform XML: unsupported browser")):e(d)}):e(d)};"<"!=b.charAt(0)?Ld(b,a,d,!0,f,m):Md(b,null,a,d,!1,f,m)}else e("missing machine element: "+a)}catch(E){e(E.message)}return l}window.embedPDP11=function(a,b,c,d){wa(!1);return Od(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})();