diff --git a/gulpfile.js b/gulpfile.js index 1e59db60b..511b91142 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -34,12 +34,12 @@ * so for normal development, you should continue using Grunt. * * To learn Gulp, I started with a simple concatenation task ("mktmp") that combines all the files - * required to compile a single emulation module (PCx86), and then I added a compilation task ("compile") + * required to compile a single emulation module (PDPjs), and then I added a compilation task ("compile") * that runs the new JavaScript version of Google's Closure Compiler. * * Unfortunately, the JavaScript version of the Closure Compiler appears to be MUCH slower than the * Java version. But, it did uncover a few new type-related bugs in my code, which are now fixed, - * and the PCx86 emulation module now compiles successfully (although I haven't tested it yet). + * and the PDPjs emulation module now compiles successfully (although I haven't tested it yet). * * Additional work is required to make Gulp skip tasks when the output file(s) are still newer * than the input file(s). By default, every time you run Gulp, EVERYTHING is built again. Apparently, @@ -60,9 +60,9 @@ var pkg = require("./package.json"); pkg.version = pkg.version.slice(0, -1) + 'x'; // TODO: Remove this hack when we're done testing -var pcX86TmpDir = "./tmp/pcx86/" + pkg.version; -var pcX86ReleaseDir = "./versions/pcx86/" + pkg.version; -var pcX86ReleaseFile = "pcx86.js"; +var pdp11TmpDir = "./tmp/pdp11/" + pkg.version; +var pdp11ReleaseDir = "./versions/pdpjs/" + pkg.version; +var pdp11ReleaseFile = "pdp11.js"; var sExterns = ""; var sSiteHost = "www.pcjs.org"; @@ -86,7 +86,7 @@ if (pkg.homepage) { } gulp.task('mktmp', function() { - return gulp.src(pkg.pcX86Files) + return gulp.src(pkg.pdp11Files) .pipe(foreach(function(stream, file){ return stream .pipe(header('/* ' + file.path + ' */\n\n')) @@ -95,13 +95,13 @@ gulp.task('mktmp', function() { .pipe(replace(/[ \t]*if\s*\(typeof\s+module\s*!==\s*(['"])undefined\1\)\s*(\{[^}]*}|[^\n]*)(\n|$)/gm, "")) .pipe(replace(/[ \t]*[A-Za-z_][A-Za-z0-9_.]*\.assert\([^\n]*\);[^\n]*/g, "")) })) - .pipe(concat(pcX86ReleaseFile)) + .pipe(concat(pdp11ReleaseFile)) .pipe(header('"use strict";\n\n')) - .pipe(gulp.dest(pcX86TmpDir)); + .pipe(gulp.dest(pdp11TmpDir)); }); gulp.task('compile', function() { - return gulp.src(path.join(pcX86TmpDir, pcX86ReleaseFile) /*, {base: './'} */) + return gulp.src(path.join(pdp11TmpDir, pdp11ReleaseFile) /*, {base: './'} */) .pipe(compiler({ assumeFunctionWrapper: true, compilationLevel: 'ADVANCED', @@ -117,10 +117,10 @@ gulp.task('compile', function() { languageIn: "ES6", // this is now the default, just documenting our requirements languageOut: "ES5", // this is also the default outputWrapper: '(function(){%output%})()', - jsOutputFile: pcX86ReleaseFile, // TODO: This must vary according to debugger/non-debugger releases + jsOutputFile: pdp11ReleaseFile, // TODO: This must vary according to debugger/non-debugger releases createSourceMap: false })) - .pipe(gulp.dest(pcX86ReleaseDir)); + .pipe(gulp.dest(pdp11ReleaseDir)); }); gulp.task('default', function() { diff --git a/modules/c1pjs/lib/computer.js b/modules/c1pjs/lib/computer.js index b02023816..e440c94a5 100644 --- a/modules/c1pjs/lib/computer.js +++ b/modules/c1pjs/lib/computer.js @@ -253,7 +253,7 @@ C1PComputer.power = function(computer) /* * C1PComputer.init() * - * This function operates on every HTML element of class "computer", extracting the + * This function operates on every HTML element of class "c1pjs-computer", extracting the * JSON-encoded parameters for the C1PComputer constructor from the element's "data-value" * attribute, invoking the constructor to create a C1PComputer component, and then binding * any associated HTML controls to the new component. @@ -263,7 +263,7 @@ C1PComputer.init = function() /* * In non-COMPILED builds, embedMachine() may have set XMLVERSION. */ - if (!COMPILED && C1PJS.XMLVERSION) C1PJS.APPVERSION = C1PJS.XMLVERSION; + if (!COMPILED && XMLVERSION) C1PJS.APPVERSION = XMLVERSION; var aeComputers = Component.getElementsByClass(document, C1PJS.APPCLASS, "computer"); diff --git a/modules/pc8080/lib/computer.js b/modules/pc8080/lib/computer.js index 7ea97ce6e..1912af22c 100644 --- a/modules/pc8080/lib/computer.js +++ b/modules/pc8080/lib/computer.js @@ -1488,7 +1488,7 @@ Computer8080.prototype.updateVideo = function(fForced) /** * Computer8080.init() * - * For every machine represented by an HTML element of class "pcjs-machine", this function + * For every machine represented by an HTML element of class "pc8080-machine", this function * locates the HTML element of class "computer", extracting the JSON-encoded parameters for the * Computer constructor from the element's "data-value" attribute, invoking the constructor to * create a Computer component, and then binding any associated HTML controls to the new component. @@ -1498,7 +1498,7 @@ Computer8080.init = function() /* * In non-COMPILED builds, embedMachine() may have set XMLVERSION. */ - if (!COMPILED && PC8080.XMLVERSION) PC8080.APPVERSION = PC8080.XMLVERSION; + if (!COMPILED && XMLVERSION) PC8080.APPVERSION = XMLVERSION; var aeMachines = Component.getElementsByClass(document, PC8080.APPCLASS + "-machine"); diff --git a/modules/pcx86/lib/computer.js b/modules/pcx86/lib/computer.js index 262d32c61..c9d3501a2 100644 --- a/modules/pcx86/lib/computer.js +++ b/modules/pcx86/lib/computer.js @@ -1518,7 +1518,7 @@ Computer.prototype.updateVideo = function(fForce) /** * Computer.init() * - * For every machine represented by an HTML element of class "pcjs-machine", this function + * For every machine represented by an HTML element of class "pcx86-machine", this function * locates the HTML element of class "computer", extracting the JSON-encoded parameters for the * Computer constructor from the element's "data-value" attribute, invoking the constructor to * create a Computer component, and then binding any associated HTML controls to the new component. @@ -1528,7 +1528,7 @@ Computer.init = function() /* * In non-COMPILED builds, embedMachine() may have set XMLVERSION. */ - if (!COMPILED && PCX86.XMLVERSION) PCX86.APPVERSION = PCX86.XMLVERSION; + if (!COMPILED && XMLVERSION) PCX86.APPVERSION = XMLVERSION; var aeMachines = Component.getElementsByClass(document, PCX86.APPCLASS + "-machine"); diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 9bad104f1..1f3dbe00e 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -133,7 +133,7 @@ function BusPDP11(parmsBus, cpu, dbg) this.fIOBreakAll = false; this.fnReset = null; - this.fnAccess = this.access; + this.fnIOAccess = this.unknownIO; /* * Allocate empty Memory blocks to span the entire physical address space. @@ -214,7 +214,7 @@ BusPDP11.IOController = { } return b; } - b = bus.fnAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 1); + b = bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 1); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { this.dbg.printMessage("warning: unconverted read access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b)); } @@ -279,7 +279,7 @@ BusPDP11.IOController = { } return; } - bus.fnAccess(addr | BusPDP11.IOPAGE_22BIT, b, 1); + bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, b, 1); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { this.dbg.printMessage("warning: unconverted write access to byte @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(b)); } @@ -312,7 +312,7 @@ BusPDP11.IOController = { } return w; } - w = bus.fnAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 0); + w = bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, -1, 0); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { this.dbg.printMessage("warning: unconverted read access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w)); } @@ -349,7 +349,7 @@ BusPDP11.IOController = { } return; } - bus.fnAccess(addr | BusPDP11.IOPAGE_22BIT, w, 0); + bus.fnIOAccess(addr | BusPDP11.IOPAGE_22BIT, w, 0); if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { this.dbg.printMessage("warning: unconverted write access to word @" + this.dbg.toStrBase(addr) + ": " + this.dbg.toStrBase(w)); } @@ -426,7 +426,7 @@ BusPDP11.prototype.reset = function() }; /** - * access(addr, data, byteFlag) + * unknownIO(addr, data, byteFlag) * * This is our default I/O handler, called whenever there's an IOPAGE access without a corresponding entry * in aIOHandlers; in the interim, our Device component will override this default handler with its own function @@ -438,10 +438,10 @@ BusPDP11.prototype.reset = function() * @param {number} data (-1 if read, otherwise write) * @param {number} byteFlag (true if byte I/O, otherwise word) */ -BusPDP11.prototype.access = function(addr, data, byteFlag) +BusPDP11.prototype.unknownIO = function(addr, data, byteFlag) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage("warning: unrecognized access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")"); + this.dbg.printMessage("warning: unrecognized I/O access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")"); } return 0; }; @@ -808,10 +808,10 @@ BusPDP11.prototype.getWord = function(addr) { var off = addr & this.nBlockLimit; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; - if (off != this.nBlockLimit) { - return this.aMemBlocks[iBlock].readWord(off, addr); + if (!PDP11.WORDBUS && off == this.nBlockLimit) { + return this.aMemBlocks[iBlock++].readByte(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByte(0, addr + 1) << 8); } - return this.aMemBlocks[iBlock++].readByte(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByte(0, addr + 1) << 8); + return this.aMemBlocks[iBlock].readWord(off, addr); }; /** @@ -827,10 +827,10 @@ BusPDP11.prototype.getWordDirect = function(addr) { var off = addr & this.nBlockLimit; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; - if (off != this.nBlockLimit) { - return this.aMemBlocks[iBlock].readWordDirect(off, addr); + if (!PDP11.WORDBUS && off == this.nBlockLimit) { + return this.aMemBlocks[iBlock++].readByteDirect(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByteDirect(0, addr + 1) << 8); } - return this.aMemBlocks[iBlock++].readByteDirect(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByteDirect(0, addr + 1) << 8); + return this.aMemBlocks[iBlock].readWordDirect(off, addr); }; /** @@ -871,12 +871,12 @@ BusPDP11.prototype.setWord = function(addr, w) { var off = addr & this.nBlockLimit; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; - if (off != this.nBlockLimit) { - this.aMemBlocks[iBlock].writeWord(off, w & 0xffff, addr); + if (!PDP11.WORDBUS && off == this.nBlockLimit) { + this.aMemBlocks[iBlock++].writeByte(off, w & 0xff, addr); + this.aMemBlocks[iBlock & this.nBlockMask].writeByte(0, (w >> 8) & 0xff, addr + 1); return; } - this.aMemBlocks[iBlock++].writeByte(off, w & 0xff, addr); - this.aMemBlocks[iBlock & this.nBlockMask].writeByte(0, (w >> 8) & 0xff, addr + 1); + this.aMemBlocks[iBlock].writeWord(off, w & 0xffff, addr); }; /** @@ -893,12 +893,12 @@ BusPDP11.prototype.setWordDirect = function(addr, w) { var off = addr & this.nBlockLimit; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; - if (off != this.nBlockLimit) { - this.aMemBlocks[iBlock].writeWordDirect(off, w & 0xffff, addr); + if (!PDP11.WORDBUS && off == this.nBlockLimit) { + this.aMemBlocks[iBlock++].writeByteDirect(off, w & 0xff, addr); + this.aMemBlocks[iBlock & this.nBlockMask].writeByteDirect(0, (w >> 8) & 0xff, addr + 1); return; } - this.aMemBlocks[iBlock++].writeByteDirect(off, w & 0xff, addr); - this.aMemBlocks[iBlock & this.nBlockMask].writeByteDirect(0, (w >> 8) & 0xff, addr + 1); + this.aMemBlocks[iBlock].writeWordDirect(off, w & 0xffff, addr); }; /** @@ -1072,18 +1072,18 @@ BusPDP11.prototype.addIOTable = function(component, table) }; /** - * addIODefaultHandlers(fnReset, fnAccess) + * addIODefaultHandlers(fnReset, fnIOAccess) * * Add default I/O notification handlers. * * @this {BusPDP11} * @param {function()} fnReset - * @param {function(number,number,number)} fnAccess + * @param {function(number,number,number)} fnIOAccess */ -BusPDP11.prototype.addIODefaultHandlers = function(fnReset, fnAccess) +BusPDP11.prototype.addIODefaultHandlers = function(fnReset, fnIOAccess) { this.fnReset = fnReset; - this.fnAccess = fnAccess; + this.fnIOAccess = fnIOAccess; }; /** diff --git a/modules/pdp11/lib/computer.js b/modules/pdp11/lib/computer.js index b62519a07..57dd720ff 100644 --- a/modules/pdp11/lib/computer.js +++ b/modules/pdp11/lib/computer.js @@ -1448,7 +1448,7 @@ ComputerPDP11.prototype.updateStatus = function(fForce) /** * ComputerPDP11.init() * - * For every machine represented by an HTML element of class "pcjs-machine", this function + * For every machine represented by an HTML element of class "pdp11-machine", this function * locates the HTML element of class "computer", extracting the JSON-encoded parameters for the * Computer constructor from the element's "data-value" attribute, invoking the constructor to * create a Computer component, and then binding any associated HTML controls to the new component. diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 5e0ffd2c0..7e37f91b3 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -1094,12 +1094,18 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl this.mmuLastVirtual = physicalAddress; if (physicalAddress >= BusPDP11.IOPAGE_VIRT) { physicalAddress |= BusPDP11.IOPAGE_22BIT; - } else { // no max_memory check in 16 bit mode + } + /* + * I'm moving this alignment test to the CPU->Bus interfaces that read/write physical words; + * hopefully there are no order dependencies on this test. + * + else { // no max_memory check in 16 bit mode if ((physicalAddress & 1) && !(accessFlags & PDP11.ACCESS.BYTE)) { this.regErr |= PDP11.CPUERR.ODDADDR; this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR); } } + */ } else { this.mmuLastVirtual = virtualAddress; page = (virtualAddress >> 13) & this.mmuMask[this.mmuMode]; @@ -1118,10 +1124,15 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl this.regErr |= PDP11.CPUERR.NOMEMORY; this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.NOMEMORY); // KB11-EM does this after ABORT handling - KB11-CM before } + /* + * I'm moving this alignment test to the CPU->Bus interfaces that read/write physical words; + * hopefully there are no order dependencies on this test. + * if ((physicalAddress & 1) && !(accessFlags & PDP11.ACCESS.BYTE)) { this.regErr |= PDP11.CPUERR.ODDADDR; this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMMUADDR); } + */ } switch (pdr & 0x7) { case 1: // read-only with trap @@ -1190,6 +1201,18 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl return physicalAddress; }; +/** + * readByteFromPhysical(physicalAddress) [formerly readByteByAddr] + * + * @this {CPUStatePDP11} + * @param {number} physicalAddress + * @return {number} + */ +CPUStatePDP11.prototype.readByteFromPhysical = function(physicalAddress) +{ + return this.bus.getByte(physicalAddress); +}; + /** * readWordFromPhysical(physicalAddress) [formerly readWordByAddr] * @@ -1199,6 +1222,10 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl */ CPUStatePDP11.prototype.readWordFromPhysical = function(physicalAddress) { + if (physicalAddress & 0x1) { + this.regErr |= PDP11.CPUERR.ODDADDR; + this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR); + } return this.bus.getWord(physicalAddress); }; @@ -1213,30 +1240,6 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(virtualAddress) return this.readWordFromPhysical(this.mapVirtualToPhysical(virtualAddress, PDP11.ACCESS.READ_WORD)); }; -/** - * writeWordToPhysical(physicalAddress, data) [formerly writeWordByAddr] - * - * @this {CPUStatePDP11} - * @param {number} physicalAddress - * @param {number} data - */ -CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) -{ - this.bus.setWord(physicalAddress, data & 0xffff); -}; - -/** - * readByteFromPhysical(physicalAddress) [formerly readByteByAddr] - * - * @this {CPUStatePDP11} - * @param {number} physicalAddress - * @return {number} - */ -CPUStatePDP11.prototype.readByteFromPhysical = function(physicalAddress) -{ - return this.bus.getByte(physicalAddress); -}; - /** * writeByteToPhysical(physicalAddress, data) [formerly writeByteByAddr] * @@ -1250,6 +1253,22 @@ CPUStatePDP11.prototype.writeByteToPhysical = function(physicalAddress, data) this.bus.setByte(physicalAddress, data & 0xff); }; +/** + * writeWordToPhysical(physicalAddress, data) [formerly writeWordByAddr] + * + * @this {CPUStatePDP11} + * @param {number} physicalAddress + * @param {number} data + */ +CPUStatePDP11.prototype.writeWordToPhysical = function(physicalAddress, data) +{ + if (physicalAddress & 0x1) { + this.regErr |= PDP11.CPUERR.ODDADDR; + this.trap(PDP11.TRAP.BUS_ERROR, PDP11.REASON.ODDMEMADDR); + } + this.bus.setWord(physicalAddress, data & 0xffff); +}; + /** * popWord() * diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 32b95bfea..4a584ad66 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -590,7 +590,7 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). */ b = this.bus.getByteDirect(addr); this.nDisableMessages--; @@ -614,7 +614,11 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). + * + * NOTE: We don't care if the word address is aligned, because 1) we assume the user knows what + * they're doing, and 2) the Bus simply ignores the low address bit anyway. Alignment checks are + * performed by the CPU, not the Bus. */ w = this.bus.getWordDirect(addr); this.nDisableMessages--; @@ -637,7 +641,7 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). */ this.bus.setByteDirect(addr, b); this.nDisableMessages--; @@ -660,7 +664,11 @@ if (DEBUGGER) { if (addr !== PDP11.ADDR_INVALID) { this.nDisableMessages++; /* - * TODO: We also need a Bus interface to disable fnAccess() calls that could trigger a trap() + * TODO: We also need a Bus interface to disable fnIOAccess() calls that could trigger a trap(). + * + * NOTE: We don't care if the word address is aligned, because 1) we assume the user knows what + * they're doing, and 2) the Bus simply ignores the low address bit anyway. Alignment checks are + * performed by the CPU, not the Bus. */ this.bus.setWordDirect(addr, w); this.nDisableMessages--; @@ -2841,15 +2849,14 @@ if (DEBUGGER) { var sData = "", sChars = ""; sAddr = this.toStrAddr(dbgAddr); /* - * It's just coincidence that we want to dump 8 bytes per line when using base 8 and 16 bytes - * per line when using base 16, because octal requires more digits. + * Dump 8 bytes per line when using base 8, and dump 16 bytes when using base 16 (or when dumping dwords) */ var nBytes = (size == 4? 16 : this.nBase); for (i = nBytes; i > 0 && cb > 0; i--) { var b = this.getByte(dbgAddr, 1); data |= (b << (iByte++ << 3)); if (iByte == size) { - sData += (this.nBase == 8? str.toOct(data, size * 3) : str.toHex(data, size * 2)); + sData += this.toStrBase(data, size); sData += (size == 1? (i == 9? '-' : ' ') : " "); data = iByte = 0; } diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 2a8d34385..95a4983f7 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -79,6 +79,21 @@ var BYTEARRAYS = false; */ var TYPEDARRAYS = (typeof ArrayBuffer !== 'undefined'); +/** + * WORDBUS forces the Bus and Memory interfaces to assume even addresses when accessing words. Since PDPjs inherited + * its Bus component from PCx86, it originally supported both aligned and unaligned word accesses by default, but since + * the PDP-11 requires aligned (even) word addresses, we can turn off support for unaligned accesses and get some + * performance gains. + * + * When WORDBUS is true, the Bus and Memory components simply ignore the low bit of word addresses, because it is the + * CPU, not the Bus, that's responsible for validating addresses and generating the appropriate traps. + * + * Don't worry that the source code looks MORE complicated rather than LESS with the additional WORDBUS checks, because + * the Closure Compiler eliminates those checks and throws away the (unreachable) code blocks that deal with unaligned + * accesses. + */ +var WORDBUS = true; + /* * Combine all the shared globals and machine-specific globals into one machine-specific global object, * which all machine components should start using; eg: "if (PDP11.DEBUG) ..." instead of "if (DEBUG) ...". @@ -95,6 +110,7 @@ var PDP11 = { MAXDEBUG: MAXDEBUG, // shared PRIVATE: PRIVATE, // shared TYPEDARRAYS:TYPEDARRAYS, + WORDBUS: WORDBUS, SITEHOST: SITEHOST, // shared XMLVERSION: XMLVERSION, // shared diff --git a/modules/pdp11/lib/memory.js b/modules/pdp11/lib/memory.js index 6f7f841fc..ba4c0080a 100644 --- a/modules/pdp11/lib/memory.js +++ b/modules/pdp11/lib/memory.js @@ -782,10 +782,15 @@ MemoryPDP11.prototype = { */ readWordLE: function readWordLE(off, addr) { /* - * TODO: It remains to be seen if there's any advantage to checking the offset for an aligned read - * vs. always reading the bytes separately. + * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset + * for an aligned read vs. always reading the bytes separately. */ - var w = (off & 0x1)? (this.ab[off] | (this.ab[off+1] << 8)) : this.aw[off >> 1]; + var w; + if (PDP11.WORDBUS || !(off & 0x1)) { + w = this.aw[off >> 1]; + } else { + w = this.ab[off] | (this.ab[off+1] << 8); + } if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { this.dbg.printMessage("Memory.readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true); } @@ -840,14 +845,14 @@ MemoryPDP11.prototype = { */ writeWordLE: function writeWordLE(off, w, addr) { /* - * TODO: It remains to be seen if there's any advantage to checking the offset for an aligned write - * vs. always writing the bytes separately. + * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset + * for an aligned write vs. always writing the bytes separately. */ - if (off & 0x1) { + if (PDP11.WORDBUS || !(off & 0x1)) { + this.aw[off >> 1] = w; + } else { this.ab[off] = w; this.ab[off+1] = w >> 8; - } else { - this.aw[off >> 1] = w; } this.fDirty = true; if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index 6b2032106..3cce30f1b 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -9,222 +9,222 @@ typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encod 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.dc=this.id.substr(0,b),this.pb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Hb:!1,ec:!1,ia:!1,error:!1};this.Xb=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;bb?this.Pb=this.id:(this.cc=this.id.substr(0,b),this.Pb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Bb:!1,dc:!1,ia:!1,error:!1};this.Rb=null;this.v.error=!1;this.K={};this.j=null;this.ka=d||0;x.push(this)}var Ua=void 0,Va={}; +if(window){Ua||(Ua=window.location.search.substr(1));for(var Wa,Xa=/\+/g,Ya=/([^&=]+)=?([^&]*)/g;Wa=Ya.exec(Ua);)Va[decodeURIComponent(Wa[1].replace(Xa," "))]=decodeURIComponent(Wa[2].replace(Xa," "))}function Za(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var 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=Za(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var $a=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else $a={},x=[];function ab(a,b,c){$a[a]&&b&&($a[a][b]=c)}function bb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.ca&&(this.ca=10);15>2;this.f=this.Ca-1;this.w=this.B/this.Ca|0;this.C=this.w-1;this.Ra=[];this.F=null;this.Jb=this.Jc;a=new I;Bb(a,this.j);this.O=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.Jb(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.Jb(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.Jb(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.Jb(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.Ja=function(a,b){b||this.reset();return!0}; -function Gb(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ca;0g&&(n=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.A)return l.Ub+=l.A-f,l.A=f,!0;if(f>=l.A+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.A+n;f=m+a.Ca;g-=n;h++;continue}}return Ib(1,f,g)}f=new I(f,n,a.Ca,d,e);Bb(f,a.j,l);a.O[h++]=f;f=m+a.Ca;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.jb=function(a){return this.O[(a&this.g)>>>this.ca].ub(a&this.f,a)};k.Ha=function(a){var b=a&this.f,c=(a&this.g)>>>this.ca;return b!=this.f?this.O[c].Bc(b,a):this.O[c++].ub(b,a)|this.O[c&this.C].ub(0,a+1)<<8};function Kb(a,b){var c=b&a.f,d=(b&a.g)>>>a.ca;return c!=a.f?a.O[d].kc(c,b):a.O[d++].Nb(c,b)|a.O[d&a.C].Nb(0,b+1)<<8}k.Rb=function(a,b){this.O[(a&this.g)>>>this.ca].Ab(a&this.f,b&255,a)}; -k.nb=function(a,b){var c=a&this.f,d=(a&this.g)>>>this.ca;c!=this.f?this.O[d].Ic(c,b&65535,a):(this.O[d++].Ab(c,b&255,a),this.O[d&this.C].Ab(0,b>>8&255,a+1))};function Lb(a){for(var b=0,c=[],d=0;d>1)+2;10>this.ca&&(this.ca=10);15>2;this.f=this.Ca-1;this.w=this.F/this.Ca|0;this.Ra=[];this.D=null;this.Eb=this.od;a=new I;Ab(a,this.j);this.X=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.Eb(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 Cb(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.Eb(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 Db(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.Eb(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 Eb(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.Eb(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=zb.prototype;k.reset=function(){this.D&&this.D()}; +k.od=function(a,b,c){this.j&&F(this.j,64)&&E(this.j,"warning: unrecognized I/O access("+J(this.j,a)+","+J(this.j,b)+","+c+")");return 0};k.Ja=function(a,b){b||this.reset();return!0}; +function Fb(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ca;0g&&(n=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.A)return l.Ob+=l.A-f,l.A=f,!0;if(f>=l.A+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.A+n;f=m+a.Ca;g-=n;h++;continue}}return Hb(1,f,g)}f=new I(f,n,a.Ca,d,e);Ab(f,a.j,l);a.X[h++]=f;f=m+a.Ca;g-=n}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Ib[d]+" at "+p(b,8,!0)),!0):Hb(2,b,c)} +k.jb=function(a){return this.X[(a&this.g)>>>this.ca].Wb(a&this.f,a)};k.Ha=function(a){return this.X[(a&this.g)>>>this.ca].Bc(a&this.f,a)};function Jb(a,b){return a.X[(b&a.g)>>>a.ca].jc(b&a.f,b)}k.Lb=function(a,b){this.X[(a&this.g)>>>this.ca].$b(a&this.f,b&255,a)};k.nc=function(a,b){this.X[(a&this.g)>>>this.ca].Ic(a&this.f,b&65535,a)}; +function Kb(a){for(var b=0,c=[],d=0;d>5&3;c.xa=a>>1&15;c.Yb=a&257?a&1?6:4:0;Sb(c);a=c.F;a&1|256&&(b=this.b.lb&16?1:2);this.g.rb=this.g.rb&-8|b};k.Zc=function(){return Tb(this.b)};k.rd=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.dd,drive:f,blocksize:256,mapped:0,maxblock:b.cb[f]*b.da[f],url:"rk"+f+".dsk"});b.R&=-129;switch(b.R>>1&7){case 0:b.Pb=2496;b.oa=0;b.R=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.cb[f]){b.oa|=32832;b.R|=49152;break}if((b.va&15)>=b.da[f]){b.oa|=32800;b.R|=49152;break}c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.R&48)<<12|b.Ob;e=65536-b.Qb&65535;Wb(a,b.ra[f],c,d,e);return;case 2:if((b.va>>4&511)>=b.cb[f])b.oa|= -32832,b.R|=49152;else if((b.va&15)>=b.da[f])b.oa|=32800,b.R|=49152;else{c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.R&48)<<12|b.Ob;e=65536-b.Qb&65535;a.$b(b.ra[f],c,d,e);return}}b.Pb=f<<13|b.Pb&8176|b.va%9&15;L(a.b,20,5,144,function(){b.R=b.R&65534|128;return!!(b.R&64)})}k.dd=function(a,b,c,d,e){var f=this.C;f.Ob=d&65535;f.R=f.R&-49|d>>12&48;f.Qb=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.ed,drive:f,blocksize:128,mapped:1,maxblock:b.cb[f]*b.da[f],url:"rl"+f+".dsk"});switch(b.M>>1&7){case 2:b.Wa&8&&(b.M&=63);b.Wa=b.Lc[f]|b.ab&64;break;case 3:1==(b.fa&3)&&(b.ab=b.fa&4?b.ab+(b.fa&65408)&65408|b.fa<<2&64:b.ab-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.ab);break;case 4:b.Wa=b.ab;break;case 5:if(b.fa>>6>=b.cb[f]){b.M|=37888;break}if((b.fa&63)>=b.da[f]){b.M|=37888;break}c=(b.fa>>6)* -b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Gb;e=65536-b.Wa&65535;Wb(a,b.ra[f],c,d,e);return;case 6:if(b.fa>>6>=b.cb[f])b.M|=37888;else if((b.fa&63)>=b.da[f])b.M|=37888;else{c=(b.fa>>6)*b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Gb;e=65536-b.Wa&65535;a.$b(b.ra[f],c,d,e);return}}L(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})} -k.ed=function(a,b,c,d,e){var f=this.w;f.Gb=d&65535;f.M=f.M&-49|d>>12&48;f.Sa=d>>16&63;f.fa=~~(c/f.da[b.Ma])<<6|c%f.da[b.Ma];f.ab=f.fa;f.Wa=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 Yb(a){a=a.B;a.T=2176;a.Da=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.wb=[0,0,0,0,0,0,0,0];a.mb=a.xb=a.vb=a.$a=a.nc=0} -function gc(a,b){var c=a.B,d,e,f;c.T&=-16513;c.Da&=-2049;c.ta[b]&=-1153;L(a.b,-1,0,172);"undefined"===typeof c.ra[b]&&(c.ra[b]={cache:[],postProcess:a.fd,drive:b,blocksize:256,mapped:0,maxblock:c.cc[0]*c.bb[0]*c.da[0],url:"rp"+b+".dsk"});switch(c.T&63){case 5:c.bc[b]=c.Qa[b];c.T|=32896;c.ta[b]|=32896;c.mb|=1<=c.cc[0]||c.Ea[b]>>8>=c.bb[0]||(c.Ea[b]&255)>=c.da[0]){c.wb[b]|=1024;c.T|=49152;break}d=(c.Qa[b]*c.bb[0]+(c.Ea[b]>>8))* -c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.vb;f=65536-c.xb&65535;Wb(a,c.ra[b],d,e,f);return;case 57:if(c.Qa[b]>=c.cc[0]||c.Ea[b]>>8>=c.bb[0]||(c.Ea[b]&255)>=c.da[0])c.wb[b]|=1024,c.T|=49152;else{d=(c.Qa[b]*c.bb[0]+(c.Ea[b]>>8))*c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.vb;f=65536-c.xb&65535;a.$b(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.fd=function(a,b,c,d,e){var f=this.B;f.xb=65536-e&65535;f.vb=d&65535;f.T=f.T&-769|d>>8&768;f.$a=d>>16&63;e=~~(c/f.da[0]);d=~~(e/f.bb[0]);f.Ea[b.Ma]=e%f.bb[0]<<8|c%f.da[0];f.bc[b.Ma]=f.Qa[b.Ma]=d;f.mb|=1<=b.Vc-1&&(f.ta[b.Ma]|=1024);switch(a){case 1:f.Da|=512;f.T|=49152;break;case 2:f.Da|=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.jc(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.jc(0,b,c,d,e)}k.reset=function(){this.g.rb=this.g.rb&-120|20;this.f.Va=0;this.C.R=128;this.w.M=128;Yb(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.Za&65280:(a&1&&(b<<=8),f.Za=b|255,d=0);break;case 4194298:if(0>b)d=f.mc;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.mc=d;f.D|=2}break;case 4194294:if(70!==f.ib)return f.L(4,222);0>b?d=f.J:d=f.J=0;break;case 4194292:if(70!==f.ib)return f.L(4,224);d=1;break;case 4194290:if(70!==f.ib)return f.L(4,226);d=0;break;case 4194288:if(70!==f.ib)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.ib)return f.L(4,232);e=a-4194272>>1;0>b?d=f.hc[e]:(d=M(this,f.hc[e],a,b,c),0<=d&&(f.hc[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.ya[3]=b),d=f.ya[3]):f.P>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[1]=b),d=f.ya[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.ya[0]=b),d=f.ya[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.ac,a,b,c);0<=d&&(f.ac=d);break;case 4194172:d=f.Ya;d&65280&& -(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.g.od&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.Pb,a,b,c);0<=d&&(e.Pb=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.Qb,a,b,c);0<=d&&(e.Qb=d);break;case 4194056:d=M(this,e.Ob,a,b,c);0<=d&&(e.Ob=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.Cc,a,b,c);0<=d&&(e.Cc=d);break;default:return f.J|=16,f.L(4,128)}break;case 4193728:var g=this.B;e=g.Da&7;switch(a&-2){case 4193728:d=M(this,g.T,a,b,c);0<=b&&0<=d&&(g.$a=g.$a&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.xb,a,b,c);0<=d&&(g.xb=d);break;case 4193732:d=M(this,g.vb,a,b,c);0<=d&&(g.vb=d&65534);break;case 4193734:d= -M(this,g.Ea[e],a,b,c);0<=d&&(g.Ea[e]=d&7967);break;case 4193736:d=M(this,g.Da,a,b,c);0<=d&&(g.Da=d&63|g.Da&65472,d&128&&Yb(this));break;case 4193738:d=g.ta[e];break;case 4193740:d=g.wb[e];break;case 4193742:d=M(this,g.mb,a,b,c);0<=d&&(g.mb=d&255);break;case 4193744:d=g.ld[e];break;case 4193746:d=M(this,g.Dc,a,b,c);0<=d&&(g.Dc=d);break;case 4193748:d=M(this,g.Ec[e],a,b,c);0<=d&&(g.Ec[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.md[e];break;case 4193754:d=M(this,g.Fc[e],a,b,c);0<=d&& -(g.Fc[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.bc[e]=g.Qa[e];d=g.bc[e];break;case 4193760:d=g.jd[e];break;case 4193762:d=g.kd[e];break;case 4193764:d=g.gd[e];break;case 4193766:d=g.hd[e];break;case 4193768:d=M(this,g.$a,a,b,c);0<=d&&(g.$a=d&63,g.T=g.T&-769|(d&3)<<8);break;case 4193770:d=M(this,g.nc,a,b,c);0<=d&&(g.nc=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.Gb,a,b,c);0<=d&&(e.Gb=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.Wa,a,b,c);0<=d&&(e.Wa=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.lb:(d=M(this,f.lb,a,b,c),0<=d&&(70!==f.ib&&(d&=-49),f.lb=d,f.Zb[0]=d&4?15:7,f.Zb[1]=d&2?15:7,f.Zb[3]= -d&1?15:7,f.Yb&&(e=2,f.lb&16&&(e=1),this.g.rb=this.g.rb&-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.ib)return f.L(4,234);e=a>>2&31;d=f.Sb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=M(this,d,a,b,c),0<=d&&(f.Sb[e]=a&2?d<<16|f.Sb[e]&65535:f.Sb[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.Xc,K.prototype.pd,"LKS"],kc[65402]=[null,null,K.prototype.Yc,K.prototype.qd,"MMR0"],kc[65534]=[null,null,K.prototype.Zc,K.prototype.rd,"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)},$: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},xa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<< -a)|b<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ua=!0},Y:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,1,c.U)&&c.ja(!0)}return this.Nb(a,b)},ha:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,2,c.U)&&c.ja(!0)}return this.kc(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.Bb(a,b,c)},Aa: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.qc(a,b,c)},U:function(a){return this.f[a]},Z: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.Ua=!0},wa:function(a,b,c){this.f[a]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},za:function(a,b){this.F.setUint16(a,b,!0);this.Ua=!0},Ba:function(a,b,c){a&1?(this.f[a]=b,this.f[a+1]=b>>8):this.I[a>>1]=b;this.Ua=!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.Ab=a.g?a.w:a.Bb,a.Ic=a.g?a.G:a.qc):--a.K||(a.ub=a.Nb,a.Bc=a.kc)}function vc(a,b,c){c&&a.C||(a.Ab=!a.g&&b[1]||a.w,a.Ic=!a.g&&b[3]||a.G);if(c||void 0===c)a.Bb=b[1]||a.w,a.qc=b[3]||a.G}function xc(a,b,c){c&&a.K||(a.ub=b[0]||a.N,a.Bc=b[2]||a.S);if(c||void 0===c)a.Nb=b[0]||a.N,a.kc=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.$,I.prototype.xa,I.prototype.ma,I.prototype.pb],wc=[I.prototype.Y,I.prototype.ua,I.prototype.ha,I.prototype.Aa]; -if(xb)var tc=[I.prototype.U,I.prototype.qa,I.prototype.ea,I.prototype.za],sc=[I.prototype.Z,I.prototype.wa,I.prototype.la,I.prototype.Ba];function Bc(a,b){w.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Aa=a.cycles||b;this.Xa=c;this.fb=Math.round(this.Aa/1E4)/100;this.kb=this.fb*this.Xa;this.v.ga=!1;this.v.oc=!1;this.v.Eb=a.autoStart;this.v.uc=!1;this.v.qb=!1;this.Kb=this.ha=0;this.Lb=a.csStart;this.sb=a.csInterval;this.tb=a.csStop;this.N=[];this.Wb=this.nd.bind(this);G(this)}y(Bc); -var Cc=["power","reset"];k=Bc.prototype;k.Oa=function(a,b,c,d){this.C=a;this.H=b;this.j=d;for(b=0;b=a.ha&&(a.ha+=a.sb,c=!0);0<=a.tb&&a.tb<=Ic(a)&&(a.sb=a.tb=-1,Fc(a),a.ja(),c=!0);c&&a.i(Ic(a)+" cycles: checksum="+p(a.Kb))}} -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.uc?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.Y/a.kb?b=1:d=!0;a.Xa=b;b=a.fb*a.Xa;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.K.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.C&&a.C.Tb()}Lc(a,a.U);a.U=0;a.S=ra();a.Z=0;Mc(a);return d}function Pb(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Qb(a,b,c){0<=b&&ba.N[b][0]&&(c*=a.Aa*a.Xa/1E3,a.N[b][0]=c)}function fd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b} -function gd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function hd(a){a.$-=a.b;a.b=0} -k.nd=function(){if(this.v.ga){this.ob>=this.Aa&&Mc(this,!0);this.ua=0;this.za=ra();if(this.Z){var a=this.za-this.Z;a>this.Ib&&(this.S+=a,this.S>this.za&&(this.S=this.za))}try{do{var b=fd(this,this.v.qb?1:this.Ba);try{this.zb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.$-this.b;gd(this,c);this.ua+=c;this.U+=c;Lc(this,0,!0);Hc(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ba;15<=++this.Vb&&(this.C&&this.C.Fa(),this.Vb=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.Wb;this.Z=ra();c=this.Ib;this.ua&&(c=Math.round(c*this.ua/this.Ba));var c=c-(this.Z-this.za),d=this.Z-this.S;d&&(this.Y=Math.round(this.U/(10*d))/100,864E5<=d&&(this.ea=0,Kc(this)));if(0>c||this.Yc&&(this.S-=c),c=0;this.ob+=this.ua;this.Z+=c;a(b,c)}}}; -k.yb=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.oc=!0;this.qa&&this.qa.start();var b=this.K.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.Tb(!0),this.C.start(this.S,Ic(this)));N(this,!0);setTimeout(this.Wb,0);return!0};k.zb=function(){return 0}; -k.ja=function(a){if(this.v.ga){hd(this);Lc(this,this.U);this.U=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.Fa(b)} -function id(a){this.Wc=+a.model||1170;this.ic=a.resetAddr||0;Bc.call(this,a,6666667);this.Fb=0;this.decode=jd.bind(this);this.V=65536;this.W=32768;this.aa=65535;this.X=32768;this.P=15;this.u=[0,0,0,0,0,0,0,this.ic];this.Pa=[0,0,0,0,0,0];this.ya=[0,0,0,0];this.xa=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.Sb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.hc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=this.f=this.eb=this.G=this.I=this.D=0;this.ib=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.Za=255;a.J=0;a.mc=0;a.F=0;a.Ya=0;a.ac=0;a.lb=0;a.Yb=0;a.wa=0;a.Zb=[7,7,7,7];a.w=[];a.D|=2;Sb(a)}function Sb(a){a.Yb?(a.Cb=65536,a.ba=a.Sc):(a.Cb=0,a.ba=a.Rc)}k.wc=function(){return 0};k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ea,this.Xa]);a.set(2,Lb(this.H));return a.data()}; -k.restore=function(a){var b=a[1];this.ea=b[1];Kc(this,b[3]);a:{b=this.H;a=a[2];var c;for(c=0;cb){a.w[f].La-=b;break}b-=a.w[f].La}a.w.splice(f+1,0,{La:b,Ac:c<<5&224,Hc:d,gc: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.X=b<<12;a.aa=~b&4;a.W=b<<14;a.V=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.ya[c]=a.u[6],a.u[6]=a.ya[a.B]);a.D|=2;a.P=b}function P(a,b){a.D&128||(a.X=a.aa=b,a.W=0)}function rd(a,b,c){a.D&128||(a.X=a.aa=a.V=b,a.W=c||0)}function sd(a,b,c,d){a.D&128||(a.X=a.aa=a.V=b,a.W=(c^b)&(d^b))}function td(a,b){a.D&128||(a.X=a.aa=a.V=b,a.W=a.X^a.V>>1)} -function ud(a,b,c,d){a.D&128||(a.X=a.aa=a.V=b,a.W=(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.Ya=63222,this.ac=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.lb&32&&(b=a.Sb[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.Yb){d=b>>13&a.Zb[a.B];e=a.na[a.B][d];f=(a.na[a.B][d+16]<<6)+(b&8191)&4194303;a.lb&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.wa=a.B,a.xa=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.F&57344||(a.F=a.F|g|a.wa<<5|a.xa<<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.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-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.ya[a.P>>12&3];return c}function Bd(a,b,c,d){a.F&57344||(a.Ya=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.H.nb(e,d&65535)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.ya[a.P>>12&3]=d} -function Cd(a,b){b>>=6;var c=a.I=b&7;(b=a.G=(b&56)>>3)?(c=a.ba(b,c,3),a=a.H.jb(c)):a=a.u[c]&255;return a}function Dd(a,b){var c;b>>=6;var d=a.I=b&7;(b=a.G=(b&56)>>3)?c=jc(a,a.ba(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.ba(b,c,3),a=a.H.jb(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.ba(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.eb=a.ba(b,e,7),c=d.call(a,c,a.H.jb(e)),e&1&&a.b--,a.H.Rb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),c=d.call(a,c,jc(a,e)),a.H.nb(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.ba(b,e,5),d&1&&a.b--,a.H.Rb(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.ba(b,d,4),a.H.nb(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.zb=function(a){this.v.complete=!0;var b=this.v.Oc=this.j&&Jd(this.j),c=a?this.v.oc?0:1:-1;this.v.oc=!1;this.$=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.mc&224,e=this.w.length;0<=--e;){if(0d&&(d=this.w[e].Ac,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.Hc,26):this.L(160,26))}else this.D&1&&this.D++;this.F&57344||(this.Ya=0,this.ac=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.X=this.aa=a,this.W=b&(b^a));return a&65535}function Yd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.X=this.aa=c,this.W=b&(b^c));return a&255}function Zd(a,b){a=b+a;this.D&128||(this.X=this.aa=a,this.W=a&(b^a));return a&65535} -function $d(a,b){a=b+a;var c=a<<8;this.D&128||(this.X=this.aa=c,this.W=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.V>>16&1;td(this,a);return a&65535}function de(a,b){a=b<<1|this.V>>16&1;td(this,a<<8);return a&255}function ee(a,b){a=(this.V&65536|b)>>1|b<<16;td(this,a);return a&65535}function fe(a,b){a=((this.V&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.X=this.aa=b&65280,this.W=this.V=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.V=this.W=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.W=32768)}this.u[a]=c&65535;this.X=this.aa=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.V=this.W=0;b&=63;if(b&32){b=64-b;32>b-1;this.V=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.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function U(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.aa=1);a&8&&(this.X=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.V=this.W=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.aa=d>>16|d,this.X=d>>16):(this.W=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.W=32768,this.V=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.X=b>>16,this.aa=this.X|b,this.W=0,this.V=-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){R(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)}function Qe(a){R(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.G?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.G?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.G?4:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Rd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f? -2:0)},function(a){R(this,a,Dd(this,a),Td);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Ld);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);P(this,Hd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;ud(this,b-a,a,b);this.b-=this.g? -4+(this.I&&6<=this.f?1:0):(this.G?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.G?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.G?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.G?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?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){R(this,a,0,Vd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Xd);this.b-=this.g?9:3+(7==this.f?2:0)}],Xe=[function(a){R(this,a,0,ae);this.b-=this.g?11:6},function(a){R(this,a,ld(this)?1:0,Ld);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(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){R(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Pd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(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.H.reset());this.b-=667},function(){wd(this);this.b-=13},W,W,W,W,W,W,W,W,W],af=[ue,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.X=0;this.b-=5},U,U,U,U,U,U,U],bf=[ue,function(){this.V= -65536;this.b-=5},function(){this.W=32768;this.b-=5},V,function(){this.aa=0;this.b-=5},V,V,V,function(){this.X=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,ve,ve],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.eb&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.eb&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.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;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf); -gf.prototype.Oa=function(a,b,c,d){this.H=b;this.b=c;this.j=d;jf(this)};gf.prototype.Ja=function(){if(this.Ka){if(this.j){var a=this.j,b=this.id,c=this.B,d=this.g,e=this.Ka,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.tc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.G.push({xd:b,A:c,Tc:d,Ka:e,rc:f})}delete this.Ka}return!0};gf.prototype.Ia=function(){return!0}; -function hf(a,b,c,d){if(d)a.sa("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.dc,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.Ka=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.ca].Bb(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.ca;0>>=e.ca;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.I=db(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.N=d.receiveData){this.status(this.dc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ja=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ia=function(a){return a?this.save():!0};k.reset=function(){of(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return of(this)};function of(a){a.Y=0;a.f=0;a.g=128;a.B=[];return!0}k.lc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.Z||8,c=a-this.G%a,this.Z&&(b=na("",c)));this.S&&!this.G&&c&&(b=String.fromCharCode(this.S)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.G+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.i(this.F), -this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;L(this.b,100,4,52,this.U)}};var pf={},nf=(pf[65392]=[null,null,Y.prototype.ad,Y.prototype.td,"RCSR"],pf[65394]=[null,null,Y.prototype.$c,Y.prototype.sd,"RBUF"],pf[65396]=[null,null,Y.prototype.cd,Y.prototype.vd,"XCSR"],pf[65398]=[null,null,Y.prototype.bd,Y.prototype.ud,"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.xc=function(){return-1};qf.prototype.yc=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.$?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; +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.F=b;this.b=c;this.j=d;var e=this;this.f.pc=Ob(this.b,function(){e.f.Va|=128;e.f.Va&64&&(L(e.b,0,6,64),Pb(e.b,e.f.pc,1E3/60))});Lb(b,this,Qb);Mb(b,this.reset.bind(this),this.Lc.bind(this));G(this)};k.Wc=function(){var a=this.f.Va;this.f.Va&=-129;return a}; +k.pd=function(a){this.f.Va=a;a&64&&Pb(this.b,this.f.pc,1E3/60);this.f.Va=a&-129};k.Xc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};k.qd=function(a){var b=4,c=this.b;c.G=a&=62337;c.wa=a>>5&3;c.xa=a>>1&15;c.Tb=a&257?a&1?6:4:0;Rb(c);a=c.G;a&1|256&&(b=this.b.lb&16?1:2);this.g.pb=this.g.pb&-8|b};k.Yc=function(){return Sb(this.b)};k.rd=function(a){Tb(this.b,a&-1809|Sb(this.b)&1808);this.b.C|=128}; +function Ub(a){var b=a.D,c,d,e,f=b.va>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.cd,drive:f,blocksize:256,mapped:0,maxblock:b.eb[f]*b.da[f],url:"rk"+f+".dsk"});b.P&=-129;switch(b.P>>1&7){case 0:b.Jb=2496;b.oa=0;b.P=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.eb[f]){b.oa|=32832;b.P|=49152;break}if((b.va&15)>=b.da[f]){b.oa|=32800;b.P|=49152;break}c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.P&48)<<12|b.Ib;e=65536-b.Kb&65535;Vb(a,b.ra[f],c,d,e);return;case 2:if((b.va>>4&511)>=b.eb[f])b.oa|= +32832,b.P|=49152;else if((b.va&15)>=b.da[f])b.oa|=32800,b.P|=49152;else{c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.P&48)<<12|b.Ib;e=65536-b.Kb&65535;a.Xb(b.ra[f],c,d,e);return}}b.Jb=f<<13|b.Jb&8176|b.va%9&15;L(a.b,20,5,144,function(){b.P=b.P&65534|128;return!!(b.P&64)})}k.cd=function(a,b,c,d,e){var f=this.D;f.Ib=d&65535;f.P=f.P&-49|d>>12&48;f.Kb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.P|=49152;break;case 2:f.oa|=33792,f.P|=49152}L(this.b,20,5,144,function(){f.P=f.P&65534|128;return!!(f.P&64)})}; +function Wb(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.dd,drive:f,blocksize:128,mapped:1,maxblock:b.eb[f]*b.da[f],url:"rl"+f+".dsk"});switch(b.M>>1&7){case 2:b.Wa&8&&(b.M&=63);b.Wa=b.Jc[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.Wa=b.bb;break;case 5:if(b.fa>>6>=b.eb[f]){b.M|=37888;break}if((b.fa&63)>=b.da[f]){b.M|=37888;break}c=(b.fa>>6)* +b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Ab;e=65536-b.Wa&65535;Vb(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.da[f])b.M|=37888;else{c=(b.fa>>6)*b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Ab;e=65536-b.Wa&65535;a.Xb(b.ra[f],c,d,e);return}}L(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})} +k.dd=function(a,b,c,d,e){var f=this.w;f.Ab=d&65535;f.M=f.M&-49|d>>12&48;f.Sa=d>>16&63;f.fa=~~(c/f.da[b.Ma])<<6|c%f.da[b.Ma];f.bb=f.fa;f.Wa=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 Xb(a){a=a.B;a.S=2176;a.Da=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.tb=[0,0,0,0,0,0,0,0];a.mb=a.ub=a.sb=a.$a=a.mc=0} +function gc(a,b){var c=a.B,d,e,f;c.S&=-16513;c.Da&=-2049;c.ta[b]&=-1153;L(a.b,-1,0,172);"undefined"===typeof c.ra[b]&&(c.ra[b]={cache:[],postProcess:a.ed,drive:b,blocksize:256,mapped:0,maxblock:c.bc[0]*c.cb[0]*c.da[0],url:"rp"+b+".dsk"});switch(c.S&63){case 5:c.Zb[b]=c.Qa[b];c.S|=32896;c.ta[b]|=32896;c.mb|=1<=c.bc[0]||c.Ea[b]>>8>=c.cb[0]||(c.Ea[b]&255)>=c.da[0]){c.tb[b]|=1024;c.S|=49152;break}d=(c.Qa[b]*c.cb[0]+(c.Ea[b]>>8))* +c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.sb;f=65536-c.ub&65535;Vb(a,c.ra[b],d,e,f);return;case 57:if(c.Qa[b]>=c.bc[0]||c.Ea[b]>>8>=c.cb[0]||(c.Ea[b]&255)>=c.da[0])c.tb[b]|=1024,c.S|=49152;else{d=(c.Qa[b]*c.cb[0]+(c.Ea[b]>>8))*c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.sb;f=65536-c.ub&65535;a.Xb(c.ra[b],d,e,f);return}}L(a.b,3,5,172,function(){c.S=c.S&65534|128;c.ta[b]|=128;return!!(c.S&64)})} +k.ed=function(a,b,c,d,e){var f=this.B;f.ub=65536-e&65535;f.sb=d&65535;f.S=f.S&-769|d>>8&768;f.$a=d>>16&63;e=~~(c/f.da[0]);d=~~(e/f.cb[0]);f.Ea[b.Ma]=e%f.cb[0]<<8|c%f.da[0];f.Zb[b.Ma]=f.Qa[b.Ma]=d;f.mb|=1<=b.Uc-1&&(f.ta[b.Ma]|=1024);switch(a){case 1:f.Da|=512;f.S|=49152;break;case 2:f.Da|=2048,f.S|=49152}L(this.b,20,5,172,function(){f.ta[b.Ma]|=128;f.S=f.S&65534|128;return!!(f.S&64)})}; +function hc(a,b,c,d,e,f){var g=~~((f+c.Ta-1)/c.Ta),h=new XMLHttpRequest;2048>g&&d+2048ic(this.b,a.Tc?jc(this.b,c):c,a.cache[b][e])){a.Vb(2,a,b,c,d);return}c+=2;--d}b++}a.Vb(0,a,b,c,d)}; +function Vb(a,b,c,d,e){for(var f,g;0g){b.Vb(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.Vb(0,b,c,d,e)}k.reset=function(){this.g.pb=this.g.pb&-120|20;this.f.Va=0;this.D.P=128;this.w.M=128;Xb(this)}; +k.Lc=function(a,b,c){var d,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.Za&65280:(a&1&&(b<<=8),f.Za=b|255,d=0);break;case 4194298:if(0>b)d=f.lc;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.lc=d;f.C|=2}break;case 4194294:if(70!==f.ib)return f.L(4,222);0>b?d=f.J:d=f.J=0;break;case 4194292:if(70!==f.ib)return f.L(4,224);d=1;break;case 4194290:if(70!==f.ib)return f.L(4,226);d=0;break;case 4194288:if(70!==f.ib)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.ib)return f.L(4,232);e=a-4194272>>1;0>b?d=f.gc[e]:(d=M(this,f.gc[e],a,b,c),0<=d&&(f.gc[e]=d));break;case 4194254:return a&1?f.O>>14&1?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[3]=b),d=f.ya[3]):f.O>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[1]=b),d=f.ya[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.O&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.O>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[0]=b),d=f.ya[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.O&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.Yb,a,b,c);0<=d&&(f.Yb=d);break;case 4194172:d=f.Ya;d&65280&& +(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.g.nd&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.D;switch(a&-2){case 4194048:d=M(this,e.Jb,a,b,c);0<=d&&(e.Jb=d);break;case 4194050:d=M(this,e.oa,a,b,c);0<=d&&(e.oa=d);break;case 4194052:d=M(this,e.P,a,b,c);0<=b&&0<=d&&(e.P=d&-36993|e.P&36992,e.P&1&&Ub(this));break;case 4194054:d=M(this,e.Kb,a,b,c);0<=d&&(e.Kb=d);break;case 4194056:d=M(this,e.Ib,a,b,c);0<=d&&(e.Ib=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.Cc,a,b,c);0<=d&&(e.Cc=d);break;default:return f.J|=16,f.L(4,128)}break;case 4193728:var g=this.B;e=g.Da&7;switch(a&-2){case 4193728:d=M(this,g.S,a,b,c);0<=b&&0<=d&&(g.$a=g.$a&60|d>>8&3,g.S=d&17279|g.S&34944|2048,d&1&&g.S&128?gc(this,e):192==(d&192)&&L(f,0,5,172));break;case 4193730:d=M(this,g.ub,a,b,c);0<=d&&(g.ub=d);break;case 4193732:d=M(this,g.sb,a,b,c);0<=d&&(g.sb=d&65534);break;case 4193734:d= +M(this,g.Ea[e],a,b,c);0<=d&&(g.Ea[e]=d&7967);break;case 4193736:d=M(this,g.Da,a,b,c);0<=d&&(g.Da=d&63|g.Da&65472,d&128&&Xb(this));break;case 4193738:d=g.ta[e];break;case 4193740:d=g.tb[e];break;case 4193742:d=M(this,g.mb,a,b,c);0<=d&&(g.mb=d&255);break;case 4193744:d=g.kd[e];break;case 4193746:d=M(this,g.Dc,a,b,c);0<=d&&(g.Dc=d);break;case 4193748:d=M(this,g.Ec[e],a,b,c);0<=d&&(g.Ec[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.ld[e];break;case 4193754:d=M(this,g.Fc[e],a,b,c);0<=d&& +(g.Fc[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.Zb[e]=g.Qa[e];d=g.Zb[e];break;case 4193760:d=g.hd[e];break;case 4193762:d=g.jd[e];break;case 4193764:d=g.fd[e];break;case 4193766:d=g.gd[e];break;case 4193768:d=M(this,g.$a,a,b,c);0<=d&&(g.$a=d&63,g.S=g.S&-769|(d&3)<<8);break;case 4193770:d=M(this,g.mc,a,b,c);0<=d&&(g.mc=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||Wb(this));break;case 4192514:d=M(this,e.Ab,a,b,c);0<=d&&(e.Ab=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.Wa,a,b,c);0<=d&&(e.Wa=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.lb:(d=M(this,f.lb,a,b,c),0<=d&&(70!==f.ib&&(d&=-49),f.lb=d,f.Ub[0]=d&4?15:7,f.Ub[1]=d&2?15:7,f.Ub[3]= +d&1?15:7,f.Tb&&(e=2,f.lb&16&&(e=1),this.g.pb=this.g.pb&-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.ib)return f.L(4,234);e=a>>2&31;d=f.Mb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=M(this,d,a,b,c),0<=d&&(f.Mb[e]=a&2?d<<16|f.Mb[e]&65535:f.Mb[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=Nb[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 lc={},Qb=(lc[65382]=[null,null,K.prototype.Wc,K.prototype.pd,"LKS"],lc[65402]=[null,null,K.prototype.Xc,K.prototype.qd,"MMR0"],lc[65534]=[null,null,K.prototype.Yc,K.prototype.rd,"PSW"],lc); +La(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.D,0,c>>2),sc(this,oc?tc:uc);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},Z:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},la: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},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<< +a)|b<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ua=!0},T:function(a,b){if(this.j&&null!=this.A){var c=this.j;zc(c,this.A+a,1,c.T)&&c.ja(!0)}return this.ic(a,b)},ea:function(a,b){if(this.j&&null!=this.A){var c=this.j;zc(c,this.A+a,2,c.T)&&c.ja(!0)}return this.jc(a,b)},qa:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;zc(d,this.A+a,1,d.G)&&d.ja(!0)}this.f?this.K(a, +b,c):this.ac(a,b,c)},za:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;zc(d,this.A+a,2,d.G)&&d.ja(!0)}this.f?this.K(a,b,c):this.qc(a,b,c)},R:function(a){return this.w[a]},Y:function(a,b){a=this.w[a];this.j&&F(this.j,128)&&E(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},$:function(a){return this.B.getUint16(a,!0)},ha:function(a,b){a=this.H[a>>1];this.j&&F(this.j,128)&&E(this.j,"Memory.readWord("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ma:function(a,b){this.w[a]=b; +this.Ua=!0},ua:function(a,b,c){this.w[a]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},xa:function(a,b){this.B.setUint16(a,b,!0);this.Ua=!0},Aa:function(a,b,c){this.H[a>>1]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0)}};function Ab(a,b,c){a.j=b;a.g=a.F=0;c&&((a.g=c.g)&&yc(a,xc,!1),(a.F=c.F)&&wc(a,xc,!1))} +function Ac(a,b){b?--a.F||(a.$b=a.f?a.K:a.ac,a.Ic=a.f?a.G:a.qc):--a.g||(a.Wb=a.ic,a.Bc=a.jc)}function wc(a,b,c){c&&a.F||(a.$b=!a.f&&b[1]||a.K,a.Ic=!a.f&&b[3]||a.G);if(c||void 0===c)a.ac=b[1]||a.K,a.qc=b[3]||a.G}function yc(a,b,c){c&&a.g||(a.Wb=b[0]||a.I,a.Bc=b[2]||a.N);if(c||void 0===c)a.ic=b[0]||a.I,a.jc=b[2]||a.N}function sc(a,b){b||(b=Bc);yc(a,b,void 0);wc(a,b,void 0)}var Bc=[],vc=[I.prototype.Z,I.prototype.wa,I.prototype.la,I.prototype.Ba],xc=[I.prototype.T,I.prototype.qa,I.prototype.ea,I.prototype.za]; +if(kb)var uc=[I.prototype.R,I.prototype.ma,I.prototype.$,I.prototype.xa],tc=[I.prototype.Y,I.prototype.ua,I.prototype.ha,I.prototype.Aa];function Cc(a,b){w.call(this,"CPU",a,Cc,1);var c=a.multiplier||1;this.Aa=a.cycles||b;this.Xa=c;this.ab=Math.round(this.Aa/1E4)/100;this.kb=this.ab*this.Xa;this.v.ga=!1;this.v.oc=!1;this.v.yb=a.autoStart;this.v.uc=!1;this.v.ob=!1;this.Fb=this.ha=0;this.Gb=a.csStart;this.qb=a.csInterval;this.rb=a.csStop;this.N=[];this.Sb=this.md.bind(this);G(this)}y(Cc); +var Dc=["power","reset"];k=Cc.prototype;k.Oa=function(a,b,c,d){this.D=a;this.F=b;this.j=d;for(b=0;b=a.ha&&(a.ha+=a.qb,c=!0);0<=a.rb&&a.rb<=Jc(a)&&(a.qb=a.rb=-1,Gc(a),a.ja(),c=!0);c&&a.i(Jc(a)+" cycles: checksum="+p(a.Fb))}} +function Kc(a,b,c,d){if(a.K[b]){void 0===c&&(jb(a,"Value for "+b+" is invalid"),a.ja());var e=a.j&&a.j.qa||8;c=!a.v.ga||a.v.uc?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.D)if(a=d.D,a.v.ia)a=!0;else{var b=null,c,h=bb(a.id);for(c=0;ca.Y/a.kb?b=1:d=!0;a.Xa=b;b=a.ab*a.Xa;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.K.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.D&&a.D.Nb()}Mc(a,a.T);a.T=0;a.R=ra();a.Z=0;Nc(a);return d}function Ob(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Pb(a,b,c){0<=b&&ba.N[b][0]&&(c*=a.Aa*a.Xa/1E3,a.N[b][0]=c)}function gd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b} +function hd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function id(a){a.$-=a.b;a.b=0} +k.md=function(){if(this.v.ga){this.nb>=this.Aa&&Nc(this,!0);this.ua=0;this.za=ra();if(this.Z){var a=this.za-this.Z;a>this.Db&&(this.R+=a,this.R>this.za&&(this.R=this.za))}try{do{var b=gd(this,this.v.ob?1:this.Ba);try{this.wb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.$-this.b;hd(this,c);this.ua+=c;this.T+=c;Mc(this,0,!0);Ic(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ba;15<=++this.Qb&&(this.D&&this.D.Fa(),this.Qb=0);break}}while(this.v.ga)}catch(e){this.ja();N(this);this.D&&this.D.stop(ra(), +Jc(this));jb(this,e.stack||e.message);return}if(this.v.ga){a=setTimeout;b=this.Sb;this.Z=ra();c=this.Db;this.ua&&(c=Math.round(c*this.ua/this.Ba));var c=c-(this.Z-this.za),d=this.Z-this.R;d&&(this.Y=Math.round(this.T/(10*d))/100,864E5<=d&&(this.ea=0,Lc(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.nb+=this.ua;this.Z+=c;a(b,c)}}}; +k.vb=function(a){if(ib(this))return!1;if(this.v.ga)return this.i(this.toString()+" busy"),!1;Lc(this);this.v.ga=!0;this.v.oc=!0;this.qa&&this.qa.start();var b=this.K.run;b&&(b.textContent="Halt");this.D&&(a&&this.D.Nb(!0),this.D.start(this.R,Jc(this)));N(this,!0);setTimeout(this.Sb,0);return!0};k.wb=function(){return 0}; +k.ja=function(a){if(this.v.ga){id(this);Mc(this,this.T);this.T=0;this.v.ga=!1;this.qa&&this.qa.stop();var b=this.K.run;b&&(b.textContent="Run");this.D&&this.D.stop(ra(),Jc(this));N(this)}this.v.complete=a};function N(a,b){a.D&&a.D.Fa(b)} +function jd(a){this.Vc=+a.model||1170;this.hc=a.resetAddr||0;Cc.call(this,a,6666667);this.Cb=0;this.decode=kd.bind(this);this.U=65536;this.V=32768;this.aa=65535;this.W=32768;this.O=15;this.u=[0,0,0,0,0,0,0,this.hc];this.Pa=[0,0,0,0,0,0];this.ya=[0,0,0,0];this.xa=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.Mb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.gc=[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.C=0;this.ib=70;this.ma=-1;ld(this);this.v.complete=this.v.Nc=!1}y(jd,Cc);k=jd.prototype;k.reset=function(){this.v.ga&&this.ja();ld(this);Fc(this);this.v.error=!1;this.parent.reset.call(this)}; +function ld(a){a.Za=255;a.J=0;a.lc=0;a.G=0;a.Ya=0;a.Yb=0;a.lb=0;a.Tb=0;a.wa=0;a.Ub=[7,7,7,7];a.w=[];a.C|=2;Rb(a)}function Rb(a){a.Tb?(a.zb=65536,a.ba=a.Qc):(a.zb=0,a.ba=a.Pc)}k.wc=function(){return 0};k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ea,this.Xa]);a.set(2,Kb(this.F));return a.data()}; +k.restore=function(a){var b=a[1];this.ea=b[1];Lc(this,b[3]);a:{b=this.F;a=a[2];var c;for(c=0;cb){a.w[f].La-=b;break}b-=a.w[f].La}a.w.splice(f+1,0,{La:b,Ac:c<<5&224,Hc:d,fc:e})}a.C|=2}function Sb(a){return a.O=a.O&63728|a.Na()|od(a)|nd(a)|md(a)} +function Tb(a,b){a.W=b<<12;a.aa=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.O)&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.O>>14&3;a.B!=c&&(a.ya[c]=a.u[6],a.u[6]=a.ya[a.B]);a.C|=2;a.O=b}function P(a,b){a.C&128||(a.W=a.aa=b,a.V=0)}function sd(a,b,c){a.C&128||(a.W=a.aa=a.U=b,a.V=c||0)}function td(a,b,c,d){a.C&128||(a.W=a.aa=a.U=b,a.V=(c^b)&(d^b))}function ud(a,b){a.C&128||(a.W=a.aa=a.U=b,a.V=a.W^a.U>>1)} +function vd(a,b,c,d){a.C&128||(a.W=a.aa=a.U=b,a.V=(c^d)&(d^b))}k.L=function(a){var b=!1;0>this.ma?this.ma=Sb(this):this.B||(a=4,b=!0);this.G&57344||(this.Ya=63222,this.Yb=a);this.B=0;var c=qd(this,a|65536),d=qd(this,a+2&65535|65536);Tb(this,d&-12289|this.ma>>2&12288);b&&(this.J|=4,this.u[6]=4);wd(this,this.ma);wd(this,this.u[7]);rd(this,c);this.C&=-113;this.ma=-1;throw a;};function xd(a){var b=yd(a),c=yd(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);rd(a,b);Tb(a,c);a.C&=-17} +function jc(a,b){var c=b>>13&31;31>c?a.lb&32&&(b=a.Mb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} +function zd(a,b,c){var d,e,f,g=0;if(c&a.Tb){d=b>>13&a.Ub[a.B];e=a.na[a.B][d];f=(a.na[a.B][d+16]<<6)+(b&8191)&4194303;a.lb&16?3932160<=f&&4186112>f&&(f=jc(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&3915776<=f&&(a.J|=32,a.L(4,12));switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.na[a.B][d]=e;if(4194170!== +f||a.B)a.wa=a.B,a.xa=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.L(168,16)),a.G&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=qd(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=qd(a,e)|g; +a.b-=8;break;case 6:return e=pd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=pd(a),e=e+a.u[c]&65535,e=qd(a,e|65536)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32?(a.J|=4,a.u[6]=4,a.L(4,24)):(a.J|=8,a.C|=64));return e}k.Pc=function(a,b,c){return Ad(this,a,b,c)};k.Qc=function(a,b,c){return zd(this,Ad(this,a,b,c),c)}; +function Bd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Ad(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=qd(a,d|c&65536),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.ya[a.O>>12&3];return c}function Cd(a,b,c,d){a.G&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Ad(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=zd(a,e|c&65536,4),a.B=a.O>>14&3,ic(a,e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.ya[a.O>>12&3]=d} +function Dd(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.ba(b,c,3),a=a.F.jb(c)):a=a.u[c]&255;return a}function Ed(a,b){var c;b>>=6;var d=a.I=b&7;(b=a.H=(b&56)>>3)?c=kc(a,a.ba(b,d,2)):c=a.u[d];return c}function Fd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Ad(a,b,c,8)}function Gd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.ba(b,c,3),a=a.F.jb(c)):a=a.u[c]&255;return a}function Hd(a,b){var c,d=a.f=b&7;(b=a.g=(b&56)>>3)?c=kc(a,a.ba(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.ba(b,e,7),c=d.call(a,c,a.F.jb(e)),e&1&&a.b--,a.F.Lb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),ic(a,e,d.call(a,c,kc(a,e)))):a.u[e]=d.call(a,c,a.u[e])}function Id(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),d&1&&a.b--,a.F.Lb(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 Jd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?ic(a,a.ba(b,d,4),c):a.u[d]=c&65535;return c}function T(a,b,c){c&&(rd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.wb=function(a){this.v.complete=!0;var b=this.v.Nc=this.j&&Kd(this.j),c=a?this.v.oc?0:1:-1;this.v.oc=!1;this.$=this.b=a;do{if(b){if(Ld(this.j,this.u[7],c)){this.ja();break}c=1}if(this.C&&(this.C&112&&(this.C&32?this.L(168,28):this.C&64?this.L(4,30):this.C&16&&this.L(12,32),this.C&=-113),this.C&7))if(this.C&2){this.C&=-3;a=null;for(var d=this.lc&224,e=this.w.length;0<=--e;){if(0d&&(d=this.w[e].Ac,a=this.w[e],this.w.splice(e,1))}d>(this.O&224)&&(this.C&4&&(this.u[7]=this.u[7]+2&65535,this.C&=-5),a?this.L(a.Hc,26):this.L(160,26))}else this.C&1&&this.C++;this.G&57344||(this.Ya=0,this.Yb=this.u[7]);this.C=this.C&7|this.O&16;this.decode(pd(this))}while(0>1|b<<16;ud(this,a);return a&65535}function Rd(a,b){a=b&2048|b>>1|b<<8;ud(this,a<<8);return a&255}function Sd(a,b){a=b&~a;P(this,a);return a}function Td(a,b){a=b&~a;P(this,a<<8);return a}function Ud(a,b){a|=b;P(this,a);return a} +function Vd(a,b){a|=b;P(this,a<<8);return a}function Wd(a,b){a=~b|65536;sd(this,a);return a&65535}function Xd(a,b){a=~b|256;sd(this,a<<8);return a&255}function Yd(a,b){a=b-a;this.C&128||(this.W=this.aa=a,this.V=b&(b^a));return a&65535}function Zd(a,b){a=b-a;var c=a<<8;b<<=8;this.C&128||(this.W=this.aa=c,this.V=b&(b^c));return a&255}function $d(a,b){a=b+a;this.C&128||(this.W=this.aa=a,this.V=a&(b^a));return a&65535} +function ae(a,b){a=b+a;var c=a<<8;this.C&128||(this.W=this.aa=c,this.V=c&(b<<8^c));return a&255}function be(a,b){a=-b;sd(this,a,a&b&32768);return a&65535}function ce(a,b){a=-b;sd(this,a<<8,(a&b&128)<<8);return a&255}function de(a,b){a=b<<1|this.U>>16&1;ud(this,a);return a&65535}function ee(a,b){a=b<<1|this.U>>16&1;ud(this,a<<8);return a&255}function fe(a,b){a=(this.U&65536|b)>>1|b<<16;ud(this,a);return a&65535}function ge(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ud(this,a<<8);return a&255} +function he(a,b){var c=b-a;vd(this,c,a,b);return c&65535}function ie(a,b){var c=b-a;vd(this,c<<8,a<<8,b<<8);return c&255}function je(a,b){this.C&128||(this.W=this.aa=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function ke(a,b){a^=b;P(this,a);return a&65535} +function le(a){var b=Hd(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.aa=c;this.b-=(this.g?6:7)+b} +function me(a){var b=Hd(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.aa=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.aa=1);a&8&&(this.W=0);this.b-=5} +function ne(a){var b=Hd(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.aa=d>>16|d,this.W=d>>16):(this.V=32768,this.aa=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.aa=this.W=0,this.V=32768,this.U=65536,this.b-=7}var oe=[0,7,7,10,7,11,9,13];function pe(a){var b=this.b;rd(this,Fd(this,a));this.b=b-oe[this.g]} +var qe=[0,14,14,17,14,18,16,20];function re(a){var b=this.b,c=Fd(this,a);a=a>>6&7;wd(this,this.u[a]);this.u[a]=this.u[7];rd(this,c);this.b=b-qe[this.g]}var se=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],te=[7,13,13,17,14,18,17,21];function ue(a){var b=Hd(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.C&128||(this.W=b>>16,this.aa=this.W|b,this.V=0,this.U=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)rd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Qe(a){R(this,a,0,je);this.b-=this.g?9:3+(7==this.f?2:0)}function Re(a){R(this,a,Ed(this,a),ke);this.b-=this.g?9:3+(7==this.f?2:0)}function W(){this.L(8,6)}function kd(a){Se[a>>12].call(this,a)} +var Se=[function(a){Te[a>>8&15].call(this,a)},function(a){var b=Ed(this,a),c=this.b;P(this,Jd(this,a,b));this.b=c-se[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=Ed(this,a);a=Hd(this,a);vd(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,Ed(this,a)&Hd(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){R(this,a,Ed(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){R(this,a,Ed(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){R(this,a,Ed(this,a),Md);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Ue[a>>8&15].call(this,a)},function(a){Ve[a>>8&15].call(this,a)},function(a){var b=Dd(this,a);P(this,Id(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=Dd(this,a)<<8;a=Gd(this,a)<<8;vd(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))<<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,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){Q(this,a,Dd(this,a),Vd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Ed(this,a),he);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},W],Te= +[function(a){We[a>>4&15].call(this,a)},function(a){T(this,a,!0)},function(a){T(this,a,!od(this))},function(a){T(this,a,od(this))},function(a){T(this,a,!this.Na()==!nd(this))},function(a){T(this,a,!this.Na()!=!nd(this))},function(a){T(this,a,!od(this)&&!this.Na()==!nd(this))},function(a){T(this,a,od(this)||!this.Na()!=!nd(this))},re,re,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)},function(a){$e[a>>6&3].call(this,a)},W,W],Xe=[function(a){sd(this, +Jd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Yd);this.b-=this.g?9:3+(7==this.f?2:0)}],Ye=[function(a){R(this,a,0,be);this.b-=this.g?11:6},function(a){R(this,a,md(this)?1:0,Md);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,md(this)?1:0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Hd(this,a);sd(this,a);this.b-=this.g?4:3+(7==this.f? +2:0)}],Ze=[function(a){R(this,a,0,fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Qd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Od);this.b-=this.g?9:3+(7==this.f?2:0)}],$e=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=qd(this,a|65536);rd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Bd(this,a,0);wd(this,a);P(this,a);this.b-=11},function(a){var b=yd(this),c=this.b;Cd(this,a, +0,b);P(this,b);this.b=c-te[this.g]},function(a){P(this,Jd(this,a,this.Na?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],We=[function(a){af[a&15].call(this,a)},W,W,W,pe,pe,pe,pe,function(a){if(a&8)this.L(8,6);else{var b=yd(this);a&=7;rd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.C|=1),this.b-=5):this.L(8,6)},function(a){bf[a&15].call(this,a)},function(a){cf[a&15].call(this,a)},Qe,Qe,Qe,Qe],af=[function(){this.O&49152?(this.J|=128,this.L(4, +3)):id(this);this.b-=7},function(){this.C|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){xd(this);this.C|=this.O&16;this.b-=13},function(){this.L(12,1);this.b-=5},function(){this.L(16,4);this.b-=25},function(){this.O&49152||(ld(this),this.F.reset());this.b-=667},function(){xd(this);this.b-=13},W,W,W,W,W,W,W,W,W],bf=[ve,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.W=0;this.b-=5},U,U,U,U,U,U,U],cf=[ve,function(){this.U= +65536;this.b-=5},function(){this.V=32768;this.b-=5},V,function(){this.aa=0;this.b-=5},V,V,V,function(){this.W=32768;this.b-=5},V,V,V,V,V,V,V],Ue=[ue,ue,ne,ne,le,le,me,me,Re,Re,W,W,W,W,we,we],Ve=[function(a){T(this,a,!this.Na())},function(a){T(this,a,this.Na())},function(a){T(this,a,!md(this)&&!od(this))},function(a){T(this,a,md(this)||od(this))},function(a){T(this,a,!nd(this))},function(a){T(this,a,nd(this))},function(a){T(this,a,!md(this))},function(a){T(this,a,md(this))},function(){this.L(24,2); +this.b-=25},function(){this.L(28,5);this.b-=5},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)},function(a){gf[a>>6&3].call(this,a)},W,W],df=[function(a){sd(this,Id(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Xd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Zd);this.b-=this.g?9:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,ce);this.b-= +this.g?11:6},function(a){Q(this,a,md(this)?1:0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,md(this)?1:0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);sd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],ff=[function(a){Q(this,a,0,ge);this.b-=this.g?9+(this.fb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Rd);this.b-=this.g?9+(this.fb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Pd);this.b-=this.g?9:3+(7== +this.f?2:0)}],gf=[W,function(a){a=Bd(this,a,65536);wd(this,a);P(this,a);this.b-=11},function(a){var b=yd(this),c=this.b;Cd(this,a,65536,b);P(this,b);this.b=c-te[this.g]},W];function hf(a){w.call(this,"ROM",a,hf);this.f=null;this.B=a.addr;this.g=a.size;this.G=a.writable;this.D=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){jf(c,a,b,f)})}}y(hf); +hf.prototype.Oa=function(a,b,c,d){this.F=b;this.b=c;this.j=d;kf(this)};hf.prototype.Ja=function(){if(this.Ka){if(this.j){var a=this.j,b=this.id,c=this.B,d=this.g,e=this.Ka,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.sc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({xd:b,A:c,Sc:d,Ka:e,rc:f})}delete this.Ka}return!0};hf.prototype.Ia=function(){return!0}; +function jf(a,b,c,d){if(d)a.sa("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.cc,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.Ka=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.ca].ac(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.D?b.push(a.D):null!=a.D&&a.D.length&&(b=a.D);for(c=0;c>> +e.ca;0>>=e.ca;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.I=cb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.N=d.receiveData){this.status(this.cc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ja=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +k.Ia=function(a){return a?this.save():!0};k.reset=function(){pf(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return pf(this)};function pf(a){a.Y=0;a.f=0;a.g=128;a.B=[];return!0}k.kc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.Z||8,c=a-this.H%a,this.Z&&(b=na("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.i(this.G), +this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;L(this.b,100,4,52,this.T)}};var qf={},of=(qf[65392]=[null,null,Y.prototype.$c,Y.prototype.td,"RCSR"],qf[65394]=[null,null,Y.prototype.Zc,Y.prototype.sd,"RBUF"],qf[65396]=[null,null,Y.prototype.bd,Y.prototype.vd,"XCSR"],qf[65398]=[null,null,Y.prototype.ad,Y.prototype.ud,"XBUF"],qf);La(function(){for(var a=D(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};rf.prototype.xc=function(){return-1};rf.prototype.yc=function(){}; +function tf(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.$?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 uf(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=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);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 zf(a,b){if(b)return yf(a,b,a.ha[b]);var c=0;for(b in a.ha)yf(a,b,a.ha[b]),c++;return 0>>d.H.ca;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.ca].Nb(d&c.f,d),this.g--,b&&If(a,b));return c}; -k.Ha=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(this.g++,c=Kb(this.H,d),this.g--,b&&If(a,b));return c};k.Rb=function(a,b,c){var d=this.ba(a,!0,1);if(-1!==d){this.g++;var e=this.H;e.O[(d&e.g)>>>e.ca].Bb(d&e.f,b&255,d);this.g--;c&&If(a,c);N(this.b,!0)}};k.nb=function(a,b,c){var d=this.ba(a,!0,2);if(-1!==d){this.g++;var e=this.H,f=d&e.f,g=(d&e.g)>>>e.ca;f!=e.f?e.O[g].qc(f,b&65535,d):(e.O[g++].Bb(f,b&255,d),e.O[g&e.C].Bb(0,b>>8&255,d+1));this.g--;c&&If(a,c);N(this.b,!0)}}; -function Z(a){return{A:a,Ga:!1}}function Jf(a){return[a.A,a.Ga]}function Kf(a){return{A:a[0],Ga:a[1]}}function Hf(a,b,c){var d;c=(c?a.S:a.ob).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.yc=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.ya[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.za.push(a):this.xa&&a==this.xa||(this.xa=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.N||!a.N.length){a.N=Array(1E3);for(b=0;b>>d.ca],!1)}a.U=["br"];if(a.F)for(b=1;b>>d.ca],!0);a.F=["bw"];a.Cb=0} -k.gb=function(a,b,c){var d=!0;c||Rf(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.i("invalid address: "+J(this,b.A)),d=!1;else{var f=this.H;f.O[e>>>f.ca].gb(e&f.f,a==this.F)}}d&&(a.push(b),c?b.Ga=!0:(Sf(this,a,a.length-1,"set"),Bf(this)));return d};function Rf(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ca],b==a.F));h.Ga||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.Ha(q,2),v="#"+J(u,A,0,!0));break;case 24:7>z?v="@("+Mf(z)+")+":(A=u.Ha(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.Ha(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.Ha(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.ya[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.tc=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.$&&(a.i("ended assemble at "+J(a,a.Z.A)),a.S=a.Z,a.$=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=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 Qc=[];"call"==Be&&(lb=1E5,Qc=["CALL"]);for(void 0!==Ae&&a.i(X+" instructions earlier:");0=ja.length&&(ba=0);a.Fb=X;De++;lb--}}De||(a.i("no "+Ce+"history available"),a.Fb=void 0)}else{var Zb=Hf(a,ia);if(Zb){var $b=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),$b=wf(a,za)>>>0,65536<$b&&($b=65536));for(var nb="",Ra="dd"==Oa?4:"dw"==Oa?2:1,ac=Ra*$b||128,yg=ac+15>>4||1;yg--&&0bc?String.fromCharCode(bc):".";ac--}nb&&(nb+="\n");nb+=ia+" "+Sc+(0==pb?" "+Ge:"")}nb&&a.i(nb);a.ob=Zb}}}}break;case "e":if("else"==g[0])break;var Sa,Tc,Uc,Vc,Wc=g[0],Xc=g[1];"eb"==Wc?(Sa=1,Tc=255,Uc=a.jb,Vc=a.Rb):"e"==Wc||"ew"==Wc?(Sa=2,Tc=65535,Uc=a.Ha,Vc=a.nb):Xc=null;if(null==Xc)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 cc=Hf(a,Xc);if(cc)for(var dc=2;dc$c;){for(var Aa=null,Cg=256;65536>sb.A>>>0;){ad.A=a.Ha(sb,2);if(null==sb.A||!Cg--)break;if(!(ad.A&1)){for(var Dg=a,ec=ad,Ie=null,tb=ec.A, -Je=tb,bd=1;6>=bd&&tb;bd++){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.1","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 PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== -f&&"no machine state"!=g?(this.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.N}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.Eb());this.Y&&(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 PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};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.1"),g=new O(a,"1.30.1","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ja(),d=a.b.Ia(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>)/,"$1PDPjs$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.1/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;})(); +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=Af.prototype; +k.Oa=function(a,b,c,d){this.F=b;this.b=c;this.D=a;(a=Ec(a,"messages"))&&Df(this,a);this.Db=Gf;Hf(this,function(a){a:{var b=d.F.X,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(If(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.F.ca;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=Ib[c],n&&d.i(p(n.id,8)+" %"+p(e<>>c.ca].ic(d&c.f,d),this.g--,b&&Jf(a,b));return c}; +k.Ha=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(this.g++,c=Jb(this.F,d),this.g--,b&&Jf(a,b));return c};k.Lb=function(a,b,c){var d=this.ba(a,!0,1);if(-1!==d){this.g++;var e=this.F;e.X[(d&e.g)>>>e.ca].ac(d&e.f,b&255,d);this.g--;c&&Jf(a,c);N(this.b,!0)}};k.nc=function(a,b,c){var d=this.ba(a,!0,2);if(-1!==d){this.g++;var e=this.F;e.X[(d&e.g)>>>e.ca].qc(d&e.f,b&65535,d);this.g--;c&&Jf(a,c);N(this.b,!0)}};function Z(a){return{A:a,Ga:!1}}function Kf(a){return[a.A,a.Ga]} +function Lf(a){return{A:a[0],Ga:a[1]}}function If(a,b,c){var d;c=(c?a.R:a.nb).A;if(void 0!==b){d=b=wf(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.yc=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.ya[a-16]:20==a&&(b=Sb(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.za.push(a):this.xa&&a==this.xa||(this.xa=a,this.ka&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,id(a),a.la=0,N(a))))}; +function Cf(a){var b;if(Kd(a)){if(!a.N||!a.N.length){a.N=Array(1E3);for(b=0;b>>d.ca],!1)}a.T=["br"];if(a.G)for(b=1;b>>d.ca],!0);a.G=["bw"];a.zb=0} +k.gb=function(a,b,c){var d=!0;c||Sf(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.i("invalid address: "+J(this,b.A)),d=!1;else{var f=this.F;f.X[e>>>f.ca].gb(e&f.f,a==this.G)}}d&&(a.push(b),c?b.Ga=!0:(Tf(this,a,a.length-1,"set"),Cf(this)));return d};function Sf(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ca],b==a.G));h.Ga||Cf(a);break}}return f} +function Uf(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=Nf(z);break;case 8:v="@"+Nf(z);break;case 16:7>z?v="("+Nf(z)+ +")+":(A=u.Ha(q,2),v="#"+J(u,A,0,!0));break;case 24:7>z?v="@("+Nf(z)+")+":(A=u.Ha(q,2),v="@#"+J(u,A,0,!0));break;case 32:v="-("+Nf(z)+")";break;case 40:v="@-("+Nf(z)+")";break;case 48:A=u.Ha(q,2);v=J(u,A,0,!0)+"("+Nf(z)+")";7==z&&(v=[v,J(u,A+q.A&65535)]);break;case 56:A=u.Ha(q,2),v="@"+J(u,A)+"("+Nf(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=Nf(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.ya[b-16]):20==b&&(c="PS="+J(a,Sb(d)));c&&(c+=" ");return c}function Zf(a){var b,c="";for(b=0;6>b;b++)c+=Yf(a,b);c=c+"\n"+(Yf(a,6)+Yf(a,7)+Yf(a,20));return c+=Xf(a,"T")+Xf(a,"N")+Xf(a,"Z")+Xf(a,"V")+Xf(a,"C")}k.sc=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Sc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}N(d);a.i("updated registers:")}a.i(Zf(a));c&&(a.R=Z(d.u[7]),Qf(a,J(a,a.R.A)))}}function dg(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=Wf(a,b,g,f);a.i(f);a.R=b;e-=b.A-l;c++}}} +function Vf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.$&&(a.i("ended assemble at "+J(a,a.Z.A)),a.R=a.Z,a.$=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(hb(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 Rc=[];"call"==Ce&&(lb=1E5,Rc=["CALL"]);for(void 0!==Be&&a.i(X+" instructions earlier:");0=ja.length&&(ba=0);a.Cb=X;Ee++;lb--}}Ee||(a.i("no "+De+"history available"),a.Cb=void 0)}else{var Yb=If(a,ia);if(Yb){var Zb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||xg),Zb=xf(a,za)>>>0,65536>4||1;zg--&&0<$b;){var ac=0,Sc=0,pb,Tc="",He="",ia=J(a,Yb.A);for(pb=4==ob?16:a.qa;0bc?String.fromCharCode(bc):".";$b--}nb&&(nb+="\n");nb+=ia+" "+Tc+(0==pb?" "+He:"")}nb&&a.i(nb);a.nb=Yb}}}}break;case "e":if("else"==g[0])break;var Ra,Uc,Vc,Wc,Xc=g[0],Yc=g[1];"eb"==Xc?(Ra=1,Uc=255,Vc=a.jb,Wc=a.Lb):"e"==Xc||"ew"==Xc?(Ra=2,Uc=65535,Vc=a.Ha,Wc=a.nc):Yc=null;if(null==Yc)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 cc=If(a,Yc);if(cc)for(var dc=2;dcad;){for(var Aa=null,Dg=256;65536>sb.A>>>0;){bd.A=a.Ha(sb,2);if(null==sb.A||!Dg--)break;if(!(bd.A&1)){for(var Eg=a,ec=bd,Je=null,tb=ec.A,Ke=tb,cd=1;6>=cd&& +tb;cd++){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;big){if(kg(d,this.I)){this.B=new O(this,"1.30.1","failsafe");kg(this.B)&&(pg(this,d),a=2,qg(this.B));this.B.set("timestamp",sa());rg(this.B);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=og(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?kg(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),qg(d),kg(d)?(c=og(d),e=!0):c=!1))}e&&ng(this,c?d:null)}else 2==a&&d.clear()}else ng(this);delete this.I;delete this.N}e=bb(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&&(sg(this,this.b,b,c,a),this.b.yb());this.Y&&(pg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.D=0}; +function pg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.url;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} +function fg(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ja(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var h=bb(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>)/,"$1PDPjs$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);Kg(a,b,c)}})}else c(a,null)} +function Lg(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&&(--wg||Sa(!0));l=!1}var g,h,l=!0;wg++;$a[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.1/components.xsl");m=function(d,h){h?Ig(c,null,null,!1,e,function(d,l){l?(ab(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--wg||Sa(!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),--wg||Sa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ig(b,a,d,!0,e,m):Jg(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){Sa(!1);return Lg(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ta;})(); diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 5453be8f6..a1de16dfc 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -9,144 +9,143 @@ 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.fb=this.id:(this.wb=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Lc:!1,Mc:!1,P:!1,error:!1};this.nb=null;this.i.error=!1;this.w={};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.Mb=b.comment;this.fc=b;b=this.id.indexOf(".");0>b?this.cb=this.id:(this.wb=this.id.substr(0,b),this.cb=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Lc:!1,Mc:!1,P:!1,error:!1};this.lb=null;this.i.error=!1;this.A={};this.K=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.A=null;this.Xa=this.I;a=new G;Ma(a,this.K);this.b=Array(this.m);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.qa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=d.Xa(b|4186112,-1,1)} -function Oa(a,b,c){var d=!1,e=this.controller,f=e.qa[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.qa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||e.Xa(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.Xa(b|4186112,-1,0)} -function Qa(a,b,c){var d=!1,e=this.controller;if(a=e.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||e.Xa(c|4186112,b,0)}La.prototype.reset=function(){this.A&&this.A()};La.prototype.I=function(){return 0};La.prototype.la=function(a,b){b||this.reset();return!0}; -function Ra(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.c;0g&&(q=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.Ta)return l.tb+=l.Ta-f,l.Ta=f,!0;if(f>=l.Ta+l.tb){q=l.size-(f-m);q>g&&(q=g);l.tb=f-l.Ta+q;f=m+a.g;g-=q;h++;continue}}return Ta(1,f,g)}f=new G(f,q,a.g,d,e);Ma(f,a.K,l);a.b[h++]=f;f=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].Za(b&a.h,b)} -function Wa(a,b,c){var d=b&a.h,e=(b&a.j)>>>a.c;d!=a.h?a.b[e].Hc(d,c&65535,b):(a.b[e++].Sa(d,c&255,b),a.b[e&a.H].Sa(0,c>>8&255,b+1))}function Xa(a){for(var b=0,c=[],d=0;d>1)+2;10>this.c&&(this.c=10);15>2;this.h=this.g-1;this.o=this.l/this.g|0;this.qa=[];this.m=null;this.Wa=this.G;a=new G;Ma(a,this.K);this.b=Array(this.o);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.qa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=d.Wa(b|4186112,-1,1)}function Oa(a,b,c){var d=!1,e=this.controller,f=e.qa[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.qa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||e.Wa(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.Wa(b|4186112,-1,0)}function Qa(a,b,c){var d=!1,e=this.controller;if(a=e.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||e.Wa(c|4186112,b,0)}La.prototype.reset=function(){this.m&&this.m()};La.prototype.G=function(){return 0};La.prototype.la=function(a,b){b||this.reset();return!0}; +function Ra(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.c;0g&&(q=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.Sa)return l.sb+=l.Sa-f,l.Sa=f,!0;if(f>=l.Sa+l.sb){q=l.size-(f-m);q>g&&(q=g);l.sb=f-l.Sa+q;f=m+a.g;g-=q;h++;continue}}return Ta(1,f,g)}f=new G(f,q,a.g,d,e);Ma(f,a.K,l);a.b[h++]=f;f=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.u)>>>a.c].Cb(b&a.h,b)} +function Wa(a){for(var b=0,c=[],d=0;d>5&3;c.hb=a>>1&15;c.ob=a&257?a&1?6:4:0;db(c);a=c.G;a&1|256&&(b=this.a.Ka&16?1:2);this.c.Na=this.c.Na&-8|b};k.lc=function(){return eb(this.a)};k.Ec=function(a){fb(this.a,a&-1809|eb(this.a)&1808);this.a.l|=128}; -function gb(a){var b=a.g,c,d,e,f=b.X>>13&7;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.rc,drive:f,blocksize:256,mapped:0,maxblock:b.Ia[f]*b.J[f],url:"rk"+f+".dsk"});b.D&=-129;switch(b.D>>1&7){case 0:b.ab=2496;b.S=0;b.D=128;b.X=0;break;case 1:if((b.X>>4&511)>=b.Ia[f]){b.S|=32832;b.D|=49152;break}if((b.X&15)>=b.J[f]){b.S|=32800;b.D|=49152;break}c=(b.X>>4&511)*b.J[f]+(b.X&15);d=(b.D&48)<<12|b.$a;e=65536-b.bb&65535;hb(a,b.T[f],c,d,e);return;case 2:if((b.X>>4&511)>=b.Ia[f])b.S|=32832, -b.D|=49152;else if((b.X&15)>=b.J[f])b.S|=32800,b.D|=49152;else{c=(b.X>>4&511)*b.J[f]+(b.X&15);d=(b.D&48)<<12|b.$a;e=65536-b.bb&65535;a.qb(b.T[f],c,d,e);return}}b.ab=f<<13|b.ab&8176|b.X%9&15;I(a.a,20,5,144,function(){b.D=b.D&65534|128;return!!(b.D&64)})}k.rc=function(a,b,c,d,e){var f=this.g;f.$a=d&65535;f.D=f.D&-49|d>>12&48;f.bb=65536-e&65535;switch(a){case 1:f.S|=33024;f.D|=49152;break;case 2:f.S|=33792,f.D|=49152}I(this.a,20,5,144,function(){f.D=f.D&65534|128;return!!(f.D&64)})}; -function ib(a){var b=a.h,c,d,e,f=b.u>>8&3;b.u&=-2;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.sc,drive:f,blocksize:128,mapped:1,maxblock:b.Ia[f]*b.J[f],url:"rl"+f+".dsk"});switch(b.u>>1&7){case 2:b.xa&8&&(b.u&=63);b.xa=b.ac[f]|b.Ba&64;break;case 3:1==(b.L&3)&&(b.Ba=b.L&4?b.Ba+(b.L&65408)&65408|b.L<<2&64:b.Ba-(b.L&65408)&65408|b.L<<2&64,b.L=b.Ba);break;case 4:b.xa=b.Ba;break;case 5:if(b.L>>6>=b.Ia[f]){b.u|=37888;break}if((b.L&63)>=b.J[f]){b.u|=37888;break}c=(b.L>>6)*b.J[f]+(b.L&63); -d=(b.ra&63)<<16|b.Wa;e=65536-b.xa&65535;hb(a,b.T[f],c,d,e);return;case 6:if(b.L>>6>=b.Ia[f])b.u|=37888;else if((b.L&63)>=b.J[f])b.u|=37888;else{c=(b.L>>6)*b.J[f]+(b.L&63);d=(b.ra&63)<<16|b.Wa;e=65536-b.xa&65535;a.qb(b.T[f],c,d,e);return}}I(a.a,20,5,112,function(){b.u|=129;return!!(b.u&64)})} -k.sc=function(a,b,c,d,e){var f=this.h;f.Wa=d&65535;f.u=f.u&-49|d>>12&48;f.ra=d>>16&63;f.L=~~(c/f.J[b.ja])<<6|c%f.J[b.ja];f.Ba=f.L;f.xa=65536-e&65535;switch(a){case 1:f.u|=33792;break;case 2:f.u|=40960}I(this.a,20,5,112,function(){f.u|=129;return!!(f.u&64)})};function jb(a){a=a.j;a.F=2176;a.aa=0;a.V=[4544,4544,4544,4544,4544,4544,4544,4544];a.Pa=[0,0,0,0,0,0,0,0];a.Ma=a.Qa=a.Oa=a.Aa=a.Fb=0} -function kb(a,b){var c=a.j,d,e,f;c.F&=-16513;c.aa&=-2049;c.V[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.tc,drive:b,blocksize:256,mapped:0,maxblock:c.ub[0]*c.Ha[0]*c.J[0],url:"rp"+b+".dsk"});switch(c.F&63){case 5:c.sb[b]=c.ma[b];c.F|=32896;c.V[b]|=32896;c.Ma|=1<=c.ub[0]||c.ba[b]>>8>=c.Ha[0]||(c.ba[b]&255)>=c.J[0]){c.Pa[b]|=1024;c.F|=49152;break}d=(c.ma[b]*c.Ha[0]+(c.ba[b]>>8))*c.J[0]+ -(c.ba[b]&255);e=(c.Aa&63)<<16|c.Oa;f=65536-c.Qa&65535;hb(a,c.T[b],d,e,f);return;case 57:if(c.ma[b]>=c.ub[0]||c.ba[b]>>8>=c.Ha[0]||(c.ba[b]&255)>=c.J[0])c.Pa[b]|=1024,c.F|=49152;else{d=(c.ma[b]*c.Ha[0]+(c.ba[b]>>8))*c.J[0]+(c.ba[b]&255);e=(c.Aa&63)<<16|c.Oa;f=65536-c.Qa&65535;a.qb(c.T[b],d,e,f);return}}I(a.a,3,5,172,function(){c.F=c.F&65534|128;c.V[b]|=128;return!!(c.F&64)})} -k.tc=function(a,b,c,d,e){var f=this.j;f.Qa=65536-e&65535;f.Oa=d&65535;f.F=f.F&-769|d>>8&768;f.Aa=d>>16&63;e=~~(c/f.J[0]);d=~~(e/f.Ha[0]);f.ba[b.ja]=e%f.Ha[0]<<8|c%f.J[0];f.sb[b.ja]=f.ma[b.ja]=d;f.Ma|=1<=b.ic-1&&(f.V[b.ja]|=1024);switch(a){case 1:f.aa|=512;f.F|=49152;break;case 2:f.aa|=2048,f.F|=49152}I(this.a,20,5,172,function(){f.V[b.ja]|=128;f.F=f.F&65534|128;return!!(f.F&64)})}; -function lb(a,b,c,d,e,f){var g=~~((f+c.sa-1)/c.sa),h=new XMLHttpRequest;2048>g&&d+2048g){b.Cb(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.Cb(0,b,c,d,e)}k.reset=function(){this.c.Na=this.c.Na&-120|20;this.b.wa=0;this.g.D=128;this.h.u=128;jb(this)}; -k.$b=function(a,b,c){var d,e,f=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.za&65280:(a&1&&(b<<=8),f.za=b|255,d=0);break;case 4194298:if(0>b)d=f.Eb;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.Eb=d;f.l|=2}break;case 4194294:if(70!==f.Ja)return K(f,4);0>b?d=f.s:d=f.s=0;break;case 4194292:if(70!==f.Ja)return K(f,4);d=1;break;case 4194290:if(70!==f.Ja)return K(f,4);d=0;break;case 4194288:if(70!==f.Ja)return K(f,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!==f.Ja)return K(f,4);e=a-4194272>>1;0>b?d=f.Ab[e]:(d=J(this,f.Ab[e],a,b,c),0<=d&&(f.Ab[e]=d));break;case 4194254:return a&1?f.C>>14&1?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.da[3]=b),d=f.da[3]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.da[1]=b),d=f.da[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.C&2048?(0<=b&&(f.f[e]=b),d=f.f[e]):(0<=b&&(f.La[e]=b),d=f.La[e]),d;case 4194246:return a& -1?(0<=b&&(f.f[7]=b),d=f.f[7]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.da[0]=b),d=f.da[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.C&2048?(0<=b&&(f.La[e]=b),d=f.La[e]):(0<=b&&(f.f[e]=b),d=f.f[e]),d;default:return f.s|=16,K(f,4)}break;case 4194176:e=a>>1&31;d=J(this,f.R[3][e],a,b,c);0<=d&&(f.R[3][e]=d,f.R[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=J(this,f.rb,a,b,c);0<=d&&(f.rb=d);break;case 4194172:d=f.ya;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194168:0> -b?d=this.c.Bc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;default:return f.s|=16,K(f,4)}break;case 4194048:e=this.g;switch(a&-2){case 4194048:d=J(this,e.ab,a,b,c);0<=d&&(e.ab=d);break;case 4194050:d=J(this,e.S,a,b,c);0<=d&&(e.S=d);break;case 4194052:d=J(this,e.D,a,b,c);0<=b&&0<=d&&(e.D=d&-36993|e.D&36992,e.D&1&&gb(this));break;case 4194054:d=J(this,e.bb,a,b,c);0<=d&&(e.bb=d);break;case 4194056:d=J(this,e.$a,a,b,c);0<=d&&(e.$a=d);break;case 4194058:d=J(this,e.X,a,b,c);0<=d&&(e.X= -d);break;case 4194060:break;case 4194062:d=J(this,e.Sb,a,b,c);0<=d&&(e.Sb=d);break;default:return f.s|=16,K(f,4)}break;case 4193728:var g=this.j;e=g.aa&7;switch(a&-2){case 4193728:d=J(this,g.F,a,b,c);0<=b&&0<=d&&(g.Aa=g.Aa&60|d>>8&3,g.F=d&17279|g.F&34944|2048,d&1&&g.F&128?kb(this,e):192==(d&192)&&I(f,0,5,172));break;case 4193730:d=J(this,g.Qa,a,b,c);0<=d&&(g.Qa=d);break;case 4193732:d=J(this,g.Oa,a,b,c);0<=d&&(g.Oa=d&65534);break;case 4193734:d=J(this,g.ba[e],a,b,c);0<=d&&(g.ba[e]=d&7967);break;case 4193736:d= -J(this,g.aa,a,b,c);0<=d&&(g.aa=d&63|g.aa&65472,d&128&&jb(this));break;case 4193738:d=g.V[e];break;case 4193740:d=g.Pa[e];break;case 4193742:d=J(this,g.Ma,a,b,c);0<=d&&(g.Ma=d&255);break;case 4193744:d=g.yc[e];break;case 4193746:d=J(this,g.Tb,a,b,c);0<=d&&(g.Tb=d);break;case 4193748:d=J(this,g.Ub[e],a,b,c);0<=d&&(g.Ub[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.zc[e];break;case 4193754:d=J(this,g.Vb[e],a,b,c);0<=d&&(g.Vb[e]=d);break;case 4193756:d=J(this,g.ma[e],a,b,c);0<=d&&(g.ma[e]= -d&511);break;case 4193758:g.sb[e]=g.ma[e];d=g.sb[e];break;case 4193760:d=g.wc[e];break;case 4193762:d=g.xc[e];break;case 4193764:d=g.uc[e];break;case 4193766:d=g.vc[e];break;case 4193768:d=J(this,g.Aa,a,b,c);0<=d&&(g.Aa=d&63,g.F=g.F&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Fb,a,b,c);0<=d&&(g.Fb=d);break;default:return f.s|=16,K(f,4)}break;case 4192512:e=this.h;switch(a&-2){case 4192512:d=J(this,e.u,a,b,c);0<=b&&0<=d&&(e.ra=e.ra&60|d>>4&3,e.u=e.u&-1023|d&1022,e.u&128||ib(this));break;case 4192514:d= -J(this,e.Wa,a,b,c);0<=d&&(e.Wa=d&65534);break;case 4192516:d=J(this,e.L,a,b,c);0<=d&&(e.L=d);break;case 4192518:d=J(this,e.xa,a,b,c);0<=d&&(e.xa=d);break;case 4192520:d=J(this,e.ra,a,b,c);0<=d&&(e.ra=d&63,e.u=e.u&-49|(e.ra&3)<<4);break;default:return f.s|=16,K(f,4)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.Ka:(d=J(this,f.Ka,a,b,c),0<=d&&(70!==f.Ja&&(d&=-49),f.Ka=d,f.pb[0]=d&4?15:7,f.pb[1]=d&2?15:7,f.pb[3]=d&1?15:7,f.ob&&(e=2,f.Ka&16&&(e=1),this.c.Na=this.c.Na&-8|e)));break;default:return f.s|= -16,K(f,4)}break;case 4191424:e=a>>1&31;d=J(this,f.R[0][e],a,b,c);0<=d&&(f.R[0][e]=d,f.R[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=J(this,f.R[1][e],a,b,c);0<=d&&(f.R[1][e]=d,f.R[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.Ja)return K(f,4);e=a>>2&31;d=f.cb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(f.cb[e]=a&2?d<<16|f.cb[e]&65535:f.cb[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=$a[a>>1&255];else return f.s|=16,K(f,4);break;default:return f.s|=16,K(f,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.jc,H.prototype.Cc,"LKS"],ob[65402]=[null,null,H.prototype.kc,H.prototype.Dc,"MMR0"],ob[65534]=[null,null,H.prototype.lc,H.prototype.Ec,"PSW"],ob);u(function(){for(var a=D(document,"pdp11","device"),b=0;b>5&3;c.fb=a>>1&15;c.mb=a&257?a&1?6:4:0;cb(c);a=c.G;a&1|256&&(b=this.a.Ja&16?1:2);this.c.Ma=this.c.Ma&-8|b};k.lc=function(){return db(this.a)};k.Ec=function(a){eb(this.a,a&-1809|db(this.a)&1808);this.a.j|=128}; +function fb(a){var b=a.g,c,d,e,f=b.X>>13&7;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.rc,drive:f,blocksize:256,mapped:0,maxblock:b.Ha[f]*b.J[f],url:"rk"+f+".dsk"});b.D&=-129;switch(b.D>>1&7){case 0:b.Za=2496;b.S=0;b.D=128;b.X=0;break;case 1:if((b.X>>4&511)>=b.Ha[f]){b.S|=32832;b.D|=49152;break}if((b.X&15)>=b.J[f]){b.S|=32800;b.D|=49152;break}c=(b.X>>4&511)*b.J[f]+(b.X&15);d=(b.D&48)<<12|b.Ya;e=65536-b.$a&65535;gb(a,b.T[f],c,d,e);return;case 2:if((b.X>>4&511)>=b.Ha[f])b.S|=32832, +b.D|=49152;else if((b.X&15)>=b.J[f])b.S|=32800,b.D|=49152;else{c=(b.X>>4&511)*b.J[f]+(b.X&15);d=(b.D&48)<<12|b.Ya;e=65536-b.$a&65535;a.pb(b.T[f],c,d,e);return}}b.Za=f<<13|b.Za&8176|b.X%9&15;I(a.a,20,5,144,function(){b.D=b.D&65534|128;return!!(b.D&64)})}k.rc=function(a,b,c,d,e){var f=this.g;f.Ya=d&65535;f.D=f.D&-49|d>>12&48;f.$a=65536-e&65535;switch(a){case 1:f.S|=33024;f.D|=49152;break;case 2:f.S|=33792,f.D|=49152}I(this.a,20,5,144,function(){f.D=f.D&65534|128;return!!(f.D&64)})}; +function hb(a){var b=a.h,c,d,e,f=b.v>>8&3;b.v&=-2;"undefined"===typeof b.T[f]&&(b.T[f]={cache:[],postProcess:a.sc,drive:f,blocksize:128,mapped:1,maxblock:b.Ha[f]*b.J[f],url:"rl"+f+".dsk"});switch(b.v>>1&7){case 2:b.xa&8&&(b.v&=63);b.xa=b.$b[f]|b.Ba&64;break;case 3:1==(b.L&3)&&(b.Ba=b.L&4?b.Ba+(b.L&65408)&65408|b.L<<2&64:b.Ba-(b.L&65408)&65408|b.L<<2&64,b.L=b.Ba);break;case 4:b.xa=b.Ba;break;case 5:if(b.L>>6>=b.Ha[f]){b.v|=37888;break}if((b.L&63)>=b.J[f]){b.v|=37888;break}c=(b.L>>6)*b.J[f]+(b.L&63); +d=(b.ra&63)<<16|b.Va;e=65536-b.xa&65535;gb(a,b.T[f],c,d,e);return;case 6:if(b.L>>6>=b.Ha[f])b.v|=37888;else if((b.L&63)>=b.J[f])b.v|=37888;else{c=(b.L>>6)*b.J[f]+(b.L&63);d=(b.ra&63)<<16|b.Va;e=65536-b.xa&65535;a.pb(b.T[f],c,d,e);return}}I(a.a,20,5,112,function(){b.v|=129;return!!(b.v&64)})} +k.sc=function(a,b,c,d,e){var f=this.h;f.Va=d&65535;f.v=f.v&-49|d>>12&48;f.ra=d>>16&63;f.L=~~(c/f.J[b.ja])<<6|c%f.J[b.ja];f.Ba=f.L;f.xa=65536-e&65535;switch(a){case 1:f.v|=33792;break;case 2:f.v|=40960}I(this.a,20,5,112,function(){f.v|=129;return!!(f.v&64)})};function ib(a){a=a.l;a.F=2176;a.aa=0;a.V=[4544,4544,4544,4544,4544,4544,4544,4544];a.Oa=[0,0,0,0,0,0,0,0];a.La=a.Pa=a.Na=a.Aa=a.Fb=0} +function jb(a,b){var c=a.l,d,e,f;c.F&=-16513;c.aa&=-2049;c.V[b]&=-1153;I(a.a,-1,0,172);"undefined"===typeof c.T[b]&&(c.T[b]={cache:[],postProcess:a.tc,drive:b,blocksize:256,mapped:0,maxblock:c.ub[0]*c.Ga[0]*c.J[0],url:"rp"+b+".dsk"});switch(c.F&63){case 5:c.rb[b]=c.ma[b];c.F|=32896;c.V[b]|=32896;c.La|=1<=c.ub[0]||c.ba[b]>>8>=c.Ga[0]||(c.ba[b]&255)>=c.J[0]){c.Oa[b]|=1024;c.F|=49152;break}d=(c.ma[b]*c.Ga[0]+(c.ba[b]>>8))*c.J[0]+ +(c.ba[b]&255);e=(c.Aa&63)<<16|c.Na;f=65536-c.Pa&65535;gb(a,c.T[b],d,e,f);return;case 57:if(c.ma[b]>=c.ub[0]||c.ba[b]>>8>=c.Ga[0]||(c.ba[b]&255)>=c.J[0])c.Oa[b]|=1024,c.F|=49152;else{d=(c.ma[b]*c.Ga[0]+(c.ba[b]>>8))*c.J[0]+(c.ba[b]&255);e=(c.Aa&63)<<16|c.Na;f=65536-c.Pa&65535;a.pb(c.T[b],d,e,f);return}}I(a.a,3,5,172,function(){c.F=c.F&65534|128;c.V[b]|=128;return!!(c.F&64)})} +k.tc=function(a,b,c,d,e){var f=this.l;f.Pa=65536-e&65535;f.Na=d&65535;f.F=f.F&-769|d>>8&768;f.Aa=d>>16&63;e=~~(c/f.J[0]);d=~~(e/f.Ga[0]);f.ba[b.ja]=e%f.Ga[0]<<8|c%f.J[0];f.rb[b.ja]=f.ma[b.ja]=d;f.La|=1<=b.ic-1&&(f.V[b.ja]|=1024);switch(a){case 1:f.aa|=512;f.F|=49152;break;case 2:f.aa|=2048,f.F|=49152}I(this.a,20,5,172,function(){f.V[b.ja]|=128;f.F=f.F&65534|128;return!!(f.F&64)})}; +function kb(a,b,c,d,e,f){var g=~~((f+c.sa-1)/c.sa),h=new XMLHttpRequest;2048>g&&d+2048lb(this.a,a.hc?mb(this.a,c):c,a.cache[b][e])){a.ob(2,a,b,c,d);return}c+=2;--d}b++}a.ob(0,a,b,c,d)}; +function gb(a,b,c,d,e){for(var f,g;0g){b.ob(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.ob(0,b,c,d,e)}k.reset=function(){this.c.Ma=this.c.Ma&-120|20;this.b.wa=0;this.g.D=128;this.h.v=128;ib(this)}; +k.ac=function(a,b,c){var d,e,f=this.a;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.za&65280:(a&1&&(b<<=8),f.za=b|255,d=0);break;case 4194298:if(0>b)d=f.Eb;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.Eb=d;f.j|=2}break;case 4194294:if(70!==f.Ia)return K(f,4);0>b?d=f.s:d=f.s=0;break;case 4194292:if(70!==f.Ia)return K(f,4);d=1;break;case 4194290:if(70!==f.Ia)return K(f,4);d=0;break;case 4194288:if(70!==f.Ia)return K(f,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!==f.Ia)return K(f,4);e=a-4194272>>1;0>b?d=f.zb[e]:(d=J(this,f.zb[e],a,b,c),0<=d&&(f.zb[e]=d));break;case 4194254:return a&1?f.C>>14&1?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.da[3]=b),d=f.da[3]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.da[1]=b),d=f.da[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.C&2048?(0<=b&&(f.f[e]=b),d=f.f[e]):(0<=b&&(f.Ka[e]=b),d=f.Ka[e]),d;case 4194246:return a& +1?(0<=b&&(f.f[7]=b),d=f.f[7]):f.C>>14&0?(0<=b&&(f.f[6]=b),d=f.f[6]):(0<=b&&(f.da[0]=b),d=f.da[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.C&2048?(0<=b&&(f.Ka[e]=b),d=f.Ka[e]):(0<=b&&(f.f[e]=b),d=f.f[e]),d;default:return f.s|=16,K(f,4)}break;case 4194176:e=a>>1&31;d=J(this,f.R[3][e],a,b,c);0<=d&&(f.R[3][e]=d,f.R[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=J(this,f.qb,a,b,c);0<=d&&(f.qb=d);break;case 4194172:d=f.ya;d&65280&&(d=(d<<8|d>>8)&65535);break;case 4194168:0> +b?d=this.c.Bc&65535:(d=J(this,this.c.data,a,b,c),0<=d&&(this.c.data=d));break;default:return f.s|=16,K(f,4)}break;case 4194048:e=this.g;switch(a&-2){case 4194048:d=J(this,e.Za,a,b,c);0<=d&&(e.Za=d);break;case 4194050:d=J(this,e.S,a,b,c);0<=d&&(e.S=d);break;case 4194052:d=J(this,e.D,a,b,c);0<=b&&0<=d&&(e.D=d&-36993|e.D&36992,e.D&1&&fb(this));break;case 4194054:d=J(this,e.$a,a,b,c);0<=d&&(e.$a=d);break;case 4194056:d=J(this,e.Ya,a,b,c);0<=d&&(e.Ya=d);break;case 4194058:d=J(this,e.X,a,b,c);0<=d&&(e.X= +d);break;case 4194060:break;case 4194062:d=J(this,e.Sb,a,b,c);0<=d&&(e.Sb=d);break;default:return f.s|=16,K(f,4)}break;case 4193728:var g=this.l;e=g.aa&7;switch(a&-2){case 4193728:d=J(this,g.F,a,b,c);0<=b&&0<=d&&(g.Aa=g.Aa&60|d>>8&3,g.F=d&17279|g.F&34944|2048,d&1&&g.F&128?jb(this,e):192==(d&192)&&I(f,0,5,172));break;case 4193730:d=J(this,g.Pa,a,b,c);0<=d&&(g.Pa=d);break;case 4193732:d=J(this,g.Na,a,b,c);0<=d&&(g.Na=d&65534);break;case 4193734:d=J(this,g.ba[e],a,b,c);0<=d&&(g.ba[e]=d&7967);break;case 4193736:d= +J(this,g.aa,a,b,c);0<=d&&(g.aa=d&63|g.aa&65472,d&128&&ib(this));break;case 4193738:d=g.V[e];break;case 4193740:d=g.Oa[e];break;case 4193742:d=J(this,g.La,a,b,c);0<=d&&(g.La=d&255);break;case 4193744:d=g.yc[e];break;case 4193746:d=J(this,g.Tb,a,b,c);0<=d&&(g.Tb=d);break;case 4193748:d=J(this,g.Ub[e],a,b,c);0<=d&&(g.Ub[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.zc[e];break;case 4193754:d=J(this,g.Vb[e],a,b,c);0<=d&&(g.Vb[e]=d);break;case 4193756:d=J(this,g.ma[e],a,b,c);0<=d&&(g.ma[e]= +d&511);break;case 4193758:g.rb[e]=g.ma[e];d=g.rb[e];break;case 4193760:d=g.wc[e];break;case 4193762:d=g.xc[e];break;case 4193764:d=g.uc[e];break;case 4193766:d=g.vc[e];break;case 4193768:d=J(this,g.Aa,a,b,c);0<=d&&(g.Aa=d&63,g.F=g.F&-769|(d&3)<<8);break;case 4193770:d=J(this,g.Fb,a,b,c);0<=d&&(g.Fb=d);break;default:return f.s|=16,K(f,4)}break;case 4192512:e=this.h;switch(a&-2){case 4192512:d=J(this,e.v,a,b,c);0<=b&&0<=d&&(e.ra=e.ra&60|d>>4&3,e.v=e.v&-1023|d&1022,e.v&128||hb(this));break;case 4192514:d= +J(this,e.Va,a,b,c);0<=d&&(e.Va=d&65534);break;case 4192516:d=J(this,e.L,a,b,c);0<=d&&(e.L=d);break;case 4192518:d=J(this,e.xa,a,b,c);0<=d&&(e.xa=d);break;case 4192520:d=J(this,e.ra,a,b,c);0<=d&&(e.ra=d&63,e.v=e.v&-49|(e.ra&3)<<4);break;default:return f.s|=16,K(f,4)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.Ja:(d=J(this,f.Ja,a,b,c),0<=d&&(70!==f.Ia&&(d&=-49),f.Ja=d,f.nb[0]=d&4?15:7,f.nb[1]=d&2?15:7,f.nb[3]=d&1?15:7,f.mb&&(e=2,f.Ja&16&&(e=1),this.c.Ma=this.c.Ma&-8|e)));break;default:return f.s|= +16,K(f,4)}break;case 4191424:e=a>>1&31;d=J(this,f.R[0][e],a,b,c);0<=d&&(f.R[0][e]=d,f.R[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=J(this,f.R[1][e],a,b,c);0<=d&&(f.R[1][e]=d,f.R[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.Ia)return K(f,4);e=a>>2&31;d=f.ab[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=J(this,d,a,b,c),0<=d&&(f.ab[e]=a&2?d<<16|f.ab[e]&65535:f.ab[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=Za[a>>1&255];else return f.s|=16,K(f,4);break;default:return f.s|=16,K(f,4)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var ob={},bb=(ob[65382]=[null,null,H.prototype.jc,H.prototype.Cc,"LKS"],ob[65402]=[null,null,H.prototype.kc,H.prototype.Dc,"MMR0"],ob[65534]=[null,null,H.prototype.lc,H.prototype.Ec,"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.b,0,c>>2),vb(this,rb?wb:xb);else{this.a=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},W:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ga: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.ta=!0},I:function(a,b){return this.M(a,b)},ca:function(a,b){return this.ea(a, -b)},na:function(a,b,c){this.w||this.Zb(a,b,c)},Da:function(a,b,c){this.w||this.Ea(a,b,c)},H:function(a){return this.b[a]},N:function(a){return this.b[a]},Z:function(a){return this.g.getUint16(a,!0)},fa:function(a){return a&1?this.b[a]|this.b[a+1]<<8:this.m[a>>1]},ha:function(a,b){this.b[a]=b;this.ta=!0},oa:function(a,b){this.b[a]=b;this.ta=!0},Ca:function(a,b){this.g.setUint16(a,b,!0);this.ta=!0},Fa:function(a,b){a&1?(this.b[a]=b,this.b[a+1]=b>>8):this.m[a>>1]=b;this.ta=!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.Sa=!a.w&&b[1]||a.v,a.Hc=!a.w&&b[3]||a.G);if(c||void 0===c)a.Zb=b[1]||a.v,a.Ea=b[3]||a.G}function zb(a,b,c){c&&a.h||(a.Za=b[0]||a.o,a.oc=b[2]||a.A);if(c||void 0===c)a.M=b[0]||a.o,a.ea=b[2]||a.A}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.ga,G.prototype.Ga],Ab=[G.prototype.I,G.prototype.na,G.prototype.ca,G.prototype.Da]; -if(Ia)var xb=[G.prototype.H,G.prototype.ha,G.prototype.Z,G.prototype.Ca],wb=[G.prototype.N,G.prototype.oa,G.prototype.fa,G.prototype.Fa];function Db(a,b){v.call(this,"CPU",a,Db);var c=a.multiplier||1;this.lb=a.cycles||b;this.ga=c;this.xb=Math.round(this.lb/1E4)/100;this.na=this.xb*this.ga;this.i.$=!1;this.i.Wb=!1;this.i.Va=a.autoStart;this.i.Hb=!1;this.i.mb=!1;this.jb=this.oa=0;this.kb=a.csStart;this.Da=a.csInterval;this.Ea=a.csStop;this.M=[];this.Qb=this.Ac.bind(this);F(this)}y(Db); -var Eb=["power","reset"];k=Db.prototype;k.va=function(a,b,c,d){this.A=a;this.B=b;this.K=d;for(b=0;b>=3;d=""+e}else d=n(c,d);else d="--------".substr(0,d||4);a.w[b].textContent!=d&&(a.w[b].textContent=d)}} -k.Y=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.i.P)a=!0;else{var b=null,c,h=z(a.id);for(c=0;ca.ea/a.na&&(b=1),a.ga=b,b=a.xb*a.ga,a.na!=b)){a.na=b;b=a.na.toFixed(2)+"Mhz";var c=a.w.setSpeed;c&&(c.textContent=b);a.U("target speed: "+b)}Nb(a,a.ca);a.ca=0;a.Z=ja();a.fa=0;Ob(a)}function ab(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function bb(a,b,c){0<=b&&ba.M[b][0]&&(c*=a.lb*a.ga/1E3,a.M[b][0]=c)} -k.Ac=function(){if(this.i.$){this.Bb>=this.lb&&Ob(this,!0);this.Ga=0;this.ib=ja();if(this.fa){var a=this.ib-this.fa;a>this.Nb&&(this.Z+=a,this.Z>this.ib&&(this.Z=this.ib))}try{do{for(var b,c=this.i.mb?1:this.eb,d=this.M.length-1;0<=d;d--){var e=this.M[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Xb(b)}catch(m){if("number"!=typeof m)throw m;}for(var f=this.W-this.a,a=f,g=this.M.length-1;0<=g;g--){var h=this.M[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ga+=f;this.ca+=f;Nb(this,0,!0);a=f;if(this.i.mb){var l= -!1;this.jb=this.jb+this.Mb()|0;this.oa-=a;0>=this.oa&&(this.oa+=this.Da,l=!0);0<=this.Ea&&this.Ea<=Pb(this)&&(this.Da=this.Ea=-1,Hb(this),Lb(this),l=!0);l&&this.U(Pb(this)+" cycles: checksum="+n(this.jb))}this.Fa-=f;if(0>=this.Fa){this.Fa+=this.eb;15<=++this.Ob&&(this.A&&this.A.Ra(),this.Ob=0);break}}while(this.i.$)}catch(m){Lb(this);Ib(this);this.A&&this.A.stop(ja(),Pb(this));b=m.stack||m.message;this.i.error=!0;this.O(b);return}if(this.i.$){b=setTimeout;c=this.Qb;this.fa=ja();d=this.Nb;this.Ga&& -(d=Math.round(d*this.Ga/this.eb));d-=this.fa-this.ib;if(e=this.fa-this.Z)this.ea=Math.round(this.ca/(10*e))/100,864E5<=e&&(this.ha=0,Mb(this));if(0>d||this.ead&&(this.Z-=d),d=0;this.Bb+=this.Ga;this.fa+=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.$)a.U(a.toString()+" busy");else{Mb(a);a.i.$=!0;a.i.Wb=!0;a.Ca&&a.Ca.start();if(b=a.w.run)b.textContent="Halt";a.A&&a.A.start(a.Z,Pb(a));Ib(a,!0);setTimeout(a.Qb,0)}}k.Xb=function(){return 0}; -function Lb(a){if(a.i.$){a.W-=a.a;a.a=0;Nb(a,a.ca);a.ca=0;a.i.$=!1;a.Ca&&a.Ca.stop();var b=a.w.run;b&&(b.textContent="Run");a.A&&a.A.stop(ja(),Pb(a));Ib(a)}a.i.complete=void 0}function Ib(a,b){a.A&&a.A.Ra(b)} -function Qb(a){this.gc=a.resetAddr||0;Db.call(this,a,6666667);this.Kb=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.La=[0,0,0,0,0,0];this.da=[0,0,0,0];this.hb=this.v=0;this.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.cb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.Ab=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.c=this.b=this.vb=this.H=this.I=this.l=0;this.Ja=70;this.pa=-1;Sb(this);this.i.complete=this.i.bc=!1}y(Qb,Db);k=Qb.prototype;k.reset=function(){this.i.$&&Lb(this);Sb(this);Gb(this);this.i.error=!1;this.parent.reset.call(this)}; -function Sb(a){a.za=255;a.s=0;a.Eb=0;a.G=0;a.ya=0;a.rb=0;a.Ka=0;a.ob=0;a.gb=0;a.pb=[7,7,7,7];a.o=[];a.l|=2;db(a)}function db(a){a.ob?(a.Jb=65536,a.N=a.ec):(a.Jb=0,a.N=a.dc)}k.Mb=function(){return 0};k.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.ha,this.ga]);a.set(2,Xa(this.B));return a.data()}; -k.restore=function(a){var b=a[1];this.ha=b[1];Mb(this,b[3]);a:{b=this.B;a=a[2];var c;for(c=0;cb){a.o[f].ia-=b;break}b-=a.o[f].ia}a.o.splice(f+1,0,{ia:b,Rb:c<<5&224,Yb:d,yb:e})}a.l|=2}function eb(a){return a.C=a.C&63728|a.ua()|(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.La.length;0<=--c;){var d=a.f[c];a.f[c]=a.La[c];a.La[c]=d}a.v=b>>14&3;c=a.C>>14&3;a.v!=c&&(a.da[c]=a.f[6],a.f[6]=a.da[a.v]);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.v||(b=4,c=!0);a.G&57344||(a.ya=63222,a.rb=b);a.v=0;var d=N(a,b|65536),e=N(a,b+2&65535|65536);fb(a,e&-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.Ka&32&&(b=a.cb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} -function Zb(a,b,c){var d,e,f,g=0;if(c&a.ob){d=b>>13&a.pb[a.v];e=a.R[a.v][d];f=(a.R[a.v][d+16]<<6)+(b&8191)&4194303;a.Ka&16?3932160<=f&&4186112>f&&(f=mb(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&(3915776<=f&&(a.s|=32,K(a,4)),f&1&&!(c&1)&&(a.s|=64,K(a,4)));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.R[a.v][d]=e;if(4194170!==f||a.v)a.gb=a.v,a.hb=d;g&&(g&57344&&(0<=a.pa&&(g|=128),a.G&57344||(a.G=a.G|g|a.gb<<5|a.hb<<1),K(a,168)),a.G&61440||!(4191360>f||4194239>>a.c;return c!=a.h?a.b[d].oc(c,b):a.b[d++].Za(c,b)|a.b[d&a.H].Za(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.ya=a.ya<<8|246);!a.v&&c<=a.za&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=g);e=N(a,e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=g);e=N(a,e)|g;a.a-=8;break; -case 6:return e=Tb(a),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=Tb(a),e=e+a.f[c]&65535,e=N(a,e|65536)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!g||a.G&57344||(a.ya=a.ya<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.za||65534<=a.f[6])&&(a.f[6]<=a.za-32?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.l|=64));return e}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.v=a.C>>12&3,c=N(a,d|c&65536),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.da[a.C>>12&3];return c}function bc(a,b,c,d){a.G&57344||(a.ya=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=$b(a,b,e,4),c&65536||(e&=65535),a.v=a.C>>12&3,e=Zb(a,e|c&65536,4),a.v=a.C>>14&3,Wa(a.B,e,d&65535)):6!=e||(a.C>>2&12288)===(a.C&12288)?a.f[e]=d:a.da[a.C>>12&3]=d} -function cc(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.N(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.I=b&7;(b=a.H=(b&56)>>3)?c=nb(a,a.N(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.N(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.N(b,d,2)):c=a.f[d];return c} -function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.vb=a.N(b,e,7),c=d.call(a,c,Va(a.B,e)),e&1&&a.a--,a=a.B,a.b[(e&a.j)>>>a.c].Sa(e&a.h,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.N(b,e,6),c=d.call(a,c,nb(a,e)),Wa(a.B,e,c&65535)):a.f[e]=d.call(a,c,a.f[e])} -function fc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.N(b,e,5),d&1&&a.a--,a=a.B,a.b[(d&a.j)>>>a.c].Sa(d&a.h,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function gc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.N(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.Xb=function(a){this.i.complete=!0;this.i.bc=!1;this.i.Wb=!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.Eb&224,c=this.o.length;0<=--c;){if(0b&&(b=this.o[c].Rb,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.Yb):K(this,160))}else this.l&1&&this.l++;this.G&57344||(this.ya=0,this.rb=this.f[7]);this.l=this.l&7|this.C&16;this.decode(Tb(this))}while(0>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},fa: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},oa: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.ta=!0},H:function(a,b){return this.I(a,b)},Z:function(a,b){return this.ca(a, +b)},ha:function(a,b,c){this.A||this.Zb(a,b,c)},Ca:function(a,b,c){this.A||this.Da(a,b,c)},G:function(a){return this.c[a]},M:function(a){return this.c[a]},W:function(a){return this.g.getUint16(a,!0)},ea:function(a){return this.l[a>>1]},ga:function(a,b){this.c[a]=b;this.ta=!0},na:function(a,b){this.c[a]=b;this.ta=!0},pa:function(a,b){this.g.setUint16(a,b,!0);this.ta=!0},Ea:function(a,b){this.l[a>>1]=b;this.ta=!0}}; +function Ma(a,b,c){a.K=b;a.h=a.u=0;c&&((a.h=c.h)&&zb(a,Ab,!1),(a.u=c.u)&&Bb(a,Ab,!1))}function Bb(a,b,c){c&&a.u||(a.tb=!a.A&&b[1]||a.B,a.Hc=!a.A&&b[3]||a.w);if(c||void 0===c)a.Zb=b[1]||a.B,a.Da=b[3]||a.w}function zb(a,b,c){c&&a.h||(a.Cb=b[0]||a.m,a.oc=b[2]||a.o);if(c||void 0===c)a.I=b[0]||a.m,a.ca=b[2]||a.o}function vb(a,b){b||(b=Cb);zb(a,b,void 0);Bb(a,b,void 0)}var Cb=[],yb=[G.prototype.N,G.prototype.oa,G.prototype.fa,G.prototype.Fa],Ab=[G.prototype.H,G.prototype.ha,G.prototype.Z,G.prototype.Ca]; +if(Ia)var xb=[G.prototype.G,G.prototype.ga,G.prototype.W,G.prototype.pa],wb=[G.prototype.M,G.prototype.na,G.prototype.ea,G.prototype.Ea];function Db(a,b){v.call(this,"CPU",a,Db);var c=a.multiplier||1;this.bb=a.cycles||b;this.ga=c;this.Ab=Math.round(this.bb/1E4)/100;this.na=this.Ab*this.ga;this.i.$=!1;this.i.Wb=!1;this.i.Ua=a.autoStart;this.i.Hb=!1;this.i.kb=!1;this.hb=this.oa=0;this.ib=a.csStart;this.Da=a.csInterval;this.Ea=a.csStop;this.M=[];this.Qb=this.Ac.bind(this);F(this)}y(Db); +var Eb=["power","reset"];k=Db.prototype;k.va=function(a,b,c,d){this.B=a;this.u=b;this.K=d;for(b=0;b>=3;d=""+e}else d=n(c,d);else d="--------".substr(0,d||4);a.A[b].textContent!=d&&(a.A[b].textContent=d)}} +k.Y=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.B)if(a=d.B,a.i.P)a=!0;else{var b=null,c,h=z(a.id);for(c=0;ca.ea/a.na&&(b=1),a.ga=b,b=a.Ab*a.ga,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.ca);a.ca=0;a.Z=ja();a.fa=0;Ob(a)}function $a(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function ab(a,b,c){0<=b&&ba.M[b][0]&&(c*=a.bb*a.ga/1E3,a.M[b][0]=c)} +k.Ac=function(){if(this.i.$){this.Bb>=this.bb&&Ob(this,!0);this.Ra=0;this.gb=ja();if(this.fa){var a=this.gb-this.fa;a>this.Nb&&(this.Z+=a,this.Z>this.gb&&(this.Z=this.gb))}try{do{for(var b,c=this.i.kb?1:this.jb,d=this.M.length-1;0<=d;d--){var e=this.M[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Xb(b)}catch(m){if("number"!=typeof m)throw m;}for(var f=this.W-this.a,a=f,g=this.M.length-1;0<=g;g--){var h=this.M[g];0>h[0]||(h[0]-=a,0>=h[0]&&(h[0]=-1,h[1]()))}this.Ra+=f;this.ca+=f;Nb(this,0,!0);a=f;if(this.i.kb){var l= +!1;this.hb=this.hb+this.Lb()|0;this.oa-=a;0>=this.oa&&(this.oa+=this.Da,l=!0);0<=this.Ea&&this.Ea<=Pb(this)&&(this.Da=this.Ea=-1,Hb(this),Lb(this),l=!0);l&&this.U(Pb(this)+" cycles: checksum="+n(this.hb))}this.Fa-=f;if(0>=this.Fa){this.Fa+=this.jb;15<=++this.Pb&&(this.B&&this.B.Qa(),this.Pb=0);break}}while(this.i.$)}catch(m){Lb(this);Ib(this);this.B&&this.B.stop(ja(),Pb(this));b=m.stack||m.message;this.i.error=!0;this.O(b);return}if(this.i.$){b=setTimeout;c=this.Qb;this.fa=ja();d=this.Nb;this.Ra&& +(d=Math.round(d*this.Ra/this.jb));d-=this.fa-this.gb;if(e=this.fa-this.Z)this.ea=Math.round(this.ca/(10*e))/100,864E5<=e&&(this.ha=0,Mb(this));if(0>d||this.ead&&(this.Z-=d),d=0;this.Bb+=this.Ra;this.fa+=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.$)a.U(a.toString()+" busy");else{Mb(a);a.i.$=!0;a.i.Wb=!0;a.Ca&&a.Ca.start();if(b=a.A.run)b.textContent="Halt";a.B&&a.B.start(a.Z,Pb(a));Ib(a,!0);setTimeout(a.Qb,0)}}k.Xb=function(){return 0}; +function Lb(a){if(a.i.$){a.W-=a.a;a.a=0;Nb(a,a.ca);a.ca=0;a.i.$=!1;a.Ca&&a.Ca.stop();var b=a.A.run;b&&(b.textContent="Run");a.B&&a.B.stop(ja(),Pb(a));Ib(a)}a.i.complete=void 0}function Ib(a,b){a.B&&a.B.Qa(b)} +function Qb(a){this.gc=a.resetAddr||0;Db.call(this,a,6666667);this.Kb=0;this.decode=Rb.bind(this);this.l=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.Ka=[0,0,0,0,0,0];this.da=[0,0,0,0];this.fb=this.w=0;this.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.ab=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.zb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.c=this.b=this.vb=this.H=this.I=this.j=0;this.Ia=70;this.pa=-1;Sb(this);this.i.complete=this.i.bc=!1}y(Qb,Db);k=Qb.prototype;k.reset=function(){this.i.$&&Lb(this);Sb(this);Gb(this);this.i.error=!1;this.parent.reset.call(this)}; +function Sb(a){a.za=255;a.s=0;a.Eb=0;a.G=0;a.ya=0;a.qb=0;a.Ja=0;a.mb=0;a.eb=0;a.nb=[7,7,7,7];a.o=[];a.j|=2;cb(a)}function cb(a){a.mb?(a.Jb=65536,a.N=a.ec):(a.Jb=0,a.N=a.dc)}k.Lb=function(){return 0};k.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.ha,this.ga]);a.set(2,Wa(this.u));return a.data()}; +k.restore=function(a){var b=a[1];this.ha=b[1];Mb(this,b[3]);a:{b=this.u;a=a[2];var c;for(c=0;cb){a.o[f].ia-=b;break}b-=a.o[f].ia}a.o.splice(f+1,0,{ia:b,Rb:c<<5&224,Yb:d,xb:e})}a.j|=2}function db(a){return a.C=a.C&63728|a.ua()|(a.h&65535?0:4)|(a.g&32768?2:0)|M(a)} +function eb(a,b){a.m=b<<12;a.h=~b&4;a.g=b<<14;a.l=b<<16;if((b^a.C)&2048)for(var c=a.Ka.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ka[c];a.Ka[c]=d}a.w=b>>14&3;c=a.C>>14&3;a.w!=c&&(a.da[c]=a.f[6],a.f[6]=a.da[a.w]);a.j|=2;a.C=b}function O(a,b){a.j&128||(a.m=a.h=b,a.g=0)}function P(a,b,c){a.j&128||(a.m=a.h=a.l=b,a.g=c||0)}function Ub(a,b,c,d){a.j&128||(a.m=a.h=a.l=b,a.g=(c^b)&(d^b))}function Q(a,b){a.j&128||(a.m=a.h=a.l=b,a.g=a.m^a.l>>1)}function Vb(a,b,c,d){a.j&128||(a.m=a.h=a.l=b,a.g=(c^d)&(d^b))} +function K(a,b){var c=!1;0>a.pa?a.pa=db(a):a.w||(b=4,c=!0);a.G&57344||(a.ya=63222,a.qb=b);a.w=0;var d=N(a,b|65536),e=N(a,b+2&65535|65536);eb(a,e&-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.j&=-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;eb(a,c);a.j&=-17} +function mb(a,b){var c=b>>13&31;31>c?a.Ja&32&&(b=a.ab[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b} +function Zb(a,b,c){var d,e,f,g=0;if(c&a.mb){d=b>>13&a.nb[a.w];e=a.R[a.w][d];f=(a.R[a.w][d+16]<<6)+(b&8191)&4194303;a.Ja&16?3932160<=f&&4186112>f&&(f=mb(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&3915776<=f&&(a.s|=32,K(a,4));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.R[a.w][d]=e;if(4194170!== +f||a.w)a.eb=a.w,a.fb=d;g&&(g&57344&&(0<=a.pa&&(g|=128),a.G&57344||(a.G=a.G|g|a.eb<<5|a.fb<<1),K(a,168)),a.G&61440||!(4191360>f||4194239>>a.c].oc(b&a.h,b)}function N(a,b){return nb(a,Zb(a,b,2))}function lb(a,b,c){b&1&&(a.s|=64,K(a,4));a=a.u;a.b[(b&a.u)>>>a.c].Hc(b&a.h,c&65535,b)}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.ya=a.ya<<8|246);!a.w&&c<=a.za&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=g);e=N(a,e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=g);e=N(a,e)|g;a.a-=8;break; +case 6:return e=Tb(a),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=Tb(a),e=e+a.f[c]&65535,e=N(a,e|65536)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!g||a.G&57344||(a.ya=a.ya<<8|f<<3&248|c);6==c&&!a.w&&d&4&&0>=f&&(a.f[6]<=a.za||65534<=a.f[6])&&(a.f[6]<=a.za-32?(a.s|=4,a.f[6]=4,K(a,4)):(a.s|=8,a.j|=64));return e}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.w=a.C>>12&3,c=N(a,d|c&65536),a.w=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.da[a.C>>12&3];return c}function bc(a,b,c,d){a.G&57344||(a.ya=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=$b(a,b,e,4),c&65536||(e&=65535),a.w=a.C>>12&3,e=Zb(a,e|c&65536,4),a.w=a.C>>14&3,lb(a,e,d)):6!=e||(a.C>>2&12288)===(a.C&12288)?a.f[e]=d:a.da[a.C>>12&3]=d} +function cc(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.N(b,c,3),a=Va(a.u,c)):a=a.f[c]&255;return a}function R(a,b){var c;b>>=6;var d=a.I=b&7;(b=a.H=(b&56)>>3)?c=nb(a,a.N(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.N(b,c,3),a=Va(a.u,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.N(b,d,2)):c=a.f[d];return c} +function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.vb=a.N(b,e,7),c=d.call(a,c,Va(a.u,e)),e&1&&a.a--,a=a.u,a.b[(e&a.u)>>>a.c].tb(e&a.h,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.N(b,e,6),lb(a,e,d.call(a,c,nb(a,e)))):a.f[e]=d.call(a,c,a.f[e])}function fc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.N(b,e,5),d&1&&a.a--,a=a.u,a.b[(d&a.u)>>>a.c].tb(d&a.h,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c} +function gc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?lb(a,a.N(b,d,4),c):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.Xb=function(a){this.i.complete=!0;this.i.bc=!1;this.i.Wb=!1;this.W=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?K(this,168):this.j&64?K(this,4):this.j&16&&K(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.Eb&224,c=this.o.length;0<=--c;){if(0b&&(b=this.o[c].Rb,a=this.o[c],this.o.splice(c,1))}b>(this.C&224)&&(this.j&4&&(this.f[7]= +this.f[7]+2&65535,this.j&=-5),a?K(this,a.Yb):K(this,160))}else this.j&1&&this.j++;this.G&57344||(this.ya=0,this.qb=this.f[7]);this.j=this.j&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)} +function sc(a,b){a=~b|256;P(this,a<<8);return a&255}function tc(a,b){a=b-a;this.j&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.j&128||(this.m=this.h=c,this.g=b&(b^c));return a&255}function vc(a,b){a=b+a;this.j&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.j&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.l>>16&1;Q(this,a);return a&65535}function Ac(a,b){a=b<<1|this.l>>16&1;Q(this,a<<8);return a&255}function Bc(a,b){a=(this.l&65536|b)>>1|b<<16;Q(this,a);return a&65535}function Cc(a,b){a=((this.l&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.j&128||(this.m=this.h=b&65280,this.g=this.l=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.l=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.l=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.l=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.l=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.l=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.l=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.j&128||(this.m=b>>16,this.h=this.m|b,this.g=0,this.l=-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.I&&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.I&&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.I&&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.I&&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.I&&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.I&&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.I&&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.I&&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.I&&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.I&&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.I&&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.ua()==!(this.g&32768))},function(a){V(this,a,!this.ua()!=!(this.g&32768))},function(a){V(this,a,!!(this.h&65535)&&!this.ua()==!(this.g&32768))},function(a){V(this,a,(this.h&65535?0:4)||!this.ua()!=!(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.ua?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.ua())},function(a){V(this,a,this.ua())},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, +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.ua?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.j|=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.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Xb(this);this.j|=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.u.reset());this.a-=667},function(){Xb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],ed=[Rc,function(){this.l=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.l=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.ua())},function(a){V(this,a,this.ua())},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.vb&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.vb&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.A=ba(this.h);if(this.h){a=this.h;var b=ca(this.A);"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,f){ld(c,a,b,f)})}}y(kd);kd.prototype.va=function(a,b,c,d){this.B=b;this.a=c;this.K=d;md(this)};kd.prototype.la=function(){this.j&&(this.K&&this.K.a(this.id,this.m,this.c,this.j),delete this.j);return!0}; +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.B=ba(this.h);if(this.h){a=this.h;var b=ca(this.B);"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,f){ld(c,a,b,f)})}}y(kd);kd.prototype.va=function(a,b,c,d){this.u=b;this.a=c;this.K=d;md(this)};kd.prototype.la=function(){this.l&&(this.K&&this.K.a(this.id,this.m,this.c,this.l),delete this.l);return!0}; kd.prototype.ka=function(){return!0}; -function ld(a,b,c,d){if(d)a.O("Unable to load system ROM (error "+d+": "+b+")");else{Fa(a.wb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,h=eval("("+c+")");if(f=h.bytes)a.b=f;else if(f=h.words)for(a.b=Array(2*f.length),g=e=0;e>8&255;else if(f=h.data)for(a.b=Array(4*f.length),g=e=0;e>8&255,a.b[g++]=f[e]>>16&255,a.b[g++]=f[e]>>24&255;else a.b=h;a.j=h.symbols;if(!a.b.length){r("Empty ROM: "+b); +function ld(a,b,c,d){if(d)a.O("Unable to load system ROM (error "+d+": "+b+")");else{Fa(a.wb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,h=eval("("+c+")");if(f=h.bytes)a.b=f;else if(f=h.words)for(a.b=Array(2*f.length),g=e=0;e>8&255;else if(f=h.data)for(a.b=Array(4*f.length),g=e=0;e>8&255,a.b[g++]=f[e]>>16&255,a.b[g++]=f[e]>>24&255;else a.b=h;a.l=h.symbols;if(!a.b.length){r("Empty ROM: "+b); return}if(1==a.b.length){r(a.b[0]);return}}catch(l){a.O("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>d.c].Zb(e&d.h,a.b[c]&255,e)}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>>e.c;0>>=e.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.fb)return;b=ha(b[1]);if(this.o=Ga(b)){var d=this.o.exports;if(d){var e=d.connect;e&&e.call(this.o);if(this.v=d.receiveData){this.status(this.wb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.la=function(a,b){if(!b)if(this.Pb(),!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(){rd(this)};k.save=function(){var a=new L(this);a.set(0,[]);return a.data()};k.restore=function(){return rd(this)};function rd(a){a.I=0;a.b=0;a.c=128;a.h=[];return!0}k.Db=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.M||8,c=a-this.m%a,this.M&&(b=" ".slice(0,c)));this.G&&!this.m&&c&&(b=String.fromCharCode(this.G)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.U(this.j), -this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;I(this.a,100,4,52,this.H)}};var sd={},qd=(sd[65392]=[null,null,Z.prototype.nc,Z.prototype.Gc,"RCSR"],sd[65394]=[null,null,Z.prototype.mc,Z.prototype.Fc,"RBUF"],sd[65396]=[null,null,Z.prototype.qc,Z.prototype.Jc,"XCSR"],sd[65398]=[null,null,Z.prototype.pc,Z.prototype.Ic,"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;b>>d.c].Zb(e&d.h,a.b[c]&255,e)}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>>e.c;0>>=e.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.cb)return;b=ha(b[1]);if(this.o=Ga(b)){var d=this.o.exports;if(d){var e=d.connect;e&&e.call(this.o);if(this.w=d.receiveData){this.status(this.wb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.la=function(a,b){if(!b)if(this.Ob(),!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(){rd(this)};k.save=function(){var a=new L(this);a.set(0,[]);return a.data()};k.restore=function(){return rd(this)};function rd(a){a.I=0;a.b=0;a.c=128;a.h=[];return!0}k.Db=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.M||8,c=a-this.m%a,this.M&&(b=" ".slice(0,c)));this.G&&!this.m&&c&&(b=String.fromCharCode(this.G)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.m+=c}else if(null!=this.l){if(10==a||1024<=this.l.length)this.U(this.l), +this.l="";10!=a&&(this.l+=String.fromCharCode(a))}this.c&=-129;I(this.a,100,4,52,this.H)}};var sd={},qd=(sd[65392]=[null,null,Z.prototype.nc,Z.prototype.Gc,"RCSR"],sd[65394]=[null,null,Z.prototype.mc,Z.prototype.Fc,"RBUF"],sd[65396]=[null,null,Z.prototype.qc,Z.prototype.Jc,"XCSR"],sd[65398]=[null,null,Z.prototype.pc,Z.prototype.Ic,"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.A)){this.j=new L(this,"1.30.1","failsafe");xd(this.j)&&(Cd(this,d),a=2,Dd(this.j));this.j.set("timestamp",ka());Ed(this.j);var e=this.b&&!this.m;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Bd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?xd(d,g):("error"== -f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(pa("user",""),this.c=null)):this.U(f+": "+g),Dd(d),xd(d)?(c=Bd(d),e=!0):c=!1))}e&&Ad(this,c?d:null)}else 2==a&&d.clear()}else Ad(this);delete this.A;delete this.v}e=z(this.id);for(f=0;fa[1];a=a[2];this.Z=!0;this.i.P=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.a&&(Fd(this,this.a,b,c,a),this.a.Va());this.I&&(Cd(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +k.Xa=function(a){void 0===a&&(a=this.b||(this.B?1:vd));if(!this.g){this.g++;var b=!1,c=!1;this.I=!1;var d=this.w||new L(this,"1.30.1");if(-1==a)b=!0;else if(a>vd){if(xd(d,this.B)){this.l=new L(this,"1.30.1","failsafe");xd(this.l)&&(Cd(this,d),a=2,Dd(this.l));this.l.set("timestamp",ka());Ed(this.l);var e=this.b&&!this.m;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Bd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?xd(d,g):("error"== +f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(pa("user",""),this.c=null)):this.U(f+": "+g),Dd(d),xd(d)?(c=Bd(d),e=!0):c=!1))}e&&Ad(this,c?d:null)}else 2==a&&d.clear()}else Ad(this);delete this.B;delete this.w}e=z(this.id);for(f=0;fa[1];a=a[2];this.Z=!0;this.i.P=!0;var d=this.A.power;d&&(d.textContent="Shutdown");this.a&&(Fd(this,this.a,b,c,a),this.a.Ua());this.I&&(Cd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0}; function Cd(a,b){if(la("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.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,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),g=new L(a,"1.30.1","validate"),h=ka();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ka&&(c&&Lb(a.a),d=a.a.ka(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.P=!1,!1===d&&(e=null)));for(var h=z(a.id),l=0;l