From 21d91cbcfad48ebcf8e3fc6ec72b652767c5f397 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 20 Oct 2016 15:16:22 -0700 Subject: [PATCH] Fixed the components.xsl for PDPjs machines, and added more instructions, resource links, etc, for the PDP-11 demo machines --- Gruntfile.js | 2 +- apps/pdp11/boot/bootstrap/README.md | 18 +- apps/pdp11/boot/test/README.md | 2 + apps/pdp11/tapes/README.md | 19 +- .../tapes/{ => absloader}/DEC-11-L2PC-PO.json | 0 apps/pdp11/tapes/absloader/README.md | 19 ++ .../tapes/{ => basic}/DEC-11-AJPB-PB.json | 0 apps/pdp11/tapes/basic/README.md | 17 ++ devices/pdp11/machine/1120/basic/README.md | 12 + .../machine/1120/basic/debugger/README.md | 12 + .../machine/1120/basic/debugger/machine.xml | 2 +- devices/pdp11/machine/1120/basic/machine.xml | 2 +- .../pdp11/machine/1120/bootstrap/README.md | 18 ++ .../machine/1120/bootstrap/debugger/README.md | 21 ++ devices/pdp11/panel/test/terminal.xml | 18 ++ devices/pdp11/pc11/README.md | 26 +- devices/pdp11/pc11/demo.xml | 6 +- docs/pcx86/examples/components.css | 4 + docs/pcx86/examples/components.xsl | 37 ++- modules/pcx86/lib/fdc.js | 1 + modules/pdp11/lib/debugger.js | 14 +- modules/pdp11/lib/defines.js | 34 ++- modules/pdp11/lib/keyboard.js | 1 - modules/pdp11/lib/pc11.js | 54 +++- modules/pdp11/lib/serialport.js | 58 +++- modules/shared/templates/components.xsl | 37 ++- modules/shared/templates/machine.xsl | 3 +- versions/pc8080/1.30.1/components.css | 4 + versions/pc8080/1.30.1/components.xsl | 37 ++- versions/pcx86/1.30.1/components.css | 4 + versions/pcx86/1.30.1/components.xsl | 37 ++- versions/pdpjs/1.30.1/components.css | 4 + versions/pdpjs/1.30.1/components.xsl | 39 ++- versions/pdpjs/1.30.1/pdp11-dbg.js | 277 +++++++++--------- versions/pdpjs/1.30.1/pdp11.js | 130 ++++---- 35 files changed, 685 insertions(+), 284 deletions(-) rename apps/pdp11/tapes/{ => absloader}/DEC-11-L2PC-PO.json (100%) create mode 100644 apps/pdp11/tapes/absloader/README.md rename apps/pdp11/tapes/{ => basic}/DEC-11-AJPB-PB.json (100%) create mode 100644 apps/pdp11/tapes/basic/README.md diff --git a/Gruntfile.js b/Gruntfile.js index 05d2b7644..6dcbdf8c3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -525,7 +525,7 @@ module.exports = function(grunt) { options: { process: function(content, srcPath) { var s = content.replace(/()[^<]*(<\/xsl:variable>)/g, "$1pdp11$2"); - s = s.replace(/()[^<]*(<\/xsl:variable>)/g, "$1PDP11$2"); + s = s.replace(/()[^<]*(<\/xsl:variable>)/g, "$1PDPjs$2"); s = s.replace(/()[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2"); s = s.replace(/"[^"]*\/?(common.css|common.xsl|components.css|components.xsl|document.css|document.xsl)"/g, '"/versions/pdpjs/' + pkg.version + '/$1"'); s = s.replace(/[ \t]*\/\*[^*][\s\S]*?\*\//g, "").replace(/[ \t]*[ \t]*\n?/g, ""); diff --git a/apps/pdp11/boot/bootstrap/README.md b/apps/pdp11/boot/bootstrap/README.md index 37a973db7..8b1b8da0e 100644 --- a/apps/pdp11/boot/bootstrap/README.md +++ b/apps/pdp11/boot/bootstrap/README.md @@ -7,10 +7,10 @@ permalink: /apps/pdp11/boot/bootstrap/ DEC PDP-11 Bootstrap Loader --------------------------- -The blog post "[PDP-11 Paper Tape BASIC](http://www.avitech.com.au/ptb/ptb.html)" describes the *Bootstrap Loader*, -a small program used to load the *Absolute Loader*, which in turn loads the *PDP-11 BASIC Paper Tape*. +The **Bootstrap Loader** is a small program that loads the **[Absolute Loader](/apps/pdp11/tapes/absloader/)**, +which is then used to load other PDP-11 tapes, such as **[BASIC (Single User)](/apps/pdp11/tabes/basic/)**. -Here's what the *Bootstrap Loader* looks like: +Here's what the **Bootstrap Loader** looks like: Location Instruction 037744 016701 @@ -28,8 +28,8 @@ Here's what the *Bootstrap Loader* looks like: 037774 000765 037776 177550 -Using a [PDPjs](/modules/pdpjs/) machine with the built-in Debugger, such as the -[PDP-11/20 Test Machine with Debugger](/devices/pdp11/machine/1120/test/debugger/), the *Bootstrap Loader* +Using any [PDPjs](/modules/pdpjs/) machine with the built-in Debugger, such as this +[PDP-11/20 Test Machine with Debugger](/devices/pdp11/machine/1120/test/debugger/), the **Bootstrap Loader** is easily entered with a single Debugger EDIT ("e") command: e 037744 016701 000026 012702 000352 005211 105711 100376 116162 000002 037400 005267 177756 000765 177550 @@ -51,8 +51,8 @@ To run the above code, set the PC to 037744 and start the machine: r pc=037744 g -Preloading DEC's Bootstrap Loader ---------------------------------- +Pre-loading DEC's Bootstrap Loader +---------------------------------- I pasted the disassembled code (above) into a listing file, [BOOTSTRAP-16KB.lst](BOOTSTRAP-16KB.lst), and then ran [FileDump](/modules/filedump) to produce a [BOOTSTRAP-16KB.json](BOOTSTRAP-16KB.json) that can @@ -60,8 +60,8 @@ be automatically pre-loaded into any machine: filedump --file=BOOTSTRAP-16KB.lst --format=octal --output=BOOTSTRAP-16KB.json -For example, this [PDP-11/20 16Kb Machine](/devices/pdp11/machine/1120/bootstrap/debugger/machine.xml) preloads -the *Bootstrap Loader* using the `` component's optional *file* attribute: +For example, this [PDP-11/20 16Kb Machine](/devices/pdp11/machine/1120/bootstrap/debugger/) pre-loads +the **Bootstrap Loader** using the `` component's optional *file* attribute: diff --git a/apps/pdp11/boot/test/README.md b/apps/pdp11/boot/test/README.md index cbd4a89c7..85871e118 100644 --- a/apps/pdp11/boot/test/README.md +++ b/apps/pdp11/boot/test/README.md @@ -14,6 +14,8 @@ PDP-11 Boot Test [TEST.mac](TEST.mac) was cross-assembled with [MACRO11](https://github.com/shattered/macro11) to produce [TEST.lst](TEST.lst), which was then processed by [FileDump](/modules/filedump/) to produce [TEST.json](TEST.json). +To see this Boot Test in action, try the [PDP-11/70 Test Machine with Debugger](/devices/pdp11/machine/1170/test/debugger/). + The source code is shown below. ; BOOT LOADER CODE diff --git a/apps/pdp11/tapes/README.md b/apps/pdp11/tapes/README.md index 37e4cfda0..b1af34d92 100644 --- a/apps/pdp11/tapes/README.md +++ b/apps/pdp11/tapes/README.md @@ -1,26 +1,25 @@ --- layout: page -title: DEC PDP-11 Tapes +title: DEC PDP-11 Tape Images permalink: /apps/pdp11/tapes/ --- -DEC PDP-11 Tapes ----------------- +DEC PDP-11 Tape Images +---------------------- We have archived the following DEC PDP-11 Tapes: -- [Absolute Loader](DEC-11-L2PC-PO.json) -- [BASIC (Single User)](DEC-11-AJPB-PB.json) +- [Absolute Loader](absloader/) +- [BASIC (Single User)](basic/) To make it easy for PDPjs machines to load these tapes, we created the following High-Speed Paper Tape Reader (PC11) configurations: - [demo.xml](/devices/pdp11/pc11/demo.xml) +which is typically instantiated by a Machine XML file using: + + + These configuration files create UI controls that allow you to choose from a set of tapes that are automatically sent to the machine's PC11 device. - -Third-Party Resources ---------------------- - -- [PDP-11 Paper Tape BASIC](http://www.avitech.com.au/ptb/ptb.html) diff --git a/apps/pdp11/tapes/DEC-11-L2PC-PO.json b/apps/pdp11/tapes/absloader/DEC-11-L2PC-PO.json similarity index 100% rename from apps/pdp11/tapes/DEC-11-L2PC-PO.json rename to apps/pdp11/tapes/absloader/DEC-11-L2PC-PO.json diff --git a/apps/pdp11/tapes/absloader/README.md b/apps/pdp11/tapes/absloader/README.md new file mode 100644 index 000000000..9ab62f0d1 --- /dev/null +++ b/apps/pdp11/tapes/absloader/README.md @@ -0,0 +1,19 @@ +--- +layout: page +title: DEC PDP-11 Absolute Loader +permalink: /apps/pdp11/tapes/absloader/ +--- + +DEC PDP-11 Absolute Loader +-------------------------- + +The Absolute Loader is a special tape image that must be loaded in order to load *other* tapes +which use the Absolute Loader format. + +To see the Absolute Loader in action, try the [Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/debugger/). + +PCjs has archived the following DEC resources: + +- [Absolute Loader](DEC-11-L2PC-PO.json) +- [LISTING OF PDP-11 ABSOLUTE LOADER (June 1975)](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-UABLA-A-LA_PDP-11AbsoluteLoaderListing_Jun75.pdf) +- "APPENDIX D: THE BOOTSTRAP AND ABSOLUTE LOADERS" from the [PDP-11 BASIC PROGRAMMING MANUAL (December 1970)](http://archive.pcjs.org/pubs/dec/pdp11/other/BASIC_Programming_Manual_Dec70.pdf) diff --git a/apps/pdp11/tapes/DEC-11-AJPB-PB.json b/apps/pdp11/tapes/basic/DEC-11-AJPB-PB.json similarity index 100% rename from apps/pdp11/tapes/DEC-11-AJPB-PB.json rename to apps/pdp11/tapes/basic/DEC-11-AJPB-PB.json diff --git a/apps/pdp11/tapes/basic/README.md b/apps/pdp11/tapes/basic/README.md new file mode 100644 index 000000000..ae3dc3383 --- /dev/null +++ b/apps/pdp11/tapes/basic/README.md @@ -0,0 +1,17 @@ +--- +layout: page +title: DEC PDP-11 BASIC +permalink: /apps/pdp11/tapes/basic/ +--- + +DEC PDP-11 BASIC +---------------- + +PCjs has archived the following DEC resources: + +- [BASIC (Single User)](DEC-11-AJPB-PB.json) +- [PDP-11 BASIC PROGRAMMING MANUAL (December 1970)](http://archive.pcjs.org/pubs/dec/pdp11/other/BASIC_Programming_Manual_Dec70.pdf) + +Third-party resources include: + +- "[PDP-11 Paper Tape BASIC](http://www.avitech.com.au/ptb/ptb.html)", written March 24, 2013 diff --git a/devices/pdp11/machine/1120/basic/README.md b/devices/pdp11/machine/1120/basic/README.md index e44482353..609f534e3 100644 --- a/devices/pdp11/machine/1120/basic/README.md +++ b/devices/pdp11/machine/1120/basic/README.md @@ -8,4 +8,16 @@ machines: autoMount: '' --- +DEC PDP-11 BASIC Demo +--------------------- + +This machine pre-loads the **[DEC PDP-11 BASIC](/apps/pdp11/tapes/basic/)** tape image into 16Kb of RAM: + + + +However, if this is too convenient for you, you can manually load it into memory using the +[Bootstrap Loader](/apps/pdp11/boot/bootstrap/). + {% include machine.html id="test1120" %} + +See also: [DEC PDP-11 BASIC Demo (with Debugger)](/devices/pdp11/machine/1120/basic/debugger/) diff --git a/devices/pdp11/machine/1120/basic/debugger/README.md b/devices/pdp11/machine/1120/basic/debugger/README.md index 31880cbc5..34ce7808f 100644 --- a/devices/pdp11/machine/1120/basic/debugger/README.md +++ b/devices/pdp11/machine/1120/basic/debugger/README.md @@ -9,4 +9,16 @@ machines: autoMount: '' --- +DEC PDP-11 BASIC Demo (with Debugger) +------------------------------------- + +This machine pre-loads the **[DEC PDP-11 BASIC](/apps/pdp11/tapes/basic/)** tape image into 16Kb of RAM: + + + +However, if this is too convenient for you, you can manually load it into memory using the +[Bootstrap Loader](/apps/pdp11/boot/bootstrap/). + +See [Bootstrap Loader Demo (with Debugger)](/devices/pdp11/machine/1120/bootstrap/debugger/) for details. + {% include machine.html id="test1120" %} diff --git a/devices/pdp11/machine/1120/basic/debugger/machine.xml b/devices/pdp11/machine/1120/basic/debugger/machine.xml index 396332096..4a5fe634c 100644 --- a/devices/pdp11/machine/1120/basic/debugger/machine.xml +++ b/devices/pdp11/machine/1120/basic/debugger/machine.xml @@ -4,7 +4,7 @@ PDP-11/20: 16Kb, DEC BASIC, Debugger - + diff --git a/devices/pdp11/machine/1120/basic/machine.xml b/devices/pdp11/machine/1120/basic/machine.xml index f38ae8ca4..144bedf71 100644 --- a/devices/pdp11/machine/1120/basic/machine.xml +++ b/devices/pdp11/machine/1120/basic/machine.xml @@ -4,7 +4,7 @@ PDP-11/20: 16Kb, DEC BASIC - + diff --git a/devices/pdp11/machine/1120/bootstrap/README.md b/devices/pdp11/machine/1120/bootstrap/README.md index 8e1fd45ca..d60774ffc 100644 --- a/devices/pdp11/machine/1120/bootstrap/README.md +++ b/devices/pdp11/machine/1120/bootstrap/README.md @@ -7,4 +7,22 @@ machines: type: pdp11 --- +Bootstrap Loader Demo +--------------------- + +This machine pre-loads the **[Bootstrap Loader](/apps/pdp11/boot/bootstrap/)** code into RAM: + + + +and then pre-attaches the **[Absolute Loader](/apps/pdp11/tapes/absloader/)** tape image to the PC11 Paper Tape Reader: + + ... + +Click "Run" to load the **[Absolute Loader](/apps/pdp11/tapes/absloader/)**. +When the **[Bootstrap Loader](/apps/pdp11/boot/bootstrap/)** is finished, it will HALT, +leaving the **[Absolute Loader](/apps/pdp11/tapes/absloader/)** ready to run immediately after the HALT. + +You can then select another tape image in the Absolute Loader format, such as **[BASIC (Single User)](/apps/pdp11/tapes/basic/)**, +click "Attach" and then "Run". + {% include machine.html id="test1120" %} diff --git a/devices/pdp11/machine/1120/bootstrap/debugger/README.md b/devices/pdp11/machine/1120/bootstrap/debugger/README.md index 1932330c3..44729b609 100644 --- a/devices/pdp11/machine/1120/bootstrap/debugger/README.md +++ b/devices/pdp11/machine/1120/bootstrap/debugger/README.md @@ -8,4 +8,25 @@ machines: debugger: true --- +Bootstrap Loader Demo (with Debugger) +------------------------------------- + +This machine pre-loads the **[Bootstrap Loader](/apps/pdp11/boot/bootstrap/)** code into RAM: + + + +and then pre-attaches the **[Absolute Loader](/apps/pdp11/tapes/absloader/)** tape image to the PC11 Paper Tape Reader: + + ... + +Click "Run" to load the **[Absolute Loader](/apps/pdp11/tapes/absloader/)**. +When the **[Bootstrap Loader](/apps/pdp11/boot/bootstrap/)** is finished, it will HALT, +leaving the **[Absolute Loader](/apps/pdp11/tapes/absloader/)** ready to run immediately after the HALT. + +You can then select another tape image in the Absolute Loader format, such as **[BASIC (Single User)](/apps/pdp11/tapes/basic/)**, +click "Attach" and then "Run". + +If you need to start over, select "Bootstrap Loader (16Kb)" from the list of tapes and click "Load" instead of +"Attach", re-installing the **[Bootstrap Loader](/apps/pdp11/boot/bootstrap/)** directly into RAM. + {% include machine.html id="test1120" %} diff --git a/devices/pdp11/panel/test/terminal.xml b/devices/pdp11/panel/test/terminal.xml index d88301801..fe89b180c 100644 --- a/devices/pdp11/panel/test/terminal.xml +++ b/devices/pdp11/panel/test/terminal.xml @@ -4,6 +4,24 @@ + + Registers + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + + 0 + 0 + 0 + 0 + + Run Reset diff --git a/devices/pdp11/pc11/README.md b/devices/pdp11/pc11/README.md index dab64fc60..ab12496c8 100644 --- a/devices/pdp11/pc11/README.md +++ b/devices/pdp11/pc11/README.md @@ -9,15 +9,27 @@ PC11 High-Speed Paper Tape Reader/Punch PDPjs implements the PC11 component in [pc11.js](/modules/pdp11/lib/pc11.js). -Paper Tape configurations include: +A variety of [Paper Tape Images](/apps/pdp11/tapes/) have been archived, and they are typically collected in a +configuration file such as [demo.xml](demo.xml): -- [Demo](demo.xml) - -which are typically instantiated by a Machine XML file using: - - + + + Paper Tape Controls + + + + + + + Attach + Load + + + Tape Progress + + -The above configurations are used by machines such as: +The above configuration is used by PDPjs machines such as: - [PDP-11/20 with 16Kb and Bootstrap Loader](/devices/pdp11/machine/1120/bootstrap/) ([Debugger](/devices/pdp11/machine/1120/bootstrap/debugger/)) - [PDP-11/20 with 16Kb and DEC BASIC](/devices/pdp11/machine/1120/basic/) ([Debugger](/devices/pdp11/machine/1120/basic/debugger/)) diff --git a/devices/pdp11/pc11/demo.xml b/devices/pdp11/pc11/demo.xml index e01d42ec3..b5ec3a7cc 100644 --- a/devices/pdp11/pc11/demo.xml +++ b/devices/pdp11/pc11/demo.xml @@ -1,11 +1,11 @@ - + Paper Tape Controls - - + + Attach Load diff --git a/docs/pcx86/examples/components.css b/docs/pcx86/examples/components.css index fc92ecbb1..707d508a0 100644 --- a/docs/pcx86/examples/components.css +++ b/docs/pcx86/examples/components.css @@ -194,4 +194,8 @@ .pcjs-registers { width: 100% !important; } + .pdp11-device { + width: 100% !important; + max-width: none !important; + } } diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index ed916e79f..be9f7ea1b 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -23,7 +23,14 @@ - + + + + + + + + @@ -760,6 +767,18 @@ + + + + 0 + + + + + + 0 + + @@ -770,7 +789,7 @@ device - ,type:'',autoMount:'' + ,type:'',baudReceive:,baudTransmit:,autoMount:'' @@ -836,6 +855,18 @@ 0 + + + + 0 + + + + + + 0 + + @@ -859,7 +890,7 @@ serial - ,adapter:,binding:'',tabSize:,charBOL: + ,adapter:,baudReceive:,baudTransmit:,binding:'',tabSize:,charBOL: diff --git a/modules/pcx86/lib/fdc.js b/modules/pcx86/lib/fdc.js index a8613ea31..ee246e214 100644 --- a/modules/pcx86/lib/fdc.js +++ b/modules/pcx86/lib/fdc.js @@ -103,6 +103,7 @@ if (NODE) { * component-specific property: * * autoMount: one or more JSON-encoded objects, each containing 'name' and 'path' properties + * * sortBy: "name" to sort disks by name, "path" to sort by path, or "none" to leave as-is (default is "name") * * Regarding early diskette drives: the IBM PC Model 5150 originally shipped with single-sided drives, diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 7dd71091f..b417ece44 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1610,8 +1610,20 @@ if (DEBUGGER) { */ DebuggerPDP11.prototype.checkInstruction = function(addr, nState) { + var opCode = -1 var cpu = this.cpu; + /* + * Purely as a convenience, we're going to skip over a HALT opcode if the machine is just starting, + * and pretend that the NEXT instruction is the first to be executed. + */ + if (nState == 0) { + opCode = this.cpu.getWordDirect(addr); + if (opCode == PDP11.OPCODE.HALT) { + this.cpu.advancePC(2); + } + } + if (nState > 0) { if (this.nBreakIns && !--this.nBreakIns) { return true; @@ -1629,7 +1641,7 @@ if (DEBUGGER) { */ if (nState >= 0 && this.aaOpcodeCounts.length) { this.cOpcodes++; - var opCode = this.cpu.getWordDirect(addr); + if (opCode < 0) opCode = this.cpu.getWordDirect(addr); if (opCode != null) { var dbgAddr = this.aOpcodeHistory[this.iOpcodeHistory]; this.setAddr(dbgAddr, cpu.getPC()); diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 565913861..425001751 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -185,6 +185,12 @@ var PDP11 = { CMODE: 14 } }, + /* + * Assorted common opcodes + */ + OPCODE: { + HALT: 0x0000 + }, /* * Internal operation state flags */ @@ -523,19 +529,26 @@ var PDP11 = { BUSY: 0x0800, // Busy (R/O) ERROR: 0x8000, // Error (R/O) CLEAR: 0x08C0, // bits cleared on INIT - RMASK: 0xFFFE, // bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see PC11.readPRS()) - WMASK: 0x0041 // bits writable + RMASK: 0xFFFE, // bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readPRS()) + WMASK: 0x0041, // bits writable + BAUD: 3600 }, PRB: { MASK: 0x00FF // Data - } + }, + PPS: { + /* + * TODO: Flesh this out if/when we add Paper Tape Punch support + */ + BAUD: 600 + }, }, DL11: { // Serial Line Interface (program compatible with the KL11 for control of console teleprinters) PRI: 4, RVEC: 0o60, XVEC: 0o64, RCSR: { // 177560 - RE: 0x0001, // Reader Enable (W/O) TODO: Determine if we really need to exclude this write-only bit from RMASK + RE: 0x0001, // Reader Enable (W/O) DTR: 0x0002, // Data Terminal Ready (R/W) RTS: 0x0004, // Request To Send (R/W) STD: 0x0008, // Secondary Transmitted Data (R/W) @@ -548,16 +561,16 @@ var PDP11 = { CTS: 0x2000, // Clear To Send (R/O) RI: 0x4000, // Ring Indicator (R/O) DSC: 0x8000, // Dataset Status Change (R/O) - RMASK: 0xFFFF, // read mask - WMASK: 0x006F // write mask + RMASK: 0xFFFE, // bits readable (TODO: All I know for sure is that bit 0 is NOT readable; see readRCSR()) + WMASK: 0x006F, // bits writable + BAUD: 9600 }, RBUF: { // 177562 DATA: 0x00ff, // Received Data (R/O) PARITY: 0x1000, // Received Data Parity (R/O) FE: 0x2000, // Framing Error (R/O) OE: 0x4000, // Overrun Error (R/O) - ERROR: 0x8000, // Error (R/O) - DELAY: 1 + ERROR: 0x8000 // Error (R/O) }, XCSR: { // 177564 BREAK: 0x0001, // BREAK (R/W) @@ -566,11 +579,10 @@ var PDP11 = { READY: 0x0080, // Transmitter Ready (R/O) RMASK: 0x00C5, WMASK: 0x0045, - DELAY: 1 + BAUD: 9600 }, XBUF: { // 177566 - DATA: 0x00FF, // Transmitted Data (W/O) TODO: Determine why pdp11.js effectively defined this as 0x7F - DELAY: 1 + DATA: 0x00FF // Transmitted Data (W/O) TODO: Determine why pdp11.js effectively defined this as 0x7F } }, KW11: { // KW11-L Line Time Clock diff --git a/modules/pdp11/lib/keyboard.js b/modules/pdp11/lib/keyboard.js index 1a1b01d4c..59bd4978d 100644 --- a/modules/pdp11/lib/keyboard.js +++ b/modules/pdp11/lib/keyboard.js @@ -88,7 +88,6 @@ KeyboardPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.cmp = cmp; this.cpu = cpu; this.dbg = dbg; // NOTE: The "dbg" property must be set for the message functions to work - this.chipset = null; // /** @type {ChipSetPDP11} */ (cmp.getMachineComponent("ChipSet")); }; /** diff --git a/modules/pdp11/lib/pc11.js b/modules/pdp11/lib/pc11.js index 5796ac71e..310e60a08 100644 --- a/modules/pdp11/lib/pc11.js +++ b/modules/pdp11/lib/pc11.js @@ -1,5 +1,5 @@ /** - * @fileoverview Implements the PC11 High-Speed Paper Tape Reader/Punch + * @fileoverview Implements the PDP-11 High-Speed Paper Tape Reader/Punch (eg, PC11) * @author Jeff Parsons * @copyright © Jeff Parsons 2012-2016 * @@ -41,6 +41,24 @@ if (NODE) { /** * PC11(parms) * + * The PC11 component has the following component-specific (parms) properties: + * + * autoMount: a JSON-encoded object containing 'name' and 'path' properties, describing a + * tape resource to automatically attach at startup (only the "attach" operation is supported + * for autoMount; if you want to "load" a tape image directly into RAM at startup, you must + * ask the RAM component to do that). + * + * baudReceive: the default number of bits/second that the device should receive data at; + * 0 means use the device default (PDP11.PC11.PRS.BAUD) + * + * baudTransmit: the default number of bits/second that the device should transmit data at; + * 0 means use the device default (PDP11.PC11.PPS.BAUD); currently ignored, since punch + * support isn't implemented yet. + * + * NOTE: Since the XSL file defines the 'baud' properties as numbers, not strings, there's no need to + * use parseInt(), and as an added benefit, we don't need to worry about whether a hex or decimal format + * was used. + * * @constructor * @extends Component * @param {Object} parms @@ -55,6 +73,7 @@ function PC11(parms) */ this.configMount = parms['autoMount'] || null; this.cAutoMount = 0; + this.nBaudReceive = parms['baudReceive'] || PDP11.PC11.PRS.BAUD; this.prs = 0; // PRS register this.prb = 0; // PRB register @@ -63,6 +82,7 @@ function PC11(parms) this.sTapeSource = PC11.SOURCE.NONE; this.nTapeTarget = PC11.TARGET.NONE; this.sTapeName = this.sTapePath = ""; + this.nLastPercent = -1; // ensure the first displayProgress() displays something /* * Support for local tape images is currently limited to desktop browsers with FileReader support; @@ -622,7 +642,7 @@ PC11.prototype.displayTape = function() PC11.prototype.displayProgress = function(nPercent) { nPercent |= 0; - if (nPercent !== this.lastPercent) { + if (nPercent !== this.nLastPercent) { var control = this.bindings[PC11.BINDING.READ_PROGRESS]; if (control) { var aeControls = Component.getElementsByClass(control, PC11.CSSCLASS.PROGRESS_BAR); @@ -631,7 +651,7 @@ PC11.prototype.displayProgress = function(nPercent) controlBar.style.width = nPercent + "%"; } } - this.lastPercent = nPercent; + this.nLastPercent = nPercent; } }; @@ -734,6 +754,25 @@ PC11.prototype.restore = function(data) return true; }; +/** + * getBaudTimeout(nBaud) + * + * Based on the selected baud rate (nBaud), convert that rate into a millisecond delay. + * + * @this {PC11} + * @param {number} nBaud + * @return {number} (number of milliseconds per byte) + */ +PC11.prototype.getBaudTimeout = function(nBaud) +{ + /* + * TODO: Do a better job computing this, based on actual numbers of start, stop and parity bits, + * instead of hard-coding the total number of bits per byte to 10. + */ + var nBytesPerSecond = Math.round(nBaud / 10); + return 1000 / nBytesPerSecond; +}; + /** * advanceReader() * @@ -748,9 +787,14 @@ PC11.prototype.advanceReader = function() if ((this.prs & (PDP11.PC11.PRS.RE | PDP11.PC11.PRS.ERROR)) == PDP11.PC11.PRS.RE) { if (!(this.prs & PDP11.PC11.PRS.DONE)) { if (this.iTapeData < this.aTapeData.length) { + /* + * Here, as elsewhere (eg, the DL11 component), even if I trusted all incoming data + * to be byte values (which I don't), there's also the risk that it could be signed data + * (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask + * the data assigned to PRB with 0xff. + */ this.prb = this.aTapeData[this.iTapeData++] & 0xff; this.displayProgress(this.iTapeData / this.aTapeData.length * 100); - if (MAXDEBUG) this.println("tape read " + str.toHexByte(this.prb) + " at pos " + str.toHexWord(this.iTapeData)); this.prs |= PDP11.PC11.PRS.DONE; this.prs &= ~PDP11.PC11.PRS.BUSY; if (this.prs & PDP11.PC11.PRS.RIE) { @@ -809,7 +853,7 @@ PC11.prototype.writePRS = function(data, addr) * that's the rate we'll choose as well (ie, 1000ms / 300). As an aside, the original "low speed" * version of the reader ran at 10 CPS. */ - this.cpu.setTimer(this.timerReaderAdvance, 1000/300); + this.cpu.setTimer(this.timerReaderAdvance, this.getBaudTimeout(this.nBaudReceive)); } } this.prs = (this.prs & ~PDP11.PC11.PRS.WMASK) | (data & PDP11.PC11.PRS.WMASK); diff --git a/modules/pdp11/lib/serialport.js b/modules/pdp11/lib/serialport.js index 0af5b5653..525b3a8fe 100644 --- a/modules/pdp11/lib/serialport.js +++ b/modules/pdp11/lib/serialport.js @@ -1,5 +1,5 @@ /** - * @fileoverview Implements the PDP11 SerialPort component. + * @fileoverview Implements the PDP-11 SerialPort component (eg, DL11) * @author Jeff Parsons * @copyright © Jeff Parsons 2012-2016 * @@ -46,19 +46,24 @@ if (NODE) { * * The SerialPort component has the following component-specific (parmsSerial) properties: * - * adapter: adapter number; 0 if not defined + * adapter: adapter number; 0 if not defined (the PCx86 SerialPort component uses this + * value to set the device's internal COM number, which in turn determines other properties, + * such as I/O ports and IRQ; for the PDP-11, this currently has no defined use) + * + * baudReceive: the default number of bits/second that the device should receive data at; + * 0 means use the device default (PDP11.DL11.RCSR.BAUD) + * + * baudTransmit: the default number of bits/second that the device should transmit data at; + * 0 means use the device default (PDP11.DL11.XCSR.BAUD) * * binding: name of a control (based on its "binding" attribute) to bind to this port's I/O * * tabSize: set to a non-zero number to convert tabs to spaces (applies only to output to * the above binding); default is 0 (no conversion) * - * In the future, we may support 'port' and 'irq' properties that allow the machine to define a - * non-standard serial port configuration, instead of only our pre-defined 'adapter' configurations. - * - * NOTE: Since the XSL file defines 'adapter' as a number, not a string, there's no need to use - * parseInt(), and as an added benefit, we don't need to worry about whether a hex or decimal format - * was used. + * NOTE: Since the XSL file defines the 'adapter' and 'baud' properties as numbers, not strings, + * there's no need to use parseInt(), and as an added benefit, we don't need to worry about whether + * a hex or decimal format was used. * * @constructor * @extends Component @@ -67,6 +72,8 @@ if (NODE) { function SerialPortPDP11(parmsSerial) { this.iAdapter = parmsSerial['adapter']; + this.nBaudReceive = parmsSerial['baudReceive'] || PDP11.DL11.RCSR.BAUD; + this.nBaudTransmit = parmsSerial['baudTransmit'] || PDP11.DL11.XCSR.BAUD; /** * consoleOutput becomes a string that records serial port output if the 'binding' property is set to the @@ -265,7 +272,13 @@ SerialPortPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.timerReceiveInterrupt = this.cpu.addTimer(function readyReceiver() { if (!(serial.rcsr & PDP11.DL11.RCSR.RD)) { if (serial.abReceive.length) { - serial.rbuf = serial.abReceive.shift(); + /* + * Here, as elsewhere (eg, the PC11 component), even if I trusted all incoming data + * to be byte values (which I don't), there's also the risk that it could be signed data + * (eg, -128 to 127, instead of 0 to 255). Both risks are good reasons to always mask + * the data assigned to RBUF with 0xff. + */ + serial.rbuf = serial.abReceive.shift() & 0xff; serial.rcsr |= PDP11.DL11.RCSR.RD; if (serial.rcsr & PDP11.DL11.RCSR.RIE) { serial.cpu.setTrigger(serial.triggerReceiveInterrupt); @@ -447,6 +460,25 @@ SerialPortPDP11.prototype.saveRegisters = function() return []; }; +/** + * getBaudTimeout(nBaud) + * + * Based on the selected baud rate (nBaud), convert that rate into a millisecond delay. + * + * @this {SerialPortPDP11} + * @param {number} nBaud + * @return {number} (number of milliseconds per byte) + */ +SerialPortPDP11.prototype.getBaudTimeout = function(nBaud) +{ + /* + * TODO: Do a better job computing this, based on actual numbers of start, stop and parity bits, + * instead of hard-coding the total number of bits per byte to 10. + */ + var nBytesPerSecond = Math.round(nBaud / 10); + return 1000 / nBytesPerSecond; +}; + /** * receiveData(data) * @@ -471,7 +503,7 @@ SerialPortPDP11.prototype.receiveData = function(data) else { this.abReceive = this.abReceive.concat(data); } - this.cpu.setTimer(this.timerReceiveInterrupt, PDP11.DL11.RBUF.DELAY); + this.cpu.setTimer(this.timerReceiveInterrupt, this.getBaudTimeout(this.nBaudReceive)); return true; // for now, return true regardless, since we're buffering everything anyway }; @@ -570,7 +602,7 @@ SerialPortPDP11.prototype.readRBUF = function(addr) { this.rcsr &= ~PDP11.DL11.RCSR.RD; if (this.abReceive.length > 0) { - this.cpu.setTimer(this.timerReceiveInterrupt, PDP11.DL11.RBUF.DELAY); + this.cpu.setTimer(this.timerReceiveInterrupt, this.getBaudTimeout(this.nBaudReceive)); } return this.rbuf; }; @@ -611,7 +643,7 @@ SerialPortPDP11.prototype.writeXCSR = function(data, addr) * If the device is READY, and IE is transitioning on, then request an interrupt. */ if ((this.xcsr & (PDP11.DL11.XCSR.READY | PDP11.DL11.XCSR.TIE)) == PDP11.DL11.XCSR.READY && (data & PDP11.DL11.XCSR.TIE)) { - this.cpu.setTimer(this.timerTransmitInterrupt, PDP11.DL11.XCSR.DELAY); + this.cpu.setTimer(this.timerTransmitInterrupt, this.getBaudTimeout(this.nBaudTransmit)); } this.xcsr = (this.xcsr & ~PDP11.DL11.XCSR.WMASK) | (data & PDP11.DL11.XCSR.WMASK); }; @@ -641,7 +673,7 @@ SerialPortPDP11.prototype.writeXBUF = function(data, addr) if (data) { this.transmitByte(data); this.xcsr &= ~PDP11.DL11.XCSR.READY; - this.cpu.setTimer(this.timerTransmitInterrupt, PDP11.DL11.XBUF.DELAY); + this.cpu.setTimer(this.timerTransmitInterrupt, this.getBaudTimeout(this.nBaudTransmit)); } }; diff --git a/modules/shared/templates/components.xsl b/modules/shared/templates/components.xsl index a48b2bcde..ca1e854bc 100644 --- a/modules/shared/templates/components.xsl +++ b/modules/shared/templates/components.xsl @@ -24,7 +24,14 @@ - + + + + + + + + @@ -762,6 +769,18 @@ + + + + 0 + + + + + + 0 + + @@ -772,7 +791,7 @@ device - ,type:'',autoMount:'' + ,type:'',baudReceive:,baudTransmit:,autoMount:'' @@ -838,6 +857,18 @@ 0 + + + + 0 + + + + + + 0 + + @@ -861,7 +892,7 @@ serial - ,adapter:,binding:'',tabSize:,charBOL: + ,adapter:,baudReceive:,baudTransmit:,binding:'',tabSize:,charBOL: diff --git a/modules/shared/templates/machine.xsl b/modules/shared/templates/machine.xsl index 6b5ffd007..df9eb4bd6 100644 --- a/modules/shared/templates/machine.xsl +++ b/modules/shared/templates/machine.xsl @@ -10,8 +10,7 @@ - - + diff --git a/versions/pc8080/1.30.1/components.css b/versions/pc8080/1.30.1/components.css index fc92ecbb1..707d508a0 100644 --- a/versions/pc8080/1.30.1/components.css +++ b/versions/pc8080/1.30.1/components.css @@ -194,4 +194,8 @@ .pcjs-registers { width: 100% !important; } + .pdp11-device { + width: 100% !important; + max-width: none !important; + } } diff --git a/versions/pc8080/1.30.1/components.xsl b/versions/pc8080/1.30.1/components.xsl index 7ff1fefa2..7af78588a 100644 --- a/versions/pc8080/1.30.1/components.xsl +++ b/versions/pc8080/1.30.1/components.xsl @@ -23,7 +23,14 @@ - + + + + + + + + @@ -760,6 +767,18 @@ + + + + 0 + + + + + + 0 + + @@ -770,7 +789,7 @@ device - ,type:'',autoMount:'' + ,type:'',baudReceive:,baudTransmit:,autoMount:'' @@ -836,6 +855,18 @@ 0 + + + + 0 + + + + + + 0 + + @@ -859,7 +890,7 @@ serial - ,adapter:,binding:'',tabSize:,charBOL: + ,adapter:,baudReceive:,baudTransmit:,binding:'',tabSize:,charBOL: diff --git a/versions/pcx86/1.30.1/components.css b/versions/pcx86/1.30.1/components.css index fc92ecbb1..707d508a0 100644 --- a/versions/pcx86/1.30.1/components.css +++ b/versions/pcx86/1.30.1/components.css @@ -194,4 +194,8 @@ .pcjs-registers { width: 100% !important; } + .pdp11-device { + width: 100% !important; + max-width: none !important; + } } diff --git a/versions/pcx86/1.30.1/components.xsl b/versions/pcx86/1.30.1/components.xsl index 73ab318f6..f3058d973 100644 --- a/versions/pcx86/1.30.1/components.xsl +++ b/versions/pcx86/1.30.1/components.xsl @@ -23,7 +23,14 @@ - + + + + + + + + @@ -760,6 +767,18 @@ + + + + 0 + + + + + + 0 + + @@ -770,7 +789,7 @@ device - ,type:'',autoMount:'' + ,type:'',baudReceive:,baudTransmit:,autoMount:'' @@ -836,6 +855,18 @@ 0 + + + + 0 + + + + + + 0 + + @@ -859,7 +890,7 @@ serial - ,adapter:,binding:'',tabSize:,charBOL: + ,adapter:,baudReceive:,baudTransmit:,binding:'',tabSize:,charBOL: diff --git a/versions/pdpjs/1.30.1/components.css b/versions/pdpjs/1.30.1/components.css index fc92ecbb1..707d508a0 100644 --- a/versions/pdpjs/1.30.1/components.css +++ b/versions/pdpjs/1.30.1/components.css @@ -194,4 +194,8 @@ .pcjs-registers { width: 100% !important; } + .pdp11-device { + width: 100% !important; + max-width: none !important; + } } diff --git a/versions/pdpjs/1.30.1/components.xsl b/versions/pdpjs/1.30.1/components.xsl index a1930e759..001cc1cb3 100644 --- a/versions/pdpjs/1.30.1/components.xsl +++ b/versions/pdpjs/1.30.1/components.xsl @@ -13,7 +13,7 @@ pc pcjs pdp11 - PDP11 + PDPjs 1.30.1 www.pcjs.org @@ -23,7 +23,14 @@ - + + + + + + + + @@ -760,6 +767,18 @@ + + + + 0 + + + + + + 0 + + @@ -770,7 +789,7 @@ device - ,type:'',autoMount:'' + ,type:'',baudReceive:,baudTransmit:,autoMount:'' @@ -836,6 +855,18 @@ 0 + + + + 0 + + + + + + 0 + + @@ -859,7 +890,7 @@ serial - ,adapter:,binding:'',tabSize:,charBOL: + ,adapter:,baudReceive:,baudTransmit:,binding:'',tabSize:,charBOL: diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index f94d88ec4..213e64151 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -35,52 +35,52 @@ function ua(a,b){return(a+" ").slice(0,b) function ya(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 Ba(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 m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(m)}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 Ca(a,b){var c,d={ha:null,ka:null,Ua:null,Ta: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.Ua=g.load;d.Ta=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.ka=g.symbols;d.ha.length?1==d.ha.length&&(n(d.ha[0]),d=null):(n("Empty resource: "+a),d=null)}catch(h){n("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.Ua=g.load;d.Ta=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.la=g.symbols;d.ia.length?1==d.ia.length&&(n(d.ia[0]),d=null):(n("Empty resource: "+a),d=null)}catch(h){n("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Za=this.id:(this.Ra=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Ia:!1,Lb:!1,ga:!1,error:!1};this.Bb=null;this.v.error=!1;this.I={};this.i=null;this.la=d||0;t.push(this)}var cb=void 0,db={}; +function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Zb=b.comment;this.tc=b;b=this.id.indexOf(".");0>b?this.Za=this.id:(this.Ra=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Ia:!1,Lb:!1,ga:!1,error:!1};this.Bb=null;this.v.error=!1;this.I={};this.i=null;this.ma=d||0;t.push(this)}var cb=void 0,db={}; if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(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 u(a,b){b||(b=r);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ib=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ib={},t=[];function jb(a,b,c){ib[a]&&b&&(ib[a][b]=c)}function kb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.w=this.ua-1;this.C=this.H/this.ua|0;this.Ha=[];this.A=0;this.D=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.C);for(b=0;b>2;this.w=this.ua-1;this.C=this.H/this.ua|0;this.Ha=[];this.A=0;this.D=[];this.mc=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.Y=Array(this.C);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ha[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&D(this.i,64)&&C(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&D(this.i,64)&&C(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} function Pb(a,b,c){var d=!1,e=this.controller,f=e.Ha[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ha[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&D(this.i,64)&&C(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&D(this.i,64)&&C(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} function Qb(a,b){var c=-1,d=this.controller;(a=d.Ha[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.i&&D(this.i,64)&&C(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&D(this.i,64)&&C(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} function Rb(a,b,c){var d=!1,e=this.controller;if(a=e.Ha[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.i&&D(this.i,64)&&C(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&D(this.i,64)&&C(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ia;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.B)return m.xb+=m.B-f,m.B=f,!0;if(f>=m.B+m.xb){q=m.size-(f-p);q>g&&(q=g);m.xb=f-m.B+q;f=p+a.ua;g-=q;h++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.W[h++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ia;0>>=a.ia;0>>this.ia].Hb(a&this.w,a)};k.Db=function(a){this.A++;a=this.W[(a&this.f)>>>this.ia].Nb(a&this.w,a);this.A--;return a};k.na=function(a){return this.W[(a&this.f)>>>this.ia].oa(a&this.w,a)}; -k.rb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ia;this.A++;a=this.W[c].Ob(b,a);this.A--;return a};k.Ib=function(a,b){this.W[(a&this.f)>>>this.ia].Kb(a&this.w,b&255,a)};k.Xa=function(a,b){this.A++;this.W[(a&this.f)>>>this.ia].Tb(a&this.w,b&255,a);this.A--};k.Ya=function(a,b){this.W[(a&this.f)>>>this.ia].yb(a&this.w,b&65535,a)};k.Jb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ia;this.A++;this.W[d].Ub(c,b&65535,a);this.A--}; -function cc(a){for(var b=0,c=[],d=0;da.b.fb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!h&&p&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));dc(a,e,e,g,h,m,p,f[4])}}}function fc(a,b){a.D.push(b)} -function gc(a,b){a.A||(a.i&&D(a.i,536870912)&&C(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.ea(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Gb:20,gd:0};this.f={Td:0,Sb:-1}}u(K);k=K.prototype; +function Vb(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ja;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.B)return m.xb+=m.B-f,m.B=f,!0;if(f>=m.B+m.xb){q=m.size-(f-p);q>g&&(q=g);m.xb=f-m.B+q;f=p+a.ua;g-=q;h++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.ua,d,e);Sb(f,a.i,m);a.Y[h++]=f;f=p+a.ua;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ja;0>>=a.ja;0>>this.ja].Hb(a&this.w,a)};k.Db=function(a){this.A++;a=this.Y[(a&this.f)>>>this.ja].Nb(a&this.w,a);this.A--;return a};k.na=function(a){return this.Y[(a&this.f)>>>this.ja].oa(a&this.w,a)}; +k.fb=function(a){var b=a&this.w,c=(a&this.f)>>>this.ja;this.A++;a=this.Y[c].Ob(b,a);this.A--;return a};k.Ib=function(a,b){this.Y[(a&this.f)>>>this.ja].Kb(a&this.w,b&255,a)};k.Xa=function(a,b){this.A++;this.Y[(a&this.f)>>>this.ja].Tb(a&this.w,b&255,a);this.A--};k.Ya=function(a,b){this.Y[(a&this.f)>>>this.ja].yb(a&this.w,b&65535,a)};k.Jb=function(a,b){var c=a&this.w,d=(a&this.f)>>>this.ja;this.A++;this.Y[d].Ub(c,b&65535,a);this.A--}; +function cc(a){for(var b=0,c=[],d=0;da.b.gb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!h&&p&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));dc(a,e,e,g,h,m,p,f[4])}}}function fc(a,b){a.D.push(b)} +function gc(a,b){a.A||(a.i&&D(a.i,536870912)&&C(a.i,"memory fault on address "+J(a.i,b),!0,!0),a.b.fa(4,b))}function ac(a,b,c){n("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,Sd:0,Gb:20,gd:0};this.f={Td:0,Sb:-1}}u(K);k=K.prototype; k.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.Sb=hc(c,function(){e.f.Ka|=128;e.f.Ka&64&&(ic(e.b,e.f.hd),jc(e.b,e.f.Sb,1E3/60))});this.f.hd=kc(64,6);ec(b,this,L);fc(b,this.reset.bind(this));H(this)};k.reset=function(){this.g.Gb=this.g.Gb&-120|20;this.f.Ka=0};k.Dc=function(){var a=this.f.Ka;this.f.Ka&=-129;return a};k.rd=function(a){this.f.Ka=a;a&64&&jc(this.b,this.f.Sb,1E3/60);this.f.Ka=a&-129};k.wc=function(a){return(a?this.g.gd:this.g.data)&65535}; k.kd=function(a){this.g.data=a};k.Fc=function(){var a=this.b;return a.F&62337|a.wa<<5|a.xa<<1};k.td=function(a){var b=this.b;a&=62337;if(b.F!=a){b.F=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.La!=c&&(b.La=c,tc(b))}uc(this)};k.Gc=function(){var a=this.b.Na;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.Hc=function(){return this.b.vb};k.Ic=function(){return this.b.Oa}; -k.ud=function(a){var b=this.b;1170>b.fb&&(a&=-49);b.Oa!=a&&(b.Oa=a,a&16?(b.bb=4194303,b.ya=3915776):(b.bb=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Gb=a.g.Gb&-8|(a.b.La?a.b.Oa&16?1:2:4)}k.Wc=function(a){return this.b.T[1][a>>1&7]};k.Id=function(a,b){this.b.T[1][b>>1&7]=a&65295};k.Uc=function(a){return this.b.T[1][(a>>1&7)+8]};k.Gd=function(a,b){this.b.T[1][(b>>1&7)+8]=a&65295};k.Vc=function(a){return this.b.ta[1][a>>1&7]}; -k.Hd=function(a,b){b=b>>1&7;this.b.ta[1][b]=a;this.b.T[1][b]&=65295};k.Tc=function(a){return this.b.ta[1][(a>>1&7)+8]};k.Fd=function(a,b){b=(b>>1&7)+8;this.b.ta[1][b]=a;this.b.T[1][b]&=65295};k.Cc=function(a){return this.b.T[0][a>>1&7]};k.qd=function(a,b){this.b.T[0][b>>1&7]=a&65295};k.Ac=function(a){return this.b.T[0][(a>>1&7)+8]};k.od=function(a,b){this.b.T[0][(b>>1&7)+8]=a&65295};k.Bc=function(a){return this.b.ta[0][a>>1&7]};k.pd=function(a,b){b=b>>1&7;this.b.ta[0][b]=a;this.b.T[0][b]&=65295}; -k.zc=function(a){return this.b.ta[0][(a>>1&7)+8]};k.nd=function(a,b){b=(b>>1&7)+8;this.b.ta[0][b]=a;this.b.T[0][b]&=65295};k.bd=function(a){return this.b.T[3][a>>1&7]};k.Od=function(a,b){this.b.T[3][b>>1&7]=a&65295};k.$c=function(a){return this.b.T[3][(a>>1&7)+8]};k.Md=function(a,b){this.b.T[3][(b>>1&7)+8]=a&65295};k.ad=function(a){return this.b.ta[3][a>>1&7]};k.Nd=function(a,b){b=b>>1&7;this.b.ta[3][b]=a;this.b.T[3][b]&=65295};k.Zc=function(a){return this.b.ta[3][(a>>1&7)+8]}; -k.Ld=function(a,b){b=(b>>1&7)+8;this.b.ta[3][b]=a;this.b.T[3][b]&=65295};k.jb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};k.nb=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};k.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};k.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};k.Qc=function(){return this.b.u[7]};k.Cd=function(a){this.b.u[7]=a};k.kb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; -k.ob=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};k.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};k.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};k.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};k.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};k.yc=function(a){return this.b.gc[a-65504>>1]};k.md=function(a,b){this.b.gc[b-65504>>1]=a};k.dc=function(a){return 65520==a?61183:0};k.jc=function(){}; -k.Yc=function(){return 1};k.Kd=function(){};k.xc=function(){return this.b.$};k.ld=function(){this.b.$=0};k.Ec=function(){return this.b.fc};k.sd=function(a,b){b&1||(a&=255);this.b.fc=a};k.Jc=function(a){return a?this.b.Qb:0};k.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Qb=a;b.G|=2};k.Xc=function(a){return a?this.b.Pa&65280:0};k.Jd=function(a){this.b.Pa=a|255};k.Mc=function(){return Lb(this.b)};k.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.G|=128}; +k.ud=function(a){var b=this.b;1170>b.gb&&(a&=-49);b.Oa!=a&&(b.Oa=a,a&16?(b.bb=4194303,b.ya=3915776):(b.bb=262143,b.ya=253952),tc(b));uc(this)};function uc(a){a.g.Gb=a.g.Gb&-8|(a.b.La?a.b.Oa&16?1:2:4)}k.Wc=function(a){return this.b.U[1][a>>1&7]};k.Id=function(a,b){this.b.U[1][b>>1&7]=a&65295};k.Uc=function(a){return this.b.U[1][(a>>1&7)+8]};k.Gd=function(a,b){this.b.U[1][(b>>1&7)+8]=a&65295};k.Vc=function(a){return this.b.ta[1][a>>1&7]}; +k.Hd=function(a,b){b=b>>1&7;this.b.ta[1][b]=a;this.b.U[1][b]&=65295};k.Tc=function(a){return this.b.ta[1][(a>>1&7)+8]};k.Fd=function(a,b){b=(b>>1&7)+8;this.b.ta[1][b]=a;this.b.U[1][b]&=65295};k.Cc=function(a){return this.b.U[0][a>>1&7]};k.qd=function(a,b){this.b.U[0][b>>1&7]=a&65295};k.Ac=function(a){return this.b.U[0][(a>>1&7)+8]};k.od=function(a,b){this.b.U[0][(b>>1&7)+8]=a&65295};k.Bc=function(a){return this.b.ta[0][a>>1&7]};k.pd=function(a,b){b=b>>1&7;this.b.ta[0][b]=a;this.b.U[0][b]&=65295}; +k.zc=function(a){return this.b.ta[0][(a>>1&7)+8]};k.nd=function(a,b){b=(b>>1&7)+8;this.b.ta[0][b]=a;this.b.U[0][b]&=65295};k.bd=function(a){return this.b.U[3][a>>1&7]};k.Od=function(a,b){this.b.U[3][b>>1&7]=a&65295};k.$c=function(a){return this.b.U[3][(a>>1&7)+8]};k.Md=function(a,b){this.b.U[3][(b>>1&7)+8]=a&65295};k.ad=function(a){return this.b.ta[3][a>>1&7]};k.Nd=function(a,b){b=b>>1&7;this.b.ta[3][b]=a;this.b.U[3][b]&=65295};k.Zc=function(a){return this.b.ta[3][(a>>1&7)+8]}; +k.Ld=function(a,b){b=(b>>1&7)+8;this.b.ta[3][b]=a;this.b.U[3][b]&=65295};k.kb=function(a){a&=7;return this.b.L&2048?this.b.Ea[a]:this.b.u[a]};k.ob=function(a,b){b&=7;this.b.L&2048?this.b.Ea[b]=a:this.b.u[b]=a};k.Nc=function(){return this.b.L&49152?this.b.va[0]:this.b.u[6]};k.zd=function(a){this.b.L&49152?this.b.va[0]=a:this.b.u[6]=a};k.Qc=function(){return this.b.u[7]};k.Cd=function(a){this.b.u[7]=a};k.lb=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Ea[a]}; +k.pb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Ea[b]=a};k.Oc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[1]};k.Ad=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[1]=a};k.Pc=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.va[3]};k.Bd=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.va[3]=a};k.yc=function(a){return this.b.gc[a-65504>>1]};k.md=function(a,b){this.b.gc[b-65504>>1]=a};k.dc=function(a){return 65520==a?61183:0};k.jc=function(){}; +k.Yc=function(){return 1};k.Kd=function(){};k.xc=function(){return this.b.aa};k.ld=function(){this.b.aa=0};k.Ec=function(){return this.b.fc};k.sd=function(a,b){b&1||(a&=255);this.b.fc=a};k.Jc=function(a){return a?this.b.Qb:0};k.vd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Qb=a;b.G|=2};k.Xc=function(a){return a?this.b.Pa&65280:0};k.Jd=function(a){this.b.Pa=a|255};k.Mc=function(){return Lb(this.b)};k.yd=function(a){vc(this.b,a&-1809|Lb(this.b)&1808);this.b.G|=128}; k.ic=function(a,b){D(this)&&C(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; var M={},L=(M[62592]=[null,null,K.prototype.Wc,K.prototype.Id,"SISDR",1145],M[62608]=[null,null,K.prototype.Uc,K.prototype.Gd,"SDSDR",1145],M[62624]=[null,null,K.prototype.Vc,K.prototype.Hd,"SISAR",1145],M[62640]=[null,null,K.prototype.Tc,K.prototype.Fd,"SDSAR",1145],M[62656]=[null,null,K.prototype.Cc,K.prototype.qd,"KISDR",1145],M[62672]=[null,null,K.prototype.Ac,K.prototype.od,"KDSDR",1145],M[62688]=[null,null,K.prototype.Bc,K.prototype.pd,"KISAR",1145],M[62704]=[null,null,K.prototype.zc,K.prototype.nd, "KDSAR",1145],M[62798]=[null,null,K.prototype.Ic,K.prototype.ud,"MMR3",1145],M[65382]=[null,null,K.prototype.Dc,K.prototype.rd,"LKS"],M[65400]=[null,null,K.prototype.wc,K.prototype.kd,"CNSL"],M[65402]=[null,null,K.prototype.Fc,K.prototype.td,"MMR0",1145],M[65404]=[null,null,K.prototype.Gc,K.prototype.ic,"MMR1",1145],M[65406]=[null,null,K.prototype.Hc,K.prototype.ic,"MMR2",1145],M[65408]=[null,null,K.prototype.bd,K.prototype.Od,"UISDR",1145],M[65424]=[null,null,K.prototype.$c,K.prototype.Md,"UDSDR", -1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.jb,K.prototype.nb,"R0SET0"],M[65473]=[null,null,K.prototype.jb,K.prototype.nb,"R1SET0"],M[65474]=[null,null,K.prototype.jb,K.prototype.nb,"R2SET0"],M[65475]=[null,null,K.prototype.jb,K.prototype.nb,"R3SET0"],M[65476]=[null,null,K.prototype.jb,K.prototype.nb,"R4SET0"],M[65477]=[null,null,K.prototype.jb,K.prototype.nb,"R5SET0"],M[65478]= -[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.kb,K.prototype.ob,"R0SET1",1145],M[65481]=[null,null,K.prototype.kb,K.prototype.ob,"R1SET1",1145],M[65482]=[null,null,K.prototype.kb,K.prototype.ob,"R2SET1",1145],M[65483]=[null,null,K.prototype.kb,K.prototype.ob,"R3SET1",1145],M[65484]=[null,null,K.prototype.kb,K.prototype.ob,"R4SET1",1145],M[65485]=[null,null,K.prototype.kb,K.prototype.ob,"R5SET1",1145], +1145],M[65440]=[null,null,K.prototype.ad,K.prototype.Nd,"UISAR",1145],M[65456]=[null,null,K.prototype.Zc,K.prototype.Ld,"UDSAR",1145],M[65472]=[null,null,K.prototype.kb,K.prototype.ob,"R0SET0"],M[65473]=[null,null,K.prototype.kb,K.prototype.ob,"R1SET0"],M[65474]=[null,null,K.prototype.kb,K.prototype.ob,"R2SET0"],M[65475]=[null,null,K.prototype.kb,K.prototype.ob,"R3SET0"],M[65476]=[null,null,K.prototype.kb,K.prototype.ob,"R4SET0"],M[65477]=[null,null,K.prototype.kb,K.prototype.ob,"R5SET0"],M[65478]= +[null,null,K.prototype.Nc,K.prototype.zd,"R6KERNEL"],M[65479]=[null,null,K.prototype.Qc,K.prototype.Cd,"R7KERNEL"],M[65480]=[null,null,K.prototype.lb,K.prototype.pb,"R0SET1",1145],M[65481]=[null,null,K.prototype.lb,K.prototype.pb,"R1SET1",1145],M[65482]=[null,null,K.prototype.lb,K.prototype.pb,"R2SET1",1145],M[65483]=[null,null,K.prototype.lb,K.prototype.pb,"R3SET1",1145],M[65484]=[null,null,K.prototype.lb,K.prototype.pb,"R4SET1",1145],M[65485]=[null,null,K.prototype.lb,K.prototype.pb,"R5SET1",1145], M[65486]=[null,null,K.prototype.Oc,K.prototype.Ad,"R6SUPER",1145],M[65487]=[null,null,K.prototype.Pc,K.prototype.Bd,"R6USER",1145],M[65504]=[null,null,K.prototype.yc,K.prototype.md,"CTRL",1170],M[65520]=[null,null,K.prototype.dc,K.prototype.jc,"LSIZE",1170],M[65522]=[null,null,K.prototype.dc,K.prototype.jc,"HSIZE",1170],M[65524]=[null,null,K.prototype.Yc,K.prototype.Kd,"SYSID",1170],M[65526]=[null,null,K.prototype.xc,K.prototype.ld,"CPUERR",1170],M[65528]=[null,null,K.prototype.Ec,K.prototype.sd, "MB",1170],M[65530]=[null,null,K.prototype.Jc,K.prototype.vd,"PIR"],M[65532]=[null,null,K.prototype.Xc,K.prototype.Jd,"SL"],M[65534]=[null,null,K.prototype.Mc,K.prototype.yd,"PSW"],M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624]; L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688]; @@ -90,177 +90,178 @@ if(sb){var yc=new ArrayBuffer(2);(new DataView(yc)).setUint16(0,256,!0);xc=256== function I(a,b,c,d,e,f){this.w=a;this.id=Ac+=2;this.b=null;this.B=b;this.xb=c;this.size=d||0;this.type=e||Bc;this.f=e==Cc;this.controller=null;Sb(this);this.Ja=this.pc=!1;if(d)if(f)this.controller=f,this.b=null,Dc(this,f.mc);else if(sb)this.A=new ArrayBuffer(d),this.F=new DataView(this.A,0,d),this.C=new Uint8Array(this.A,0,d),this.J=new Uint16Array(this.A,0,d>>1),this.b=new Int32Array(this.A,0,d>>2),Dc(this,zc?Ec:Fc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},U:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a,b){a&1&&gc(this.w,b);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},sa: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.Ja=!0},O:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,1,c.M)&&c.ba(!0)}return this.Nb(a,b)},ca:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,2,c.M)&&c.ba(!0)}return this.Ob(a,b)},qa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a, -1,d.C)&&d.ba(!0)}this.f?this.D(a,b,c):this.Tb(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a,2,d.C)&&d.ba(!0)}this.f?this.D(a,b,c):this.Ub(a,b,c)},N:function(a){return this.C[a]},P:function(a,b){a=this.C[a];this.i&&D(this.i,128)&&C(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Z:function(a,b){a&1&&gc(this.w,b);return this.F.getUint16(a,!0)},fa:function(a,b){a&1&&gc(this.w,b);a=this.J[a>>1];this.i&&D(this.i,128)&&C(this.i,"Memory.readWord("+J(this.i, +l(this.B),!0),this.i.ca());return 255},D:function(a,b){this.i&&D(this.i,128)&&(C(this.i,"attempt to write "+l(b,4,!0)+" to invalid block %"+l(this.B),!0),this.i.ca())},M:function(a,b){return this.Hb(a++,b++)|this.Hb(a,b)<<8},H:function(a,b,c){this.Kb(a++,b&255,c++);this.Kb(a,b>>8,c)},R:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ha:function(a,b){a&1&&gc(this.w,b);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},sa: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.Ja=!0},O:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,1,c.M)&&c.ca(!0)}return this.Nb(a,b)},X:function(a,b){if(this.i&&null!=this.B){var c=this.i;Kc(c,this.B+a,2,c.M)&&c.ca(!0)}return this.Ob(a,b)},qa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a,1, +d.C)&&d.ca(!0)}this.f?this.D(a,b,c):this.Tb(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.B){var d=this.i;Kc(d,this.B+a,2,d.C)&&d.ca(!0)}this.f?this.D(a,b,c):this.Ub(a,b,c)},N:function(a){return this.C[a]},P:function(a,b){a=this.C[a];this.i&&D(this.i,128)&&C(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},W:function(a,b){a&1&&gc(this.w,b);return this.F.getUint16(a,!0)},da:function(a,b){a&1&&gc(this.w,b);a=this.J[a>>1];this.i&&D(this.i,128)&&C(this.i,"Memory.readWord("+J(this.i, b)+"): "+J(this.i,a),!0);return a},pa:function(a,b){this.C[a]=b;this.Ja=!0},Ra:function(a,b,c){this.C[a]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&gc(this.w,c);this.F.setUint16(a,b,!0);this.Ja=!0},ya:function(a,b,c){a&1&&gc(this.w,c);this.J[a>>1]=b;this.Ja=!0;this.i&&D(this.i,128)&&C(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0)}}; function Sb(a,b,c){a.i=b;a.g=a.I=0;c&&((a.g=c.g)&&Jc(a,Ic,!1),(a.I=c.I)&&Hc(a,Ic,!1))}function Lc(a,b){b?--a.I||(a.Kb=a.f?a.D:a.Tb,a.yb=a.f?a.H:a.Ub):--a.g||(a.Hb=a.Nb,a.oa=a.Ob)}function Hc(a,b,c){c&&a.I||(a.Kb=!a.f&&b[1]||a.D,a.yb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Tb=b[1]||a.D,a.Ub=b[3]||a.H}function Jc(a,b,c){c&&a.g||(a.Hb=b[0]||a.K,a.oa=b[2]||a.M);if(c||void 0===c)a.Nb=b[0]||a.K,a.Ob=b[2]||a.M}function Dc(a,b){b||(b=Mc);Jc(a,b,void 0);Hc(a,b,void 0)} -var Mc=[],Gc=[I.prototype.U,I.prototype.sa,I.prototype.ma,I.prototype.Za],Ic=[I.prototype.O,I.prototype.qa,I.prototype.ca,I.prototype.xa];if(sb)var Fc=[I.prototype.N,I.prototype.pa,I.prototype.Z,I.prototype.wa],Ec=[I.prototype.P,I.prototype.Ra,I.prototype.fa,I.prototype.ya]; -function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.Ma=c;this.ab=Math.round(this.Ga/1E4)/100;this.Wa=this.ab*this.Ma;this.v.da=!1;this.v.Rb=!1;this.v.pb=a.autoStart;this.v.cb=!1;this.sb=this.ma=0;this.tb=a.csStart;this.gb=a.csInterval;this.hb=a.csStop;this.K=[];this.Fb=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];k=Nc.prototype; -k.Ca=function(a,b,c,d){this.D=a;this.w=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.gb,c=!0);0<=a.hb&&a.hb<=Uc(a)&&(a.gb=a.hb=-1,Rc(a),a.ba(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+l(a.sb))}} -k.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.D)if(a=d.D,a.v.ga)a=!0;else{var b=null,c,h=kb(a.id);for(c=0;ca.U/a.Wa?b=1:d=!0;a.Ma=b;b=a.ab*a.Ma;if(a.Wa!=b){a.Wa=b;b=a.Wa.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.D&&a.D.wb()}Wc(a,a.O);a.O=0;a.N=za();a.Z=0;Xc(a);return d}function hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function jc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Ga*a.Ma/1E3*c|0,a.K[b][0]=c+Yc(a))} -function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function $c(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Yc(a,b){var c=a.ca-=a.b;a.b=0;b&&(a.ca=0);return c} -k.fd=function(){if(this.v.da){this.eb>=this.Ga&&Xc(this,!0);this.sa=0;this.Fa=za();if(this.Z){var a=this.Fa-this.Z;a>this.Cb&&(this.N+=a,this.N>this.Fa&&(this.N=this.Fa))}try{do{var b=Zc(this,this.v.cb?1:this.Qa);try{this.mb(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.sa+=b;this.O+=b;Tc(this,b);$c(this,b);this.pa-=b;if(0>=this.pa){this.pa+=this.Qa;15<=++this.Eb&&(this.D&&this.D.aa(),this.Eb=0);break}}while(this.v.da)}catch(e){this.ba();this.D&&this.D.stop(za(),Uc(this));rb(this, -e.stack||e.message);return}if(this.v.da){a=setTimeout;b=this.Fb;this.Z=za();var c=this.Cb;this.sa&&(c=Math.round(c*this.sa/this.Qa));var c=c-(this.Z-this.Fa),d=this.Z-this.N;d&&(this.U=Math.round(this.O/(10*d))/100,864E5<=d&&(this.fa=0,Vc(this)));if(0>c||this.Uc&&(this.N-=c),c=0;this.eb+=this.sa;this.Z+=c;a(b,c)}}}; -k.lb=function(a){if(qb(this))return!1;if(this.v.da)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.da=!0;this.v.Rb=!0;var b=this.I.run;b&&(b.textContent="Halt");this.D&&(a&&this.D.wb(!0),this.D.start(this.N,Uc(this)));setTimeout(this.Fb,0);return!0};k.mb=function(){return 0};k.ba=function(a){if(this.v.da){Yc(this);Wc(this,this.O);this.O=0;this.v.da=!1;var b=this.I.run;b&&(b.textContent="Run");this.D&&this.D.stop(za(),Uc(this))}this.v.complete=a}; -function ad(a){this.fb=+a.model||1170;this.zb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.fb?bd.bind(this):cd.bind(this);dd(this);this.A=0;this.P=null;this.v.complete=this.v.oc=!1}u(ad,Nc);k=ad.prototype;k.reset=function(){this.status("model "+this.fb);this.v.da&&this.ba();dd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; -function dd(a){a.R=65536;a.S=32768;a.X=65535;a.V=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.zb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.C=0;a.xa=0;a.sc=[4,2,0,1];a.T=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ta=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.G=0;a.H=a.J=0;a.g=a.f=a.$a=0;a.qa=-1;ed(a)}function ed(a){a.Pa=255;a.$=0;a.Qb=0;a.F=0;a.Na=0;a.vb=0;a.Oa=0;a.La=0;a.wa=0;a.bb=262143;a.ya=253952;a.G|=2;a.w&&tc(a)}function tc(a){a.La?(a.M=65536,a.Y=a.rc,a.oa=a.cd,a.yb=a.Pd,Vb(a.w,a.Oa&16?22:18)):(a.M=0,a.Y=a.qc,a.oa=a.ec,a.yb=a.kc,Vb(a.w,16))}function fd(a,b){a.zb=b;N(a,b);a.i&&(a.ba(),a.i.aa())}k.$b=function(){return 0}; -k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.fa,this.Ma]);a.set(2,cc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.fa=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.C!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.C]);a.L=b;a.G|=2}function P(a,b){a.G&128||(a.V=a.X=b,a.S=0)}function Ed(a,b,c){a.G&128||(a.V=a.X=a.R=b,a.S=c||0)}function Fd(a,b,c,d){a.G&128||(a.V=a.X=a.R=b,a.S=(c^b)&(d^b))}function Gd(a,b){a.G&128||(a.V=a.X=a.R=b,a.S=a.V^a.R>>1)} -function Hd(a,b,c,d){a.G&128||(a.V=a.X=a.R=b,a.S=(c^d)&(d^b))}k.ea=function(a,b){if(!this.A){var c=!1;0>this.qa?this.qa=Lb(this):this.C||(a=4,c=!0);this.F&57344||(this.Na=63222,this.vb=a);this.C=0;var d=this.oa(a|this.M),e=this.oa(a+2&65535|this.M);vc(this,e&-12289|this.qa>>2&12288);c&&(this.$|=4,this.u[6]=4);Id(this,this.qa);Id(this,this.u[7]);N(this,d);this.G&=-113;this.qa=-1;if(26!=b)throw a;}};function Jd(a){var b=Kd(a),c=Kd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);N(a,b);vc(a,c);a.G&=-17} -function Ld(a,b,c){var d,e,f,g=0;d=b>>13;a.Oa&a.sc[a.C]||(d&=7);e=a.T[a.C][d];f=(a.ta[a.C][d]<<6)+(b&8191)&a.bb;if(ff){if(3932160<=f){f&=262143;var h=f>>13&31;31>h?a.Oa&32&&(f=a.uc[h]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.$|=32,a.ea(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4? -192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.T[a.C][d]=e;if(4194170!==f||a.C)a.wa=a.C,a.xa=d;g&&(g&57344&&(0<=a.qa&&(g|=128),a.F&57344||(a.F=a.F|g|a.wa<<5|a.xa<<1),a.ea(168,16)),a.F&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.oa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.oa(e)|g; -a.b-=8;break;case 6:return e=a.oa(Dd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.oa(Dd(a,2)),e=e+a.u[c]&65535,e=a.oa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Na=a.Na<<8|f<<3&248|c);6==c&&!a.C&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.$|=4,a.u[6]=4,a.ea(4,24)):(a.$|=8,a.G|=64));return e}k.Db=function(a){if(!this.La)return this.w.Db(a);this.A++;a=Md(this,Ld(this,a,3));this.A--;return a}; -k.rb=function(a){if(!this.La)return this.w.rb(a);this.A++;a=this.ec(Ld(this,a,2));this.A--;return a};k.Xa=function(a,b){this.La?(this.A++,Nd(this,Ld(this,a,5),b),this.A--):this.w.Xa(a,b)};k.Jb=function(a,b){this.La?(this.A++,this.kc(Ld(this,a,4),b),this.A--):this.w.Jb(a,b)};k.qc=function(a,b,c){return Od(this,a,b,c)};k.rc=function(a,b,c){return Ld(this,Od(this,a,b,c),c)};k.ec=function(a){return this.w.na(a)};k.cd=function(a){return this.w.na(Ld(this,a,2))};k.kc=function(a,b){this.w.Ya(a,b&65535)}; +var Mc=[],Gc=[I.prototype.R,I.prototype.sa,I.prototype.ha,I.prototype.Za],Ic=[I.prototype.O,I.prototype.qa,I.prototype.X,I.prototype.xa];if(sb)var Fc=[I.prototype.N,I.prototype.pa,I.prototype.W,I.prototype.wa],Ec=[I.prototype.P,I.prototype.Ra,I.prototype.da,I.prototype.ya]; +function Nc(a,b){r.call(this,"CPU",a,Nc,1);var c=a.multiplier||1;this.Ga=a.cycles||b;this.Ma=c;this.ab=Math.round(this.Ga/1E4)/100;this.Wa=this.ab*this.Ma;this.v.ea=!1;this.v.Rb=!1;this.v.qb=a.autoStart;this.v.cb=!1;this.sb=this.ha=0;this.tb=a.csStart;this.hb=a.csInterval;this.ib=a.csStop;this.K=[];this.Fb=this.fd.bind(this);H(this)}u(Nc);var Oc=["power","reset"];k=Nc.prototype; +k.Ca=function(a,b,c,d){this.D=a;this.w=b;this.i=d;for(b=0;b=a.ha&&(a.ha+=a.hb,c=!0);0<=a.ib&&a.ib<=Uc(a)&&(a.hb=a.ib=-1,Rc(a),a.ca(),c=!0);c&&a.j(Uc(a)+" cycles: checksum="+l(a.sb))}} +k.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.D)if(a=d.D,a.v.ga)a=!0;else{var b=null,c,h=kb(a.id);for(c=0;ca.R/a.Wa?b=1:d=!0;a.Ma=b;b=a.ab*a.Ma;if(a.Wa!=b){a.Wa=b;b=a.Wa.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.D&&a.D.wb()}Wc(a,a.O);a.O=0;a.N=za();a.W=0;Xc(a);return d}function hc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function jc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.Ga*a.Ma/1E3*c|0,a.K[b][0]=c+Yc(a))} +function Zc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function $c(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Yc(a,b){var c=a.X-=a.b;a.b=0;b&&(a.X=0);return c} +k.fd=function(){if(this.v.ea){this.eb>=this.Ga&&Xc(this,!0);this.sa=0;this.Fa=za();if(this.W){var a=this.Fa-this.W;a>this.Cb&&(this.N+=a,this.N>this.Fa&&(this.N=this.Fa))}try{do{var b=Zc(this,this.v.cb?1:this.Qa);try{this.nb(b)}catch(e){if("number"!=typeof e)throw e;}b=Yc(this,!0);this.sa+=b;this.O+=b;Tc(this,b);$c(this,b);this.pa-=b;if(0>=this.pa){this.pa+=this.Qa;15<=++this.Eb&&(this.D&&this.D.ba(),this.Eb=0);break}}while(this.v.ea)}catch(e){this.ca();this.D&&this.D.stop(za(),Uc(this));rb(this, +e.stack||e.message);return}if(this.v.ea){a=setTimeout;b=this.Fb;this.W=za();var c=this.Cb;this.sa&&(c=Math.round(c*this.sa/this.Qa));var c=c-(this.W-this.Fa),d=this.W-this.N;d&&(this.R=Math.round(this.O/(10*d))/100,864E5<=d&&(this.da=0,Vc(this)));if(0>c||this.Rc&&(this.N-=c),c=0;this.eb+=this.sa;this.W+=c;a(b,c)}}}; +k.mb=function(a){if(qb(this))return!1;if(this.v.ea)return this.j(this.toString()+" busy"),!1;Vc(this);this.v.ea=!0;this.v.Rb=!0;var b=this.I.run;b&&(b.textContent="Halt");this.D&&(a&&this.D.wb(!0),this.D.start(this.N,Uc(this)));setTimeout(this.Fb,0);return!0};k.nb=function(){return 0};k.ca=function(a){if(this.v.ea){Yc(this);Wc(this,this.O);this.O=0;this.v.ea=!1;var b=this.I.run;b&&(b.textContent="Run");this.D&&this.D.stop(za(),Uc(this))}this.v.complete=a}; +function ad(a){this.gb=+a.model||1170;this.zb=a.addrReset||0;Nc.call(this,a,6666667);this.decode=1120==this.gb?bd.bind(this):cd.bind(this);dd(this);this.A=0;this.P=null;this.v.complete=this.v.oc=!1}u(ad,Nc);k=ad.prototype;k.reset=function(){this.status("model "+this.gb);this.v.ea&&this.ca();dd(this);Qc(this);this.v.error=!1;this.parent.reset.call(this)}; +function dd(a){a.S=65536;a.T=32768;a.Z=65535;a.V=32768;a.L=15;a.u=[0,0,0,0,0,0,0,a.zb];a.Ea=[0,0,0,0,0,0];a.va=[0,0,0,0];a.C=0;a.xa=0;a.sc=[4,2,0,1];a.U=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ta=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.uc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.gc=[0,0,0,0,0,0,0,0];a.fc=0;a.G=0;a.H=a.J=0;a.g=a.f=a.$a=0;a.qa=-1;ed(a)}function ed(a){a.Pa=255;a.aa=0;a.Qb=0;a.F=0;a.Na=0;a.vb=0;a.Oa=0;a.La=0;a.wa=0;a.bb=262143;a.ya=253952;a.G|=2;a.w&&tc(a)}function tc(a){a.La?(a.M=65536,a.$=a.rc,a.oa=a.cd,a.yb=a.Pd,Vb(a.w,a.Oa&16?22:18)):(a.M=0,a.$=a.qc,a.oa=a.ec,a.yb=a.kc,Vb(a.w,16))}function fd(a,b){a.zb=b;N(a,b);a.i&&(a.ca(),a.i.ba())}k.$b=function(){return 0}; +k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.da,this.Ma]);a.set(2,cc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.da=b[1];Vc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.L>>14&3;a.C!=c&&(a.va[c]=a.u[6],a.u[6]=a.va[a.C]);a.L=b;a.G|=2}function P(a,b){a.G&128||(a.V=a.Z=b,a.T=0)}function Ed(a,b,c){a.G&128||(a.V=a.Z=a.S=b,a.T=c||0)}function Fd(a,b,c,d){a.G&128||(a.V=a.Z=a.S=b,a.T=(c^b)&(d^b))}function Gd(a,b){a.G&128||(a.V=a.Z=a.S=b,a.T=a.V^a.S>>1)} +function Hd(a,b,c,d){a.G&128||(a.V=a.Z=a.S=b,a.T=(c^d)&(d^b))}k.fa=function(a,b){if(!this.A){var c=!1;0>this.qa?this.qa=Lb(this):this.C||(a=4,c=!0);this.F&57344||(this.Na=63222,this.vb=a);this.C=0;var d=this.oa(a|this.M),e=this.oa(a+2&65535|this.M);vc(this,e&-12289|this.qa>>2&12288);c&&(this.aa|=4,this.u[6]=4);Id(this,this.qa);Id(this,this.u[7]);N(this,d);this.G&=-113;this.qa=-1;if(26!=b)throw a;}};function Jd(a){var b=Kd(a),c=Kd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);N(a,b);vc(a,c);a.G&=-17} +function Ld(a,b,c){var d,e,f,g=0;d=b>>13;a.Oa&a.sc[a.C]||(d&=7);e=a.U[a.C][d];f=(a.ta[a.C][d]<<6)+(b&8191)&a.bb;if(ff){if(3932160<=f){f&=262143;var h=f>>13&31;31>h?a.Oa&32&&(f=a.uc[h]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.aa|=32,a.fa(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c& +4?192:128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.U[a.C][d]=e;if(4194170!==f||a.C)a.wa=a.C,a.xa=d;g&&(g&57344&&(0<=a.qa&&(g|=128),a.F&57344||(a.F=a.F|g|a.wa<<5|a.xa<<1),a.fa(168,16)),a.F&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.oa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.oa(e)| +g;a.b-=8;break;case 6:return e=a.oa(Dd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.oa(Dd(a,2)),e=e+a.u[c]&65535,e=a.oa(e|a.M)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Na=a.Na<<8|f<<3&248|c);6==c&&!a.C&&d&4&&0>=f&&(a.u[6]<=a.Pa||65534<=a.u[6])&&(a.u[6]<=a.Pa-32?(a.aa|=4,a.u[6]=4,a.fa(4,24)):(a.aa|=8,a.G|=64));return e}k.Db=function(a){if(!this.La)return this.w.Db(a);this.A++;a=Md(this,Ld(this,a,3));this.A--;return a}; +k.fb=function(a){if(!this.La)return this.w.fb(a);this.A++;a=this.ec(Ld(this,a,2));this.A--;return a};k.Xa=function(a,b){this.La?(this.A++,Nd(this,Ld(this,a,5),b),this.A--):this.w.Xa(a,b)};k.Jb=function(a,b){this.La?(this.A++,this.kc(Ld(this,a,4),b),this.A--):this.w.Jb(a,b)};k.qc=function(a,b,c){return Od(this,a,b,c)};k.rc=function(a,b,c){return Ld(this,Od(this,a,b,c),c)};k.ec=function(a){return this.w.na(a)};k.cd=function(a){return this.w.na(Ld(this,a,2))};k.kc=function(a,b){this.w.Ya(a,b&65535)}; k.Pd=function(a,b){this.w.Ya(Ld(this,a,4),b)};function Pd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Od(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.C=a.L>>12&3,c=a.oa(d|c&a.M),a.C=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.va[a.L>>12&3];return c}function Qd(a,b,c,d){a.F&57344||(a.Na=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Od(a,b,e,4),c&65536||(e&=65535),a.C=a.L>>12&3,e=Ld(a,e|c&65536,4),a.C=a.L>>14&3,a.w.Ya(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.va[a.L>>12&3]=d} -function Rd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?Md(a,a.Y(b,c,3)):a.u[c]&255}function Sd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]}function Td(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Od(a,b,c,8)}function Ud(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Md(a,a.Y(b,c,3)):a.u[c]&255}function Vd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.na(a.Y(b,c,2)):a.u[c]} -function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.$a=a.Y(b,e,7),Nd(a,e,d.call(a,c,Md(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Y(b,e,6),a.w.Ya(e,d.call(a,c,a.w.na(e)))):a.u[e]=d.call(a,c,a.u[e])}function Wd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Nd(a,a.Y(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Xd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Ya(a.Y(b,d,4),c):a.u[d]=c&65535;return c} +function Rd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?Md(a,a.$(b,c,3)):a.u[c]&255}function Sd(a,b){b>>=6;var c=a.J=b&7;return(b=a.H=(b&56)>>3)?a.w.na(a.$(b,c,2)):a.u[c]}function Td(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Od(a,b,c,8)}function Ud(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Md(a,a.$(b,c,3)):a.u[c]&255}function Vd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.na(a.$(b,c,2)):a.u[c]} +function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.$a=a.$(b,e,7),Nd(a,e,d.call(a,c,Md(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.$(b,e,6),a.w.Ya(e,d.call(a,c,a.w.na(e)))):a.u[e]=d.call(a,c,a.u[e])}function Wd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Nd(a,a.$(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Xd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.Ya(a.$(b,d,4),c):a.u[d]=c&65535;return c} function S(a,b,c){c&&(N(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -k.mb=function(a){this.v.complete=!0;var b=this.v.oc=this.i&&Yd(this.i),c=a?this.v.Rb?0:1:-1;this.v.Rb=!1;this.ca=this.b=a;do{if(b){if(Zd(this.i,this.u[7],c)){this.ba();break}c=1}if(this.G&&(this.G&112&&(this.G&32?this.ea(168,28):this.G&64?this.ea(4,30):this.G&16&&this.ea(12,32),this.G&=-113),this.G&7))if(this.G&2){this.G&=-3;var d=160,e=(this.Qb&224)>>5;if(a=this.P&&this.P.ib>e?this.P:null)d=a.jd,e=a.ib;e>(this.L&224)>>5?(this.G&4&&(Dd(this,2),this.G&=-5),this.ea(d,26),e=!0):e=!1;if(e&&a)if(e=this.P, -e==a)this.P=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.G&1&&this.G++;this.G=this.G&7|this.L&16;this.decode(jd(this))}while(0>5;if(a=this.P&&this.P.jb>e?this.P:null)d=a.jd,e=a.jb;e>(this.L&224)>>5?(this.G&4&&(Dd(this,2),this.G&=-5),this.fa(d,26),e=!0):e=!1;if(e&&a)if(e=this.P, +e==a)this.P=a.next;else for(;e;){d=e.next;if(d==a){e.next=d.next;break}e=d}}else this.G&1&&this.G++;this.G=this.G&7|this.L&16;this.decode(jd(this))}while(0>1|b<<16;Gd(this,a);return a&65535}function ee(a,b){a=b&2048|b>>1|b<<8;Gd(this,a<<8);return a&255}function fe(a,b){a=b&~a;P(this,a);return a}function ge(a,b){a=b&~a;P(this,a<<8);return a}function he(a,b){a|=b;P(this,a);return a}function ie(a,b){a|=b;P(this,a<<8);return a}function je(a,b){a=~b|65536;Ed(this,a);return a&65535} -function ke(a,b){a=~b|256;Ed(this,a<<8);return a&255}function le(a,b){a=b-a;this.G&128||(this.V=this.X=a,this.S=b&(b^a));return a&65535}function me(a,b){a=b-a;var c=a<<8;b<<=8;this.G&128||(this.V=this.X=c,this.S=b&(b^c));return a&255}function ne(a,b){a=b+a;this.G&128||(this.V=this.X=a,this.S=a&(b^a));return a&65535}function oe(a,b){a=b+a;var c=a<<8;this.G&128||(this.V=this.X=c,this.S=c&(b<<8^c));return a&255}function pe(a,b){a=-b;Ed(this,a,a&b&32768);return a&65535} -function qe(a,b){a=-b;Ed(this,a<<8,(a&b&128)<<8);return a&255}function re(a,b){a=b<<1|this.R>>16&1;Gd(this,a);return a&65535}function se(a,b){a=b<<1|this.R>>16&1;Gd(this,a<<8);return a&255}function te(a,b){a=(this.R&65536|b)>>1|b<<16;Gd(this,a);return a&65535}function ue(a,b){a=((this.R&65536)>>8|b)>>1|b<<8;Gd(this,a<<8);return a&255}function ve(a,b){var c=b-a;Hd(this,c,a,b);return c&65535}function we(a,b){var c=b-a;Hd(this,c<<8,a<<8,b<<8);return c&255} -function xe(a,b){this.G&128||(this.V=this.X=b&65280,this.S=this.R=0);return(b<<8|b>>8)&65535}function ye(a,b){a^=b;P(this,a);return a&65535}function ze(a){R(this,a,Sd(this,a),$d);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function Ae(a){var b=Vd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.R=this.S=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.S=32768)}this.u[a]=c&65535;this.V=this.X=c;this.b-=(this.g?6:7)+b} -function Be(a){var b=Vd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=0;b&=63;if(b&32){b=64-b;32>b-1;this.R=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.V=d>>16;this.X=d>>16|d;this.b-=(this.g?6:7)+b}function Ce(a){S(this,a,!gd(this))}function De(a){S(this,a,gd(this))} +function ke(a,b){a=~b|256;Ed(this,a<<8);return a&255}function le(a,b){a=b-a;this.G&128||(this.V=this.Z=a,this.T=b&(b^a));return a&65535}function me(a,b){a=b-a;var c=a<<8;b<<=8;this.G&128||(this.V=this.Z=c,this.T=b&(b^c));return a&255}function ne(a,b){a=b+a;this.G&128||(this.V=this.Z=a,this.T=a&(b^a));return a&65535}function oe(a,b){a=b+a;var c=a<<8;this.G&128||(this.V=this.Z=c,this.T=c&(b<<8^c));return a&255}function pe(a,b){a=-b;Ed(this,a,a&b&32768);return a&65535} +function qe(a,b){a=-b;Ed(this,a<<8,(a&b&128)<<8);return a&255}function re(a,b){a=b<<1|this.S>>16&1;Gd(this,a);return a&65535}function se(a,b){a=b<<1|this.S>>16&1;Gd(this,a<<8);return a&255}function te(a,b){a=(this.S&65536|b)>>1|b<<16;Gd(this,a);return a&65535}function ue(a,b){a=((this.S&65536)>>8|b)>>1|b<<8;Gd(this,a<<8);return a&255}function ve(a,b){var c=b-a;Hd(this,c,a,b);return c&65535}function we(a,b){var c=b-a;Hd(this,c<<8,a<<8,b<<8);return c&255} +function xe(a,b){this.G&128||(this.V=this.Z=b&65280,this.T=this.S=0);return(b<<8|b>>8)&65535}function ye(a,b){a^=b;P(this,a);return a&65535}function ze(a){R(this,a,Sd(this,a),$d);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} +function Ae(a){var b=Vd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.S=this.T=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.T=32768)}this.u[a]=c&65535;this.V=this.Z=c;this.b-=(this.g?6:7)+b} +function Be(a){var b=Vd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.S=this.T=0;b&=63;if(b&32){b=64-b;32>b-1;this.S=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.V=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function Ce(a){S(this,a,!gd(this))}function De(a){S(this,a,gd(this))} function Ee(a){R(this,a,Sd(this,a),fe);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Fe(a){Q(this,a,Rd(this,a),ge);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function Ge(a){R(this,a,Sd(this,a),he);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function He(a){Q(this,a,Rd(this,a),ie);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} function Ie(a){P(this,Sd(this,a)&Vd(this,a));this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Je(a){P(this,(Rd(this,a)&Ud(this,a))<<8);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ke(a){S(this,a,id(this))}function Le(a){S(this,a,!this.Da()==!hd(this))}function Me(a){S(this,a,!id(this)&&!this.Da()==!hd(this))}function Ne(a){S(this,a,!gd(this)&&!id(this))}function Oe(a){S(this,a,id(this)||!this.Da()!=!hd(this))} -function Pe(a){S(this,a,gd(this)||id(this))}function Qe(a){S(this,a,!this.Da()!=!hd(this))}function Re(a){S(this,a,this.Da())}function Se(a){S(this,a,!id(this))}function Te(a){S(this,a,!this.Da())}function Ue(){this.ea(12,1);this.b-=5}function Ve(a){S(this,a,!0)}function We(a){S(this,a,!hd(this))}function Xe(a){S(this,a,hd(this))}function T(a){a&1&&(this.R=0);a&2&&(this.S=0);a&4&&(this.X=1);a&8&&(this.V=0);this.b-=5} +function Pe(a){S(this,a,gd(this)||id(this))}function Qe(a){S(this,a,!this.Da()!=!hd(this))}function Re(a){S(this,a,this.Da())}function Se(a){S(this,a,!id(this))}function Te(a){S(this,a,!this.Da())}function Ue(){this.fa(12,1);this.b-=5}function Ve(a){S(this,a,!0)}function We(a){S(this,a,!hd(this))}function Xe(a){S(this,a,hd(this))}function T(a){a&1&&(this.S=0);a&2&&(this.T=0);a&4&&(this.Z=1);a&8&&(this.V=0);this.b-=5} function Ye(a){var b=Sd(this,a);a=Vd(this,a);Hd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)}function Ze(a){var b=Rd(this,a)<<8;a=Ud(this,a)<<8;Hd(this,b-a,a,b);this.b-=this.g?4+(this.J&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)} -function $e(a){var b=Vd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=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.X=d>>16|d,this.V=d>>16):(this.S=32768,this.X=d>>15|d,this.V=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.V=0,this.S=32768,this.R=65536,this.b-=7}function af(){this.ea(24,2);this.b-=25} -function bf(){this.L&49152?(this.$|=128,this.ea(4,3)):this.i?$b(this.i):this.ba();this.b-=7}function cf(){this.ea(16,4);this.b-=25}var df=[0,7,7,10,7,11,9,13];function ef(a){var b=this.b;N(this,Td(this,a));this.b=b-df[this.g]}var ff=[0,14,14,17,14,18,16,20];function gf(a){var b=this.b,c=Td(this,a);a=a>>6&7;Id(this,this.u[a]);this.u[a]=this.u[7];N(this,c);this.b=b-ff[this.g]}var hf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; +function $e(a){var b=Vd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.S=this.T=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.Z=d>>16|d,this.V=d>>16):(this.T=32768,this.Z=d>>15|d,this.V=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.V=0,this.T=32768,this.S=65536,this.b-=7}function af(){this.fa(24,2);this.b-=25} +function bf(){this.L&49152?(this.aa|=128,this.fa(4,3)):this.i?$b(this.i):this.ca();this.b-=7}function cf(){this.fa(16,4);this.b-=25}var df=[0,7,7,10,7,11,9,13];function ef(a){var b=this.b;N(this,Td(this,a));this.b=b-df[this.g]}var ff=[0,14,14,17,14,18,16,20];function gf(a){var b=this.b,c=Td(this,a);a=a>>6&7;Id(this,this.u[a]);this.u[a]=this.u[7];N(this,c);this.b=b-ff[this.g]}var hf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function jf(a){var b=Sd(this,a),c=this.b;P(this,Xd(this,a,b));this.b=c-hf[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)}function kf(a){var b=Rd(this,a);P(this,Wd(this,a,b,1)<<8);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var lf=[7,13,13,17,14,18,17,21]; -function mf(a){var b=Vd(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.G&128||(this.V=b>>16,this.X=this.V|b,this.S=0,this.R=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)N(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function sf(a){R(this,a,Sd(this,a),ve);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function tf(a){R(this,a,0,xe);this.b-=this.g?9:3+(7==this.f?2:0)}function uf(){this.ea(28,5);this.b-=5}function vf(){this.G&4||this.D.aa();this.G|=4;Dd(this,-2);this.b-=3} -function wf(a){R(this,a,Sd(this,a),ye);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,C(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function bd(a){xf[a>>12].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)}function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a>>6&3].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){Hf[a&15].call(this,a)}function If(a){Jf[a>>6&3].call(this,a)}function Kf(a){Lf[a>>6&3].call(this,a)} +function mf(a){var b=Vd(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.G&128||(this.V=b>>16,this.Z=this.V|b,this.T=0,this.S=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)N(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function sf(a){R(this,a,Sd(this,a),ve);this.b-=this.g?9+(this.J&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}function tf(a){R(this,a,0,xe);this.b-=this.g?9:3+(7==this.f?2:0)}function uf(){this.fa(28,5);this.b-=5}function vf(){this.G&4||this.D.ba();this.G|=4;Dd(this,-2);this.b-=3} +function wf(a){R(this,a,Sd(this,a),ye);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,C(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.fa(8,6)}function bd(a){xf[a>>12].call(this,a)}function yf(a){zf[a>>6&3].call(this,a)}function Af(a){Bf[a>>6&3].call(this,a)}function Cf(a){Df[a>>6&3].call(this,a)}function Ef(a){Ff[a&15].call(this,a)}function Gf(a){Hf[a&15].call(this,a)}function If(a){Jf[a>>6&3].call(this,a)}function Kf(a){Lf[a>>6&3].call(this,a)} function Mf(a){Nf[a>>6&3].call(this,a)} var xf=[function(a){Of[a>>8&15].call(this,a)},jf,Ye,Ie,Ee,Ge,ze,V,function(a){Pf[a>>8&15].call(this,a)},kf,Ze,Je,Fe,He,sf,V],Of=[function(a){Qf[a>>4&15].call(this,a)},Ve,Se,Ke,Le,Qe,Me,Oe,gf,gf,yf,Af,Cf,V,V,V],zf=[function(a){Ed(this,Xd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,le);this.b-=this.g?9:3+(7==this.f?2:0)}],Bf=[function(a){R(this,a,0, pe);this.b-=this.g?11:6},function(a){R(this,a,gd(this)?1:0,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,gd(this)?1:0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Vd(this,a);Ed(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Df=[function(a){R(this,a,0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,be);this.b-=this.g?9:3+(7==this.f?2:0)}], -Qf=[function(a){Rf[a&15].call(this,a)},V,V,V,ef,ef,ef,ef,qf,V,Ef,Gf,tf,tf,tf,tf],Rf=[bf,vf,pf,Ue,cf,of,V,V,V,V,V,V,V,V,V,V],Ff=[nf,function(){this.R=0;this.b-=5},function(){this.S=0;this.b-=5},T,function(){this.X=1;this.b-=5},T,T,T,function(){this.V=0;this.b-=5},T,T,T,T,T,T,T],Hf=[nf,function(){this.R=65536;this.b-=5},function(){this.S=32768;this.b-=5},W,function(){this.X=0;this.b-=5},W,W,W,function(){this.V=32768;this.b-=5},W,W,W,W,W,W,W],Pf=[Te,Re,Ne,Pe,We,Xe,Ce,De,af,uf,If,Kf,Mf,V,V,V],Jf=[function(a){Ed(this, +Qf=[function(a){Rf[a&15].call(this,a)},V,V,V,ef,ef,ef,ef,qf,V,Ef,Gf,tf,tf,tf,tf],Rf=[bf,vf,pf,Ue,cf,of,V,V,V,V,V,V,V,V,V,V],Ff=[nf,function(){this.S=0;this.b-=5},function(){this.T=0;this.b-=5},T,function(){this.Z=1;this.b-=5},T,T,T,function(){this.V=0;this.b-=5},T,T,T,T,T,T,T],Hf=[nf,function(){this.S=65536;this.b-=5},function(){this.T=32768;this.b-=5},W,function(){this.Z=0;this.b-=5},W,W,W,function(){this.V=32768;this.b-=5},W,W,W,W,W,W,W],Pf=[Te,Re,Ne,Pe,We,Xe,Ce,De,af,uf,If,Kf,Mf,V,V,V],Jf=[function(a){Ed(this, Wd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,me);this.b-=this.g?9:3+(7==this.f?2:0)}],Lf=[function(a){Q(this,a,0,qe);this.b-=this.g?11:6},function(a){Q(this,a,gd(this)?1:0,ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,gd(this)?1:0,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ud(this,a);Ed(this,a<<8);this.b-=this.g?4:3+(7== this.f?2:0)}],Nf=[function(a){Q(this,a,0,ue);this.b-=this.g?9+(this.$a&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ee);this.b-=this.g?9+(this.$a&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ce);this.b-=this.g?9:3+(7==this.f?2:0)}];function cd(a){kg[a>>12].call(this,a)} var kg=[function(a){lg[a>>8&15].call(this,a)},jf,Ye,Ie,Ee,Ge,ze,function(a){mg[a>>8&15].call(this,a)},function(a){ng[a>>8&15].call(this,a)},kf,Ze,Je,Fe,He,sf,V],lg=[function(a){og[a>>4&15].call(this,a)},Ve,Se,Ke,Le,Qe,Me,Oe,gf,gf,yf,Af,Cf,function(a){pg[a>>6&3].call(this,a)},V,V],pg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.oa(a|this.M);N(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Pd(this,a,0);Id(this,a);P(this,a);this.b-=11},function(a){var b=Kd(this),c= this.b;Qd(this,a,0,b);P(this,b);this.b=c-lf[this.g]},function(a){P(this,Xd(this,a,this.Da?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],og=[function(a){qg[a&15].call(this,a)},V,V,V,ef,ef,ef,ef,qf,function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.G|=1),this.b-=5):V.call(this,a)},Ef,Gf,tf,tf,tf,tf],qg=[bf,vf,pf,Ue,cf,of,function(){Jd(this);this.b-=13},V,V,V,V,V,V,V,V,V],mg=[mf,mf,$e,$e,Ae,Ae,Be,Be,wf,wf,V,V,V,V,rf,rf],ng=[Te,Re,Ne,Pe,We,Xe,Ce,De,af,uf,If,Kf,Mf,function(a){rg[a>>6&3].call(this, a)},V,V],rg=[V,function(a){a=Pd(this,a,65536);Id(this,a);P(this,a);this.b-=11},function(a){var b=Kd(this),c=this.b;Qd(this,a,65536,b);P(this,b);this.b=c-lf[this.g]},V]; -function sg(a){r.call(this,"ROM",a,sg);this.ka=this.f=null;this.C=a.addr;this.g=a.size;this.A=a.alias;this.D=a.file;this.F=oa(this.D);if(this.D){a=this.D;var b=pa(this.F);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.D+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.ja("Unable to load ROM resource (error "+f+": "+a+")"):(jb(c.Ra,a,b),(a=Ca(a,b))?(c.f=a.ha,c.ka=a.ka):c.D=null,tg(c))})}}u(sg);sg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;tg(this)}; -sg.prototype.Aa=function(){if(this.ka){if(this.i){var a=this.i,b=this.id,c=this.C,d=this.g,e=this.ka,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var m=h.o,p=h.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=ya(q,m,a.Wb);0>v&&q.splice(-(v+1),0,m)}p&&(h.a=p.replace(/''/g,'"'))}a.F.push({Ud:b,B:c,vc:d,ka:e,Vb:f})}delete this.ka}return!0};sg.prototype.za=function(){return!0}; +function sg(a){r.call(this,"ROM",a,sg);this.la=this.f=null;this.C=a.addr;this.g=a.size;this.A=a.alias;this.D=a.file;this.F=oa(this.D);if(this.D){a=this.D;var b=pa(this.F);"json"!=b&&"hex"!=b&&(a=ra()+"/api/v1/dump?file="+this.D+"&format=bytes&decimal=true");var c=this;Ba(a,null,!0,function(a,b,f){f?c.ka("Unable to load ROM resource (error "+f+": "+a+")"):(jb(c.Ra,a,b),(a=Ca(a,b))?(c.f=a.ia,c.la=a.la):c.D=null,tg(c))})}}u(sg);sg.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.i=d;tg(this)}; +sg.prototype.Aa=function(){if(this.la){if(this.i){var a=this.i,b=this.id,c=this.C,d=this.g,e=this.la,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var m=h.o,p=h.a;if(void 0!==m){var q=f,m=[m>>>0,g],v=ya(q,m,a.Wb);0>v&&q.splice(-(v+1),0,m)}p&&(h.a=p.replace(/''/g,'"'))}a.F.push({Ud:b,B:c,vc:d,la:e,Vb:f})}delete this.la}return!0};sg.prototype.za=function(){return!0}; function tg(a){if(!pb(a)){if(a.D){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)rb(a,"ROM size ("+l(a.f.length,8,!0)+") does not match specified size ("+l(a.g,8,!0)+")");else{var b;b=a.C;if(Yb(a.w,b,a.g,Cc)){var c;for(c=0;c=b.length)break;for(var g=g+2,m=b[g++]&255|(b[g++]&255)<<8,p=b[g++]&255|(b[g++]&255)<<8,h=h+((m&255)+(m>>8)+(p&255)+(p>>8)),q=g,v=m-=6;0=b.length)break;h+=b[g++]&255;if(h&255)break;if(v)for(;v--;)a.b.Xa(p++,b[q++]&255);else p&1?a.b.ba():fd(a.b,p);f=!0}else g++;else g+=2}if(!f&&(null==c&&(c=e),null!=c)){for(e=0;e=b.length)break;for(var g=g+2,m=b[g++]&255|(b[g++]&255)<<8,p=b[g++]&255|(b[g++]&255)<<8,h=h+((m&255)+(m>>8)+(p&255)+(p>>8)),q=g,v=m-=6;0=b.length)break;h+=b[g++]&255;if(h&255)break;if(v)for(;v--;)a.b.Xa(p++,b[q++]&255);else p&1?a.b.ca():fd(a.b,p);f=!0}else g++;else g+=2}if(!f&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=va(b[0]);if(c!=this.Za)return;b=va(b[1]);if(this.J=lb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.K=d.receiveData){this.status(this.Ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Aa=function(a,b){if(!b)if(this.cc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -k.za=function(a){return a?this.save():!0};k.reset=function(){Ag(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return Ag(this)};function Ag(a){a.N=0;a.f=0;a.g=128;a.C=[];return!0}k.Pb=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.O||8,c=a-this.H%a,this.O&&(b=ua("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.j(this.F), -this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;jc(this.b,this.U,1)}};var Bg={},zg=(Bg[65392]=[null,null,X.prototype.Sc,X.prototype.Ed,"RCSR"],Bg[65394]=[null,null,X.prototype.Rc,X.prototype.Dd,"RBUF"],Bg[65396]=[null,null,X.prototype.ed,X.prototype.Rd,"XCSR"],Bg[65398]=[null,null,X.prototype.dd,X.prototype.Qd,"XBUF"],Bg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.R||8,c=a-this.H%a,this.R&&(b=ua("",c)));this.N&&!this.H&&c&&(b=String.fromCharCode(this.N)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.j(this.F), +this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;jc(this.b,this.X,1E3/Math.round(this.O/10))}};var Bg={},zg=(Bg[65392]=[null,null,X.prototype.Sc,X.prototype.Ed,"RCSR"],Bg[65394]=[null,null,X.prototype.Rc,X.prototype.Dd,"RBUF"],Bg[65396]=[null,null,X.prototype.ed,X.prototype.Rd,"XCSR"],Bg[65398]=[null,null,X.prototype.dd,X.prototype.Qd,"XBUF"],Bg);Ta(function(){for(var a=B(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.I[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.I[b]=c,c.onclick= function(){var a=d.I.listTapes;a&&Eg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.N){c.parentNode.removeChild(c);break}this.I[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;Eg(d,oa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.I[b]=c,!0}return!1}; -k.Ca=function(a,b,c,d){this.D=a;this.w=b;this.b=c;this.i=d;this.O=Fg(a);var e=this;if((this.g=Pc(this.D,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){n("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.P=kc(56,4);this.Z=hc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=pa(c),f="json"==e||"gz"==e?encodeURI(c):ra()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ba(f,null,!0,function(e,f,g){var h=0>g&&a.D&&!a.D.v.ga;g?a.ja('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(jb(a.Ra,e,f),(e=Ca(e,f))&&Og(a,b,c,d,e.ha,e.Ua, +function Eg(a,b,c,d,e){if(c)if("?"==c)a.ka('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=oa(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;Kg(a,b,c,d,!1,e)}else Mg(a,!1)} +function Kg(a,b,c,d,e,f){var g=-1;if(a.F.toLowerCase()!=c.toLowerCase()||a.A!=d)g++,Mg(a,!0),a.v.Ia?a.ka("PC11 busy"):(e&&(a.C++,D(a)&&C(a,"auto-loading tape: "+b)),Ng(a,b,c,d,f)?g++:a.v.Ia=!0);g&&a.status(1==a.A?"tape attached":"tape loaded")} +function Ng(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),Og(a,b,c,d,e),a.H="?");Lg(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=pa(c),f="json"==e||"gz"==e?encodeURI(c):ra()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ba(f,null,!0,function(e,f,g){var h=0>g&&a.D&&!a.D.v.ga;g?a.ka('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(jb(a.Ra,e,f),(e=Ca(e,f))&&Og(a,b,c,d,e.ia,e.Ua, e.Ta));a.v.Ia=!1;a.C&&(a.C--,a.C||H(a));Lg(a)})}function Ig(a,b,c,d){if((a=a.I.listTapes)&&a.options){for(var e=0;e=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Qg.prototype.ac=function(){return-1};Qg.prototype.bc=function(){}; +function Lg(a){var b=a.I.listTapes;if(b&&b.options){a=a.H||a.F;for(var c=0;c=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Qg.prototype.ac=function(){return-1};Qg.prototype.bc=function(){}; function Sg(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.P?b="end":b=a.g[a.A+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(va(b.substring(c,f))),c=f+1}}return a} function Tg(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 Ug(a,b,c){var d;if(b){b=Vg(a,b);for(var e=0,f=!1,g=b,h=[],m=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Yg(a,b){if(b)return Xg(a,b,a.Z[b]);var c=0;for(b in a.Z)Xg(a,b,a.Z[b]),c++;return 0>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Yg(a,b){if(b)return Xg(a,b,a.W[b]);var c=0;for(b in a.W)Xg(a,b,a.W[b]),c++;return 0this.b.fb?gh:[];hh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.Y(ih(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ia;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<this.b.gb?gh:[];hh(this,function(a){a:{var b=d.w.Y,c=a[0],e=a=0,m=b.length;if(c){a=d.$(ih(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ja;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;dd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.bc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ea[a-8]:20>a?b=this.b.va[a-16]:20==a&&(b=Lb(this.b)));return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.vb).B));this.la&1073741824?this.wa.push(a):this.sa&&a==this.sa||(this.sa=a,this.la&-2147483648&&(this.ba(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,Yc(a),a.pa=0,a.D.aa()))}; -function ah(a){var b;if(Yd(a)){if(!a.J||!a.J.length){a.J=Array(1E3);for(b=0;b>>d.ia],!1)}a.M=["br"];if(a.C)for(b=1;b>>d.ia],!0);a.C=["bw"];a.ab=0} -k.Sa=function(a,b,c){var d=!0;c||sh(this,a,b,!1,!0);if(a!=this.f){var e=this.Y(b);if(-1===e)this.j("invalid address: "+J(this,b.B)),d=!1;else{var f=this.w;f.W[e>>>f.ia].Sa(e&f.w,a==this.C)}}d&&(a.push(b),c?b.Ba=!0:(th(this,a,a.length-1,"set"),ah(this)));return d};function sh(a,b,c,d,e){var f=!1;c=a.Y(c);for(var g=1;g>>d.ia],b==a.C));h.Ba||ah(a);break}}return f} -function uh(a,b){for(var c=1;cd&&(d=a.b.fb(b)),null!=d&&(b=a.J[a.da],b.B=e.u[7],b.Ba=!1,++a.da==a.J.length&&(a.da=0)));return!1}function $b(a){var b=a.b;if(b.v.ea)throw N(b,a.b.vb),a.ca(),-1;return!1} +function $g(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b>>d.ja],!1)}a.M=["br"];if(a.C)for(b=1;b>>d.ja],!0);a.C=["bw"];a.ab=0}k.Sa=function(a,b,c){var d=!0;c||sh(this,a,b,!1,!0);if(a!=this.f){var e=this.$(b);if(-1===e)this.j("invalid address: "+J(this,b.B)),d=!1;else{var f=this.w;f.Y[e>>>f.ja].Sa(e&f.w,a==this.C)}}d&&(a.push(b),c?b.Ba=!0:(th(this,a,a.length-1,"set"),ah(this)));return d}; +function sh(a,b,c,d,e){var f=!1;c=a.$(c);for(var g=1;g>>d.ja],b==a.C));h.Ba||ah(a);break}}return f}function uh(a,b){for(var c=1;c>23)&65535,y=J(x,w);else if(8192==F)w=w.B-((f&63)<<1)&65535,y=J(x,w);else if(12288==F)y=J(x,f&7,1);else if(24576==F)y=J(x,f&63,1);else if(F=f&E,E&4032&&(F>>=6,E>>=6),E&63)switch(E=F&7,F&56){case 0:y= nh(E);break;case 8:y="@"+nh(E);break;case 16:7>E?y="("+nh(E)+")+":(F=x.na(w,2),y="#"+J(x,F,0,!0));break;case 24:7>E?y="@("+nh(E)+")+":(F=x.na(w,2),y="@#"+J(x,F,0,!0));break;case 32:y="-("+nh(E)+")";break;case 40:y="@-("+nh(E)+")";break;case 48:F=x.na(w,2);y=J(x,F,0,!0)+"("+nh(E)+")";7==E&&(y=[y,J(x,F+w.B&65535)]);break;case 56:F=x.na(w,2),y="@"+J(x,F)+"("+nh(E)+")",7==E&&(y=[y,J(x,F+w.B&65535)])}x=y;if(!x||!x.length){h="INVALID";break}"string"!=typeof x&&(p=x[1],x=x[0]);0b?(c=nh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ea[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.va[b-16]):20==b&&(c="PS="+J(a,Lb(d)));c&&(c+=" ");return c}function zh(a){var b,c="";for(b=0;6>b;b++)c+=yh(a,b);c=c+"\n"+(yh(a,6)+yh(a,7)+yh(a,20));return c+=xh(a,"T")+xh(a,"N")+xh(a,"Z")+xh(a,"V")+xh(a,"C")}k.Wb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.D.aa();a.j("updated registers:")}a.j(zh(a));c&&(a.K=Z(d.u[7]),qh(a,J(a,a.K.B)))}}function Eh(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var p=h[0]+":";h[2]&&(p+=" "+h[2]);a.j(p)}h[3]&&(g=h[3],f=null);f=wh(a,b,g,f);a.j(f);a.K=b;e-=b.B-m;c++}}} +function Ah(a,b,c){var d=[],e=a.$(b)>>>0;for(b=0;b>>0,h=f.vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.D.ba();a.j("updated registers:")}a.j(zh(a));c&&(a.K=Z(d.u[7]),qh(a,J(a,a.K.B)))}}function Eh(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var p=h[0]+":";h[2]&&(p+=" "+h[2]);a.j(p)}h[3]&&(g=h[3],f=null);f=wh(a,b,g,f);a.j(f);a.K=b;e-=b.B-m;c++}}} function vh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.P&&(a.j("ended assemble at "+J(a,a.O.B)),a.K=a.O,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.sa=null;if(pb(a)&&0q||"z"ka.length&&(a.j("note: only "+ka.length+" available"),Y=ka.length);ca-=Y;0>ca&&(null==ka[ka.length-1].B?(Y=ca+Y,ca=0):ca+=ka.length);var nd=[];"call"==Xf&&(wb=1E5,nd=["CALL"]);for(void 0!==Wf&&a.j(Y+" instructions earlier:");0=ka.length&&(ca=0);a.bb=Y;Zf++;wb--}}Zf||(a.j("no "+Yf+"history available"),a.bb=void 0)}else{var yb=ih(a,ja);if(yb){var lc=0;Ga&&("l"==Ga.charAt(0)&&(Ga=Ga.substr(1)||Yh),lc=Wg(a,Ga)>>>0,65536>4||1;$h--&&0oc?String.fromCharCode(oc):".";mc--}zb&&(zb+="\n");zb+=ja+" "+od+(0==Bb?" "+bg:"")}zb&&a.j(zb);a.Qa=yb}}}}break;case "e":if("else"==g[0])break;var bb,qd,rd,sd,td=g[0],ud=g[1];"eb"==td?(bb=1,qd=255,rd=a.qb,sd=a.Ib):"e"==td||"ew"==td?(bb=2,qd=65535,rd=a.na,sd=a.Ya):ud=null;if(null==ud)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var pc=ih(a,ud);if(pc)for(var qc=2;qc< -g.length;qc++){var Cb=Ug(a,g[qc]);if(void 0===Cb){a.j("unrecognized value: "+g[qc]);break}Cb&~qd&&a.j("warning: "+l(Cb)+" exceeds "+bb+"-byte value");var ai=rd.call(a,pc);a.j("changing "+J(a,pc.B)+" from "+J(a,ai,bb)+" to "+J(a,Cb,bb));sd.call(a,pc,Cb,bb)}}break;case "g":a:{var cg=g[1],bi=b;if(void 0!==cg){var vd=ih(a,cg,!0);if(!vd)break a;mh(a,vd,bi);a.Sa(a.f,vd,!0)}a.lb(!0,c)}break;case "h":a.v.da?(c||a.j("halting"),a.ba()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var wd; -var Db=b.substr(2),Db=va(Db);Ug(a,Db)?(c||a.j("true: "+Db),wd=!0):(c||a.j("false: "+Db),wd=!1);wd||(d=!1);break}f=!0;break;case "k":var ci=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var xd=0,yd=Z(),Eb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Eb.B));10>xd;){for(var Ha=null,di=256;65536>Eb.B>>>0;){yd.B=a.na(Eb,2);if(null==Eb.B||!di--)break;if(!(yd.B&1)){for(var ei=a,rc=yd,dg=null,Fb=rc.B,eg=Fb,zd=1;6>=zd&&Fb;zd++){if(2< -zd){rc.B=Fb;var sc=wh(ei,rc);if(0<=sc.indexOf("JSR")){var fg=sc.indexOf(" ");if(Fb+(sc.indexOf(" ",fg+1)-fg-1)/2==eg){dg=sc;break}}}Fb-=2}rc.B=eg;if(Ha=dg)break}}if(!Ha||null==Ha)break;var gg=null;if("ks"==ci){var hg=Ha.match(/[0-9A-F]+$/);hg&&(gg=Dh(a,hg[0]))}Ha=ua(Ha,50)+" ;"+(gg||"stack="+J(a,Eb.B));a.j(Ha);xd++}xd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){Dh(a,g[1],!0);break}f=!0;break;case "m":a:{var la,ma=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var xa=0;if("all"== -G)xa=1878917119,G=null;else if("on"==G)ma=!0,G=null;else if("off"==G)ma=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(la in tb)if(G==la){xa=tb[la];ma=!!(a.la&xa);break}if(!xa){a.j("unknown message category: "+G);break a}}if(xa)if("on"==g[2])a.la|=xa,ma=!0;else if("off"==g[2]&&(a.la&=~xa,ma=!1,1073741824==xa)){for(var Ad=0;Adka.length&&(a.j("note: only "+ka.length+" available"),Y=ka.length);ca-=Y;0>ca&&(null==ka[ka.length-1].B?(Y=ca+Y,ca=0):ca+=ka.length);var nd=[];"call"==Xf&&(xb=1E5,nd=["CALL"]);for(void 0!==Wf&&a.j(Y+" instructions earlier:");0=ka.length&&(ca=0);a.bb=Y;Zf++;xb--}}Zf||(a.j("no "+Yf+"history available"),a.bb=void 0)}else{var zb=ih(a,ja);if(zb){var lc=0;Ga&&("l"==Ga.charAt(0)&&(Ga=Ga.substr(1)||Yh),lc=Wg(a,Ga)>>>0,65536>4||1;$h--&&0oc?String.fromCharCode(oc):".";mc--}Ab&&(Ab+="\n");Ab+=ja+" "+od+(0==Cb?" "+bg:"")}Ab&&a.j(Ab);a.Qa=zb}}}}break;case "e":if("else"==g[0])break;var bb,qd,rd,sd,td=g[0],ud=g[1];"eb"==td?(bb=1,qd=255,rd=a.rb,sd=a.Ib):"e"==td||"ew"==td?(bb=2,qd=65535,rd=a.na,sd=a.Ya):ud=null;if(null==ud)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var pc=ih(a,ud);if(pc)for(var qc=2;qc< +g.length;qc++){var Db=Ug(a,g[qc]);if(void 0===Db){a.j("unrecognized value: "+g[qc]);break}Db&~qd&&a.j("warning: "+l(Db)+" exceeds "+bb+"-byte value");var ai=rd.call(a,pc);a.j("changing "+J(a,pc.B)+" from "+J(a,ai,bb)+" to "+J(a,Db,bb));sd.call(a,pc,Db,bb)}}break;case "g":a:{var cg=g[1],bi=b;if(void 0!==cg){var vd=ih(a,cg,!0);if(!vd)break a;mh(a,vd,bi);a.Sa(a.f,vd,!0)}a.mb(!0,c)}break;case "h":a.v.ea?(c||a.j("halting"),a.ca()):ob(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var wd; +var Eb=b.substr(2),Eb=va(Eb);Ug(a,Eb)?(c||a.j("true: "+Eb),wd=!0):(c||a.j("false: "+Eb),wd=!1);wd||(d=!1);break}f=!0;break;case "k":var ci=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var xd=0,yd=Z(),Fb=Z(a.b.u[6]);for(a.j("stack trace for "+J(a,Fb.B));10>xd;){for(var Ha=null,di=256;65536>Fb.B>>>0;){yd.B=a.na(Fb,2);if(null==Fb.B||!di--)break;if(!(yd.B&1)){for(var ei=a,rc=yd,dg=null,Gb=rc.B,eg=Gb,zd=1;6>=zd&&Gb;zd++){if(2< +zd){rc.B=Gb;var sc=wh(ei,rc);if(0<=sc.indexOf("JSR")){var fg=sc.indexOf(" ");if(Gb+(sc.indexOf(" ",fg+1)-fg-1)/2==eg){dg=sc;break}}}Gb-=2}rc.B=eg;if(Ha=dg)break}}if(!Ha||null==Ha)break;var gg=null;if("ks"==ci){var hg=Ha.match(/[0-9A-F]+$/);hg&&(gg=Dh(a,hg[0]))}Ha=ua(Ha,50)+" ;"+(gg||"stack="+J(a,Fb.B));a.j(Ha);xd++}xd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){Dh(a,g[1],!0);break}f=!0;break;case "m":a:{var la,ma=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var xa=0;if("all"== +G)xa=1878917119,G=null;else if("on"==G)ma=!0,G=null;else if("off"==G)ma=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(la in tb)if(G==la){xa=tb[la];ma=!!(a.ma&xa);break}if(!xa){a.j("unknown message category: "+G);break a}}if(xa)if("on"==g[2])a.ma|=xa,ma=!0;else if("off"==g[2]&&(a.ma&=~xa,ma=!1,1073741824==xa)){for(var Ad=0;Ad\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bJh){if(Lh(d,this.J)){this.C=new O(this,"1.30.1","failsafe");Lh(this.C)&&(Qh(this,d),a=2,Rh(this.C));this.C.set("timestamp",Aa());Sh(this.C);var e=this.f&&!this.F;if(1==a||Da("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ph(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Lh(d,g):("error"== -f&&"no machine state"!=g?(this.ja("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.g=null)):this.j(f+": "+g),Rh(d),Lh(d)?(c=Ph(d),e=!0):c=!1))}e&&Oh(this,c?d:null)}else 2==a&&d.clear()}else Oh(this);delete this.J;delete this.K}e=kb(this.id);for(f=0;fa[1];a=a[2];this.fa=!0;this.v.ga=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.b&&(Th(this,this.b,b,c,a),this.b.pb());this.O&&(Qh(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.D=0}; -function Qh(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} -function Gh(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),h=Aa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.ba(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ga=!1,!1===d&&(e=null)));for(var h=kb(a.id),m=0;ma[1];a=a[2];this.da=!0;this.v.ga=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.b&&(Th(this,this.b,b,c,a),this.b.qb());this.O&&(Qh(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.D=0}; +function Qh(a,b){if(Da("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.X;d.user=c;d.type="bug";d.data=b;Ba("http://www.pcjs.org/api/v1/report",d,!0)}} +function Gh(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),h=Aa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.za&&(c&&a.b.ca(),d=a.b.za(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ga=!1,!1===d&&(e=null)));for(var h=kb(a.id),m=0;ma?"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 k(a,b,c,d){var e=0,f=null,h=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)}),h;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var n="",r;for(r in b)b.hasOwnProperty(r)&&(n&&(n+="&"),n+=r+"="+encodeURIComponent(b[r]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),h=[f,e]);return h} -function ua(a,b){var c,d={L:null,Y:null,va:null,ua:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,h;if("<"==b.substr(0,1))throw Error(b);h=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.va=h.load;d.ua=h.exec;if(e=h.bytes)d.L=e;else if(e=h.words)for(d.L=Array(2*e.length),f=c=0;c>8&255;else if(e=h.data)for(d.L=Array(4*e.length),f=c=0;c>8&255,d.L[f++]=e[c]>>16&255,d.L[f++]=e[c]>>24&255;else d.L=h;d.Y=h.symbols;d.L.length?1==d.L.length&&(m(d.L[0]),d=null):(m("Empty resource: "+a),d=null)}catch(l){m("Resource data error ("+a+"): "+l.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.va=h.load;d.ua=h.exec;if(e=h.bytes)d.N=e;else if(e=h.words)for(d.N=Array(2*e.length),f=c=0;c>8&255;else if(e=h.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=h;d.Y=h.symbols;d.N.length?1==d.N.length&&(m(d.N[0]),d=null):(m("Empty resource: "+a),d=null)}catch(l){m("Resource data error ("+a+"): "+l.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ka=this.id:(this.ra=this.id.substr(0,b),this.Ka=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Ya:!1,gd:!1,M:!1,error:!1};this.Ua=null;this.i.error=!1;this.s={};this.F=null;v.push(this)}var Ia=void 0,Ja={}; +Ea(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Fa(p.exit)});function u(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.pb=b.comment;this.Hb=b;b=this.id.indexOf(".");0>b?this.Ka=this.id:(this.ra=this.id.substr(0,b),this.Ka=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Ya:!1,gd:!1,O:!1,error:!1};this.Ua=null;this.i.error=!1;this.s={};this.F=null;v.push(this)}var Ia=void 0,Ja={}; if(window){Ia||(Ia=window.location.search.substr(1));for(var Ka,La=/\+/g,Ma=/([^&=]+)=?([^&]*)/g;Ka=Ma.exec(Ia);)Ja[decodeURIComponent(Ka[1].replace(La," "))]=decodeURIComponent(Ka[2].replace(La," "))}function Na(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 w(a,b){b||(b=u);a.prototype=Na(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Oa=window.PCjs.Machines||(window.PCjs.Machines={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else Oa={},v=[];function Pa(a,b,c){Oa[a]&&b&&(Oa[a][b]=c)}function x(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.g=this.c-1;this.A=this.w/this.c|0;this.ka=[];this.T=0;this.o=[];this.Bb=[$a,ab,bb,cb];a=new F(this);db(a,this.F);this.b=Array(this.A);for(b=0;b>2;this.g=this.c-1;this.A=this.w/this.c|0;this.ka=[];this.P=0;this.o=[];this.Bb=[$a,ab,bb,cb];a=new F(this);db(a,this.F);this.b=Array(this.A);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=fb(d,b)}function ab(a,b,c){var d=!1,e=this.controller,f=e.ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||fb(e,c)} function bb(a,b){var c=-1,d=this.controller;(a=d.ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=fb(d,b)}function cb(a,b,c){var d=!1,e=this.controller;if(a=e.ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||fb(e,c)}function gb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.m;0h&&(t=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.Ea)return n.Wa+=n.Ea-f,n.Ea=f,!0;if(f>=n.Ea+n.Wa){t=n.size-(f-r);t>h&&(t=h);n.Wa=f-n.Ea+t;f=r+a.c;h-=t;l++;continue}}return lb(1,f,h)}f=new F(a,f,t,a.c,d,e);db(f,a.F,n);a.b[l++]=f;f=r+a.c;h-=t}if(0>=h){c/=1024;var y;e="";y?10>>=a.m;0>>=a.m;0>>a.m].eb(b&a.g,b)}function ob(a,b){return a.b[(b&a.h)>>>a.m].R(b&a.g,b)}Za.prototype.Ia=function(a,b){this.T++;this.b[(a&this.h)>>>this.m].yb(a&this.g,b&255,a);this.T--}; +10;a.status(e+"Kb "+mb[d]+" at "+ia(b));return!0}return lb(2,b,c)}function ib(a,b,c){var d=[];for(b>>>=a.m;0>>=a.m;0>>a.m].eb(b&a.g,b)}function ob(a,b){return a.b[(b&a.h)>>>a.m].S(b&a.g,b)}Za.prototype.Ia=function(a,b){this.P++;this.b[(a&this.h)>>>this.m].yb(a&this.g,b&255,a);this.P--}; function pb(a,b,c){a.b[(b&a.h)>>>a.m].Xa(b&a.g,c&65535,b)}function qb(a){for(var b=0,c=[],d=0;da.a.Ja)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));rb(a,e,e,h,l,n,r,f[4])}}}function tb(a,b){a.o.push(b)}function ub(a,b){a.T||G(a.a,4,b)} +function sb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Ja)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,r=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&r&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(r)));rb(a,e,e,h,l,n,r,f[4])}}}function tb(a,b){a.o.push(b)}function ub(a,b){a.P||G(a.a,4,b)} function lb(a,b,c){m("Memory block error ("+a+": "+ja(b)+","+ja(c)+")");return!1}function H(a){u.call(this,"Device",a,H);this.c={data:0,fd:0,Va:20,uc:0};this.b={hd:0,ib:-1}}w(H);g=H.prototype;g.fa=function(a,b,c,d){this.m=b;this.a=c;this.F=d;var e=this;this.b.ib=vb(c,function(){e.b.na|=128;e.b.na&64&&(wb(e.a,e.b.vc),xb(e.a,e.b.ib,1E3/60))});this.b.vc=yb(64,6);sb(b,this,I);tb(b,this.reset.bind(this));C(this)};g.reset=function(){this.c.Va=this.c.Va&-120|20;this.b.na=0}; g.Qb=function(){var a=this.b.na;this.b.na&=-129;return a};g.Ec=function(a){this.b.na=a;a&64&&xb(this.a,this.b.ib,1E3/60);this.b.na=a&-129};g.Jb=function(a){return(a?this.c.uc:this.c.data)&65535};g.xc=function(a){this.c.data=a};g.Sb=function(){var a=this.a;return a.w&62337|a.La<<5|a.Ma<<1};g.Gc=function(a){var b=this.a;a&=62337;if(b.w!=a){b.w=a;b.La=a>>5&3;b.Ma=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ga!=c&&(b.Ga=c,zb(b))}Ab(this)}; g.Tb=function(){var a=this.a.oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Ub=function(){return this.a.gb};g.Vb=function(){return this.a.pa};g.Hc=function(a){var b=this.a;1170>b.Ja&&(a&=-49);b.pa!=a&&(b.pa=a,a&16?(b.bb=4194303,b.Na=3915776):(b.bb=262143,b.Na=253952),zb(b));Ab(this)};function Ab(a){a.c.Va=a.c.Va&-8|(a.a.Ga?a.a.pa&16?1:2:4)}g.ic=function(a){return this.a.D[1][a>>1&7]};g.Vc=function(a,b){this.a.D[1][b>>1&7]=a&65295};g.gc=function(a){return this.a.D[1][(a>>1&7)+8]}; -g.Tc=function(a,b){this.a.D[1][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.S[1][a>>1&7]};g.Uc=function(a,b){b=b>>1&7;this.a.S[1][b]=a;this.a.D[1][b]&=65295};g.fc=function(a){return this.a.S[1][(a>>1&7)+8]};g.Sc=function(a,b){b=(b>>1&7)+8;this.a.S[1][b]=a;this.a.D[1][b]&=65295};g.Pb=function(a){return this.a.D[0][a>>1&7]};g.Dc=function(a,b){this.a.D[0][b>>1&7]=a&65295};g.Nb=function(a){return this.a.D[0][(a>>1&7)+8]};g.Bc=function(a,b){this.a.D[0][(b>>1&7)+8]=a&65295}; -g.Ob=function(a){return this.a.S[0][a>>1&7]};g.Cc=function(a,b){b=b>>1&7;this.a.S[0][b]=a;this.a.D[0][b]&=65295};g.Mb=function(a){return this.a.S[0][(a>>1&7)+8]};g.Ac=function(a,b){b=(b>>1&7)+8;this.a.S[0][b]=a;this.a.D[0][b]&=65295};g.oc=function(a){return this.a.D[3][a>>1&7]};g.ad=function(a,b){this.a.D[3][b>>1&7]=a&65295};g.mc=function(a){return this.a.D[3][(a>>1&7)+8]};g.Zc=function(a,b){this.a.D[3][(b>>1&7)+8]=a&65295};g.nc=function(a){return this.a.S[3][a>>1&7]}; -g.$c=function(a,b){b=b>>1&7;this.a.S[3][b]=a;this.a.D[3][b]&=65295};g.lc=function(a){return this.a.S[3][(a>>1&7)+8]};g.Yc=function(a,b){b=(b>>1&7)+8;this.a.S[3][b]=a;this.a.D[3][b]&=65295};g.ya=function(a){a&=7;return this.a.v&2048?this.a.wa[a]:this.a.f[a]};g.Aa=function(a,b){b&=7;this.a.v&2048?this.a.wa[b]=a:this.a.f[b]=a};g.$b=function(){return this.a.v&49152?this.a.aa[0]:this.a.f[6]};g.Mc=function(a){this.a.v&49152?this.a.aa[0]=a:this.a.f[6]=a};g.cc=function(){return this.a.f[7]}; +g.Tc=function(a,b){this.a.D[1][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.T[1][a>>1&7]};g.Uc=function(a,b){b=b>>1&7;this.a.T[1][b]=a;this.a.D[1][b]&=65295};g.fc=function(a){return this.a.T[1][(a>>1&7)+8]};g.Sc=function(a,b){b=(b>>1&7)+8;this.a.T[1][b]=a;this.a.D[1][b]&=65295};g.Pb=function(a){return this.a.D[0][a>>1&7]};g.Dc=function(a,b){this.a.D[0][b>>1&7]=a&65295};g.Nb=function(a){return this.a.D[0][(a>>1&7)+8]};g.Bc=function(a,b){this.a.D[0][(b>>1&7)+8]=a&65295}; +g.Ob=function(a){return this.a.T[0][a>>1&7]};g.Cc=function(a,b){b=b>>1&7;this.a.T[0][b]=a;this.a.D[0][b]&=65295};g.Mb=function(a){return this.a.T[0][(a>>1&7)+8]};g.Ac=function(a,b){b=(b>>1&7)+8;this.a.T[0][b]=a;this.a.D[0][b]&=65295};g.oc=function(a){return this.a.D[3][a>>1&7]};g.ad=function(a,b){this.a.D[3][b>>1&7]=a&65295};g.mc=function(a){return this.a.D[3][(a>>1&7)+8]};g.Zc=function(a,b){this.a.D[3][(b>>1&7)+8]=a&65295};g.nc=function(a){return this.a.T[3][a>>1&7]}; +g.$c=function(a,b){b=b>>1&7;this.a.T[3][b]=a;this.a.D[3][b]&=65295};g.lc=function(a){return this.a.T[3][(a>>1&7)+8]};g.Yc=function(a,b){b=(b>>1&7)+8;this.a.T[3][b]=a;this.a.D[3][b]&=65295};g.ya=function(a){a&=7;return this.a.v&2048?this.a.wa[a]:this.a.f[a]};g.Aa=function(a,b){b&=7;this.a.v&2048?this.a.wa[b]=a:this.a.f[b]=a};g.$b=function(){return this.a.v&49152?this.a.aa[0]:this.a.f[6]};g.Mc=function(a){this.a.v&49152?this.a.aa[0]=a:this.a.f[6]=a};g.cc=function(){return this.a.f[7]}; g.Pc=function(a){this.a.f[7]=a};g.za=function(a){a&=7;return this.a.v&2048?this.a.f[a]:this.a.wa[a]};g.Ba=function(a,b){b&=7;this.a.v&2048?this.a.f[b]=a:this.a.wa[b]=a};g.ac=function(){return 1==(this.a.v&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Nc=function(a){1==(this.a.v&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.bc=function(){return 3==(this.a.v&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Oc=function(a){3==(this.a.v&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Lb=function(a){return this.a.vb[a-65504>>1]}; g.zc=function(a,b){this.a.vb[b-65504>>1]=a};g.tb=function(a){return 65520==a?61183:0};g.Ab=function(){};g.kc=function(){return 1};g.Xc=function(){};g.Kb=function(){return this.a.H};g.yc=function(){this.a.H=0};g.Rb=function(){return this.a.ub};g.Fc=function(a,b){b&1||(a&=255);this.a.ub=a};g.Wb=function(a){return a?this.a.hb:0};g.Ic=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.hb=a;b.l|=2};g.jc=function(a){return a?this.a.qa&65280:0};g.Wc=function(a){this.a.qa=a|255}; g.Zb=function(){return Ya(this.a)};g.Lc=function(a){Bb(this.a,a&-1809|Ya(this.a)&1808);this.a.l|=128};g.zb=function(){}; @@ -83,32 +83,32 @@ if(Ta){var Db=new ArrayBuffer(2);(new DataView(Db)).setUint16(0,256,!0);Cb=256== function F(a,b,c,d,e,f){this.m=a;this.id=Fb+=2;this.a=null;this.Ea=b;this.Wa=c;this.size=d||0;this.type=e||Gb;this.g=e==Hb;this.controller=null;db(this);this.la=this.Db=!1;if(d)if(f)this.controller=f,this.a=null,Ib(this,f.Bb);else if(Ta)this.b=new ArrayBuffer(d),this.s=new DataView(this.b,0,d),this.c=new Uint8Array(this.b,0,d),this.o=new Uint16Array(this.b,0,d>>1),this.a=new Int32Array(this.b,0,d>>2),Ib(this,Eb?Jb:Kb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&ub(this.m,b);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},ha: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.la=!0},G:function(a,b){return this.I(a,b)}, -T:function(a,b){return this.W(a,b)},ea:function(a,b,c){this.g||this.yb(a,b,c)},ja:function(a,b,c){this.g||this.ra(a,b,c)},C:function(a){return this.c[a]},J:function(a){return this.c[a]},O:function(a,b){a&1&&ub(this.m,b);return this.s.getUint16(a,!0)},X:function(a,b){a&1&&ub(this.m,b);return this.o[a>>1]},da:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&ub(this.m,c);this.s.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&ub(this.m,c);this.o[a>> -1]=b;this.la=!0}};function db(a,b,c){a.F=b;a.h=a.j=0;c&&((a.h=c.h)&&Mb(a,Nb,!1),(a.j=c.j)&&Ob(a,Nb,!1))}function Ob(a,b,c){c&&a.j||(a.jb=!a.g&&b[1]||a.w,a.Xa=!a.g&&b[3]||a.B);if(c||void 0===c)a.yb=b[1]||a.w,a.ra=b[3]||a.B}function Mb(a,b,c){c&&a.h||(a.eb=b[0]||a.A,a.R=b[2]||a.u);if(c||void 0===c)a.I=b[0]||a.A,a.W=b[2]||a.u}function Ib(a,b){b||(b=Pb);Mb(a,b,void 0);Ob(a,b,void 0)} -var Pb=[],Lb=[F.prototype.N,F.prototype.ha,F.prototype.ca,F.prototype.ta],Nb=[F.prototype.G,F.prototype.ea,F.prototype.T,F.prototype.ja];if(Ta)var Kb=[F.prototype.C,F.prototype.da,F.prototype.O,F.prototype.ia],Jb=[F.prototype.J,F.prototype.ga,F.prototype.X,F.prototype.sa]; -function Qb(a,b){u.call(this,"CPU",a,Qb);var c=a.multiplier||1;this.Sa=a.cycles||b;this.ea=c;this.ab=Math.round(this.Sa/1E4)/100;this.ga=this.ab*this.ea;this.i.U=!1;this.i.wb=!1;this.i.Fa=a.autoStart;this.i.Ra=!1;this.Pa=this.ia=0;this.Qa=a.csStart;this.sa=a.csInterval;this.ta=a.csStop;this.G=[];this.sb=this.tc.bind(this);C(this)}w(Qb);var Rb=["power","reset"];g=Qb.prototype; -g.fa=function(a,b,c,d){this.A=a;this.m=b;this.F=d;for(b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&ub(this.m,b);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},ha: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.la=!0},G:function(a,b){return this.I(a,b)}, +P:function(a,b){return this.U(a,b)},ea:function(a,b,c){this.g||this.yb(a,b,c)},ja:function(a,b,c){this.g||this.ra(a,b,c)},C:function(a){return this.c[a]},J:function(a){return this.c[a]},M:function(a,b){a&1&&ub(this.m,b);return this.s.getUint16(a,!0)},X:function(a,b){a&1&&ub(this.m,b);return this.o[a>>1]},da:function(a,b){this.c[a]=b;this.la=!0},ga:function(a,b){this.c[a]=b;this.la=!0},ia:function(a,b,c){a&1&&ub(this.m,c);this.s.setUint16(a,b,!0);this.la=!0},sa:function(a,b,c){a&1&&ub(this.m,c);this.o[a>> +1]=b;this.la=!0}};function db(a,b,c){a.F=b;a.h=a.j=0;c&&((a.h=c.h)&&Mb(a,Nb,!1),(a.j=c.j)&&Ob(a,Nb,!1))}function Ob(a,b,c){c&&a.j||(a.jb=!a.g&&b[1]||a.w,a.Xa=!a.g&&b[3]||a.B);if(c||void 0===c)a.yb=b[1]||a.w,a.ra=b[3]||a.B}function Mb(a,b,c){c&&a.h||(a.eb=b[0]||a.A,a.S=b[2]||a.u);if(c||void 0===c)a.I=b[0]||a.A,a.U=b[2]||a.u}function Ib(a,b){b||(b=Pb);Mb(a,b,void 0);Ob(a,b,void 0)} +var Pb=[],Lb=[F.prototype.L,F.prototype.ha,F.prototype.ca,F.prototype.ta],Nb=[F.prototype.G,F.prototype.ea,F.prototype.P,F.prototype.ja];if(Ta)var Kb=[F.prototype.C,F.prototype.da,F.prototype.M,F.prototype.ia],Jb=[F.prototype.J,F.prototype.ga,F.prototype.X,F.prototype.sa]; +function Qb(a,b){u.call(this,"CPU",a,Qb);var c=a.multiplier||1;this.Sa=a.cycles||b;this.ea=c;this.ab=Math.round(this.Sa/1E4)/100;this.ga=this.ab*this.ea;this.i.V=!1;this.i.wb=!1;this.i.Fa=a.autoStart;this.i.Ra=!1;this.Pa=this.ia=0;this.Qa=a.csStart;this.sa=a.csInterval;this.ta=a.csStop;this.G=[];this.sb=this.tc.bind(this);C(this)}w(Qb);var Rb=["power","reset"];g=Qb.prototype; +g.fa=function(a,b,c,d){this.A=a;this.m=b;this.F=d;for(b=0;ba.ca/a.ga&&(b=1),a.ea=b,b=a.ab*a.ea,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.s.setSpeed;c&&(c.textContent=b);a.P("target speed: "+b)}a.J+=a.W;a.W=0;a.O=sa();a.da=0;Xb(a)}function vb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function xb(a,b,c){0<=b&&ba.G[b][0]&&(c=a.Sa*a.ea/1E3*c|0,a.G[b][0]=c+Zb(a))}function Zb(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c} -g.tc=function(){if(this.i.U){this.cb>=this.Sa&&Xb(this,!0);this.Da=0;this.Oa=sa();if(this.da){var a=this.Oa-this.da;a>this.qb&&(this.O+=a,this.O>this.Oa&&(this.O=this.Oa))}try{do{for(var b,c=this.i.Ra?1:this.Ta,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(n){if("number"!=typeof n)throw n;}b=Zb(this,!0);this.Da+=b;this.W+=b;a=b;if(this.i.Ra){var f=!1;this.Pa=this.Pa+this.mb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.sa,f=!0);0<=this.ta&&this.ta<=Yb(this)&& -(this.sa=this.ta=-1,Ub(this),D(this),f=!0);f&&this.P(Yb(this)+" cycles: checksum="+ja(this.Pa))}for(var a=b,h=this.G.length-1;0<=h;h--){var l=this.G[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Ca-=b;if(0>=this.Ca){this.Ca+=this.Ta;15<=++this.rb&&(this.A&&this.A.ba(),this.rb=0);break}}while(this.i.U)}catch(n){D(this);this.A&&this.A.stop(sa(),Yb(this));b=n.stack||n.message;this.i.error=!0;this.K(b);return}if(this.i.U){b=setTimeout;c=this.sb;this.da=sa();d=this.qb;this.Da&&(d=Math.round(d*this.Da/ -this.Ta));d-=this.da-this.Oa;if(e=this.da-this.O)this.ca=Math.round(this.W/(10*e))/100,864E5<=e&&(this.J=0,Wb(this));if(0>d||this.cad&&(this.O-=d),d=0;this.cb+=this.Da;this.da+=d;b(c,d)}}};function Vb(a){var b;a.i.error?(a.P(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.U)a.P(a.toString()+" busy");else{Wb(a);a.i.U=!0;a.i.wb=!0;if(b=a.s.run)b.textContent="Halt";a.A&&a.A.start(a.O,Yb(a));setTimeout(a.sb,0)}}g.xb=function(){return 0}; -function D(a){if(a.i.U){Zb(a);a.J+=a.W;a.W=0;a.i.U=!1;var b=a.s.run;b&&(b.textContent="Run");a.A&&a.A.stop(sa(),Yb(a))}a.i.complete=void 0}function $b(a){this.Ja=+a.model||1170;this.ob=a.addrReset||0;Qb.call(this,a,6666667);this.decode=1120==this.Ja?ac.bind(this):bc.bind(this);cc(this);this.T=0;this.X=null;this.i.complete=this.i.Cb=!1}w($b,Qb);g=$b.prototype;g.reset=function(){this.status("model "+this.Ja);this.i.U&&D(this);cc(this);Tb(this);this.i.error=!1;this.parent.reset.call(this)}; -function cc(a){a.j=65536;a.g=32768;a.h=65535;a.o=32768;a.v=15;a.f=[0,0,0,0,0,0,0,a.ob];a.wa=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.u=0;a.Ma=0;a.Gb=[4,2,0,1];a.D=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];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],[0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,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.vb=[0,0,0,0,0,0,0,0];a.ub=0;a.l=0;a.B=a.C=0;a.c=a.b=a.$a=0;a.ja=-1;dc(a)}function dc(a){a.qa=255;a.H=0;a.hb=0;a.w=0;a.oa=0;a.gb=0;a.pa=0;a.Ga=0;a.La=0;a.bb=262143;a.Na=253952;a.l|=2;a.m&&zb(a)}function zb(a){a.Ga?(a.N=65536,a.I=a.Fb,a.R=a.qc,a.Xa=a.cd,gb(a.m,a.pa&16?22:18)):(a.N=0,a.I=a.Eb,a.R=a.pc,a.Xa=a.bd,gb(a.m,16))}function ec(a,b){a.ob=b;L(a,b);a.F&&(D(a),a.F.ba())}g.mb=function(){return 0}; +g.W=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.s[b]=c,!0;case "run":return this.s[b]=c,c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.i.O)a=!0;else{var b=null,c,l=x(a.id);for(c=0;ca.ca/a.ga&&(b=1),a.ea=b,b=a.ab*a.ea,a.ga!=b)){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var c=a.s.setSpeed;c&&(c.textContent=b);a.R("target speed: "+b)}a.J+=a.U;a.U=0;a.M=sa();a.da=0;Xb(a)}function vb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function xb(a,b,c){0<=b&&ba.G[b][0]&&(c=a.Sa*a.ea/1E3*c|0,a.G[b][0]=c+Zb(a))}function Zb(a,b){var c=a.ha-=a.a;a.a=0;b&&(a.ha=0);return c} +g.tc=function(){if(this.i.V){this.cb>=this.Sa&&Xb(this,!0);this.Da=0;this.Oa=sa();if(this.da){var a=this.Oa-this.da;a>this.qb&&(this.M+=a,this.M>this.Oa&&(this.M=this.Oa))}try{do{for(var b,c=this.i.Ra?1:this.Ta,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xb(b)}catch(n){if("number"!=typeof n)throw n;}b=Zb(this,!0);this.Da+=b;this.U+=b;a=b;if(this.i.Ra){var f=!1;this.Pa=this.Pa+this.mb()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.sa,f=!0);0<=this.ta&&this.ta<=Yb(this)&& +(this.sa=this.ta=-1,Ub(this),D(this),f=!0);f&&this.R(Yb(this)+" cycles: checksum="+ja(this.Pa))}for(var a=b,h=this.G.length-1;0<=h;h--){var l=this.G[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Ca-=b;if(0>=this.Ca){this.Ca+=this.Ta;15<=++this.rb&&(this.A&&this.A.ba(),this.rb=0);break}}while(this.i.V)}catch(n){D(this);this.A&&this.A.stop(sa(),Yb(this));b=n.stack||n.message;this.i.error=!0;this.K(b);return}if(this.i.V){b=setTimeout;c=this.sb;this.da=sa();d=this.qb;this.Da&&(d=Math.round(d*this.Da/ +this.Ta));d-=this.da-this.Oa;if(e=this.da-this.M)this.ca=Math.round(this.U/(10*e))/100,864E5<=e&&(this.J=0,Wb(this));if(0>d||this.cad&&(this.M-=d),d=0;this.cb+=this.Da;this.da+=d;b(c,d)}}};function Vb(a){var b;a.i.error?(a.R(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.V)a.R(a.toString()+" busy");else{Wb(a);a.i.V=!0;a.i.wb=!0;if(b=a.s.run)b.textContent="Halt";a.A&&a.A.start(a.M,Yb(a));setTimeout(a.sb,0)}}g.xb=function(){return 0}; +function D(a){if(a.i.V){Zb(a);a.J+=a.U;a.U=0;a.i.V=!1;var b=a.s.run;b&&(b.textContent="Run");a.A&&a.A.stop(sa(),Yb(a))}a.i.complete=void 0}function $b(a){this.Ja=+a.model||1170;this.ob=a.addrReset||0;Qb.call(this,a,6666667);this.decode=1120==this.Ja?ac.bind(this):bc.bind(this);cc(this);this.P=0;this.X=null;this.i.complete=this.i.Cb=!1}w($b,Qb);g=$b.prototype;g.reset=function(){this.status("model "+this.Ja);this.i.V&&D(this);cc(this);Tb(this);this.i.error=!1;this.parent.reset.call(this)}; +function cc(a){a.j=65536;a.g=32768;a.h=65535;a.o=32768;a.v=15;a.f=[0,0,0,0,0,0,0,a.ob];a.wa=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.u=0;a.Ma=0;a.Gb=[4,2,0,1];a.D=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.T=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,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.vb=[0,0,0,0,0,0,0,0];a.ub=0;a.l=0;a.B=a.C=0;a.c=a.b=a.$a=0;a.ja=-1;dc(a)}function dc(a){a.qa=255;a.H=0;a.hb=0;a.w=0;a.oa=0;a.gb=0;a.pa=0;a.Ga=0;a.La=0;a.bb=262143;a.Na=253952;a.l|=2;a.m&&zb(a)}function zb(a){a.Ga?(a.L=65536,a.I=a.Fb,a.S=a.qc,a.Xa=a.cd,gb(a.m,a.pa&16?22:18)):(a.L=0,a.I=a.Eb,a.S=a.pc,a.Xa=a.bd,gb(a.m,16))}function ec(a,b){a.ob=b;L(a,b);a.F&&(D(a),a.F.ba())}g.mb=function(){return 0}; g.save=function(){var a=new M(this);a.set(0,[]);a.set(1,[this.J,this.ea]);a.set(2,qb(this.m));return a.data()};g.restore=function(a){var b=a[1];this.J=b[1];Wb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;c>14&3;c=a.v>>14&3;a.u!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.u]);a.v=b;a.l|=2}function O(a,b){a.l&128||(a.o=a.h=b,a.g=0)}function P(a,b,c){a.l&128||(a.o=a.h=a.j=b,a.g=c||0)}function hc(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^b)&(d^b))}function Q(a,b){a.l&128||(a.o=a.h=a.j=b,a.g=a.o^a.j>>1)}function ic(a,b,c,d){a.l&128||(a.o=a.h=a.j=b,a.g=(c^d)&(d^b))} -function G(a,b,c){if(!a.T){var d=!1;0>a.ja?a.ja=Ya(a):a.u||(b=4,d=!0);a.w&57344||(a.oa=63222,a.gb=b);a.u=0;var e=a.R(b|a.N),f=a.R(b+2&65535|a.N);Bb(a,f&-12289|a.ja>>2&12288);d&&(a.H|=4,a.f[6]=4);jc(a,a.ja);jc(a,a.f[7]);L(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function kc(a){var b=lc(a),c=lc(a)&-1793;a.v&49152&&(c=c&-225|a.v&63712);L(a,b);Bb(a,c);a.l&=-17} -function mc(a,b,c){var d,e,f,h=0;d=b>>13;a.pa&a.Gb[a.u]||(d&=7);e=a.D[a.u][d];f=(a.S[a.u][d]<<6)+(b&8191)&a.bb;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Ib[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Na&&4186112>f&&(a.H|=32,G(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192: -128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.D[a.u][d]=e;if(4194170!==f||a.u)a.La=a.u,a.Ma=d;h&&(h&57344&&(0<=a.ja&&(h|=128),a.w&57344||(a.w=a.w|h|a.La<<5|a.Ma<<1),G(a,168,16)),a.w&61440||!(4191360>f||4194239>>a.m].jb(b&a.g,c&255,b)}function lc(a){var b=a.R(a.f[6]|a.N);a.f[6]=a.f[6]+2&65535;return b} +function G(a,b,c){if(!a.P){var d=!1;0>a.ja?a.ja=Ya(a):a.u||(b=4,d=!0);a.w&57344||(a.oa=63222,a.gb=b);a.u=0;var e=a.S(b|a.L),f=a.S(b+2&65535|a.L);Bb(a,f&-12289|a.ja>>2&12288);d&&(a.H|=4,a.f[6]=4);jc(a,a.ja);jc(a,a.f[7]);L(a,e);a.l&=-113;a.ja=-1;if(26!=c)throw b;}}function kc(a){var b=lc(a),c=lc(a)&-1793;a.v&49152&&(c=c&-225|a.v&63712);L(a,b);Bb(a,c);a.l&=-17} +function mc(a,b,c){var d,e,f,h=0;d=b>>13;a.pa&a.Gb[a.u]||(d&=7);e=a.D[a.u][d];f=(a.T[a.u][d]<<6)+(b&8191)&a.bb;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.pa&32&&(f=a.Ib[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Na&&4186112>f&&(a.H|=32,G(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192: +128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.D[a.u][d]=e;if(4194170!==f||a.u)a.La=a.u,a.Ma=d;h&&(h&57344&&(0<=a.ja&&(h|=128),a.w&57344||(a.w=a.w|h|a.La<<5|a.Ma<<1),G(a,168,16)),a.w&61440||!(4191360>f||4194239>>a.m].jb(b&a.g,c&255,b)}function lc(a){var b=a.S(a.f[6]|a.L);a.f[6]=a.f[6]+2&65535;return b} function jc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.w&57344||(a.oa=a.oa<<8|246);!a.u&&c<=a.qa&&4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.R(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.R(e)|h;a.a-= -8;break;case 6:return e=a.R(gc(a,2)),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=a.R(gc(a,2)),e=e+a.f[c]&65535,e=a.R(e|a.N)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.w&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.u&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.H|=4,a.f[6]=4,G(a,4,24)):(a.H|=8,a.l|=64));return e}g.Ia=function(a,b){this.Ga?(this.T++,nc(this,mc(this,a,5),b),this.T--):this.m.Ia(a,b)};g.Eb=function(a,b,c){return oc(this,a,b,c)}; -g.Fb=function(a,b,c){return mc(this,oc(this,a,b,c),c)};g.pc=function(a){return ob(this.m,a)};g.qc=function(a){return ob(this.m,mc(this,a,2))};g.bd=function(a,b){pb(this.m,a,b&65535)};g.cd=function(a,b){pb(this.m,mc(this,a,4),b)};function pc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=oc(a,b,d,2),c&65536||61440!==(a.v&61440)&&(d&=65535),a.u=a.v>>12&3,c=a.R(d|c&a.N),a.u=a.v>>14&3):c=6!=d||(a.v>>2&12288)===(a.v&12288)?a.f[d]:a.aa[a.v>>12&3];return c} +function oc(a,b,c,d){var e,f,h=d&8?0:a.L;switch(b){case 0:return G(a,4,20),0;case 1:return 6===c&&!a.u&&d&4&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32||65534<=a.f[6]?(a.H|=4,a.f[6]=4,G(a,4,22)):(a.H|=8,a.l|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|h;case 2:f=2;e=a.f[c];7!==c&&(e|=h,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.S(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.S(e)|h;a.a-= +8;break;case 6:return e=a.S(gc(a,2)),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=a.S(gc(a,2)),e=e+a.f[c]&65535,e=a.S(e|a.L)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.w&57344||(a.oa=a.oa<<8|f<<3&248|c);6==c&&!a.u&&d&4&&0>=f&&(a.f[6]<=a.qa||65534<=a.f[6])&&(a.f[6]<=a.qa-32?(a.H|=4,a.f[6]=4,G(a,4,24)):(a.H|=8,a.l|=64));return e}g.Ia=function(a,b){this.Ga?(this.P++,nc(this,mc(this,a,5),b),this.P--):this.m.Ia(a,b)};g.Eb=function(a,b,c){return oc(this,a,b,c)}; +g.Fb=function(a,b,c){return mc(this,oc(this,a,b,c),c)};g.pc=function(a){return ob(this.m,a)};g.qc=function(a){return ob(this.m,mc(this,a,2))};g.bd=function(a,b){pb(this.m,a,b&65535)};g.cd=function(a,b){pb(this.m,mc(this,a,4),b)};function pc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=oc(a,b,d,2),c&65536||61440!==(a.v&61440)&&(d&=65535),a.u=a.v>>12&3,c=a.S(d|c&a.L),a.u=a.v>>14&3):c=6!=d||(a.v>>2&12288)===(a.v&12288)?a.f[d]:a.aa[a.v>>12&3];return c} function qc(a,b,c,d){a.w&57344||(a.oa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=oc(a,b,e,4),c&65536||(e&=65535),a.u=a.v>>12&3,e=mc(a,e|c&65536,4),a.u=a.v>>14&3,pb(a.m,e,d)):6!=e||(a.v>>2&12288)===(a.v&12288)?a.f[e]=d:a.aa[a.v>>12&3]=d}function rc(a,b){b>>=6;var c=a.C=b&7;(b=a.B=(b&56)>>3)?(c=a.I(b,c,3),a=nb(a.m,c)):a=a.f[c]&255;return a}function R(a,b){b>>=6;var c=a.C=b&7;return(b=a.B=(b&56)>>3)?ob(a.m,a.I(b,c,2)):a.f[c]}function sc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return oc(a,b,c,8)} function tc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.I(b,c,3),a=nb(a.m,c)):a=a.f[c]&255;return a}function uc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?ob(a.m,a.I(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.$a=a.I(b,e,7),nc(a,e,d.call(a,c,nb(a.m,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.I(b,e,6),pb(a.m,e,d.call(a,c,ob(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} function vc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?nc(a,a.I(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?pb(a.m,a.I(b,d,4),c):a.f[d]=c&65535;return c}function U(a,b,c){c&&(L(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3} @@ -134,56 +134,56 @@ this.a-=this.c?11:6},function(a){T(this,a,N(this)?1:0,xc);this.a-=this.c?9:3+(7= 15].call(this,a)},Y,Y,Y,W,W,W,W,Md,Y,ae,ce,Pd,Pd,Pd,Pd],ne=[zd,Rd,Ld,rd,Ad,Kd,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],be=[Jd,function(){this.j=0;this.a-=5},function(){this.g=0;this.a-=5},V,function(){this.h=1;this.a-=5},V,V,V,function(){this.o=0;this.a-=5},V,V,V,V,V,V,V],de=[Jd,function(){this.j=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.o=32768;this.a-=5},X,X,X,X,X,X,X],le=[qd,od,kd,md,td,ud,$c,ad,yd,Qd,ee,ge,ie,Y,Y,Y],fe=[function(a){P(this,vc(this,a, 0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Mc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}],he=[function(a){S(this,a,0,Oc);this.a-=this.c?11:6},function(a){S(this,a,N(this)?1:0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,N(this)?1:0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=tc(this,a);P(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}], je=[function(a){S(this,a,0,Sc);this.a-=this.c?9+(this.$a&1):3+(7==this.b?2:0)},function(a){S(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,Cc);this.a-=this.c?9+(this.$a&1):3+(7==this.b?2:0)},function(a){S(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)}];function bc(a){oe[a>>12].call(this,a)} -var oe=[function(a){pe[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Xc,function(a){qe[a>>8&15].call(this,a)},function(a){re[a>>8&15].call(this,a)},Gd,wd,gd,cd,ed,Od,Y],pe=[function(a){se[a>>4&15].call(this,a)},sd,pd,hd,id,nd,jd,ld,Dd,Dd,Ud,Wd,Yd,function(a){te[a>>6&3].call(this,a)},Y,Y],te=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.R(a|this.N);L(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=pc(this,a,0);jc(this,a);O(this,a);this.a-=11},function(a){var b=lc(this),c=this.a; +var oe=[function(a){pe[a>>8&15].call(this,a)},Fd,vd,fd,bd,dd,Xc,function(a){qe[a>>8&15].call(this,a)},function(a){re[a>>8&15].call(this,a)},Gd,wd,gd,cd,ed,Od,Y],pe=[function(a){se[a>>4&15].call(this,a)},sd,pd,hd,id,nd,jd,ld,Dd,Dd,Ud,Wd,Yd,function(a){te[a>>6&3].call(this,a)},Y,Y],te=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.L);L(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=pc(this,a,0);jc(this,a);O(this,a);this.a-=11},function(a){var b=lc(this),c=this.a; qc(this,a,0,b);O(this,b);this.a=c-Hd[this.c]},function(a){O(this,wc(this,a,this.ma?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],se=[function(a){ue[a&15].call(this,a)},Y,Y,Y,W,W,W,W,Md,function(a){a&8?(this.v&49152||(this.v=this.v&-2017|(a&7)<<5,this.l|=1),this.a-=5):G(this,8,6)},ae,ce,Pd,Pd,Pd,Pd],ue=[zd,Rd,Ld,rd,Ad,Kd,function(){kc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],qe=[Id,Id,xd,xd,Yc,Yc,Zc,Zc,Sd,Sd,Y,Y,Y,Y,Nd,Nd],re=[qd,od,kd,md,td,ud,$c,ad,yd,Qd,ee,ge,ie,function(a){ve[a>>6&3].call(this,a)}, Y,Y],ve=[Y,function(a){a=pc(this,a,65536);jc(this,a);O(this,a);this.a-=11},function(a){var b=lc(this),c=this.a;qc(this,a,65536,b);O(this,b);this.a=c-Hd[this.c]},Y]; -function we(a){u.call(this,"ROM",a,we);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;k(a,null,!0,function(a,b,f){f?c.K("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.ra,a,b),(a=ua(a,b))?(c.b=a.L,c.Y=a.Y):c.g=null,xe(c))})}}w(we);we.prototype.fa=function(a,b,c,d){this.m=b;this.a=c;this.F=d;xe(this)}; +function we(a){u.call(this,"ROM",a,we);this.Y=this.b=null;this.j=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.o=ka(this.g);if(this.g){a=this.g;var b=la(this.o);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;k(a,null,!0,function(a,b,f){f?c.K("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.ra,a,b),(a=ua(a,b))?(c.b=a.N,c.Y=a.Y):c.g=null,xe(c))})}}w(we);we.prototype.fa=function(a,b,c,d){this.m=b;this.a=c;this.F=d;xe(this)}; we.prototype.$=function(){this.Y&&(this.F&&this.F.a(this.id,this.j,this.c,this.Y),delete this.Y);return!0};we.prototype.Z=function(){return!0}; function xe(a){if(!Sa(a)){if(a.g){if(!a.b||!a.m)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.i.error=!0;a.K(b)}else{b=a.j;if(jb(a.m,b,a.c,Hb)){var c;for(c=0;c=b.length)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,y=n-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(y)for(;y--;)a.a.Ia(r++,b[t++]&255);else r&1?D(a.a):ec(a.a,r);f=!0}else h++;else h+=2}if(!f&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=qa(b[0]);if(c!=this.Ka)return;b=qa(b[1]);if(this.u=Qa(b)){var d=this.u.exports;if(d){var e=d.connect;e&&e.call(this.u);if(this.w=d.receiveData){this.status(this.ra+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -g.Z=function(a){return a?this.save():!0};g.reset=function(){Ee(this)};g.save=function(){var a=new M(this);a.set(0,[]);return a.data()};g.restore=function(){return Ee(this)};function Ee(a){a.C=0;a.b=0;a.c=128;a.h=[];return!0}g.fb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.G||8,c=a-this.o%a,this.G&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.P(this.j), -this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;xb(this.a,this.J,1)}};var Fe={},De=(Fe[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],Fe[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],Fe[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],Fe[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],Fe);q(function(){for(var a=B(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.s[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.s[b]=c,c.onclick=function(){var a= +g.Z=function(a){return a?this.save():!0};g.reset=function(){Ee(this)};g.save=function(){var a=new M(this);a.set(0,[]);return a.data()};g.restore=function(){return Ee(this)};function Ee(a){a.I=0;a.b=0;a.c=128;a.h=[];return!0}g.fb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.o%a,this.J&&(b=" ".slice(0,c)));this.C&&!this.o&&c&&(b=String.fromCharCode(this.C)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.j){if(10==a||1024<=this.j.length)this.R(this.j), +this.j="";10!=a&&(this.j+=String.fromCharCode(a))}this.c&=-129;xb(this.a,this.M,1E3/Math.round(this.G/10))}};var Fe={},De=(Fe[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],Fe[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],Fe[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],Fe[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],Fe);q(function(){for(var a=B(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.s[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.s[b]=c,c.onclick=function(){var a= d.s.listTapes;a&&Ie(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.s[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;Ie(d,ka(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.s[b]=c,!0}return!1}; -g.fa=function(a,b,c,d){this.A=a;this.m=b;this.a=c;this.F=d;this.G=Je(a);var e=this;if((this.c=Sb(this.A,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){m("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.I=yb(56,4);this.N=vb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!k(f,null,!0,function(e,f,h){var l=0>h&&a.A&&!a.A.i.M;h?a.K('Unable to load tape "'+b+'" (error '+h+": "+e+")",l):(Pa(a.ra,e,f),(e=ua(e,f))&&Se(a,b,c,d,e.L,e.va,e.ua)); +function Re(a,b,c,d,e){var f=c;if(e){var h=new FileReader;h.onload=function(){var e=h.result;e&&(e=new Uint8Array(e,0,e.byteLength),Se(a,b,c,d,e),a.o="?");Pe(a)};h.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!k(f,null,!0,function(e,f,h){var l=0>h&&a.A&&!a.A.i.O;h?a.K('Unable to load tape "'+b+'" (error '+h+": "+e+")",l):(Pa(a.ra,e,f),(e=ua(e,f))&&Se(a,b,c,d,e.N,e.va,e.ua)); a.i.Ya=!1;a.h&&(a.h--,a.h||C(a));Pe(a)})}function Me(a,b,c,d){if((a=a.s.listTapes)&&a.options){for(var e=0;e\nLicense: GPL version 3 or later ");this.P("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;b\nLicense: GPL version 3 or later ");this.R("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bWe){if(Ye(d,this.u)){this.j=new M(this,"1.30.1","failsafe");Ye(this.j)&&(cf(this,d),a=2,df(this.j));this.j.set("timestamp",ta());ef(this.j);var e=this.b&&!this.o;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=bf(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?Ye(d,h):("error"== -f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(za("user",""),this.c=null)):this.P(f+": "+h),df(d),Ye(d)?(c=bf(d),e=!0):c=!1))}e&&af(this,c?d:null)}else 2==a&&d.clear()}else af(this);delete this.u;delete this.w}e=x(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.i.M=!0;var d=this.s.power;d&&(d.textContent="Shutdown");this.a&&(ff(this,this.a,b,c,a),this.a.Fa());this.G&&(cf(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; -function cf(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;k("http://www.pcjs.org/api/v1/report",d,!0)}} -function gf(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new M(a,"1.30.1"),h=new M(a,"1.30.1","validate"),l=ta();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&D(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.M=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;na[1];a=a[2];this.P=!0;this.i.O=!0;var d=this.s.power;d&&(d.textContent="Shutdown");this.a&&(ff(this,this.a,b,c,a),this.a.Fa());this.G&&(cf(this,b),b.clear());!c&&this.j&&(this.j.clear(),delete this.j);this.g=0}; +function cf(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.M;d.user=c;d.type="bug";d.data=b;k("http://www.pcjs.org/api/v1/report",d,!0)}} +function gf(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new M(a,"1.30.1"),h=new M(a,"1.30.1","validate"),l=ta();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&D(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.O=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n