From cacff66983713d79edd031795143eddc64fd8b8e Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Tue, 29 Nov 2016 14:48:26 -0800 Subject: [PATCH] Lots of memory interface cleanup; still can't boot RSTS/E though.... --- .../pdp11/machine/1170/4mb/debugger/README.md | 4 +- .../machine/1170/panel/debugger/README.md | 45 +- modules/pdp11/lib/bus.js | 46 +- modules/pdp11/lib/cpuops.js | 6 +- modules/pdp11/lib/cpustate.js | 109 ++-- modules/pdp11/lib/debugger.js | 36 +- modules/pdp11/lib/device.js | 19 +- modules/pdp11/lib/panel.js | 10 +- modules/pdp11/lib/ram.js | 4 +- modules/pdp11/lib/rk11.js | 11 +- modules/pdp11/lib/rl11.js | 61 +- versions/pdpjs/1.30.5/pdp11-dbg.js | 605 +++++++++--------- versions/pdpjs/1.30.5/pdp11.js | 424 ++++++------ 13 files changed, 704 insertions(+), 676 deletions(-) diff --git a/devices/pdp11/machine/1170/4mb/debugger/README.md b/devices/pdp11/machine/1170/4mb/debugger/README.md index 1096956fe..474059e2f 100644 --- a/devices/pdp11/machine/1170/4mb/debugger/README.md +++ b/devices/pdp11/machine/1170/4mb/debugger/README.md @@ -8,8 +8,8 @@ machines: debugger: true autoStart: true autoMount: - RL0: - path: http://archive.pcjs.org/disks/dec/rl02k/RL02K-XXDP.json + RL2: + path: http://archive.pcjs.org/disks/dec/rl01k/RL01K-RSTS-V70.json --- {% include machine.html id="test1170" %} diff --git a/devices/pdp11/machine/1170/panel/debugger/README.md b/devices/pdp11/machine/1170/panel/debugger/README.md index 1aec69300..db7534e77 100644 --- a/devices/pdp11/machine/1170/panel/debugger/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/README.md @@ -21,8 +21,8 @@ As DEC notes in the [PDP-11/70 Maintenance Service Guide](http://archive.pcjs.or Chapter 4: "There are several useful toggle-ins that are probably not very well known." Excerpts are provided below. If you're not sure how to "toggle in" code using a Front Panel, check out [Front Panel Basics](/devices/pdp11/panel/1170/#front-panel-basics). -However, since the above machine also includes the PDPjs Debugger, you'll find that it's much easier to use the Debugger commands -described below to load and execute these "toggle-ins". +However, since the above machine also includes the PDPjs Debugger, you'll find that it's much easier to use the +Debugger commands described below to load and execute these "toggle-ins". ### Memory Management @@ -82,7 +82,10 @@ which should produce these results: stopped (3 instructions, 32 cycles, 9 ms, 3556 hz) R0=000000 R1=000000 R2=000000 R3=000000 R4=000000 R5=000000 SP=000000 PC=000214 PS=000001 SW=00000000 T0 N0 Z0 V0 C1 - 000214: 000000 HALT + 000214: 000000 HALT + +and dumping the contents of virtual address 300 should display 070707: + >> d 300 l1 000300 070707 @@ -130,7 +133,7 @@ which should produce these results: >> e 500 125252 changing 000500 from 000000 to 125252 >> d 17000500 l1 - 00017000500 125252 + 00017000500: 125252 >> e 17000700 070707 changing 00017000700 from 000000 to 070707 >> e 17770202 000000 @@ -140,16 +143,19 @@ which should produce these results: >> e 17772516 40 changing 00017772516 from 000000 to 000040 >> d 17000500 l1 - 00017000500 070707 + 00017000500: 070707 -If you also want to see all the hardware register activity, use the Debugger's "m bus on" command to turn Bus messages on: +If you also want to see all the hardware register activity, use the Debugger's "m bus on; m device on" command +to turn Bus+Device messages on: >> m bus on messages on: bus + >> m device on + messages on: device >> e 500 125252 changing 000500 to 125252 >> d 17000500 l1 - 00017000500 125252 + 00017000500: 125252 >> e 17000700 070707 changing 00017000700 to 070707 >> e 17770202 000000 @@ -160,9 +166,8 @@ If you also want to see all the hardware register activity, use the Debugger's " UNIMAP0.writeWord(00017770200,000200) >> e 17772516 40 changing 00017772516 to 000040 - MMR3.writeWord(00017772516,000040) >> d 17000500 l1 - 00017000500 070707 + 00017000500: 070707 ### Memory Clear Program @@ -219,10 +224,12 @@ The above "toggle-in" can be entered with the PDPjs Debugger as follows: e 17772260 000200 021311 003402 005000 000766 005312 000000; r pc 172240 -which should produce the following results when Bus messages are turned on ("m bus on"): +which should produce the following results when Bus+MMU messages are turned on ("m bus on; m mmu on"): >> m bus on messages on: bus + >> m mmu on + messages on: mmu >> e 17772300 077406 changing 00017772300 to 077406 KIPDR0.writeWord(00017772300,077406) @@ -301,9 +308,9 @@ which should produce the following results when Bus messages are turned on ("m b SIPAR1.readWord(172242): 000020 172240: 012714 000020 MOV #20,@R4 -All the "Supervisor I Page Address Register" (SIPAR) and "Supervisor D Page Address Register" (SDPAR) reads and writes -merely reflect where the above code is being loaded and executed from; those registers are essentially being used as scratch -RAM. +All the "Supervisor I Page Address Register" (SIPAR) and "Supervisor D Page Address Register" (SDPAR) reads +and writes merely reflect where the above code is being loaded and executed from; those registers are essentially +being used as scratch RAM. As the **Maintenance Service Guide** goes on to say: @@ -315,13 +322,13 @@ As the **Maintenance Service Guide** goes on to say: Note: When loading the program you must be in console physical [i.e., the ADDRESS select switch must be set to "CONS PHY", which is the default setting of the PDPjs Front Panel]. -Before running the above code, you should turn Bus messages off (ie, "m bus off"); otherwise, the quantity of messages will -slow execution to a crawl. +Before running the above code, you should turn messages off (eg, "m bus off"); otherwise, the quantity of +messages will slow execution to a crawl. -If you want to set an execution breakpoint in the above code, make sure you use the appropriate virtual (16-bit) address. -For example, to break on this instruction: +If you want to set an execution breakpoint in the above code, make sure you use the appropriate virtual (16-bit) +address. For example, to break on this instruction: 17772256 062711 ADD #200,(R1) ; Step Page -use the command "bp 172256", because while the code *is* physically located at 17772256, it is being executed at virtual -address 172256, and execution breakpoints operate on virtual addresses. +use the command "bp 172256", because while the code *is* physically located at 17772256, it is being executed at +virtual address 172256, and execution breakpoints operate on virtual addresses. diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 2f2dc1051..c4719e3ea 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -127,7 +127,6 @@ function BusPDP11(parmsBus, cpu, dbg) this.fIOBreakAll = false; this.nDisableFaults = 0; this.fFault = false; - this.cbRAM = 0; /* * Array of RESET notification handlers registered by Device components. @@ -669,9 +668,6 @@ BusPDP11.prototype.addMemory = function(addr, size, type, controller) } if (sizeLeft <= 0) { - if (type == MemoryPDP11.TYPE.RAM) { - this.cbRAM += size; - } this.status((size >> 10) + "Kb " + MemoryPDP11.TYPE_NAMES[type] + " at " + str.toOct(addr)); return true; } @@ -914,7 +910,6 @@ BusPDP11.prototype.setMemoryBlocks = function(addr, size, aBlocks, type) */ BusPDP11.prototype.getByte = function(addr) { - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); return this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].readByte(addr & this.nBlockLimit, addr); }; @@ -933,7 +928,7 @@ BusPDP11.prototype.getBlockDirect = function(addr) /** * getByteDirect(addr) * - * This is useful for the Debugger and other components that want to access physical memory without side-effects. + * This is used for device I/O and Debugger physical memory requests, not the CPU. * * @this {BusPDP11} * @param {number} addr is a physical address @@ -943,7 +938,6 @@ BusPDP11.prototype.getByteDirect = function(addr) { this.fFault = false; this.nDisableFaults++; - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); var b = this.getBlockDirect(addr).readByteDirect(addr & this.nBlockLimit, addr); this.nDisableFaults--; return b; @@ -958,7 +952,6 @@ BusPDP11.prototype.getByteDirect = function(addr) */ BusPDP11.prototype.getWord = function(addr) { - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); var off = addr & this.nBlockLimit; var iBlock = (addr & this.nMemMask) >>> this.nBlockShift; if (!PDP11.WORDBUS && off == this.nBlockLimit) { @@ -970,7 +963,7 @@ BusPDP11.prototype.getWord = function(addr) /** * getWordDirect(addr) * - * This is useful for the Debugger and other components that want to bypass getWord() breakpoint detection. + * This is used for device I/O and Debugger physical memory requests, not the CPU. * * @this {BusPDP11} * @param {number} addr is a physical address @@ -981,7 +974,6 @@ BusPDP11.prototype.getWordDirect = function(addr) var w; this.fFault = false; this.nDisableFaults++; - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); var off = addr & this.nBlockLimit; var block = this.getBlockDirect(addr); if (!PDP11.WORDBUS && off == this.nBlockLimit) { @@ -1002,15 +994,13 @@ BusPDP11.prototype.getWordDirect = function(addr) */ BusPDP11.prototype.setByte = function(addr, b) { - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); this.aMemBlocks[(addr & this.nMemMask) >>> this.nBlockShift].writeByte(addr & this.nBlockLimit, b & 0xff, addr); }; /** * setByteDirect(addr, b) * - * This is useful for the Debugger and other components that want to bypass breakpoint detection AND read-only - * memory protection (for example, this is an interface the ROM component could use to initialize ROM contents). + * This is used for device I/O and Debugger physical memory requests, not the CPU. * * @this {BusPDP11} * @param {number} addr is a physical address @@ -1020,7 +1010,6 @@ BusPDP11.prototype.setByteDirect = function(addr, b) { this.fFault = false; this.nDisableFaults++; - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); this.getBlockDirect(addr).writeByteDirect(addr & this.nBlockLimit, b & 0xff, addr); this.nDisableFaults--; }; @@ -1034,7 +1023,6 @@ BusPDP11.prototype.setByteDirect = function(addr, b) */ BusPDP11.prototype.setWord = function(addr, w) { - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); var off = addr & this.nBlockLimit; var iBlock = (addr & this.nMemMask) >>> this.nBlockShift; if (!PDP11.WORDBUS && off == this.nBlockLimit) { @@ -1048,8 +1036,7 @@ BusPDP11.prototype.setWord = function(addr, w) /** * setWordDirect(addr, w) * - * This is useful for the Debugger and other components that want to bypass breakpoint detection AND read-only - * memory protection (for example, this is an interface the ROM component could use to initialize ROM contents). + * This is used for device I/O and Debugger physical memory requests, not the CPU. * * @this {BusPDP11} * @param {number} addr is a physical address @@ -1059,7 +1046,6 @@ BusPDP11.prototype.setWordDirect = function(addr, w) { this.fFault = false; this.nDisableFaults++; - if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.cpu.mapUnibus(addr); var off = addr & this.nBlockLimit; var block = this.getBlockDirect(addr); if (!PDP11.WORDBUS && off == this.nBlockLimit) { @@ -1192,24 +1178,22 @@ BusPDP11.prototype.restoreMemory = function(a) }; /** - * getMemorySize(type) - * - * NOTE: The original pdp11.js defined a constant named MAX_MEMORY equal to UNIBUS_22BIT - 16384, - * where UNIBUS_22BIT is 4Mb less 256Kb, from which it then subtracted another 16Kb "for BSD 2.9 boot." + * getMemoryLimit(type) * * @this {BusPDP11} - * @param {number} type is one of the MemoryPDP11.TYPE constants (only RAM is currently supported) - * @return {number} (size of initial allocation, in bytes) + * @param {number} type is one of the MemoryPDP11.TYPE constants + * @return {number} (the limiting address of the specified memory type, zero if none) */ -BusPDP11.prototype.getMemorySize = function(type) +BusPDP11.prototype.getMemoryLimit = function(type) { - var cb = 0; - switch(type) { - case MemoryPDP11.TYPE.RAM: - cb = this.cbRAM; - break; + var addr = 0; + for (var iBlock = 0; iBlock < this.aBusBlocks.length; iBlock++) { + var block = this.aBusBlocks[iBlock]; + if (block.type == type) { + addr = block.addr + block.used; + } } - return cb; + return addr; }; /** diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index c462c6216..558630a47 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -832,7 +832,6 @@ PDP11.opBPL = function(opCode) PDP11.opBPT = function(opCode) { this.trap(PDP11.TRAP.BPT, 0, PDP11.REASON.OPCODE); - this.nStepCycles -= (4 + 1); }; /** @@ -1106,7 +1105,7 @@ PDP11.opDIV = function(opCode) PDP11.opEMT = function(opCode) { this.trap(PDP11.TRAP.EMT, 0, PDP11.REASON.OPCODE); - this.nStepCycles -= (22 + 3); + this.nStepCycles -= (22 + 3 - 5); }; /** @@ -1206,7 +1205,7 @@ PDP11.opINCB = function(opCode) PDP11.opIOT = function(opCode) { this.trap(PDP11.TRAP.IOT, 0, PDP11.REASON.OPCODE); - this.nStepCycles -= (22 + 3); + this.nStepCycles -= (22 + 3 - 5); }; PDP11.JMP_CYCLES = [ @@ -1789,7 +1788,6 @@ PDP11.opSXT = function(opCode) PDP11.opTRAP = function(opCode) { this.trap(PDP11.TRAP.TRAP, 0, PDP11.REASON.OPCODE); - this.nStepCycles -= (4 + 1); }; /** diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 306f061d0..196e91580 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -216,7 +216,7 @@ CPUStatePDP11.prototype.initRegs = function() [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // mode 2 (not used) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] // USER (8 UIPDR regs followed by 8 UDPDR regs) ]; - this.unibusMap = [ // 32 unibus map registers + this.regsUniMap = [ // 32 UNIBUS map registers 0, 0, 0, 0, 0, 0, 0, 0, 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.regsControl = [ // various control registers (177740-177756) we don't really care about @@ -278,7 +278,7 @@ CPUStatePDP11.prototype.resetMMU = function() if (this.bus) { this.setMemoryAccess(); - this.addrInvalid = this.bus.getMemorySize(MemoryPDP11.TYPE.RAM); + this.addrInvalid = this.bus.getMemoryLimit(MemoryPDP11.TYPE.RAM); } }; @@ -1393,6 +1393,13 @@ CPUStatePDP11.prototype.trap = function(vector, flag, reason) this.pushWord(this.regsGen[7], fRed); this.setPC(newPC); + /* + * TODO: Determine the appropriate number of cycles for traps; all I've done for now is move the + * cycle charge from opTrap() to here, and reduced the amount the other opcode handlers that call + * trap() charge by a corresponding amount (5). + */ + this.nStepCycles -= (4 + 1); + /* * DEC's "TRAP TEST" (MAINDEC-11-D0NA-PB) triggers a RESERVED trap with an invalid opcode and the * stack deliberately set too low, and expects the stack overflow trap to be "sprung" immediately @@ -1513,22 +1520,28 @@ CPUStatePDP11.prototype.getTrapStatus = function() */ CPUStatePDP11.prototype.mapUnibus = function(addr) { - var idx = (addr >> 13) & 0x1f; - if (idx < 31) { - if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) { - /* - * The UNIBUS map relocation is enabled - */ - addr = (this.unibusMap[idx] + (addr & 0x1ffe)) & 0x3ffffe; - this.assert(addr < BusPDP11.UNIBUS_22BIT || addr >= BusPDP11.IOPAGE_22BIT); - } else { - /* - * Since UNIBUS map relocation is NOT enabled, then as explained above: - * - * If the UNIBUS map relocation is not enabled, an incoming 18-bit UNIBUS address has 4 leading zeroes added for - * referencing a 22-bit physical address. The lower 18 bits are the same. No relocation is performed. - */ - addr &= ~BusPDP11.UNIBUS_22BIT; + /* + * NOTE: Most callers check the first condition themselves (addr >= BusPDP11.UNIBUS_22BIT) to avoid + * making unnecessary function calls. + */ + if (addr >= BusPDP11.UNIBUS_22BIT) { + var idx = (addr >> 13) & 0x1f; + if (idx < 31) { + if (this.regMMR3 & PDP11.MMR3.UNIBUS_MAP) { + /* + * The UNIBUS map relocation is enabled + */ + addr = (this.regsUniMap[idx] + (addr & 0x1ffe)) & 0x3ffffe; + this.assert(addr < BusPDP11.UNIBUS_22BIT || addr >= BusPDP11.IOPAGE_22BIT); + } else { + /* + * Since UNIBUS map relocation is NOT enabled, then as explained above: + * + * If the UNIBUS map relocation is not enabled, an incoming 18-bit UNIBUS address has 4 leading zeroes added for + * referencing a 22-bit physical address. The lower 18 bits are the same. No relocation is performed. + */ + addr &= ~BusPDP11.UNIBUS_22BIT; + } } } return addr; @@ -1559,7 +1572,7 @@ CPUStatePDP11.prototype.mapUnibus = function(addr) * A PDP-11/70 is different from other PDP-11s in that the highest 18 bit space (017000000 & above) * maps directly to UNIBUS space - including low memory. This doesn't appear to be particularly * useful as it restricts maximum system memory - although it does appear to allow software - * testing of the unibus map. This feature also appears to confuse some OSes which test consecutive + * testing of the UNIBUS map. This feature also appears to confuse some OSes which test consecutive * memory locations to find maximum memory -- and on a full memory system find themselves accessing * low memory again at high addresses. * @@ -1594,13 +1607,11 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) var page, pdr, addr; /* - * This can happen when the DSTMODE (MAINT) bit of MMR0 is set but *not* the ENABLED bit. + * This can happen when the DSTMODE (MAINT) bit of MMR0 is set but not the ENABLED bit. */ if (!(access & this.mmuEnable)) { addr = addrVirtual & 0xffff; - if (addr >= BusPDP11.IOPAGE_16BIT) { - addr |= this.addrIOPage; - } + if (addr >= BusPDP11.IOPAGE_16BIT) addr |= this.addrIOPage; return addr; } @@ -1609,9 +1620,7 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(addrVirtual, access) pdr = this.mmuPDR[this.mmuMode][page]; addr = ((this.mmuPAR[this.mmuMode][page] << 6) + (addrVirtual & 0x1fff)) & this.mmuMask; - if (addr >= BusPDP11.UNIBUS_22BIT) { - addr = this.mapUnibus(addr); - } + if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); if (this.nDisableTraps) return addr; @@ -2009,20 +2018,16 @@ CPUStatePDP11.prototype.checkStackLimit1145 = function(access, step, addr) }; /** - * getByteDirect(addr) + * getByteSafe(addr) * - * This interface is expressly for the Debugger, to access virtual memory without faulting; - * note that if the MMU is not enabled, this is effectively the same as using the Bus interface. + * This interface is expressly for the Debugger, to access virtual memory without faulting. * * @this {CPUStatePDP11} * @param {number} addr * @return {number} */ -CPUStatePDP11.prototype.getByteDirect = function(addr) +CPUStatePDP11.prototype.getByteSafe = function(addr) { - if (!this.mmuEnable) { - return this.bus.getByteDirect(addr); - } this.nDisableTraps++; var b = this.readByteFromPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.READ_BYTE)); this.nDisableTraps--; @@ -2030,20 +2035,16 @@ CPUStatePDP11.prototype.getByteDirect = function(addr) }; /** - * getWordDirect(addr) + * getWordSafe(addr) * - * This interface is expressly for the Debugger, to access virtual memory without faulting; - * note that if the MMU is not enabled, this is effectively the same as using the Bus interface. + * This interface is expressly for the Debugger, to access virtual memory without faulting. * * @this {CPUStatePDP11} * @param {number} addr * @return {number} */ -CPUStatePDP11.prototype.getWordDirect = function(addr) +CPUStatePDP11.prototype.getWordSafe = function(addr) { - if (!this.mmuEnable) { - return this.bus.getWordDirect(addr); - } this.nDisableTraps++; var w = this.readWordFromPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.READ_WORD)); this.nDisableTraps--; @@ -2051,42 +2052,32 @@ CPUStatePDP11.prototype.getWordDirect = function(addr) }; /** - * setByteDirect(addr, data) + * setByteSafe(addr, data) * - * This interface is expressly for the Debugger, to access virtual memory without faulting; - * note that if the MMU is not enabled, this is effectively the same as using the Bus interface. + * This interface is expressly for the Debugger, to access virtual memory without faulting. * * @this {CPUStatePDP11} * @param {number} addr * @param {number} data */ -CPUStatePDP11.prototype.setByteDirect = function(addr, data) +CPUStatePDP11.prototype.setByteSafe = function(addr, data) { - if (!this.mmuEnable) { - this.bus.setByteDirect(addr, data); - return; - } this.nDisableTraps++; this.writeByteToPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.WRITE_BYTE), data); this.nDisableTraps--; }; /** - * setWordDirect(addr, data) + * setWordSafe(addr, data) * - * This interface is expressly for the Debugger, to access virtual memory without faulting; - * note that if the MMU is not enabled, this is effectively the same as using the Bus interface. + * This interface is expressly for the Debugger, to access virtual memory without faulting. * * @this {CPUStatePDP11} * @param {number} addr * @param {number} data */ -CPUStatePDP11.prototype.setWordDirect = function(addr, data) +CPUStatePDP11.prototype.setWordSafe = function(addr, data) { - if (!this.mmuEnable) { - this.bus.setWordDirect(addr, data); - return; - } this.nDisableTraps++; this.writeWordToPhysical(this.mapVirtualToPhysical(addr, PDP11.ACCESS.WRITE_WORD), data); this.nDisableTraps--; @@ -2105,7 +2096,9 @@ CPUStatePDP11.prototype.setWordDirect = function(addr, data) */ CPUStatePDP11.prototype.getPhysicalAddrByMode = function(mode, reg, access) { - return this.getAddrByMode(mode, reg, access); + var addr = this.getAddrByMode(mode, reg, access); + if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); + return addr; }; /** @@ -2135,6 +2128,7 @@ CPUStatePDP11.prototype.getVirtualAddrByMode = function(mode, reg, access) */ CPUStatePDP11.prototype.readWordFromPhysical = function(addr) { + if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); return this.bus.getWord(this.addrLast = addr); }; @@ -2163,6 +2157,7 @@ CPUStatePDP11.prototype.readWordFromVirtual = function(addrVirtual) */ CPUStatePDP11.prototype.writeWordToPhysical = function(addr, data) { + if (addr >= BusPDP11.UNIBUS_22BIT) addr = this.mapUnibus(addr); this.bus.setWord(this.addrLast = addr, data & 0xffff); }; diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 18db95275..a006f4362 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -659,7 +659,7 @@ if (DEBUGGER) { var b = 0xff; var addr = this.getAddr(dbgAddr, false, 1); if (addr !== PDP11.ADDR_INVALID) { - b = dbgAddr.fPhysical? this.bus.getByteDirect(addr) : this.cpu.getByteDirect(addr); + b = (dbgAddr.fPhysical || addr > 0xffff)? this.bus.getByteDirect(this.cpu.mapUnibus(addr)) : this.cpu.getByteSafe(addr); if (inc) this.incAddr(dbgAddr, inc); } return b; @@ -678,7 +678,7 @@ if (DEBUGGER) { var w = 0xffff; var addr = this.getAddr(dbgAddr, false, 2); if (addr !== PDP11.ADDR_INVALID) { - w = dbgAddr.fPhysical? this.bus.getWordDirect(addr) : this.cpu.getWordDirect(addr); + w = (dbgAddr.fPhysical || addr > 0xffff)? this.bus.getWordDirect(this.cpu.mapUnibus(addr)) : this.cpu.getWordSafe(addr); if (inc) this.incAddr(dbgAddr, inc); } return w; @@ -696,10 +696,10 @@ if (DEBUGGER) { { var addr = this.getAddr(dbgAddr, true, 1); if (addr !== PDP11.ADDR_INVALID) { - if (dbgAddr.fPhysical) { - this.bus.setByteDirect(addr, b); + if (dbgAddr.fPhysical || addr > 0xffff) { + this.bus.setByteDirect(this.cpu.mapUnibus(addr), b); } else { - this.cpu.setByteDirect(addr, b); + this.cpu.setByteSafe(addr, b); } if (inc) this.incAddr(dbgAddr, inc); this.cmp.updateDisplays(-1); @@ -718,10 +718,10 @@ if (DEBUGGER) { { var addr = this.getAddr(dbgAddr, true, 2); if (addr !== PDP11.ADDR_INVALID) { - if (dbgAddr.fPhysical) { - this.bus.setWordDirect(addr, w); + if (dbgAddr.fPhysical || addr > 0xffff) { + this.bus.setWordDirect(this.cpu.mapUnibus(addr), w); } else { - this.cpu.setWordDirect(addr, w); + this.cpu.setWordSafe(addr, w); } if (inc) this.incAddr(dbgAddr, inc); this.cmp.updateDisplays(-1); @@ -1706,7 +1706,7 @@ if (DEBUGGER) { * for that here by skipping over the HALT if/when the machine starts up again. */ if (!nState) { - opCode = this.cpu.getWordDirect(addr); + opCode = this.cpu.getWordSafe(addr); if (opCode == PDP11.OPCODE.HALT) { addr = this.cpu.advancePC(2); } @@ -1733,7 +1733,7 @@ if (DEBUGGER) { if (nState >= 0 && this.aInstructionHistory.length) { this.cInstructions++; if (opCode < 0) { - opCode = this.cpu.getWordDirect(addr); + opCode = this.cpu.getWordSafe(addr); } if ((opCode & 0xffff) != PDP11.OPCODE.INVALID) { var dbgAddr = this.aInstructionHistory[this.iInstructionHistory]; @@ -3118,7 +3118,7 @@ if (DEBUGGER) { data = shift = 0; } i -= n; nBytes -= n; - while (n--) { + while (size == 1 && n--) { var c = v & 0xff; sChars += (c >= 32 && c < 128? String.fromCharCode(c) : '.'); v >>= 8; @@ -3128,7 +3128,7 @@ if (DEBUGGER) { if (fJSON) { sDump += sData + ","; } else { - sDump += sAddr + " " + sData + ((i == 0)? (' ' + sChars) : ""); + sDump += sAddr + ": " + sData + ((i == 0)? (' ' + sChars) : ""); } } @@ -3859,12 +3859,22 @@ if (DEBUGGER) { var dbg = this; var fRegs = (sCmd != "t"); var nCount = this.parseValue(sCount, null, true) || 1; - var nCycles = (nCount == 1? 0 : 1); + + /* + * We used to set nCycles to 1 when a count > 1 was specified, because nCycles set + * to 0 used to mean "execute the next instruction without checking for interrupts". + * Well, this machine's stepCPU() doesn't do that; it ALWAYS checks for interrupts, + * so we should leave nCycles set to 0, so that if an interrupt is dispatched, we will + * get to see the first instruction of the interrupt handler. + */ + var nCycles = 0; // (nCount == 1? 0 : 1); + if (sCmd == "tc") { nCycles = nCount; nCount = 1; } this.sTraceCmdPrev = sCmd; + web.onCountRepeat( nCount, function onCountStep() { diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index edd8592e4..21509130f 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -301,7 +301,7 @@ DevicePDP11.prototype.writeMMR3 = function(data, addr) DevicePDP11.prototype.readUNIMAP = function(addr) { var word = (addr >> 1) & 0x3f, reg = word >> 1; - var data = this.cpu.unibusMap[reg]; + var data = this.cpu.regsUniMap[reg]; return (word & 1)? (data >> 16) : (data & 0xffff); }; @@ -318,9 +318,9 @@ DevicePDP11.prototype.writeUNIMAP = function(data, addr) { var word = (addr >> 1) & 0x3f, reg = word >> 1; if (word & 1) { - this.cpu.unibusMap[reg] = (this.cpu.unibusMap[reg] & 0xffff) | ((data & 0x003f) << 16); + this.cpu.regsUniMap[reg] = (this.cpu.regsUniMap[reg] & 0xffff) | ((data & 0x003f) << 16); } else { - this.cpu.unibusMap[reg] = (this.cpu.unibusMap[reg] & ~0xffff) | (data & 0xfffe); + this.cpu.regsUniMap[reg] = (this.cpu.regsUniMap[reg] & ~0xffff) | (data & 0xfffe); } }; @@ -454,10 +454,7 @@ DevicePDP11.prototype.readKIPDR = function(addr) DevicePDP11.prototype.writeKIPDR = function(data, addr) { var reg = (addr >> 1) & 7; - this.cpu.mmuPDR[0][reg] = data &= 0xff0f; - if (this.messageEnabled(MessagesPDP11.MMU)) { - this.printMessage("writeKIPDR[" + reg + "]: " + str.toOct(data), true); - } + this.cpu.mmuPDR[0][reg] = data & 0xff0f; }; /** @@ -892,13 +889,7 @@ DevicePDP11.prototype.writeCTRL = function(data, addr) */ DevicePDP11.prototype.readSIZE = function(addr) { - /* - * TODO: getMemorySize() returns an aggregate total, so if there are multiple discontiguous - * chunks of RAM, this could return the wrong result; another interface, getHighestAddress(), - * might be required. Then again, perhaps multiple discontiguous chunks of RAM are not permitted - * in PDP-11 machines. - */ - return addr == PDP11.UNIBUS.LSIZE? ((this.bus.getMemorySize(MemoryPDP11.TYPE.RAM) >> 6) - 1) : 0; + return addr == PDP11.UNIBUS.LSIZE? ((this.bus.getMemoryLimit(MemoryPDP11.TYPE.RAM) >> 6) - 1) : 0; }; /** diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index 1ee71c87b..b8d8e3312 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -760,12 +760,15 @@ PanelPDP11.prototype.processDeposit = function(value, index) if (this.fDeposit) this.advanceAddr(); var w = this.updateData(this.regSwitches); if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) { + /* + * TODO: Determine if this needs to take the UNIBUS map into consideration. + */ this.bus.setWordDirect(this.regAddr, w); } else { /* * TODO: This code is obviously incomplete, since it doesn't take into account the precise ADDRSEL mode. */ - this.cpu.setWordDirect(this.regAddr, w); + this.cpu.setWordSafe(this.regAddr, w); } } }; @@ -783,12 +786,15 @@ PanelPDP11.prototype.processExamine = function(value, index) var w; if (this.fExamine) this.advanceAddr(); if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) { + /* + * TODO: Determine if this needs to take the UNIBUS map into consideration. + */ w = this.bus.getWordDirect(this.regAddr); } else { /* * TODO: This code is obviously incomplete, since it doesn't take into account the precise ADDRSEL mode. */ - w = this.cpu.getWordDirect(this.regAddr); + w = this.cpu.getWordSafe(this.regAddr); } this.updateData(w); } diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index 39931e94a..133b99d37 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -349,7 +349,7 @@ RAMPDP11.prototype.loadImage = function(aBytes, addrLoad, addrExec, addrInit, fR } else { this.printMessage("loading " + str.toHexWord(cbData) + " bytes at " + str.toHexWord(addr) + "-" + str.toHexWord(addr + cbData - 1), MessagesPDP11.PAPER); while (cbData--) { - this.cpu.setByteDirect(addr++, aBytes[offData++] & 0xff); + this.bus.setByteDirect(addr++, aBytes[offData++] & 0xff); } } fLoaded = true; @@ -359,7 +359,7 @@ RAMPDP11.prototype.loadImage = function(aBytes, addrLoad, addrExec, addrInit, fR if (addrLoad == null) addrLoad = addrInit; if (addrLoad != null) { for (var i = 0; i < aBytes.length; i++) { - this.cpu.setByteDirect(addrLoad + i, aBytes[i]); + this.bus.setByteDirect(addrLoad + i, aBytes[i]); } fLoaded = true; } diff --git a/modules/pdp11/lib/rk11.js b/modules/pdp11/lib/rk11.js index 4dc9c0d98..192f71de1 100644 --- a/modules/pdp11/lib/rk11.js +++ b/modules/pdp11/lib/rk11.js @@ -1017,10 +1017,13 @@ RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add err = PDP11.RK11.RKER.NXS; break; } - this.bus.setWordDirect(addr, data = b0 | (b1 << 8)); - if (DEBUG && this.messageEnabled(MessagesPDP11.READ) && sWords.length < 56) { + this.bus.setWordDirect(this.cpu.mapUnibus(addr), data = b0 | (b1 << 8)); + if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { sWords += str.toOct(data) + ' '; - if (sWords.length >= 56) this.printMessage(sWords + '\n', true); + if (sWords.length >= 56) { + this.printMessage(sWords + '\n', true); + sWords = ""; + } } if (this.bus.checkFault()) { err = PDP11.RK11.RKER.NXM; @@ -1069,7 +1072,7 @@ RK11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, ad } while (nWords--) { - var data = this.bus.getWordDirect(addr); + var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr)); if (this.bus.checkFault()) { err = PDP11.RK11.RKER.NXM; break; diff --git a/modules/pdp11/lib/rl11.js b/modules/pdp11/lib/rl11.js index 0f702314f..808cb1187 100644 --- a/modules/pdp11/lib/rl11.js +++ b/modules/pdp11/lib/rl11.js @@ -918,10 +918,10 @@ RL11.prototype.processCommand = function() break; case PDP11.RL11.FUNC.STATUS: - if (this.dar & PDP11.RL11.RLDA.GS_RST) { - this.csr &= 0x3F; // TODO: Review + if (this.mpr & PDP11.RL11.RLMP.GS_BH) { + this.csr &= (PDP11.RL11.RLCS.DRDY | PDP11.RL11.RLCS.FUNC | PDP11.RL11.RLCS.BAE); // TODO: Review } - this.mpr = drive.status | (this.darInternal & PDP11.RL11.RLDA.RW_HS); // bit 6: Head Select, bit 7: Drive Type (1=RL02) + this.mpr = drive.status | (this.darInternal & PDP11.RL11.RLDA.RW_HS); // bit 6: Head Select, bit 7: Drive Type (1=RL02) break; case PDP11.RL11.FUNC.SEEK: @@ -956,11 +956,11 @@ RL11.prototype.processCommand = function() } addr = (((this.ber & PDP11.RL11.RLBE.MASK)) << 16) | this.bar; // 22 bit mode nWords = (0x10000 - this.mpr) & 0xffff; + var pos = ((((iCylinder << 1) + iHead) * drive.nSectors) + iSector) * 128; if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { - var pos = ((((iCylinder << 1) + iHead) * drive.nSectors) + iSector) * 128; this.printMessage((fnReadWrite == this.readData? "readData" : "writeData") + "(pos=" + pos + ",addr=" + str.toOct(addr) + ",bytes=" + (nWords * 2) + ")", true, true); } - fInterrupt = fnReadWrite.call(this, drive, iCylinder, iHead, iSector, nWords, addr, this.endReadWrite.bind(this)); + fInterrupt = fnReadWrite.call(this, drive, pos, iCylinder, iHead, iSector, nWords, addr, this.endReadWrite.bind(this)); break; default: @@ -973,8 +973,6 @@ RL11.prototype.processCommand = function() } }; - - /** * endReadWrite(err, iCylinder, iHead, iSector, nWords, addr) * @@ -1002,10 +1000,11 @@ RL11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a }; /** - * readData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * readData(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) * * @this {RL11} * @param {Object} drive + * @param {number} pos * @param {number} iCylinder * @param {number} iHead * @param {number} iSector @@ -1014,9 +1013,10 @@ RL11.prototype.endReadWrite = function(err, iCylinder, iHead, iSector, nWords, a * @param {function(...)} done * @return {boolean} true if complete, false if queued */ -RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, addr, done) +RL11.prototype.readData = function(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) { var err = 0; + var checksum = 0; var disk = drive.disk; var sector = null, ibSector; @@ -1025,6 +1025,7 @@ RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add nWords = 0; } + var sWords = "", fDump = (addr == 0); while (nWords--) { if (!sector) { sector = drive.disk.seek(iCylinder, iHead, iSector + 1); @@ -1034,17 +1035,25 @@ RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add } ibSector = 0; } - var b0, b1; + var b0, b1, data; if ((b0 = drive.disk.read(sector, ibSector++)) < 0 || (b1 = drive.disk.read(sector, ibSector++)) < 0) { err = PDP11.RL11.ERRC.HNF; break; } - var data = this.bus.setWordDirect(addr, b0 | (b1 << 8)); + this.bus.setWordDirect(this.cpu.mapUnibus(addr), data = b0 | (b1 << 8)); + if (DEBUG && fDump && this.messageEnabled(MessagesPDP11.READ)) { + sWords += str.toOct(data) + ' '; + if (sWords.length >= 56) { + this.println(sWords); + sWords = ""; + } + } if (this.bus.checkFault()) { err = PDP11.RL11.ERRC.NXM; break; } addr += 2; + checksum += data; if (ibSector >= disk.cbSector) { sector = null; if (++iSector >= disk.nSectors) { @@ -1059,14 +1068,23 @@ RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add } } } + + if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + this.printMessage("checksum: " + (checksum|0), true); + if (pos == 732160) { + this.cpu.stopCPU(); + } + } + return done(err, iCylinder, iHead, iSector, nWords, addr); }; /** - * writeData(drive, iCylinder, iHead, iSector, nWords, addr, done) + * writeData(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) * * @this {RL11} * @param {Object} drive + * @param {number} pos * @param {number} iCylinder * @param {number} iHead * @param {number} iSector @@ -1075,9 +1093,10 @@ RL11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add * @param {function(...)} done * @return {boolean} true if complete, false if queued */ -RL11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, addr, done) +RL11.prototype.writeData = function(drive, pos, iCylinder, iHead, iSector, nWords, addr, done) { var err = 0; + var checksum = 0; var disk = drive.disk; var sector = null, ibSector; @@ -1086,13 +1105,22 @@ RL11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, ad nWords = 0; } + var sWords = "", fDump = (pos = 946944); while (nWords--) { - var data = this.bus.getWordDirect(addr); + var data = this.bus.getWordDirect(this.cpu.mapUnibus(addr)); if (this.bus.checkFault()) { err = PDP11.RL11.ERRC.NXM; break; } + if (DEBUG && fDump && this.messageEnabled(MessagesPDP11.READ)) { + sWords += str.toOct(data) + ' '; + if (sWords.length >= 56) { + this.println(sWords); + sWords = ""; + } + } addr += 2; + checksum += data; if (!sector) { sector = drive.disk.seek(iCylinder, iHead, iSector + 1, true); if (!sector) { @@ -1119,6 +1147,11 @@ RL11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, ad } } } + + if (DEBUG && this.messageEnabled(MessagesPDP11.READ)) { + this.printMessage("checksum: " + (checksum|0), true); + } + return done(err, iCylinder, iHead, iSector, nWords, addr); }; diff --git a/versions/pdpjs/1.30.5/pdp11-dbg.js b/versions/pdpjs/1.30.5/pdp11-dbg.js index f0b8ad5fa..2da27fab8 100644 --- a/versions/pdpjs/1.30.5/pdp11-dbg.js +++ b/versions/pdpjs/1.30.5/pdp11-dbg.js @@ -32,324 +32,325 @@ http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ -for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,vc:65,Df:66,Ff:67,bg:68,E:69,cg:70,dg:71,eg:72,fg:73,gg:74,hg:75,ig:76,jg:77,kg:78,lg:79,mg:80,Q:81,ng:82,og:83,pg:84,qg:85,rg:86,sg:87,tg:88,ug:89,gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,vg:97,wg:98,xg:99,d:100,e:101,yg:102,zg:103,Ag:104,Bg:105,Eg:106,k:107,Fg:108,Gg:109,n:110,Hg:111,p:112,q:113,r:114,Ig:115,t:116,Kg:117,Lg:118,Mg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Xc:127}; +var ka={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},la={Af:0,Qc:1,Cf:2,Df:3,Ef:4,Ff:5,Gf:6,Hf:7,tc:8,If:9,Rc:10,Jf:11,Kf:12,Sc:13,Lf:14,Mf:15,Nf:16,Of:17,Pf:18,Qf:19,Rf:20,Sf:21,Tf:22,Uf:23,Vf:24,Wf:25,Xf:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,sc:65,zf:66,Bf:67,Yf:68,E:69,Zf:70,$f:71,ag:72,bg:73,cg:74,dg:75,eg:76,fg:77,gg:78,hg:79,ig:80,Q:81,jg:82,kg:83,lg:84,mg:85,ng:86,og:87,pg:88,qg:89,cd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,rg:97,sg:98,tg:99,d:100,e:101,ug:102,vg:103,wg:104,xg:105,Ag:106,k:107,Bg:108,Cg:109,n:110,Dg:111,p:112,q:113,r:114,Eg:115,t:116,Gg:117,Hg:118,Ig:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,Tc:127}; function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)} -function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function sa(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} -function ta(a,b){return(a+" ").slice(0,b)}function ya(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ra(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} +function ta(a,b){return(a+" ").slice(0,b)}function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function Ea(a,b){var c,d={ha:null,ja:null,Sa:null,Ra:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Sa=g.load;d.Ra=g.exec;if(e=g.bytes)d.ha=e;else if(e=g.words)for(d.ha=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ha=Array(4*e.length),f=c=0;c>8&255,d.ha[f++]=e[c]>>16&255,d.ha[f++]=e[c]>>24&255;else d.ha=g;d.ja=g.symbols;d.ha.length?1==d.ha.length&&(w(d.ha[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Sa=g.load;d.Ra=g.exec;if(e=g.bytes)d.ia=e;else if(e=g.words)for(d.ia=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ia=Array(4*e.length),f=c=0;c>8&255,d.ia[f++]=e[c]>>16&255,d.ia[f++]=e[c]>>24&255;else d.ia=g;d.ja=g.symbols;d.ia.length?1==d.ia.length&&(w(d.ia[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.gb=this.id:(this.hb=this.id.substr(0,b),this.gb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,jb:!1,nc:!1,ma:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.oa=d||0;z.push(this)}var eb=void 0,fb={}; -if(window){eb||(eb=window.location.search.substr(1));for(var gb,hb=/\+/g,ib=/([^&=]+)=?([^&]*)/g;gb=ib.exec(eb);)fb[decodeURIComponent(gb[1].replace(hb," "))]=decodeURIComponent(gb[2].replace(hb," "))}function jb(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 B(a,b){b||(b=x);a.prototype=jb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var kb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else kb={},z=[];function lb(a,b,c){kb[a]&&b&&(kb[a][b]=c)}function mb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?this.fb=this.id:(this.gb=this.id.substr(0,b),this.fb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,ib:!1,jc:!1,ma:!1,error:!1};this.$b=null;this.C.error=!1;this.D={};this.j=null;this.na=d||0;z.push(this)}var fb=void 0,gb={}; +if(window){fb||(fb=window.location.search.substr(1));for(var hb,ib=/\+/g,jb=/([^&=]+)=?([^&]*)/g;hb=jb.exec(fb);)gb[decodeURIComponent(hb[1].replace(ib," "))]=decodeURIComponent(hb[2].replace(ib," "))}function kb(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 B(a,b){b||(b=x);a.prototype=kb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},z=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}B(Eb);var Fb=7;function Gb(a,b){return a.f[b]&&a.f[b][1]}k=Eb.prototype;k.reset=function(){this.stop()}; +function Eb(a){x.call(this,"Panel",a,Eb,512);this.Ba=this.w=this.cb=this.yb=this.B=this.F=0;this.J=this.K=this.G=!1;this.L=Fb;this.g={};this.f={START:[1,1,!0,!1,this.Ad],STEP:[1,1,!1,!1,this.Bd],ENABLE:[1,1,!1,!1,this.wd],CONT:[1,1,!0,!1,this.ud],DEP:[0,0,!0,!1,this.vd],EXAM:[1,1,!0,!1,this.xd],LOAD:[1,1,!0,!1,this.zd],TEST:[0,0,!0,!1,this.yd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.Cd,a]}B(Eb);var Fb=7;function Gb(a,b){return a.f[b]&&a.f[b][1]}k=Eb.prototype;k.reset=function(){this.stop()}; k.xa=function(a,b,c,d){if(this.A&&this.A.xa(a,b,c,d)||this.b&&this.b.xa(a,b,c,d)||this.j&&this.j.xa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, -b){return function(){Hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Hb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ib(a,b)}}(this,b),!0):this.parent.xa.call(this,a,b,c,d)}};k.Ha=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;Jb(b,this,Kb);Lb(b,this.reset.bind(this));Mb(this);Nb(this)};k.Ka=function(a,b){b||(Ob(),this.reset());return!0};k.Ja=function(){return!0}; -function Pb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Mb(a,b){for(var c in a.g)Pb(a,c,null!=b?b:a.g[c])}function Qb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Nb(a){for(var b in a.f)Qb(a,b,a.f[b][1])}function Rb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.j&&a.j.na||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} -function Hb(a,b){var c=a.f[b];Qb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Ib(a,b){var c=a.f[b];c[2]&&c[3]&&(Qb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.X||(a=this.b,a.v.reset(),Sb(a),Gb(this,"ENABLE")&&this.b.qb())};k.Fd=function(){};k.Ad=function(a){a||this.b.da()}; -k.yd=function(a){if(!a&&!this.b.C.X)if(Gb(this,"ENABLE"))this.b.qb();else{if((a=this.j)&&!qb(a,!0))pb(a,!0),a.rb(0,null),pb(a,!1);else try{var b=this.b.rb(1);0a.b.kb?8:16,c=65472<=a.Ba&&a.Ba<65472+b,b=c?1:2,c=c?15:a.v.Hb;Gb(a,"STEP")||(b=-b);Yb(a,a.Ba&~c|a.Ba+b&c)} -function Yb(a,b){a.Ba=b&a.v.Hb;b=a.Ba;for(var c=0;22>c;c++)$b(a,"A"+c,b&1<c;c++)$b(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ia-1;this.w=this.B/this.Ia|0;this.ib=[];this.qa=0;this.A=!1;this.G=0;this.F=[];this.ld=[rc,sc,tc,uc];a=new K(this);vc(a,this.j);this.ga=Array(this.w);this.f=Array(this.w);for(b=0;b>>this.pa;this.I=0;this.g=this.Hb;J(this)} -B(pc);var qc=8192,yc=qc-1;function rc(a,b){var c=-1,d=this.controller,e=d.ib[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.ib[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} -function sc(a,b,c){var d=!1,e=this.controller,f=e.ib[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.ib[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, -b),!0,!e.qa))}function tc(a,b){var c=-1,d=this.controller;a=d.ib[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} -function uc(a,b,c){var d=!1,e=this.controller;a=e.ib[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.qa))} -function zc(a,b){if(b!=a.I){for(var c=0;c>>a.pa,a.f[a.L]=a.ga[a.K])}}k=pc.prototype;k.reset=function(){for(var a=0;a>>a.pa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Zb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Zb){n=l.size-(f-m);n>g&&(n=g);l.Zb=f-l.H+n;f=m+a.Ia;g-=n;h++;continue}}return Ac(1,f,g)}f=new K(a,f,n,a.Ia,d,e);vc(f,a.j,l);a.ga[h++]=f;f=m+a.Ia;g-=n}return 0>=g?(d==Bc&&(a.G+=c),a.status((c>>10)+"Kb "+Cc[d]+" at "+na(b)),!0):Ac(2,b,c)} -k.dc=function(a){3932160<=a&&(a=Dc(this.b,a));return this.f[(a&this.g)>>>this.pa].fc(a&this.v,a)};function Ec(a,b){return a.ga[(b&a.Hb)>>>a.pa]}k.ec=function(a){this.A=!1;this.qa++;3932160<=a&&(a=Dc(this.b,a));a=Ec(this,a).I(a&this.v,a);this.qa--;return a};k.va=function(a){3932160<=a&&(a=Dc(this.b,a));return this.f[(a&this.g)>>>this.pa].Aa(a&this.v,a)};k.Va=function(a){this.A=!1;this.qa++;3932160<=a&&(a=Dc(this.b,a));a=Ec(this,a).K(a&this.v,a);this.qa--;return a}; -k.Nb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f[(a&this.g)>>>this.pa].ic(a&this.v,b&255,a)};k.Bb=function(a,b){this.A=!1;this.qa++;3932160<=a&&(a=Dc(this.b,a));Ec(this,a).G(a&this.v,b&255,a);this.qa--};k.Cb=function(a,b){3932160<=a&&(a=Dc(this.b,a));this.f[(a&this.g)>>>this.pa].$b(a&this.v,b&65535,a)};k.pb=function(a,b){this.A=!1;this.qa++;3932160<=a&&(a=Dc(this.b,a));Ec(this,a).N(a&this.v,b&65535,a);this.qa--}; -function Fc(a){for(var b=0,c=[],d=0;da.b.kb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],r=f[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Gb=128;Lc(this.b,this.f.tc,1E3/60,!0)};k.Od=function(){return this.f.Gb};k.Ne=function(a){this.f.Gb=a&192;this.f.Gb&64||Pc(this.b,this.f.Fb)};k.Qd=function(){return Qc(this.b)};k.Pe=function(a){Rc(this.b,a&-129|this.b.Da&128)}; -k.Rd=function(){return $c(this.b)};k.Sd=function(){return ad(this.b)};k.Td=function(){return this.b.Xa};k.Qe=function(a){bd(this.b,a)};k.Ae=function(a){a=a>>1&63;var b=this.b.Yb[a>>1];return a&1?b>>16:b&65535};k.zf=function(a,b){b=b>>1&63;var c=b>>1;this.b.Yb[c]=b&1?this.b.Yb[c]&65535|(a&63)<<16:this.b.Yb[c]&-65536|a&65534};k.te=function(a){return this.b.S[1][a>>1&7]};k.sf=function(a,b){this.b.S[1][b>>1&7]=a&65295};k.re=function(a){return this.b.S[1][(a>>1&7)+8]}; -k.qf=function(a,b){this.b.S[1][(b>>1&7)+8]=a&65295};k.se=function(a){return this.b.ka[1][a>>1&7]};k.rf=function(a,b){b=b>>1&7;this.b.ka[1][b]=a;this.b.S[1][b]&=65295};k.qe=function(a){return this.b.ka[1][(a>>1&7)+8]};k.pf=function(a,b){b=(b>>1&7)+8;this.b.ka[1][b]=a;this.b.S[1][b]&=65295};k.Nd=function(a){return this.b.S[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.S[0][b]=a&=65295;I(this,64)&&G(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.Ld=function(a){return this.b.S[0][(a>>1&7)+8]}; -k.Ke=function(a,b){this.b.S[0][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.ka[0][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.ka[0][b]=a;this.b.S[0][b]&=65295};k.Kd=function(a){return this.b.ka[0][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.ka[0][b]=a;this.b.S[0][b]&=65295};k.ze=function(a){return this.b.S[3][a>>1&7]};k.yf=function(a,b){this.b.S[3][b>>1&7]=a&65295};k.xe=function(a){return this.b.S[3][(a>>1&7)+8]};k.wf=function(a,b){this.b.S[3][(b>>1&7)+8]=a&65295}; -k.ye=function(a){return this.b.ka[3][a>>1&7]};k.xf=function(a,b){b=b>>1&7;this.b.ka[3][b]=a;this.b.S[3][b]&=65295};k.we=function(a){return this.b.ka[3][(a>>1&7)+8]};k.vf=function(a,b){b=(b>>1&7)+8;this.b.ka[3][b]=a;this.b.S[3][b]&=65295};k.Kb=function(a){a&=7;return this.b.P&2048?this.b.fb[a]:this.b.u[a]};k.Ob=function(a,b){b&=7;this.b.P&2048?this.b.fb[b]=a:this.b.u[b]=a};k.Yd=function(){return this.b.P&49152?this.b.Oa[0]:this.b.u[6]};k.Ve=function(a){this.b.P&49152?this.b.Oa[0]=a:this.b.u[6]=a}; -k.ae=function(){return this.b.u[7]};k.Ye=function(a){this.b.u[7]=a};k.Lb=function(a){a&=7;return this.b.P&2048?this.b.u[a]:this.b.fb[a]};k.Pb=function(a,b){b&=7;this.b.P&2048?this.b.u[b]=a:this.b.fb[b]=a};k.Zd=function(){return 1==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.We=function(a){1==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.$d=function(){return 3==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.Xe=function(a){3==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a}; -k.Jd=function(a){return this.b.Oc[a-65504>>1]};k.Ie=function(a,b){this.b.Oc[b-65504>>1]=a};k.Lc=function(a){return 65520==a?(Gc(this.v)>>6)-1:0};k.Rc=function(){};k.ve=function(){return 1};k.uf=function(){};k.Id=function(){return this.b.sa};k.He=function(){this.b.sa=0};k.Pd=function(){return this.b.Nc};k.Oe=function(a,b){b&1||(a&=255);this.b.Nc=a};k.Ud=function(a,b){return b?0:this.b.Mb};k.Re=function(a){cd(this.b,a)};k.ue=function(a,b){return b?0:this.b.nb&65280};k.tf=function(a){this.b.nb=a|255}; -k.Xd=function(){return dd(this.b)};k.Ue=function(a){ed(this.b,a&-1793|dd(this.b)&1792);this.b.J|=256};k.Qc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; -var O={},Nc=(O[61568]=[null,null,M.prototype.Ae,M.prototype.zf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.te,M.prototype.sf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.re,M.prototype.qf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.se,M.prototype.rf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.qe,M.prototype.pf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Nd,M.prototype.Me,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Ld,M.prototype.Ke,"KDPDR",8,1145,64],O[62688]= -[null,null,M.prototype.Md,M.prototype.Le,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Kd,M.prototype.Je,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Td,M.prototype.Qe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Od,M.prototype.Ne,"LKS"],O[65402]=[null,null,M.prototype.Qd,M.prototype.Pe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Rd,M.prototype.Qc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Sd,M.prototype.Qc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ze,M.prototype.yf, -"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.xe,M.prototype.wf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ye,M.prototype.xf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.we,M.prototype.vf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Kb,M.prototype.Ob,"R0SET0"],O[65473]=[null,null,M.prototype.Kb,M.prototype.Ob,"R1SET0"],O[65474]=[null,null,M.prototype.Kb,M.prototype.Ob,"R2SET0"],O[65475]=[null,null,M.prototype.Kb,M.prototype.Ob,"R3SET0"],O[65476]=[null,null,M.prototype.Kb, -M.prototype.Ob,"R4SET0"],O[65477]=[null,null,M.prototype.Kb,M.prototype.Ob,"R5SET0"],O[65478]=[null,null,M.prototype.Yd,M.prototype.Ve,"R6KERNEL"],O[65479]=[null,null,M.prototype.ae,M.prototype.Ye,"R7KERNEL"],O[65480]=[null,null,M.prototype.Lb,M.prototype.Pb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Lb,M.prototype.Pb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Lb,M.prototype.Pb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Lb,M.prototype.Pb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Lb, -M.prototype.Pb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Lb,M.prototype.Pb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Zd,M.prototype.We,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.$d,M.prototype.Xe,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Jd,M.prototype.Ie,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Lc,M.prototype.Rc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Lc,M.prototype.Rc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.ve,M.prototype.uf,"SYSID",1,1170],O[65526]= -[null,null,M.prototype.Id,M.prototype.He,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Pd,M.prototype.Oe,"MB",1,1170],O[65530]=[null,null,M.prototype.Ud,M.prototype.Re,"PIR"],O[65532]=[null,null,M.prototype.ue,M.prototype.tf,"SL"],O[65534]=[null,null,M.prototype.Xd,M.prototype.Ue,"PSW"],O); -ab(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),md(this,id?nd:od);else{a=this.b=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},ea:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},Ea:function(a,b){a&1&&this.v.Na(b,64,2);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},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.bb=!0},gb:function(a,b){if(this.j&&null!=this.H){var c=this.j;td(c,this.H+a,1,c.N)&&c.da(!0)}return this.I(a,b)},na:function(a,b){if(this.j&&null!=this.H){var c=this.j;td(c,this.H+a,2,c.N)&&c.da(!0)}return this.K(a,b)},Fa:function(a, -b,c){if(this.j&&null!=this.H){var d=this.j;td(d,this.H+a,1,d.F)&&d.da(!0)}this.f?this.w(a,b,c):this.G(a,b,c)},Ya:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;td(d,this.H+a,2,d.F)&&d.da(!0)}this.f?this.w(a,b,c):this.N(a,b,c)},aa:function(a){return this.D[a]},hb:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},fa:function(a,b){a&1&&this.v.Na(b,64,2);return this.F.getUint16(a,!0)},ua:function(a,b){a&1&&this.v.Na(b,64,2); -a=this.R[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},Ca:function(a,b){this.D[a]=b;this.bb=!0},Ga:function(a,b,c){this.D[a]=b;this.bb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Qa:function(a,b,c){a&1&&this.v.Na(c,64,4);this.F.setUint16(a,b,!0);this.bb=!0},Za:function(a,b,c){a&1&&this.v.Na(c,64,4);this.R[a>>1]=b;this.bb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, -b)+")",!0)}};function vc(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&sd(a,rd,!1),(a.g=c.g)&&qd(a,rd,!1))}function ud(a,b){b?--a.g||(a.ic=a.f?a.w:a.G,a.$b=a.f?a.L:a.N):--a.A||(a.fc=a.I,a.Aa=a.K)}function qd(a,b,c){c&&a.g||(a.ic=!a.f&&b[1]||a.w,a.$b=!a.f&&b[3]||a.L);if(c||void 0===c)a.G=b[1]||a.w,a.N=b[3]||a.L}function sd(a,b,c){c&&a.A||(a.fc=b[0]||a.T,a.Aa=b[2]||a.U);if(c||void 0===c)a.I=b[0]||a.T,a.K=b[2]||a.U}function md(a,b){b||(b=vd);sd(a,b,void 0);qd(a,b,void 0)} -var vd=[],pd=[K.prototype.ea,K.prototype.Pa,K.prototype.Ea,K.prototype.$a],rd=[K.prototype.gb,K.prototype.Fa,K.prototype.na,K.prototype.Ya];if(Bb)var od=[K.prototype.aa,K.prototype.Ca,K.prototype.fa,K.prototype.Qa],nd=[K.prototype.hb,K.prototype.Ga,K.prototype.ua,K.prototype.Za]; -function wd(a,b){x.call(this,"CPU",a,wd,1);b=a.cycles||b;var c=a.multiplier||1;this.Qb=0;this.sb=b;this.lb=c;this.Tb=Math.round(this.sb/1E4)/100;this.zb=this.Tb*this.lb;this.C.X=!1;this.C.hc=!1;this.C.Db=a.autoStart;this.C.Eb=!1;this.Vb=this.Ca=0;this.Wb=a.csStart;this.Ib=a.csInterval;this.Jb=a.csStop;this.N=[];this.Cc=this.Ee.bind(this);J(this)}B(wd);var xd=["power","reset"];k=wd.prototype; -k.Ha=function(a,b,c,d){this.A=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b=a.Ca&&(a.Ca+=a.Ib,c=!0);0<=a.Jb&&a.Jb<=Dd(a)&&(a.Ib=a.Jb=-1,Ad(a),a.da(),c=!0);c&&a.i(Dd(a)+" cycles: checksum="+p(a.Vb))}} -k.xa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.ma)a=!0;else{var b=null,c,h=mb(a.id);for(c=0;ca.Ea/a.zb?b=1:d=!0;a.lb=b;b=a.Tb*a.lb;if(a.zb!=b){a.zb=b;b=a.zb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.ob()}Ub(a,a.aa);a.aa=0;a.U=Ba();a.ea=0;Fd(a);return d}function Jc(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Lc(a,b,c,d){0<=b&&ba.N[b][0])&&(c=a.sb*a.lb/1E3*c|0,a.C.X&&(c+=Gd(a)),a.N[b][0]=c)} -function Hd(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 Tb(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 Gd(a,b){var c=a.fa-=a.b;a.b=a.K=0;b&&(a.fa=0);return c} -k.Ee=function(){if(this.C.X){this.jc>=this.sb&&Fd(this,!0);this.Qa=0;this.$a=Ba();if(this.ea){var a=this.$a-this.ea;a>this.Ac&&(this.U+=a,this.U>this.$a&&(this.U=this.$a))}try{do{var b=Hd(this,this.C.Eb?1:this.tb);try{this.rb(b)}catch(e){if("number"!=typeof e)throw e;}b=Gd(this,!0);this.Qa+=b;this.aa+=b;Vb(this,b);Tb(this,b);this.Fa-=b;if(0>=this.Fa){this.Fa+=this.tb;15<=++this.Bc&&(this.ya(),this.Bc=0);break}}while(this.C.X)}catch(e){this.da();this.A&&this.A.stop(Ba(),Dd(this));Ab(this,e.stack|| -e.message);return}if(this.C.X){a=setTimeout;b=this.Cc;this.ea=Ba();var c=this.Ac;this.Qa&&(c=Math.round(c*this.Qa/this.tb));var c=c-(this.ea-this.$a),d=this.ea-this.U;d&&(this.Ea=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.na=0,Ed(this)));if(0>c||this.Eac&&(this.U-=c),c=0;this.jc+=this.Qa;this.ea+=c;a(b,c)}}}; -k.qb=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Ed(this);this.C.X=!0;this.C.hc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.ob(!0),this.A.start(this.U,Dd(this)));setTimeout(this.Cc,0);return!0};k.rb=function(){return 0};k.da=function(a){var b=!1;if(this.C.X){Gd(this);Ub(this,this.aa);this.aa=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Dd(this));b=!0}this.C.complete=a;return b}; -function Id(a){this.kb=+a.model||1170;this.xc=a.addrReset||0;wd.call(this,a,6666667);this.ub=0;this.zc=255;1120==this.kb?(this.decode=Jd.bind(this),this.ua=this.rd,this.ub=8,this.zc=-1):(this.decode=Kd.bind(this),this.ua=this.sd);Ld(this);this.L=0;this.I=null;this.C.complete=!1}B(Id,wd);k=Id.prototype;k.reset=function(){this.status("model "+this.kb);this.C.X&&this.da();Ld(this);zd(this);this.C.error=!1;this.parent.reset.call(this)}; -function Ld(a){a.V=65536;a.W=32768;a.ba=65535;a.Z=32768;a.P=15;a.u=[0,0,0,0,0,0,0,a.xc,-1,-2,-3,-4,-5,-6,-7,-8];a.fb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.B=0;a.Za=0;a.hd=[4,2,0,1];a.S=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0]];a.Yb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Oc=[0,0,0,0,0,0,0,0];a.Nc=0;a.J=0;a.F=a.G=0;a.g=a.f=a.Sb=0;a.Ga=-1;Sb(a)}function Sb(a){a.Da=0;a.kc=0;a.lc=0;a.Xa=0;a.sa=0;a.Mb=0;a.nb=255;a.R=0;a.Ya=0;a.Pa=262143;a.Ub=0;a.wa=0;a.I=null;a.v&&(Md(a),a.fd=Gc(a.v))}function Md(a){a.R?(a.T=65536,a.Rb=a.Xa&16?4186112:253952,a.ca=a.vd,a.Aa=a.Be,a.$b=a.Af,zc(a.v,a.Xa&16?22:18)):(a.T=0,a.Rb=57344,a.ca=a.ud,a.Aa=a.Mc,a.$b=a.Sc,zc(a.v,16))} -function Qc(a){var b=a.Da;b&57344||(b=b&-3199|a.Ya<<5|a.Za<<1);return b}function Rc(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.kc=a.wa>>16&65535,a.lc=a.wa&65535);a.Da=b;a.Ya=b>>5&3;a.Za=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.R!=c&&(a.R=c,Md(a))}}function $c(a){a.Da&57344||(a.kc=a.wa>>16&65535);a=a.kc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function ad(a){a.Da&57344||(a.lc=a.wa&65535);return a.lc}function bd(a,b){1170>a.kb&&(b&=-49);a.Xa!=b&&(a.Xa=b,a.Pa=b&16?4194303:262143,Md(a))} -k.Hc=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.na,this.lb]);a.set(2,Fc(this.v));return a.data()};k.restore=function(a){var b=a[1];this.na=b[1];Ed(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.P>>14&3;a.B!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.B]);a.P=b;a.J&=-3;a.J|=a.I?2:1}function cd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.J|=1}a.Mb=b}function U(a,b){a.J&256||(a.Z=a.ba=b,a.W=0)}function Vd(a,b,c){a.J&256||(a.Z=a.ba=a.V=b,a.W=c||0)} -function Wd(a,b,c,d){a.J&256||(a.Z=a.ba=a.V=b,a.W=(c^b)&(d^b))}function Xd(a,b){a.J&256||(a.Z=a.ba=a.V=b,a.W=a.Z^a.V>>1)}function Yd(a,b,c,d){a.J&256||(a.Z=a.ba=a.V=b,a.W=(c^d)&(d^b))} -k.ta=function(a,b,c){if(!this.L){0>this.Ga?this.Ga=dd(this):this.B||(c=-3);var d=!1;-3==c&&(a=4,this.sa|=4,this.u[6]=4,d=!0);this.wa=a|4143316992;this.B=0;var e=this.Aa(a|this.T),f=this.Aa(a+2&65535|this.T);ed(this,f&-12289|this.Ga>>2&12288);se(this,this.Ga,d);se(this,this.u[7],d);T(this,e);this.J&=~(b|19);this.J|=129;this.Ga=-1;this.pd=a;this.kd=c;if(-3<=c)throw a;}};function te(a){var b=ue(a),c=ue(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);T(a,b);ed(a,c);a.J&=-17} -function Dc(a,b){var c=b>>13&31;31>c&&(b=a.Xa&32?a.Yb[c]+(b&8190)&4194302:b&-3932161);return b} -function ve(a,b,c){var d,e,f;if(!(c&a.R))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Xa&a.hd[a.B]||(d&=7);e=a.S[a.B][d];f=(a.ka[a.B][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=Dc(a,f));if(a.L)return f;f>=a.fd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& -8128)&&(g|=16384));a.S[a.B][d]=e;if(f!=(4194170&a.Pa)||a.B)a.Ya=a.B,a.Za=d;g&&(g&57344&&(0<=a.Ga&&(g|=128),a.Da&57344||(g|=a.Da&4096|a.Ya<<5|a.Za<<1,Rc(a,a.Da&-61695|g&61694)),a.ta(168,64,-1)),a.Da&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function we(a,b){return a.v.dc(b)}function ue(a){var b=a.Aa(a.u[6]|a.T);a.u[6]=a.u[6]+2&65535;return b} -function se(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.wa=a.wa&65535|(a.wa&-65536)<<8|16121856;c||a.ua(4,-2,d);a.$b(d,b)} -function xe(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return a.ta(4,0,-2),0;case 1:return 6==c&&a.ua(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ua(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Aa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ua(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Aa(e)|g;a.b-=8;break;case 6:return e=a.Aa(Sd(a,2)),e=e+a.u[c]&65535,6==c&&a.ua(d, -0,e),a.b-=6,e|g;case 7:return e=a.Aa(Sd(a,2)),e=e+a.u[c]&65535,e=a.Aa(e|a.T),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.wa=a.wa&65535|(a.wa&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.B&&0>=b&&c<=this.nb&&(this.J|=32)};k.sd=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.nb&&(c<=this.nb-32?this.ta(4,0,-3):(this.sa|=8,this.J|=32)))};k.ec=function(a){if(!this.R)return this.v.ec(a);this.L++;a=we(this,ve(this,a,3));this.L--;return a}; -k.Va=function(a){if(!this.R)return this.v.Va(a);this.L++;a=this.Mc(ve(this,a,2));this.L--;return a};k.Bb=function(a,b){this.R?(this.L++,a=ve(this,a,5),a&1&&this.b--,this.v.Nb(a,b),this.L--):this.v.Bb(a,b)};k.pb=function(a,b){this.R?(this.L++,this.Sc(ve(this,a,4),b),this.L--):this.v.pb(a,b)};k.ud=function(a,b,c){return xe(this,a,b,c)};k.vd=function(a,b,c){return ve(this,xe(this,a,b,c),c)};k.Mc=function(a){return this.v.va(this.Ub=a)};k.Be=function(a){return this.v.va(this.Ub=ve(this,a,2))}; -k.Sc=function(a,b){this.v.Cb(this.Ub=a,b&65535)};k.Af=function(a,b){this.v.Cb(this.Ub=ve(this,a,4),b)};function ye(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=xe(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.B=a.P>>12&3,c=a.Aa(d|c&a.T),a.B=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.Oa[a.P>>12&3];return c} -function ze(a,b,c,d){a.wa=a.wa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=xe(a,b,e,4),c&65536||(e&=65535),a.B=a.P>>12&3,e=ve(a,e|c&65536,4),a.B=a.P>>14&3,a.v.Cb(e,d)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.Oa[a.P>>12&3]=d}function Ae(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?we(a,a.ca(b,c,3)):a.u[c+a.ub]&a.zc}function Be(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.v.va(a.ca(b,c,2)):a.u[c+a.ub]}function Ce(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return xe(a,b,c,8)} -function De(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?we(a,a.ca(b,c,3)):a.u[c]&255}function Ee(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.va(a.ca(b,c,2)):a.u[c]}function Fe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Sb=a.ca(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,we(a,e)),e&1&&a.b--,a.v.Nb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))} -function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ca(b,e,6),a.v.Cb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.va(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}function Ge(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ca(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Nb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function He(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ca(b,d,4),a.v.Cb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c} -function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.rb=function(a){this.C.complete=!0;var b=this.j?Ie(this.j)?1:this.C.hc?-1:0:0,c=a?this.C.hc?0:1:-1;this.C.hc=!1;this.fa=this.b=a;do{if(b){if(Je(this.j,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&11)if(a=!1,this.J&2){var d=160,e=(this.Mb&224)>>5,f=this.I&&this.I.mb>e?this.I:null;f&&(d=f.uc,e=f.mb);e>(this.P&224)>>5?(this.J&8&&(Sd(this,2),this.J&=-9),this.ta(d,0,-9),e=!0):e=!1;e&&(f&&Td(this,f),a=!0);this.I||this.Mb||(this.J&=-3)}else this.J&1&&this.J++;if(a){if(b&&Je(this.j,this.u[7], -c)){this.da();break}if(0>c)break}if(this.J&112&&Ud(this)){if(b&&Je(this.j,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&15|this.P&16;this.decode(Rd(this))}while(0>1|b<<16;Xd(this,a);return a&65535}function Pe(a,b){a=b&128|b>>1|b<<8;Xd(this,a<<8);return a&255}function Qe(a,b){a=b&~a;U(this,a);return a}function Re(a,b){a=b&~a;U(this,a<<8);return a}function Se(a,b){a|=b;U(this,a);return a}function Te(a,b){a|=b;U(this,a<<8);return a}function Ue(a,b){a=~b|65536;Vd(this,a);return a&65535} -function Ve(a,b){a=~b|256;Vd(this,a<<8);return a&255}function We(a,b){a=b-a;this.J&256||(this.Z=this.ba=a,this.W=b&(b^a));return a&65535}function Xe(a,b){a=b-a;var c=a<<8;b<<=8;this.J&256||(this.Z=this.ba=c,this.W=b&(b^c));return a&255}function Ye(a,b){a=b+a;this.J&256||(this.Z=this.ba=a,this.W=a&(b^a));return a&65535}function Ze(a,b){a=b+a;var c=a<<8;this.J&256||(this.Z=this.ba=c,this.W=c&(b<<8^c));return a&255}function $e(a,b){a=-b;Vd(this,a,a&b&32768);return a&65535} -function af(a,b){a=-b;Vd(this,a<<8,(a&b&128)<<8);return a&255}function bf(a,b){a=b<<1|this.V>>16&1;Xd(this,a);return a&65535}function cf(a,b){a=b<<1|this.V>>16&1;Xd(this,a<<8);return a&255}function df(a,b){a=(this.V&65536|b)>>1|b<<16;Xd(this,a);return a&65535}function ef(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;Xd(this,a<<8);return a&255}function ff(a,b){var c=b-a;Yd(this,c,a,b);return c&65535}function gf(a,b){var c=b-a;Yd(this,c<<8,a<<8,b<<8);return c&255} -function hf(a,b){this.J&256||(this.Z=this.ba=b&65280,this.W=this.V=0);return(b<<8|b>>8)&65535}function jf(a,b){a^=b;U(this,a);return a&65535}function kf(a){V(this,a,Be(this,a),Ke);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function lf(a){var b=Ee(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.Z=this.ba=c;this.b-=(this.g?6:7)+b} -function mf(a){var b=Ee(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.Z=d>>16;this.ba=d>>16|d;this.b-=(this.g?6:7)+b}function nf(a){W(this,a,!Nd(this))}function of(a){W(this,a,Nd(this))} -function pf(a){V(this,a,Be(this,a),Qe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function qf(a){Fe(this,a,Ae(this,a),Re);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function rf(a){V(this,a,Be(this,a),Se);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function sf(a){Fe(this,a,Ae(this,a),Te);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} -function tf(a){var b=Be(this,a);a=Ee(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function uf(a){var b=Ae(this,a);a=De(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function vf(a){W(this,a,Pd(this))}function wf(a){W(this,a,!Qd(this)==!Od(this))}function xf(a){W(this,a,!Pd(this)&&!Qd(this)==!Od(this))}function yf(a){W(this,a,!Nd(this)&&!Pd(this))} -function zf(a){W(this,a,Pd(this)||!Qd(this)!=!Od(this))}function Af(a){W(this,a,Nd(this)||Pd(this))}function Bf(a){W(this,a,!Qd(this)!=!Od(this))}function Cf(a){W(this,a,Qd(this))}function Df(a){W(this,a,!Pd(this))}function Ef(a){W(this,a,!Qd(this))}function Ff(){this.ta(12,0,-8);this.b-=5}function Gf(a){W(this,a,!0)}function Hf(a){W(this,a,!Od(this))}function If(a){W(this,a,Od(this))}function Jf(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.ba=1);a&8&&(this.Z=0);this.b-=5} -function Kf(a){var b=Be(this,a);a=Ee(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;Yd(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Lf(a){var b=Ae(this,a);a=De(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);Yd(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} -function Mf(a){var b=Ee(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.ba=d>>16|d,this.Z=d>>16):(this.W=32768,this.ba=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ba=this.Z=0,this.W=32768,this.V=65536,this.b-=7}function Nf(){this.ta(24,0,-8);this.b-=25} -function Of(){this.P&49152?(this.sa|=128,this.ta(4,0,-7)):(this.w&&1120==this.kb&&this.w.setData(this.u[0],!0),this.j?Pf(this.j):this.da());this.b-=7}function Qf(){this.ta(16,0,-8);this.b-=25}var Rf=[0,7,7,10,7,11,9,13];function Sf(a){this.K=this.b;T(this,Ce(this,a));this.b=this.K-Rf[this.g]}var Tf=[0,14,14,17,14,18,16,20];function Uf(a){this.K=this.b;var b=Ce(this,a);a=a>>6&7;se(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.K-Tf[this.g]} -var Vf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Wf(a){var b=Be(this,a);this.K=this.b;U(this,He(this,a,b));this.b=this.K-Vf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Xf(a){var b=Ae(this,a);U(this,Ge(this,a,b,65535)<<8);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var Yf=[7,13,13,17,14,18,17,21]; -function Zf(a){var b=Ee(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.J&256||(this.Z=b>>16,this.ba=this.Z|b,this.W=0,this.V=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function fg(a){V(this,a,Be(this,a),ff);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function gg(a){V(this,a,0,hf);this.b-=this.g?9:3+(7==this.f?2:0)}function hg(){this.ta(28,0,-8);this.b-=5} -function ig(){this.w&&(this.w.sc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=8;Sd(this,-2);this.b-=3}function jg(a){V(this,a,this.u[(a>>6&7)+this.ub],jf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Pf(b)):b=!1;b||this.ta(8,0,-8)}function Jd(a){kg[a>>12].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a>>6&3].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)} -function rg(a){sg[a&15].call(this,a)}function tg(a){ug[a&15].call(this,a)}function vg(a){wg[a>>6&3].call(this,a)}function xg(a){yg[a>>6&3].call(this,a)}function zg(a){Ag[a>>6&3].call(this,a)} -var kg=[function(a){Bg[a>>8&15].call(this,a)},Wf,Kf,tf,pf,rf,kf,X,function(a){Cg[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,fg,X],Bg=[function(a){Dg[a>>4&15].call(this,a)},Gf,Df,vf,wf,Bf,xf,zf,Uf,Uf,lg,ng,pg,X,X,X],mg=[function(a){Vd(this,He(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,We);this.b-=this.g?9:3+(7==this.f?2:0)}],og=[function(a){V(this,a,0, -$e);this.b-=this.g?11:6},function(a){V(this,a,Nd(this)?1:0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Nd(this)?1:0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ee(this,a);Vd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],qg=[function(a){V(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Me);this.b-=this.g?9:3+(7==this.f?2:0)}], -Dg=[function(a){Eg[a&15].call(this,a)},X,X,X,Sf,Sf,Sf,Sf,bg,X,rg,tg,gg,gg,gg,gg],Eg=[Of,ig,cg,Ff,Qf,ag,X,X,X,X,X,X,X,X,X,X],sg=[$f,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},Jf,function(){this.ba=1;this.b-=5},Jf,Jf,Jf,function(){this.Z=0;this.b-=5},Jf,Jf,Jf,Jf,Jf,Jf,Jf],ug=[$f,function(){this.V=65536;this.b-=5},function(){this.W=32768;this.b-=5},dg,function(){this.ba=0;this.b-=5},dg,dg,dg,function(){this.Z=32768;this.b-=5},dg,dg,dg,dg,dg,dg,dg],Cg=[Ef,Cf,yf,Af,Hf,If,nf,of,Nf,hg, -vg,xg,zg,X,X,X],wg=[function(a){Vd(this,Ge(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,1,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,1,Xe);this.b-=this.g?9:3+(7==this.f?2:0)}],yg=[function(a){Fe(this,a,0,af);this.b-=this.g?11:6},function(a){Fe(this,a,Nd(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,Nd(this)?1:0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= -De(this,a);Vd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Ag=[function(a){Fe(this,a,0,ef);this.b-=this.g?9+(this.Sb&1):3+(7==this.f?2:0)},function(a){Fe(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Fe(this,a,0,Pe);this.b-=this.g?9+(this.Sb&1):3+(7==this.f?2:0)},function(a){Fe(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}];function Kd(a){Fg[a>>12].call(this,a)} -var Fg=[function(a){Gg[a>>8&15].call(this,a)},Wf,Kf,tf,pf,rf,kf,function(a){Hg[a>>8&15].call(this,a)},function(a){Ig[a>>8&15].call(this,a)},Xf,Lf,uf,qf,sf,fg,X],Gg=[function(a){Jg[a>>4&15].call(this,a)},Gf,Df,vf,wf,Bf,xf,zf,Uf,Uf,lg,ng,pg,function(a){Kg[a>>6&3].call(this,a)},X,X],Kg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Aa(a|this.T);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ye(this,a,0);se(this,a);U(this,a);this.b-=11},function(a){var b=ue(this);this.K= -this.b;ze(this,a,0,b);U(this,b);this.b=this.K-Yf[this.g]},function(a){U(this,He(this,a,Qd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Jg=[function(a){Lg[a&15].call(this,a)},X,X,X,Sf,Sf,Sf,Sf,bg,function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.J|=1,this.J&=-3),this.b-=5):X.call(this,a)},rg,tg,gg,gg,gg,gg],Lg=[Of,ig,function(){te(this);this.J|=this.P&16;this.b-=13},Ff,Qf,ag,cg,function(){this.ta(8,0,-8)},X,X,X,X,X,X,X,X],Hg=[Zf,Zf,Mf,Mf,lf,lf,mf,mf,jg,jg,X,X,X,X,eg,eg],Ig= -[Ef,Cf,yf,Af,Hf,If,nf,of,Nf,hg,vg,xg,zg,function(a){Mg[a>>6&3].call(this,a)},X,X],Mg=[X,function(a){a=ye(this,a,65536);se(this,a);U(this,a);this.b-=11},function(a){var b=ue(this);this.K=this.b;ze(this,a,65536,b);U(this,b);this.b=this.K-Yf[this.g]},X]; -function Ng(a){x.call(this,"ROM",a,Ng,128);this.ja=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(lb(c.hb,a,b),(a=Ea(a,b))?(c.A=a.ha,c.ja=a.ja):c.g=null);Og(c)})}}B(Ng);k=Ng.prototype; -k.Ha=function(a,b,c,d){this.v=b;this.b=c;this.j=d;Og(this)};k.Ka=function(){this.ja&&(this.j&&Pg(this.j,this.id,this.B,this.f,this.ja),delete this.ja);return!0};k.Ja=function(){return!0}; -function Og(a){if(!yb(a)){if(a.g){if(!a.A||!a.v)return;a.f||(a.f=a.A.length);if(a.A.length!=a.f)Ab(a,"ROM size ("+p(a.A.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+qc){var c={};b=(c[b]=[Ng.prototype.pe,Ng.prototype.nf,null,null,null,a.f>>1],c);if(Jb(a.v,a,b)){b=a.F=!0;break a}}else if(wc(a.v,b,a.f,ld)){for(c=0;c>>f.pa;0>>=f.pa;0>>a.pa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= -b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(v)for(G(a,"loading "+q(v)+" bytes at "+q(r)+"-"+q(r+v-1),4096);v--;)a.b.Bb(r++,b[t++]&255);else r&1?a.b.da():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.vc&&c<=la.gd&&(b=c-(la.vc-la.Uc));b&&(a.preventDefault&&a.preventDefault(),d.gc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Wc&&(b=la.Vc);d.gc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); -a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.gc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -k.Ha=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;var e=this;this.fa=Mc(48,4,262144);this.aa=Jc(this.b,function(){var a;a=-1;e.G.length&&(a=e.G.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.ea&&97<=a&&122>a&&(a-=32),Lc(e.b,e.aa,1E3/Math.round(e.R/10)));0<=a&&(e.K=a,e.f&128?e.K|=49152:e.f|=128,e.f&64&&Kc(c,e.fa))});this.N=Mc(52,4,262144);this.ua=Jc(this.b,function(){e.g|=128;e.g&64&&Kc(c,e.N)});Jb(b,this,Wg);Lb(b,this.reset.bind(this));J(this)}; -k.Kc=function(){if(!this.I){var a=yd(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.gb)return;b=ya(b[1]);if(this.I=nb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.hb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.Kc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.Ja=function(a){return a?this.save():!0};k.reset=function(){Xg(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return Xg(this)};function Xg(a){a.K=0;a.f=0;a.g=128;a.G=[];return!0}k.gc=function(a){if("number"==typeof a)this.G.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.U||8,c=a-this.F%a,this.U&&(b=ta("",c)));this.T&&!this.F&&c&&(b=String.fromCharCode(this.T)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.F+=c}}else if(null!=this.B){if(10==a||1024<= -this.B.length)this.i(this.B),this.B="";10!=a&&(this.B+=String.fromCharCode(a))}Lc(this.b,this.ua,1E3/Math.round(this.na/10));this.g&=-129};var Yg={},Wg=(Yg[65392]=[null,null,Ug.prototype.ce,Ug.prototype.$e,"RCSR"],Yg[65394]=[null,null,Ug.prototype.be,Ug.prototype.Ze,"RBUF"],Yg[65396]=[null,null,Ug.prototype.De,Ug.prototype.Cf,"XCSR"],Yg[65398]=[null,null,Ug.prototype.Ce,Ug.prototype.Bf,"XBUF"],Yg); -ab(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= -function(){var a=d.D.listTapes;a&&uh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.R){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;uh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; -k.Ha=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;this.aa=vh(a);var e=this;if((this.g=yd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.T=Mc(56,4,4096);this.fa=Jc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.ma;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(lb(a.hb,e,f),(e=Ea(e,f))&&Eh(a,b,c,d,e.ha,e.Sa, -e.Ra));a.C.jb=!1;a.F&&(a.F--,a.F||J(a));Bh(a)})}function yh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Da(f, -null,!0,function(b,c,d){Lh(a,b,c,d)})} -function Lh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.ma;if(d)a.controller.O('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{lb(a.controller.hb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(h.length)if(1==h.length)w(h[0]);else{a.la=h.length;a.ra=h[0].length;a.ia=h[0][0].length;var l=h[0][0][0];a.za=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,A=t.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Wa+a.Ma&&(a.Ma+=f-(a.Wa+a.Ma)+1):(a.Wa=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ -b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Ta+": "+c);return b}; -k.toJSON=function(){var a;a=0;for(var b;b=Oh(this,a++);)Rh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Rh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.I=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; -k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Sh(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&Th(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Y)?(a=Na(Qh(a),a.rc.replace(".json",".img")),w(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Th(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Ha=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;if((a=yd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.I[e]=a[e]);Uh(this);this.Fb=Mc(144,5,65536);Jb(b,this,Vh);Lb(b,this.reset.bind(this));Wh(this,"None","",!0);this.K&&Wh(this,"Local Disk","?");Wh(this,"Remote Disk","??");Xh(this)||J(this)}; -k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Sh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Uh(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return Uh(this,a[0])};function Xh(a,b){b||(a.F=0);for(var c in a.I){var d=a.I[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}Zh(a,e,b,c,!1,d)}else Yh(a,e)} -function Zh(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,Yh(a,b,!0),h.xb?a.O("RK11 busy"):(h.xb=!0,e&&(h.wb=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.cb=!!f,Kh(new Gh(a,h,"preload"),c,d,f,a.Zc)&&g++));return g} -k.Zc=function(a,b,c,d,e){var f;a.xb=!1;b&&(f=Nh(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.O('Disk "'+c+'" too large for drive '+("RK"+a.yb)),b=null);b?(a.Y=b,a.Ta=c,a.La=d,this.O('Mounted disk "'+c+'" in drive '+("RK"+a.yb),a.wb||e),this.A&&this.A.ob()):a.cb=!1;a.wb&&(a.wb=!1,--this.F||J(this));Sh(this,a.yb)}; -function Wh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.G=65536-e&65535;a&&(this.B=this.B|a|32768,this.M|=49152);return!0};k.$c=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=32;break}this.v.pb(f,r|t<<8);if(Ic(this.v)){h=1024;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; -k.ad=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){var r=this.v.Va(f);if(Ic(this.v)){h=1024;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=32;break}if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.he=function(){return this.L};k.ef=function(){};k.ie=function(){return this.B};k.ff=function(){};k.ee=function(){return this.M&61438}; -k.bf=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.B=0;this.M=128;this.f=0;break;case 4:b=this.$c;case 2:b||(b=this.ad),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.B|=32832,this.M|=49152):g>=d.ia?(this.B|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.G&65535,c=b.call(this,d,e,f,g,c,h,this.Yc.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= --2,this.M|=128,this.M&64&&Kc(this.b,this.Fb))}};k.je=function(){return this.G};k.gf=function(a){this.G=a};k.de=function(){return this.w};k.af=function(a){this.w=a};k.fe=function(){return this.f};k.cf=function(a){this.f=a};k.ge=function(){return this.N};k.df=function(a){this.N=a}; -var $h={},Vh=($h[65280]=[null,null,Q.prototype.he,Q.prototype.ef,"RKDS"],$h[65282]=[null,null,Q.prototype.ie,Q.prototype.ff,"RKER"],$h[65284]=[null,null,Q.prototype.ee,Q.prototype.bf,"RKCS"],$h[65286]=[null,null,Q.prototype.je,Q.prototype.gf,"RKWC"],$h[65288]=[null,null,Q.prototype.de,Q.prototype.af,"RKBA"],$h[65290]=[null,null,Q.prototype.fe,Q.prototype.cf,"RKDA"],$h[65294]=[null,null,Q.prototype.ge,Q.prototype.df,"RKDB"],$h); -function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.I=0;this.g=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; -k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&ai(d,a)},!0;case "loadDrive":return this.D[b]= -c,c.onclick=function(){var a=d.D.listDisks;a&&bi(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Y)?(a=Na(Qh(a),a.rc.replace(".json",".img")),w(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;bi(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -k.Ha=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;if((a=yd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);ci(this);this.Fb=Mc(112,5,131072);Jb(b,this,di);Lb(b,this.reset.bind(this));ei(this,"None","",!0);this.L&&ei(this,"Local Disk","?");ei(this,"Remote Disk","??");fi(this)||J(this)}; -k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ai(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){ci(this)};k.save=function(){return(new S(this)).data()}; -k.restore=function(a){return ci(this,a[0])};function fi(a,b){b||(a.I=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}hi(a,e,b,c,!1,d)}else gi(a,e)} -function hi(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,gi(a,b,!0),h.xb?a.O("RL11 busy"):(h.xb=!0,e&&(h.wb=!0,a.I++,I(a)&&G(a,"auto-loading disk: "+c)),h.cb=!!f,Kh(new Gh(a,h,"preload"),c,d,f,a.cd)&&g++));return g} -k.cd=function(a,b,c,d,e){var f;a.xb=!1;b&&(f=Nh(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.Y=b,a.Ta=c,a.La=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.wb||e),this.A&&this.A.ob()):a.cb=!1;a.wb&&(a.wb=!1,--this.I||J(this));ai(this,a.yb)}; -function ei(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.B=this.f=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; -k.dd=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=5120;break}this.v.pb(f,r|t<<8);if(Ic(this.v)){h=8192;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)}; -k.ed=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=5120,e=0);for(;e--;){var r=this.v.Va(f);if(Ic(this.v)){h=8192;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=5120;break}if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)};k.me=function(){return this.M&65535}; -k.kf=function(a){this.M=this.M&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.f&8&&(this.M&=63);this.G=c.status|this.B&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.B=this.f&4?this.B+b:this.B-b,this.f=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.dd;case 10:b||(b=this.ed),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ia?this.M|=37888:(g=(this.F& -63)<<16|this.w,a=65536-this.G&65535,a=b.call(this,c,d,e,f,a,g,this.bd.bind(this)))}a&&(this.M|=129,this.M&64&&Kc(this.b,this.Fb))}};k.ke=function(){return this.w};k.hf=function(a){this.w=a&65534};k.ne=function(){return this.f};k.lf=function(a){this.f=a};k.oe=function(){return this.G};k.mf=function(a){this.G=a};k.le=function(){return this.F};k.jf=function(a){this.F=a&63;this.M=this.M&-49|(this.F&3)<<4}; -var ii={},di=(ii[63744]=[null,null,P.prototype.me,P.prototype.kf,"RLCS"],ii[63746]=[null,null,P.prototype.ke,P.prototype.hf,"RLBA"],ii[63748]=[null,null,P.prototype.ne,P.prototype.lf,"RLDA"],ii[63750]=[null,null,P.prototype.oe,P.prototype.mf,"RLMP"],ii[63752]=[null,null,P.prototype.le,P.prototype.jf,"RLBE"],ii);function ji(a){x.call(this,"Debugger",a,ji);this.na=a.base||16;this.Ga=!1;this.K=0;this.U=!1;this.B=-1;this.g=[];this.ea={}}B(ji); -var ki={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ji.prototype.Ic=function(){return-1};ji.prototype.Jc=function(){}; -function li(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.U?b="end":b=a.g[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(ya(b.substring(c,f))),c=f+1}}return a} -function mi(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; +b){return function(){Hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Hb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ib(a,b)}}(this,b),!0):this.parent.xa.call(this,a,b,c,d)}};k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;Jb(b,this,Kb);Lb(b,this.reset.bind(this));Mb(this);Nb(this)};k.Ja=function(a,b){b||(Ob(),this.reset());return!0};k.Ia=function(){return!0}; +function Pb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Mb(a,b){for(var c in a.g)Pb(a,c,null!=b?b:a.g[c])}function Qb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Nb(a){for(var b in a.f)Qb(a,b,a.f[b][1])}function Rb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ea()),c=8==(a.j&&a.j.ta||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} +function Hb(a,b){var c=a.f[b];Qb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.J="DEP"==b,a.K="EXAM"==b)}function Ib(a,b){var c=a.f[b];c[2]&&c[3]&&(Qb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ad=function(a){a||this.b.C.X||(a=this.b,a.v.reset(),Sb(a),Gb(this,"ENABLE")&&this.b.ob())};k.Bd=function(){};k.wd=function(a){a||this.b.ea()}; +k.ud=function(a){if(!a&&!this.b.C.X)if(Gb(this,"ENABLE"))this.b.ob();else{if((a=this.j)&&!rb(a,!0))qb(a,!0),a.pb(0,null),qb(a,!1);else try{var b=this.b.pb(1);0a.b.jb?8:16,c=65472<=a.Ba&&a.Ba<65472+b,b=c?1:2,c=c?15:a.v.Eb;Gb(a,"STEP")||(b=-b);oc(a,a.Ba&~c|a.Ba+b&c)} +function oc(a,b){a.Ba=b&a.v.Eb;b=a.Ba;for(var c=0;22>c;c++)qc(a,"A"+c,b&1<c;c++)qc(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ha-1;this.w=this.B/this.Ha|0;this.hb=[];this.pa=0;this.A=!1;this.F=[];this.gd=[vc,wc,xc,yc];a=new K(this);zc(a,this.j);this.da=Array(this.w);this.f=Array(this.w);for(b=0;b>>this.oa;this.G=0;this.g=this.Eb;J(this)}B(tc); +var uc=8192,Cc=uc-1;function vc(a,b){var c=-1,d=this.controller,e=d.hb[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.hb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.pa),c;d.Na(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.pa);return c} +function wc(a,b,c){var d=!1,e=this.controller,f=e.hb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.hb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.pa):(e.Na(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, +b),!0,!e.pa))}function xc(a,b){var c=-1,d=this.controller;a=d.hb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.pa),c;d.Na(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.pa);return c} +function yc(a,b,c){var d=!1,e=this.controller;a=e.hb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.pa):(e.Na(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.pa))} +function Dc(a,b){if(b!=a.G){for(var c=0;c>>a.oa,a.f[a.K]=a.da[a.J])}}k=tc.prototype;k.reset=function(){for(var a=0;a>>a.oa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Lb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.H+n;f=m+a.Ha;g-=n;h++;continue}}return Ec(1,f,g)}f=new K(a,f,n,a.Ha,d,e);zc(f,a.j,l);a.da[h++]=f;f=m+a.Ha;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Fc[d]+" at "+na(b)),!0):Ec(2,b,c)}k.ac=function(a){return this.f[(a&this.g)>>>this.oa].bc(a&this.v,a)}; +function Gc(a,b){return a.da[(b&a.Eb)>>>a.oa]}k.va=function(a){return this.f[(a&this.g)>>>this.oa].Aa(a&this.v,a)};function $b(a,b){a.A=!1;a.pa++;b=Gc(a,b).K(b&a.v,b);a.pa--;return b}k.Kb=function(a,b){this.f[(a&this.g)>>>this.oa].ec(a&this.v,b&255,a)};function Hc(a,b,c){a.A=!1;a.pa++;Gc(a,b).G(b&a.v,c&255,b);a.pa--}k.zb=function(a,b){this.f[(a&this.g)>>>this.oa].Xb(a&this.v,b&65535,a)};function Yb(a,b,c){a.A=!1;a.pa++;Gc(a,b).N(b&a.v,c&65535,b);a.pa--} +function Ic(a){for(var b=0,c=[],d=0;da.b.jb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],r=f[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Db=128;Pc(this.b,this.f.pc,1E3/60,!0)};k.Kd=function(){return this.f.Db};k.Je=function(a){this.f.Db=a&192;this.f.Db&64||Tc(this.b,this.f.Cb)};k.Md=function(){return Uc(this.b)};k.Le=function(a){cd(this.b,a&-129|this.b.Da&128)}; +k.Nd=function(){return dd(this.b)};k.Od=function(){return ed(this.b)};k.Pd=function(){return this.b.Wa};k.Me=function(a){fd(this.b,a)};k.we=function(a){a=a>>1&63;var b=this.b.Wb[a>>1];return a&1?b>>16:b&65535};k.vf=function(a,b){b=b>>1&63;var c=b>>1;this.b.Wb[c]=b&1?this.b.Wb[c]&65535|(a&63)<<16:this.b.Wb[c]&-65536|a&65534};k.pe=function(a){return this.b.R[1][a>>1&7]};k.nf=function(a,b){this.b.R[1][b>>1&7]=a&65295};k.ne=function(a){return this.b.R[1][(a>>1&7)+8]}; +k.lf=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};k.oe=function(a){return this.b.ka[1][a>>1&7]};k.mf=function(a,b){b=b>>1&7;this.b.ka[1][b]=a;this.b.R[1][b]&=65295};k.me=function(a){return this.b.ka[1][(a>>1&7)+8]};k.kf=function(a,b){b=(b>>1&7)+8;this.b.ka[1][b]=a;this.b.R[1][b]&=65295};k.Jd=function(a){return this.b.R[0][a>>1&7]};k.Ie=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Hd=function(a){return this.b.R[0][(a>>1&7)+8]};k.Ge=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295}; +k.Id=function(a){return this.b.ka[0][a>>1&7]};k.He=function(a,b){b=b>>1&7;this.b.ka[0][b]=a;this.b.R[0][b]&=65295};k.Gd=function(a){return this.b.ka[0][(a>>1&7)+8]};k.Fe=function(a,b){b=(b>>1&7)+8;this.b.ka[0][b]=a;this.b.R[0][b]&=65295};k.ve=function(a){return this.b.R[3][a>>1&7]};k.uf=function(a,b){this.b.R[3][b>>1&7]=a&65295};k.te=function(a){return this.b.R[3][(a>>1&7)+8]};k.sf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295};k.ue=function(a){return this.b.ka[3][a>>1&7]}; +k.tf=function(a,b){b=b>>1&7;this.b.ka[3][b]=a;this.b.R[3][b]&=65295};k.se=function(a){return this.b.ka[3][(a>>1&7)+8]};k.rf=function(a,b){b=(b>>1&7)+8;this.b.ka[3][b]=a;this.b.R[3][b]&=65295};k.Hb=function(a){a&=7;return this.b.P&2048?this.b.eb[a]:this.b.u[a]};k.Mb=function(a,b){b&=7;this.b.P&2048?this.b.eb[b]=a:this.b.u[b]=a};k.Ud=function(){return this.b.P&49152?this.b.Oa[0]:this.b.u[6]};k.Re=function(a){this.b.P&49152?this.b.Oa[0]=a:this.b.u[6]=a};k.Xd=function(){return this.b.u[7]}; +k.Ue=function(a){this.b.u[7]=a};k.Ib=function(a){a&=7;return this.b.P&2048?this.b.u[a]:this.b.eb[a]};k.Nb=function(a,b){b&=7;this.b.P&2048?this.b.u[b]=a:this.b.eb[b]=a};k.Vd=function(){return 1==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.Se=function(a){1==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.Wd=function(){return 3==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.Te=function(a){3==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a};k.Fd=function(a){return this.b.Lc[a-65504>>1]}; +k.Ee=function(a,b){this.b.Lc[b-65504>>1]=a};k.Ic=function(a){return 65520==a?(Jc(this.v)>>6)-1:0};k.Oc=function(){};k.re=function(){return 1};k.qf=function(){};k.Ed=function(){return this.b.ra};k.De=function(){this.b.ra=0};k.Ld=function(){return this.b.Kc};k.Ke=function(a,b){b&1||(a&=255);this.b.Kc=a};k.Qd=function(a,b){return b?0:this.b.Jb};k.Ne=function(a){gd(this.b,a)};k.qe=function(a,b){return b?0:this.b.mb&65280};k.pf=function(a){this.b.mb=a|255};k.Td=function(){return hd(this.b)}; +k.Qe=function(a){id(this.b,a&-1793|hd(this.b)&1792);this.b.I|=256};k.Nc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; +var O={},Rc=(O[61568]=[null,null,M.prototype.we,M.prototype.vf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.pe,M.prototype.nf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.ne,M.prototype.lf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.oe,M.prototype.mf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.me,M.prototype.kf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Jd,M.prototype.Ie,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Hd,M.prototype.Ge,"KDPDR",8,1145,64],O[62688]= +[null,null,M.prototype.Id,M.prototype.He,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Gd,M.prototype.Fe,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Pd,M.prototype.Me,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Kd,M.prototype.Je,"LKS"],O[65402]=[null,null,M.prototype.Md,M.prototype.Le,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Nd,M.prototype.Nc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Od,M.prototype.Nc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ve,M.prototype.uf, +"UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.te,M.prototype.sf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ue,M.prototype.tf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.se,M.prototype.rf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Hb,M.prototype.Mb,"R0SET0"],O[65473]=[null,null,M.prototype.Hb,M.prototype.Mb,"R1SET0"],O[65474]=[null,null,M.prototype.Hb,M.prototype.Mb,"R2SET0"],O[65475]=[null,null,M.prototype.Hb,M.prototype.Mb,"R3SET0"],O[65476]=[null,null,M.prototype.Hb, +M.prototype.Mb,"R4SET0"],O[65477]=[null,null,M.prototype.Hb,M.prototype.Mb,"R5SET0"],O[65478]=[null,null,M.prototype.Ud,M.prototype.Re,"R6KERNEL"],O[65479]=[null,null,M.prototype.Xd,M.prototype.Ue,"R7KERNEL"],O[65480]=[null,null,M.prototype.Ib,M.prototype.Nb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Ib,M.prototype.Nb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Ib,M.prototype.Nb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Ib,M.prototype.Nb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Ib, +M.prototype.Nb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Ib,M.prototype.Nb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Vd,M.prototype.Se,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.Wd,M.prototype.Te,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Fd,M.prototype.Ee,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Ic,M.prototype.Oc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Ic,M.prototype.Oc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.re,M.prototype.qf,"SYSID",1,1170],O[65526]= +[null,null,M.prototype.Ed,M.prototype.De,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Ld,M.prototype.Ke,"MB",1,1170],O[65530]=[null,null,M.prototype.Qd,M.prototype.Ne,"PIR"],O[65532]=[null,null,M.prototype.qe,M.prototype.pf,"SL"],O[65534]=[null,null,M.prototype.Td,M.prototype.Qe,"PSW"],O); +bb(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),qd(this,md?rd:sd);else{a=this.b=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},fa:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},Ea:function(a,b){a&1&&this.v.Na(b,64,2);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},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.ab=!0},gb:function(a,b){if(this.j&&null!=this.H){var c=this.j;xd(c,this.H+a,1,c.N)&&c.ea(!0)}return this.J(a,b)},ta:function(a,b){if(this.j&&null!=this.H){var c=this.j;xd(c,this.H+a,2,c.N)&&c.ea(!0)}return this.K(a,b)},Fa:function(a, +b,c){if(this.j&&null!=this.H){var d=this.j;xd(d,this.H+a,1,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.G(a,b,c)},Xa:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;xd(d,this.H+a,2,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.N(a,b,c)},fb:function(a){return this.D[a]},aa:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ga:function(a,b){a&1&&this.v.Na(b,64,2);return this.F.getUint16(a,!0)},ua:function(a,b){a&1&&this.v.Na(b,64,2); +a=this.S[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},Ca:function(a,b){this.D[a]=b;this.ab=!0},La:function(a,b,c){this.D[a]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Qa:function(a,b,c){a&1&&this.v.Na(c,64,4);this.F.setUint16(a,b,!0);this.ab=!0},Ya:function(a,b,c){a&1&&this.v.Na(c,64,4);this.S[a>>1]=b;this.ab=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, +b)+")",!0)}};function zc(a,b,c){a.j=b;a.A=a.g=0;c&&((a.A=c.A)&&wd(a,vd,!1),(a.g=c.g)&&ud(a,vd,!1))}function yd(a,b){b?--a.g||(a.ec=a.f?a.w:a.G,a.Xb=a.f?a.L:a.N):--a.A||(a.bc=a.J,a.Aa=a.K)}function ud(a,b,c){c&&a.g||(a.ec=!a.f&&b[1]||a.w,a.Xb=!a.f&&b[3]||a.L);if(c||void 0===c)a.G=b[1]||a.w,a.N=b[3]||a.L}function wd(a,b,c){c&&a.A||(a.bc=b[0]||a.T,a.Aa=b[2]||a.U);if(c||void 0===c)a.J=b[0]||a.T,a.K=b[2]||a.U}function qd(a,b){b||(b=zd);wd(a,b,void 0);ud(a,b,void 0)} +var zd=[],td=[K.prototype.fa,K.prototype.Pa,K.prototype.Ea,K.prototype.Za],vd=[K.prototype.gb,K.prototype.Fa,K.prototype.ta,K.prototype.Xa];if(Bb)var sd=[K.prototype.fb,K.prototype.Ca,K.prototype.ga,K.prototype.Qa],rd=[K.prototype.aa,K.prototype.La,K.prototype.ua,K.prototype.Ya]; +function Ad(a,b){x.call(this,"CPU",a,Ad,1);b=a.cycles||b;var c=a.multiplier||1;this.Ob=0;this.qb=b;this.kb=c;this.Rb=Math.round(this.qb/1E4)/100;this.xb=this.Rb*this.kb;this.C.X=!1;this.C.dc=!1;this.C.Ab=a.autoStart;this.C.Bb=!1;this.Tb=this.Ea=0;this.Ub=a.csStart;this.Fb=a.csInterval;this.Gb=a.csStop;this.N=[];this.zc=this.Ae.bind(this);J(this)}B(Ad);var Bd=["power","reset"];k=Ad.prototype; +k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b=a.Ea&&(a.Ea+=a.Fb,c=!0);0<=a.Gb&&a.Gb<=Hd(a)&&(a.Fb=a.Gb=-1,Ed(a),a.ea(),c=!0);c&&a.i(Hd(a)+" cycles: checksum="+p(a.Tb))}} +k.xa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.ma)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.ua/a.xb?b=1:d=!0;a.kb=b;b=a.Rb*a.kb;if(a.xb!=b){a.xb=b;b=a.xb.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.A&&a.A.nb()}Ub(a,a.U);a.U=0;a.T=Ba();a.aa=0;Jd(a);return d}function Nc(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&ba.N[b][0])&&(c=a.qb*a.kb/1E3*c|0,a.C.X&&(c+=Kd(a)),a.N[b][0]=c)} +function Ld(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 Tb(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 Kd(a,b){var c=a.fa-=a.b;a.b=a.L=0;b&&(a.fa=0);return c} +k.Ae=function(){if(this.C.X){this.fc>=this.qb&&Jd(this,!0);this.Qa=0;this.Za=Ba();if(this.aa){var a=this.Za-this.aa;a>this.xc&&(this.T+=a,this.T>this.Za&&(this.T=this.Za))}try{do{var b=Ld(this,this.C.Bb?1:this.rb);try{this.pb(b)}catch(e){if("number"!=typeof e)throw e;}b=Kd(this,!0);this.Qa+=b;this.U+=b;Vb(this,b);Tb(this,b);this.Ca-=b;if(0>=this.Ca){this.Ca+=this.rb;15<=++this.yc&&(this.ya(),this.yc=0);break}}while(this.C.X)}catch(e){this.ea();this.A&&this.A.stop(Ba(),Hd(this));Ab(this,e.stack||e.message); +return}if(this.C.X){a=setTimeout;b=this.zc;this.aa=Ba();var c=this.xc;this.Qa&&(c=Math.round(c*this.Qa/this.rb));var c=c-(this.aa-this.Za),d=this.aa-this.T;d&&(this.ua=Math.round(this.U/(10*d))/100,864E5<=d&&(this.ga=0,Id(this)));if(0>c||this.uac&&(this.T-=c),c=0;this.fc+=this.Qa;this.aa+=c;a(b,c)}}}; +k.ob=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Id(this);this.C.X=!0;this.C.dc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.A&&(a&&this.A.nb(!0),this.A.start(this.T,Hd(this)));setTimeout(this.zc,0);return!0};k.pb=function(){return 0};k.ea=function(a){var b=!1;if(this.C.X){Kd(this);Ub(this,this.U);this.U=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.A&&this.A.stop(Ba(),Hd(this));b=!0}this.C.complete=a;return b}; +function Md(a){this.jb=+a.model||1170;this.uc=a.addrReset||0;Ad.call(this,a,6666667);this.sb=0;this.wc=255;1120==this.jb?(this.decode=Nd.bind(this),this.ta=this.nd,this.sb=8,this.wc=-1):(this.decode=Od.bind(this),this.ta=this.od);Pd(this);this.K=0;this.J=null;this.C.complete=!1}B(Md,Ad);k=Md.prototype;k.reset=function(){this.status("model "+this.jb);this.C.X&&this.ea();Pd(this);Dd(this);this.C.error=!1;this.parent.reset.call(this)}; +function Pd(a){a.V=65536;a.W=32768;a.ba=65535;a.Z=32768;a.P=15;a.u=[0,0,0,0,0,0,0,a.uc,-1,-2,-3,-4,-5,-6,-7,-8];a.eb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.B=0;a.Ya=0;a.dd=[4,2,0,1];a.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],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0]];a.Wb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Lc=[0,0,0,0,0,0,0,0];a.Kc=0;a.I=0;a.F=a.G=0;a.g=a.f=a.Qb=0;a.Fa=-1;Sb(a)}function Sb(a){a.Da=0;a.gc=0;a.hc=0;a.Wa=0;a.ra=0;a.Jb=0;a.mb=255;a.La=0;a.Xa=0;a.Pa=262143;a.Sb=0;a.wa=0;a.J=null;a.v&&(Qd(a),a.bd=Jc(a.v))}function Qd(a){a.La?(a.S=65536,a.Pb=a.Wa&16?4186112:253952,a.ca=a.rd,a.Aa=a.xe,a.Xb=a.wf,Dc(a.v,a.Wa&16?22:18)):(a.S=0,a.Pb=57344,a.ca=a.qd,a.Aa=a.Jc,a.Xb=a.rc,Dc(a.v,16))} +function Uc(a){var b=a.Da;b&57344||(b=b&-3199|a.Xa<<5|a.Ya<<1);return b}function cd(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.gc=a.wa>>16&65535,a.hc=a.wa&65535);a.Da=b;a.Xa=b>>5&3;a.Ya=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.La!=c&&(a.La=c,Qd(a))}}function dd(a){a.Da&57344||(a.gc=a.wa>>16&65535);a=a.gc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function ed(a){a.Da&57344||(a.hc=a.wa&65535);return a.hc} +function fd(a,b){1170>a.jb&&(b&=-49);a.Wa!=b&&(a.Wa=b,a.Pa=b&16?4194303:262143,Qd(a))}k.Ec=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.ga,this.kb]);a.set(2,Ic(this.v));return a.data()}; +k.restore=function(a){var b=a[1];this.ga=b[1];Id(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.P>>14&3;a.B!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.B]);a.P=b;a.I&=-3;a.I|=a.J?2:1}function gd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.I|=1}a.Jb=b}function U(a,b){a.I&256||(a.Z=a.ba=b,a.W=0)}function Zd(a,b,c){a.I&256||(a.Z=a.ba=a.V=b,a.W=c||0)} +function $d(a,b,c,d){a.I&256||(a.Z=a.ba=a.V=b,a.W=(c^b)&(d^b))}function ae(a,b){a.I&256||(a.Z=a.ba=a.V=b,a.W=a.Z^a.V>>1)}function ve(a,b,c,d){a.I&256||(a.Z=a.ba=a.V=b,a.W=(c^d)&(d^b))} +k.sa=function(a,b,c){if(!this.K){0>this.Fa?this.Fa=hd(this):this.B||(c=-3);var d=!1;-3==c&&(a=4,this.ra|=4,this.u[6]=4,d=!0);this.wa=a|4143316992;this.B=0;var e=this.Aa(a|this.S),f=this.Aa(a+2&65535|this.S);id(this,f&-12289|this.Fa>>2&12288);we(this,this.Fa,d);we(this,this.u[7],d);T(this,e);this.b-=5;this.I&=~(b|19);this.I|=129;this.Fa=-1;this.ld=a;this.fd=c;if(-3<=c)throw a;}};function xe(a){var b=ye(a),c=ye(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);T(a,b);id(a,c);a.I&=-17} +function ze(a,b){if(3932160<=b){var c=b>>13&31;31>c&&(b=a.Wa&32?a.Wb[c]+(b&8190)&4194302:b&-3932161)}return b} +function Zb(a,b,c){var d,e,f;if(!(c&a.La))return f=b&65535,57344<=f&&(f|=a.Pb),f;d=b>>13;a.Wa&a.dd[a.B]||(d&=7);e=a.R[a.B][d];f=(a.ka[a.B][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=ze(a,f));if(a.K)return f;f>=a.bd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& +8128)&&(g|=16384));a.R[a.B][d]=e;if(f!=(4194170&a.Pa)||a.B)a.Xa=a.B,a.Ya=d;g&&(g&57344&&(0<=a.Fa&&(g|=128),a.Da&57344||(g|=a.Da&4096|a.Xa<<5|a.Ya<<1,cd(a,a.Da&-61695|g&61694)),a.sa(168,64,-1)),a.Da&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Da|=4096,a.Da&512&&(a.I|=64)));return f}function Ae(a,b){return a.v.ac(b)}function ye(a){var b=a.Aa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b} +function we(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.wa=a.wa&65535|(a.wa&-65536)<<8|16121856;c||a.ta(4,-2,d);a.Xb(d,b)} +function Be(a,b,c,d){var e,f,g=d&8?0:a.S;switch(b){case 0:return a.sa(4,0,-2),0;case 1:return 6==c&&a.ta(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ta(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Aa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ta(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Aa(e)|g;a.b-=8;break;case 6:return e=a.Aa(Wd(a,2)),e=e+a.u[c]&65535,6==c&&a.ta(d, +0,e),a.b-=6,e|g;case 7:return e=a.Aa(Wd(a,2)),e=e+a.u[c]&65535,e=a.Aa(e|a.S),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.wa=a.wa&65535|(a.wa&-65536)<<8|(f<<3&248|c)<<16;return e}k.nd=function(a,b,c){!this.B&&0>=b&&c<=this.mb&&(this.I|=32)};k.od=function(a,b,c){this.B||(65534<=c&&(c|=-65536),a&4&&c<=this.mb&&(c<=this.mb-32?this.sa(4,0,-3):(this.ra|=8,this.I|=32)))};function nc(a,b){a.K++;b=a.Jc(Zb(a,b,2));a.K--;return b}k.qd=function(a,b,c){a=Be(this,a,b,c);3932160<=a&&(a=ze(this,a));return a}; +k.rd=function(a,b,c){return Zb(this,Be(this,a,b,c),c)};k.Jc=function(a){3932160<=a&&(a=ze(this,a));return this.v.va(this.Sb=a)};k.xe=function(a){return this.v.va(this.Sb=Zb(this,a,2))};k.rc=function(a,b){3932160<=a&&(a=ze(this,a));this.v.zb(this.Sb=a,b&65535)};k.wf=function(a,b){this.v.zb(this.Sb=Zb(this,a,4),b)}; +function Ce(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Be(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.B=a.P>>12&3,c=a.Aa(d|c&a.S),a.B=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.Oa[a.P>>12&3];return c}function De(a,b,c,d){a.wa=a.wa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Be(a,b,e,4),c&65536||(e&=65535),a.B=a.P>>12&3,e=Zb(a,e|c&65536,4),a.B=a.P>>14&3,a.v.zb(e,d)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.Oa[a.P>>12&3]=d} +function Ee(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?Ae(a,a.ca(b,c,3)):a.u[c+a.sb]&a.wc}function Fe(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.v.va(a.ca(b,c,2)):a.u[c+a.sb]}function Ge(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Be(a,b,c,8)}function He(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ae(a,a.ca(b,c,3)):a.u[c]&255}function Ie(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.va(a.ca(b,c,2)):a.u[c]} +function Je(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Qb=a.ca(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,Ae(a,e)),e&1&&a.b--,a.v.Kb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ca(b,e,6),a.v.zb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.va(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])} +function Ke(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ca(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Kb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Le(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ca(b,d,4),a.v.zb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +k.pb=function(a){this.C.complete=!0;var b=this.j?Me(this.j)?1:this.C.dc?-1:0:0,c=a?this.C.dc?0:1:-1;this.C.dc=!1;this.fa=this.b=a;do{if(b){if(Ne(this.j,this.u[7],c)){this.ea();break}c||c++;b++}if(this.I){if(a=this.I&11)if(a=!1,this.I&2){var d=160,e=(this.Jb&224)>>5,f=this.J&&this.J.lb>e?this.J:null;f&&(d=f.qc,e=f.lb);e>(this.P&224)>>5?(this.I&8&&(Wd(this,2),this.I&=-9),this.sa(d,0,-9),e=!0):e=!1;e&&(f&&Xd(this,f),a=!0);this.J||this.Jb||(this.I&=-3)}else this.I&1&&this.I++;if(a){if(b&&Ne(this.j,this.u[7], +c)){this.ea();break}if(0>c)break}if(this.I&112&&Yd(this)){if(b&&Ne(this.j,this.u[7],c)){this.ea();break}if(0>c)break}}this.I=this.I&15|this.P&16;this.decode(Vd(this))}while(0>1|b<<16;ae(this,a);return a&65535}function Te(a,b){a=b&128|b>>1|b<<8;ae(this,a<<8);return a&255}function Ue(a,b){a=b&~a;U(this,a);return a}function Ve(a,b){a=b&~a;U(this,a<<8);return a}function We(a,b){a|=b;U(this,a);return a}function Xe(a,b){a|=b;U(this,a<<8);return a}function Ye(a,b){a=~b|65536;Zd(this,a);return a&65535} +function Ze(a,b){a=~b|256;Zd(this,a<<8);return a&255}function $e(a,b){a=b-a;this.I&256||(this.Z=this.ba=a,this.W=b&(b^a));return a&65535}function af(a,b){a=b-a;var c=a<<8;b<<=8;this.I&256||(this.Z=this.ba=c,this.W=b&(b^c));return a&255}function bf(a,b){a=b+a;this.I&256||(this.Z=this.ba=a,this.W=a&(b^a));return a&65535}function cf(a,b){a=b+a;var c=a<<8;this.I&256||(this.Z=this.ba=c,this.W=c&(b<<8^c));return a&255}function df(a,b){a=-b;Zd(this,a,a&b&32768);return a&65535} +function ef(a,b){a=-b;Zd(this,a<<8,(a&b&128)<<8);return a&255}function ff(a,b){a=b<<1|this.V>>16&1;ae(this,a);return a&65535}function gf(a,b){a=b<<1|this.V>>16&1;ae(this,a<<8);return a&255}function hf(a,b){a=(this.V&65536|b)>>1|b<<16;ae(this,a);return a&65535}function jf(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;ae(this,a<<8);return a&255}function kf(a,b){var c=b-a;ve(this,c,a,b);return c&65535}function lf(a,b){var c=b-a;ve(this,c<<8,a<<8,b<<8);return c&255} +function mf(a,b){this.I&256||(this.Z=this.ba=b&65280,this.W=this.V=0);return(b<<8|b>>8)&65535}function nf(a,b){a^=b;U(this,a);return a&65535}function of(a){V(this,a,Fe(this,a),Oe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function pf(a){var b=Ie(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.Z=this.ba=c;this.b-=(this.g?6:7)+b} +function qf(a){var b=Ie(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.Z=d>>16;this.ba=d>>16|d;this.b-=(this.g?6:7)+b}function rf(a){W(this,a,!Rd(this))}function sf(a){W(this,a,Rd(this))} +function tf(a){V(this,a,Fe(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function uf(a){Je(this,a,Ee(this,a),Ve);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function vf(a){V(this,a,Fe(this,a),We);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function wf(a){Je(this,a,Ee(this,a),Xe);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} +function xf(a){var b=Fe(this,a);a=Ie(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function yf(a){var b=Ee(this,a);a=He(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function zf(a){W(this,a,Td(this))}function Af(a){W(this,a,!Ud(this)==!Sd(this))}function Bf(a){W(this,a,!Td(this)&&!Ud(this)==!Sd(this))}function Cf(a){W(this,a,!Rd(this)&&!Td(this))} +function Df(a){W(this,a,Td(this)||!Ud(this)!=!Sd(this))}function Ef(a){W(this,a,Rd(this)||Td(this))}function Ff(a){W(this,a,!Ud(this)!=!Sd(this))}function Gf(a){W(this,a,Ud(this))}function Hf(a){W(this,a,!Td(this))}function If(a){W(this,a,!Ud(this))}function Jf(){this.sa(12,0,-8)}function Kf(a){W(this,a,!0)}function Lf(a){W(this,a,!Sd(this))}function Mf(a){W(this,a,Sd(this))}function Nf(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.ba=1);a&8&&(this.Z=0);this.b-=5} +function Of(a){var b=Fe(this,a);a=Ie(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ve(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Pf(a){var b=Ee(this,a);a=He(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ve(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} +function Qf(a){var b=Ie(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.ba=d>>16|d,this.Z=d>>16):(this.W=32768,this.ba=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ba=this.Z=0,this.W=32768,this.V=65536,this.b-=7}function Rf(){this.sa(24,0,-8);this.b-=20} +function Sf(){this.P&49152?(this.ra|=128,this.sa(4,0,-7)):(this.w&&1120==this.jb&&this.w.setData(this.u[0],!0),this.j?Tf(this.j):this.ea());this.b-=7}function Uf(){this.sa(16,0,-8);this.b-=20}var Vf=[0,7,7,10,7,11,9,13];function Wf(a){this.L=this.b;T(this,Ge(this,a));this.b=this.L-Vf[this.g]}var Xf=[0,14,14,17,14,18,16,20];function Yf(a){this.L=this.b;var b=Ge(this,a);a=a>>6&7;we(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.L-Xf[this.g]} +var Zf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function $f(a){var b=Fe(this,a);this.L=this.b;U(this,Le(this,a,b));this.b=this.L-Zf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function ag(a){var b=Ee(this,a);U(this,Ke(this,a,b,65535)<<8);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var bg=[7,13,13,17,14,18,17,21]; +function cg(a){var b=Ie(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.I&256||(this.Z=b>>16,this.ba=this.Z|b,this.W=0,this.V=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function jg(a){V(this,a,Fe(this,a),kf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function kg(a){V(this,a,0,mf);this.b-=this.g?9:3+(7==this.f?2:0)}function lg(){this.sa(28,0,-8)} +function mg(){this.w&&(this.w.oc(this.u[7],!0),this.w.setData(this.u[0],!0));this.I|=8;Wd(this,-2);this.b-=3}function ng(a){V(this,a,this.u[(a>>6&7)+this.sb],nf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Tf(b)):b=!1;b||this.sa(8,0,-8)}function Nd(a){og[a>>12].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)} +function vg(a){wg[a&15].call(this,a)}function xg(a){yg[a&15].call(this,a)}function zg(a){Ag[a>>6&3].call(this,a)}function Bg(a){Cg[a>>6&3].call(this,a)}function Dg(a){Eg[a>>6&3].call(this,a)} +var og=[function(a){Fg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,of,X,function(a){Gg[a>>8&15].call(this,a)},ag,Pf,yf,uf,wf,jg,X],Fg=[function(a){Hg[a>>4&15].call(this,a)},Kf,Hf,zf,Af,Ff,Bf,Df,Yf,Yf,pg,rg,tg,X,X,X],qg=[function(a){Zd(this,Le(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)}],sg=[function(a){V(this,a,0, +df);this.b-=this.g?11:6},function(a){V(this,a,Rd(this)?1:0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Rd(this)?1:0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ie(this,a);Zd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],ug=[function(a){V(this,a,0,hf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)}], +Hg=[function(a){Ig[a&15].call(this,a)},X,X,X,Wf,Wf,Wf,Wf,fg,X,vg,xg,kg,kg,kg,kg],Ig=[Sf,mg,gg,Jf,Uf,eg,X,X,X,X,X,X,X,X,X,X],wg=[dg,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},Nf,function(){this.ba=1;this.b-=5},Nf,Nf,Nf,function(){this.Z=0;this.b-=5},Nf,Nf,Nf,Nf,Nf,Nf,Nf],yg=[dg,function(){this.V=65536;this.b-=5},function(){this.W=32768;this.b-=5},hg,function(){this.ba=0;this.b-=5},hg,hg,hg,function(){this.Z=32768;this.b-=5},hg,hg,hg,hg,hg,hg,hg],Gg=[If,Gf,Cf,Ef,Lf,Mf,rf,sf,Rf,lg, +zg,Bg,Dg,X,X,X],Ag=[function(a){Zd(this,Ke(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,0,Ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,1,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,1,af);this.b-=this.g?9:3+(7==this.f?2:0)}],Cg=[function(a){Je(this,a,0,ef);this.b-=this.g?11:6},function(a){Je(this,a,Rd(this)?1:0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,Rd(this)?1:0,lf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= +He(this,a);Zd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Eg=[function(a){Je(this,a,0,jf);this.b-=this.g?9+(this.Qb&1):3+(7==this.f?2:0)},function(a){Je(this,a,0,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Je(this,a,0,Te);this.b-=this.g?9+(this.Qb&1):3+(7==this.f?2:0)},function(a){Je(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)}];function Od(a){Jg[a>>12].call(this,a)} +var Jg=[function(a){Kg[a>>8&15].call(this,a)},$f,Of,xf,tf,vf,of,function(a){Lg[a>>8&15].call(this,a)},function(a){Mg[a>>8&15].call(this,a)},ag,Pf,yf,uf,wf,jg,X],Kg=[function(a){Ng[a>>4&15].call(this,a)},Kf,Hf,zf,Af,Ff,Bf,Df,Yf,Yf,pg,rg,tg,function(a){Og[a>>6&3].call(this,a)},X,X],Og=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Aa(a|this.S);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ce(this,a,0);we(this,a);U(this,a);this.b-=11},function(a){var b=ye(this);this.L= +this.b;De(this,a,0,b);U(this,b);this.b=this.L-bg[this.g]},function(a){U(this,Le(this,a,Ud(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ng=[function(a){Pg[a&15].call(this,a)},X,X,X,Wf,Wf,Wf,Wf,fg,function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.I|=1,this.I&=-3),this.b-=5):X.call(this,a)},vg,xg,kg,kg,kg,kg],Pg=[Sf,mg,function(){xe(this);this.I|=this.P&16;this.b-=13},Jf,Uf,eg,gg,function(){this.sa(8,0,-8)},X,X,X,X,X,X,X,X],Lg=[cg,cg,Qf,Qf,pf,pf,qf,qf,ng,ng,X,X,X,X,ig,ig],Mg= +[If,Gf,Cf,Ef,Lf,Mf,rf,sf,Rf,lg,zg,Bg,Dg,function(a){Qg[a>>6&3].call(this,a)},X,X],Qg=[X,function(a){a=Ce(this,a,65536);we(this,a);U(this,a);this.b-=11},function(a){var b=ye(this);this.L=this.b;De(this,a,65536,b);U(this,b);this.b=this.L-bg[this.g]},X]; +function Rg(a){x.call(this,"ROM",a,Rg,128);this.ja=this.A=null;this.B=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(mb(c.gb,a,b),(a=Ea(a,b))?(c.A=a.ia,c.ja=a.ja):c.g=null);Sg(c)})}}B(Rg);k=Rg.prototype; +k.Ga=function(a,b,c,d){this.v=b;this.b=c;this.j=d;Sg(this)};k.Ja=function(){this.ja&&(this.j&&Tg(this.j,this.id,this.B,this.f,this.ja),delete this.ja);return!0};k.Ia=function(){return!0}; +function Sg(a){if(!yb(a)){if(a.g){if(!a.A||!a.v)return;a.f||(a.f=a.A.length);if(a.A.length!=a.f)Ab(a,"ROM size ("+p(a.A.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+uc){var c={};b=(c[b]=[Rg.prototype.le,Rg.prototype.jf,null,null,null,a.f>>1],c);if(Jb(a.v,a,b)){b=a.F=!0;break a}}else if(Ac(a.v,b,a.f,pd)){for(c=0;c>>f.oa;0>>=f.oa;0>>a.oa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= +b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(v)for(G(a,"loading "+q(v)+" bytes at "+q(r)+"-"+q(r+v-1),4096);v--;)Hc(a.v,r++,b[t++]&255);else r&1?a.b.ea():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.sc&&c<=la.cd&&(b=c-(la.sc-la.Qc));b&&(a.preventDefault&&a.preventDefault(),d.cc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Sc&&(b=la.Rc);d.cc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation(); +a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.cc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;var e=this;this.ga=Qc(48,4,262144);this.aa=Nc(this.b,function(){var a;a=-1;e.G.length&&(a=e.G.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.fa&&97<=a&&122>a&&(a-=32),Pc(e.b,e.aa,1E3/Math.round(e.S/10)));0<=a&&(e.K=a,e.f&128?e.K|=49152:e.f|=128,e.f&64&&Oc(c,e.ga))});this.N=Qc(52,4,262144);this.ua=Nc(this.b,function(){e.g|=128;e.g&64&&Oc(c,e.N)});Jb(b,this,$g);Lb(b,this.reset.bind(this));J(this)}; +k.Hc=function(){if(!this.J){var a=Cd(this.A,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ua(b[0]);if(c!=this.fb)return;b=ua(b[1]);if(this.J=ob(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.gb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ja=function(a,b){if(!b)if(this.Hc(),!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(){ah(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return ah(this)};function ah(a){a.K=0;a.f=0;a.g=128;a.G=[];return!0}k.cc=function(a){if("number"==typeof a)this.G.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.U||8,c=a-this.F%a,this.U&&(b=ta("",c)));this.T&&!this.F&&c&&(b=String.fromCharCode(this.T)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.F+=c}}else if(null!=this.B){if(10==a||1024<= +this.B.length)this.i(this.B),this.B="";10!=a&&(this.B+=String.fromCharCode(a))}Pc(this.b,this.ua,1E3/Math.round(this.ta/10));this.g&=-129};var bh={},$g=(bh[65392]=[null,null,Yg.prototype.Zd,Yg.prototype.We,"RCSR"],bh[65394]=[null,null,Yg.prototype.Yd,Yg.prototype.Ve,"RBUF"],bh[65396]=[null,null,Yg.prototype.ze,Yg.prototype.yf,"XCSR"],bh[65398]=[null,null,Yg.prototype.ye,Yg.prototype.xf,"XBUF"],bh); +bb(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= +function(){var a=d.D.listTapes;a&&yh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.S){c.parentNode.removeChild(c);break}this.D[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;yh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;this.aa=zh(a);var e=this;if((this.g=Cd(this.A,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.T=Qc(56,4,4096);this.ga=Nc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.A&&!a.A.C.ma;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.gb,e,f),(e=Ea(e,f))&&Ih(a,b,c,d,e.ia,e.Sa, +e.Ra));a.C.ib=!1;a.F&&(a.F--,a.F||J(a));Fh(a)})}function Ch(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Zb?"":e)+"&format=json"));return!!Da(f, +null,!0,function(b,c,d){Ph(a,b,c,d)})} +function Ph(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.A&&!a.A.C.ma;if(d)a.controller.O('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{mb(a.controller.gb,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(h.length)if(1==h.length)w(h[0]);else{a.la=h.length;a.qa=h[0].length;a.ha=h[0][0].length;var l=h[0][0][0];a.za=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,A=t.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Va+a.Ma&&(a.Ma+=f-(a.Va+a.Ma)+1):(a.Va=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ +b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Ta+": "+c);return b}; +k.toJSON=function(){var a;a=0;for(var b;b=Sh(this,a++);)Vh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Vh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function Q(a){x.call(this,"RK11",a,Q,65536);this.J=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; +k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RK11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Wh(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&Xh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Y)?(a=Na(Uh(a),a.nc.replace(".json",".img")),w(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xh(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;if((a=Cd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.J[e]=a[e]);Yh(this);this.Cb=Qc(144,5,65536);Jb(b,this,Zh);Lb(b,this.reset.bind(this));$h(this,"None","",!0);this.K&&$h(this,"Local Disk","?");$h(this,"Remote Disk","??");ai(this)||J(this)}; +k.Ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.lc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Wh(this,0)}}return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){Yh(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return Yh(this,a[0])};function ai(a,b){b||(a.F=0);for(var c in a.J){var d=a.J[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}ci(a,e,b,c,!1,d)}else bi(a,e)} +function ci(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&&(g++,bi(a,b,!0),h.vb?a.O("RK11 busy"):(h.vb=!0,e&&(h.ub=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Oh(new Kh(a,h,"preload"),c,d,f,a.Vc)&&g++));return g} +k.Vc=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=Rh(b),b&&f[0]>a.la||f[1]>a.qa)&&(this.O('Disk "'+c+'" too large for drive '+("RK"+a.wb)),b=null);b?(a.Y=b,a.Ta=c,a.Ka=d,this.O('Mounted disk "'+c+'" in drive '+("RK"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.F||J(this));Wh(this,a.wb)}; +function $h(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.G=65536-e&65535;a&&(this.B=this.B|a|32768,this.M|=49152);return!0};k.Wc=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=32;break}Yb(this.v,ze(this.b,f),r|t<<8);if(Mc(this.v)){h=1024;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ha&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; +k.Xc=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){var r=$b(this.v,ze(this.b,f));if(Mc(this.v)){h=1024;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=32;break}if(n>=l.za&&(m=null,++d>=l.ha&&(d=0,++c>=l.qa&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.de=function(){return this.L};k.af=function(){};k.ee=function(){return this.B};k.bf=function(){};k.ae=function(){return this.M&61438}; +k.Ye=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.B=0;this.M=128;this.f=0;break;case 4:b=this.Wc;case 2:b||(b=this.Xc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.B|=32832,this.M|=49152):g>=d.ha?(this.B|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.G&65535,c=b.call(this,d,e,f,g,c,h,this.Uc.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= +-2,this.M|=128,this.M&64&&Oc(this.b,this.Cb))}};k.fe=function(){return this.G};k.cf=function(a){this.G=a};k.$d=function(){return this.w};k.Xe=function(a){this.w=a};k.be=function(){return this.f};k.Ze=function(a){this.f=a};k.ce=function(){return this.N};k.$e=function(a){this.N=a}; +var di={},Zh=(di[65280]=[null,null,Q.prototype.de,Q.prototype.af,"RKDS"],di[65282]=[null,null,Q.prototype.ee,Q.prototype.bf,"RKER"],di[65284]=[null,null,Q.prototype.ae,Q.prototype.Ye,"RKCS"],di[65286]=[null,null,Q.prototype.fe,Q.prototype.cf,"RKWC"],di[65288]=[null,null,Q.prototype.$d,Q.prototype.Xe,"RKBA"],di[65290]=[null,null,Q.prototype.be,Q.prototype.Ze,"RKDA"],di[65294]=[null,null,Q.prototype.ce,Q.prototype.$e,"RKDB"],di); +function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.J=0;this.g=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; +k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&ei(d,a)},!0;case "loadDrive":return this.D[b]= +c,c.onclick=function(){var a=d.D.listDisks;a&&fi(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Y)?(a=Na(Uh(a),a.nc.replace(".json",".img")),w(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return this.D[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;fi(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +k.Ga=function(a,b,c,d){this.A=a;this.v=b;this.b=c;this.j=d;if((a=Cd(this.A,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.K[e]=a[e]);gi(this);this.Cb=Qc(112,5,131072);Jb(b,this,hi);Lb(b,this.reset.bind(this));ii(this,"None","",!0);this.L&&ii(this,"Local Disk","?");ii(this,"Remote Disk","??");ji(this)||J(this)}; +k.Ja=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.A.lc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ei(this,0)}}return!0};k.Ia=function(a){return a?this.save():!0};k.reset=function(){gi(this)};k.save=function(){return(new S(this)).data()}; +k.restore=function(a){return gi(this,a[0])};function ji(a,b){b||(a.J=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}li(a,e,b,c,!1,d)}else ki(a,e)} +function li(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Ka.toLowerCase()!=d.toLowerCase()&&(g++,ki(a,b,!0),h.vb?a.O("RL11 busy"):(h.vb=!0,e&&(h.ub=!0,a.J++,I(a)&&G(a,"auto-loading disk: "+c)),h.bb=!!f,Oh(new Kh(a,h,"preload"),c,d,f,a.Zc)&&g++));return g} +k.Zc=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=Rh(b),b&&f[0]>a.la||f[1]>a.qa)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.wb)),b=null);b?(a.Y=b,a.Ta=c,a.Ka=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.wb),a.ub||e),this.A&&this.A.nb()):a.bb=!1;a.ub&&(a.ub=!1,--this.J||J(this));ei(this,a.wb)}; +function ii(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.B=this.f=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; +k.$c=function(a,b,c,d,e,f,g,h){b=0;var l=a.Y,m=null,n;l||(b=5120,f=0);for(;f--;){if(!m){m=a.Y.seek(c,d,e+1);if(!m){b=5120;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){b=5120;break}Yb(this.v,ze(this.b,g),r|t<<8);if(Mc(this.v)){b=8192;break}g+=2;if(n>=l.za&&(m=null,++e>=l.ha&&(e=0,++d>=l.qa&&(d=0,++c>=l.la)))){b=5120;break}}return h(b,c,d,e,f,g)}; +k.ad=function(a,b,c,d,e,f,g,h){b=0;var l=a.Y,m=null,n;l||(b=5120,f=0);for(;f--;){var r=$b(this.v,ze(this.b,g));if(Mc(this.v)){b=8192;break}g+=2;if(!m){m=a.Y.seek(c,d,e+1,!0);if(!m){b=5120;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){b=5120;break}if(n>=l.za&&(m=null,++e>=l.ha&&(e=0,++d>=l.qa&&(d=0,++c>=l.la)))){b=5120;break}}return h(b,c,d,e,f,g)};k.ie=function(){return this.M&65535}; +k.ff=function(a){this.M=this.M&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.G&8&&(this.M&=63);this.G=c.status|this.B&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.B=this.f&4?this.B+b:this.B-b,this.f=this.B=this.B&65408|c);break;case 8:this.G=this.B;break;case 12:b=this.$c;case 10:b||(b=this.ad),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ha?this.M|=37888:(g=(this.F& +63)<<16|this.w,a=65536-this.G&65535,a=b.call(this,c,128*(((d<<1)+e)*c.ha+f),d,e,f,a,g,this.Yc.bind(this)))}a&&(this.M|=129,this.M&64&&Oc(this.b,this.Cb))}};k.ge=function(){return this.w};k.df=function(a){this.w=a&65534};k.je=function(){return this.f};k.gf=function(a){this.f=a};k.ke=function(){return this.G};k.hf=function(a){this.G=a};k.he=function(){return this.F};k.ef=function(a){this.F=a&63;this.M=this.M&-49|(this.F&3)<<4}; +var mi={},hi=(mi[63744]=[null,null,P.prototype.ie,P.prototype.ff,"RLCS"],mi[63746]=[null,null,P.prototype.ge,P.prototype.df,"RLBA"],mi[63748]=[null,null,P.prototype.je,P.prototype.gf,"RLDA"],mi[63750]=[null,null,P.prototype.ke,P.prototype.hf,"RLMP"],mi[63752]=[null,null,P.prototype.he,P.prototype.ef,"RLBE"],mi);function ni(a){x.call(this,"Debugger",a,ni);this.ta=a.base||16;this.La=!1;this.K=0;this.U=!1;this.B=-1;this.g=[];this.fa={}}B(ni); +var oi={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};ni.prototype.Fc=function(){return-1};ni.prototype.Gc=function(){}; +function pi(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.U?b="end":b=a.g[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(ua(b.substring(c,f))),c=f+1}}return a} +function qi(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 ni(a,b,c){var d;if(b){b=oi(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+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ri(a,b){if(b)return qi(a,b,a.ea[b]);var c=0;for(b in a.ea)qi(a,b,a.ea[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function vi(a,b){if(b)return ui(a,b,a.fa[b]);var c=0;for(b in a.fa)ui(a,b,a.fa[b]),c++;return 0this.b.kb?Bi:[];Oc(this,16,function(a){a:{var b=d.v.ga,c=a[0],e=a=0,l=b.length;if(c){a=d.ca(Ci(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.pa;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=Cc[c],n&&d.i(p(n.id,8)+" %"+ -p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} -k.Jc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.fb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=dd(this.b);break;case 21:b=c.Mb;break;case 22:b=c.sa;break;case 23:b=c.nb;break;case 24:b=Qc(c);break;case 25:b=$c(c);break;case 26:b=ad(c);break;case 27:b=c.Xa;break;case 28:d&&(b=d.Ba);break;case 29:d&&(b=d.Ab);break;case 30:d&&nc(d)&&(b=d.eb)}}return b}; -k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.wa&65535).H));if(!this.ua||a!=this.ua)if(this.ua=a,this.oa&1073741824)this.aa.push(a);else{var c;if(this.oa&-2147483648&&this.b&&(c=this.b.C.X)||qb(this,!0))this.da(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Gd(a),a.Fa=0,a.ya())}}; -function ui(a){var b;if(!Ie(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.fa=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.R?Ji(a):Ki(a)}}function Ii(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.ma?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; -k.Ja=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){ui(this);this.Fa=0;this.ua=null;this.K=0;this.L=Y(this.b.u[7]);this.C.X=!1;Li(this);a||Bd(this)};k.save=function(){var a=new S(this);a.set(0,Ei(this.L));a.set(1,Ei(this.T));a.set(2,[this.g,this.U,this.oa]);a.set(3,this.I);return a.data()}; -k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Fi(a[b++]),this.T=Fi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.oa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.i("running");this.C.X=!0;this.Rb=a;this.Sb=b}; -k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.K=b-this.Sb;if(!this.R){b="stopped";if(this.K){a-=this.Rb;var c=0d&&(d=a.b.Va(b)),65535!=(d&65535)&&(a.sc(a.G[a.fa],b),++a.fa==a.G.length&&(a.fa=0)));return!1}function Pf(a){var b=a.b;if(b.C.X)throw T(b,a.b.wa&65535),a.da(),-1;return!1} -function ti(a){var b,c;a.f=["bp"];if(a.N)for(b=1;b>>d.pa],!1)}a.N=["br"];if(a.F)for(b=1;b>>d.pa],!0);a.F=["bw"];a.$a=0}k.vb=function(a,b,c){var d=!0;c||Mi(this,a,b,!1,!0);if(a!=this.f){var e=this.ca(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.v;f.ga[e>>>f.pa].vb(e&f.v,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Ni(this,a,a.length-1,"set"),ui(this)));return d}; -function Mi(a,b,c,d,e){var f=!1;c=a.ca(c);for(var g=1;g>>d.pa],b==a.F));h.Ua||ui(a);break}}return f}function Oi(a,b){for(var c=1;c>23)&65535,y=L(v,t);else if(8192==C)t=t.H-((f&63)<<1)&65535,y=L(v,t);else if(12288==C)y=L(v,f&7,1);else if(24576==C)y=L(v,f&63,1);else if(32768==C)y=L(v,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), -A&63)switch(A=C&7,C&56){case 0:y=Hi(A);break;case 8:y="@"+Hi(A);break;case 16:7>A?y="("+Hi(A)+")+":(C=v.va(t,2),y="#"+L(v,C,0,!0));break;case 24:7>A?y="@("+Hi(A)+")+":(C=v.va(t,2),y="@#"+L(v,C,0,!0));break;case 32:y="-("+Hi(A)+")";break;case 40:y="@-("+Hi(A)+")";break;case 48:C=v.va(t,2);y=L(v,C,0,!0)+"("+Hi(A)+")";7==A&&(y=L(v,C+t.H&65535));break;case 56:C=v.va(t,2),y="@"+L(v,C)+"("+Hi(A)+")",7==A&&(y="@"+L(v,C+t.H&65535))}v=y;if(!v||!v.length){h="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]); -0b)c=Hi(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.fb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,dd(d));break;case 21:c="IR="+L(a,d.Mb);break;case 22:c="ER="+L(a,d.sa);break;case 23:c="SL="+L(a,d.nb);break;case 24:c="MMR0="+L(a,Qc(d));break;case 25:c="MMR1="+L(a,$c(d));break;case 26:c="MMR2="+L(a,ad(d));break;case 27:c="MMR3="+L(a,d.Xa);break;case 28:a.w&&(c="AR="+L(a,a.w.Ba,3));break;case 29:a.w&& -(c="DR="+L(a,a.w.Ab));break;case 30:a.w&&nc(a.w)&&(c="SR="+L(a,a.w.eb,3))}c&&(c+=" ");return c}function Si(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ri(a,"T")+Ri(a,"N")+Ri(a,"Z")+Ri(a,"V")+Ri(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Fc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Fc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Jg:b,H:c,xd:d,ja:e,Dc:f})}function Ti(a,b,c){var d=[],e=a.ca(b)>>>0;for(b=0;b>>0,h=f.xd;if(e>=g&&eb)){e.u[b]= -g&65535;break}a.i("unknown register: "+f);return}a.A.ya();a.i("updated registers:")}}a.i(Si(a,d));c&&(a.L=Y(e.u[7]),Ki(a,L(a,a.L.H)))}}function Xi(a,b){b=ya(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=Qi(a,b,g,f);a.i(f);a.L=b;e-=b.H-l;c++}}} -function Pi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.U&&(a.i("ended assemble at "+L(a,a.T.H)),a.L=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ua=null;if(yb(a)&&0n||"z"va.length&&(a.i("note: only "+va.length+" available"),ea=va.length);ja-=ea;0>ja&&(null==va[va.length-1].H?(ea=ja+ea,ja=0):ja+=va.length);var ae=[];"call"==eh&&(ac=1E5,ae=["CALL"]);for(void 0!==dh&&a.i(ea+" instructions earlier:");0=va.length&&(ja=0);a.sb=ea;gh++;ac--}}gh||(a.i("no "+fh+"history available"),a.sb=void 0)}else{var ub=Ci(a,ua);if(ub){var cc=0,be=!1,ce="ds"==Ta;Ua&&(be=!0,"l"==Ua.charAt(0)&&(be=!1,Ua=Ua.substr(1)||qj),cc=pi(a,Ua)>>>0,65536fe?String.fromCharCode(fe):"."),Uc=Uc>>8}Va&&(Va+="\n");Va=ce?Va+(Wa+","):Va+(ua+" "+Wa+(0==Tc?" "+ee:""))}Va&&a.i(Va);a.Ya=ub}}}}break;case "e":if("else"==g[0])break;var xb,ge,he,ie,je=g[0],ke=g[1];"eb"==je?(xb=1,ge=255,he=a.dc,ie=a.Nb):"e"== -je||"ew"==je?(xb=2,ge=65535,he=a.va,ie=a.Cb):ke=null;if(null==ke)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 Vc=Ci(a,ke);if(Vc)for(var Wc=2;Wcne;){for(var Xa=null,vj=256;65536>hc.H>>>0;){oe.H=a.va(hc,2);if(null==hc.H||!vj--)break;if(!(oe.H&1)){for(var wj=a,Xc=oe,kh=null,ic=Xc.H,lh=ic,pe=1;6>=pe&⁣pe++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bbj){if(dj(d,this.I)){this.B=new S(this,"1.30.5","failsafe");dj(this.B)&&(ij(this,d),a=2,jj(this.B));this.B.set("timestamp",Ca());kj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=hj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?dj(d,g):("error"== -f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),jj(d),dj(d)?(c=hj(d),e=!0):c=!1))}e&&gj(this,c?d:null)}else 2==a&&d.clear()}else gj(this);delete this.I;delete this.K}e=mb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.C.ma=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(lj(this,this.b,b,c,a),this.ya(),this.b.Db());this.R&&(ij(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; -function ij(a,b){if(Ga("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.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} -function Zi(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.da(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.ma=!1,!1===d&&(e=null)));for(var h=mb(a.id),l=0;l=c||30<=(b.Qb+=c))&&(d.textContent=b.C.X?b.Ea.toFixed(2)+"Mhz":"Stopped",b.Qb=0)}if(this.w&&(b=this.w,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.J&8);if(0>=a||60<=(b.B+=a)){for(var e=0;ethis.b.jb?Fi:[];Sc(this,16,function(a){a:{var b=d.v.da,c=a[0],e=a=0,l=b.length;if(c){a=d.ca(Gi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.oa;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=Fc[c],n&&d.i(p(n.id,8)+" %"+ +p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} +k.Gc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.eb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=hd(this.b);break;case 21:b=c.Jb;break;case 22:b=c.ra;break;case 23:b=c.mb;break;case 24:b=Uc(c);break;case 25:b=dd(c);break;case 26:b=ed(c);break;case 27:b=c.Wa;break;case 28:d&&(b=d.Ba);break;case 29:d&&(b=d.yb);break;case 30:d&&rc(d)&&(b=d.cb)}}return b}; +k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.wa&65535).H));if(!this.ua||a!=this.ua)if(this.ua=a,this.na&1073741824)this.aa.push(a);else{var c;if(this.na&-2147483648&&this.b&&(c=this.b.C.X)||rb(this,!0))this.ea(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Kd(a),a.Ca=0,a.ya())}}; +function yi(a){var b;if(!Me(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.ga=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?Ni(a):Oi(a)}}function Mi(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.ma?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ja=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; +k.Ia=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){yi(this);this.Fa=0;this.ua=null;this.K=0;this.L=Y(this.b.u[7]);this.C.X=!1;Pi(this);a||Fd(this)};k.save=function(){var a=new S(this);a.set(0,Ii(this.L));a.set(1,Ii(this.T));a.set(2,[this.g,this.U,this.na]);a.set(3,this.J);return a.data()}; +k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Ji(a[b++]),this.T=Ji(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.na|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.S||this.i("running");this.C.X=!0;this.Pb=a;this.Qb=b}; +k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.K=b-this.Qb;if(!this.S){b="stopped";if(this.K){a-=this.Pb;var c=0d&&(d=nc(a.b,b)),65535!=(d&65535)&&(a.oc(a.G[a.ga],b),++a.ga==a.G.length&&(a.ga=0)));return!1}function Tf(a){var b=a.b;if(b.C.X)throw T(b,a.b.wa&65535),a.ea(),-1;return!1} +function xi(a){var b,c;a.f=["bp"];if(a.N)for(b=1;b>>d.oa],!1)}a.N=["br"];if(a.F)for(b=1;b>>d.oa],!0);a.F=["bw"];a.Za=0}k.tb=function(a,b,c){var d=!0;c||Qi(this,a,b,!1,!0);if(a!=this.f){var e=this.ca(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.v;f.da[e>>>f.oa].tb(e&f.v,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Ri(this,a,a.length-1,"set"),yi(this)));return d}; +function Qi(a,b,c,d,e){var f=!1;c=a.ca(c);for(var g=1;g>>d.oa],b==a.F));h.Ua||yi(a);break}}return f}function Si(a,b){for(var c=1;c>23)&65535,y=L(v,t);else if(8192==C)t=t.H-((f&63)<<1)&65535,y=L(v,t);else if(12288==C)y=L(v,f&7,1);else if(24576==C)y=L(v,f&63,1);else if(32768==C)y=L(v,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), +A&63)switch(A=C&7,C&56){case 0:y=Li(A);break;case 8:y="@"+Li(A);break;case 16:7>A?y="("+Li(A)+")+":(C=v.va(t,2),y="#"+L(v,C,0,!0));break;case 24:7>A?y="@("+Li(A)+")+":(C=v.va(t,2),y="@#"+L(v,C,0,!0));break;case 32:y="-("+Li(A)+")";break;case 40:y="@-("+Li(A)+")";break;case 48:C=v.va(t,2);y=L(v,C,0,!0)+"("+Li(A)+")";7==A&&(y=L(v,C+t.H&65535));break;case 56:C=v.va(t,2),y="@"+L(v,C)+"("+Li(A)+")",7==A&&(y="@"+L(v,C+t.H&65535))}v=y;if(!v||!v.length){h="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]); +0b)c=Li(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.eb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,hd(d));break;case 21:c="IR="+L(a,d.Jb);break;case 22:c="ER="+L(a,d.ra);break;case 23:c="SL="+L(a,d.mb);break;case 24:c="MMR0="+L(a,Uc(d));break;case 25:c="MMR1="+L(a,dd(d));break;case 26:c="MMR2="+L(a,ed(d));break;case 27:c="MMR3="+L(a,d.Wa);break;case 28:a.w&&(c="AR="+L(a,a.w.Ba,3));break;case 29:a.w&& +(c="DR="+L(a,a.w.yb));break;case 30:a.w&&rc(a.w)&&(c="SR="+L(a,a.w.cb,3))}c&&(c+=" ");return c}function Wi(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Vi(a,"T")+Vi(a,"N")+Vi(a,"Z")+Vi(a,"V")+Vi(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Cc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Cc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Fg:b,H:c,td:d,ja:e,Ac:f})}function Xi(a,b,c){var d=[],e=a.ca(b)>>>0;for(b=0;b>>0,h=f.td;if(e>=g&&eb)){e.u[b]= +g&65535;break}a.i("unknown register: "+f);return}a.A.ya();a.i("updated registers:")}}a.i(Wi(a,d));c&&(a.L=Y(e.u[7]),Oi(a,L(a,a.L.H)))}}function aj(a,b){b=ua(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=Ui(a,b,g,f);a.i(f);a.L=b;e-=b.H-l;c++}}} +function Ti(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.U&&(a.i("ended assemble at "+L(a,a.T.H)),a.L=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ua=null;if(yb(a)&&0n||"z"wa.length&&(a.i("note: only "+wa.length+" available"),fa=wa.length);ja-=fa;0>ja&&(null==wa[wa.length-1].H?(fa=ja+fa,ja=0):ja+=wa.length);var de=[];"call"==ih&&(ac=1E5,de=["CALL"]);for(void 0!==hh&&a.i(fa+" instructions earlier:");0=wa.length&&(ja=0);a.qb=fa;kh++;ac--}}kh||(a.i("no "+jh+"history available"),a.qb=void 0)}else{var vb=Gi(a,va);if(vb){var cc=0,ee=!1,fe="ds"==Ta;Ua&&(ee=!0,"l"==Ua.charAt(0)&&(ee=!1,Ua=Ua.substr(1)||uj),cc=ti(a,Ua)>>>0,65536ie?String.fromCharCode(ie):"."),Xc=Xc>>8}Wa&&(Wa+="\n");Wa=fe?Wa+(Xa+","):Wa+(va+": "+Xa+(0==Wc?" "+he:""))}Wa&&a.i(Wa);a.Xa=vb}}}}break;case "e":if("else"==g[0])break;var xb,je,ke,le,me=g[0],ne=g[1];"eb"==me?(xb=1,je=255,ke=a.ac,le= +a.Kb):"e"==me||"ew"==me?(xb=2,je=65535,ke=a.va,le=a.zb):ne=null;if(null==ne)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 Yc=Gi(a,ne);if(Yc)for(var Zc=2;Zcqe;){for(var Ya=null,zj=256;65536>hc.H>>>0;){re.H=a.va(hc,2);if(null==hc.H||!zj--)break;if(!(re.H&1)){for(var Aj=a,$c=re,oh=null,ic=$c.H,ph=ic,se=1;6>=se&⁣se++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bfj){if(hj(d,this.J)){this.B=new S(this,"1.30.5","failsafe");hj(this.B)&&(mj(this,d),a=2,nj(this.B));this.B.set("timestamp",Ca());oj(this.B);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hj(d,g):("error"== +f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(La("user",""),this.A=null)):this.i(f+": "+g),nj(d),hj(d)?(c=lj(d),e=!0):c=!1))}e&&kj(this,c?d:null)}else 2==a&&d.clear()}else kj(this);delete this.J;delete this.K}e=nb(this.id);for(f=0;fa[1];a=a[2];this.ga=!0;this.C.ma=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(pj(this,this.b,b,c,a),this.ya(),this.b.Ab());this.S&&(mj(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.g=0}; +function mj(a,b){if(Ga("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.A||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.fa;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} +function cj(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ea(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.ma=!1,!1===d&&(e=null)));for(var h=nb(a.id),l=0;l=c||30<=(b.Ob+=c))&&(d.textContent=b.C.X?b.ua.toFixed(2)+"Mhz":"Stopped",b.Ob=0)}if(this.w&&(b=this.w,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.I&8);if(0>=a||60<=(b.B+=a)){for(var e=0;ef.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+"...");Da(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);Cj(a,b,c)}})}else c(a,null)} -function Dj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=sa(a))}function f(a){e("Error: "+a);l&&(--pj||cb(!0));l=!1}var g,h,l=!0;pj++;kb[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/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Aj(c,null,null,!1,e,function(d,l){l?(lb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--pj||cb(!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),--pj||cb(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Aj(b,a,d,!0,e,m):Bj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return Dj(a,b,c,d)};window.enableEvents=cb;window.sendEvent=db;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map +k.xa=function(a,b,c){var d=this;switch(b){case "power":return this.D[b]=c,c.onclick=function(){d.g||(d.C.ma?cj(d,!1,!0):jj(d,d.Vb))},!0;case "reset":return this.D[b]=c,c.onclick=function(){if(d.C.ma&&!d.g)if(d.f&&!d.G){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");cj(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.lc=!0),d.Vb(fj),d.lc=!1)}else d.reset(),d.b&&d.b.Ab()},!0;case "save":if(pa(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.D[b]= +c,c.onclick=function(){var a=gj(d,!0);if(a){var b=!!(d.f&&!d.G||d.N),c=cj(d,b);b?qj(d,a,c):d.O("Resume disabled, machine state not saved")}},!0}return!1}; +function gj(a,b){var c=a.A;c||((c=Ja("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=rj(a,c))||a.O("The user ID is invalid.")):b&&a.O("Browser local storage is not available"));return c} +function rj(a,b){a.A=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.A=b.data)}catch(d){w(d.message+" ("+c+")")}return a.A}function ij(a){var b=null;a.A&&(b=Fa()+"/api/v1/user?req=load&user="+a.A+"&state="+sj(a,"1.30.5"));return b} +function qj(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=sj(a,"1.30.5");d.data=c;b=Da(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.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+"...");Da(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);Gj(a,b,c)}})}else c(a,null)} +function Hj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--tj||db(!0));l=!1}var g,h,l=!0;tj++;lb[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/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Ej(c,null,null,!1,e,function(d,l){l?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--tj||db(!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),--tj||db(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ej(b,a,d,!0,e,m):Fj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){db(!1);return Hj(a,b,c,d)};window.enableEvents=db;window.sendEvent=eb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map diff --git a/versions/pdpjs/1.30.5/pdp11.js b/versions/pdpjs/1.30.5/pdp11.js index 680aeb156..68338d28c 100644 --- a/versions/pdpjs/1.30.5/pdp11.js +++ b/versions/pdpjs/1.30.5/pdp11.js @@ -34,9 +34,9 @@ */ for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,Tb:65,Te:66,Ve:67,tf:68,E:69,uf:70,vf:71,wf:72,xf:73,yf:74,zf:75,Af:76,Bf:77,Cf:78,Df:79,Ef:80,Q:81,Ff:82,Gf:83,Hf:84,If:85,Jf:86,Kf:87,Lf:88,Mf:89,zc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Nf:97,Of:98,Pf:99,d:100,e:101,Qf:102,Rf:103,Sf:104,Tf:105,Wf:106,k:107,Xf:108,Yf:109,n:110,Zf:111,p:112,q:113,r:114,$f:115,t:116,ag:117,bg:118,cg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,qc:127}; +var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],2494464:[203,2,12,512],5242880:[256,2,40,256],10485760:[512,2,40,256]},m={Re:0,kc:1,Te:2,Ue:3,Ve:4,We:5,Xe:6,Ye:7,Rb:8,Ze:9,lc:10,$e:11,af:12,mc:13,bf:14,cf:15,df:16,ef:17,ff:18,gf:19,hf:20,jf:21,kf:22,lf:23,mf:24,nf:25,pf:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42, +"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Qb:65,Qe:66,Se:67,qf:68,E:69,rf:70,sf:71,tf:72,uf:73,vf:74,wf:75,xf:76,yf:77,zf:78,Af:79,Bf:80,Q:81,Cf:82,Df:83,Ef:84,Ff:85,Gf:86,Hf:87,If:88,Jf:89,wc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Kf:97,Lf:98,Mf:99,d:100,e:101,Nf:102,Of:103,Pf:104,Qf:105,Tf:106,k:107,Uf:108,Vf:109,n:110,Wf:111,p:112,q:113,r:114,Xf:115,t:116,Yf:117,Zf:118,$f:119,x:120,y:121,z:122,"{":123, +"|":124,"}":125,"~":126,nc:127}; function q(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function r(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function t(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})} @@ -44,227 +44,227 @@ function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function w(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} -function sa(a,b){var c,d={N:null,ca:null,na:null,ma:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.na=g.load;d.ma=g.exec;if(e=g.bytes)d.N=e;else if(e=g.words)for(d.N=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.N=Array(4*e.length),f=c=0;c>8&255,d.N[f++]=e[c]>>16&255,d.N[f++]=e[c]>>24&255;else d.N=g;d.ca=g.symbols;d.N.length?1==d.N.length&&(x(d.N[0]),d=null):(x("Empty resource: "+a),d=null)}catch(k){x("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.na=g.load;d.ma=g.exec;if(e=g.bytes)d.O=e;else if(e=g.words)for(d.O=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.O=Array(4*e.length),f=c=0;c>8&255,d.O[f++]=e[c]>>16&255,d.O[f++]=e[c]>>24&255;else d.O=g;d.ca=g.symbols;d.O.length?1==d.O.length&&(x(d.O[0]),d=null):(x("Empty resource: "+a),d=null)}catch(k){x("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ba=this.id:(this.ta=this.id.substr(0,b),this.Ba=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Jb:!1,S:!1,error:!1};this.wb=null;this.o.error=!1;this.j={};this.G=null;this.Lc=d||0;z.push(this)}var Ma=void 0,Na={}; +Ha(za("Opera")||za("iOS")?"onunload":"onbeforeunload",function(){Ja(Da.exit)});function y(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Vb=b.comment;this.Kc=b;b=this.id.indexOf(".");0>b?this.xa=this.id:(this.ya=this.id.substr(0,b),this.xa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Ga:!1,Hb:!1,R:!1,error:!1};this.ub=null;this.o.error=!1;this.j={};this.G=null;this.Ic=d||0;z.push(this)}var Ma=void 0,Na={}; if(window){Ma||(Ma=window.location.search.substr(1));for(var Oa,Pa=/\+/g,Qa=/([^&=]+)=?([^&]*)/g;Oa=Qa.exec(Ma);)Na[decodeURIComponent(Oa[1].replace(Pa," "))]=decodeURIComponent(Oa[2].replace(Pa," "))}function Ra(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 A(a,b){b||(b=y);a.prototype=Ra(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Sa=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},z=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Wc,a]}A($a);var ab=7;function bb(a,b){return a.b[b]&&a.b[b][1]}h=$a.prototype;h.reset=function(){this.stop()}; -h.ba=function(a,b,c,d){if(this.m&&this.m.ba(a,b,c,d)||this.a&&this.a.ba(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.h[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){cb(a, -b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){db(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){cb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){db(a,b)}}(this,b),!0):this.parent.ba.call(this,a,b,c,d)}};h.ga=function(a,b,c,d){this.m=a;this.g=b;this.a=c;this.G=d;eb(b,this,fb);gb(b,this.reset.bind(this));hb(this);ib(this)};h.ia=function(a,b){b||(jb(),this.reset());return!0};h.ha=function(){return!0}; +function $a(a){y.call(this,"Panel",a,$a,512);this.ja=this.i=this.c=this.m=this.s=this.v=0;this.w=this.D=this.B=!1;this.H=ab;this.h={};this.b={START:[1,1,!0,!1,this.Rc],STEP:[1,1,!1,!1,this.Sc],ENABLE:[1,1,!1,!1,this.Nc],CONT:[1,1,!0,!1,this.Lc],DEP:[0,0,!0,!1,this.Mc],EXAM:[1,1,!0,!1,this.Oc],LOAD:[1,1,!0,!1,this.Qc],TEST:[0,0,!0,!1,this.Pc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Tc,a]}A($a);var ab=7;function bb(a,b){return a.b[b]&&a.b[b][1]}h=$a.prototype;h.reset=function(){this.stop()}; +h.ba=function(a,b,c,d){if(this.l&&this.l.ba(a,b,c,d)||this.a&&this.a.ba(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.h[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){cb(a, +b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){db(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){cb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){db(a,b)}}(this,b),!0):this.parent.ba.call(this,a,b,c,d)}};h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;eb(b,this,fb);gb(b,this.reset.bind(this));hb(this);ib(this)};h.ia=function(a,b){b||(jb(),this.reset());return!0};h.ha=function(){return!0}; function kb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function hb(a,b){for(var c in a.h)kb(a,c,null!=b?b:a.h[c])}function lb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ib(a){for(var b in a.b)lb(a,b,a.b[b][1])}function mb(a,b,c,d){a.j[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.G&&a.G.g||8)?ja(c,d):r(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} -function cb(a,b){var c=a.b[b];lb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.w="DEP"==b,a.D="EXAM"==b)}function db(a,b){var c=a.b[b];c[2]&&c[3]&&(lb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Uc=function(a){a||this.a.o.U||(a=this.a,a.g.reset(),nb(a),bb(this,"ENABLE")&&ob(this.a))};h.Vc=function(){};h.Qc=function(a){a||G(this.a)}; -h.Oc=function(a){if(!a&&!this.a.o.U)if(bb(this,"ENABLE"))ob(this.a);else{a=this.G;var b;if(b=a)a.o.Fa&&(a.o.Jb=!0),b=!a.o.Fa;if(b)Wa(a,!0),a.zb(0,null),Wa(a,!1);else try{var c=this.a.zb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Ta?8:16,c=65472<=a.ja&&a.ja<65472+b,b=c?1:2,c=c?15:a.g.Da;bb(a,"STEP")||(b=-b);ub(a,a.ja&~c|a.ja+b&c)}function ub(a,b){a.ja=b&a.g.Da;b=a.ja;for(var c=0;22>c;c++)vb(a,"A"+c,b&1<c;c++)vb(a,"D"+c,b&1<>2;this.m=this.c-1;this.v=this.B/this.c|0;this.Ca=[];this.i=0;this.s=!1;this.D=0;this.w=[];this.Ac=[zb,Ab,Bb,Cb];a=new H(this);Db(a,this.G);this.g=Array(this.v);this.h=Array(this.v);for(b=0;b>>this.b;this.H=0;this.l=this.Da;F(this)}A(xb); -var yb=8192,Gb=yb-1;function zb(a,b){var c=-1,d=this.controller,e=d.Ca[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ca[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} -function Ab(a,b,c){var d=!1,e=this.controller,f=e.Ca[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ca[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Bb(a,b){var c=-1,d=this.controller;a=d.Ca[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} -function Cb(a,b,c){var d=!1,e=this.controller;a=e.Ca[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Hb(a,b){if(b!=a.H){for(var c=0;c>>a.b,a.h[a.K]=a.g[a.J])}}h=xb.prototype;h.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Pa)return l.Ab+=l.Pa-f,l.Pa=f,!0;if(f>=l.Pa+l.Ab){p=l.size-(f-n);p>g&&(p=g);l.Ab=f-l.Pa+p;f=n+a.c;g-=p;k++;continue}}return Ib(1,f,g)}f=new H(a,f,p,a.c,d,e);Db(f,a.G,l);a.g[k++]=f;f=n+a.c;g-=p}return 0>=g?(d==Jb&&(a.D+=c),a.status((c>>10)+"Kb "+Kb[d]+" at "+ja(b)),!0):Ib(2,b,c)} -function Lb(a,b){3932160<=b&&(b=Mb(a.a,b));return a.h[(b&a.l)>>>a.b].Nb(b&a.m,b)}function Nb(a,b){3932160<=b&&(b=Mb(a.a,b));return a.h[(b&a.l)>>>a.b].Y(b&a.m,b)}h.Qa=function(a){this.s=!1;this.i++;3932160<=a&&(a=Mb(this.a,a));a=this.g[(a&this.Da)>>>this.b].fc(a&this.m,a);this.i--;return a};function Ob(a,b,c){3932160<=b&&(b=Mb(a.a,b));a.h[(b&a.l)>>>a.b].Rb(b&a.m,c&255,b)}h.kb=function(a,b){this.s=!1;this.i++;3932160<=a&&(a=Mb(this.a,a));this.g[(a&this.Da)>>>this.b].Sb(a&this.m,b&255,a);this.i--}; -function Pb(a,b,c){3932160<=b&&(b=Mb(a.a,b));a.h[(b&a.l)>>>a.b].Bb(b&a.m,c&65535,b)}h.Xa=function(a,b){this.s=!1;this.i++;3932160<=a&&(a=Mb(this.a,a));this.g[(a&this.Da)>>>this.b].lc(a&this.m,b&65535,a);this.i--};function Qb(a){for(var b=0,c=[],d=0;da.a.Ta)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,v=0;v>16&65535);a=a.Ib;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.hd=function(){var a=this.a;a.aa&57344||(a.Kb=a.w&65535);return a.Kb};h.jd=function(){return this.a.Ea};h.he=function(a){var b=this.a;1170>b.Ta&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.$a=a&16?4194303:262143,ac(b))};h.Rd=function(a){a=a>>1&63;var b=this.a.lb[a>>1];return a&1?b>>16:b&65535}; -h.Pe=function(a,b){b=b>>1&63;var c=b>>1;this.a.lb[c]=b&1?this.a.lb[c]&65535|(a&63)<<16:this.a.lb[c]&-65536|a&65534};h.Kd=function(a){return this.a.I[1][a>>1&7]};h.Ie=function(a,b){this.a.I[1][b>>1&7]=a&65295};h.Id=function(a){return this.a.I[1][(a>>1&7)+8]};h.Ge=function(a,b){this.a.I[1][(b>>1&7)+8]=a&65295};h.Jd=function(a){return this.a.da[1][a>>1&7]};h.He=function(a,b){b=b>>1&7;this.a.da[1][b]=a;this.a.I[1][b]&=65295};h.Hd=function(a){return this.a.da[1][(a>>1&7)+8]}; -h.Fe=function(a,b){b=(b>>1&7)+8;this.a.da[1][b]=a;this.a.I[1][b]&=65295};h.cd=function(a){return this.a.I[0][a>>1&7]};h.de=function(a,b){this.a.I[0][b>>1&7]=a&65295};h.ad=function(a){return this.a.I[0][(a>>1&7)+8]};h.be=function(a,b){this.a.I[0][(b>>1&7)+8]=a&65295};h.bd=function(a){return this.a.da[0][a>>1&7]};h.ce=function(a,b){b=b>>1&7;this.a.da[0][b]=a;this.a.I[0][b]&=65295};h.$c=function(a){return this.a.da[0][(a>>1&7)+8]};h.ae=function(a,b){b=(b>>1&7)+8;this.a.da[0][b]=a;this.a.I[0][b]&=65295}; -h.Qd=function(a){return this.a.I[3][a>>1&7]};h.Oe=function(a,b){this.a.I[3][b>>1&7]=a&65295};h.Od=function(a){return this.a.I[3][(a>>1&7)+8]};h.Me=function(a,b){this.a.I[3][(b>>1&7)+8]=a&65295};h.Pd=function(a){return this.a.da[3][a>>1&7]};h.Ne=function(a,b){b=b>>1&7;this.a.da[3][b]=a;this.a.I[3][b]&=65295};h.Nd=function(a){return this.a.da[3][(a>>1&7)+8]};h.Le=function(a,b){b=(b>>1&7)+8;this.a.da[3][b]=a;this.a.I[3][b]&=65295};h.Va=function(a){a&=7;return this.a.F&2048?this.a.Ja[a]:this.a.f[a]}; -h.Ya=function(a,b){b&=7;this.a.F&2048?this.a.Ja[b]=a:this.a.f[b]=a};h.od=function(){return this.a.F&49152?this.a.qa[0]:this.a.f[6]};h.me=function(a){this.a.F&49152?this.a.qa[0]=a:this.a.f[6]=a};h.rd=function(){return this.a.f[7]};h.pe=function(a){this.a.f[7]=a};h.Wa=function(a){a&=7;return this.a.F&2048?this.a.f[a]:this.a.Ja[a]};h.Za=function(a,b){b&=7;this.a.F&2048?this.a.f[b]=a:this.a.Ja[b]=a};h.pd=function(){return 1==(this.a.F&49152)>>14?this.a.f[6]:this.a.qa[1]}; -h.ne=function(a){1==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.qa[1]=a};h.qd=function(){return 3==(this.a.F&49152)>>14?this.a.f[6]:this.a.qa[3]};h.oe=function(a){3==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.qa[3]=a};h.Zc=function(a){return this.a.ic[a-65504>>1]};h.$d=function(a,b){this.a.ic[b-65504>>1]=a};h.ec=function(a){return 65520==a?(Rb(this.g)>>6)-1:0};h.kc=function(){};h.Md=function(){return 1};h.Ke=function(){};h.Yc=function(){return this.a.Z};h.Zd=function(){this.a.Z=0};h.ed=function(){return this.a.hc}; -h.fe=function(a,b){b&1||(a&=255);this.a.hc=a};h.kd=function(a,b){return b?0:this.a.yb};h.ie=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=1}b.yb=a};h.Ld=function(a,b){return b?0:this.a.jb&65280};h.Je=function(a){this.a.jb=a|255};h.nd=function(){return bc(this.a)};h.le=function(a){cc(this.a,a&-1793|bc(this.a)&1792);this.a.u|=256};h.jc=function(){}; -var L={},Yb=(L[61568]=[null,null,K.prototype.Rd,K.prototype.Pe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Kd,K.prototype.Ie,"SIPDR",8,1145,64],L[62608]=[null,null,K.prototype.Id,K.prototype.Ge,"SDPDR",8,1145,64],L[62624]=[null,null,K.prototype.Jd,K.prototype.He,"SIPAR",8,1145,64],L[62640]=[null,null,K.prototype.Hd,K.prototype.Fe,"SDPAR",8,1145,64],L[62656]=[null,null,K.prototype.cd,K.prototype.de,"KIPDR",8,1145,64],L[62672]=[null,null,K.prototype.ad,K.prototype.be,"KDPDR",8,1145,64],L[62688]= -[null,null,K.prototype.bd,K.prototype.ce,"KIPAR",8,1145,64],L[62704]=[null,null,K.prototype.$c,K.prototype.ae,"KDPAR",8,1145,64],L[62798]=[null,null,K.prototype.jd,K.prototype.he,"MMR3",1,1145,64],L[65382]=[null,null,K.prototype.dd,K.prototype.ee,"LKS"],L[65402]=[null,null,K.prototype.fd,K.prototype.ge,"MMR0",1,1145,64],L[65404]=[null,null,K.prototype.gd,K.prototype.jc,"MMR1",1,1145,64],L[65406]=[null,null,K.prototype.hd,K.prototype.jc,"MMR2",1,1145,64],L[65408]=[null,null,K.prototype.Qd,K.prototype.Oe, -"UIPDR",8,1145,64],L[65424]=[null,null,K.prototype.Od,K.prototype.Me,"UDPDR",8,1145,64],L[65440]=[null,null,K.prototype.Pd,K.prototype.Ne,"UIPAR",8,1145,64],L[65456]=[null,null,K.prototype.Nd,K.prototype.Le,"UDPAR",8,1145,64],L[65472]=[null,null,K.prototype.Va,K.prototype.Ya,"R0SET0"],L[65473]=[null,null,K.prototype.Va,K.prototype.Ya,"R1SET0"],L[65474]=[null,null,K.prototype.Va,K.prototype.Ya,"R2SET0"],L[65475]=[null,null,K.prototype.Va,K.prototype.Ya,"R3SET0"],L[65476]=[null,null,K.prototype.Va, -K.prototype.Ya,"R4SET0"],L[65477]=[null,null,K.prototype.Va,K.prototype.Ya,"R5SET0"],L[65478]=[null,null,K.prototype.od,K.prototype.me,"R6KERNEL"],L[65479]=[null,null,K.prototype.rd,K.prototype.pe,"R7KERNEL"],L[65480]=[null,null,K.prototype.Wa,K.prototype.Za,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Wa,K.prototype.Za,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Wa,K.prototype.Za,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Wa,K.prototype.Za,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Wa, -K.prototype.Za,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Wa,K.prototype.Za,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.pd,K.prototype.ne,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.qd,K.prototype.oe,"R6USER",1,1145],L[65504]=[null,null,K.prototype.Zc,K.prototype.$d,"CTRL",8,1170],L[65520]=[null,null,K.prototype.ec,K.prototype.kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.ec,K.prototype.kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Md,K.prototype.Ke,"SYSID",1,1170],L[65526]= -[null,null,K.prototype.Yc,K.prototype.Zd,"CPUERR",1,1170],L[65528]=[null,null,K.prototype.ed,K.prototype.fe,"MB",1,1170],L[65530]=[null,null,K.prototype.kd,K.prototype.ie,"PIR"],L[65532]=[null,null,K.prototype.Ld,K.prototype.Je,"SL"],L[65534]=[null,null,K.prototype.nd,K.prototype.le,"PSW"],L); -Ia(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),kc(this,gc?lc:mc);else{a=this.a=Array(this.size>> -2);for(f=0;f>2),b=0;b>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&I(this.g,b,64);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},ta: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.ya=!0},H:function(a,b){return this.J(a,b)},V:function(a,b){return this.fc(a,b)},sa:function(a,b,c){this.m?this.h(a,b,c):this.Sb(a,b,c)},va:function(a,b,c){this.m?this.h(a,b,c):this.lc(a,b,c)},D:function(a){return this.j[a]},K:function(a){return this.j[a]},R:function(a,b){a&1&&I(this.g,b,64);return this.c.getUint16(a,!0)},ka:function(a,b){a&1&&I(this.g,b,64);return this.s[a>>1]},ra:function(a,b){this.j[a]=b;this.ya=!0},Ba:function(a,b){this.j[a]=b;this.ya=!0},ua:function(a,b,c){a&1&&I(this.g, -c,64);this.c.setUint16(a,b,!0);this.ya=!0},wa:function(a,b,c){a&1&&I(this.g,c,64);this.s[a>>1]=b;this.ya=!0}};function Db(a,b,c){a.G=b;a.i=a.l=0;c&&((a.i=c.i)&&oc(a,rc,!1),(a.l=c.l)&&sc(a,rc,!1))}function sc(a,b,c){c&&a.l||(a.Rb=!a.m&&b[1]||a.h,a.Bb=!a.m&&b[3]||a.w);if(c||void 0===c)a.Sb=b[1]||a.h,a.lc=b[3]||a.w}function oc(a,b,c){c&&a.i||(a.Nb=b[0]||a.v,a.Y=b[2]||a.B);if(c||void 0===c)a.J=b[0]||a.v,a.fc=b[2]||a.B}function kc(a,b){b||(b=tc);oc(a,b,void 0);sc(a,b,void 0)} -var tc=[],nc=[H.prototype.M,H.prototype.ta,H.prototype.la,H.prototype.xa],rc=[H.prototype.H,H.prototype.sa,H.prototype.V,H.prototype.va];if(Za)var mc=[H.prototype.D,H.prototype.ra,H.prototype.R,H.prototype.ua],lc=[H.prototype.K,H.prototype.Ba,H.prototype.ka,H.prototype.wa]; -function uc(a,b){y.call(this,"CPU",a,uc,1);b=a.cycles||b;var c=a.multiplier||1;this.Db=0;this.rb=b;this.wa=c;this.Cb=Math.round(this.rb/1E4)/100;this.Ma=this.Cb*this.wa;this.o.U=!1;this.o.Pb=!1;this.o.gb=a.autoStart;this.o.ub=!1;this.pb=this.Na=0;this.qb=a.csStart;this.ab=a.csInterval;this.bb=a.csStop;this.M=[];this.dc=this.Vd.bind(this);F(this)}A(uc);var vc=["power","reset"];h=uc.prototype; -h.ga=function(a,b,c,d){this.m=a;this.g=b;this.G=d;this.B=a.B;for(b=0;b=a.Na&&(a.Na+=a.ab,c=!0);0<=a.bb&&a.bb<=zc(a)&&(a.ab=a.bb=-1,yc(a),G(a),c=!0);c&&a.X(zc(a)+" cycles: checksum="+r(a.pb))}} -h.ba=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.m)if(a=d.m,a.o.S)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.La/a.Ma&&(b=1);a.wa=b;b=a.Cb*a.wa;if(a.Ma!=b){a.Ma=b;b=a.Ma.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.m&&Cc(a.m)}qb(a,a.sa);a.sa=0;a.la=qa();a.ua=0;Bc(a)}function Ub(a,b){var c=a.M.length;a.M.push([-1,b]);return c}function Wb(a,b,c,d){0<=b&&ba.M[b][0])&&(c=a.rb*a.wa/1E3*c|0,a.o.U&&(c+=Dc(a)),a.M[b][0]=c)} -function pb(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Dc(a,b){var c=a.va-=a.a;a.a=a.K=0;b&&(a.va=0);return c} -h.Vd=function(){if(this.o.U){this.Gb>=this.rb&&Bc(this,!0);this.eb=0;this.ob=qa();if(this.ua){var a=this.ob-this.ua;a>this.ac&&(this.la+=a,this.la>this.ob&&(this.la=this.ob))}try{do{for(var b,c=this.o.ub?1:this.sb,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.zb(b)}catch(f){if("number"!=typeof f)throw f;}b=Dc(this,!0);this.eb+=b;this.sa+=b;rb(this,b);pb(this,b);this.cb-=b;if(0>=this.cb){this.cb+=this.sb;15<=++this.bc&&(this.Aa(),this.bc=0);break}}while(this.o.U)}catch(f){G(this); -this.m&&this.m.stop(qa(),zc(this));Ya(this,f.stack||f.message);return}if(this.o.U){a=setTimeout;b=this.dc;this.ua=qa();c=this.ac;this.eb&&(c=Math.round(c*this.eb/this.sb));c-=this.ua-this.ob;if(d=this.ua-this.la)this.La=Math.round(this.sa/(10*d))/100,864E5<=d&&(this.xa=0,Ac(this));if(0>c||this.Lac&&(this.la-=c),c=0;this.Gb+=this.eb;this.ua+=c;a(b,c)}}}; -function ob(a){var b;a.o.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.U)a.X(a.toString()+" busy");else{Ac(a);a.o.U=!0;a.o.Pb=!0;if(b=a.j.run)b.textContent="Halt";a.m&&a.m.start(a.la,zc(a));setTimeout(a.dc,0)}}h.zb=function(){return 0};function G(a){var b=!1;if(a.o.U){Dc(a);qb(a,a.sa);a.sa=0;a.o.U=!1;if(b=a.j.run)b.textContent="Run";a.m&&a.m.stop(qa(),zc(a));b=!0}a.o.complete=void 0;return b} -function Ec(a){this.Ta=+a.model||1170;this.Xb=a.addrReset||0;uc.call(this,a,6666667);this.tb=0;this.Zb=255;1120==this.Ta?(this.decode=Fc.bind(this),this.Ka=this.Ec,this.tb=8,this.Zb=-1):(this.decode=Gc.bind(this),this.Ka=this.Fc);Hc(this);this.ra=0;this.J=null;this.o.complete=!1}A(Ec,uc);h=Ec.prototype;h.reset=function(){this.status("model "+this.Ta);this.o.U&&G(this);Hc(this);xc(this);this.o.error=!1;this.parent.reset.call(this)}; -function Hc(a){a.l=65536;a.h=32768;a.i=65535;a.s=32768;a.F=15;a.f=[0,0,0,0,0,0,0,a.Xb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.v=0;a.nb=0;a.Mc=[4,2,0,1];a.I=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.da=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0]];a.lb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.ic=[0,0,0,0,0,0,0,0];a.hc=0;a.u=0;a.D=a.H=0;a.c=a.b=a.Fb=0;a.Oa=-1;nb(a)}function nb(a){a.aa=0;a.Ib=0;a.Kb=0;a.Ea=0;a.Z=0;a.yb=0;a.jb=255;a.ka=0;a.mb=0;a.$a=262143;a.fb=0;a.w=0;a.J=null;a.g&&(ac(a),a.Kc=Rb(a.g))}function ac(a){a.ka?(a.V=65536,a.Eb=a.Ea&16?4186112:253952,a.R=a.Ic,a.Y=a.Sd,a.Bb=a.Qe,Hb(a.g,a.Ea&16?22:18)):(a.V=0,a.Eb=57344,a.R=a.Hc,a.Y=a.gc,a.Bb=a.mc,Hb(a.g,16))} -function $b(a,b){b&=-3073;if(a.aa!=b){b&57344&&!(a.aa&57344)&&(a.Ib=a.w>>16&65535,a.Kb=a.w&65535);a.aa=b;a.mb=b>>5&3;a.nb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ka!=c&&(a.ka=c,ac(a))}}h.$b=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.xa,this.wa]);a.set(2,Qb(this.g));return a.data()}; -h.restore=function(a){var b=a[1];this.xa=b[1];Ac(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c>14&3;c=a.F>>14&3;a.v!=c&&(a.qa[c]=a.f[6],a.f[6]=a.qa[a.v]);a.F=b;a.u&=-3;a.u|=a.J?2:1}function R(a,b){a.u&256||(a.s=a.i=b,a.h=0)} -function Mc(a,b,c){a.u&256||(a.s=a.i=a.l=b,a.h=c||0)}function Nc(a,b,c,d){a.u&256||(a.s=a.i=a.l=b,a.h=(c^b)&(d^b))}function Oc(a,b){a.u&256||(a.s=a.i=a.l=b,a.h=a.s^a.l>>1)}function Pc(a,b,c,d){a.u&256||(a.s=a.i=a.l=b,a.h=(c^d)&(d^b))} -function J(a,b,c,d){if(!a.ra){0>a.Oa?a.Oa=bc(a):a.v||(d=-3);var e=!1;-3==d&&(b=4,a.Z|=4,a.f[6]=4,e=!0);a.w=b|4143316992;a.v=0;var f=a.Y(b|a.V),g=a.Y(b+2&65535|a.V);cc(a,g&-12289|a.Oa>>2&12288);Qc(a,a.Oa,e);Qc(a,a.f[7],e);Q(a,f);a.u&=~(c|19);a.u|=129;a.Oa=-1;if(-3<=d)throw b;}}function Rc(a){var b=Sc(a),c=Sc(a)&-1793;a.F&49152&&(c=c&-225|a.F&63712);Q(a,b);cc(a,c);a.u&=-17}function Mb(a,b){var c=b>>13&31;31>c&&(b=a.Ea&32?a.lb[c]+(b&8190)&4194302:b&-3932161);return b} -function Tc(a,b,c){var d,e,f;if(!(c&a.ka))return f=b&65535,57344<=f&&(f|=a.Eb),f;d=b>>13;a.Ea&a.Mc[a.v]||(d&=7);e=a.I[a.v][d];f=(a.da[a.v][d]<<6)+(b&8191)&a.$a;3932160<=f&&(f=Mb(a,f));if(a.ra)return f;f>=a.Kc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& -(g|=16384));a.I[a.v][d]=e;if(f!=(4194170&a.$a)||a.v)a.mb=a.v,a.nb=d;g&&(g&57344&&(0<=a.Oa&&(g|=128),a.aa&57344||(g|=a.aa&4096|a.mb<<5|a.nb<<1,$b(a,a.aa&-61695|g&61694)),J(a,168,64,-1)),a.aa&61440||!(f<(4191360&a.$a)||f>(4194239&a.$a))||(a.aa|=4096,a.aa&512&&(a.u|=64)));return f}function Sc(a){var b=a.Y(a.f[6]|a.V);a.f[6]=a.f[6]+2&65535;return b}function Qc(a,b,c){var d=a.f[6]-2&65535;a.f[6]=d;a.w=a.w&65535|(a.w&-65536)<<8|16121856;c||a.Ka(4,-2,d);a.Bb(d,b)} -function Uc(a,b,c,d){var e,f,g=d&8?0:a.V;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.Ka(d,0,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];6==c&&a.Ka(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.Y(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;6==c&&a.Ka(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.Y(e)|g;a.a-=8;break;case 6:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,6==c&&a.Ka(d,0, -e),a.a-=6,e|g;case 7:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,e=a.Y(e|a.V),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.w=a.w&65535|(a.w&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ec=function(a,b,c){!this.v&&0>=b&&c<=this.jb&&(this.u|=32)};h.Fc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.jb&&(c<=this.jb-32?J(this,4,0,-3):(this.Z|=8,this.u|=32)))};h.Qa=function(a){if(!this.ka)return this.g.Qa(a);this.ra++;a=this.gc(Tc(this,a,2));this.ra--;return a}; -h.kb=function(a,b){this.ka?(this.ra++,a=Tc(this,a,5),a&1&&this.a--,Ob(this.g,a,b),this.ra--):this.g.kb(a,b)};h.Xa=function(a,b){this.ka?(this.ra++,this.mc(Tc(this,a,4),b),this.ra--):this.g.Xa(a,b)};h.Hc=function(a,b,c){return Uc(this,a,b,c)};h.Ic=function(a,b,c){return Tc(this,Uc(this,a,b,c),c)};h.gc=function(a){return Nb(this.g,this.fb=a)};h.Sd=function(a){return Nb(this.g,this.fb=Tc(this,a,2))};h.mc=function(a,b){Pb(this.g,this.fb=a,b&65535)};h.Qe=function(a,b){Pb(this.g,this.fb=Tc(this,a,4),b)}; -function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Uc(a,b,d,2),c&65536||61440!==(a.F&61440)&&(d&=65535),a.v=a.F>>12&3,c=a.Y(d|c&a.V),a.v=a.F>>14&3):c=6!=d||(a.F>>2&12288)===(a.F&12288)?a.f[d]:a.qa[a.F>>12&3];return c}function Wc(a,b,c,d){a.w=a.w&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Uc(a,b,e,4),c&65536||(e&=65535),a.v=a.F>>12&3,e=Tc(a,e|c&65536,4),a.v=a.F>>14&3,Pb(a.g,e,d)):6!=e||(a.F>>2&12288)===(a.F&12288)?a.f[e]=d:a.qa[a.F>>12&3]=d} -function Xc(a,b){b>>=6;var c=a.H=b&7;(b=a.D=(b&56)>>3)?(c=a.R(b,c,3),a=Lb(a.g,c)):a=a.f[c+a.tb]&a.Zb;return a}function Yc(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?Nb(a.g,a.R(b,c,2)):a.f[c+a.tb]}function Zc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Uc(a,b,c,8)}function $c(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Lb(a.g,c)):a=a.f[c]&255;return a}function ad(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Nb(a.g,a.R(b,c,2)):a.f[c]} -function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Fb=a.R(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Lb(a.g,e)),e&1&&a.a--,Ob(a.g,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Pb(a.g,e,d.call(a,0>c?a.f[-c-1]:c,Nb(a.g,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])} -function bd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Ob(a.g,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function cd(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,d,4),Pb(a.g,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c}function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} -h.zb=function(a){this.o.complete=!0;var b=a?this.o.Pb?0:1:-1;this.o.Pb=!1;this.va=this.a=a;do{if(this.u){if(a=this.u&11){a=!1;if(this.u&2){var c=160,d=(this.yb&224)>>5,e=this.J&&this.J.Ua>d?this.J:null;e&&(c=e.Xd,d=e.Ua);d>(this.F&224)>>5?(this.u&8&&(Kc(this,2),this.u&=-9),J(this,c,0,-9),d=!0):d=!1;d&&(e&&Zb(this,e),a=!0);this.J||this.yb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Lc(this)&&0>b)break}this.u=this.u&15|this.F&16;this.decode(Jc(this))}while(0>1|b<<16;Oc(this,a);return a&65535} -function id(a,b){a=b&128|b>>1|b<<8;Oc(this,a<<8);return a&255}function jd(a,b){a=b&~a;R(this,a);return a}function kd(a,b){a=b&~a;R(this,a<<8);return a}function ld(a,b){a|=b;R(this,a);return a}function md(a,b){a|=b;R(this,a<<8);return a}function nd(a,b){a=~b|65536;Mc(this,a);return a&65535}function od(a,b){a=~b|256;Mc(this,a<<8);return a&255}function pd(a,b){a=b-a;this.u&256||(this.s=this.i=a,this.h=b&(b^a));return a&65535} -function qd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&256||(this.s=this.i=c,this.h=b&(b^c));return a&255}function rd(a,b){a=b+a;this.u&256||(this.s=this.i=a,this.h=a&(b^a));return a&65535}function sd(a,b){a=b+a;var c=a<<8;this.u&256||(this.s=this.i=c,this.h=c&(b<<8^c));return a&255}function td(a,b){a=-b;Mc(this,a,a&b&32768);return a&65535}function ud(a,b){a=-b;Mc(this,a<<8,(a&b&128)<<8);return a&255}function vd(a,b){a=b<<1|this.l>>16&1;Oc(this,a);return a&65535} -function wd(a,b){a=b<<1|this.l>>16&1;Oc(this,a<<8);return a&255}function xd(a,b){a=(this.l&65536|b)>>1|b<<16;Oc(this,a);return a&65535}function yd(a,b){a=((this.l&65536)>>8|b)>>1|b<<8;Oc(this,a<<8);return a&255}function zd(a,b){var c=b-a;Pc(this,c,a,b);return c&65535}function Ad(a,b){var c=b-a;Pc(this,c<<8,a<<8,b<<8);return c&255}function Bd(a,b){this.u&256||(this.s=this.i=b&65280,this.h=this.l=0);return(b<<8|b>>8)&65535}function Cd(a,b){a^=b;R(this,a);return a&65535} -function Dd(a){U(this,a,Yc(this,a),dd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Ed(a){var b=ad(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.l=this.h=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.h=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} -function Fd(a){var b=ad(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.h=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.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Gd(a){V(this,a,!P(this))}function Hd(a){V(this,a,P(this))} -function Id(a){U(this,a,Yc(this,a),jd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Jd(a){S(this,a,Xc(this,a),kd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Kd(a){U(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Ld(a){S(this,a,Xc(this,a),md);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)} -function Md(a){var b=Yc(this,a);a=ad(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function Nd(a){var b=Xc(this,a);a=$c(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function Od(a){V(this,a,this.i&65535?0:4)}function Pd(a){V(this,a,!Ic(this)==!(this.h&32768))}function Qd(a){V(this,a,!!(this.i&65535)&&!Ic(this)==!(this.h&32768))} -function Rd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Sd(a){V(this,a,(this.i&65535?0:4)||!Ic(this)!=!(this.h&32768))}function Td(a){V(this,a,P(this)||(this.i&65535?0:4))}function Ud(a){V(this,a,!Ic(this)!=!(this.h&32768))}function Vd(a){V(this,a,Ic(this))}function Wd(a){V(this,a,!!(this.i&65535))}function Xd(a){V(this,a,!Ic(this))}function Yd(){J(this,12,0,-8);this.a-=5}function Zd(a){V(this,a,!0)}function $d(a){V(this,a,!(this.h&32768))}function ae(a){V(this,a,this.h&32768?2:0)} -function W(a){a&1&&(this.l=0);a&2&&(this.h=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function be(a){var b=Yc(this,a);a=ad(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Pc(this,c,a,b);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function ce(a){var b=Xc(this,a);a=$c(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Pc(this,c,a,b);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)} -function de(a){var b=ad(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.l=this.h=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.h=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.h=32768,this.l=65536,this.a-=7}function ee(){J(this,24,0,-8);this.a-=25} -function fe(){this.F&49152?(this.Z|=128,J(this,4,0,-7)):(this.B&&1120==this.Ta&&this.B.setData(this.f[0],!0),this.G?this.G.b():G(this));this.a-=7}function ge(){J(this,16,0,-8);this.a-=25}var he=[0,7,7,10,7,11,9,13];function ie(a){this.K=this.a;Q(this,Zc(this,a));this.a=this.K-he[this.c]}var je=[0,14,14,17,14,18,16,20];function ke(a){this.K=this.a;var b=Zc(this,a);a=a>>6&7;Qc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.K-je[this.c]}var le=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; -function me(a){var b=Yc(this,a);this.K=this.a;R(this,cd(this,a,b));this.a=this.K-le[(this.D?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ne(a){var b=Xc(this,a);R(this,bd(this,a,b,65535)<<8);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}var oe=[7,13,13,17,14,18,17,21]; -function pe(a){var b=ad(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.u&256||(this.s=b>>16,this.i=this.s|b,this.h=0,this.l=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ve(a){U(this,a,Yc(this,a),zd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function we(a){U(this,a,0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)}function xe(){J(this,28,0,-8);this.a-=5} -function ye(){this.B&&(this.B.ja=this.f[7],this.B.setData(this.f[0],!0));this.u|=8;Kc(this,-2);this.a-=3}function ze(a){U(this,a,this.f[(a>>6&7)+this.tb],Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Fc(a){Ae[a>>12].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)} -function Ne(a){Oe[a>>6&3].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)} -var Ae=[function(a){Re[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,Y,function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],Re=[function(a){Te[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,Y,Y,Y],Ce=[function(a){Mc(this,cd(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ee=[function(a){U(this,a,0, -td);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);Mc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}], -Te=[function(a){Ue[a&15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,Y,He,Je,we,we,we,we],Ue=[fe,ye,te,Yd,ge,re,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ie=[qe,function(){this.l=0;this.a-=5},function(){this.h=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ke=[qe,function(){this.l=65536;this.a-=5},function(){this.h=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Se=[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,Y,Y,Y],Me=[function(a){Mc(this, -bd(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Oe=[function(a){S(this,a,0,ud);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);Mc(this,a<<8);this.a-=this.c?4:3+(7== -this.b?2:0)}],Qe=[function(a){S(this,a,0,yd);this.a-=this.c?9+(this.Fb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,id);this.a-=this.c?9+(this.Fb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Gc(a){Ve[a>>12].call(this,a)} -var Ve=[function(a){We[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,function(a){Xe[a>>8&15].call(this,a)},function(a){Ye[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],We=[function(a){Ze[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.Y(a|this.V);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Vc(this,a,0);Qc(this,a);R(this,a);this.a-=11},function(a){var b=Sc(this);this.K= -this.a;Wc(this,a,0,b);R(this,b);this.a=this.K-oe[this.c]},function(a){R(this,cd(this,a,Ic(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ze=[function(a){af[a&15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,function(a){a&8?(this.F&49152||(this.F=this.F&-2017|(a&7)<<5,this.u|=1,this.u&=-3),this.a-=5):J(this,8,0,-8)},He,Je,we,we,we,we],af=[fe,ye,function(){Rc(this);this.u|=this.F&16;this.a-=13},Yd,ge,re,te,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Xe=[pe,pe,de,de,Ed,Ed,Fd,Fd,ze,ze,Y,Y,Y,Y,ue,ue],Ye=[Xd, -Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[Y,function(a){a=Vc(this,a,65536);Qc(this,a);R(this,a);this.a-=11},function(a){var b=Sc(this);this.K=this.a;Wc(this,a,65536,b);R(this,b);this.a=this.K-oe[this.c]},Y]; -function cf(a){y.call(this,"ROM",a,cf,128);this.ca=this.c=null;this.i=a.addr;this.b=a.size;this.l=!1;this.h=a.alias;this.m=a.file;this.s=t(this.m);if(this.m){a=this.m;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.m+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.m=null):(Ta(c.ta,a,b),(a=sa(a,b))?(c.c=a.N,c.ca=a.ca):c.m=null);df(c)})}}A(cf);h=cf.prototype; -h.ga=function(a,b,c,d){this.g=b;this.a=c;this.G=d;df(this)};h.ia=function(){this.ca&&(this.G&&this.G.a(this.id,this.i,this.b,this.ca),delete this.ca);return!0};h.ha=function(){return!0}; -function df(a){if(!Xa(a)){if(a.m){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+yb){var c={};b=(c[b]=[cf.prototype.Gd,cf.prototype.Ee,null,null,null,a.b>>1],c);if(eb(a.g,a,b)){b=a.l=!0;break a}}else if(Eb(a.g,b,a.b,jc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)a.a.kb(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Tb&&c<=m.zc&&(b=c-(m.Tb-m.nc));b&&(a.preventDefault&&a.preventDefault(),d.xb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.pc&&(b=m.oc);d.xb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& -a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.xb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; -h.ga=function(a,b,c,d){this.m=a;this.g=b;this.a=c;this.G=d;var e=this;this.V=Xb(48,4,262144);this.M=Ub(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.R&&97<=a&&122>a&&(a-=32),Wb(e.a,e.M,1E3/Math.round(e.H/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&Vb(c,e.V))});this.D=Xb(52,4,262144);this.la=Ub(this.a,function(){e.c|=128;e.c&64&&Vb(c,e.D)});eb(b,this,kf);gb(b,this.reset.bind(this));F(this)}; -h.cc=function(){if(!this.v){var a=wc(this.m,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.Ba)return;b=oa(b[1]);if(this.v=Ua(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.w=d.receiveData){this.status(this.ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ia=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.ha=function(a){return a?this.save():!0};h.reset=function(){lf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return lf(this)};function lf(a){a.B=0;a.b=0;a.c=128;a.s=[];return!0}h.xb=function(a){if("number"==typeof a)this.s.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.K||8,c=a-this.l%a,this.K&&(b=" ".slice(0,c)));this.J&&!this.l&&c&&(b=String.fromCharCode(this.J)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.l+=c}}else if(null!=this.i){if(10==a|| -1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Wb(this.a,this.la,1E3/Math.round(this.ka/10));this.c&=-129};var mf={},kf=(mf[65392]=[null,null,Z.prototype.td,Z.prototype.re,"RCSR"],mf[65394]=[null,null,Z.prototype.sd,Z.prototype.qe,"RBUF"],mf[65396]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XCSR"],mf[65398]=[null,null,Z.prototype.Td,Z.prototype.Re,"XBUF"],mf); -Ia(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.j[b]=c,c.onclick= -function(){var a=d.j.listTapes;a&&pf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.H){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;pf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1}; -h.ga=function(a,b,c,d){this.m=a;this.g=b;this.a=c;this.G=d;this.M=qf(a);var e=this;if((this.c=wc(this.m,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){x("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.J=Xb(56,4,4096);this.V=Ub(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.m&&!a.m.o.S;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.ta,e,f),(e=sa(e,f))&&zf(a,b,c,d,e.N,e.na,e.ma)); -a.o.Fa=!1;a.l&&(a.l--,a.l||F(a));wf(a)})}function tf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.P);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.vb?"":e)+"&format=json"));return!!w(f, -null,!0,function(b,c,d){Gf(a,b,c,d)})} -function Gf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.m&&!a.m.o.S;if(d)a.controller.C('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{Ta(a.controller.ta,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ -c+")");if(k.length)if(1==k.length)x(k[0]);else{a.P=k.length;a.T=k[0].length;a.O=k[0][0].length;var l=k[0][0][0];a.W=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var T=n<<2,Aa=v.length;Aa>2,e=Array(d),f=0;fa;a++)this.b["S"+a][1]=0&1<a.a.Ra?8:16,c=65472<=a.ja&&a.ja<65472+b,b=c?1:2,c=c?15:a.g.Da;bb(a,"STEP")||(b=-b);xb(a,a.ja&~c|a.ja+b&c)}function xb(a,b){a.ja=b&a.g.Da;b=a.ja;for(var c=0;22>c;c++)yb(a,"A"+c,b&1<c;c++)yb(a,"D"+c,b&1<>2;this.l=this.c-1;this.v=this.B/this.c|0;this.Ca=[];this.m=0;this.s=!1;this.w=[];this.xc=[Cb,Db,Eb,Fb];a=new H(this);Gb(a,this.G);this.g=Array(this.v);this.h=Array(this.v);for(b=0;b>>this.b;this.D=0;this.i=this.Da;F(this)}A(Ab); +var Bb=8192,Jb=Bb-1;function Cb(a,b){var c=-1,d=this.controller,e=d.Ca[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Ca[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} +function Db(a,b,c){var d=!1,e=this.controller,f=e.Ca[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Ca[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||I(e,c,16)}function Eb(a,b){var c=-1,d=this.controller;a=d.Ca[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;I(d,b,16);return 65535} +function Fb(a,b,c){var d=!1,e=this.controller;a=e.Ca[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||I(e,c,16)}function Kb(a,b){if(b!=a.D){for(var c=0;c>>a.b,a.h[a.J]=a.g[a.H])}}Ab.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Fa)return l.jb+=l.Fa-f,l.Fa=f,!0;if(f>=l.Fa+l.jb){p=l.size-(f-n);p>g&&(p=g);l.jb=f-l.Fa+p;f=n+a.c;g-=p;k++;continue}}return Lb(1,f,g)}f=new H(a,f,p,a.c,d,e);Gb(f,a.G,l);a.g[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Mb[d]+" at "+ja(b)),!0):Lb(2,b,c)}function Nb(a,b){return a.h[(b&a.i)>>>a.b].Lb(b&a.l,b)} +function Ob(a,b){return a.h[(b&a.i)>>>a.b].Y(b&a.l,b)}function wb(a,b){a.s=!1;a.m++;b=a.g[(b&a.Da)>>>a.b].cc(b&a.l,b);a.m--;return b}function Pb(a,b,c){a.s=!1;a.m++;a.g[(b&a.Da)>>>a.b].Pb(b&a.l,c&255,b);a.m--}function Qb(a,b,c){a.h[(b&a.i)>>>a.b].zb(b&a.l,c&65535,b)}function ub(a,b,c){a.s=!1;a.m++;a.g[(b&a.Da)>>>a.b].ic(b&a.l,c&65535,b);a.m--} +function Rb(a){for(var b=0,c=[],d=0;da.a.Ra)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,v=0;v>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.ed=function(){var a=this.a;a.aa&57344||(a.Ib=a.w&65535);return a.Ib};h.fd=function(){return this.a.Ea};h.ee=function(a){var b=this.a;1170>b.Ra&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Ya=a&16?4194303:262143,cc(b))};h.Od=function(a){a=a>>1&63;var b=this.a.ib[a>>1];return a&1?b>>16:b&65535}; +h.Me=function(a,b){b=b>>1&63;var c=b>>1;this.a.ib[c]=b&1?this.a.ib[c]&65535|(a&63)<<16:this.a.ib[c]&-65536|a&65534};h.Hd=function(a){return this.a.I[1][a>>1&7]};h.Fe=function(a,b){this.a.I[1][b>>1&7]=a&65295};h.Fd=function(a){return this.a.I[1][(a>>1&7)+8]};h.De=function(a,b){this.a.I[1][(b>>1&7)+8]=a&65295};h.Gd=function(a){return this.a.da[1][a>>1&7]};h.Ee=function(a,b){b=b>>1&7;this.a.da[1][b]=a;this.a.I[1][b]&=65295};h.Ed=function(a){return this.a.da[1][(a>>1&7)+8]}; +h.Ce=function(a,b){b=(b>>1&7)+8;this.a.da[1][b]=a;this.a.I[1][b]&=65295};h.$c=function(a){return this.a.I[0][a>>1&7]};h.ae=function(a,b){this.a.I[0][b>>1&7]=a&65295};h.Yc=function(a){return this.a.I[0][(a>>1&7)+8]};h.Zd=function(a,b){this.a.I[0][(b>>1&7)+8]=a&65295};h.Zc=function(a){return this.a.da[0][a>>1&7]};h.$d=function(a,b){b=b>>1&7;this.a.da[0][b]=a;this.a.I[0][b]&=65295};h.Xc=function(a){return this.a.da[0][(a>>1&7)+8]};h.Yd=function(a,b){b=(b>>1&7)+8;this.a.da[0][b]=a;this.a.I[0][b]&=65295}; +h.Nd=function(a){return this.a.I[3][a>>1&7]};h.Le=function(a,b){this.a.I[3][b>>1&7]=a&65295};h.Ld=function(a){return this.a.I[3][(a>>1&7)+8]};h.Je=function(a,b){this.a.I[3][(b>>1&7)+8]=a&65295};h.Md=function(a){return this.a.da[3][a>>1&7]};h.Ke=function(a,b){b=b>>1&7;this.a.da[3][b]=a;this.a.I[3][b]&=65295};h.Kd=function(a){return this.a.da[3][(a>>1&7)+8]};h.Ie=function(a,b){b=(b>>1&7)+8;this.a.da[3][b]=a;this.a.I[3][b]&=65295};h.Ta=function(a){a&=7;return this.a.F&2048?this.a.Ka[a]:this.a.f[a]}; +h.Va=function(a,b){b&=7;this.a.F&2048?this.a.Ka[b]=a:this.a.f[b]=a};h.ld=function(){return this.a.F&49152?this.a.qa[0]:this.a.f[6]};h.je=function(a){this.a.F&49152?this.a.qa[0]=a:this.a.f[6]=a};h.od=function(){return this.a.f[7]};h.me=function(a){this.a.f[7]=a};h.Ua=function(a){a&=7;return this.a.F&2048?this.a.f[a]:this.a.Ka[a]};h.Wa=function(a,b){b&=7;this.a.F&2048?this.a.f[b]=a:this.a.Ka[b]=a};h.md=function(){return 1==(this.a.F&49152)>>14?this.a.f[6]:this.a.qa[1]}; +h.ke=function(a){1==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.qa[1]=a};h.nd=function(){return 3==(this.a.F&49152)>>14?this.a.f[6]:this.a.qa[3]};h.le=function(a){3==(this.a.F&49152)>>14?this.a.f[6]=a:this.a.qa[3]=a};h.Wc=function(a){return this.a.fc[a-65504>>1]};h.Xd=function(a,b){this.a.fc[b-65504>>1]=a};h.bc=function(a){return 65520==a?(Sb(this.g)>>6)-1:0};h.hc=function(){};h.Jd=function(){return 1};h.He=function(){};h.Vc=function(){return this.a.Z};h.Wd=function(){this.a.Z=0};h.bd=function(){return this.a.ec}; +h.ce=function(a,b){b&1||(a&=255);this.a.ec=a};h.gd=function(a,b){return b?0:this.a.wb};h.fe=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=1}b.wb=a};h.Id=function(a,b){return b?0:this.a.hb&65280};h.Ge=function(a){this.a.hb=a|255};h.kd=function(){return dc(this.a)};h.ie=function(a){ec(this.a,a&-1793|dc(this.a)&1792);this.a.u|=256};h.gc=function(){}; +var L={},$b=(L[61568]=[null,null,K.prototype.Od,K.prototype.Me,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Hd,K.prototype.Fe,"SIPDR",8,1145,64],L[62608]=[null,null,K.prototype.Fd,K.prototype.De,"SDPDR",8,1145,64],L[62624]=[null,null,K.prototype.Gd,K.prototype.Ee,"SIPAR",8,1145,64],L[62640]=[null,null,K.prototype.Ed,K.prototype.Ce,"SDPAR",8,1145,64],L[62656]=[null,null,K.prototype.$c,K.prototype.ae,"KIPDR",8,1145,64],L[62672]=[null,null,K.prototype.Yc,K.prototype.Zd,"KDPDR",8,1145,64],L[62688]= +[null,null,K.prototype.Zc,K.prototype.$d,"KIPAR",8,1145,64],L[62704]=[null,null,K.prototype.Xc,K.prototype.Yd,"KDPAR",8,1145,64],L[62798]=[null,null,K.prototype.fd,K.prototype.ee,"MMR3",1,1145,64],L[65382]=[null,null,K.prototype.ad,K.prototype.be,"LKS"],L[65402]=[null,null,K.prototype.cd,K.prototype.de,"MMR0",1,1145,64],L[65404]=[null,null,K.prototype.dd,K.prototype.gc,"MMR1",1,1145,64],L[65406]=[null,null,K.prototype.ed,K.prototype.gc,"MMR2",1,1145,64],L[65408]=[null,null,K.prototype.Nd,K.prototype.Le, +"UIPDR",8,1145,64],L[65424]=[null,null,K.prototype.Ld,K.prototype.Je,"UDPDR",8,1145,64],L[65440]=[null,null,K.prototype.Md,K.prototype.Ke,"UIPAR",8,1145,64],L[65456]=[null,null,K.prototype.Kd,K.prototype.Ie,"UDPAR",8,1145,64],L[65472]=[null,null,K.prototype.Ta,K.prototype.Va,"R0SET0"],L[65473]=[null,null,K.prototype.Ta,K.prototype.Va,"R1SET0"],L[65474]=[null,null,K.prototype.Ta,K.prototype.Va,"R2SET0"],L[65475]=[null,null,K.prototype.Ta,K.prototype.Va,"R3SET0"],L[65476]=[null,null,K.prototype.Ta, +K.prototype.Va,"R4SET0"],L[65477]=[null,null,K.prototype.Ta,K.prototype.Va,"R5SET0"],L[65478]=[null,null,K.prototype.ld,K.prototype.je,"R6KERNEL"],L[65479]=[null,null,K.prototype.od,K.prototype.me,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ua,K.prototype.Wa,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ua,K.prototype.Wa,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ua,K.prototype.Wa,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ua,K.prototype.Wa,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ua, +K.prototype.Wa,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ua,K.prototype.Wa,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.md,K.prototype.ke,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.nd,K.prototype.le,"R6USER",1,1145],L[65504]=[null,null,K.prototype.Wc,K.prototype.Xd,"CTRL",8,1170],L[65520]=[null,null,K.prototype.bc,K.prototype.hc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.bc,K.prototype.hc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Jd,K.prototype.He,"SYSID",1,1170],L[65526]= +[null,null,K.prototype.Vc,K.prototype.Wd,"CPUERR",1,1170],L[65528]=[null,null,K.prototype.bd,K.prototype.ce,"MB",1,1170],L[65530]=[null,null,K.prototype.gd,K.prototype.fe,"PIR"],L[65532]=[null,null,K.prototype.Id,K.prototype.Ge,"SL"],L[65534]=[null,null,K.prototype.kd,K.prototype.ie,"PSW"],L); +Ia(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),mc(this,ic?nc:oc);else{a=this.a=Array(this.size>> +2);for(f=0;f>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},la:function(a,b){a&1&&I(this.g,b,64);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},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ua=!0},H:function(a,b){return this.J(a,b)},V:function(a,b){return this.cc(a,b)},ya:function(a,b,c){this.l?this.h(a,b,c):this.Pb(a,b,c)},ta:function(a,b,c){this.l?this.h(a,b,c):this.ic(a,b,c)},D:function(a){return this.j[a]},K:function(a){return this.j[a]},U:function(a,b){a&1&&I(this.g,b,64);return this.c.getUint16(a,!0)},ka:function(a,b){a&1&&I(this.g,b,64);return this.s[a>>1]},xa:function(a,b){this.j[a]=b;this.ua=!0},za:function(a,b){this.j[a]=b;this.ua=!0},sa:function(a,b,c){a&1&&I(this.g, +c,64);this.c.setUint16(a,b,!0);this.ua=!0},Aa:function(a,b,c){a&1&&I(this.g,c,64);this.s[a>>1]=b;this.ua=!0}};function Gb(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.m=c.m)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.m||(a.yb=!a.l&&b[1]||a.h,a.zb=!a.l&&b[3]||a.w);if(c||void 0===c)a.Pb=b[1]||a.h,a.ic=b[3]||a.w}function sc(a,b,c){c&&a.i||(a.Lb=b[0]||a.v,a.Y=b[2]||a.B);if(c||void 0===c)a.J=b[0]||a.v,a.cc=b[2]||a.B}function mc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} +var vc=[],pc=[H.prototype.N,H.prototype.ra,H.prototype.la,H.prototype.Ba],tc=[H.prototype.H,H.prototype.ya,H.prototype.V,H.prototype.ta];if(Za)var oc=[H.prototype.D,H.prototype.xa,H.prototype.U,H.prototype.sa],nc=[H.prototype.K,H.prototype.za,H.prototype.ka,H.prototype.Aa]; +function wc(a,b){y.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Bb=0;this.pb=b;this.sa=c;this.Ab=Math.round(this.pb/1E4)/100;this.La=this.Ab*this.sa;this.o.T=!1;this.o.Nb=!1;this.o.eb=a.autoStart;this.o.sb=!1;this.nb=this.Ma=0;this.ob=a.csStart;this.Za=a.csInterval;this.$a=a.csStop;this.N=[];this.ac=this.Sd.bind(this);F(this)}A(wc);var xc=["power","reset"];h=wc.prototype; +h.ga=function(a,b,c,d){this.l=a;this.g=b;this.G=d;this.B=a.B;for(b=0;b=a.Ma&&(a.Ma+=a.Za,c=!0);0<=a.$a&&a.$a<=Bc(a)&&(a.Za=a.$a=-1,Ac(a),G(a),c=!0);c&&a.X(Bc(a)+" cycles: checksum="+r(a.nb))}} +h.ba=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.R)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Ba/a.La&&(b=1);a.sa=b;b=a.Ab*a.sa;if(a.La!=b){a.La=b;b=a.La.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.X("target speed: "+b)}c&&a.l&&Ec(a.l)}qb(a,a.la);a.la=0;a.ka=qa();a.za=0;Dc(a)}function Wb(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.N[b][0])&&(c=a.pb*a.sa/1E3*c|0,a.o.T&&(c+=Fc(a)),a.N[b][0]=c)} +function pb(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 Fc(a,b){var c=a.ra-=a.a;a.a=a.K=0;b&&(a.ra=0);return c} +h.Sd=function(){if(this.o.T){this.Eb>=this.pb&&Dc(this,!0);this.bb=0;this.mb=qa();if(this.za){var a=this.mb-this.za;a>this.Yb&&(this.ka+=a,this.ka>this.mb&&(this.ka=this.mb))}try{do{for(var b,c=this.o.sb?1:this.qb,d=this.N.length-1;0<=d;d--){var e=this.N[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.bb+=b;this.la+=b;rb(this,b);pb(this,b);this.ab-=b;if(0>=this.ab){this.ab+=this.qb;15<=++this.Zb&&(this.wa(),this.Zb=0);break}}while(this.o.T)}catch(f){G(this); +this.l&&this.l.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.T){a=setTimeout;b=this.ac;this.za=qa();c=this.Yb;this.bb&&(c=Math.round(c*this.bb/this.qb));c-=this.za-this.mb;if(d=this.za-this.ka)this.Ba=Math.round(this.la/(10*d))/100,864E5<=d&&(this.ta=0,Cc(this));if(0>c||this.Bac&&(this.ka-=c),c=0;this.Eb+=this.bb;this.za+=c;a(b,c)}}}; +function ob(a){var b;a.o.error?(a.X(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.T)a.X(a.toString()+" busy");else{Cc(a);a.o.T=!0;a.o.Nb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.ka,Bc(a));setTimeout(a.ac,0)}}h.xb=function(){return 0};function G(a){var b=!1;if(a.o.T){Fc(a);qb(a,a.la);a.la=0;a.o.T=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(qa(),Bc(a));b=!0}a.o.complete=void 0;return b} +function Gc(a){this.Ra=+a.model||1170;this.Ub=a.addrReset||0;wc.call(this,a,6666667);this.rb=0;this.Wb=255;1120==this.Ra?(this.decode=Hc.bind(this),this.Aa=this.Bc,this.rb=8,this.Wb=-1):(this.decode=Ic.bind(this),this.Aa=this.Cc);Jc(this);this.Na=0;this.J=null;this.o.complete=!1}A(Gc,wc);h=Gc.prototype;h.reset=function(){this.status("model "+this.Ra);this.o.T&&G(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; +function Jc(a){a.m=65536;a.h=32768;a.i=65535;a.s=32768;a.F=15;a.f=[0,0,0,0,0,0,0,a.Ub,-1,-2,-3,-4,-5,-6,-7,-8];a.Ka=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.v=0;a.lb=0;a.Jc=[4,2,0,1];a.I=[[0,0,0,0,0,0,0,0,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,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.da=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0]];a.ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.fc=[0,0,0,0,0,0,0,0];a.ec=0;a.u=0;a.D=a.H=0;a.c=a.b=a.Db=0;a.Oa=-1;nb(a)}function nb(a){a.aa=0;a.Gb=0;a.Ib=0;a.Ea=0;a.Z=0;a.wb=0;a.hb=255;a.Xa=0;a.kb=0;a.Ya=262143;a.cb=0;a.w=0;a.J=null;a.g&&(cc(a),a.Hc=Sb(a.g))}function cc(a){a.Xa?(a.V=65536,a.Cb=a.Ea&16?4186112:253952,a.U=a.Fc,a.Y=a.Pd,a.zb=a.Ne,Kb(a.g,a.Ea&16?22:18)):(a.V=0,a.Cb=57344,a.U=a.Ec,a.Y=a.dc,a.zb=a.jc,Kb(a.g,16))} +function bc(a,b){b&=-3073;if(a.aa!=b){b&57344&&!(a.aa&57344)&&(a.Gb=a.w>>16&65535,a.Ib=a.w&65535);a.aa=b;a.kb=b>>5&3;a.lb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Xa!=c&&(a.Xa=c,cc(a))}}h.Xb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ta,this.sa]);a.set(2,Rb(this.g));return a.data()}; +h.restore=function(a){var b=a[1];this.ta=b[1];Cc(this,b[3]);a:{b=this.g;a=a[2];var c;for(c=0;c>14&3;c=a.F>>14&3;a.v!=c&&(a.qa[c]=a.f[6],a.f[6]=a.qa[a.v]);a.F=b;a.u&=-3;a.u|=a.J?2:1}function R(a,b){a.u&256||(a.s=a.i=b,a.h=0)} +function Oc(a,b,c){a.u&256||(a.s=a.i=a.m=b,a.h=c||0)}function Pc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.h=(c^b)&(d^b))}function Qc(a,b){a.u&256||(a.s=a.i=a.m=b,a.h=a.s^a.m>>1)}function Rc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.h=(c^d)&(d^b))} +function J(a,b,c,d){if(!a.Na){0>a.Oa?a.Oa=dc(a):a.v||(d=-3);var e=!1;-3==d&&(b=4,a.Z|=4,a.f[6]=4,e=!0);a.w=b|4143316992;a.v=0;var f=a.Y(b|a.V),g=a.Y(b+2&65535|a.V);ec(a,g&-12289|a.Oa>>2&12288);Sc(a,a.Oa,e);Sc(a,a.f[7],e);Q(a,f);a.a-=5;a.u&=~(c|19);a.u|=129;a.Oa=-1;if(-3<=d)throw b;}}function Tc(a){var b=Uc(a),c=Uc(a)&-1793;a.F&49152&&(c=c&-225|a.F&63712);Q(a,b);ec(a,c);a.u&=-17}function Vc(a,b){if(3932160<=b){var c=b>>13&31;31>c&&(b=a.Ea&32?a.ib[c]+(b&8190)&4194302:b&-3932161)}return b} +function vb(a,b,c){var d,e,f;if(!(c&a.Xa))return f=b&65535,57344<=f&&(f|=a.Cb),f;d=b>>13;a.Ea&a.Jc[a.v]||(d&=7);e=a.I[a.v][d];f=(a.da[a.v][d]<<6)+(b&8191)&a.Ya;3932160<=f&&(f=Vc(a,f));if(a.Na)return f;f>=a.Hc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& +(g|=16384));a.I[a.v][d]=e;if(f!=(4194170&a.Ya)||a.v)a.kb=a.v,a.lb=d;g&&(g&57344&&(0<=a.Oa&&(g|=128),a.aa&57344||(g|=a.aa&4096|a.kb<<5|a.lb<<1,bc(a,a.aa&-61695|g&61694)),J(a,168,64,-1)),a.aa&61440||!(f<(4191360&a.Ya)||f>(4194239&a.Ya))||(a.aa|=4096,a.aa&512&&(a.u|=64)));return f}function Uc(a){var b=a.Y(a.f[6]|a.V);a.f[6]=a.f[6]+2&65535;return b}function Sc(a,b,c){var d=a.f[6]-2&65535;a.f[6]=d;a.w=a.w&65535|(a.w&-65536)<<8|16121856;c||a.Aa(4,-2,d);a.zb(d,b)} +function Wc(a,b,c,d){var e,f,g=d&8?0:a.V;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.Aa(d,0,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];6==c&&a.Aa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.Y(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;6==c&&a.Aa(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.Y(e)|g;a.a-=8;break;case 6:return e=a.Y(Mc(a,2)),e=e+a.f[c]&65535,6==c&&a.Aa(d,0, +e),a.a-=6,e|g;case 7:return e=a.Y(Mc(a,2)),e=e+a.f[c]&65535,e=a.Y(e|a.V),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.w=a.w&65535|(a.w&-65536)<<8|(f<<3&248|c)<<16;return e}h.Bc=function(a,b,c){!this.v&&0>=b&&c<=this.hb&&(this.u|=32)};h.Cc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.hb&&(c<=this.hb-32?J(this,4,0,-3):(this.Z|=8,this.u|=32)))};h.Ec=function(a,b,c){a=Wc(this,a,b,c);3932160<=a&&(a=Vc(this,a));return a};h.Fc=function(a,b,c){return vb(this,Wc(this,a,b,c),c)}; +h.dc=function(a){3932160<=a&&(a=Vc(this,a));return Ob(this.g,this.cb=a)};h.Pd=function(a){return Ob(this.g,this.cb=vb(this,a,2))};h.jc=function(a,b){3932160<=a&&(a=Vc(this,a));Qb(this.g,this.cb=a,b&65535)};h.Ne=function(a,b){Qb(this.g,this.cb=vb(this,a,4),b)};function Xc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Wc(a,b,d,2),c&65536||61440!==(a.F&61440)&&(d&=65535),a.v=a.F>>12&3,c=a.Y(d|c&a.V),a.v=a.F>>14&3):c=6!=d||(a.F>>2&12288)===(a.F&12288)?a.f[d]:a.qa[a.F>>12&3];return c} +function Yc(a,b,c,d){a.w=a.w&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Wc(a,b,e,4),c&65536||(e&=65535),a.v=a.F>>12&3,e=vb(a,e|c&65536,4),a.v=a.F>>14&3,Qb(a.g,e,d)):6!=e||(a.F>>2&12288)===(a.F&12288)?a.f[e]=d:a.qa[a.F>>12&3]=d}function Zc(a,b){b>>=6;var c=a.H=b&7;(b=a.D=(b&56)>>3)?(c=a.U(b,c,3),a=Nb(a.g,c)):a=a.f[c+a.rb]&a.Wb;return a}function $c(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?Ob(a.g,a.U(b,c,2)):a.f[c+a.rb]} +function ad(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Wc(a,b,c,8)}function bd(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.U(b,c,3),a=Nb(a.g,c)):a=a.f[c]&255;return a}function cd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Ob(a.g,a.U(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Db=a.U(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Nb(a.g,e)),e&1&&a.a--,a=a.g,a.h[(e&a.i)>>>a.b].yb(e&a.l,c&255,e)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))} +function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.U(b,e,6),Qb(a.g,e,d.call(a,0>c?a.f[-c-1]:c,Ob(a.g,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function dd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.U(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,a=a.g,a.h[(d&a.i)>>>a.b].yb(d&a.l,e&255,d)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c} +function ed(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.U(b,d,4),Qb(a.g,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c}function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} +h.xb=function(a){this.o.complete=!0;var b=a?this.o.Nb?0:1:-1;this.o.Nb=!1;this.ra=this.a=a;do{if(this.u){if(a=this.u&11){a=!1;if(this.u&2){var c=160,d=(this.wb&224)>>5,e=this.J&&this.J.Sa>d?this.J:null;e&&(c=e.Ud,d=e.Sa);d>(this.F&224)>>5?(this.u&8&&(Mc(this,2),this.u&=-9),J(this,c,0,-9),d=!0):d=!1;d&&(e&&ac(this,e),a=!0);this.J||this.wb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Nc(this)&&0>b)break}this.u=this.u&15|this.F&16;this.decode(Lc(this))}while(0>1|b<<16;Qc(this,a);return a&65535} +function kd(a,b){a=b&128|b>>1|b<<8;Qc(this,a<<8);return a&255}function ld(a,b){a=b&~a;R(this,a);return a}function md(a,b){a=b&~a;R(this,a<<8);return a}function nd(a,b){a|=b;R(this,a);return a}function od(a,b){a|=b;R(this,a<<8);return a}function pd(a,b){a=~b|65536;Oc(this,a);return a&65535}function qd(a,b){a=~b|256;Oc(this,a<<8);return a&255}function rd(a,b){a=b-a;this.u&256||(this.s=this.i=a,this.h=b&(b^a));return a&65535} +function sd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&256||(this.s=this.i=c,this.h=b&(b^c));return a&255}function td(a,b){a=b+a;this.u&256||(this.s=this.i=a,this.h=a&(b^a));return a&65535}function ud(a,b){a=b+a;var c=a<<8;this.u&256||(this.s=this.i=c,this.h=c&(b<<8^c));return a&255}function vd(a,b){a=-b;Oc(this,a,a&b&32768);return a&65535}function wd(a,b){a=-b;Oc(this,a<<8,(a&b&128)<<8);return a&255}function xd(a,b){a=b<<1|this.m>>16&1;Qc(this,a);return a&65535} +function yd(a,b){a=b<<1|this.m>>16&1;Qc(this,a<<8);return a&255}function zd(a,b){a=(this.m&65536|b)>>1|b<<16;Qc(this,a);return a&65535}function Ad(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Qc(this,a<<8);return a&255}function Bd(a,b){var c=b-a;Rc(this,c,a,b);return c&65535}function Cd(a,b){var c=b-a;Rc(this,c<<8,a<<8,b<<8);return c&255}function Dd(a,b){this.u&256||(this.s=this.i=b&65280,this.h=this.m=0);return(b<<8|b>>8)&65535}function Ed(a,b){a^=b;R(this,a);return a&65535} +function Fd(a){U(this,a,$c(this,a),fd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Gd(a){var b=cd(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.h=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.h=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} +function Hd(a){var b=cd(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.h=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Id(a){V(this,a,!P(this))}function Jd(a){V(this,a,P(this))} +function Kd(a){U(this,a,$c(this,a),ld);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Ld(a){S(this,a,Zc(this,a),md);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Md(a){U(this,a,$c(this,a),nd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function Nd(a){S(this,a,Zc(this,a),od);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)} +function Od(a){var b=$c(this,a);a=cd(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function Pd(a){var b=Zc(this,a);a=bd(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function Qd(a){V(this,a,this.i&65535?0:4)}function Rd(a){V(this,a,!Kc(this)==!(this.h&32768))}function Sd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.h&32768))} +function Td(a){V(this,a,!P(this)&&!!(this.i&65535))}function Ud(a){V(this,a,(this.i&65535?0:4)||!Kc(this)!=!(this.h&32768))}function Vd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Wd(a){V(this,a,!Kc(this)!=!(this.h&32768))}function Xd(a){V(this,a,Kc(this))}function Yd(a){V(this,a,!!(this.i&65535))}function Zd(a){V(this,a,!Kc(this))}function $d(){J(this,12,0,-8)}function ae(a){V(this,a,!0)}function be(a){V(this,a,!(this.h&32768))}function ce(a){V(this,a,this.h&32768?2:0)} +function W(a){a&1&&(this.m=0);a&2&&(this.h=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function de(a){var b=$c(this,a);a=cd(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Rc(this,c,a,b);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)}function ee(a){var b=Zc(this,a);a=bd(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Rc(this,c,a,b);this.a-=this.c?4+(this.H&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)} +function fe(a){var b=cd(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.h=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.h=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.h=32768,this.m=65536,this.a-=7}function ge(){J(this,24,0,-8);this.a-=20} +function he(){this.F&49152?(this.Z|=128,J(this,4,0,-7)):(this.B&&1120==this.Ra&&this.B.setData(this.f[0],!0),this.G?this.G.b():G(this));this.a-=7}function ie(){J(this,16,0,-8);this.a-=20}var je=[0,7,7,10,7,11,9,13];function ke(a){this.K=this.a;Q(this,ad(this,a));this.a=this.K-je[this.c]}var le=[0,14,14,17,14,18,16,20];function me(a){this.K=this.a;var b=ad(this,a);a=a>>6&7;Sc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.K-le[this.c]}var ne=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function oe(a){var b=$c(this,a);this.K=this.a;R(this,ed(this,a,b));this.a=this.K-ne[(this.D?8:0)+this.c]+(7!=this.b||this.c?0:2)}function pe(a){var b=Zc(this,a);R(this,dd(this,a,b,65535)<<8);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}var qe=[7,13,13,17,14,18,17,21]; +function re(a){var b=cd(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.u&256||(this.s=b>>16,this.i=this.s|b,this.h=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function xe(a){U(this,a,$c(this,a),Bd);this.a-=this.c?9+(this.H&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)}function ye(a){U(this,a,0,Dd);this.a-=this.c?9:3+(7==this.b?2:0)}function ze(){J(this,28,0,-8)} +function Ae(){this.B&&(this.B.ja=this.f[7],this.B.setData(this.f[0],!0));this.u|=8;Mc(this,-2);this.a-=3}function Be(a){U(this,a,this.f[(a>>6&7)+this.rb],Ed);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Hc(a){Ce[a>>12].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a>>6&3].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a>>6&3].call(this,a)} +function Pe(a){Qe[a>>6&3].call(this,a)}function Re(a){Se[a>>6&3].call(this,a)} +var Ce=[function(a){Te[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,Fd,Y,function(a){Ue[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,xe,Y],Te=[function(a){Ve[a>>4&15].call(this,a)},ae,Yd,Qd,Rd,Wd,Sd,Ud,me,me,De,Fe,He,Y,Y,Y],Ee=[function(a){Oc(this,ed(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0, +vd);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=cd(this,a);Oc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ie=[function(a){U(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,jd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)}], +Ve=[function(a){We[a&15].call(this,a)},Y,Y,Y,ke,ke,ke,ke,ue,Y,Je,Le,ye,ye,ye,ye],We=[he,Ae,ve,$d,ie,te,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ke=[se,function(){this.m=0;this.a-=5},function(){this.h=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Me=[se,function(){this.m=65536;this.a-=5},function(){this.h=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ue=[Zd,Xd,Td,Vd,be,ce,Id,Jd,ge,ze,Ne,Pe,Re,Y,Y,Y],Oe=[function(a){Oc(this, +dd(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)}],Qe=[function(a){S(this,a,0,wd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bd(this,a);Oc(this,a<<8);this.a-=this.c?4:3+(7== +this.b?2:0)}],Se=[function(a){S(this,a,0,Ad);this.a-=this.c?9+(this.Db&1):3+(7==this.b?2:0)},function(a){S(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,kd);this.a-=this.c?9+(this.Db&1):3+(7==this.b?2:0)},function(a){S(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Xe[a>>12].call(this,a)} +var Xe=[function(a){Ye[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,Fd,function(a){Ze[a>>8&15].call(this,a)},function(a){$e[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,xe,Y],Ye=[function(a){af[a>>4&15].call(this,a)},ae,Yd,Qd,Rd,Wd,Sd,Ud,me,me,De,Fe,He,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.Y(a|this.V);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Xc(this,a,0);Sc(this,a);R(this,a);this.a-=11},function(a){var b=Uc(this);this.K= +this.a;Yc(this,a,0,b);R(this,b);this.a=this.K-qe[this.c]},function(a){R(this,ed(this,a,Kc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],af=[function(a){cf[a&15].call(this,a)},Y,Y,Y,ke,ke,ke,ke,ue,function(a){a&8?(this.F&49152||(this.F=this.F&-2017|(a&7)<<5,this.u|=1,this.u&=-3),this.a-=5):J(this,8,0,-8)},Je,Le,ye,ye,ye,ye],cf=[he,Ae,function(){Tc(this);this.u|=this.F&16;this.a-=13},$d,ie,te,ve,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ze=[re,re,fe,fe,Gd,Gd,Hd,Hd,Be,Be,Y,Y,Y,Y,we,we],$e=[Zd, +Xd,Td,Vd,be,ce,Id,Jd,ge,ze,Ne,Pe,Re,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[Y,function(a){a=Xc(this,a,65536);Sc(this,a);R(this,a);this.a-=11},function(a){var b=Uc(this);this.K=this.a;Yc(this,a,65536,b);R(this,b);this.a=this.K-qe[this.c]},Y]; +function ef(a){y.call(this,"ROM",a,ef,128);this.ca=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.h=a.alias;this.l=a.file;this.s=t(this.l);if(this.l){a=this.l;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.ya,a,b),(a=sa(a,b))?(c.c=a.O,c.ca=a.ca):c.l=null);ff(c)})}}A(ef);h=ef.prototype; +h.ga=function(a,b,c,d){this.g=b;this.a=c;this.G=d;ff(this)};h.ia=function(){this.ca&&(this.G&&this.G.a(this.id,this.i,this.b,this.ca),delete this.ca);return!0};h.ha=function(){return!0}; +function ff(a){if(!Xa(a)){if(a.l){if(!a.c||!a.g)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Bb){var c={};b=(c[b]=[ef.prototype.Dd,ef.prototype.Be,null,null,null,a.b>>1],c);if(eb(a.g,a,b)){b=a.m=!0;break a}}else if(Hb(a.g,b,a.b,lc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)Pb(a.g,p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Qb&&c<=m.wc&&(b=c-(m.Qb-m.kc));b&&(a.preventDefault&&a.preventDefault(),d.vb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.mc&&(b=m.lc);d.vb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& +a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.vb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; +h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;var e=this;this.V=Zb(48,4,262144);this.N=Wb(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.U&&97<=a&&122>a&&(a-=32),Yb(e.a,e.N,1E3/Math.round(e.H/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&Xb(c,e.V))});this.D=Zb(52,4,262144);this.la=Wb(this.a,function(){e.c|=128;e.c&64&&Xb(c,e.D)});eb(b,this,mf);gb(b,this.reset.bind(this));F(this)}; +h.$b=function(){if(!this.v){var a=yc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.xa)return;b=oa(b[1]);if(this.v=Ua(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.w=d.receiveData){this.status(this.ya+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ia=function(a,b){if(!b)if(this.$b(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.ha=function(a){return a?this.save():!0};h.reset=function(){nf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return nf(this)};function nf(a){a.B=0;a.b=0;a.c=128;a.s=[];return!0}h.vb=function(a){if("number"==typeof a)this.s.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.K||8,c=a-this.m%a,this.K&&(b=" ".slice(0,c)));this.J&&!this.m&&c&&(b=String.fromCharCode(this.J)+b);this.h.value+=b;this.h.scrollTop=this.h.scrollHeight;this.m+=c}}else if(null!=this.i){if(10==a|| +1024<=this.i.length)this.X(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Yb(this.a,this.la,1E3/Math.round(this.ka/10));this.c&=-129};var of={},mf=(of[65392]=[null,null,Z.prototype.qd,Z.prototype.oe,"RCSR"],of[65394]=[null,null,Z.prototype.pd,Z.prototype.ne,"RBUF"],of[65396]=[null,null,Z.prototype.Rd,Z.prototype.Pe,"XCSR"],of[65398]=[null,null,Z.prototype.Qd,Z.prototype.Oe,"XBUF"],of); +Ia(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.j[b]=c,c.onclick= +function(){var a=d.j.listTapes;a&&rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.H){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;rf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1}; +h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;this.N=sf(a);var e=this;if((this.c=yc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){x("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.J=Zb(56,4,4096);this.V=Wb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.Bc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.R;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.ya,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.O,e.na,e.ma)); +a.o.Ga=!1;a.m&&(a.m--,a.m||F(a));yf(a)})}function vf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.P);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.tb?"":e)+"&format=json"));return!!w(f, +null,!0,function(b,c,d){If(a,b,c,d)})} +function If(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.R;if(d)a.controller.C('Unable to load disk "'+a.oa+'" (error '+d+": "+b+")",f);else{Ta(a.controller.ya,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ +c+")");if(k.length)if(1==k.length)x(k[0]);else{a.P=k.length;a.S=k[0].length;a.M=k[0][0].length;var l=k[0][0][0];a.W=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var T=n<<2,Aa=v.length;Aa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.fa?f=a.pa+a.fa&&(a.fa+=f-(a.pa+a.fa)+1):(a.pa=f,a.fa=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ +function Lf(a,b){var c=a.S*a.M,d=b/c|0;return dg)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.oa+": "+c);return b}; -h.toJSON=function(){var a;a=0;for(var b;b=Jf(this,a++);)Mf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; -function Mf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){y.call(this,"RK11",a,N,65536);this.v=a.autoMount||{};this.l=0;this.c=Array(8);this.B=!za("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; -h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Nf(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Of(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.L)?(a=Ca(Lf(a),a.Ob.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Of(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ga=function(a,b,c,d){this.m=a;this.g=b;this.a=c;this.G=d;if((a=wc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.v[e]=a[e]);Pf(this);this.Ra=Xb(144,5,65536);eb(b,this,Qf);gb(b,this.reset.bind(this));Rf(this,"None","",!0);this.B&&Rf(this,"Local Disk","?");Rf(this,"Remote Disk","??");Sf(this)||F(this)}; -h.ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Nf(this,0)}}return!0};h.ha=function(a){return a?this.save():!0};h.reset=function(){Pf(this)};h.save=function(){return(new O(this)).data()}; -h.restore=function(a){return Pf(this,a[0])};function Sf(a,b){b||(a.l=0);for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}Uf(a,e,b,c,!1,d)}else Tf(a,e)} -function Uf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Tf(a,b,!0),k.Ha?a.C("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.l++),k.za=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.sc)&&g++));return g} -h.sc=function(a,b,c,d,e){var f;a.Ha=!1;b&&(f=If(b),b&&f[0]>a.P||f[1]>a.T)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.L=b,a.oa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.m&&Cc(this.m)):a.za=!1;a.Ga&&(a.Ga=!1,--this.l||F(this));Nf(this,a.Ia)}; -function Rf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.s=65536-e&65535;a&&(this.i=this.i|a|32768,this.A|=49152);return!0}; -h.tc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){if(!n){n=a.L.seek(b,c,d+1);if(!n){k=4096;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){k=32;break}this.g.Xa(f,u|v<<8);if(Tb(this.g)){k=1024;break}f+=2;if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.T&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)}; -h.uc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){var u=this.g.Qa(f);if(Tb(this.g)){k=1024;break}f+=2;if(!n){n=a.L.seek(b,c,d+1,!0);if(!n){k=4096;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){k=32;break}if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.T&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)};h.yd=function(){return this.w};h.we=function(){};h.zd=function(){return this.i};h.xe=function(){};h.vd=function(){return this.A&61438}; -h.te=function(a){this.A=this.A&-3968|a&3967;if(this.A&1){var b,c=!0;a=(this.b&57344)>>13;var d=this.c[a],e,f,g,k;this.A&=-129;switch(this.A&14){case 0:this.w=d.status;this.i=0;this.A=128;this.b=0;break;case 4:b=this.tc;case 2:b||(b=this.uc),e=(this.b&8160)>>5,f=(this.b&16)>>4,g=this.b&15,e>=d.P?(this.i|=32832,this.A|=49152):g>=d.O?(this.i|=32800,this.A|=49152):(k=(this.A&48)<<12|this.h,c=65536-this.s&65535,c=b.call(this,d,e,f,g,c,k,this.rc.bind(this)))}this.w=d.status|a<<13|this.b%9&15;c&&(this.A&= --2,this.A|=128,this.A&64&&Vb(this.a,this.Ra))}};h.Ad=function(){return this.s};h.ye=function(a){this.s=a};h.ud=function(){return this.h};h.se=function(a){this.h=a};h.wd=function(){return this.b};h.ue=function(a){this.b=a};h.xd=function(){return this.D};h.ve=function(a){this.D=a}; -var Vf={},Qf=(Vf[65280]=[null,null,N.prototype.yd,N.prototype.we,"RKDS"],Vf[65282]=[null,null,N.prototype.zd,N.prototype.xe,"RKER"],Vf[65284]=[null,null,N.prototype.vd,N.prototype.te,"RKCS"],Vf[65286]=[null,null,N.prototype.Ad,N.prototype.ye,"RKWC"],Vf[65288]=[null,null,N.prototype.ud,N.prototype.se,"RKBA"],Vf[65290]=[null,null,N.prototype.wd,N.prototype.ue,"RKDA"],Vf[65294]=[null,null,N.prototype.xd,N.prototype.ve,"RKDB"],Vf); +h.toJSON=function(){var a;a=0;for(var b;b=Lf(this,a++);)Of(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; +function Of(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){y.call(this,"RK11",a,N,65536);this.v=a.autoMount||{};this.m=0;this.c=Array(8);this.B=!za("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; +h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Pf(d,a)},!0;case "loadDrive":return this.j[b]= +c,c.onclick=function(){var a=d.j.listDisks;a&&Qf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.L)?(a=Ca(Nf(a),a.Mb.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;if((a=yc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.v[e]=a[e]);Rf(this);this.Pa=Zb(144,5,65536);eb(b,this,Sf);gb(b,this.reset.bind(this));Tf(this,"None","",!0);this.B&&Tf(this,"Local Disk","?");Tf(this,"Remote Disk","??");Uf(this)||F(this)}; +h.ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Pf(this,0)}}return!0};h.ha=function(a){return a?this.save():!0};h.reset=function(){Rf(this)};h.save=function(){return(new O(this)).data()}; +h.restore=function(a){return Rf(this,a[0])};function Uf(a,b){b||(a.m=0);for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wf(a,e,b,c,!1,d)}else Vf(a,e)} +function Wf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Vf(a,b,!0),k.Ia?a.C("RK11 busy"):(k.Ia=!0,e&&(k.Ha=!0,a.m++),k.va=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.pc)&&g++));return g} +h.pc=function(a,b,c,d,e){var f;a.Ia=!1;b&&(f=Kf(b),b&&f[0]>a.P||f[1]>a.S)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ja)),b=null);b?(a.L=b,a.oa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ja),a.Ha||e),this.l&&Ec(this.l)):a.va=!1;a.Ha&&(a.Ha=!1,--this.m||F(this));Pf(this,a.Ja)}; +function Tf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.s=65536-e&65535;a&&(this.i=this.i|a|32768,this.A|=49152);return!0}; +h.qc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){if(!n){n=a.L.seek(b,c,d+1);if(!n){k=4096;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){k=32;break}ub(this.g,Vc(this.a,f),u|v<<8);if(Vb(this.g)){k=1024;break}f+=2;if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)}; +h.rc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=128,e=0);for(;e--;){var u=wb(this.g,Vc(this.a,f));if(Vb(this.g)){k=1024;break}f+=2;if(!n){n=a.L.seek(b,c,d+1,!0);if(!n){k=4096;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){k=32;break}if(p>=l.W&&(n=null,++d>=l.M&&(d=0,++c>=l.S&&(c=0,++b>=l.P)))){k=64;break}}return g(k,b,c,d,e,f)};h.vd=function(){return this.w};h.te=function(){};h.wd=function(){return this.i};h.ue=function(){};h.sd=function(){return this.A&61438}; +h.qe=function(a){this.A=this.A&-3968|a&3967;if(this.A&1){var b,c=!0;a=(this.b&57344)>>13;var d=this.c[a],e,f,g,k;this.A&=-129;switch(this.A&14){case 0:this.w=d.status;this.i=0;this.A=128;this.b=0;break;case 4:b=this.qc;case 2:b||(b=this.rc),e=(this.b&8160)>>5,f=(this.b&16)>>4,g=this.b&15,e>=d.P?(this.i|=32832,this.A|=49152):g>=d.M?(this.i|=32800,this.A|=49152):(k=(this.A&48)<<12|this.h,c=65536-this.s&65535,c=b.call(this,d,e,f,g,c,k,this.oc.bind(this)))}this.w=d.status|a<<13|this.b%9&15;c&&(this.A&= +-2,this.A|=128,this.A&64&&Xb(this.a,this.Pa))}};h.xd=function(){return this.s};h.ve=function(a){this.s=a};h.rd=function(){return this.h};h.pe=function(a){this.h=a};h.td=function(){return this.b};h.re=function(a){this.b=a};h.ud=function(){return this.D};h.se=function(a){this.D=a}; +var Xf={},Sf=(Xf[65280]=[null,null,N.prototype.vd,N.prototype.te,"RKDS"],Xf[65282]=[null,null,N.prototype.wd,N.prototype.ue,"RKER"],Xf[65284]=[null,null,N.prototype.sd,N.prototype.qe,"RKCS"],Xf[65286]=[null,null,N.prototype.xd,N.prototype.ve,"RKWC"],Xf[65288]=[null,null,N.prototype.rd,N.prototype.pe,"RKBA"],Xf[65290]=[null,null,N.prototype.td,N.prototype.re,"RKDA"],Xf[65294]=[null,null,N.prototype.ud,N.prototype.se,"RKDB"],Xf); function M(a){y.call(this,"RL11",a,M,131072);this.B=a.autoMount||{};this.v=0;this.c=Array(4);this.w=!za("Mobi")&&window&&"FileReader"in window}A(M);h=M.prototype; -h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Wf(d,a)},!0;case "loadDrive":return this.j[b]= -c,c.onclick=function(){var a=d.j.listDisks;a&&Xf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.w){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.L)?(a=Ca(Lf(a),a.Ob.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.w)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= -!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; -h.ga=function(a,b,c,d){this.m=a;this.g=b;this.a=c;this.G=d;if((a=wc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.B[e]=a[e]);Yf(this);this.Ra=Xb(112,5,131072);eb(b,this,Zf);gb(b,this.reset.bind(this));$f(this,"None","",!0);this.w&&$f(this,"Local Disk","?");$f(this,"Remote Disk","??");ag(this)||F(this)}; -h.ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Wf(this,0)}}return!0};h.ha=function(a){return a?this.save():!0};h.reset=function(){Yf(this)};h.save=function(){return(new O(this)).data()}; -h.restore=function(a){return Yf(this,a[0])};function ag(a,b){b||(a.v=0);for(var c in a.B){var d=a.B[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}cg(a,e,b,c,!1,d)}else bg(a,e)} -function cg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,bg(a,b,!0),k.Ha?a.C("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.v++),k.za=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.wc)&&g++));return g} -h.wc=function(a,b,c,d,e){var f;a.Ha=!1;b&&(f=If(b),b&&f[0]>a.P||f[1]>a.T)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.L=b,a.oa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.m&&Cc(this.m)):a.za=!1;a.Ga&&(a.Ga=!1,--this.v||F(this));Wf(this,a.Ia)}; -function $f(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.l=f>>16&63;this.i=this.b=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.A=this.A|a|32768);return!0}; -h.xc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.L.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){k=5120;break}this.g.Xa(f,u|v<<8);if(Tb(this.g)){k=8192;break}f+=2;if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.T&&(c=0,++b>=l.P)))){k=5120;break}}return g(k,b,c,d,e,f)}; -h.yc=function(a,b,c,d,e,f,g){var k=0,l=a.L,n=null,p;l||(k=5120,e=0);for(;e--;){var u=this.g.Qa(f);if(Tb(this.g)){k=8192;break}f+=2;if(!n){n=a.L.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){k=5120;break}if(p>=l.W&&(n=null,++d>=l.O&&(d=0,++c>=l.T&&(c=0,++b>=l.P)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Dd=function(){return this.A&65535}; -h.Be=function(a){this.A=this.A&-1023|a&1022;this.l=this.l&60|(a&48)>>4;if(!(this.A&128)){var b;a=!0;var c=this.c[(this.A&768)>>8],d,e,f,g;this.A&=-2;switch(this.A&14){case 4:this.b&8&&(this.A&=63);this.s=c.status|this.i&64;break;case 6:1==(this.b&3)&&(b=this.b&65408,c=(this.b&16)<<2,this.i=this.b&4?this.i+b:this.i-b,this.b=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.xc;case 10:b||(b=this.yc),d=this.b>>7,e=this.b&64?1:0,f=this.b&63,d>=c.P||f>=c.O?this.A|=37888:(g=(this.l& -63)<<16|this.h,a=65536-this.s&65535,a=b.call(this,c,d,e,f,a,g,this.vc.bind(this)))}a&&(this.A|=129,this.A&64&&Vb(this.a,this.Ra))}};h.Bd=function(){return this.h};h.ze=function(a){this.h=a&65534};h.Ed=function(){return this.b};h.Ce=function(a){this.b=a};h.Fd=function(){return this.s};h.De=function(a){this.s=a};h.Cd=function(){return this.l};h.Ae=function(a){this.l=a&63;this.A=this.A&-49|(this.l&3)<<4}; -var dg={},Zf=(dg[63744]=[null,null,M.prototype.Dd,M.prototype.Be,"RLCS"],dg[63746]=[null,null,M.prototype.Bd,M.prototype.ze,"RLBA"],dg[63748]=[null,null,M.prototype.Ed,M.prototype.Ce,"RLDA"],dg[63750]=[null,null,M.prototype.Fd,M.prototype.De,"RLMP"],dg[63752]=[null,null,M.prototype.Cd,M.prototype.Ae,"RLBE"],dg); -function eg(a,b,c){y.call(this,"Computer",a,eg,33554432);this.o.S=!1;fg(this,b);this.w=wc(this,"autoPower",a);this.m=0;this.M=a.busWidth||a.buswidth;this.b=gg;this.s=null;this.i=this.J=!1;this.R=wc(this,"url")||"";(Math.random()+.1).toString(36);this.c=hg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.g=new xb({id:this.ta+".bus",busWidth:this.M},this.a,this.G);var d,e=B(this.id);if((this.B=Va("Panel",this.id))&&this.B.hb)for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bgg){if(ig(d,this.s)){this.h=new O(this,"1.30.5","failsafe");ig(this.h)&&(ng(this,d),a=2,og(this.h));this.h.set("timestamp",ra());pg(this.h);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=mg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ig(d,g):("error"== -f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(ya("user",""),this.c=null)):this.X(f+": "+g),og(d),ig(d)?(c=mg(d),e=!0):c=!1))}e&&lg(this,c?d:null)}else 2==a&&d.clear()}else lg(this);delete this.s;delete this.v}e=B(this.id);for(f=0;fa[1];a=a[2];this.V=!0;this.o.S=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(sg(this,this.a,b,c,a),this.Aa(),this.a.gb());this.H&&(ng(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.m=0}; -function ng(a,b){if(ua("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.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;w("http://www.pcjs.org/api/v1/report",d,!0)}} -function tg(a,b,c){var d,e="none";if(a.m)return null;a.m--;var f=new O(a,"1.30.5"),g=new O(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ha&&(c&&G(a.a),d=a.a.ha(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.S=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.Db+=c))&&(d.textContent=b.o.U?b.La.toFixed(2)+"Mhz":"Stopped",b.Db=0)}if(this.B&&(b=this.B,a=a||0,b.v)){c=b.a.o.U;d=!!(b.a.u&8);if(0>=a||60<=(b.s+=a)){for(var e=0;e'+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Yf(d,a)},!0;case "loadDrive":return this.j[b]= +c,c.onclick=function(){var a=d.j.listDisks;a&&Zf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.w){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.L)?(a=Ca(Nf(a),a.Mb.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.w)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= +!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Zf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; +h.ga=function(a,b,c,d){this.l=a;this.g=b;this.a=c;this.G=d;if((a=yc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.B[e]=a[e]);$f(this);this.Pa=Zb(112,5,131072);eb(b,this,ag);gb(b,this.reset.bind(this));bg(this,"None","",!0);this.w&&bg(this,"Local Disk","?");bg(this,"Remote Disk","??");cg(this)||F(this)}; +h.ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Jb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Yf(this,0)}}return!0};h.ha=function(a){return a?this.save():!0};h.reset=function(){$f(this)};h.save=function(){return(new O(this)).data()}; +h.restore=function(a){return $f(this,a[0])};function cg(a,b){b||(a.v=0);for(var c in a.B){var d=a.B[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}eg(a,e,b,c,!1,d)}else dg(a,e)} +function eg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,dg(a,b,!0),k.Ia?a.C("RL11 busy"):(k.Ia=!0,e&&(k.Ha=!0,a.v++),k.va=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.tc)&&g++));return g} +h.tc=function(a,b,c,d,e){var f;a.Ia=!1;b&&(f=Kf(b),b&&f[0]>a.P||f[1]>a.S)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ja)),b=null);b?(a.L=b,a.oa=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ja),a.Ha||e),this.l&&Ec(this.l)):a.va=!1;a.Ha&&(a.Ha=!1,--this.v||F(this));Yf(this,a.Ja)}; +function bg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.m=f>>16&63;this.i=this.b=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.A=this.A|a|32768);return!0}; +h.uc=function(a,b,c,d,e,f,g,k){b=0;var l=a.L,n=null,p;l||(b=5120,f=0);for(;f--;){if(!n){n=a.L.seek(c,d,e+1);if(!n){b=5120;break}p=0}var u,v;if(0>(u=a.L.read(n,p++))||0>(v=a.L.read(n,p++))){b=5120;break}ub(this.g,Vc(this.a,g),u|v<<8);if(Vb(this.g)){b=8192;break}g+=2;if(p>=l.W&&(n=null,++e>=l.M&&(e=0,++d>=l.S&&(d=0,++c>=l.P)))){b=5120;break}}return k(b,c,d,e,f,g)}; +h.vc=function(a,b,c,d,e,f,g,k){b=0;var l=a.L,n=null,p;l||(b=5120,f=0);for(;f--;){var u=wb(this.g,Vc(this.a,g));if(Vb(this.g)){b=8192;break}g+=2;if(!n){n=a.L.seek(c,d,e+1,!0);if(!n){b=5120;break}p=0}if(!a.L.write(n,p++,u&255)||!a.L.write(n,p++,u>>8)){b=5120;break}if(p>=l.W&&(n=null,++e>=l.M&&(e=0,++d>=l.S&&(d=0,++c>=l.P)))){b=5120;break}}return k(b,c,d,e,f,g)};h.Ad=function(){return this.A&65535}; +h.ye=function(a){this.A=this.A&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.A&128)){var b;a=!0;var c=this.c[(this.A&768)>>8],d,e,f,g;this.A&=-2;switch(this.A&14){case 4:this.s&8&&(this.A&=63);this.s=c.status|this.i&64;break;case 6:1==(this.b&3)&&(b=this.b&65408,c=(this.b&16)<<2,this.i=this.b&4?this.i+b:this.i-b,this.b=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.uc;case 10:b||(b=this.vc),d=this.b>>7,e=this.b&64?1:0,f=this.b&63,d>=c.P||f>=c.M?this.A|=37888:(g=(this.m& +63)<<16|this.h,a=65536-this.s&65535,a=b.call(this,c,128*(((d<<1)+e)*c.M+f),d,e,f,a,g,this.sc.bind(this)))}a&&(this.A|=129,this.A&64&&Xb(this.a,this.Pa))}};h.yd=function(){return this.h};h.we=function(a){this.h=a&65534};h.Bd=function(){return this.b};h.ze=function(a){this.b=a};h.Cd=function(){return this.s};h.Ae=function(a){this.s=a};h.zd=function(){return this.m};h.xe=function(a){this.m=a&63;this.A=this.A&-49|(this.m&3)<<4}; +var fg={},ag=(fg[63744]=[null,null,M.prototype.Ad,M.prototype.ye,"RLCS"],fg[63746]=[null,null,M.prototype.yd,M.prototype.we,"RLBA"],fg[63748]=[null,null,M.prototype.Bd,M.prototype.ze,"RLDA"],fg[63750]=[null,null,M.prototype.Cd,M.prototype.Ae,"RLMP"],fg[63752]=[null,null,M.prototype.zd,M.prototype.xe,"RLBE"],fg); +function gg(a,b,c){y.call(this,"Computer",a,gg,33554432);this.o.R=!1;hg(this,b);this.w=yc(this,"autoPower",a);this.l=0;this.N=a.busWidth||a.buswidth;this.b=ig;this.s=null;this.i=this.J=!1;this.U=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=jg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.g=new Ab({id:this.ya+".bus",busWidth:this.N},this.a,this.G);var d,e=B(this.id);if((this.B=Va("Panel",this.id))&&this.B.fb)for(b=0;b\nLicense: GPL version 3 or later ");this.X("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;big){if(kg(d,this.s)){this.h=new O(this,"1.30.5","failsafe");kg(this.h)&&(pg(this,d),a=2,qg(this.h));this.h.set("timestamp",ra());rg(this.h);var e=this.b&&!this.i;if(1==a||ua("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.C("Error: "+g),"unable to verify user"==g&&(ya("user",""),this.c=null)):this.X(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.s;delete this.v}e=B(this.id);for(f=0;fa[1];a=a[2];this.V=!0;this.o.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(ug(this,this.a,b,c,a),this.wa(),this.a.eb());this.H&&(pg(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.l=0}; +function pg(a,b){if(ua("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.5"};d.url=a.U;d.user=c;d.type="bug";d.data=b;w("http://www.pcjs.org/api/v1/report",d,!0)}} +function vg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.5"),g=new O(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ha&&(c&&G(a.a),d=a.a.ha(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.R=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.Bb+=c))&&(d.textContent=b.o.T?b.Ba.toFixed(2)+"Mhz":"Stopped",b.Bb=0)}if(this.B&&(b=this.B,a=a||0,b.v)){c=b.a.o.T;d=!!(b.a.u&8);if(0>=a||60<=(b.s+=a)){for(var e=0;ef.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(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");w(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Ag(a,b,c)}})}else c(a,null)} -function Bg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--xg||Ka(!0));l=!1}var g,k,l=!0;xg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| -(c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?yg(c,null,null,!1,e,function(d,l){l?(Ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--xg||Ka(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--xg||Ka(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?yg(b,a,d,!0,e,n):zg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(v){f(v.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Bg(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map +h.ba=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.l||(d.o.R?vg(d,!1,!0):mg(d,d.gb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.o.R&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");vg(d,a,!0);!a&&d.D?window&&window.location.reload():(a||(d.Jb=!0),d.gb(ig),d.Jb=!1)}else d.reset(),d.a&&d.a.eb()},!0;case "save":if(la(ta(),"pcjs.org"))c.parentNode.removeChild(c);else return this.j[b]= +c,c.onclick=function(){var a=jg(d,!0);if(a){var b=!!(d.b&&!d.m||d.D),c=vg(d,b);b?wg(d,a,c):d.C("Resume disabled, machine state not saved")}},!0}return!1}; +function jg(a,b){var c=a.c;c||((c=xa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=xg(a,c))||a.C("The user ID is invalid.")):b&&a.C("Browser local storage is not available"));return c} +function xg(a,b){a.c=null;b=w(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.c=b.data)}catch(d){x(d.message+" ("+c+")")}return a.c}function lg(a){var b=null;a.c&&(b=ta()+"/api/v1/user?req=load&user="+a.c+"&state="+yg(a,"1.30.5"));return b} +function wg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=yg(a,"1.30.5");d.data=c;b=w(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.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(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");w(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Cg(a,b,c)}})}else c(a,null)} +function Dg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--zg||Ka(!0));l=!1}var g,k,l=!0;zg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| +(c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?Ag(c,null,null,!1,e,function(d,l){l?(Ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--zg||Ka(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--zg||Ka(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ag(b,a,d,!0,e,n):Bg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(v){f(v.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Dg(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map