Merge branch 'master' into gh-pages, and fix a few issues related to autoStart

# Conflicts:
#	_posts/2016-12-02-the-pdp-11-and-vt100-revisited.md
#	docs/pcx86/examples/pcx86-dbg.js
#	docs/pcx86/examples/pcx86.js
This commit is contained in:
Jeff Parsons 2016-12-04 11:26:10 -08:00 committed by Jeff Parsons
commit 9ed580066c
33 changed files with 348 additions and 321 deletions

View file

@ -306,7 +306,7 @@ added, too.
When a PCjs machine runs in a browser, an XML machine configuration file is transformed into HTML with a set of DIVs
for each component: an "object" DIV whose *data-value* attribute provides the initialization parameters for the
corresponding component, along with a set of optional "control" DIVs that the component can bind to (eg, a "Run" button,
corresponding component, along with a set of optional "control" DIVs that the component can bind to (eg, a **Run** button,
or a visual representation of DIP switches, or whatever).
When a PCjs machine is run from the command-line, there is no XML, HTML, or DIVs involved; this is basically a
@ -379,7 +379,7 @@ where PCjs could run amok and destroy the planet.
Other parameters that can be passed via the URL:
- *autostart*: set it to "true" to allow all machines to start normally, "false" to prevent all machines from starting,
or "no" to prevent all machines from starting *unless* they have no "Run" button; e.g.:
or "no" to prevent all machines from starting *unless* they have no **Run** button; e.g.:
http://localhost:8088/?gort=debug&autostart=false

View file

@ -34,7 +34,7 @@ gems:
pcjs:
domain: pcjs.org # whereas site.url is used for linking purposes, site.pcjs.domain is used for display purposes
version: 1.30.5 # IMPORTANT: keep pcjs.version in sync with package.json:version
version: 1.30.6 # IMPORTANT: keep pcjs.version in sync with package.json:version
compiled: true # by default, the compiled pcjs.version scripts will be used (eg, pcx86.js or pcx86-dbg.js)
c1p_scripts: # if pcjs.compiled is false, the following scripts will be included instead, in the order listed
- /modules/shared/lib/defines.js
@ -104,6 +104,7 @@ pcjs:
- /modules/shared/lib/save.js
pc8080_scripts:
- /modules/shared/lib/defines.js
- /modules/shared/lib/nodebug.js
- /modules/shared/lib/dumpapi.js
- /modules/shared/lib/reportapi.js
- /modules/shared/lib/userapi.js
@ -134,6 +135,7 @@ pcjs:
- /modules/shared/lib/embed.js
pdp11_scripts:
- /modules/shared/lib/defines.js
- /modules/shared/lib/nodebug.js
- /modules/shared/lib/dumpapi.js
- /modules/shared/lib/reportapi.js
- /modules/shared/lib/userapi.js

View file

@ -2,3 +2,5 @@ developer: true
url: "http://localhost:4000"
pcjs:
compiled: false
debug: false
private: true

View file

@ -116,7 +116,7 @@ of our Markdown or XML documents. Examples: 'automount' becomes 'autoMount', 'a
{% if machine_type == "pc8080" %}{% assign array_scripts = site.pcjs.pc8080_scripts %}{% endif %}
{% if machine_type == "pdp11" %}{% assign array_scripts = site.pcjs.pdp11_scripts %}{% endif %}
{% for script in array_scripts %}
{% if script != "/modules/shared/lib/nodebug.js" or machine.debug != true %}
{% if script != "/modules/shared/lib/nodebug.js" or machine.debug != true and site.pcjs.debug != true %}
{% capture machine_script %}<script type="text/javascript" src="{{ site.baseurl }}{{ script }}"></script>{% endcapture %}
{% unless machine_scripts contains machine_script %}
{{ machine_script }}

View file

@ -89,7 +89,7 @@ first prefix changed the instruction's addressing mode from 16-bit to 32-bit, an
16-bit. PCx86 should have simply ignored the second prefix.
With all of the above changes in place, PCx86 v1.18.4 is able to run Windows 95 Setup a bit farther, but still far from
completion. If you want to give it a spin yourself, start the machine below (click the "Run" button) and once it has
completion. If you want to give it a spin yourself, start the machine below (click the **Run** button) and once it has
finished booting, run SETUP from drive B, where the first Windows 95 diskette is already loaded.
If, when it crashes (and it will), you're interested in examining the instructions that were executed prior to the

View file

@ -37,7 +37,7 @@ component, [device.js](/modules/pdp11/lib/device.js), which has now been convert
The first new device component is [serialport.js](/modules/pdp11/lib/serialport.js), which is currently the
only means PDPjs has of communicating with the outside world. So you can try
[PDPjs connected to a VT100 Terminal](/devices/pdp11/machine/1170/vt100/), by clicking the "Run" button on the test machine.
[PDPjs connected to a VT100 Terminal](/devices/pdp11/machine/1170/vt100/), by clicking the **Run** button on the test machine.
The test machine is running [custom boot code](/apps/pdp11/boot/test/), adapted from boot code written by Paul, but due to the
lack of other device support, nothing can be booted yet.

View file

@ -24,9 +24,10 @@ and machines can now be configured to include a virtual paper tape reader, with
ready to be loaded.
In the real world, before you could load *any* paper tape, you had to first enter a
[Bootstrap Loader](/apps/pdp11/boot/bootstrap/). PDPjs has simplified that process by including the Bootstrap Loader as
just another paper tape image that you can "Read" directly into memory. Once that has been done, you can then load any
other paper tape image using the Bootstrap Loader, once you "Load" it into the paper tape reader.
[Bootstrap Loader](/apps/pdp11/boot/bootstrap/). PDPjs has simplified that process by including the "Bootstrap Loader"
as just another paper tape image that you can read directly into memory, using the **Read** button. Once that has been
done, you can then load any other paper tape image using the Bootstrap Loader, once you **Load** it into the paper tape
reader.
{% include machine.html id="test1120" %}

View file

@ -28,11 +28,11 @@ The latest release, v1.30.3, adds the following features:
- Support for DEC's [RL11 Disk Controller](/devices/pdp11/rl11/) has been implemented
To test RL11 support below, then select the "XXDP+ Diagnostics" disk from the "Disk Drive Controls",
click "Load", and wait for the message:
click **Load**, and wait for the message:
Mounted disk "XXDP+ Diagnostics" in drive RL0
Then start the machine (click "Run") and make sure the following prompt has been displayed:
Then start the machine (click **Run**) and make sure the following prompt has been displayed:
PDP-11 MONITOR V1.0

View file

@ -80,7 +80,7 @@ but unlike tapes like [PDP-11 BASIC](/apps/pdp11/tapes/basic/), they don't inclu
documentation for each test to learn the starting procedure, including any switches that should be set first.
However, PDPjs makes life a bit simpler for you. As noted for other [DEC PDP-11 Tape Images](/apps/pdp11/tapes/), any
"Absolute Format" tape can be read directly into RAM using the machine's "Read" button instead of "Load", allowing you
"Absolute Format" tape can be read directly into RAM using the machine's **Read** button instead of **Load**, allowing you
to bypass the usual three-step process of loading the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) in order to load the
[Absolute Loader](/apps/pdp11/tapes/absloader/) in order to load the desired tape.

View file

@ -10,13 +10,13 @@ I'm still trying to flush out lingering bugs in PDPjs. I'll give you an example
![Image of PDP-11/70 with 256Kb, Front Panel and Debugger](/blog/images/pdp-1170-panel-debugger.png)
After loading the "MD-11 11/70 CPU EXERCISER" paper tape image directly into memory using the "Load" button
(*not* "Attach"), and then loading the "RT-11 v4.0" disk image into drive RK0, and then finally issuing a few
After loading the "MD-11 11/70 CPU EXERCISER" paper tape image directly into memory using the **Read** button
(*not* **Load**), and then loading the "RT-11 v4.0" disk image into drive RK0, and then finally issuing a few
preliminary Debugger commands:
m rk11 on; bp 005254
we're ready to "let 'er rip," either by using the Debugger `g` command or clicking the "Run" button.
we're ready to "let 'er rip," either by using the Debugger `g` command or clicking the **Run** button.
You'll see a variety of disk-related messages from the RK11 component in the Control Panel window, which serves
both as the Debugger's output window and as the 11/70's terminal window. The output begins with:

View file

@ -11,13 +11,16 @@ To load any of the DEC PDP-11 paper tapes listed below, you will need to use a [
with a [PC11 High-Speed Paper Tape Reader/Punch](/devices/pdp11/pc11/), such as this
[PDP-11/20](/devices/pdp11/machine/1120/basic/debugger), and then follow this three-step process:
- "Read" the [DEC PDP-11 Bootstrap Loader](/apps/pdp11/boot/bootstrap/)
- "Load" the [Absolute Loader](absloader/) tape image, and read it with the Bootstrap Loader
- "Load" one of the "Absolute Format" tape images below, and read it with the Absolute Loader
- **Read** the [DEC PDP-11 Bootstrap Loader](/apps/pdp11/boot/bootstrap/)
- **Load** the [Absolute Loader](absloader/) tape image
- **Run** the Bootstrap Loader to read the Absolute Loader
- **Load** one of the "Absolute Format" tape images below
- **Run** the Absolute Loader to read the selected tape image
This mirrors the three-step "real world" process of loading paper tape software. Moreover, any "Absolute
Format" tape (which should include all the tapes listed below) can be loaded directly into RAM using the
machine's "Read" button instead of "Load". In most cases, that eliminates the first two steps.
This mirrors the multi-step "real world" process of loading paper tape software.
PDPjs simplifies that process: any "Absolute Format" tape (which should include all the tapes listed below) can be
loaded directly into RAM using the machine's **Read** button, replacing all the above steps with a single click.
Paper Tape Diagnostics
----------------------

View file

@ -13,7 +13,7 @@ website, we have been able to archive the PDP-11 diagnostics shown below. The t
[PC11](/modules/pdp11/lib/pc11.js), such as this [PDP-11/20 with Front Panel and Debugger](/devices/pdp11/machine/1120/panel/debugger/).
As noted for other [DEC PDP-11 Tape Images](/apps/pdp11/tapes/), these "Absolute Format" tapes can be read directly
into RAM using the machine's "Read" button instead of "Load", allowing you to bypass the usual three-step process of
into RAM using the machine's **Read** button instead of **Load**, allowing you to bypass the usual three-step process of
loading the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) in order to load the [Absolute Loader](/apps/pdp11/tapes/absloader/)
in order to load the desired tape.

View file

@ -16,7 +16,7 @@ All PCjs machines are built from the following sets of devices:
* [6502 Devices](c1p/) (e.g., [Challenger 1P](c1p/machine/))
* [8080 Devices](pc8080/) (e.g., [Space Invaders](pc8080/machine/invaders/), [VT100 Terminal](pc8080/machine/vt100/))
* [8086 Devices](pcx86/) (e.g., [IBM PC and compatibles](pcx86/machine/))
* [PDP-11 Devices](pdp11/) (e.g., [PDP-11/20](pdp11/machine/1120/), [PDP-11/70](pdp11/machine/1170/))
* [PDP-11 Devices](pdp11/) (e.g., [PDP-11/20](pdp11/machine/1120/), [PDP-11/45](pdp11/machine/1145/), [PDP-11/70](pdp11/machine/1170/))
These devices are user-installable components that you would typically find in a real personal computer,
such as keyboards, disk drive controllers with one or more drives, video cards, etc.

View file

@ -23,7 +23,7 @@ It is currently playable only in desktop browsers and uses the following hard-co
- D: Move Right
- L: Fire Missile
Click the "Run" button to start the simulation. You'll also find assorted
Click the **Run** button to start the simulation. You'll also find assorted
[Space Invaders Hardware Notes](#space-invaders-hardware-notes) below.
{% include machine.html id="invaders" %}

View file

@ -12,7 +12,7 @@ DEC VT100 Terminal with Debugger
--------------------------------
The [PC8080](/modules/pc8080/) machine below is configured to simulate a [VT100 Terminal](/devices/pc8080/machine/vt100/)
with a Control Panel and Debugger. When you press the "Run" button, it will start running the original
with a Control Panel and Debugger. When you press the **Run** button, it will start running the original
[VT100 Firmware](/devices/pc8080/rom/vt100/) inside the [PC8080](/modules/pc8080/) CPU emulator.
Information about [VT100 Keys](#vt100-keys) and assorted [Hardware Notes](#vt100-memory-usage) are provided below,
@ -208,8 +208,10 @@ Consequently, a VT100 [machine XML file](machine.xml) must set the Video compone
to "true", indicating that existing RAM should be used, and a new property, *bufferFormat* must be set to "vt100",
enabling support for the VT100's line data format; eg:
<ram id="ram" addr="0x2000" size="0x0C00"/>
<video id="video" screenWidth="1600" screenHeight="960" bufferAddr="0x2000" bufferRAM="true" bufferFormat="vt100" bufferCols="80" bufferRows="24" ...>
```xml
<ram id="ram" addr="0x2000" size="0x0C00"/>
<video id="video" screenWidth="1600" screenHeight="960" bufferAddr="0x2000" bufferRAM="true" bufferFormat="vt100" bufferCols="80" bufferRows="24"/>
```
VT100 Screen and Character Dimensions
-------------------------------------

View file

@ -25,17 +25,17 @@ and then pre-loads the [Absolute Loader](/apps/pdp11/tapes/absloader/) tape imag
<device id="pc11" type="pc11" baudReceive="9600" autoMount='{PTR:{path:"/apps/pdp11/tapes/absloader/DEC-11-L2PC-PO.json"}}'>...</device>
```
Click "Run" to load the [Absolute Loader](/apps/pdp11/tapes/absloader/).
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 "Load" and then "Run".
click **Load** and then **Run**.
If you need to start over, select "Bootstrap Loader (16Kb)" from the list of tapes and click "Read" instead of
"Load", re-installing the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) directly into RAM.
If you need to start over, select "Bootstrap Loader (16Kb)" from the list of tapes and click **Read** instead of
**Load**, re-installing the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) directly into RAM.
Alternatively, just press the "Reset" button. The RAM component was recently updated to restore pre-loaded images whenever
Alternatively, just press the **Reset** button. The RAM component was recently updated to restore pre-loaded images whenever
the entire machine is reset. You'll still need to manually reload the [Absolute Loader](/apps/pdp11/tapes/absloader/)
tape image, however.

View file

@ -26,17 +26,17 @@ and then pre-loads the [Absolute Loader](/apps/pdp11/tapes/absloader/) tape imag
<device id="pc11" type="pc11" baudReceive="9600" autoMount='{PTR:{path:"/apps/pdp11/tapes/absloader/DEC-11-L2PC-PO.json"}}'>...</device>
```
Click "Run" to load the [Absolute Loader](/apps/pdp11/tapes/absloader/).
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 "Load" and then "Run".
click **Load** and then **Run**.
If you need to start over, select "Bootstrap Loader (16Kb)" from the list of tapes and click "Read" instead of
"Load", re-installing the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) directly into RAM.
If you need to start over, select "Bootstrap Loader (16Kb)" from the list of tapes and click **Read** instead of
**Load**, re-installing the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) directly into RAM.
Alternatively, just press the "Reset" button. The RAM component was recently updated to restore pre-loaded images whenever
Alternatively, just press the **Reset** button. The RAM component was recently updated to restore pre-loaded images whenever
the entire machine is reset. You'll still need to manually reload the [Absolute Loader](/apps/pdp11/tapes/absloader/)
tape image, however.

View file

@ -75,8 +75,8 @@ Here's a simple machine XML definition that's more useful:
[Example 1](examples/example1.html) shows the [XML](examples/example1.xml) in action.
Machine definitions can also include visual elements. For example, we can include a "Run" button with the CPU component.
Note that as soon as the machine is ready and the CPU starts running, the "Run" button will change to "Halt".
Machine definitions can also include visual elements. For example, we can include a **Run** button with the CPU component.
Note that as soon as the machine is ready and the CPU starts running, the **Run** button will change to **Halt**.
```xml
<machine id="ibm" class="pc" width="720px">
@ -174,7 +174,7 @@ All of the examples described above are available for [download](examples/).
If you have (or find) an IMG disk image file on a server, the PCjs web server provides a
[DiskDump API](/api/v1/dump) via endpoint "/api/v1/dump" that creates PCx86-compatible disks in JSON:
{{ site.url }}/api/v1/dump?disk=(file|url)&format=json
For example, let's say you found a disk image online, such as:

View file

@ -33,7 +33,7 @@ Attributes
* Provides an easy way to multiply the default CPU speed.
* *autoStart* (optional)
* This can be set to "true" or "false" to explicitly control whether or not the machine starts running automatically.
If this parameter is omitted, the machine will autostart only if no Debugger component is included and no "Run" button is defined.
If this parameter is omitted, the machine will autostart only if no Debugger component is included and no **Run** button is defined.
Also supports the attributes of *[Component](/docs/pcx86/component/)*. The *id* attribute is optional, since machines
currently support only one CPU component.

View file

@ -51,7 +51,7 @@ function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b){var c,d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function ha(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=fa(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
function ia(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function r(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function u(a){return r(a,2,!0)}function v(a){return r(a,4,!0)}
function ja(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}var na={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})}
function pa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function pa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function sa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var ta=Date.now||function(){return+new Date};function ua(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var va=[31,28,31,30,31,30,31,31,30,31,30,31];
function wa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.vh|g<<f.shift&f.vh}return c}function xa(a,b){return(b&a.vh)>>a.shift}function ya(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c<d;c++)if(c in a&&a[c]===b)return c;return-1}
function Aa(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"==
@ -605,8 +605,8 @@ l.hc=function(a,b){if(!b)if(this.zj(this.pa),!a||!this.restore)this.reset();else
function Eo(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.Ja,[]]);a.ya=b[c++];a.Da=b[c++];a.fa=b[c++];a.ka=b[c++];a.U=b[c++];a.C=b[c++];a.ra=b[c++];a.B=b[c++];a.A=b[c++];a.aa=b[c];return!0}l.hg=function(a){if("number"==typeof a)this.aa.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.aa.push(a.charCodeAt(b));else this.aa=this.aa.concat(a);Fo(this);return!0};l.ll=function(a){var b=this.A;this.A&=~(zo|Ao);a&32&&(this.A=this.A|zo|1);a&64&&(this.A=this.A|Ao|2);b!=this.A&&Go(this)};
function Fo(a){0<a.aa.length&&!(a.B&1)&&(a.ya=a.aa.shift(),a.B|=1);Go(a)}l.Em=function(a,b){var c=this.C&128?this.fa&255:this.ya;x(this,a,null,b,this.C&128?"DLL":"RBR",c);this.B&=-2;Fo(this);return c};l.qm=function(a,b){var c=this.C&128?this.fa>>8:this.ka;x(this,a,null,b,this.C&128?"DLM":"IER",c);return c};l.rm=function(a,b){var c=this.U;x(this,a,null,b,"IIR",c);return c};l.sm=function(a,b){var c=this.C;x(this,a,null,b,"LCR",c);return c};l.um=function(a,b){var c=this.ra;x(this,a,null,b,"MCR",c);return c};
l.tm=function(a,b){var c=this.B;x(this,a,null,b,"LSR",c);return c};l.zm=function(a,b){var c=this.A;this.A&=-4;x(this,a,null,b,"MSR",c);return c};
l.ho=function(a,b,c){x(this,a,b,c,this.C&128?"DLL":"THR");if(this.C&128)this.fa=this.fa&-256|b;else{this.Da=b;this.B&=-97;a=!1;y(this,"transmitByte("+u(b)+")");this.ua&&this.ua.call(this.L,b)&&(a=!0);if(this.V)13==b?this.ea=0:8==b?(this.V.value=this.V.value.slice(0,-1),0<this.ea&&this.ea--):(a=(a=ra[b])?"<"+a+">":String.fromCharCode(b),c=a.length,32>b&&1==c&&(c=0),9==b&&(b=this.Ga||8,c=b-this.ea%b,this.Ga&&(a=pa("",c))),this.Ea&&!this.ea&&c&&(a=String.fromCharCode(this.Ea)+a),this.V.value+=a,this.V.scrollTop=
this.V.scrollHeight,this.ea+=c),a=!0;else if(null!=this.W){if(10==b||1024<=this.W.length)this.O(this.W),this.W="";10!=b&&(this.W+=String.fromCharCode(b));a=!0}a&&(this.B|=96)}};l.Tn=function(a,b,c){x(this,a,b,c,this.C&128?"DLM":"IER");this.C&128?this.fa=this.fa&255|b<<8:this.ka=b};l.Un=function(a,b,c){x(this,a,b,c,"LCR");this.C=b};
l.ho=function(a,b,c){x(this,a,b,c,this.C&128?"DLL":"THR");if(this.C&128)this.fa=this.fa&-256|b;else{this.Da=b;this.B&=-97;a=!1;y(this,"transmitByte("+u(b)+")");this.ua&&this.ua.call(this.L,b)&&(a=!0);if(this.V)13==b?this.ea=0:8==b?(this.V.value=this.V.value.slice(0,-1),0<this.ea&&this.ea--):(a=(a=13!=b&&10!=b?ra[b]:null)?"<"+a+">":String.fromCharCode(b),c=a.length,32>b&&1==c&&(c=0),9==b&&(b=this.Ga||8,c=b-this.ea%b,this.Ga&&(a=pa("",c))),this.Ea&&!this.ea&&c&&(a=String.fromCharCode(this.Ea)+a),this.V.value+=
a,this.V.scrollTop=this.V.scrollHeight,this.ea+=c),a=!0;else if(null!=this.W){if(10==b||1024<=this.W.length)this.O(this.W),this.W="";10!=b&&(this.W+=String.fromCharCode(b));a=!0}a&&(this.B|=96)}};l.Tn=function(a,b,c){x(this,a,b,c,this.C&128?"DLM":"IER");this.C&128?this.fa=this.fa&255|b<<8:this.ka=b};l.Un=function(a,b,c){x(this,a,b,c,"LCR");this.C=b};
l.Vn=function(a,b,c){var d=b^this.ra;x(this,a,b,c,"MCR");this.ra=b;d&3&&this.Cc&&(a=0,a=this.pa?a|(b&2?32:0)|(b&1?320:0):a|(b&2?16:0)|(b&1?1048576:0),this.Cc.call(this.L,a))};function Go(a){var b=-1;a.B&1&&a.ka&1?b=4:a.A&3&&a.ka&8&&(b=0);0<=b?(a.U&=-8,a.U|=b,a.N&&a.ia&&mg(a.N,a.ia,100)):(a.U|=1,a.N&&a.ia&&lg(a.N,a.ia))}
var Co={0:yo.prototype.Em,1:yo.prototype.qm,2:yo.prototype.rm,3:yo.prototype.sm,4:yo.prototype.um,5:yo.prototype.tm,6:yo.prototype.zm},Do={0:yo.prototype.ho,1:yo.prototype.Tn,3:yo.prototype.Un,4:yo.prototype.Vn};Xa(function(){for(var a=tb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new yo(d);sb(d,c)}});function Ho(a){bb.call(this,"Mouse",a,Ho,16777216);if(this.ka=a.serial)this.pa="SerialPort";this.ia=this.fa=this.Ic=!1;this.C=[];this.B=[];xb(this)}jb(Ho);var wn=0;l=Ho.prototype;
l.Jc=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;for(b=null;b=Jb(a,"Video",b);)this.C.push(b)};l.hc=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.pa&&!this.N){for(a=null;(a=Jb(this.X,this.pa,a))&&(!a.bj||!(this.N=a.bj(this.ka,this,this.kl))););if(this.N)for(this.B=[],a=0;a<this.C.length;a++)b=this.C[a],b.V=this,(b=b.X)&&this.B.push(b);else w(this.id+": "+this.pa+" "+this.ka+" unavailable")}this.Ic?Io(this):Jo(this)}return!0};
@ -869,4 +869,4 @@ a):f("transformToFragment failed")):f("unable to transform XML: unsupported brow
function zs(a,b,c,d){if(!c&&b){d.push(b);a=lb[d[0]];b=null;for(var e in a)if(ma(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?Aa(b,null,!0,function(a,b){As(b,d)}):As(null,d)}else w("Error ("+c+") requesting "+a)}
function As(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=lb[f],k={},m;for(m in h){var n=h[m],t=ka(m);if("xml"==t){for(t=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=t.exec(h[m]);){var q=d[2];q&&(h[q]||(n=n.replace(d[0],"")))}d=m=ja(m)}else"xsl"==t&&(e=m=ja(m));k[m]=n}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Na(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",w(a)):w("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Tr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcjs/1.30.6/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){zs(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Tr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcx86/1.30.6/pcx86"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){zs(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();

View file

@ -50,8 +50,8 @@ p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];
function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ga(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
function ha(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ia(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ja={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function ka(a){return a.replace(/[&<>"']/g,function(a){return ja[a]})}function la(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
var ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},na=Date.now||function(){return+new Date};function oa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
var pa=[31,28,31,30,31,30,31,31,30,31,30,31];function qa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.sg|g<<f.shift&f.sg}return c}function ra(a,b){return(b&a.sg)>>a.shift}
var ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},na=Date.now||function(){return+new Date};
function oa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var pa=[31,28,31,30,31,30,31,31,30,31,30,31];function qa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.sg|g<<f.shift&f.sg}return c}function ra(a,b){return(b&a.sg)>>a.shift}
function sa(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 k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}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 ta(){return"http://"+(window?window.location.host:"www.pcjs.org")}
function r(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va}function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
@ -565,8 +565,8 @@ l.wi=function(a){if(!this.D){var b=nc(this.ba,"connection");if(b){var c=b.split(
l.Ub=function(a,b){if(!b)if(this.wi(this.Z),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){Wl(this)};l.save=function(){var a=new de(this),b=0,c=[];c[b++]=this.ma;c[b++]=this.pa;c[b++]=this.P;c[b++]=this.Y;c[b++]=this.H;c[b++]=this.L;c[b++]=this.da;c[b++]=this.C;c[b++]=this.B;c[b]=this.K;a.set(0,c);return a.data()};l.restore=function(a){return Wl(this,a[0])};
function Wl(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.sa,[]]);a.ma=b[c++];a.pa=b[c++];a.P=b[c++];a.Y=b[c++];a.H=b[c++];a.L=b[c++];a.da=b[c++];a.C=b[c++];a.B=b[c++];a.K=b[c];return!0}l.jf=function(a){if("number"==typeof a)this.K.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.K.push(a.charCodeAt(b));else this.K=this.K.concat(a);Xl(this);return!0};l.$j=function(a){var b=this.B;this.B&=~(Rl|Sl);a&32&&(this.B=this.B|Rl|1);a&64&&(this.B=this.B|Sl|2);b!=this.B&&Yl(this)};
function Xl(a){0<a.K.length&&!(a.C&1)&&(a.ma=a.K.shift(),a.C|=1);Yl(a)}l.pl=function(){var a=this.L&128?this.P&255:this.ma;this.C&=-2;Xl(this);return a};l.bl=function(){return this.L&128?this.P>>8:this.Y};l.cl=function(){return this.H};l.dl=function(){return this.L};l.fl=function(){return this.da};l.el=function(){return this.C};l.kl=function(){var a=this.B;this.B&=-4;return a};
l.Im=function(a,b){if(this.L&128)this.P=this.P&-256|b;else{this.pa=b;this.C&=-97;a=!1;this.ga&&this.ga.call(this.D,b)&&(a=!0);if(this.G){if(13==b)this.R=0;else if(8==b)this.G.value=this.G.value.slice(0,-1),0<this.R&&this.R--;else{a=(a=ma[b])?"<"+a+">":String.fromCharCode(b);var c=a.length;32>b&&1==c&&(c=0);9==b&&(b=this.ra||8,c=b-this.R%b,this.ra&&(a=" ".slice(0,c)));this.qa&&!this.R&&c&&(a=String.fromCharCode(this.qa)+a);this.G.value+=a;this.G.scrollTop=this.G.scrollHeight;
this.R+=c}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.rc(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.C|=96)}};l.vm=function(a,b){this.L&128?this.P=this.P&255|b<<8:this.Y=b};l.wm=function(a,b){this.L=b};l.xm=function(a,b){a=b^this.da;this.da=b;a&3&&this.Rc&&(a=0,a=this.Z?a|(b&2?32:0)|(b&1?320:0):a|(b&2?16:0)|(b&1?1048576:0),this.Rc.call(this.D,a))};
l.Im=function(a,b){if(this.L&128)this.P=this.P&-256|b;else{this.pa=b;this.C&=-97;a=!1;this.ga&&this.ga.call(this.D,b)&&(a=!0);if(this.G){if(13==b)this.R=0;else if(8==b)this.G.value=this.G.value.slice(0,-1),0<this.R&&this.R--;else{a=(a=13!=b&&10!=b?ma[b]:null)?"<"+a+">":String.fromCharCode(b);var c=a.length;32>b&&1==c&&(c=0);9==b&&(b=this.ra||8,c=b-this.R%b,this.ra&&(a=" ".slice(0,c)));this.qa&&!this.R&&c&&(a=String.fromCharCode(this.qa)+a);this.G.value+=a;this.G.scrollTop=
this.G.scrollHeight;this.R+=c}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.rc(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.C|=96)}};l.vm=function(a,b){this.L&128?this.P=this.P&255|b<<8:this.Y=b};l.wm=function(a,b){this.L=b};l.xm=function(a,b){a=b^this.da;this.da=b;a&3&&this.Rc&&(a=0,a=this.Z?a|(b&2?32:0)|(b&1?320:0):a|(b&2?16:0)|(b&1?1048576:0),this.Rc.call(this.D,a))};
function Yl(a){var b=-1;a.C&1&&a.Y&1?b=4:a.B&3&&a.Y&8&&(b=0);0<=b?(a.H&=-8,a.H|=b,a.S&&a.W&&Ue(a.S,a.W,100)):(a.H|=1,a.S&&a.W&&Te(a.S,a.W))}var Ul={0:Ql.prototype.pl,1:Ql.prototype.bl,2:Ql.prototype.cl,3:Ql.prototype.dl,4:Ql.prototype.fl,5:Ql.prototype.el,6:Ql.prototype.kl},Vl={0:Ql.prototype.Im,1:Ql.prototype.vm,3:Ql.prototype.wm,4:Ql.prototype.xm};Ga(function(){for(var a=bb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=Za(c),d=new Ql(d);ab(d,c)}});
function Zl(a){Ka.call(this,"Mouse",a,Zl);if(this.Y=a.serial)this.Z="SerialPort";this.W=this.P=this.cc=!1;this.D=[];this.C=[];t(this)}Ta(Zl);var pl=0;l=Zl.prototype;l.pc=function(a,b,c,d){this.ba=a;this.ia=b;this.A=c;this.Ia=d;for(b=null;b=mb(a,"Video",b);)this.D.push(b)};
l.Ub=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.Z&&!this.G){for(a=null;(a=mb(this.ba,this.Z,a))&&(!a.fi||!(this.G=a.fi(this.Y,this,this.Zj))););if(this.G)for(this.C=[],a=0;a<this.D.length;a++)b=this.D[a],b.P=this,(b=b.G)&&this.C.push(b);else r(this.id+": "+this.Z+" "+this.Y+" unavailable")}this.cc?$l(this):am(this)}return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){bm(this)};
@ -687,4 +687,4 @@ a):f("transformToFragment failed")):f("unable to transform XML: unsupported brow
function Mn(a,b,c,d){if(!c&&b){d.push(b);a=Ua[d[0]];b=null;for(var e in a)if(ia(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?sa(b,null,!0,function(a,b){Nn(b,d)}):Nn(null,d)}else r("Error ("+c+") requesting "+a)}
function Nn(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=Ua[f],k={},m;for(m in h){var q=h[m],y=ha(m);if("xml"==y){for(y=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=y.exec(h[m]);){var w=d[2];w&&(h[w]||(q=q.replace(d[0],"")))}d=m=ga(m)}else"xsl"==y&&(e=m=ga(m));k[m]=q}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Aa(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",r(a)):r("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=Ya("Computer",a),e=Ya("Debugger",a);if(d){var f=Cn(d,!0),g=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcjs/1.30.6/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Gj:g}))return!0;sa(b,null,!0,function(c,d,e){Mn(c,d,e,[a,ga(b,!0),g,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();
window.savePC=function(a,b,c){var d=Ya("Computer",a),e=Ya("Debugger",a);if(d){var f=Cn(d,!0),g=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcx86/1.30.6/pcx86"+(e?"-dbg":"")+".js");if(c&&c({state:f,Gj:g}))return!0;sa(b,null,!0,function(c,d,e){Mn(c,d,e,[a,ga(b,!0),g,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();

View file

@ -195,21 +195,6 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg)
if (control) this.cmp.setBinding(null, CPUPDP11.BUTTONS[i], control);
}
/*
* We've already saved the parmsCPU 'autoStart' setting, but there may be a machine (or URL) override.
*/
var sAutoStart = cmp.getMachineParm('autoStart');
if (sAutoStart != null) {
this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart));
}
/*
* Start running automatically on power-up, assuming there's no Debugger and no "Run" button.
*/
if ((!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
this.flags.autoStart = true;
}
this.setReady();
};
@ -272,6 +257,21 @@ CPUPDP11.prototype.restore = function(data)
*/
CPUPDP11.prototype.powerUp = function(data, fRepower)
{
/*
* We've already saved the parmsCPU 'autoStart' setting, but there may be a machine (or URL) override.
*/
var sAutoStart = this.cmp.getMachineParm('autoStart');
if (sAutoStart != null) {
this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart));
}
else if (this.flags.autoStart == null) {
/*
* If there's no explicit parmsCPU setting either, then we will autoStart if there's no Debugger and
* no "Run" button.
*/
this.flags.autoStart = ((!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined);
}
if (!fRepower) {
this.finish();
if (!data || !this.restore) {
@ -298,6 +298,11 @@ CPUPDP11.prototype.powerUp = function(data, fRepower)
*/
this.println("No debugger detected");
}
if (this.flags.autoStart) {
this.println("CPU will auto-start");
} else {
this.println("CPU will not be auto-started, click Run to start");
}
}
/*
* The Computer component (which is responsible for all powerDown and powerUp notifications)
@ -1184,6 +1189,7 @@ CPUPDP11.prototype.startCPU = function(fUpdateFocus)
if (fUpdateFocus) this.cmp.setFocus(true);
this.cmp.start(this.msStartRun, this.getCycles());
}
if (!this.dbg) this.status("Started");
setTimeout(this.onRunTimeout, 0);
return true;
};

View file

@ -301,7 +301,7 @@ Component.getMachineResources = function(idMachine)
*/
Component.log = function(s, type)
{
if (DEBUG) {
if (!COMPILED) {
if (s) {
var sElapsed = "", sMsg = (type? (type + ": ") : "") + s;
if (typeof usr != "undefined") {
@ -352,7 +352,7 @@ Component.assert = function(f, s)
*/
Component.println = function(s, type, id)
{
if (DEBUG) {
if (!COMPILED) {
Component.log((id? (id + ": ") : "") + (s? ("\"" + s + "\"") : ""), type);
}
};
@ -368,7 +368,7 @@ Component.println = function(s, type, id)
*/
Component.notice = function(s, fPrintOnly, id)
{
if (DEBUG) {
if (!COMPILED) {
Component.println(s, "notice", id);
}
if (!fPrintOnly) web.alertUser((id? (id + ": ") : "") + s);
@ -381,7 +381,7 @@ Component.notice = function(s, fPrintOnly, id)
*/
Component.warning = function(s)
{
if (DEBUG) {
if (!COMPILED) {
Component.println(s, "warning");
}
web.alertUser(s);
@ -394,7 +394,7 @@ Component.warning = function(s)
*/
Component.error = function(s)
{
if (DEBUG) {
if (!COMPILED) {
Component.println(s, "error");
}
web.alertUser(s);
@ -716,7 +716,7 @@ Component.prototype = {
}
control.value += s + "\n";
control.scrollTop = control.scrollHeight;
if (DEBUG && window && window.console) console.log(s);
if (!COMPILED && window && window.console) console.log(s);
};
}(control));
/**
@ -750,7 +750,7 @@ Component.prototype = {
* @param {string} [type] is the message type
*/
log: function(s, type) {
if (DEBUG) {
if (!COMPILED) {
Component.log(s, type || this.id || this.type);
}
},

View file

@ -30,11 +30,15 @@
var Keys = {
/*
* Alphanumeric and other common (printable) ASCII codes.
* Keys and/or key combinations that generate common ASCII codes.
*
* TODO: Determine what we can do to get ALL constants like these inlined (enum doesn't seem to
* get the job done); the problem seems to be limited to property references that use quotes, which
* is why I've 'unquoted' as many of them as possible.
* NOTE: If you're looking for a general-purpose ASCII code table, see str.ASCII in strlib.js;
* if something's missing, that's probably the more appropriate table to add it to.
*
* TODO: The Closure Compiler doesn't inline all references to these values, at least those with
* quoted property names, which is why I've 'unquoted' as many of them as possible. One solution
* would be to add mnemonics for all of them, not just the non-printable ones (eg, SPACE instead
* of ' ', AMP instead of '&', etc.)
*/
ASCII: {
BREAK: 0, CTRL_A: 1, CTRL_B: 2, CTRL_C: 3, CTRL_D: 4, CTRL_E: 5, CTRL_F: 6, CTRL_G: 7,

View file

@ -553,12 +553,16 @@ str.trim = function(s)
};
/*
* Any codes commented out in the following table are deemed "printable"
* Future home of a general-purpose ASCII table. TODO: Flesh it out.
*/
str.ASCII = {
LF: 0x0A,
CR: 0x0D
};
/*
* Table for converting "unprintable" ASCII codes into mnemonics, to more clearly see what's being printed.
*/
str.aASCIICodes = {
0x00: "NUL",
0x01: "SOH", // (CTRL_A) Start of Heading
@ -570,10 +574,10 @@ str.aASCIICodes = {
0x07: "BEL", // (CTRL_G) Bell
0x08: "BS", // (CTRL_H) Backspace
0x09: "TAB", // (CTRL_I) Horizontal Tab
// 0x0A: "LF", // (CTRL_J) Line Feed (New Line)
0x0A: "LF", // (CTRL_J) Line Feed (New Line)
0x0B: "VT", // (CTRL_K) Vertical Tab
0x0C: "FF", // (CTRL_L) Form Feed (New Page)
// 0x0D: "CR", // (CTRL_M) Carriage Return
0x0D: "CR", // (CTRL_M) Carriage Return
0x0E: "SO", // (CTRL_N) Shift Out
0x0F: "SI", // (CTRL_O) Shift In
0x10: "DLE", // (CTRL_P) Data Link Escape
@ -602,7 +606,7 @@ str.aASCIICodes = {
*/
str.toASCIICode = function(b)
{
var s = str.aASCIICodes[b];
var s = (b != str.ASCII.CR && b != str.ASCII.LF? str.aASCIICodes[b] : null);
if (s) {
s = '<' + s + '>';
} else {

View file

@ -14,7 +14,7 @@ machines:
Selected Live Demos from [Graphics for the IBM PC](../)
---
All of the machine demos below are halted by default. Click the machine's "Run" button to start it running.
All of the machine demos below are halted by default. Click the machine's **Run** button to start it running.
From [Page 46](/modules/shared/templates/pdf.html?url=/pubs/pc/programming/Graphics_for_the_IBM_PC/pages/Graphics_for_the_IBM_PC 48.pdf&page=48&total=320):

View file

@ -126,6 +126,6 @@ VGA "Black Book" Test Machine
The [Compaq DeskPro 386](/devices/pcx86/machine/compaq/deskpro386/vga/2048kb/) machine below loads the
"VGA Tests (Black Book)" disk from the PCjs [Library](/disks/pcx86/library.xml) disk collection into Drive B.
Click the "Run" button to start the machine.
Click the **Run** button to start the machine.
{% include machine.html id="deskpro386" %}

View file

@ -34,7 +34,7 @@ Hd:88,Id:89,Pb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jd:97,Bf:98,Cf:99,d:1
function aa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ba(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function t(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){return t(a,2,!0)}
function v(a){return t(a,4,!0)}function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function fa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ga(){var a=ia();return-1!==a.indexOf("pcjs.org",a.length-8)}var ka={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function la(a){return a.replace(/[&<>"']/g,function(a){return ka[a]})}
function ma(a,b){return(a+" ").slice(0,b)}function na(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var oa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function ma(a,b){return(a+" ").slice(0,b)}function na(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var oa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function pa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var qa=Date.now||function(){return+new Date};function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function sa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c<d;c++)if(c in a&&a[c]===b)return c;return-1}
function ta(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"==
@ -183,8 +183,8 @@ l.Ec=function(a){if(!this.j){var b=oc(this.A,"connection");if(b){var c=b.split("
l.Ga=function(a,b){if(!b)if(this.Ec(this.L),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Ka=function(a){return a?this.save():!0};l.reset=function(){ze(this)};l.save=function(){var a=new Vc(this),b=0,c=[];c[b++]=this.N;c[b++]=this.X;c[b++]=this.ba;c[b++]=this.wa;c[b++]=this.J;c[b++]=this.K;c[b]=this.O;a.set(0,c);return a.data()};l.restore=function(a){return ze(this,a[0])};
function ze(a,b){var c=0;b||(b=ve);a.N=b[c++];a.X=b[c++];a.ba=b[c++];a.wa=b[c++];a.J=b[c++];a.K=b[c++];a.O=b[c];return!0}function Ae(a,b){var c=a.O&b;b&15||(c>>=4);b=ue[c];c=((a.J&12)>>2)+6;a.J&16&&c++;c+=((a.J&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function we(a,b){ib(a,"receiveByte("+ca(b)+"), status="+ca(a.wa));return a.aa||a.wa&2?!1:(a.X=b,a.wa|=2,Jd(a.b,a.ka),!0)}
l.Wb=function(a){null!=a&&(this.I="number"!=typeof a?a:this.I+String.fromCharCode(a));this.I&&(we(this,this.I.charCodeAt(0))&&(this.I=this.I.substr(1)),this.I&&this.b&&Lc(this.b,this.la,Ae(this,15)));return!0};l.oe=function(a){this.wa&=-129;a&64&&(this.wa|=128)};function ie(a,b){a.wa|=5;b&&a.fb&&a.fb.call(a.j,b)}l.Td=function(a,b){var c=this.X;E(this,a,null,b,"DATA",c);this.wa&=-3;return c};l.Sd=function(a,b){var c=this.wa;E(this,a,null,b,"STATUS",c);return c};
l.de=function(a,b,c){E(this,a,b,c,"DATA");this.ba=b;this.wa&=-6;ib(this,"transmitByte("+ca(b)+")");if(19==b)this.aa=!0;else if(17==b)this.aa=!1;else if(this.fb&&this.fb.call(this.j,b),this.u)8==b?(this.u.value=this.u.value.slice(0,-1),0<this.D&&this.D--):(a=(a=oa[b])?"<"+a+">":String.fromCharCode(b),c=a.length,9==b?(b=this.ia||8,c=b-this.D%b,this.ia&&(a=ma("",c))):13==b&&(this.D=c=0,a="\n"),this.da&&!this.D&&c&&(a=String.fromCharCode(this.da)+a),this.u.value+=a,this.u.scrollTop=this.u.scrollHeight,
this.D+=c);else if(null!=this.B){if(10==b||1024<=this.B.length)this.g(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b))}this.b&&Lc(this.b,this.ma,Ae(this,240))};l.ce=function(a,b,c){E(this,a,b,c,"CONTROL");this.N?(this.Aa&&(b^this.K)&34&&(a=0,a=this.L?a|(b&32?32:0)|(b&2?320:0):a|(b&32?16:0)|(b&2?1048576:0),this.Aa.call(this.j,a)),this.K=b,this.K&64&&(this.N=!1)):(this.J=b,this.N=!0)};l.be=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.O=b};
l.de=function(a,b,c){E(this,a,b,c,"DATA");this.ba=b;this.wa&=-6;ib(this,"transmitByte("+ca(b)+")");if(19==b)this.aa=!0;else if(17==b)this.aa=!1;else if(this.fb&&this.fb.call(this.j,b),this.u)8==b?(this.u.value=this.u.value.slice(0,-1),0<this.D&&this.D--):(a=(a=13!=b&&10!=b?oa[b]:null)?"<"+a+">":String.fromCharCode(b),c=a.length,9==b?(b=this.ia||8,c=b-this.D%b,this.ia&&(a=ma("",c))):13==b&&(this.D=c=0,a="\n"),this.da&&!this.D&&c&&(a=String.fromCharCode(this.da)+a),this.u.value+=a,this.u.scrollTop=
this.u.scrollHeight,this.D+=c);else if(null!=this.B){if(10==b||1024<=this.B.length)this.g(this.B),this.B="";10!=b&&(this.B+=String.fromCharCode(b))}this.b&&Lc(this.b,this.ma,Ae(this,240))};l.ce=function(a,b,c){E(this,a,b,c,"CONTROL");this.N?(this.Aa&&(b^this.K)&34&&(a=0,a=this.L?a|(b&32?32:0)|(b&2?320:0):a|(b&32?16:0)|(b&2?1048576:0),this.Aa.call(this.j,a)),this.K=b,this.K&64&&(this.N=!1)):(this.J=b,this.N=!0)};l.be=function(a,b,c){E(this,a,b,c,"BAUDRATES");this.O=b};
var xe={0:se.prototype.Td,1:se.prototype.Sd},ye={0:se.prototype.de,1:se.prototype.ce,2:se.prototype.be};Oa(function(){for(var a=D(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new se(d);gb(d,c)}});function Be(a){x.call(this,"Debugger",a,Be);this.Wa=a.base||16;this.aa=this.ma=this.J=0;this.O=!1;this.j=-1;this.u=[];this.da={}}A(Be);var Ce={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
Be.prototype.Sb=function(){return-1};Be.prototype.Tb=function(){};Be.prototype.Jb=function(a,b,c){if(b)if(a){0>this.j&&this.u.length&&(this.j=0);if(0>this.j||a!=this.u[this.j])this.u.splice(0,0,a),this.j=0;this.j--}else this.O?a="end":a=this.u[this.j+1];b=[];if(a){a=a.replace(/""/g,"'");var d=0,e=null;c=c||";";for(var f=0;f<=a.length;f++){var g=a.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==c&&!e||!g)b.push(na(a.substring(d,f))),d=f+1}}return b};
function De(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<<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;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?1:0;break;case "&":d=f&e;break;

View file

@ -34,7 +34,8 @@ Mc:88,Nc:89,kb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Pc:97,Ee:98,Fe:99,d:1
function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ca(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function da(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
function ea(){var a=fa();return-1!==a.indexOf("pcjs.org",a.length-8)}var ga={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function ha(a){return a.replace(/[&<>"']/g,function(a){return ga[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ka=Date.now||function(){return+new Date};function la(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},ka=Date.now||function(){return+new Date};
function la(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function ma(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 k="",n;for(n in b)b.hasOwnProperty(n)&&(k&&(k+="&"),k+=n+"="+encodeURIComponent(b[n]));k=k.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}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 na(a,b){var c,d={aa:null,wa:null,Ea:null,xa: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.Ea=g.load;d.xa=g.exec;if(e=g.bytes)d.aa=e;else if(e=g.words)for(d.aa=Array(2*e.length),f=c=0;c<e.length;c++)d.aa[f++]=e[c]&255,d.aa[f++]=e[c]>>8&255;else if(e=g.data)for(d.aa=Array(4*e.length),f=c=0;c<e.length;c++)d.aa[f++]=
@ -168,8 +169,8 @@ l.Ib=function(a){if(!this.b){var b=Ab(this.w,"connection");if(b){var c=b.split("
l.fa=function(a,b){if(!b)if(this.Ib(this.o),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.ha=function(a){return a?this.save():!0};l.reset=function(){Wc(this)};l.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.s;c[b++]=this.A;c[b++]=this.F;c[b++]=this.X;c[b++]=this.l;c[b++]=this.m;c[b]=this.u;a.set(0,c);return a.data()};l.restore=function(a){return Wc(this,a[0])};
function Wc(a,b){var c=0;b||(b=Sc);a.s=b[c++];a.A=b[c++];a.F=b[c++];a.X=b[c++];a.l=b[c++];a.m=b[c++];a.u=b[c];return!0}function Xc(a,b){var c=a.u&b;b&15||(c>>=4);b=Rc[c];c=((a.l&12)>>2)+6;a.l&16&&c++;c+=((a.l&192)>>6)+1>>1;return 1E3/Math.round(b/c)}function Tc(a,b){return a.B||a.X&2?!1:(a.A=b,a.X|=2,hc(a.a,a.P),!0)}
l.nb=function(a){null!=a&&(this.h="number"!=typeof a?a:this.h+String.fromCharCode(a));this.h&&(Tc(this,this.h.charCodeAt(0))&&(this.h=this.h.substr(1)),this.h&&this.a&&Kb(this.a,this.R,Xc(this,15)));return!0};l.rd=function(a){this.X&=-129;a&64&&(this.X|=128)};function Fc(a,b){a.X|=5;b&&a.Fa&&a.Fa.call(a.b,b)}l.Wc=function(){var a=this.A;this.X&=-3;return a};l.Vc=function(){return this.X};
l.ed=function(a,b){this.F=b;this.X&=-6;if(19==b)this.B=!0;else if(17==b)this.B=!1;else if(this.Fa&&this.Fa.call(this.b,b),this.c)if(8==b)this.c.value=this.c.value.slice(0,-1),0<this.g&&this.g--;else{a=(a=ja[b])?"<"+a+">":String.fromCharCode(b);var c=a.length;9==b?(b=this.M||8,c=b-this.g%b,this.M&&(a=" ".slice(0,c))):13==b&&(this.g=c=0,a="\n");this.G&&!this.g&&c&&(a=String.fromCharCode(this.G)+a);this.c.value+=a;this.c.scrollTop=this.c.scrollHeight;this.g+=c}else if(null!=
this.f){if(10==b||1024<=this.f.length)this.ea(this.f),this.f="";10!=b&&(this.f+=String.fromCharCode(b))}this.a&&Kb(this.a,this.T,Xc(this,240))};l.dd=function(a,b){this.s?(this.ia&&(b^this.m)&34&&(a=0,a=this.o?a|(b&32?32:0)|(b&2?320:0):a|(b&32?16:0)|(b&2?1048576:0),this.ia.call(this.b,a)),this.m=b,this.m&64&&(this.s=!1)):(this.l=b,this.s=!0)};l.cd=function(a,b){this.u=b};var Uc={0:Pc.prototype.Wc,1:Pc.prototype.Vc},Vc={0:Pc.prototype.ed,1:Pc.prototype.dd,2:Pc.prototype.cd};
l.ed=function(a,b){this.F=b;this.X&=-6;if(19==b)this.B=!0;else if(17==b)this.B=!1;else if(this.Fa&&this.Fa.call(this.b,b),this.c)if(8==b)this.c.value=this.c.value.slice(0,-1),0<this.g&&this.g--;else{a=(a=13!=b&&10!=b?ja[b]:null)?"<"+a+">":String.fromCharCode(b);var c=a.length;9==b?(b=this.M||8,c=b-this.g%b,this.M&&(a=" ".slice(0,c))):13==b&&(this.g=c=0,a="\n");this.G&&!this.g&&c&&(a=String.fromCharCode(this.G)+a);this.c.value+=a;this.c.scrollTop=this.c.scrollHeight;
this.g+=c}else if(null!=this.f){if(10==b||1024<=this.f.length)this.ea(this.f),this.f="";10!=b&&(this.f+=String.fromCharCode(b))}this.a&&Kb(this.a,this.T,Xc(this,240))};l.dd=function(a,b){this.s?(this.ia&&(b^this.m)&34&&(a=0,a=this.o?a|(b&32?32:0)|(b&2?320:0):a|(b&32?16:0)|(b&2?1048576:0),this.ia.call(this.b,a)),this.m=b,this.m&64&&(this.s=!1)):(this.l=b,this.s=!0)};l.cd=function(a,b){this.u=b};var Uc={0:Pc.prototype.Wc,1:Pc.prototype.Vc},Vc={0:Pc.prototype.ed,1:Pc.prototype.dd,2:Pc.prototype.cd};
Aa(function(){for(var a=A(document,"pc8080","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Pc(d);Qa(d,c)}});
function Yc(a,b,c){r.call(this,"Computer",a,Yc);this.j.Y=!1;Zc(this,b);this.u=Ab(this,"autoPower",a);this.f=0;this.L=a.busWidth||a.buswidth;this.b=$c;this.o=null;this.w=this.F=!1;this.H=Ab(this,"url")||"";(Math.random()+.1).toString(36);this.c=ad(this);if(this.a=Pa("CPU",this.id)){this.N=Pa("Debugger",this.id);this.l=[];for(b=null;b=C(this,"Video",b);)this.l.push(b);this.i=new Ya({id:this.za+".bus",busWidth:this.L},this.a,this.N);var d,e=Na(this.id);if((this.g=Pa("Panel",this.id))&&this.g.ya)for(b=
0;b<e.length;b++)d=e[b],d.K=this.g.K,d.ea=this.g.ea,d.ya=this.g.ya;this.ea("PC8080 v1.30.6\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.ra&&d.ra(this,this.i,this.a,this.N);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=Ab(this,"state")||(f=!0,a.state))b=this.A=a,f||(this.w=!0,this.b=$c),this.b&&(this.s=new G(this,"1.30.6"),bd(this.s)?b=null:delete this.s);

View file

@ -51,7 +51,7 @@ function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b){var c,d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function ha(a,b,c){var d="";if(!b||4<b)b=4;for(var e=0;e<b;e++)d&&(d=","+d),d=fa(a&255,8)+d,a>>=8;return(c?"0b":"")+d}
function ia(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function r(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function u(a){return r(a,2,!0)}function v(a){return r(a,4,!0)}
function ja(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ma(a,b){return-1!==a.indexOf(b,a.length-b.length)}var na={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function oa(a){return a.replace(/[&<>"']/g,function(a){return na[a]})}
function pa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function pa(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function qa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
function sa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var ta=Date.now||function(){return+new Date};function ua(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var va=[31,28,31,30,31,30,31,31,30,31,30,31];
function wa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.vh|g<<f.shift&f.vh}return c}function xa(a,b){return(b&a.vh)>>a.shift}function ya(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c<d;c++)if(c in a&&a[c]===b)return c;return-1}
function Aa(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"==
@ -605,8 +605,8 @@ l.hc=function(a,b){if(!b)if(this.zj(this.pa),!a||!this.restore)this.reset();else
function Eo(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.Ja,[]]);a.ya=b[c++];a.Da=b[c++];a.fa=b[c++];a.ka=b[c++];a.U=b[c++];a.C=b[c++];a.ra=b[c++];a.B=b[c++];a.A=b[c++];a.aa=b[c];return!0}l.hg=function(a){if("number"==typeof a)this.aa.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.aa.push(a.charCodeAt(b));else this.aa=this.aa.concat(a);Fo(this);return!0};l.ll=function(a){var b=this.A;this.A&=~(zo|Ao);a&32&&(this.A=this.A|zo|1);a&64&&(this.A=this.A|Ao|2);b!=this.A&&Go(this)};
function Fo(a){0<a.aa.length&&!(a.B&1)&&(a.ya=a.aa.shift(),a.B|=1);Go(a)}l.Em=function(a,b){var c=this.C&128?this.fa&255:this.ya;x(this,a,null,b,this.C&128?"DLL":"RBR",c);this.B&=-2;Fo(this);return c};l.qm=function(a,b){var c=this.C&128?this.fa>>8:this.ka;x(this,a,null,b,this.C&128?"DLM":"IER",c);return c};l.rm=function(a,b){var c=this.U;x(this,a,null,b,"IIR",c);return c};l.sm=function(a,b){var c=this.C;x(this,a,null,b,"LCR",c);return c};l.um=function(a,b){var c=this.ra;x(this,a,null,b,"MCR",c);return c};
l.tm=function(a,b){var c=this.B;x(this,a,null,b,"LSR",c);return c};l.zm=function(a,b){var c=this.A;this.A&=-4;x(this,a,null,b,"MSR",c);return c};
l.ho=function(a,b,c){x(this,a,b,c,this.C&128?"DLL":"THR");if(this.C&128)this.fa=this.fa&-256|b;else{this.Da=b;this.B&=-97;a=!1;y(this,"transmitByte("+u(b)+")");this.ua&&this.ua.call(this.L,b)&&(a=!0);if(this.V)13==b?this.ea=0:8==b?(this.V.value=this.V.value.slice(0,-1),0<this.ea&&this.ea--):(a=(a=ra[b])?"<"+a+">":String.fromCharCode(b),c=a.length,32>b&&1==c&&(c=0),9==b&&(b=this.Ga||8,c=b-this.ea%b,this.Ga&&(a=pa("",c))),this.Ea&&!this.ea&&c&&(a=String.fromCharCode(this.Ea)+a),this.V.value+=a,this.V.scrollTop=
this.V.scrollHeight,this.ea+=c),a=!0;else if(null!=this.W){if(10==b||1024<=this.W.length)this.O(this.W),this.W="";10!=b&&(this.W+=String.fromCharCode(b));a=!0}a&&(this.B|=96)}};l.Tn=function(a,b,c){x(this,a,b,c,this.C&128?"DLM":"IER");this.C&128?this.fa=this.fa&255|b<<8:this.ka=b};l.Un=function(a,b,c){x(this,a,b,c,"LCR");this.C=b};
l.ho=function(a,b,c){x(this,a,b,c,this.C&128?"DLL":"THR");if(this.C&128)this.fa=this.fa&-256|b;else{this.Da=b;this.B&=-97;a=!1;y(this,"transmitByte("+u(b)+")");this.ua&&this.ua.call(this.L,b)&&(a=!0);if(this.V)13==b?this.ea=0:8==b?(this.V.value=this.V.value.slice(0,-1),0<this.ea&&this.ea--):(a=(a=13!=b&&10!=b?ra[b]:null)?"<"+a+">":String.fromCharCode(b),c=a.length,32>b&&1==c&&(c=0),9==b&&(b=this.Ga||8,c=b-this.ea%b,this.Ga&&(a=pa("",c))),this.Ea&&!this.ea&&c&&(a=String.fromCharCode(this.Ea)+a),this.V.value+=
a,this.V.scrollTop=this.V.scrollHeight,this.ea+=c),a=!0;else if(null!=this.W){if(10==b||1024<=this.W.length)this.O(this.W),this.W="";10!=b&&(this.W+=String.fromCharCode(b));a=!0}a&&(this.B|=96)}};l.Tn=function(a,b,c){x(this,a,b,c,this.C&128?"DLM":"IER");this.C&128?this.fa=this.fa&255|b<<8:this.ka=b};l.Un=function(a,b,c){x(this,a,b,c,"LCR");this.C=b};
l.Vn=function(a,b,c){var d=b^this.ra;x(this,a,b,c,"MCR");this.ra=b;d&3&&this.Cc&&(a=0,a=this.pa?a|(b&2?32:0)|(b&1?320:0):a|(b&2?16:0)|(b&1?1048576:0),this.Cc.call(this.L,a))};function Go(a){var b=-1;a.B&1&&a.ka&1?b=4:a.A&3&&a.ka&8&&(b=0);0<=b?(a.U&=-8,a.U|=b,a.N&&a.ia&&mg(a.N,a.ia,100)):(a.U|=1,a.N&&a.ia&&lg(a.N,a.ia))}
var Co={0:yo.prototype.Em,1:yo.prototype.qm,2:yo.prototype.rm,3:yo.prototype.sm,4:yo.prototype.um,5:yo.prototype.tm,6:yo.prototype.zm},Do={0:yo.prototype.ho,1:yo.prototype.Tn,3:yo.prototype.Un,4:yo.prototype.Vn};Xa(function(){for(var a=tb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=qb(c),d=new yo(d);sb(d,c)}});function Ho(a){bb.call(this,"Mouse",a,Ho,16777216);if(this.ka=a.serial)this.pa="SerialPort";this.ia=this.fa=this.Ic=!1;this.C=[];this.B=[];xb(this)}jb(Ho);var wn=0;l=Ho.prototype;
l.Jc=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;for(b=null;b=Jb(a,"Video",b);)this.C.push(b)};l.hc=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.pa&&!this.N){for(a=null;(a=Jb(this.X,this.pa,a))&&(!a.bj||!(this.N=a.bj(this.ka,this,this.kl))););if(this.N)for(this.B=[],a=0;a<this.C.length;a++)b=this.C[a],b.V=this,(b=b.X)&&this.B.push(b);else w(this.id+": "+this.pa+" "+this.ka+" unavailable")}this.Ic?Io(this):Jo(this)}return!0};
@ -869,4 +869,4 @@ a):f("transformToFragment failed")):f("unable to transform XML: unsupported brow
function zs(a,b,c,d){if(!c&&b){d.push(b);a=lb[d[0]];b=null;for(var e in a)if(ma(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?Aa(b,null,!0,function(a,b){As(b,d)}):As(null,d)}else w("Error ("+c+") requesting "+a)}
function As(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=lb[f],k={},m;for(m in h){var n=h[m],t=ka(m);if("xml"==t){for(t=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=t.exec(h[m]);){var q=d[2];q&&(h[q]||(n=n.replace(d[0],"")))}d=m=ja(m)}else"xsl"==t&&(e=m=ja(m));k[m]=n}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Na(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",w(a)):w("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Tr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcjs/1.30.6/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){zs(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();
window.savePC=function(a,b,c){var d=pb("Computer",a),e=pb("Debugger",a);if(d){var f=Tr(d,!0),g=d.U?JSON.stringify(d.U):null;b||(b="/versions/pcx86/1.30.6/pcx86"+(e?"-dbg":"")+".js");if(c&&c({state:f,Ok:g}))return!0;Aa(b,null,!0,function(c,d,e){zs(c,d,e,[a,ja(b,!0),g,f])});return!0}w("Unable to identify machine '"+a+"'");return!1};})();

View file

@ -50,8 +50,8 @@ p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];
function ea(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function fa(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ga(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}
function ha(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ia(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ja={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function ka(a){return a.replace(/[&<>"']/g,function(a){return ja[a]})}function la(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
var ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},na=Date.now||function(){return+new Date};function oa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
var pa=[31,28,31,30,31,30,31,31,30,31,30,31];function qa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.sg|g<<f.shift&f.sg}return c}function ra(a,b){return(b&a.sg)>>a.shift}
var ma={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},na=Date.now||function(){return+new Date};
function oa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}var pa=[31,28,31,30,31,30,31,31,30,31,30,31];function qa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.sg|g<<f.shift&f.sg}return c}function ra(a,b){return(b&a.sg)>>a.shift}
function sa(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 k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}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 ta(){return"http://"+(window?window.location.host:"www.pcjs.org")}
function r(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}va=a}return va}function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
@ -565,8 +565,8 @@ l.wi=function(a){if(!this.D){var b=nc(this.ba,"connection");if(b){var c=b.split(
l.Ub=function(a,b){if(!b)if(this.wi(this.Z),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){Wl(this)};l.save=function(){var a=new de(this),b=0,c=[];c[b++]=this.ma;c[b++]=this.pa;c[b++]=this.P;c[b++]=this.Y;c[b++]=this.H;c[b++]=this.L;c[b++]=this.da;c[b++]=this.C;c[b++]=this.B;c[b]=this.K;a.set(0,c);return a.data()};l.restore=function(a){return Wl(this,a[0])};
function Wl(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.sa,[]]);a.ma=b[c++];a.pa=b[c++];a.P=b[c++];a.Y=b[c++];a.H=b[c++];a.L=b[c++];a.da=b[c++];a.C=b[c++];a.B=b[c++];a.K=b[c];return!0}l.jf=function(a){if("number"==typeof a)this.K.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.K.push(a.charCodeAt(b));else this.K=this.K.concat(a);Xl(this);return!0};l.$j=function(a){var b=this.B;this.B&=~(Rl|Sl);a&32&&(this.B=this.B|Rl|1);a&64&&(this.B=this.B|Sl|2);b!=this.B&&Yl(this)};
function Xl(a){0<a.K.length&&!(a.C&1)&&(a.ma=a.K.shift(),a.C|=1);Yl(a)}l.pl=function(){var a=this.L&128?this.P&255:this.ma;this.C&=-2;Xl(this);return a};l.bl=function(){return this.L&128?this.P>>8:this.Y};l.cl=function(){return this.H};l.dl=function(){return this.L};l.fl=function(){return this.da};l.el=function(){return this.C};l.kl=function(){var a=this.B;this.B&=-4;return a};
l.Im=function(a,b){if(this.L&128)this.P=this.P&-256|b;else{this.pa=b;this.C&=-97;a=!1;this.ga&&this.ga.call(this.D,b)&&(a=!0);if(this.G){if(13==b)this.R=0;else if(8==b)this.G.value=this.G.value.slice(0,-1),0<this.R&&this.R--;else{a=(a=ma[b])?"<"+a+">":String.fromCharCode(b);var c=a.length;32>b&&1==c&&(c=0);9==b&&(b=this.ra||8,c=b-this.R%b,this.ra&&(a=" ".slice(0,c)));this.qa&&!this.R&&c&&(a=String.fromCharCode(this.qa)+a);this.G.value+=a;this.G.scrollTop=this.G.scrollHeight;
this.R+=c}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.rc(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.C|=96)}};l.vm=function(a,b){this.L&128?this.P=this.P&255|b<<8:this.Y=b};l.wm=function(a,b){this.L=b};l.xm=function(a,b){a=b^this.da;this.da=b;a&3&&this.Rc&&(a=0,a=this.Z?a|(b&2?32:0)|(b&1?320:0):a|(b&2?16:0)|(b&1?1048576:0),this.Rc.call(this.D,a))};
l.Im=function(a,b){if(this.L&128)this.P=this.P&-256|b;else{this.pa=b;this.C&=-97;a=!1;this.ga&&this.ga.call(this.D,b)&&(a=!0);if(this.G){if(13==b)this.R=0;else if(8==b)this.G.value=this.G.value.slice(0,-1),0<this.R&&this.R--;else{a=(a=13!=b&&10!=b?ma[b]:null)?"<"+a+">":String.fromCharCode(b);var c=a.length;32>b&&1==c&&(c=0);9==b&&(b=this.ra||8,c=b-this.R%b,this.ra&&(a=" ".slice(0,c)));this.qa&&!this.R&&c&&(a=String.fromCharCode(this.qa)+a);this.G.value+=a;this.G.scrollTop=
this.G.scrollHeight;this.R+=c}a=!0}else if(null!=this.I){if(10==b||1024<=this.I.length)this.rc(this.I),this.I="";10!=b&&(this.I+=String.fromCharCode(b));a=!0}a&&(this.C|=96)}};l.vm=function(a,b){this.L&128?this.P=this.P&255|b<<8:this.Y=b};l.wm=function(a,b){this.L=b};l.xm=function(a,b){a=b^this.da;this.da=b;a&3&&this.Rc&&(a=0,a=this.Z?a|(b&2?32:0)|(b&1?320:0):a|(b&2?16:0)|(b&1?1048576:0),this.Rc.call(this.D,a))};
function Yl(a){var b=-1;a.C&1&&a.Y&1?b=4:a.B&3&&a.Y&8&&(b=0);0<=b?(a.H&=-8,a.H|=b,a.S&&a.W&&Ue(a.S,a.W,100)):(a.H|=1,a.S&&a.W&&Te(a.S,a.W))}var Ul={0:Ql.prototype.pl,1:Ql.prototype.bl,2:Ql.prototype.cl,3:Ql.prototype.dl,4:Ql.prototype.fl,5:Ql.prototype.el,6:Ql.prototype.kl},Vl={0:Ql.prototype.Im,1:Ql.prototype.vm,3:Ql.prototype.wm,4:Ql.prototype.xm};Ga(function(){for(var a=bb(document,"pcx86","serial"),b=0;b<a.length;b++){var c=a[b],d=Za(c),d=new Ql(d);ab(d,c)}});
function Zl(a){Ka.call(this,"Mouse",a,Zl);if(this.Y=a.serial)this.Z="SerialPort";this.W=this.P=this.cc=!1;this.D=[];this.C=[];t(this)}Ta(Zl);var pl=0;l=Zl.prototype;l.pc=function(a,b,c,d){this.ba=a;this.ia=b;this.A=c;this.Ia=d;for(b=null;b=mb(a,"Video",b);)this.D.push(b)};
l.Ub=function(a,b){if(!b){if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;if(this.Z&&!this.G){for(a=null;(a=mb(this.ba,this.Z,a))&&(!a.fi||!(this.G=a.fi(this.Y,this,this.Zj))););if(this.G)for(this.C=[],a=0;a<this.D.length;a++)b=this.D[a],b.P=this,(b=b.G)&&this.C.push(b);else r(this.id+": "+this.Z+" "+this.Y+" unavailable")}this.cc?$l(this):am(this)}return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){bm(this)};
@ -687,4 +687,4 @@ a):f("transformToFragment failed")):f("unable to transform XML: unsupported brow
function Mn(a,b,c,d){if(!c&&b){d.push(b);a=Ua[d[0]];b=null;for(var e in a)if(ia(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?sa(b,null,!0,function(a,b){Nn(b,d)}):Nn(null,d)}else r("Error ("+c+") requesting "+a)}
function Nn(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=Ua[f],k={},m;for(m in h){var q=h[m],y=ha(m);if("xml"==y){for(y=/[ \t]*<disk [^>]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=y.exec(h[m]);){var w=d[2];w&&(h[w]||(q=q.replace(d[0],"")))}d=m=ga(m)}else"xsl"==y&&(e=m=ga(m));k[m]=q}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g,
"&#xA9;"),a=Aa(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('<div id="'+f+'"></div>\n')+"...\n",a=a+('<script type="text/javascript" src="'+g+'">\x3c/script>\n')+('<script type="text/javascript">embedPC("'+f+'","'+d+'","'+e+'");\x3c/script>\n\n')+"The machine should appear where the <div> is located.",r(a)):r("Missing XML/XSL resources")}
window.savePC=function(a,b,c){var d=Ya("Computer",a),e=Ya("Debugger",a);if(d){var f=Cn(d,!0),g=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcjs/1.30.6/pc"+(e?"-dbg":"")+".js");if(c&&c({state:f,Gj:g}))return!0;sa(b,null,!0,function(c,d,e){Mn(c,d,e,[a,ga(b,!0),g,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();
window.savePC=function(a,b,c){var d=Ya("Computer",a),e=Ya("Debugger",a);if(d){var f=Cn(d,!0),g=d.L?JSON.stringify(d.L):null;b||(b="/versions/pcx86/1.30.6/pcx86"+(e?"-dbg":"")+".js");if(c&&c({state:f,Gj:g}))return!0;sa(b,null,!0,function(c,d,e){Mn(c,d,e,[a,ga(b,!0),g,f])});return!0}r("Unable to identify machine '"+a+"'");return!1};})();

View file

@ -41,7 +41,7 @@ function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function oa(a,b,c){var d="";b?32<b&&(b=32):b=32;for(var e=null==a||isNaN(a),f=c=c||b;0<b--;)f||(d=","+d,f=c),d=(e?"?":a&1?"1":"0")+d,a>>=1,f--;return d}function p(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}
function q(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function v(a){return q(a,4,!0)}function w(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function pa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}
function qa(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ra={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function sa(a){return a.replace(/[&<>"']/g,function(a){return ra[a]})}function ua(a,b){return(a+" ").slice(0,b)}function va(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}
var Ca={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function Da(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ea=Date.now||function(){return+new Date};
var Ca={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function Da(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Ea=Date.now||function(){return+new Date};
function Fa(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function Ga(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
@ -52,39 +52,39 @@ function Oa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}re
function Ra(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}function Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Ta(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ua={init:[],show:[],exit:[]},Wa=!1,bb=!1,cb=!0;function db(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function eb(a){Ua.init.push(a)}
function fb(a){if(cb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){x(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function gb(a){!cb&&a?(cb=!0,Wa&&hb("init"),bb&&hb("show")):cb=a}function hb(a){Ua[a]&&fb(Ua[a])}db("onload",function(){Wa=!0;fb(Ua.init)});db("onpageshow",function(){bb=!0;fb(Ua.show)});db(Qa("Opera")||Qa("iOS")?"onunload":"onbeforeunload",function(){fb(Ua.exit)});
function y(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Dc=b.comment;this.jd=b;b=this.id.indexOf(".");0>b?this.ib=this.id:(this.jb=this.id.substr(0,b),this.ib=this.id.substr(b+1));this[a]=c;this.C={ready:!1,lb:!1,nc:!1,la:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.pa=d||0;B.push(this)}var ib=void 0,jb={};
function y(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Dc=b.comment;this.jd=b;b=this.id.indexOf(".");0>b?this.jb=this.id:(this.kb=this.id.substr(0,b),this.jb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,mb:!1,nc:!1,la:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.pa=d||0;B.push(this)}var ib=void 0,jb={};
if(window){ib||(ib=window.location.search.substr(1));for(var kb,lb=/\+/g,mb=/([^&=]+)=?([^&]*)/g;kb=mb.exec(ib);)jb[decodeURIComponent(kb[1].replace(lb," "))]=decodeURIComponent(kb[2].replace(lb," "))}function nb(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 D(a,b){b||(b=y);a.prototype=nb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ob=window.PCjs.Machines||(window.PCjs.Machines={}),B=window.PCjs.Components||(window.PCjs.Components=[])}else ob={},B=[];function pb(a,b,c){ob[a]&&b&&(ob[a][b]=c)}function qb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<B.length;b++){var d=B[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function rb(a){if(void 0!==a){var b;for(b=0;b<B.length;b++)if(B[b].id===a)return B[b]}return null}function sb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<B.length;d++)if(c)c==B[d]&&(c=null);else if(!(a!=B[d].type||b&&B[d].id.indexOf(b)))return B[d]}return null}function E(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){x(c.message+" ("+a+")")}return b}
function F(a,b){b=G(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=E(f))&&g.binding&&a.ya(g.type,g.binding,f,g.value),l=h.length}}}}
function G(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
y.prototype={constructor:y,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ya:function(a,b,c){switch(b){case "clear":return this.D[b]||(this.D[b]=c,c.onclick=function(a){return function(){a.D.print&&(a.D.print.value="")}}(this)),!0;case "print":return this.D[b]||(this.bb=this.D[b]=c,c.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.M=function(a){this.i(a,this.ib)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.ib+": "+a)},M:function(a,b,c){c=c||this.type;b||x((c?c+": ":"")+a)},La:function(){return this.C.la=!0},Ka:function(a,b){b&&(this.C.la=!1);return!0}};function H(a,b,c,d){a.j&&(!0===c||K(a,c|0))&&a.j.message(b,d)}function K(a,b){if(a.j){a===a.j?b|=0:b=b||a.pa;var c=a.j.pa&b;return!!b&&c===b||!!(c&a.j.pd)}return!1}
function tb(a,b){if(a.C.nc)return a.C.lb=!1,a.C.nc=!1;if(a.C.error)return a.i(a.toString()+" error"),!1;a.C.lb=b;return a.C.lb}function zb(a,b){a.C.lb&&(b?a.C.nc=!0:void 0===b&&a.i(a.toString()+" busy"));return a.C.lb}function L(a,b){a.C.error||(a.C.ready=!1!==b,a.C.ready&&(b=a.cc,a.cc=null,b&&b()))}function Ab(a,b){b&&(a.C.ready?b():a.cc=b);return a.C.ready}function Bb(a){return a.C.error?(a.i(a.toString()+" error"),!0):!1}function Cb(a,b){a.C.error=!0;a.M(b)}
y.prototype={constructor:y,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ya:function(a,b,c){switch(b){case "clear":return this.D[b]||(this.D[b]=c,c.onclick=function(a){return function(){a.D.print&&(a.D.print.value="")}}(this)),!0;case "print":return this.D[b]||(this.cb=this.D[b]=c,c.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.M=function(a){this.i(a,this.jb)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.jb+": "+a)},M:function(a,b,c){c=c||this.type;b||x((c?c+": ":"")+a)},La:function(){return this.C.la=!0},Ka:function(a,b){b&&(this.C.la=!1);return!0}};function H(a,b,c,d){a.j&&(!0===c||K(a,c|0))&&a.j.message(b,d)}function K(a,b){if(a.j){a===a.j?b|=0:b=b||a.pa;var c=a.j.pa&b;return!!b&&c===b||!!(c&a.j.pd)}return!1}
function tb(a,b){if(a.C.nc)return a.C.mb=!1,a.C.nc=!1;if(a.C.error)return a.i(a.toString()+" error"),!1;a.C.mb=b;return a.C.mb}function zb(a,b){a.C.mb&&(b?a.C.nc=!0:void 0===b&&a.i(a.toString()+" busy"));return a.C.mb}function L(a,b){a.C.error||(a.C.ready=!1!==b,a.C.ready&&(b=a.cc,a.cc=null,b&&b()))}function Ab(a,b){b&&(a.C.ready?b():a.cc=b);return a.C.ready}function Bb(a){return a.C.error?(a.i(a.toString()+" error"),!0):!1}function Cb(a,b){a.C.error=!0;a.M(b)}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var Db="undefined"!==typeof ArrayBuffer,Eb="UNKNOWN PANIC ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Fb={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"},Gb={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,pc11:4096,paper:4096,disk:8192,read:16384,write:32768,rk11:65536,rl11:131072,dl11:262144,serial:262144,kw11:524288,timer:524288,speaker:16777216,computer:33554432,log:268435456,warn:536870912,
buffer:1073741824,halt:-2147483648};function Hb(a){y.call(this,"Panel",a,Hb,512);this.Da=this.v=this.gb=this.Bb=this.A=this.F=0;this.I=this.J=this.H=!1;this.K=Ib;this.g={};this.f={START:[1,1,!0,!1,this.Ed],STEP:[1,1,!1,!1,this.Fd],ENABLE:[1,1,!1,!1,this.Ad],CONT:[1,1,!0,!1,this.yd],DEP:[0,0,!0,!1,this.zd],EXAM:[1,1,!0,!1,this.Bd],LOAD:[1,1,!0,!1,this.Dd],TEST:[0,0,!0,!1,this.Cd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}D(Hb);var Ib=7;function Jb(a,b){return a.f[b]&&a.f[b][1]}k=Hb.prototype;
buffer:1073741824,halt:-2147483648};function Hb(a){y.call(this,"Panel",a,Hb,512);this.Da=this.v=this.hb=this.Bb=this.A=this.F=0;this.I=this.J=this.H=!1;this.K=Ib;this.g={};this.f={START:[1,1,!0,!1,this.Ed],STEP:[1,1,!1,!1,this.Fd],ENABLE:[1,1,!1,!1,this.Ad],CONT:[1,1,!0,!1,this.yd],DEP:[0,0,!0,!1,this.zd],EXAM:[1,1,!0,!1,this.Bd],LOAD:[1,1,!0,!1,this.Dd],TEST:[0,0,!0,!1,this.Cd]};for(a=0;22>a;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}D(Hb);var Ib=7;function Jb(a,b){return a.f[b]&&a.f[b][1]}k=Hb.prototype;
k.reset=function(){this.stop()};
k.ya=function(a,b,c,d){if(this.B&&this.B.ya(a,b,c,d)||this.b&&this.b.ya(a,b,c,d)||this.j&&this.j.ya(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
b){return function(){Kb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Lb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Kb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Lb(a,b)}}(this,b),!0):this.parent.ya.call(this,a,b,c,d)}};k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;Mb(b,this,Nb);Ob(b,this.reset.bind(this));Pb(this);Qb(this)};k.La=function(a,b){b||(Rb(),this.reset());return!0};k.Ka=function(){return!0};
function Sb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Pb(a,b){for(var c in a.g)Sb(a,c,null!=b?b:a.g[c])}function Tb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Qb(a){for(var b in a.f)Tb(a,b,a.f[b][1])}function Ub(a,b,c,d){a.D[b]&&(void 0===c&&(Cb(a,"Value for "+b+" is invalid"),a.b.aa()),c=8==(a.j&&a.j.ma||8)?p(c,d):q(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))}
function Kb(a,b){var c=a.f[b];Tb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.J="EXAM"==b)}function Lb(a,b){var c=a.f[b];c[2]&&c[3]&&(Tb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.U||(a=this.b,a.w.reset(),Vb(a),Jb(this,"ENABLE")&&this.b.hb())};k.Fd=function(){};k.Ad=function(a){a||this.b.aa()};
k.yd=function(a){if(!a&&!this.b.C.U)if(Jb(this,"ENABLE"))this.b.hb();else{if((a=this.j)&&!zb(a,!0))tb(a,!0),a.qb(0,null),tb(a,!1);else try{var b=this.b.qb(1);0<b&&(Wb(this.b,b),Xb(this.b,b,!0),Yb(this.b,b))}catch(c){"number"!=typeof c&&Cb(this.b,c.stack||c.message)}this.stop();this.B&&this.B.za()}};k.zd=function(a){if(a&&!this.b.C.U)if(this.I&&Zb(this),a=$b(this,this.gb),this.K==Ib)ac(this.w,this.Da,a);else{var b=this.b,c=this.Da;b.J++;b.wc(oc(b,c,4),a);b.J--}};
k.Bd=function(a){a||this.b.C.U||(this.J&&Zb(this),a=this.K==Ib?pc(this.w,this.Da):qc(this.b,this.Da),$b(this,a))};k.Dd=function(a){a||this.b.C.U||rc(this,this.gb)};k.Cd=function(a){a?(this.H=!0,Pb(this,!0)):(this.H=!1,Pb(this),sc(this,0))};k.Gd=function(a,b){this.gb=a?this.gb|1<<b:this.gb&~(1<<b)};function Zb(a){var b=1145>a.b.mb?8:16,c=65472<=a.Da&&a.Da<65472+b,b=c?1:2,c=c?15:a.w.Mb;Jb(a,"STEP")||(b=-b);rc(a,a.Da&~c|a.Da+b&c)}
function rc(a,b){a.Da=b&a.w.Mb;b=a.Da;for(var c=0;22>c;c++)tc(a,"A"+c,b&1<<c)}function $b(a,b){a.v=b&65535;b=a.v;for(var c=0;16>c;c++)tc(a,"D"+c,b&1<<c);return a.v}function tc(a,b,c){a.g[b]=c;a.H||Sb(a,b,c)}function uc(a){return void 0!==a.D.S0}function sc(a,b){if(uc(a)){a.gb=b;for(var c=0;22>c;c++)a.f["S"+c][1]=b&1<<c?1:0;Qb(a)}}k.stop=function(){rc(this,this.b.u[7])};k.uc=function(a){this.Da=a};k.setData=function(a,b){b?this.Bb=a:this.v=a};k.Hd=function(a,b){return(b?this.Bb:this.gb)&65535};
function Kb(a,b){var c=a.f[b];Tb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.J="EXAM"==b)}function Lb(a,b){var c=a.f[b];c[2]&&c[3]&&(Tb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.U||(a=this.b,a.w.reset(),Vb(a),Jb(this,"ENABLE")&&this.b.ib())};k.Fd=function(){};k.Ad=function(a){a||this.b.aa()};
k.yd=function(a){if(!a&&!this.b.C.U)if(Jb(this,"ENABLE"))this.b.ib();else{if((a=this.j)&&!zb(a,!0))tb(a,!0),a.rb(0,null),tb(a,!1);else try{var b=this.b.rb(1);0<b&&(Wb(this.b,b),Xb(this.b,b,!0),Yb(this.b,b))}catch(c){"number"!=typeof c&&Cb(this.b,c.stack||c.message)}this.stop();this.B&&this.B.za()}};k.zd=function(a){if(a&&!this.b.C.U)if(this.I&&Zb(this),a=$b(this,this.hb),this.K==Ib)ac(this.w,this.Da,a);else{var b=this.b,c=this.Da;b.J++;b.wc(oc(b,c,4),a);b.J--}};
k.Bd=function(a){a||this.b.C.U||(this.J&&Zb(this),a=this.K==Ib?pc(this.w,this.Da):qc(this.b,this.Da),$b(this,a))};k.Dd=function(a){a||this.b.C.U||rc(this,this.hb)};k.Cd=function(a){a?(this.H=!0,Pb(this,!0)):(this.H=!1,Pb(this),sc(this,0))};k.Gd=function(a,b){this.hb=a?this.hb|1<<b:this.hb&~(1<<b)};function Zb(a){var b=1145>a.b.nb?8:16,c=65472<=a.Da&&a.Da<65472+b,b=c?1:2,c=c?15:a.w.Mb;Jb(a,"STEP")||(b=-b);rc(a,a.Da&~c|a.Da+b&c)}
function rc(a,b){a.Da=b&a.w.Mb;b=a.Da;for(var c=0;22>c;c++)tc(a,"A"+c,b&1<<c)}function $b(a,b){a.v=b&65535;b=a.v;for(var c=0;16>c;c++)tc(a,"D"+c,b&1<<c);return a.v}function tc(a,b,c){a.g[b]=c;a.H||Sb(a,b,c)}function uc(a){return void 0!==a.D.S0}function sc(a,b){if(uc(a)){a.hb=b;for(var c=0;22>c;c++)a.f["S"+c][1]=b&1<<c?1:0;Qb(a)}}k.stop=function(){rc(this,this.b.u[7])};k.uc=function(a){this.Da=a};k.setData=function(a,b){b?this.Bb=a:this.v=a};k.Hd=function(a,b){return(b?this.Bb:this.hb)&65535};
k.He=function(a){this.Bb=a};var vc={},Nb=(vc[65400]=[null,null,Hb.prototype.Hd,Hb.prototype.He,"CNSW"],vc);function Rb(){for(var a=!1,b=G(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=E(d),f=rb(e.id);f||(a=!0,f=new Hb(e));F(f,d);a&&L(f)}}eb(Rb);
function wc(a,b,c){y.call(this,"Bus",a,wc,16);this.b=b;this.j=c;this.N=a.busWidth||16;this.A=1<<this.N;this.Mb=this.A-1;this.Ja=xc;this.ra=Math.log2(this.Ja);this.K=this.Ja>>2;this.w=this.Ja-1;this.v=this.A/this.Ja|0;this.kb=[];this.sa=0;this.B=!1;this.F=[];this.kd=[yc,zc,Ac,Bc];a=new M(this);Cc(a,this.j);this.ea=Array(this.v);this.f=Array(this.v);for(b=0;b<this.v;b++)this.ea[b]=this.f[b]=a;a=this.A-xc;Dc(this,a,xc,Ec,this);this.J=this.I=(a&this.Mb)>>>this.ra;this.H=0;this.g=this.Mb;L(this)}D(wc);
var xc=8192,Fc=xc-1;function yc(a,b){var c=-1,d=this.controller,e=d.kb[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.kb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&K(this.j,16|e[5])&&H(this.j,e[4]+".readByte("+N(this.j,b)+"): "+N(this.j,c),!0,!d.sa),c;d.Ra(b,16,3);c=255;this.j&&K(this.j,16)&&H(this.j,"warning: unconverted read access to byte @"+N(this.j,b)+": "+N(this.j,c),!0,!d.sa);return c}
function zc(a,b,c){var d=!1,e=this.controller,f=e.kb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.kb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&K(this.j,16|f[5])&&H(this.j,f[4]+".writeByte("+N(this.j,c)+","+N(this.j,b)+")",!0,!e.sa):(e.Ra(c,16,5),this.j&&K(this.j,16)&&H(this.j,"warning: unconverted write access to byte @"+N(this.j,c)+": "+N(this.j,
b),!0,!e.sa))}function Ac(a,b){var c=-1,d=this.controller;a=d.kb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&K(this.j,16|a[5])&&H(this.j,a[4]+".readWord("+N(this.j,b)+"): "+N(this.j,c),!0,!d.sa),c;d.Ra(b,16,2);c=65535;this.j&&K(this.j,16)&&H(this.j,"warning: unconverted read access to word @"+N(this.j,b)+": "+N(this.j,c),!0,!d.sa);return c}
function Bc(a,b,c){var d=!1,e=this.controller;a=e.kb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&K(this.j,16|a[5])&&H(this.j,a[4]+".writeWord("+N(this.j,c)+","+N(this.j,b)+")",!0,!e.sa):(e.Ra(c,16,4),this.j&&K(this.j,16)&&H(this.j,"warning: unconverted write access to word @"+N(this.j,c)+": "+N(this.j,b),!0,!e.sa))}
function wc(a,b,c){y.call(this,"Bus",a,wc,16);this.b=b;this.j=c;this.N=a.busWidth||16;this.A=1<<this.N;this.Mb=this.A-1;this.Ja=xc;this.ra=Math.log2(this.Ja);this.K=this.Ja>>2;this.w=this.Ja-1;this.v=this.A/this.Ja|0;this.lb=[];this.sa=0;this.B=!1;this.F=[];this.kd=[yc,zc,Ac,Bc];a=new M(this);Cc(a,this.j);this.ea=Array(this.v);this.f=Array(this.v);for(b=0;b<this.v;b++)this.ea[b]=this.f[b]=a;a=this.A-xc;Dc(this,a,xc,Ec,this);this.J=this.I=(a&this.Mb)>>>this.ra;this.H=0;this.g=this.Mb;L(this)}D(wc);
var xc=8192,Fc=xc-1;function yc(a,b){var c=-1,d=this.controller,e=d.lb[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.lb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&K(this.j,16|e[5])&&H(this.j,e[4]+".readByte("+N(this.j,b)+"): "+N(this.j,c),!0,!d.sa),c;d.Ra(b,16,3);c=255;this.j&&K(this.j,16)&&H(this.j,"warning: unconverted read access to byte @"+N(this.j,b)+": "+N(this.j,c),!0,!d.sa);return c}
function zc(a,b,c){var d=!1,e=this.controller,f=e.lb[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.lb[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.j&&K(this.j,16|f[5])&&H(this.j,f[4]+".writeByte("+N(this.j,c)+","+N(this.j,b)+")",!0,!e.sa):(e.Ra(c,16,5),this.j&&K(this.j,16)&&H(this.j,"warning: unconverted write access to byte @"+N(this.j,c)+": "+N(this.j,
b),!0,!e.sa))}function Ac(a,b){var c=-1,d=this.controller;a=d.lb[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.j&&K(this.j,16|a[5])&&H(this.j,a[4]+".readWord("+N(this.j,b)+"): "+N(this.j,c),!0,!d.sa),c;d.Ra(b,16,2);c=65535;this.j&&K(this.j,16)&&H(this.j,"warning: unconverted read access to word @"+N(this.j,b)+": "+N(this.j,c),!0,!d.sa);return c}
function Bc(a,b,c){var d=!1,e=this.controller;a=e.lb[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.j&&K(this.j,16|a[5])&&H(this.j,a[4]+".writeWord("+N(this.j,c)+","+N(this.j,b)+")",!0,!e.sa):(e.Ra(c,16,4),this.j&&K(this.j,16)&&H(this.j,"warning: unconverted write access to word @"+N(this.j,c)+": "+N(this.j,b),!0,!e.sa))}
function Gc(a,b){if(b!=a.H){for(var c=0;c<a.v;c++)a.f[c]=a.ea[c];a.H=0;a.g=a.Mb;b&&(a.H=b,b=1<<b,a.g=b-1,b-=xc,a.J=(b&a.g)>>>a.ra,a.f[a.J]=a.ea[a.I])}}k=wc.prototype;k.reset=function(){for(var a=0;a<this.F.length;a++)this.F[a]();Gc(this,16)};k.La=function(a,b){b||this.reset();return!0};
function Dc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ra;0<g&&h<a.ea.length;){var l=a.ea[h],m=h*a.Ja,n=a.Ja-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.G)return l.Sb+=l.G-f,l.G=f,!0;if(f>=l.G+l.Sb){n=l.size-(f-m);n>g&&(n=g);l.Sb=f-l.G+n;f=m+a.Ja;g-=n;h++;continue}}return Hc(1,f,g)}f=new M(a,f,n,a.Ja,d,e);Cc(f,a.j,l);a.ea[h++]=f;f=m+a.Ja;g-=n}return 0>=g?(a.status((c>>10)+"Kb "+Ic[d]+" at "+p(b)),!0):Hc(2,b,c)}k.dc=function(a){return this.f[(a&this.g)>>>this.ra].ec(a&this.w,a)};
k.xa=function(a){return this.f[(a&this.g)>>>this.ra].Ca(a&this.w,a)};k.Rb=function(a,b){this.f[(a&this.g)>>>this.ra].hc(a&this.w,b,a)};k.Eb=function(a,b){this.f[(a&this.g)>>>this.ra].$b(a&this.w,b,a)};function Jc(a,b){return a.ea[(b&a.Mb)>>>a.ra]}function pc(a,b){a.B=!1;a.sa++;b=Jc(a,b).J(b&a.w,b);a.sa--;return b}function Kc(a,b,c){a.B=!1;a.sa++;Jc(a,b).H(b&a.w,c&255,b);a.sa--}function ac(a,b,c){a.B=!1;a.sa++;Jc(a,b).N(b&a.w,c&65535,b);a.sa--}
function Lc(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.ea[d];if(e.cb||e.td){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Mc(a){for(var b=Nc,c=0,d=0;d<a.ea.length;d++){var e=a.ea[d];e.type==b&&(c=e.G+e.Sb)}return c}
function Oc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&Fc;if(void 0!==a.kb[m])return x("I/O address already registered: "+q(b,8,!0)),!1;a.kb[m]=[d,e,f,g,l||"unknown",h||16,!1]}return!0}
function Mb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.b.mb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=g[4],r=g[5]||1,u=0;u<r;u++,f+=2)if(t&&1<r&&(t=g[4]+u),!Oc(a,f,f,h,l,m,n,g[7]||b.pa,t||b.ib))return!1}}return!0}
function Lc(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.ea[d];if(e.eb||e.td){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Mc(a){for(var b=Nc,c=0,d=0;d<a.ea.length;d++){var e=a.ea[d];e.type==b&&(c=e.G+e.Sb)}return c}
function Oc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&Fc;if(void 0!==a.lb[m])return x("I/O address already registered: "+q(b,8,!0)),!1;a.lb[m]=[d,e,f,g,l||"unknown",h||16,!1]}return!0}
function Mb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.b.nb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=g[4],r=g[5]||1,u=0;u<r;u++,f+=2)if(t&&1<r&&(t=g[4]+u),!Oc(a,f,f,h,l,m,n,g[7]||b.pa,t||b.jb))return!1}}return!0}
function Ob(a,b){a.F.push(b)}k.Ra=function(a,b,c){this.B=!0;this.sa||(this.j&&K(this.j,4)&&H(this.j,"memory fault ("+c+") on "+N(this.j,a),!0,!0),b&&(this.b.oa|=b),this.b.ua(4,0,a))};function Pc(a){var b=a.B;a.B=!1;return b}function Hc(a,b,c){x("Memory block error ("+a+": "+q(b)+","+q(c)+")");return!1}function O(a){y.call(this,"Device",a,O,256);this.f={zg:0,vc:-1}}D(O);k=O.prototype;
k.Ha=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.j=d;var e=this;this.f.vc=Qc(c,function(){e.f.Lb|=128;e.f.Lb&64&&Rc(e.b,e.f.Kb);e.B&&e.B.za(1);Sc(e.b,e.f.vc,1E3/60)});this.f.Kb=Tc(c,64,6,524288);Mb(b,this,cd);Ob(b,this.reset.bind(this));d&&dd(d,64,function(a){var b=e.b;P(e,"KIPDR",b.R[0],0,a[0]);P(e,"KDPDR",b.R[0],8,a[0]);P(e,"KIPAR",b.ga[0],0,a[0]);P(e,"KDPAR",b.ga[0],8,a[0],!0);P(e,"SIPDR",b.R[1],0,a[0]);P(e,"SDPDR",b.R[1],8,a[0]);P(e,"SIPAR",b.ga[1],0,a[0]);P(e,"SDPAR",b.ga[1],8,a[0],!0);
P(e,"UIPDR",b.R[3],0,a[0]);P(e,"UDPDR",b.R[3],8,a[0]);P(e,"UIPAR",b.ga[3],0,a[0]);P(e,"UDPAR",b.ga[3],8,a[0],!0);b.Ma&32&&P(e,"UNIMAP",b.Db,-1,a[0])});L(this)};function P(a,b,c,d,e,f){a=a.j;if(!(e&&0>b.indexOf(e.toUpperCase()))){e=8;var g="",h=!1,l=0,m=8;0>d&&(e=c.length,d=0,h=!0,m=l=4);for(var n=0;n<e;n++)n%m||(g&&(g+="\n"),g+=b+(h?"["+p(n,2)+"]":"")+":"),g+=" "+N(a,c[d+n],l);a.i(g+(f?"\n":""))}}k.reset=function(){this.f.Lb=128;Sc(this.b,this.f.vc,1E3/60,!0)};k.Od=function(){return this.f.Lb};
@ -94,7 +94,7 @@ k.Ne=function(a,b){this.b.R[0][b>>1&7]=a&65295};k.Ld=function(a){return this.b.R
k.xe=function(a){return this.b.R[3][(a>>1&7)+8]};k.xf=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295};k.ye=function(a){return this.b.ga[3][a>>1&7]};k.yf=function(a,b){b=b>>1&7;this.b.ga[3][b]=a;this.b.R[3][b]&=65295};k.we=function(a){return this.b.ga[3][(a>>1&7)+8]};k.wf=function(a,b){b=(b>>1&7)+8;this.b.ga[3][b]=a;this.b.R[3][b]&=65295};k.Pb=function(a){a&=7;return this.b.O&2048?this.b.$a[a]:this.b.u[a]};k.Tb=function(a,b){b&=7;this.b.O&2048?this.b.$a[b]=a:this.b.u[b]=a};
k.Yd=function(){return this.b.O&49152?this.b.Na[0]:this.b.u[6]};k.We=function(a){this.b.O&49152?this.b.Na[0]=a:this.b.u[6]=a};k.ae=function(){return this.b.u[7]};k.Ze=function(a){this.b.u[7]=a};k.Qb=function(a){a&=7;return this.b.O&2048?this.b.u[a]:this.b.$a[a]};k.Ub=function(a,b){b&=7;this.b.O&2048?this.b.u[b]=a:this.b.$a[b]=a};k.Zd=function(){return 1==(this.b.O&49152)>>14?this.b.u[6]:this.b.Na[1]};k.Xe=function(a){1==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Na[1]=a};
k.$d=function(){return 3==(this.b.O&49152)>>14?this.b.u[6]:this.b.Na[3]};k.Ye=function(a){3==(this.b.O&49152)>>14?this.b.u[6]=a:this.b.Na[3]=a};k.Jd=function(a){return this.b.sc[a-65504>>1]};k.Je=function(a,b){this.b.sc[b-65504>>1]=a};k.Rc=function(a){return 65520==a?(Mc(this.w)>>6)-1:0};k.Vc=function(){};k.ve=function(){return 1};k.vf=function(){};k.Id=function(){return this.b.oa};k.Ie=function(){this.b.oa=0};k.Pd=function(){return this.b.rc};k.Pe=function(a,b){b&1||(a&=255);this.b.rc=a};
k.Ud=function(a,b){return b?0:this.b.Cb};k.Se=function(a){kd(this.b,a)};k.ue=function(a,b){return b?0:this.b.fb&65280};k.uf=function(a){this.b.fb=a|255};k.Xd=function(){return ld(this.b)};k.Ve=function(a){md(this.b,a&-1793|ld(this.b)&1792)};k.Uc=function(a,b){K(this)&&H(this,"writeIgnored("+p(b)+"): "+p(a),!0,!0)};
k.Ud=function(a,b){return b?0:this.b.Cb};k.Se=function(a){kd(this.b,a)};k.ue=function(a,b){return b?0:this.b.gb&65280};k.uf=function(a){this.b.gb=a|255};k.Xd=function(){return ld(this.b)};k.Ve=function(a){md(this.b,a&-1793|ld(this.b)&1792)};k.Uc=function(a,b){K(this)&&H(this,"writeIgnored("+p(b)+"): "+p(a),!0,!0)};
var Q={},cd=(Q[61568]=[null,null,O.prototype.Ae,O.prototype.Af,"UNIMAP",64,1170],Q[62592]=[null,null,O.prototype.te,O.prototype.tf,"SIPDR",8,1145,64],Q[62608]=[null,null,O.prototype.re,O.prototype.rf,"SDPDR",8,1145,64],Q[62624]=[null,null,O.prototype.se,O.prototype.sf,"SIPAR",8,1145,64],Q[62640]=[null,null,O.prototype.qe,O.prototype.qf,"SDPAR",8,1145,64],Q[62656]=[null,null,O.prototype.Nd,O.prototype.Ne,"KIPDR",8,1145,64],Q[62672]=[null,null,O.prototype.Ld,O.prototype.Le,"KDPDR",8,1145,64],Q[62688]=
[null,null,O.prototype.Md,O.prototype.Me,"KIPAR",8,1145,64],Q[62704]=[null,null,O.prototype.Kd,O.prototype.Ke,"KDPAR",8,1145,64],Q[62798]=[null,null,O.prototype.Td,O.prototype.Re,"MMR3",1,1145,64],Q[65382]=[null,null,O.prototype.Od,O.prototype.Oe,"LKS"],Q[65402]=[null,null,O.prototype.Qd,O.prototype.Qe,"MMR0",1,1145,64],Q[65404]=[null,null,O.prototype.Rd,O.prototype.Uc,"MMR1",1,1145,64],Q[65406]=[null,null,O.prototype.Sd,O.prototype.Uc,"MMR2",1,1145,64],Q[65408]=[null,null,O.prototype.ze,O.prototype.zf,
"UIPDR",8,1145,64],Q[65424]=[null,null,O.prototype.xe,O.prototype.xf,"UDPDR",8,1145,64],Q[65440]=[null,null,O.prototype.ye,O.prototype.yf,"UIPAR",8,1145,64],Q[65456]=[null,null,O.prototype.we,O.prototype.wf,"UDPAR",8,1145,64],Q[65472]=[null,null,O.prototype.Pb,O.prototype.Tb,"R0SET0"],Q[65473]=[null,null,O.prototype.Pb,O.prototype.Tb,"R1SET0"],Q[65474]=[null,null,O.prototype.Pb,O.prototype.Tb,"R2SET0"],Q[65475]=[null,null,O.prototype.Pb,O.prototype.Tb,"R3SET0"],Q[65476]=[null,null,O.prototype.Pb,
@ -102,37 +102,38 @@ O.prototype.Tb,"R4SET0"],Q[65477]=[null,null,O.prototype.Pb,O.prototype.Tb,"R5SE
O.prototype.Ub,"R4SET1",1,1145],Q[65485]=[null,null,O.prototype.Qb,O.prototype.Ub,"R5SET1",1,1145],Q[65486]=[null,null,O.prototype.Zd,O.prototype.Xe,"R6SUPER",1,1145],Q[65487]=[null,null,O.prototype.$d,O.prototype.Ye,"R6USER",1,1145],Q[65504]=[null,null,O.prototype.Jd,O.prototype.Je,"CTRL",8,1170],Q[65520]=[null,null,O.prototype.Rc,O.prototype.Vc,"LSIZE",1,1170],Q[65522]=[null,null,O.prototype.Rc,O.prototype.Vc,"HSIZE",1,1170],Q[65524]=[null,null,O.prototype.ve,O.prototype.vf,"SYSID",1,1170],Q[65526]=
[null,null,O.prototype.Id,O.prototype.Ie,"CPUERR",1,1170],Q[65528]=[null,null,O.prototype.Pd,O.prototype.Pe,"MB",1,1170],Q[65530]=[null,null,O.prototype.Ud,O.prototype.Se,"PIR"],Q[65532]=[null,null,O.prototype.ue,O.prototype.uf,"SL"],Q[65534]=[null,null,O.prototype.Xd,O.prototype.Ve,"PSW"],Q);
eb(function(){for(var a=G(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=E(d);switch(c.type){case "default":c=new O(c);F(c,d);break;case "pc11":c=new nd(c);F(c,d);break;case "rl11":c=new R(c);F(c,d);break;case "rk11":c=new T(c),F(c,d)}}});var od;if(Db){var pd=new ArrayBuffer(2);(new DataView(pd)).setUint16(0,256,!0);od=256===(new Uint16Array(pd))[0]}else od=!1;var qd=od;
function M(a,b,c,d,e,f){this.w=a;this.id=rd+=2;this.b=null;this.G=b;this.Sb=c;this.size=d||0;this.type=e||sd;this.f=e==td;this.controller=null;Cc(this);this.cb=this.td=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],ud(this,f.kd);else if(Db)this.A=new ArrayBuffer(this.size),this.F=new DataView(this.A,0,this.size),this.D=new Uint8Array(this.A,0,this.size),this.P=new Uint16Array(this.A,0,this.size>>1),this.b=new Int32Array(this.A,0,this.size>>2),ud(this,qd?vd:wd);else{a=this.b=Array(this.size>>
function M(a,b,c,d,e,f){this.w=a;this.id=rd+=2;this.b=null;this.G=b;this.Sb=c;this.size=d||0;this.type=e||sd;this.f=e==td;this.controller=null;Cc(this);this.eb=this.td=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],ud(this,f.kd);else if(Db)this.A=new ArrayBuffer(this.size),this.F=new DataView(this.A,0,this.size),this.D=new Uint8Array(this.A,0,this.size),this.P=new Uint16Array(this.A,0,this.size>>1),this.b=new Int32Array(this.A,0,this.size>>2),ud(this,qd?vd:wd);else{a=this.b=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;ud(this,xd)}else ud(this)}var sd=0,Nc=1,td=2,Ec=4,Ic=["NONE","RAM","ROM","VID","H/W"],rd=0;
M.prototype={constructor:M,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Db)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.F.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Db)for(b=0;b<a.length;b++)this.F.setInt32(b<<2,a[b],!0);else this.b=a;return this.cb=!0}return!1},vb:function(a,b){b?this.g++||yd(this,zd,!1):this.B++||Ad(this,zd,!1)},S:function(a,b){this.j&&K(this.j,32)&&H(this.j,
M.prototype={constructor:M,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Db)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.F.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Db)for(b=0;b<a.length;b++)this.F.setInt32(b<<2,a[b],!0);else this.b=a;return this.eb=!0}return!1},wb:function(a,b){b?this.g++||yd(this,zd,!1):this.B++||Ad(this,zd,!1)},S:function(a,b){this.j&&K(this.j,32)&&H(this.j,
"attempt to read invalid address "+N(this.j,b),!0);this.w.Ra(b,32,2);return 255},v:function(a,b,c){this.j&&K(this.j,32)&&H(this.j,"attempt to write "+N(this.j,b)+" to invalid addresses "+N(this.j,c),!0);this.w.Ra(c,32,4)},T:function(a,b){return this.ec(a++,b++)|this.ec(a,b)<<8},K:function(a,b,c){this.hc(a++,b&255,c++);this.hc(a,b>>8,c)},ca:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},va:function(a,b){a&1&&this.w.Ra(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
1]&255)<<8},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.cb=!0},ab:function(a,b,c){a&1&&this.w.Ra(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.cb=!0},ib:function(a,b){if(this.j&&null!=this.G){var c=this.j;Bd(c,this.G+a,1,c.N)&&c.aa(!0)}return this.I(a,b)},ma:function(a,b){if(this.j&&null!=this.G){var c=this.j;Bd(c,this.G+a,2,c.N)&&c.aa(!0)}return this.J(a,b)},Aa:function(a,
b,c){if(this.j&&null!=this.G){var d=this.j;Bd(d,this.G+a,1,d.F)&&d.aa(!0)}this.f?this.v(a,b,c):this.H(a,b,c)},Wa:function(a,b,c){if(this.j&&null!=this.G){var d=this.j;Bd(d,this.G+a,2,d.F)&&d.aa(!0)}this.f?this.v(a,b,c):this.N(a,b,c)},Y:function(a){return this.D[a]},jb:function(a,b){a=this.D[a];this.j&&K(this.j,32)&&H(this.j,"Memory.readByte("+N(this.j,b)+"): "+N(this.j,a),!0);return a},da:function(a,b){a&1&&this.w.Ra(b,64,2);return this.F.getUint16(a,!0)},na:function(a,b){a&1&&this.w.Ra(b,64,2);a=
this.P[a>>1];this.j&&K(this.j,32)&&H(this.j,"Memory.readWord("+N(this.j,b)+"): "+N(this.j,a),!0);return a},wa:function(a,b){this.D[a]=b;this.cb=!0},Ga:function(a,b,c){this.D[a]=b;this.cb=!0;this.j&&K(this.j,32)&&H(this.j,"Memory.writeByte("+N(this.j,c)+","+N(this.j,b)+")",!0)},Sa:function(a,b,c){a&1&&this.w.Ra(c,64,4);this.F.setUint16(a,b,!0);this.cb=!0},Xa:function(a,b,c){a&1&&this.w.Ra(c,64,4);this.P[a>>1]=b;this.cb=!0;this.j&&K(this.j,32)&&H(this.j,"Memory.writeWord("+N(this.j,c)+","+N(this.j,
1]&255)<<8},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.eb=!0},ab:function(a,b,c){a&1&&this.w.Ra(c,64,4);c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.eb=!0},jb:function(a,b){if(this.j&&null!=this.G){var c=this.j;Bd(c,this.G+a,1,c.N)&&c.aa(!0)}return this.I(a,b)},ma:function(a,b){if(this.j&&null!=this.G){var c=this.j;Bd(c,this.G+a,2,c.N)&&c.aa(!0)}return this.J(a,b)},Aa:function(a,
b,c){if(this.j&&null!=this.G){var d=this.j;Bd(d,this.G+a,1,d.F)&&d.aa(!0)}this.f?this.v(a,b,c):this.H(a,b,c)},Wa:function(a,b,c){if(this.j&&null!=this.G){var d=this.j;Bd(d,this.G+a,2,d.F)&&d.aa(!0)}this.f?this.v(a,b,c):this.N(a,b,c)},Y:function(a){return this.D[a]},kb:function(a,b){a=this.D[a];this.j&&K(this.j,32)&&H(this.j,"Memory.readByte("+N(this.j,b)+"): "+N(this.j,a),!0);return a},da:function(a,b){a&1&&this.w.Ra(b,64,2);return this.F.getUint16(a,!0)},na:function(a,b){a&1&&this.w.Ra(b,64,2);a=
this.P[a>>1];this.j&&K(this.j,32)&&H(this.j,"Memory.readWord("+N(this.j,b)+"): "+N(this.j,a),!0);return a},wa:function(a,b){this.D[a]=b;this.eb=!0},Ga:function(a,b,c){this.D[a]=b;this.eb=!0;this.j&&K(this.j,32)&&H(this.j,"Memory.writeByte("+N(this.j,c)+","+N(this.j,b)+")",!0)},Sa:function(a,b,c){a&1&&this.w.Ra(c,64,4);this.F.setUint16(a,b,!0);this.eb=!0},Xa:function(a,b,c){a&1&&this.w.Ra(c,64,4);this.P[a>>1]=b;this.eb=!0;this.j&&K(this.j,32)&&H(this.j,"Memory.writeWord("+N(this.j,c)+","+N(this.j,
b)+")",!0)}};function Cc(a,b,c){a.j=b;a.B=a.g=0;c&&((a.B=c.B)&&Ad(a,zd,!1),(a.g=c.g)&&yd(a,zd,!1))}function Cd(a,b){b?--a.g||(a.hc=a.f?a.v:a.H,a.$b=a.f?a.K:a.N):--a.B||(a.ec=a.I,a.Ca=a.J)}function yd(a,b,c){c&&a.g||(a.hc=!a.f&&b[1]||a.v,a.$b=!a.f&&b[3]||a.K);if(c||void 0===c)a.H=b[1]||a.v,a.N=b[3]||a.K}function Ad(a,b,c){c&&a.B||(a.ec=b[0]||a.S,a.Ca=b[2]||a.T);if(c||void 0===c)a.I=b[0]||a.S,a.J=b[2]||a.T}function ud(a,b){b||(b=Dd);Ad(a,b,void 0);yd(a,b,void 0)}
var Dd=[],xd=[M.prototype.ca,M.prototype.Pa,M.prototype.va,M.prototype.ab],zd=[M.prototype.ib,M.prototype.Aa,M.prototype.ma,M.prototype.Wa];if(Db)var wd=[M.prototype.Y,M.prototype.wa,M.prototype.da,M.prototype.Sa],vd=[M.prototype.jb,M.prototype.Ga,M.prototype.na,M.prototype.Xa];
function Ed(a,b){y.call(this,"CPU",a,Ed,1);b=a.cycles||b;var c=a.multiplier||1;this.Vb=0;this.tb=b;this.nb=c;this.kc=Math.round(this.tb/1E4)/100;this.Ab=this.kc*this.nb;this.C.U=!1;this.C.gc=!1;this.C.wb=a.autoStart;this.C.Jb=!1;this.Wb=this.Ga=0;this.Xb=a.csStart;this.Nb=a.csInterval;this.Ob=a.csStop;this.N=[];this.Ic=this.Fe.bind(this);L(this)}D(Ed);var Fd=["power","reset"];k=Ed.prototype;
k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.j=d;this.v=a.v;for(b=0;b<Fd.length;b++)(c=this.D[Fd[b]])&&this.B.ya(null,Fd[b],c);a=Gd(a,"autoStart");null!=a&&(this.C.wb="true"==a?!0:"false"==a?!1:!!a);this.j||void 0!==this.D.run||(this.C.wb=!0);L(this)};k.yc=function(){};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.La=function(a,b){if(!b){this.yc();if(a&&this.restore){Hd(this);if(!this.restore(a))return!1;Id(this)}else this.reset();this.j?(a=this.j,b=this.C.wb,a.Xa=!0,a.i("Type ? for help with PDPjs Debugger commands"),Jd(a),b||a.pb(),a.Sa&&(b=a.Sa,a.Sa=null,Kd(a,b))):this.i("No debugger detected")}return!0};k.Ka=function(a){return a?this.save():!0};k.wb=function(){return this.C.U?!0:this.C.wb?(this.hb(),!0):!1};k.Nc=function(){return 0};
function Id(a){void 0===a.Xb&&(a.Xb=0);void 0===a.Nb&&(a.Nb=-1);void 0===a.Ob&&(a.Ob=-1);a.C.Jb=0<=a.Xb&&0<a.Nb;a.C.Jb&&(a.Wb=0,a.Ga=a.Xb-a.na)}function Yb(a,b){if(a.C.Jb){var c=!1;a.Wb=a.Wb+a.Nc()|0;a.Ga-=b;0>=a.Ga&&(a.Ga+=a.Nb,c=!0);0<=a.Ob&&a.Ob<=Ld(a)&&(a.Nb=a.Ob=-1,Id(a),a.aa(),c=!0);c&&a.i(Ld(a)+" cycles: checksum="+q(a.Wb))}}
k.ya=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.la)a=!0;else{var b=null,c,h=qb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.C.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.C.la);c++);c==h.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.C.ready?"powered yet":"ready yet"+(b.cc?" (waiting for notification)":""))+".");a=!1}a&&(d.C.U?d.aa():d.hb())},
!0;case "speed":return this.D[b]=c,!0;case "setSpeed":return this.D[b]=c,c.onclick=function(){Md(d,d.nb<<1,!0)},c.textContent=this.Ab.toFixed(2)+"Mhz",!0}return!1};k.za=function(a){this.B&&this.B.za(a)};function Xb(a,b,c){a.na+=b;c&&(a.ma=a.b=a.K=0)}function Nd(a,b){var c=1;b&&1<a.nb&&a.Aa&&(c=a.Aa/a.kc);a.Gc=Math.round(1E3/30);a.ub=Math.floor(a.tb/30*c);b||(a.Pa=a.ub);a.lc=0}function Ld(a){return a.na+a.Y+a.ma-a.b}function Hd(a){a.Aa=0;a.Hc=0;a.na=a.Y=a.ma=a.b=a.K=0;Id(a);Md(a,1)}
function Md(a,b,c){var d=!1;if(void 0!==b){.8>a.Aa/a.Ab?b=1:d=!0;a.nb=b;b=a.kc*a.nb;if(a.Ab!=b){a.Ab=b;b=a.Ab.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.pb()}Xb(a,a.Y);a.Y=0;a.T=Ea();a.da=0;Nd(a);return d}function Qc(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Sc(a,b,c,d){0<=b&&b<a.N.length&&(d||0>a.N[b][0])&&(c=a.tb*a.nb/1E3*c|0,a.C.U&&(c+=Od(a)),a.N[b][0]=c)}
var Dd=[],xd=[M.prototype.ca,M.prototype.Pa,M.prototype.va,M.prototype.ab],zd=[M.prototype.jb,M.prototype.Aa,M.prototype.ma,M.prototype.Wa];if(Db)var wd=[M.prototype.Y,M.prototype.wa,M.prototype.da,M.prototype.Sa],vd=[M.prototype.kb,M.prototype.Ga,M.prototype.na,M.prototype.Xa];
function Ed(a,b){y.call(this,"CPU",a,Ed,1);b=a.cycles||b;var c=a.multiplier||1;this.Vb=0;this.ub=b;this.ob=c;this.kc=Math.round(this.ub/1E4)/100;this.Ab=this.kc*this.ob;this.C.U=!1;this.C.gc=!1;this.C.bb=a.autoStart;this.C.Jb=!1;this.Wb=this.Ga=0;this.Xb=a.csStart;this.Nb=a.csInterval;this.Ob=a.csStop;this.N=[];this.Ic=this.Fe.bind(this);L(this)}D(Ed);var Fd=["power","reset"];k=Ed.prototype;
k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.j=d;this.v=a.v;for(a=0;a<Fd.length;a++)(b=this.D[Fd[a]])&&this.B.ya(null,Fd[a],b);L(this)};k.yc=function(){};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.La=function(a,b){var c=Gd(this.B,"autoStart");null!=c?this.C.bb="true"==c?!0:"false"==c?!1:!!c:null==this.C.bb&&(this.C.bb=!this.j&&void 0===this.D.run);if(!b){this.yc();if(a&&this.restore){Hd(this);if(!this.restore(a))return!1;Id(this)}else this.reset();this.j?(a=this.j,b=this.C.bb,a.Xa=!0,a.i("Type ? for help with PDPjs Debugger commands"),Jd(a),b||a.qb(),a.Sa&&(b=a.Sa,a.Sa=null,Kd(a,b))):this.i("No debugger detected");this.C.bb?this.i("CPU will auto-start"):this.i("CPU will not be auto-started, click Run to start")}return!0};
k.Ka=function(a){return a?this.save():!0};k.bb=function(){return this.C.U?!0:this.C.bb?(this.ib(),!0):!1};k.Nc=function(){return 0};function Id(a){void 0===a.Xb&&(a.Xb=0);void 0===a.Nb&&(a.Nb=-1);void 0===a.Ob&&(a.Ob=-1);a.C.Jb=0<=a.Xb&&0<a.Nb;a.C.Jb&&(a.Wb=0,a.Ga=a.Xb-a.na)}function Yb(a,b){if(a.C.Jb){var c=!1;a.Wb=a.Wb+a.Nc()|0;a.Ga-=b;0>=a.Ga&&(a.Ga+=a.Nb,c=!0);0<=a.Ob&&a.Ob<=Ld(a)&&(a.Nb=a.Ob=-1,Id(a),a.aa(),c=!0);c&&a.i(Ld(a)+" cycles: checksum="+q(a.Wb))}}
k.ya=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.la)a=!0;else{var b=null,c,h=qb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.C.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.C.la);c++);c==h.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.C.ready?"powered yet":"ready yet"+(b.cc?" (waiting for notification)":""))+".");a=!1}a&&(d.C.U?d.aa():d.ib())},
!0;case "speed":return this.D[b]=c,!0;case "setSpeed":return this.D[b]=c,c.onclick=function(){Md(d,d.ob<<1,!0)},c.textContent=this.Ab.toFixed(2)+"Mhz",!0}return!1};k.za=function(a){this.B&&this.B.za(a)};function Xb(a,b,c){a.na+=b;c&&(a.ma=a.b=a.K=0)}function Nd(a,b){var c=1;b&&1<a.ob&&a.Aa&&(c=a.Aa/a.kc);a.Gc=Math.round(1E3/30);a.vb=Math.floor(a.ub/30*c);b||(a.Pa=a.vb);a.lc=0}function Ld(a){return a.na+a.Y+a.ma-a.b}function Hd(a){a.Aa=0;a.Hc=0;a.na=a.Y=a.ma=a.b=a.K=0;Id(a);Md(a,1)}
function Md(a,b,c){var d=!1;if(void 0!==b){.8>a.Aa/a.Ab?b=1:d=!0;a.ob=b;b=a.kc*a.ob;if(a.Ab!=b){a.Ab=b;b=a.Ab.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.qb()}Xb(a,a.Y);a.Y=0;a.T=Ea();a.da=0;Nd(a);return d}function Qc(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Sc(a,b,c,d){0<=b&&b<a.N.length&&(d||0>a.N[b][0])&&(c=a.ub*a.ob/1E3*c|0,a.C.U&&(c+=Od(a)),a.N[b][0]=c)}
function Pd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Wb(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Od(a,b){var c=a.ma-=a.b;a.b=a.K=0;b&&(a.ma=0);return c}
k.Fe=function(){if(this.C.U){this.lc>=this.tb&&Nd(this,!0);this.Xa=0;this.sb=Ea();if(this.da){var a=this.sb-this.da;a>this.Gc&&(this.T+=a,this.T>this.sb&&(this.T=this.sb))}try{do{var b=Pd(this,this.C.Jb?1:this.ub);try{this.qb(b)}catch(e){if("number"!=typeof e)throw e;}b=Od(this,!0);this.Xa+=b;this.Y+=b;Yb(this,b);Wb(this,b);this.Pa-=b;if(0>=this.Pa){this.Pa+=this.ub;15<=++this.Hc&&(this.za(),this.Hc=0);break}}while(this.C.U)}catch(e){this.aa();this.B&&this.B.stop(Ea(),Ld(this));Cb(this,e.stack||e.message);
return}if(this.C.U){a=setTimeout;b=this.Ic;this.da=Ea();var c=this.Gc;this.Xa&&(c=Math.round(c*this.Xa/this.ub));var c=c-(this.da-this.sb),d=this.da-this.T;d&&(this.Aa=Math.round(this.Y/(10*d))/100,864E5<=d&&(this.na=0,Md(this)));if(0>c||this.Aa<this.Ab)-1E3>c&&(this.T-=c),c=0;this.lc+=this.Xa;this.da+=c;a(b,c)}}};
k.hb=function(a){if(Bb(this))return!1;if(this.C.U)return this.i(this.toString()+" busy"),!1;Md(this);this.C.U=!0;this.C.gc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.pb(!0),this.B.start(this.T,Ld(this)));setTimeout(this.Ic,0);return!0};k.qb=function(){return 0};k.aa=function(a){var b=!1;if(this.C.U){Od(this);Xb(this,this.Y);this.Y=0;this.C.U=!1;if(b=this.D.run)b.textContent="Run";this.B&&this.B.stop(Ea(),Ld(this));b=!0;this.j||this.status("Stopped")}this.C.complete=a;return b};
function Qd(a){this.mb=+a.model||1170;this.Cc=a.addrReset||0;Ed.call(this,a,6666667);this.Fb=0;this.Fc=255;1120==this.mb?(this.decode=Rd.bind(this),this.wa=this.rd,this.Fb=8,this.Fc=-1):(this.decode=Sd.bind(this),this.wa=this.sd);Td(this);this.J=0;this.I=null;this.ic=[];this.C.complete=!1}D(Qd,Ed);k=Qd.prototype;k.yc=function(){for(var a=192,b=0;b<this.ic.length;b++){var c=this.ic[b];0>c.Zb&&(c.Zb=a,a+=4)}};
k.reset=function(){this.status("Model "+this.mb);this.C.U&&this.aa();Td(this);Hd(this);this.C.error=!1;this.parent.reset.call(this)};
k.Fe=function(){if(this.C.U){this.lc>=this.ub&&Nd(this,!0);this.Xa=0;this.tb=Ea();if(this.da){var a=this.tb-this.da;a>this.Gc&&(this.T+=a,this.T>this.tb&&(this.T=this.tb))}try{do{var b=Pd(this,this.C.Jb?1:this.vb);try{this.rb(b)}catch(e){if("number"!=typeof e)throw e;}b=Od(this,!0);this.Xa+=b;this.Y+=b;Yb(this,b);Wb(this,b);this.Pa-=b;if(0>=this.Pa){this.Pa+=this.vb;15<=++this.Hc&&(this.za(),this.Hc=0);break}}while(this.C.U)}catch(e){this.aa();this.B&&this.B.stop(Ea(),Ld(this));Cb(this,e.stack||e.message);
return}if(this.C.U){a=setTimeout;b=this.Ic;this.da=Ea();var c=this.Gc;this.Xa&&(c=Math.round(c*this.Xa/this.vb));var c=c-(this.da-this.tb),d=this.da-this.T;d&&(this.Aa=Math.round(this.Y/(10*d))/100,864E5<=d&&(this.na=0,Md(this)));if(0>c||this.Aa<this.Ab)-1E3>c&&(this.T-=c),c=0;this.lc+=this.Xa;this.da+=c;a(b,c)}}};
k.ib=function(a){if(Bb(this))return!1;if(this.C.U)return this.i(this.toString()+" busy"),!1;Md(this);this.C.U=!0;this.C.gc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.qb(!0),this.B.start(this.T,Ld(this)));this.j||this.status("Started");setTimeout(this.Ic,0);return!0};k.rb=function(){return 0};
k.aa=function(a){var b=!1;if(this.C.U){Od(this);Xb(this,this.Y);this.Y=0;this.C.U=!1;if(b=this.D.run)b.textContent="Run";this.B&&this.B.stop(Ea(),Ld(this));b=!0;this.j||this.status("Stopped")}this.C.complete=a;return b};
function Qd(a){this.nb=+a.model||1170;this.Cc=a.addrReset||0;Ed.call(this,a,6666667);this.Fb=0;this.Fc=255;1120==this.nb?(this.decode=Rd.bind(this),this.wa=this.rd,this.Fb=8,this.Fc=-1):(this.decode=Sd.bind(this),this.wa=this.sd);Td(this);this.J=0;this.I=null;this.ic=[];this.C.complete=!1}D(Qd,Ed);k=Qd.prototype;k.yc=function(){for(var a=192,b=0;b<this.ic.length;b++){var c=this.ic[b];0>c.Zb&&(c.Zb=a,a+=4)}};
k.reset=function(){this.status("Model "+this.nb);this.C.U&&this.aa();Td(this);Hd(this);this.C.error=!1;this.parent.reset.call(this)};
function Td(a){a.V=65536;a.W=32768;a.Z=65535;a.X=32768;a.O=15;a.u=[0,0,0,0,0,0,0,a.Cc,-1,-2,-3,-4,-5,-6,-7,-8];a.$a=[0,0,0,0,0,0];a.Na=[0,0,0,0];a.A=0;a.Ec=[4,2,0,1];a.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ga=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Db=[0,0,0,0,0,0,0,0,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.sc=[0,0,0,0,0,0,0,0];a.rc=0;a.L=0;a.F=a.H=0;a.g=a.f=a.jc=0;a.va=-1;Vb(a)}function Vb(a){a.Ea=0;a.Gb=0;a.Hb=0;a.Ma=0;a.oa=0;a.Cb=0;a.fb=255;a.ca=0;a.Sa=0;a.Wa=0;a.S=262143;a.Ib=0;a.ta=0;a.I=null;a.w&&(Ud(a),a.Wc=Mc(a.w))}function Ud(a){a.ca?(a.P=65536,a.ab=a.Ma&16?4186112:253952,a.ba=a.vd,a.Ca=a.Be,a.$b=a.Bf,Gc(a.w,a.Ma&16?22:18)):(a.P=0,a.ab=57344,a.ba=a.ud,a.Ca=a.Sc,a.$b=a.wc,Gc(a.w,16))}
0,0,0,0,0,0]];a.Db=[0,0,0,0,0,0,0,0,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.sc=[0,0,0,0,0,0,0,0];a.rc=0;a.L=0;a.F=a.H=0;a.g=a.f=a.jc=0;a.va=-1;Vb(a)}function Vb(a){a.Ea=0;a.Gb=0;a.Hb=0;a.Ma=0;a.oa=0;a.Cb=0;a.gb=255;a.ca=0;a.Sa=0;a.Wa=0;a.S=262143;a.Ib=0;a.ta=0;a.I=null;a.w&&(Ud(a),a.Wc=Mc(a.w))}function Ud(a){a.ca?(a.P=65536,a.ab=a.Ma&16?4186112:253952,a.ba=a.vd,a.Ca=a.Be,a.$b=a.Bf,Gc(a.w,a.Ma&16?22:18)):(a.P=0,a.ab=57344,a.ba=a.ud,a.Ca=a.Sc,a.$b=a.wc,Gc(a.w,16))}
function fd(a){var b=a.Ea;b&57344||(b=b&-3199|a.Sa<<5|a.Wa<<1);return b}function gd(a,b){b&=-3073;if(a.Ea!=b){b&57344&&!(a.Ea&57344)&&(a.Gb=a.ta>>16&65535,a.Hb=a.ta&65535);a.Ea=b;a.Sa=(b&96)>>5;a.Wa=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.ca!=c&&(a.ca=c,Ud(a))}}function hd(a){a.Ea&57344||(a.Gb=a.ta>>16&65535);a=a.Gb;a&65280&&(a=(a<<8|a>>8)&65535);return a}function id(a){a.Ea&57344||(a.Hb=a.ta&65535);return a.Hb}
function jd(a,b){1170>a.mb&&(b&=-49);a.Ma!=b&&(a.Ma=b,a.S=b&16?4194303:262143,Ud(a))}function Vd(a,b,c){a.Cc=b;a.w.reset();Vb(a);Wd(a,b);md(a,0);if(c){for(b=2;5>=b;b++)a.u[b]=0;a.C.U||a.hb()}else a.j?a.aa()||Jd(a.j):!1===c&&a.aa();!a.C.U&&a.v&&a.v.stop()}k.Nc=function(){return 0};
k.save=function(){var a=new U(this);a.set(0,[this.u,this.$a,this.Na,this.Db,this.sc,this.oa,this.rc,this.Cb,this.fb,ld(this),this.va,this.A,this.L,this.Ea,this.Gb,this.Hb,this.Ma,this.Sa,this.Wa,this.R,this.ga,this.ca,this.S,this.Ib,this.ta]);a.set(1,[this.na,this.nb]);a.set(2,Lc(this.w));return a.data()};
function jd(a,b){1170>a.nb&&(b&=-49);a.Ma!=b&&(a.Ma=b,a.S=b&16?4194303:262143,Ud(a))}function Vd(a,b,c){a.Cc=b;a.w.reset();Vb(a);Wd(a,b);md(a,0);if(c){for(b=2;5>=b;b++)a.u[b]=0;a.C.U||a.ib()}else a.j?a.aa()||Jd(a.j):!1===c&&a.aa();!a.C.U&&a.v&&a.v.stop()}k.Nc=function(){return 0};
k.save=function(){var a=new U(this);a.set(0,[this.u,this.$a,this.Na,this.Db,this.sc,this.oa,this.rc,this.Cb,this.gb,ld(this),this.va,this.A,this.L,this.Ea,this.Gb,this.Hb,this.Ma,this.Sa,this.Wa,this.R,this.ga,this.ca,this.S,this.Ib,this.ta]);a.set(1,[this.na,this.ob]);a.set(2,Lc(this.w));return a.data()};
k.restore=function(a){var b=a[1];this.na=b[1];Md(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.K){for(var f=0,g=Array(b.K),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.ea[d];if(!f||!f.restore(e)){x("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Xd(a){return a.V&65536?1:0}function Yd(a){return a.W&32768?2:0}function Zd(a){return a.Z&65535?0:4}function $d(a){return a.X&32768?8:0}
function ae(a){var b=a.u[7];a.ta=b;var c=a.Ca(b);a.u[7]=b+2&65535;return c}function be(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function Wd(a,b){a.u[7]=b&65535}function Tc(a,b,c,d){c={Zb:b,ob:c,message:d||0,next:null};c.name=Fb[b];a.ic.push(c);return c}function ce(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.L|=1)}
function Rc(a,b){if(b!=a.I){var c=a.I;if(!c||c.ob<=b.ob)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.ob<=b.ob){b.next=d;c.next=b;break}c=d}while(c)}}a.L|=1;b.message&&K(a,b.message|8)&&H(a,"setIRQ(vector="+p(b.Zb)+",priority="+b.ob+")",!0,!0)}function ed(a,b){ce(a,b);b.message&&K(a,b.message|8)&&H(a,"clearIRQ(vector="+p(b.Zb)+",priority="+b.ob+")",!0,!0)}function de(a){return a.L&64?(a.ua(168,64,-6),!0):a.L&32?(a.ua(4,32,-5),!0):a.L&16?(a.ua(12,16,-7),!0):!1}
function ld(a){return a.O=a.O&63728|$d(a)|Zd(a)|Yd(a)|Xd(a)}function md(a,b){a.X=b<<12;a.Z=~b&4;a.W=b<<14;a.V=b<<16;if((b^a.O)&2048)for(var c=a.$a.length;0<=--c;){var d=a.u[c];a.u[c]=a.$a[c];a.$a[c]=d}a.A=b>>14&3;c=a.O>>14&3;a.A!=c&&(a.Na[c]=a.u[6],a.u[6]=a.Na[a.A]);a.O=b;a.L&=-3;a.L|=a.I?2:1}function kd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.L|=1}a.Cb=b}k.Fa=function(a){this.X=this.Z=a;this.W=0};k.rb=function(a,b){this.X=this.Z=this.V=a;this.W=b||0};
function ae(a){var b=a.u[7];a.ta=b;var c=a.Ca(b);a.u[7]=b+2&65535;return c}function be(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function Wd(a,b){a.u[7]=b&65535}function Tc(a,b,c,d){c={Zb:b,pb:c,message:d||0,next:null};c.name=Fb[b];a.ic.push(c);return c}function ce(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.L|=1)}
function Rc(a,b){if(b!=a.I){var c=a.I;if(!c||c.pb<=b.pb)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.pb<=b.pb){b.next=d;c.next=b;break}c=d}while(c)}}a.L|=1;b.message&&K(a,b.message|8)&&H(a,"setIRQ(vector="+p(b.Zb)+",priority="+b.pb+")",!0,!0)}function ed(a,b){ce(a,b);b.message&&K(a,b.message|8)&&H(a,"clearIRQ(vector="+p(b.Zb)+",priority="+b.pb+")",!0,!0)}function de(a){return a.L&64?(a.ua(168,64,-6),!0):a.L&32?(a.ua(4,32,-5),!0):a.L&16?(a.ua(12,16,-7),!0):!1}
function ld(a){return a.O=a.O&63728|$d(a)|Zd(a)|Yd(a)|Xd(a)}function md(a,b){a.X=b<<12;a.Z=~b&4;a.W=b<<14;a.V=b<<16;if((b^a.O)&2048)for(var c=a.$a.length;0<=--c;){var d=a.u[c];a.u[c]=a.$a[c];a.$a[c]=d}a.A=b>>14&3;c=a.O>>14&3;a.A!=c&&(a.Na[c]=a.u[6],a.u[6]=a.Na[a.A]);a.O=b;a.L&=-3;a.L|=a.I?2:1}function kd(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.L|=1}a.Cb=b}k.Fa=function(a){this.X=this.Z=a;this.W=0};k.sb=function(a,b){this.X=this.Z=this.V=a;this.W=b||0};
function ze(a,b){a.X=a.Z=a.V=b;a.W=a.X^a.V>>1}function Ae(a,b,c,d){a.X=a.Z=a.V=b;a.W=(c^d)&(d^b)}
k.ua=function(a,b,c){if(!this.J){0>this.va?this.va=ld(this):this.A||(c=-4);-4==c&&(this.L&256&&(c=-1),this.L|=256,this.oa|=4,this.u[6]=a=4);if(-1!=c){this.ta=a|4143316992;this.A=0;var d=this.Ca(a|this.P),e=this.Ca(a+2&65535|this.P);md(this,e&-12289|this.va>>2&12288);Be(this,this.va);Be(this,this.u[7]);Wd(this,d)}this.b-=5;this.L&=~(b|19);this.L|=129;this.va=-1;this.qd=a;this.od=c;-1==c&&this.aa();if(-4<=c)throw a;}};
function Ce(a){var b=De(a),c=De(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);Wd(a,b);md(a,c);a.L&=-17}k.Ia=function(a){var b=a>>13&31;31>b&&(a=this.Ma&32?this.Db[b]+(a&8190)&4194302:a&-3932161);return a};
@ -140,17 +141,17 @@ function oc(a,b,c){var d,e,f;if(!(c&a.ca))return f=b&65535,57344<=f&&(f|=a.ab),f
8128)&&(g|=16384));a.R[a.A][d]=e;if(f!=(4194170&a.S)||a.A)a.Sa=a.A,a.Wa=d;g&&(g&57344&&(0<=a.va&&(g|=128),a.Ea&57344||(g|=a.Ea&4096|a.Sa<<5|a.Wa<<1,gd(a,a.Ea&-61695|g&61694)),a.ua(168,64,-2)),a.Ea&61440||!(f<(4191360&a.S)||f>(4194239&a.S))||(a.Ea|=4096,a.Ea&512&&(a.L|=64)));return f}function Ee(a,b){return a.w.dc(b)}function De(a){var b=a.Ca(a.u[6]|a.P);a.u[6]=a.u[6]+2&65535;return b}
function Be(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.ta=a.ta&65535|(a.ta&-65536)<<8|16121856;a.L&256||a.wa(4,-2,c);a.$b(c,b)}
function Fe(a,b,c,d){var e,f,g=d&8?0:a.P;switch(b){case 0:return a.ua(4,0,-3),0;case 1:return 6==c&&a.wa(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.wa(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Ca(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.wa(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Ca(e)|g;a.b-=8;break;case 6:return e=a.Ca(be(a,2)),e=e+a.u[c]&65535,6==c&&a.wa(d,
0,e),a.b-=6,e|g;case 7:return e=a.Ca(be(a,2)),e=e+a.u[c]&65535,e=a.Ca(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ta=a.ta&65535|(a.ta&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.fb&&(this.L|=32)};k.sd=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.fb&&(c<=this.fb-32?this.ua(4,0,-4):(this.oa|=8,this.L|=32)))};function qc(a,b){a.J++;b=a.Sc(oc(a,b,2));a.J--;return b}k.ud=function(a,b,c){a=Fe(this,a,b,c);3932160<=a&&(a=this.Ia(a));return a};
0,e),a.b-=6,e|g;case 7:return e=a.Ca(be(a,2)),e=e+a.u[c]&65535,e=a.Ca(e|a.P),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ta=a.ta&65535|(a.ta&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.gb&&(this.L|=32)};k.sd=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.gb&&(c<=this.gb-32?this.ua(4,0,-4):(this.oa|=8,this.L|=32)))};function qc(a,b){a.J++;b=a.Sc(oc(a,b,2));a.J--;return b}k.ud=function(a,b,c){a=Fe(this,a,b,c);3932160<=a&&(a=this.Ia(a));return a};
k.vd=function(a,b,c){return oc(this,Fe(this,a,b,c),c)};k.Sc=function(a){3932160<=a&&(a=this.Ia(a));return this.w.xa(this.Ib=a)};k.Be=function(a){return this.w.xa(this.Ib=oc(this,a,2))};k.wc=function(a,b){3932160<=a&&(a=this.Ia(a));this.w.Eb(this.Ib=a,b)};k.Bf=function(a,b){this.w.Eb(this.Ib=oc(this,a,4),b)};
function Ge(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Fe(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.A=a.O>>12&3,c=a.Ca(d|c&a.P),a.A=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.Na[a.O>>12&3];return c}function He(a,b,c,d){a.ta=a.ta&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Fe(a,b,e,4),c&65536||(e&=65535),a.A=a.O>>12&3,e=oc(a,e|c&65536,4),a.A=a.O>>14&3,a.w.Eb(e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.Na[a.O>>12&3]=d}
function Ie(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?Ee(a,a.ba(b,c,3)):a.u[c+a.Fb]&a.Fc}function Je(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?a.w.xa(a.ba(b,c,2)):a.u[c+a.Fb]}function Ke(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Fe(a,b,c,8)}function Le(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Ee(a,a.ba(b,c,3)):a.u[c]&255}function Me(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.xa(a.ba(b,c,2)):a.u[c]}
function Ne(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.jc=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,Ee(a,e)),e&1&&a.b--,a.w.Rb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.Eb(e,d.call(a,0>c?a.u[-c-1]:c,a.w.xa(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
function Oe(a,b,c,d,e){var f=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,f,5),e.call(a,(c=0>c?a.u[-c-1]&255:c)<<8),d&1&&a.b--,a.w.Rb(d,c)):(c?(c=0>c?a.u[-c-1]&255:c,a.u[f]=a.u[f]&~d|c<<24>>24&d):a.u[f]&=~d,e.call(a,c<<8))}function Pe(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,4),d.call(a,c=0>c?a.u[-c-1]:c),a.w.Eb(e,c)):(a.u[e]=c=0>c?a.u[-c-1]:c,d.call(a,c))}function W(a,b,c){c&&(Wd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
k.qb=function(a){this.C.complete=!0;var b=this.j?Qe(this.j)?1:this.C.gc?-1:0:0,c=a?this.C.gc?0:1:-1;this.C.gc=!1;this.ma=this.b=a;do{if(b){if(Re(this.j,this.u[7],c)){this.aa();break}c||c++;b++}if(this.L){if(a=this.L&11)if(a=!1,this.L&2){var d=160,e=(this.Cb&224)>>5,f=this.I&&this.I.ob>e?this.I:null;f&&(d=f.Zb,e=f.ob);e>(this.O&224)>>5?(this.L&8&&(be(this,2),this.L&=-9),this.ua(d,0,-10),e=!0):e=!1;e&&(f&&ce(this,f),a=!0);this.I||this.Cb||(this.L&=-3)}else this.L&1&&this.L++;if(a){if(b&&Re(this.j,this.u[7],
k.rb=function(a){this.C.complete=!0;var b=this.j?Qe(this.j)?1:this.C.gc?-1:0:0,c=a?this.C.gc?0:1:-1;this.C.gc=!1;this.ma=this.b=a;do{if(b){if(Re(this.j,this.u[7],c)){this.aa();break}c||c++;b++}if(this.L){if(a=this.L&11)if(a=!1,this.L&2){var d=160,e=(this.Cb&224)>>5,f=this.I&&this.I.pb>e?this.I:null;f&&(d=f.Zb,e=f.pb);e>(this.O&224)>>5?(this.L&8&&(be(this,2),this.L&=-9),this.ua(d,0,-10),e=!0):e=!1;e&&(f&&ce(this,f),a=!0);this.I||this.Cb||(this.L&=-3)}else this.L&1&&this.L++;if(a){if(b&&Re(this.j,this.u[7],
c)){this.aa();break}if(0>c)break}if(this.L&112&&de(this)){if(b&&Re(this.j,this.u[7],c)){this.aa();break}if(0>c)break}}this.L=this.L&15|this.O&16;this.decode(ae(this))}while(0<this.b);return this.C.complete?this.ma-this.b:void 0===this.C.complete?0:-1};eb(function(){for(var a=G(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Qd(d);F(d,c)}});function Se(a,b){var c=b+a;this.X=this.Z=this.V=c;this.W=(a^c)&(b^c);return c&65535}
function Te(a,b){var c=b+a,d=c<<8;this.X=this.Z=this.V=d;this.W=(a<<8^d)&(b<<8^d);return c&255}function Ue(a,b){a=b<<1;ze(this,a);return a&65535}function Ve(a,b){a=b<<1;ze(this,a<<8);return a&255}function We(a,b){a=b&32768|b>>1|b<<16;ze(this,a);return a&65535}function Xe(a,b){a=b&128|b>>1|b<<8;ze(this,a<<8);return a&255}function Ye(a,b){a=b&~a;this.Fa(a);return a}function Ze(a,b){a=b&~a;this.Fa(a<<8);return a}function $e(a,b){a|=b;this.Fa(a);return a}function af(a,b){a|=b;this.Fa(a<<8);return a}
function bf(a,b){a=~b|65536;this.rb(a);return a&65535}function cf(a,b){a=~b|256;this.rb(a<<8);return a&255}function df(a,b){this.X=this.Z=a=b-a;this.W=b&(b^a);return a&65535}function ef(a,b){a=b-a;var c=a<<8;b<<=8;this.X=this.Z=c;this.W=b&(b^c);return a&255}function ff(a,b){this.X=this.Z=a=b+a;this.W=a&(b^a);return a&65535}function gf(a,b){a=b+a;var c=a<<8;this.X=this.Z=c;this.W=c&(b<<8^c);return a&255}function hf(a,b){a=-b;this.rb(a,a&b&32768);return a&65535}
function jf(a,b){a=-b;this.rb(a<<8,(a&b&128)<<8);return a&255}function kf(a,b){a=b<<1|this.V>>16&1;ze(this,a);return a&65535}function lf(a,b){a=b<<1|this.V>>16&1;ze(this,a<<8);return a&255}function mf(a,b){a=(this.V&65536|b)>>1|b<<16;ze(this,a);return a&65535}function nf(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;ze(this,a<<8);return a&255}function of(a,b){var c=b-a;Ae(this,c,a,b);return c&65535}function pf(a,b){var c=b-a;Ae(this,c<<8,a<<8,b<<8);return c&255}
function bf(a,b){a=~b|65536;this.sb(a);return a&65535}function cf(a,b){a=~b|256;this.sb(a<<8);return a&255}function df(a,b){this.X=this.Z=a=b-a;this.W=b&(b^a);return a&65535}function ef(a,b){a=b-a;var c=a<<8;b<<=8;this.X=this.Z=c;this.W=b&(b^c);return a&255}function ff(a,b){this.X=this.Z=a=b+a;this.W=a&(b^a);return a&65535}function gf(a,b){a=b+a;var c=a<<8;this.X=this.Z=c;this.W=c&(b<<8^c);return a&255}function hf(a,b){a=-b;this.sb(a,a&b&32768);return a&65535}
function jf(a,b){a=-b;this.sb(a<<8,(a&b&128)<<8);return a&255}function kf(a,b){a=b<<1|this.V>>16&1;ze(this,a);return a&65535}function lf(a,b){a=b<<1|this.V>>16&1;ze(this,a<<8);return a&255}function mf(a,b){a=(this.V&65536|b)>>1|b<<16;ze(this,a);return a&65535}function nf(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;ze(this,a<<8);return a&255}function of(a,b){var c=b-a;Ae(this,c,a,b);return c&65535}function pf(a,b){var c=b-a;Ae(this,c<<8,a<<8,b<<8);return c&255}
function qf(a,b){this.X=this.Z=b&65280;this.W=this.V=0;return(b<<8|b>>8)&65535}function rf(a,b){a^=b;this.Fa(a);return a&65535}function sf(a){V(this,a,Je(this,a),Se);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}
function tf(a){var b=Me(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.V=this.W=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.V=c<<17-b,c>>=b;else if(b)if(16<b)this.W=c,c=0;else{this.V=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.W=32768)}this.u[a]=c&65535;this.X=this.Z=c;this.b-=(this.g?6:7)+b}
function uf(a){var b=Me(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.V=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.V=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.W=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function vf(a){W(this,a,!Xd(this))}function wf(a){W(this,a,Xd(this))}
@ -159,25 +160,25 @@ function Bf(a){var b=Je(this,a);a=Me(this,a);this.Fa((0>b?this.u[-b-1]:b)&a);thi
function Hf(a){W(this,a,Zd(this)||!$d(this)!=!Yd(this))}function If(a){W(this,a,Xd(this)||Zd(this))}function Jf(a){W(this,a,!$d(this)!=!Yd(this))}function Kf(a){W(this,a,$d(this))}function Lf(a){W(this,a,!Zd(this))}function Mf(a){W(this,a,!$d(this))}function Nf(){this.ua(12,0,-9)}function Of(a){W(this,a,!0)}function Pf(a){W(this,a,!Yd(this))}function Qf(a){W(this,a,Yd(this))}function Rf(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.Z=1);a&8&&(this.X=0);this.b-=5}
function Sf(a){var b=Je(this,a);a=Me(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;Ae(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Tf(a){var b=Ie(this,a);a=Le(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);Ae(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}
function Uf(a){var b=Me(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Z=d>>16|d,this.X=d>>16):(this.W=32768,this.Z=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.X=0,this.W=32768,this.V=65536,this.b-=7}function Vf(){this.ua(24,0,-9);this.b-=20}
function Wf(){this.O&49152?(this.oa|=128,this.ua(4,0,-8)):(this.v&&1120==this.mb&&this.v.setData(this.u[0],!0),this.j?Xf(this.j):this.aa());this.b-=7}function Yf(){this.ua(16,0,-9);this.b-=20}var Zf=[0,7,7,10,7,11,9,13];function $f(a){this.K=this.b;Wd(this,Ke(this,a));this.b=this.K-Zf[this.g]}var ag=[0,14,14,17,14,18,16,20];function bg(a){this.K=this.b;var b=Ke(this,a);a=a>>6&7;Be(this,this.u[a]);this.u[a]=this.u[7];Wd(this,b);this.b=this.K-ag[this.g]}
function Wf(){this.O&49152?(this.oa|=128,this.ua(4,0,-8)):(this.v&&1120==this.nb&&this.v.setData(this.u[0],!0),this.j?Xf(this.j):this.aa());this.b-=7}function Yf(){this.ua(16,0,-9);this.b-=20}var Zf=[0,7,7,10,7,11,9,13];function $f(a){this.K=this.b;Wd(this,Ke(this,a));this.b=this.K-Zf[this.g]}var ag=[0,14,14,17,14,18,16,20];function bg(a){this.K=this.b;var b=Ke(this,a);a=a>>6&7;Be(this,this.u[a]);this.u[a]=this.u[7];Wd(this,b);this.b=this.K-ag[this.g]}
var cg=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function dg(a){var b=Je(this,a);this.K=this.b;Pe(this,a,b,this.Fa);this.b=this.K-cg[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function eg(a){var b=Ie(this,a);Oe(this,a,b,65535,this.Fa);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var fg=[7,13,13,17,14,18,17,21];
function gg(a){var b=Me(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.X=b>>16;this.Z=this.X|b;this.W=0;this.V=-32768>b||32767<b?65536:0;this.b-=23}function hg(){this.b-=5}function ig(){this.O&49152||(this.w.reset(),Vb(this),this.v&&this.v.setData(this.u[0],!0));this.b-=667}function jg(a){if(a&8)X.call(this,a);else{var b=De(this);a&=7;7==a?Wd(this,b):(Wd(this,this.u[a]),this.u[a]=b);this.b-=9}}
function kg(){Ce(this);this.b-=13}function lg(a){a&1&&(this.V=65536);a&2&&(this.W=32768);a&4&&(this.Z=0);a&8&&(this.X=32768);this.b-=5}function mg(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)Wd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function ng(a){V(this,a,Je(this,a),of);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function og(a){V(this,a,0,qf);this.b-=this.g?9:3+(7==this.f?2:0)}function pg(){this.ua(28,0,-9)}
function qg(){this.v&&(this.v.uc(this.u[7],!0),this.v.setData(this.u[0],!0));this.L|=8;be(this,-2);this.b-=3}function rg(a){V(this,a,this.u[(a>>6&7)+this.Fb],rf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,K(b,1)?(H(b,"undefined opcode "+N(b,a),!0,!0),b=Xf(b)):b=!1;b||this.ua(8,0,-9)}function Rd(a){sg[a>>12].call(this,a)}function tg(a){ug[a>>6&3].call(this,a)}function vg(a){wg[a>>6&3].call(this,a)}function xg(a){yg[a>>6&3].call(this,a)}
function zg(a){Ag[a&15].call(this,a)}function Bg(a){Cg[a&15].call(this,a)}function Dg(a){Eg[a>>6&3].call(this,a)}function Fg(a){Gg[a>>6&3].call(this,a)}function Hg(a){Ig[a>>6&3].call(this,a)}
var sg=[function(a){Jg[a>>8&15].call(this,a)},dg,Sf,Bf,xf,zf,sf,X,function(a){Kg[a>>8&15].call(this,a)},eg,Tf,Cf,yf,Af,ng,X],Jg=[function(a){Lg[a>>4&15].call(this,a)},Of,Lf,Df,Ef,Jf,Ff,Hf,bg,bg,tg,vg,xg,X,X,X],ug=[function(a){Pe(this,a,0,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,df);this.b-=this.g?9:3+(7==this.f?2:0)}],wg=[function(a){V(this,a,0,hf);
this.b-=this.g?11:6},function(a){V(this,a,Xd(this)?1:0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Xd(this)?1:0,of);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Me(this,a);this.rb(a);this.b-=this.g?4:3+(7==this.f?2:0)}],yg=[function(a){V(this,a,0,mf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)}],Lg=
var sg=[function(a){Jg[a>>8&15].call(this,a)},dg,Sf,Bf,xf,zf,sf,X,function(a){Kg[a>>8&15].call(this,a)},eg,Tf,Cf,yf,Af,ng,X],Jg=[function(a){Lg[a>>4&15].call(this,a)},Of,Lf,Df,Ef,Jf,Ff,Hf,bg,bg,tg,vg,xg,X,X,X],ug=[function(a){Pe(this,a,0,this.sb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,bf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,df);this.b-=this.g?9:3+(7==this.f?2:0)}],wg=[function(a){V(this,a,0,hf);
this.b-=this.g?11:6},function(a){V(this,a,Xd(this)?1:0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Xd(this)?1:0,of);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Me(this,a);this.sb(a);this.b-=this.g?4:3+(7==this.f?2:0)}],yg=[function(a){V(this,a,0,mf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,kf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)}],Lg=
[function(a){Mg[a&15].call(this,a)},X,X,X,$f,$f,$f,$f,jg,X,zg,Bg,og,og,og,og],Mg=[Wf,qg,kg,Nf,Yf,ig,X,X,X,X,X,X,X,X,X,X],Ag=[hg,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},Rf,function(){this.Z=1;this.b-=5},Rf,Rf,Rf,function(){this.X=0;this.b-=5},Rf,Rf,Rf,Rf,Rf,Rf,Rf],Cg=[hg,function(){this.V=65536;this.b-=5},function(){this.W=32768;this.b-=5},lg,function(){this.Z=0;this.b-=5},lg,lg,lg,function(){this.X=32768;this.b-=5},lg,lg,lg,lg,lg,lg,lg],Kg=[Mf,Kf,Gf,If,Pf,Qf,vf,wf,Vf,pg,Dg,Fg,
Hg,X,X,X],Eg=[function(a){Oe(this,a,0,255,this.rb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,1,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,1,ef);this.b-=this.g?9:3+(7==this.f?2:0)}],Gg=[function(a){Ne(this,a,0,jf);this.b-=this.g?11:6},function(a){Ne(this,a,Xd(this)?1:0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,Xd(this)?1:0,pf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Le(this,
a);this.rb(a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Ig=[function(a){Ne(this,a,0,nf);this.b-=this.g?9+(this.jc&1):3+(7==this.f?2:0)},function(a){Ne(this,a,0,lf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,0,Xe);this.b-=this.g?9+(this.jc&1):3+(7==this.f?2:0)},function(a){Ne(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}];function Sd(a){Ng[a>>12].call(this,a)}
Hg,X,X,X],Eg=[function(a){Oe(this,a,0,255,this.sb);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,0,cf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,1,gf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,1,ef);this.b-=this.g?9:3+(7==this.f?2:0)}],Gg=[function(a){Ne(this,a,0,jf);this.b-=this.g?11:6},function(a){Ne(this,a,Xd(this)?1:0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,Xd(this)?1:0,pf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Le(this,
a);this.sb(a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Ig=[function(a){Ne(this,a,0,nf);this.b-=this.g?9+(this.jc&1):3+(7==this.f?2:0)},function(a){Ne(this,a,0,lf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Ne(this,a,0,Xe);this.b-=this.g?9+(this.jc&1):3+(7==this.f?2:0)},function(a){Ne(this,a,0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)}];function Sd(a){Ng[a>>12].call(this,a)}
var Ng=[function(a){Og[a>>8&15].call(this,a)},dg,Sf,Bf,xf,zf,sf,function(a){Pg[a>>8&15].call(this,a)},function(a){Qg[a>>8&15].call(this,a)},eg,Tf,Cf,yf,Af,ng,X],Og=[function(a){Rg[a>>4&15].call(this,a)},Of,Lf,Df,Ef,Jf,Ff,Hf,bg,bg,tg,vg,xg,function(a){Sg[a>>6&3].call(this,a)},X,X],Sg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Ca(a|this.P);Wd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ge(this,a,0);this.Fa(a);Be(this,a);this.b-=11},function(a){var b=De(this);
this.K=this.b;this.Fa(b);He(this,a,0,b);this.b=this.K-fg[this.g]},function(a){Pe(this,a,$d(this)?65535:0,this.Fa);this.b-=this.g?9:3+(7==this.f?2:0)}],Rg=[function(a){Tg[a&15].call(this,a)},X,X,X,$f,$f,$f,$f,jg,function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.L|=1,this.L&=-3),this.b-=5):X.call(this,a)},zg,Bg,og,og,og,og],Tg=[Wf,qg,function(){Ce(this);this.L|=this.O&16;this.b-=13},Nf,Yf,ig,kg,function(){this.ua(8,0,-9)},X,X,X,X,X,X,X,X],Pg=[gg,gg,Uf,Uf,tf,tf,uf,uf,rg,rg,X,X,X,X,mg,
mg],Qg=[Mf,Kf,Gf,If,Pf,Qf,vf,wf,Vf,pg,Dg,Fg,Hg,function(a){Ug[a>>6&3].call(this,a)},X,X],Ug=[X,function(a){a=Ge(this,a,65536);this.Fa(a);Be(this,a);this.b-=11},function(a){var b=De(this);this.K=this.b;this.Fa(b);He(this,a,65536,b);this.b=this.K-fg[this.g]},X];
function Vg(a){y.call(this,"ROM",a,Vg,128);this.ja=this.B=null;this.A=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.H=w(this.g);if(this.g){a=this.g;var b=pa(this.H);"json"!=b&&"hex"!=b&&(a=Ia()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Ga(a,null,!0,function(a,b,f){f?(c.M("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(pb(c.jb,a,b),(a=Ha(a,b))?(c.B=a.ha,c.ja=a.ja):c.g=null);Wg(c)})}}D(Vg);k=Vg.prototype;
function Vg(a){y.call(this,"ROM",a,Vg,128);this.ja=this.B=null;this.A=a.addr;this.f=a.size;this.F=!1;this.v=a.alias;this.g=a.file;this.H=w(this.g);if(this.g){a=this.g;var b=pa(this.H);"json"!=b&&"hex"!=b&&(a=Ia()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Ga(a,null,!0,function(a,b,f){f?(c.M("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(pb(c.kb,a,b),(a=Ha(a,b))?(c.B=a.ha,c.ja=a.ja):c.g=null);Wg(c)})}}D(Vg);k=Vg.prototype;
k.Ha=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Wg(this)};k.La=function(){this.ja&&(this.j&&Xg(this.j,this.id,this.A,this.f,this.ja),delete this.ja);return!0};k.Ka=function(){return!0};
function Wg(a){if(!Ab(a)){if(a.g){if(!a.B||!a.w)return;a.f||(a.f=a.B.length);if(a.B.length!=a.f)Cb(a,"ROM size ("+q(a.B.length,8,!0)+") does not match specified size ("+q(a.f,8,!0)+")");else{var b;a:{b=a.A;a.status(a.f+"-byte ROM at "+p(b));if(57344<=b&&b<57344+xc){var c={};b=(c[b]=[Vg.prototype.pe,Vg.prototype.pf,null,null,null,a.f>>1],c);if(Mb(a.w,a,b)){b=a.F=!0;break a}}else if(Dc(a.w,b,a.f,td)){for(c=0;c<a.B.length;c++)Kc(a.w,b+c,a.B[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.v?b.push(a.v):
null!=a.v&&a.v.length&&(b=a.v);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.w,g=d.f,h=[],l=d.A>>>f.ra;0<g&&l<f.ea.length;)h.push(f.ea[l++]),g-=f.Ja;f=d.w;d=d.f;g=0;for(e>>>=f.ra;0<d&&e<f.ea.length;){l=h[g++];if(!l)break;f.ea[e++]=l;d-=f.Ja}}a.F||delete a.B}}}L(a)}}k.pe=function(a){return this.B[a-this.A]};k.pf=function(){};eb(function(){for(var a=G(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Vg(d);F(d,c)}});
function Yg(a){y.call(this,"RAM",a,Yg);this.ja=this.B=null;this.g=a.addr;this.v=a.size;this.Ua=a.load;this.Ta=a.exec;this.A=!1;this.f=a.file;this.F=w(this.f);if(this.f){a=this.f;var b=pa(this.F);"json"!=b&&"hex"!=b&&(a=Ia()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ga(a,null,!0,function(a,b,f){f?(c.M("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(pb(c.jb,a,b),(a=Ha(a,b))?(c.B=a.ha,c.ja=a.ja,null==c.Ua&&(c.Ua=a.Ua),null==c.Ta&&(c.Ta=a.Ta)):c.f=null);Zg(c)})}}
function Yg(a){y.call(this,"RAM",a,Yg);this.ja=this.B=null;this.g=a.addr;this.v=a.size;this.Ua=a.load;this.Ta=a.exec;this.A=!1;this.f=a.file;this.F=w(this.f);if(this.f){a=this.f;var b=pa(this.F);"json"!=b&&"hex"!=b&&(a=Ia()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Ga(a,null,!0,function(a,b,f){f?(c.M("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(pb(c.kb,a,b),(a=Ha(a,b))?(c.B=a.ha,c.ja=a.ja,null==c.Ua&&(c.Ua=a.Ua),null==c.Ta&&(c.Ta=a.Ta)):c.f=null);Zg(c)})}}
D(Yg);Yg.prototype.Ha=function(a,b,c,d){this.w=b;this.b=c;this.j=d;Zg(this)};Yg.prototype.La=function(){this.ja&&(this.j&&Xg(this.j,this.id,this.g,this.v,this.ja),delete this.ja);return!0};Yg.prototype.Ka=function(){return!0};function Zg(a){if(a.w&&(!a.A&&a.v&&(Dc(a.w,a.g,a.v,Nc)?a.A=!0:a.v=0),!Ab(a))){if(!a.A)x("No RAM allocated");else if(a.f){if(!a.B||!a.w)return;$g(a,a.B,a.Ua,a.Ta,a.g)}L(a)}}
Yg.prototype.reset=function(){if(this.A){for(var a=this.w,b=this.g,c=this.v,d=b&a.w,b=b>>>a.ra;0<c&&b<a.ea.length;){var e=a.ea[b],f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Db&&e.D)for(h=d;f--&&h<e.D.length;h++)e.D[h]=g;else for(h=d;f--&&h<e.size;h++)e.H(d,g,e.G+d);c-=a.Ja;b++;d=0}this.B&&$g(this,this.B,this.Ua,this.Ta,this.g,!0)}};
function $g(a,b,c,d,e,f){var g=!1,h=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){var n=l;if(1!=m){H(a,"invalid signature ("+v(m)+") at offset "+v(n),4096);break}if(l+6>=b.length){H(a,"invalid block at offset "+v(n),4096);break}for(var l=l+2,t=b[l++]&255|(b[l++]&255)<<8,r=b[l++]&255|(b[l++]&255)<<8,m=m+((t&255)+(t>>8)+(r&255)+(r>>8)),u=l,z=t-=6;0<t&&l<b.length;)m+=b[l++]&255,t--;if(t||l>=b.length){H(a,"insufficient data for block at offset "+v(n),4096);break}m+=
@ -187,12 +188,12 @@ function bh(a){this.K=a.adapter;this.Y=a.baudReceive||9600;this.wa=a.baudTransmi
k.ya=function(a,b,c){var d=this;switch(b){case ch:return this.D[b]=this.v=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?ma.zc:ma.$c:46==c?b=ma.zc:a.ctrlKey&&c>=ma.xc&&c<=ma.gd&&(b=c-(ma.xc-ma.Xc));b&&(a.preventDefault&&a.preventDefault(),d.fc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==ma.Zc&&(b=ma.Yc);d.fc(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.fc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;var e=this;this.da=Tc(this.b,this.K?-1:48,4,262144);this.na=Qc(this.b,function(){var a;a=-1;e.I.length&&(a=e.I.shift()&255,H(e,"receiveByte("+q(a,2,!0)+")"),e.va&&97<=a&&122>a&&(a-=32),Sc(e.b,e.na,1E3/Math.round(e.Y/10)));0<=a&&(e.N=a,e.f&128?e.N|=49152:e.f|=128,e.f&64&&Rc(c,e.da))});this.T=Tc(this.b,this.K?-1:52,4,262144);this.Aa=Qc(this.b,function(){e.g|=128;e.g&64&&Rc(c,e.T)});Mb(b,this,dh,this.K?64832+8*(this.K-1)-65392:0);Ob(b,this.reset.bind(this));
L(this)};k.Qc=function(a){if(!this.A){var b=Gd(this.B,"connection");if(b){var c=b.split("->");if(2==c.length){var d=va(c[0]);if(d!=this.ib)return;c=va(c[1]);if(this.A=rb(c)){var e=this.A.exports;if(e){var f=e.connect;f&&f.call(this.A,this.J);if(this.P=e.receiveData){this.J=a;this.S=e.receiveStatus;this.status(this.jb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
L(this)};k.Qc=function(a){if(!this.A){var b=Gd(this.B,"connection");if(b){var c=b.split("->");if(2==c.length){var d=va(c[0]);if(d!=this.jb)return;c=va(c[1]);if(this.A=rb(c)){var e=this.A.exports;if(e){var f=e.connect;f&&f.call(this.A,this.J);if(this.P=e.receiveData){this.J=a;this.S=e.receiveStatus;this.status(this.kb+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
k.La=function(a,b){if(!b)if(this.Qc(this.J),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){eh(this)};k.save=function(){var a=new U(this);a.set(0,[]);return a.data()};k.restore=function(){return eh(this)};function eh(a){a.N=0;a.f=8192;a.g=128;a.I=[];return!0}
k.fc=function(a){if("number"==typeof a)this.I.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.I.push(b)}else this.I=this.I.concat(a);Sc(this.b,this.na,1E3/Math.round(this.Y/10));return!0};k.Ee=function(a){var b=this.f;this.f&=-12289;a&32&&(this.f|=8192);a&256&&(this.f|=4096);b!=this.f&&(this.f|=32768,this.f&32&&Rc(this.b,this.da))};k.ce=function(){var a=this.f&65534;this.f&=-32769;return a};
k.af=function(a){var b=a^this.f;this.f=this.f&-112|a&111;this.S&&b&6&&(b=0,b=this.J?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.S.call(this.A,b))};k.be=function(){this.f&=-129;return this.N};k.$e=function(){};k.De=function(){return this.g};k.Df=function(a){this.g&128&&(a&64?Rc(this.b,this.T):ed(this.b,this.T));this.g=this.g&-70|a&69};k.Ce=function(){return 0};
k.Cf=function(a){a&=255;H(this,"transmitByte("+q(a,2,!0)+")");this.P&&this.P.call(this.A,a);a&=127;if(this.v)if(13==a)this.H=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.H&&this.H--;else{if(a){var b;b=(b=Ca[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ma||8,c=a-this.H%a,this.ma&&(b=ua("",c)));this.ca&&!this.H&&c&&(b=String.fromCharCode(this.ca)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}}else if(null!=this.F){if(10==a||1024<=
this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}Sc(this.b,this.Aa,1E3/Math.round(this.wa/10));this.g&=-129};var fh={},dh=(fh[65392]=[null,null,bh.prototype.ce,bh.prototype.af,"RCSR"],fh[65394]=[null,null,bh.prototype.be,bh.prototype.$e,"RBUF"],fh[65396]=[null,null,bh.prototype.De,bh.prototype.Df,"XCSR"],fh[65398]=[null,null,bh.prototype.Ce,bh.prototype.Cf,"XBUF"],fh);
k.Cf=function(a){a&=255;H(this,"transmitByte("+q(a,2,!0)+")");this.P&&this.P.call(this.A,a);a&=127;if(this.v)if(13==a)this.H=0;else if(8==a)this.v.value=this.v.value.slice(0,-1),0<this.H&&this.H--;else{if(a){var b;b=(b=13!=a&&10!=a?Ca[a]:null)?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.ma||8,c=a-this.H%a,this.ma&&(b=ua("",c)));this.ca&&!this.H&&c&&(b=String.fromCharCode(this.ca)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}}else if(null!=this.F){if(10==
a||1024<=this.F.length)this.i(this.F),this.F="";10!=a&&(this.F+=String.fromCharCode(a))}Sc(this.b,this.Aa,1E3/Math.round(this.wa/10));this.g&=-129};var fh={},dh=(fh[65392]=[null,null,bh.prototype.ce,bh.prototype.af,"RCSR"],fh[65394]=[null,null,bh.prototype.be,bh.prototype.$e,"RBUF"],fh[65396]=[null,null,bh.prototype.De,bh.prototype.Df,"XCSR"],fh[65398]=[null,null,bh.prototype.Ce,bh.prototype.Cf,"XBUF"],fh);
eb(function(){for(var a=G(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new bh(d);F(d,c)}});function nd(a){y.call(this,"PC11",a,nd);this.N=gh(this,a.autoMount);this.g=0;this.ca=a.baudReceive||3600;this.I=this.J=this.f=0;this.H=[];this.F=hh;this.v=Fh;this.K=this.A="";this.ha=this.Ua=this.Ta=null;this.T=-1;this.P=!Qa("Mobi")&&window&&"FileReader"in window}D(nd);var hh="",Fh=0;
function gh(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){x(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}k=nd.prototype;
k.ya=function(a,b,c){var d=this,e=Fh;switch(b){case "listTapes":return this.D[b]=c,c.onchange=function(){var a=d.D.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){x("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "readTape":e=2;case "loadTape":return e||(e=1),this.D[b]=c,c.onclick=function(){var a=
@ -200,20 +201,20 @@ d.D.listTapes;a&&Gh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mount
k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;this.Y=Hh(a);var e=this;if(a=gh(this,Gd(this.B,"autoMount")))for(var f in a)"PTR"==f&&(this.N[f]=a[f]);this.S=Tc(this.b,56,4,4096);this.da=Qc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.I<e.H.length&&(e.J=e.H[e.I++]&255,Ih(e,e.I/e.H.length*100),e.f|=128,e.f&=-2049,e.f&64&&Rc(e.b,e.S))});Mb(b,this,Jh);Ob(b,this.reset.bind(this));Kh(this,"None",hh,!0);this.P&&Kh(this,"Local Tape","?");Kh(this,"Remote Tape","??");Lh(this)||L(this)};
k.La=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.J=0};function Lh(a){a.g=0;var b=a.N.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.D.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=w(c,!0)}c&&b?Mh(a,b,c,1,!0):Nh(a)}return!!a.g}
function Gh(a,b,c,d,e){if(c)if("?"==c)a.M('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=w(c);a.status("Attempting to load "+c+' as "'+b+'"');a.F="??"}else a.F=c;Mh(a,b,c,d,!1,e)}else Oh(a,!1)}
function Mh(a,b,c,d,e,f){var g=-1;if(a.A.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,Oh(a,!0),a.C.lb?a.M("PC11 busy"):(e&&(a.g++,K(a)&&H(a,"auto-loading tape: "+b)),Ph(a,b,c,d,f)?g++:a.C.lb=!0);g&&Qh(a,a.K,a.A,a.v,a.ha,a.Ua,a.Ta)}
function Ph(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),Qh(a,b,c,d,e),a.F="?");Nh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=pa(c),f="json"==e||"gz"==e?encodeURI(c):Ia()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ga(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.C.la;g?a.M('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(pb(a.jb,e,f),(e=Ha(e,f))&&Qh(a,b,c,d,e.ha,e.Ua,
e.Ta));a.C.lb=!1;a.g&&(a.g--,a.g||L(a));Nh(a)})}function Kh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Mh(a,b,c,d,e,f){var g=-1;if(a.A.toLowerCase()!=c.toLowerCase()||a.v!=d)g++,Oh(a,!0),a.C.mb?a.M("PC11 busy"):(e&&(a.g++,K(a)&&H(a,"auto-loading tape: "+b)),Ph(a,b,c,d,f)?g++:a.C.mb=!0);g&&Qh(a,a.K,a.A,a.v,a.ha,a.Ua,a.Ta)}
function Ph(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),Qh(a,b,c,d,e),a.F="?");Nh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=pa(c),f="json"==e||"gz"==e?encodeURI(c):Ia()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ga(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.C.la;g?a.M('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(pb(a.kb,e,f),(e=Ha(e,f))&&Qh(a,b,c,d,e.ha,e.Ua,
e.Ta));a.C.mb=!1;a.g&&(a.g--,a.g||L(a));Nh(a)})}function Kh(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Nh(a){var b=a.D.listTapes;if(b&&b.options){a=a.F||a.A;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function Ih(a,b){b|=0;if(b!==a.T){var c=a.D.readProgress;c&&(c=(c=G(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.T=b}}
function Qh(a,b,c,d,e,f,g){a.K=b;a.A=c;a.v=d;a.ha=e;a.Ua=f;a.Ta=g;2==d?a.Y&&$g(a.Y,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.M('No valid memory address for tape "'+b+'"'):(a.I=0,a.H=e,a.status('Loaded tape "'+b+'"'),Ih(a,0))}function Oh(a,b){if(a.A||!1===b)a.K="",a.A="",b||(a.v&&a.status(1==a.v?"tape detached":"tape unloaded"),a.F=hh,a.v=Fh,Nh(a))}k.save=function(){return(new U(this)).data()};k.restore=function(){return!0};k.Wd=function(){return this.f&65534};
k.Ue=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Rc(this.b,this.S)):(this.f&=-129,this.f|=2048,this.J=0,Sc(this.b,this.da,1E3/Math.round(this.ca/10))));this.f=this.f&-66|a&65};k.Vd=function(){this.f&=-129;this.f|=2048;return this.J};k.Te=function(){};var Rh={},Jh=(Rh[65384]=[null,null,nd.prototype.Wd,nd.prototype.Ue,"PRS"],Rh[65386]=[null,null,nd.prototype.Vd,nd.prototype.Te,"PRB"],Rh);
function Sh(a,b,c){y.call(this,"Disk",{id:a.jb+".disk"+q(++Th,4)},Sh,8192);this.controller=a;this.B=a.B;this.j=a.j;this.v=b;this.Va=b.name;this.bc=b.bc;Uh(this,c,b.fa,b.ka,b.ia,b.Ba);L(this)}var Th=0;D(Sh);k=Sh.prototype;k.Ha=function(a,b,c,d){this.j=d};
function Sh(a,b,c){y.call(this,"Disk",{id:a.kb+".disk"+q(++Th,4)},Sh,8192);this.controller=a;this.B=a.B;this.j=a.j;this.v=b;this.Va=b.name;this.bc=b.bc;Uh(this,c,b.fa,b.ka,b.ia,b.Ba);L(this)}var Th=0;D(Sh);k=Sh.prototype;k.Ha=function(a,b,c,d){this.j=d};
function Uh(a,b,c,d,e,f){a.mode=b;a.fa=c;a.ka=d;a.ia=e;a.Ba=f;a.b=[];if("preload"!=a.mode){b=Array(a.fa);for(c=0;c<b.length;c++){d=Array(a.ka);for(e=0;e<d.length;e++){f=Array(a.ia);for(var g=1;g<=f.length;g++)f[g-1]=Vh(null,c,e,g,a.Ba,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
function Wh(a,b,c,d,e){var f=c;if(a.w)return!0;a.Va=b;a.Oa=c;a.tc=w(c);a.w=e;a.A=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.fa=e[0];a.ka=e[1];a.ia=e[2];a.Ba=e[3]||512;c=a.Ba>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.fa);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.ka),u=0;u<r.length;u++)for(var z=r[u]=Array(a.ia),A=0;A<z.length;A++){for(var C=Vh(null,d,u,A+1,a.Ba,0),ta=C.data,Va=0;Va<c;Va++,f+=4)var S=ta[Va]=b.getInt32(f,
!0),e=e+S&-1;C.Qa=c;z[A]=C}a.f=e;c=a}else a.M("Unrecognized disk format ("+d+" bytes)");a.w&&(a.w.call(a.controller,a.v,c,a.Va,a.Oa),a.w=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=pa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):qa(c,"/")&&(d="dir"),f=Ia()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Ga(f,
null,!0,function(b,c,d){Xh(a,b,c,d)})}
function Xh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.C.la;if(d)a.controller.M('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{pb(a.controller.jb,b,c);try{if(0<w(a.tc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Va]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
function Xh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.C.la;if(d)a.controller.M('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{pb(a.controller.kb,b,c);try{if(0<w(a.tc,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Va]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(h.length)if(1==h.length)x(h[0]);else{a.fa=h.length;a.ka=h[0].length;a.ia=h[0][0].length;var l=h[0][0][0];a.Ba=l&&l.length||512;for(d=c=0;d<a.fa;d++)for(f=0;f<a.ka;f++)for(g=0;g<a.ia;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var t=l.data;if(void 0===t){var r=l.bytes;if(void 0!==r&&r.length){for(var u=m<<2,z=r.length;z<u;z++)r[z]=n;Yh(l,r)}else t=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=t;delete l.bytes}Vh(l,d,f);for(u=
0;u<t.length;u++)c=c+t[u]&-1}a.b=h;a.f=c;e=a}else x("Empty disk image: "+a.Va)}catch(A){x("Disk image error ("+b+"): "+A.message)}}a.w&&(a.w.call(a.A,a.v,e,a.Va,a.Oa),a.w=null)}function Vh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Eg=b;a.Fg=c;a.Za=a.Qa=0;a.cb=!1;return a}
0;u<t.length;u++)c=c+t[u]&-1}a.b=h;a.f=c;e=a}else x("Empty disk image: "+a.Va)}catch(A){x("Disk image error ("+b+"): "+A.message)}}a.w&&(a.w.call(a.A,a.v,e,a.Va,a.Oa),a.w=null)}function Vh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Eg=b;a.Fg=c;a.Za=a.Qa=0;a.eb=!1;return a}
k.seek=function(a,b,c,d,e){d=null;var f=this.v,g=this.b[a];if(g){var h=g[b];if(!h&&f.md&&b<f.ka)for(h=g[b]=Array(f.Kc),g=0;g<h.length;g++)h[g]=Vh(null,a,b,g+1,f.qc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.md&&9==f.mc&&(d=h[g]=Vh(null,a,b,f.mc,f.qc,0))}}e&&e(d,!1);return d};function Yh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Qa?f<a.Za?(a.Qa+=a.Za-f,a.Za=f):f>=a.Za+a.Qa&&(a.Qa+=f-(a.Za+a.Qa)+1):(a.Za=f,a.Qa=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function Zh(a,b){var c=a.ka*a.ia,d=b/c|0;return d<a.fa?(b%=c,a.seek(d,b/a.ia|0,b%a.ia+1)):null}function $h(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function ai(a){for(var b="",c=0,d;d=Zh(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode($h(a,d,e));return btoa(b)}
@ -229,11 +230,11 @@ k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;if(a=ci(this,Gd(this.
k.La=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;a<this.g.length;a++)ji(this,a,!0);ii(this,!0)}}else if(!this.restore(a))return!1;if(a=this.D.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";di(this,0)}}return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){fi(this)};k.save=function(){return(new U(this)).data()};
k.restore=function(a){return fi(this,a[0])};function ii(a,b){b||(a.F=0);for(var c in a.J){var d=a.J[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=w(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.g.length)){!ki(a,g,f,e,!0)&&b&&L(a,!1);continue}a.M("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.F}
function ei(a,b,c,d){var e=a.D.listDrives,e=e&&na(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.M("Unable to load the selected drive");else if(c)if("?"==c)a.M('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=w(c);a.status("Attempting to load "+c+' as "'+b+'"')}ki(a,e,b,c,!1,d)}else ji(a,e)}
function ki(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Oa.toLowerCase()!=d.toLowerCase()&&(g++,ji(a,b,!0),h.yb?a.M("RK11 busy"):(h.yb=!0,e&&(h.xb=!0,a.F++,K(a)&&H(a,"auto-loading disk: "+c)),h.eb=!!f,Wh(new Sh(a,h,"preload"),c,d,f,a.bd)&&g++));return g}
k.bd=function(a,b,c,d,e){a.yb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.M('Disk "'+c+'" too large for drive '+("RK"+a.zb)),b=null);b?(a.qa=b,a.Va=c,a.Oa=d,this.M('Loaded disk "'+c+'" in drive '+("RK"+a.zb),a.xb||e),this.B&&this.B.pb()):a.eb=!1;a.xb&&(a.xb=!1,--this.F||L(this));di(this,a.zb)};
function ki(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Oa.toLowerCase()!=d.toLowerCase()&&(g++,ji(a,b,!0),h.yb?a.M("RK11 busy"):(h.yb=!0,e&&(h.xb=!0,a.F++,K(a)&&H(a,"auto-loading disk: "+c)),h.fb=!!f,Wh(new Sh(a,h,"preload"),c,d,f,a.bd)&&g++));return g}
k.bd=function(a,b,c,d,e){a.yb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.M('Disk "'+c+'" too large for drive '+("RK"+a.zb)),b=null);b?(a.qa=b,a.Va=c,a.Oa=d,this.M('Loaded disk "'+c+'" in drive '+("RK"+a.zb),a.xb||e),this.B&&this.B.qb()):a.fb=!1;a.xb&&(a.xb=!1,--this.F||L(this));di(this,a.zb)};
function hi(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function di(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.D.listDisks;a=a.D.listDrives;if(d&&a&&d.options&&a.options&&(a=na(a.value,10),c=c.eb?"?":c.Oa,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ji(a,b,c){var d=a.g[b];if(d.qa||!1===c)d.Va="",d.Oa="",d.qa=null,d.eb=!1,c||(a.M("Drive RK"+b+" unloaded",c),di(a,b))}
function fi(a,b){var c=0;b||(b=[]);a.P=b[c++]||2496;a.v=b[c++]||0;a.f=b[c++]||128;a.I=b[c++]||0;a.H=b[c++]||0;a.A=b[c++]||0;a.N=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.zb=b;d.name=c.ib;d.yb=d.eb=!1;d.fa=203;d.ka=2;d.ia=12;d.Ba=512;d.bc=!0;d.nd=0;d.ld=0;d.mc=1;d.Kc=d.ia;d.qc=d.Ba;d.wd=0;d.Ge=null;d.qa||(d.Oa="");d.status=2368}return!0}
function di(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.D.listDisks;a=a.D.listDrives;if(d&&a&&d.options&&a.options&&(a=na(a.value,10),c=c.fb?"?":c.Oa,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ji(a,b,c){var d=a.g[b];if(d.qa||!1===c)d.Va="",d.Oa="",d.qa=null,d.fb=!1,c||(a.M("Drive RK"+b+" unloaded",c),di(a,b))}
function fi(a,b){var c=0;b||(b=[]);a.P=b[c++]||2496;a.v=b[c++]||0;a.f=b[c++]||128;a.I=b[c++]||0;a.H=b[c++]||0;a.A=b[c++]||0;a.N=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.zb=b;d.name=c.jb;d.yb=d.fb=!1;d.fa=203;d.ka=2;d.ia=12;d.Ba=512;d.bc=!0;d.nd=0;d.ld=0;d.mc=1;d.Kc=d.ia;d.qc=d.Ba;d.wd=0;d.Ge=null;d.qa||(d.Oa="");d.status=2368}return!0}
k.ad=function(a,b,c,d,e,f){this.H=f&65535;this.f=this.f&-49|f>>12&48;this.I=65536-e&65535;this.A=this.A&-16|d&15;a&&(this.v=this.v|a|32768,this.f|=49152);return!0};
k.Ac=function(a,b,c,d,e,f,g,h){var l=0;a=a.qa;var m=null,n;a||(l=128,e=0);for(;e--;){if(!m){m=a.seek(b,c,d+1);if(!m){l=4096;break}n=0}var t,r;if(0>(t=a.read(m,n++))||0>(r=a.read(m,n++))){l=32;break}if(!g&&(ac(this.w,f,t|r<<8),Pc(this.w))){l=1024;break}f+=2;if(n>=a.Ba&&(m=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){l=64;break}}return h?h(l,b,c,d,e,f):l};
k.cd=function(a,b,c,d,e,f,g,h){var l=0;a=a.qa;var m=null,n;a||(l=128,e=0);for(;e--;){var t=pc(this.w,f);if(Pc(this.w)){l=1024;break}f+=2;if(!m){m=a.seek(b,c,d+1,!0);if(!m){l=4096;break}n=0}if(g){var r,u;if(0>(r=a.read(m,n++))||0>(u=a.read(m,n++))){l=32;break}if(t!=(r|u<<8)){l=1;break}}else if(!a.write(m,n++,t&255)||!a.write(m,n++,t>>8)){l=32;break}if(n>=a.Ba&&(m=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){l=64;break}}return h?h(l,b,c,d,e,f):l};k.he=function(){return this.P};k.ff=function(){};
@ -250,11 +251,11 @@ k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.j=d;if(a=mi(this,Gd(this.
k.La=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;a<this.g.length;a++)ti(this,a,!0);si(this,!0)}}else if(!this.restore(a))return!1;if(a=this.D.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ni(this,0)}}return!0};k.Ka=function(a){return a?this.save():!0};k.reset=function(){pi(this)};k.save=function(){return(new U(this)).data()};
k.restore=function(a){return pi(this,a[0])};function si(a,b){b||(a.I=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=w(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.g.length)){!ui(a,g,f,e,!0)&&b&&L(a,!1);continue}a.M("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.I}
function oi(a,b,c,d){var e=a.D.listDrives,e=e&&na(e.value,10);if(void 0===e||0>e||e>=a.g.length)a.M("Unable to load the selected drive");else if(c)if("?"==c)a.M('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=w(c);a.status("Attempting to load "+c+' as "'+b+'"')}ui(a,e,b,c,!1,d)}else ti(a,e)}
function ui(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Oa.toLowerCase()!=d.toLowerCase()&&(g++,ti(a,b,!0),h.yb?a.M("RL11 busy"):(h.yb=!0,e&&(h.xb=!0,a.I++,K(a)&&H(a,"auto-loading disk: "+c)),h.eb=!!f,Wh(new Sh(a,h,"preload"),c,d,f,a.ed)&&g++));return g}
k.ed=function(a,b,c,d,e){a.yb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.M('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.qa=b,a.Va=c,a.Oa=d,this.M('Loaded disk "'+c+'" in drive '+("RL"+a.zb),a.xb||e),this.B&&this.B.pb()):a.eb=!1;a.xb&&(a.xb=!1,--this.I||L(this));ni(this,a.zb)};
function ui(a,b,c,d,e,f){var g=-1,h=a.g[b];h.Oa.toLowerCase()!=d.toLowerCase()&&(g++,ti(a,b,!0),h.yb?a.M("RL11 busy"):(h.yb=!0,e&&(h.xb=!0,a.I++,K(a)&&H(a,"auto-loading disk: "+c)),h.fb=!!f,Wh(new Sh(a,h,"preload"),c,d,f,a.ed)&&g++));return g}
k.ed=function(a,b,c,d,e){a.yb=!1;b&&(b.fa>a.fa||b.ka>a.ka)&&(this.M('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.qa=b,a.Va=c,a.Oa=d,this.M('Loaded disk "'+c+'" in drive '+("RL"+a.zb),a.xb||e),this.B&&this.B.qb()):a.fb=!1;a.xb&&(a.xb=!1,--this.I||L(this));ni(this,a.zb)};
function ri(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function ni(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.D.listDisks;a=a.D.listDrives;if(d&&a&&d.options&&a.options&&(a=na(a.value,10),c=c.eb?"?":c.Oa,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ti(a,b,c){var d=a.g[b];if(d.qa||!1===c)d.Va="",d.Oa="",d.qa=null,d.eb=!1,c||(a.M("Drive RL"+b+" unloaded",c),ni(a,b))}
function pi(a,b){var c=0;b||(b=[]);a.f=b[c++]||129;a.J=b[c++]||0;a.v=b[c++]||0;a.A=b[c++]||0;a.H=b[c++]||0;a.F=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.zb=b;d.name=c.ib;d.yb=d.eb=!1;d.fa=512;d.ka=2;d.ia=40;d.Ba=256;d.bc=!0;d.nd=0;d.ld=0;d.mc=1;d.Kc=d.ia;d.qc=d.Ba;d.wd=0;d.Ge=null;d.qa||(d.Oa="");d.status=29}return!0}
function ni(a,b){if(0<=b&&b<a.g.length){var c=a.g[b],d=a.D.listDisks;a=a.D.listDrives;if(d&&a&&d.options&&a.options&&(a=na(a.value,10),c=c.fb?"?":c.Oa,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function ti(a,b,c){var d=a.g[b];if(d.qa||!1===c)d.Va="",d.Oa="",d.qa=null,d.fb=!1,c||(a.M("Drive RL"+b+" unloaded",c),ni(a,b))}
function pi(a,b){var c=0;b||(b=[]);a.f=b[c++]||129;a.J=b[c++]||0;a.v=b[c++]||0;a.A=b[c++]||0;a.H=b[c++]||0;a.F=b[c]||0;for(b=0;b<a.g.length;b++){var d=a.g[b];void 0===d&&(d=a.g[b]={});c=a;d.zb=b;d.name=c.jb;d.yb=d.fb=!1;d.fa=512;d.ka=2;d.ia=40;d.Ba=256;d.bc=!0;d.nd=0;d.ld=0;d.mc=1;d.Kc=d.ia;d.qc=d.Ba;d.wd=0;d.Ge=null;d.qa||(d.Oa="");d.status=29}return!0}
k.dd=function(a,b,c,d,e,f){this.J=f&65535;this.f=this.f&-49|f>>12&48;this.F=f>>16&63;this.A=this.v=b<<7|(c?64:0)|d&63;this.H=65536-e&65535;a&&(this.f=this.f|a|32768);return!0};
k.Bc=function(a,b,c,d,e,f,g){var h=0;a=a.qa;var l=null,m;a||(h=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){h=5120;break}m=0}var n,t;if(0>(n=a.read(l,m++))||0>(t=a.read(l,m++))){h=5120;break}ac(this.w,this.b.Ia(f),n|t<<8);if(Pc(this.w)){h=8192;break}f+=2;if(m>=a.Ba&&(l=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g?g(h,b,c,d,e,f):h};
k.fd=function(a,b,c,d,e,f,g){var h=0;a=a.qa;var l=null,m;a||(h=5120,e=0);for(;e--;){var n=pc(this.w,this.b.Ia(f));if(Pc(this.w)){h=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){h=5120;break}m=0}if(!a.write(l,m++,n&255)||!a.write(l,m++,n>>8)){h=5120;break}if(m>=a.Ba&&(l=null,++d>=a.ia&&(d=0,++c>=a.ka&&(c=0,++b>=a.fa)))){h=5120;break}}return g?g(h,b,c,d,e,f):h};k.me=function(){return this.f&65535};
@ -275,69 +276,69 @@ Li={SP:6,PC:7,PS:20,IR:21,ER:22,SL:23,MMR0:24,MMR1:25,MMR2:26,MMR3:27,AR:28,DR:2
65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106,32768],35072:[107,32768]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,
63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,63],35904:[72,63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],
180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}},Oi=[0],Pi=[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Fi.prototype;
k.Ha=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.v=a.v;(a=Gd(a,"messages"))&&Ii(this,a);this.tb=Ni;this.Fb=1145>this.b.mb?Pi:[];dd(this,16,function(a){a:{var b=d.w.ea,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Qi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.ra;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ic[c],n&&d.i(q(n.id,8)+" %"+
k.Ha=function(a,b,c,d){this.w=b;this.B=a;this.b=c;this.v=a.v;(a=Gd(a,"messages"))&&Ii(this,a);this.ub=Ni;this.Fb=1145>this.b.nb?Pi:[];dd(this,16,function(a){a:{var b=d.w.ea,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Qi(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.w.ra;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ic[c],n&&d.i(q(n.id,8)+" %"+
q(e<<d.w.ra,8)+" %%"+q(n.G,8)+" "+v(n.Sb)+" "+v(n.size)+" "+m),c!=sd&&(c=-1),m=0);a+=d.w.Ja;e++}}});L(this)};
k.ya=function(a,b,c){var d=this;switch(b){case "debugInput":return this.va=this.D[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Kd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.g.length-1&&(b=d.g[++d.A])):40==a.keyCode&&(0<d.A?b=d.g[--d.A]:(b="",d.A=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.D[b]=c,Ta(c,function(){if(d.va){var a=d.va.value;
d.va.value="";Kd(d,a,!0);return!0}return!1}),!0;case "step":return this.D[b]=c,Ta(c,function(a){var b=!1;zb(d,!0)||(tb(d,!0),b=d.qb(a?1:0,null),tb(d,!1));return b}),!0}return!1};k.pb=function(a){if(this.va){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.va.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.G;null==a&&(a=-1);return a};k.Ia=function(a){return 3932160<=a?this.b.Ia(a):a};
d.va.value="";Kd(d,a,!0);return!0}return!1}),!0;case "step":return this.D[b]=c,Ta(c,function(a){var b=!1;zb(d,!0)||(tb(d,!0),b=d.rb(a?1:0,null),tb(d,!1));return b}),!0}return!1};k.qb=function(a){if(this.va){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.va.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.G;null==a&&(a=-1);return a};k.Ia=function(a){return 3932160<=a?this.b.Ia(a):a};
k.dc=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(a.ac||65535<d?(c=this.w,d=this.Ia(d),c.B=!1,c.sa++,d=Jc(c,d).I(d&c.w,d),c.sa--):(c=this.b,c.J++,d=Ee(c,oc(c,d,3)),c.J--),c=d,b&&Ri(a,b));return c};k.xa=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.ac||65535<d?pc(this.w,this.Ia(d)):qc(this.b,d),b&&Ri(a,b));return c};
k.Rb=function(a,b,c){var d=this.ba(a,!0,1);if(-1!==d){if(a.ac||65535<d)Kc(this.w,this.Ia(d),b);else{var e=this.b;e.J++;d=oc(e,d,5);d&1&&e.b--;e.w.Rb(d,b);e.J--}c&&Ri(a,c);this.B.za(-1)}};k.Eb=function(a,b,c){var d=this.ba(a,!0,2);if(-1!==d){if(a.ac||65535<d)ac(this.w,this.Ia(d),b);else{var e=this.b;e.J++;e.wc(oc(e,d,4),b);e.J--}c&&Ri(a,c);this.B.za(-1)}};function Y(a,b){return{G:a,ac:b,Ya:!1}}k.uc=function(a,b){a.G=b;a.Ya=!1;return a};function Si(a){return[a.G,a.Ya]}
function Ti(a){return{G:a[0],Ya:a[1]}}function Qi(a,b,c){var d,e=(c?a.K:a.Wa).G;c=!1;if(void 0!==b){b=Bi(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.I.length;e++){var g=a.I[e].ja[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Y(d));break}}if(d=f)return d;e=Ai(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function Ui(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.hd=yi(a,b.Tc=c[2]))}function Ri(a,b){null!=a.G&&(a.G+=b||1)}
function Ii(a,b){a.j=a;a.pa=a.pd=536870912;a.na=null;a.Y=[];b=yi(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Gb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.pa|=Gb[c],a.i(c+" messages enabled"))}}function dd(a,b,c){for(var d in Gb)if(b==Gb[d]){a.Pa[d]=c;break}}
k.Oc=function(a){a=a.toUpperCase();var b=Li[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function Vi(a){return 6>a?"R"+a:6==a?"SP":"PC"}
k.Pc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.$a[a-8];else if(20>a)b=this.b.Na[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=ld(this.b);break;case 21:b=c.Cb;break;case 22:b=c.oa;break;case 23:b=c.fb;break;case 24:b=fd(c);break;case 25:b=hd(c);break;case 26:b=id(c);break;case 27:b=c.Ma;break;case 28:d&&(b=d.Da);break;case 29:d&&(b=d.Bb);break;case 30:d&&uc(d)&&(b=d.gb)}}return b};
k.Pc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.$a[a-8];else if(20>a)b=this.b.Na[a-16];else{var c=this.b,d=this.v;switch(a){case 20:b=ld(this.b);break;case 21:b=c.Cb;break;case 22:b=c.oa;break;case 23:b=c.gb;break;case 24:b=fd(c);break;case 25:b=hd(c);break;case 26:b=id(c);break;case 27:b=c.Ma;break;case 28:d&&(b=d.Da);break;case 29:d&&(b=d.Bb);break;case 30:d&&uc(d)&&(b=d.hb)}}return b};
k.message=function(a,b){b&&(a+=" @"+N(this,Y(this.b.ta&65535).G));if(!this.na||a!=this.na)if(this.na=a,this.pa&1073741824)this.Y.push(a);else{var c;if(this.pa&-2147483648&&this.b&&(c=this.b.C.U)||zb(this,!0))this.aa(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Od(a),a.Pa=0,a.za())}};
function Hi(a){var b;if(!Qe(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.da=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.da=0;a.i("instruction history buffer allocated")}}k.hb=function(a,b){if(!Wi(this,b))return!1;this.b.hb(a);return!0};
k.qb=function(a,b,c){if(!Wi(this))return!1;null===b&&(b=!this.ub||"tr"==this.ub);this.J=0;a||Qe(this)&&Re(this,this.b.u[7],0);try{a=Pd(this.b,a);var d=this.b.qb(a);0<d&&(Wb(this.b,d),this.J+=d,Xb(this.b,d,!0),Yb(this.b,d),this.Aa++)}catch(e){"number"!=typeof e&&(this.J=0,Cb(this.b,e.stack||e.message))}!1!==c&&(this.v&&this.v.stop(),this.B.za(-1));Jd(this,b||!1);return 0<this.J};k.aa=function(a){this.b&&this.b.aa(a)};
function Hi(a){var b;if(!Qe(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.da=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.da=0;a.i("instruction history buffer allocated")}}k.ib=function(a,b){if(!Wi(this,b))return!1;this.b.ib(a);return!0};
k.rb=function(a,b,c){if(!Wi(this))return!1;null===b&&(b=!this.vb||"tr"==this.vb);this.J=0;a||Qe(this)&&Re(this,this.b.u[7],0);try{a=Pd(this.b,a);var d=this.b.rb(a);0<d&&(Wb(this.b,d),this.J+=d,Xb(this.b,d,!0),Yb(this.b,d),this.Aa++)}catch(e){"number"!=typeof e&&(this.J=0,Cb(this.b,e.stack||e.message))}!1!==c&&(this.v&&this.v.stop(),this.B.za(-1));Jd(this,b||!1);return 0<this.J};k.aa=function(a){this.b&&this.b.aa(a)};
function Jd(a,b){if(a.Xa){void 0===b&&(b=!0);var c;c=a.b;if(c=c.L&128?c.qd|c.od<<8:0){var d=c>>8;a.i("trapped to "+N(a,c&255,1)+" ("+(0>d?Eb[-d]:N(a,d))+")")}a.K=Y(a.b.u[7]);b&&1!=a.P?Xi(a):Yi(a)}}function Wi(a,b){var c;(c=!a.b||!Ab(a.b))||(c=a.b,c.C.la?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.U?(b||a.i("cpu busy or unavailable, command ignored"),!1):!Bb(a.b)}k.La=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
k.Ka=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Hi(this);this.Aa=0;this.na=null;this.J=0;this.K=Y(this.b.u[7]);this.C.U=!1;Zi(this);a||Jd(this)};k.save=function(){var a=new U(this);a.set(0,Si(this.K));a.set(1,Si(this.S));a.set(2,[this.g,this.T,this.pa]);a.set(3,this.I);return a.data()};
k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Ti(a[b++]),this.S=Ti(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.T=a[b][1],this.pa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.P||this.i("running");this.C.U=!0;this.Gb=a;this.Hb=b};
k.stop=function(a,b){if(this.C.U){this.C.U=!1;this.J=b-this.Hb;if(!this.P){b="stopped";if(this.J){a-=this.Gb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";Qe(this)&&(b+=this.Aa+" instructions, ",this.Aa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else K(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}Jd(this,!0);this.pb();Zi(this,this.b.u[7]);this.na=null}};function Qe(a){return 1<a.f.length||!!a.wa}
k.stop=function(a,b){if(this.C.U){this.C.U=!1;this.J=b-this.Hb;if(!this.P){b="stopped";if(this.J){a-=this.Gb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";Qe(this)&&(b+=this.Aa+" instructions, ",this.Aa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else K(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}Jd(this,!0);this.qb();Zi(this,this.b.u[7]);this.na=null}};function Qe(a){return 1<a.f.length||!!a.wa}
function Re(a,b,c){var d=-1;c||(d=qc(a.b,b),0==d&&(b=be(a.b,2)));if(0<c&&(a.wa&&!--a.wa||Bd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.Aa++,0>d&&(d=qc(a.b,b)),65535!=(d&65535)&&(a.uc(a.H[a.da],b),++a.da==a.H.length&&(a.da=0)));return!1}function Xf(a){var b=a.b;if(b.C.U)throw Wd(b,a.b.ta&65535),a.aa(),-1;return!1}
function Gi(a){var b,c;a.f=["bp"];if(a.N)for(b=1;b<a.N.length;b++){c=a.N[b];var d=a.w;c=a.ba(c);Cd(d.ea[c>>>d.ra],!1)}a.N=["br"];if(a.F)for(b=1;b<a.F.length;b++)c=a.F[b],d=a.w,c=a.ba(c),Cd(d.ea[c>>>d.ra],!0);a.F=["bw"];a.ab=0}k.vb=function(a,b,c){var d=!0;c||$i(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.i("invalid address: "+N(this,b.G)),d=!1;else{var f=this.w;f.ea[e>>>f.ra].vb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Ya=!0:(aj(this,a,a.length-1,"set"),Hi(this)));return d};
function Gi(a){var b,c;a.f=["bp"];if(a.N)for(b=1;b<a.N.length;b++){c=a.N[b];var d=a.w;c=a.ba(c);Cd(d.ea[c>>>d.ra],!1)}a.N=["br"];if(a.F)for(b=1;b<a.F.length;b++)c=a.F[b],d=a.w,c=a.ba(c),Cd(d.ea[c>>>d.ra],!0);a.F=["bw"];a.ab=0}k.wb=function(a,b,c){var d=!0;c||$i(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.i("invalid address: "+N(this,b.G)),d=!1;else{var f=this.w;f.ea[e>>>f.ra].wb(e&f.w,a==this.F)}}d&&(a.push(b),c?b.Ya=!0:(aj(this,a,a.length-1,"set"),Hi(this)));return d};
function $i(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Ya)){f=!0;h.Ya||e||aj(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.w,Cd(d.ea[c>>>d.ra],b==a.F));h.Ya||Hi(a);break}}return f}function bj(a,b){for(var c=1;c<b.length;c++)aj(a,b,c);return b.length-1}function aj(a,b,c,d){c=b[c];a.i(b[0]+" "+N(a,c.G)+(d?" "+d:c.Tc?' "'+c.Tc+'"':""))}
function Zi(a,b){if(void 0!==b)Bd(a,b,1,a.f,!0),a.P=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ya){if(!$i(a,a.f,c,!0))break;b=0}}}
function Bd(a,b,c,d,e){var f=!1;if(!a.ab++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ya)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ya&&($i(a,d,h,!0),e=!0);if(n=h.hd){for(var f=!1,t=0;t<n.length;t++)if(!cj(a,n[t],!0)){if(n[t].indexOf("if")){f=!0;break}for(var r=t+1;r<n.length&&n[r].indexOf("else");r++)t++;if(r==n.length){f=!0;break}}a.b.C.U||(f=!0)}if(f){e||aj(a,d,g,"hit");break}}}a.ab--;return f}
function dj(a,b,c,d){var e=Y(b.G),f=a.xa(b,2),g,h;for(h in a.tb)if(g=a.tb[h][f&h])break;g||(g=Oi);var l=g[0];0<=a.Fb.indexOf(l)&&(g=Oi,l=g[0]);var m=h="",n=Ki[l],t=g.length-1;l||t||(h=N(a,f));for(l=1;l<=t;l++){var r=g[l];if(void 0!==r){var u;u=a;var z=r,r=b,A="",C=z&61440;if(4096==C)r=r.G+((f&255)<<24>>23)&65535,A=N(u,r);else if(8192==C)r=r.G-((f&63)<<1)&65535,A=N(u,r);else if(12288==C)A=N(u,f&7,1);else if(24576==C)A=N(u,f&63,1);else if(32768==C)A=N(u,f&255,1);else if(C=f&z,z&4032&&(C>>=6,z>>=6),
function dj(a,b,c,d){var e=Y(b.G),f=a.xa(b,2),g,h;for(h in a.ub)if(g=a.ub[h][f&h])break;g||(g=Oi);var l=g[0];0<=a.Fb.indexOf(l)&&(g=Oi,l=g[0]);var m=h="",n=Ki[l],t=g.length-1;l||t||(h=N(a,f));for(l=1;l<=t;l++){var r=g[l];if(void 0!==r){var u;u=a;var z=r,r=b,A="",C=z&61440;if(4096==C)r=r.G+((f&255)<<24>>23)&65535,A=N(u,r);else if(8192==C)r=r.G-((f&63)<<1)&65535,A=N(u,r);else if(12288==C)A=N(u,f&7,1);else if(24576==C)A=N(u,f&63,1);else if(32768==C)A=N(u,f&255,1);else if(C=f&z,z&4032&&(C>>=6,z>>=6),
z&63)switch(z=C&7,C&56){case 0:A=Vi(z);break;case 8:A="@"+Vi(z);break;case 16:7>z?A="("+Vi(z)+")+":(C=u.xa(r,2),A="#"+N(u,C,0,!0));break;case 24:7>z?A="@("+Vi(z)+")+":(C=u.xa(r,2),A="@#"+N(u,C,0,!0));break;case 32:A="-("+Vi(z)+")";break;case 40:A="@-("+Vi(z)+")";break;case 48:C=u.xa(r,2);A=N(u,C,0,!0)+"("+Vi(z)+")";7==z&&(A=N(u,C+r.G&65535));break;case 56:C=u.xa(r,2),A="@"+N(u,C)+"("+Vi(z)+")",7==z&&(A="@"+N(u,C+r.G&65535))}u=A;if(!u||!u.length){h="INVALID";break}"string"!=typeof u&&(m=u[1],u=u[0]);
0<h.length&&(h+=",");h+=u||"???"}}f="";g=N(a,e.G)+":";if(-1!==e.G&&-1!==b.G){do if(f+=" "+N(a,a.xa(e,2)),null==e.G)break;while(e.G!=b.G)}g+=ua(f,24);g+=ua(n,5);h&&(g+=" "+h);if(c||m)g=ua(g,60)+";"+(c||""),g=a.b.C.Jb?g+("cycles="+Ld(a.b).toString()+" cs="+q(a.b.Wb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function ej(a,b){switch(b){case "N":a=$d(a.b);break;case "Z":a=Zd(a.b);break;case "V":a=Yd(a.b);break;case "C":a=Xd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
function Z(a,b){var c="",d=a.b;if(8>b)c=Vi(b),c+="="+N(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+N(a,d.$a[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+N(a,d.Na[b-16]);else switch(b){case 20:c="PS="+N(a,ld(d));break;case 21:c="IR="+N(a,d.Cb);break;case 22:c="ER="+N(a,d.oa);break;case 23:c="SL="+N(a,d.fb);break;case 24:c="MMR0="+N(a,fd(d));break;case 25:c="MMR1="+N(a,hd(d));break;case 26:c="MMR2="+N(a,id(d));break;case 27:c="MMR3="+N(a,d.Ma);break;case 28:a.v&&(c="AR="+N(a,a.v.Da,3));break;case 29:a.v&&
(c="DR="+N(a,a.v.Bb));break;case 30:a.v&&uc(a.v)&&(c="SR="+N(a,a.v.gb,3))}c&&(c+=" ");return c}function fj(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=ej(a,"T")+ej(a,"N")+ej(a,"Z")+ej(a,"V")+ej(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Lc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function Z(a,b){var c="",d=a.b;if(8>b)c=Vi(b),c+="="+N(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+N(a,d.$a[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+N(a,d.Na[b-16]);else switch(b){case 20:c="PS="+N(a,ld(d));break;case 21:c="IR="+N(a,d.Cb);break;case 22:c="ER="+N(a,d.oa);break;case 23:c="SL="+N(a,d.gb);break;case 24:c="MMR0="+N(a,fd(d));break;case 25:c="MMR1="+N(a,hd(d));break;case 26:c="MMR2="+N(a,id(d));break;case 27:c="MMR3="+N(a,d.Ma);break;case 28:a.v&&(c="AR="+N(a,a.v.Da,3));break;case 29:a.v&&
(c="DR="+N(a,a.v.Bb));break;case 30:a.v&&uc(a.v)&&(c="SR="+N(a,a.v.hb,3))}c&&(c+=" ");return c}function fj(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=ej(a,"T")+ej(a,"N")+ej(a,"Z")+ej(a,"V")+ej(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Lc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
function Xg(a,b,c,d,e){var f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],t=Da(n,l,a.Lc);0>t&&n.splice(-(t+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Lg:b,G:c,xd:d,ja:e,Jc:f})}function gj(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.G>>>0,h=f.xd;if(e>=g&&e<g+h){e=Da(f.Jc,[e-g],a.Lc);0<=e?hj(a,b,e,d):c&&(e=~e,hj(a,b,e-1,d),hj(a,b,e,d));break}}return d}
function hj(a,b,c,d){var e={},f=a.I[b].Jc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ja[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function ij(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Ei(a)||a.i("no variables"),!0;if(!c[2])return Ei(a,c[1]);if(!c[3])return delete a.ca[c[1]],!0;b=Ai(a,c[3]);return void 0!==b?(a.ca[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
function jj(a,b,c){var d=null;if(b=Qi(a,b,!0)){a.ba(b);var e=gj(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.G-e[1])&&(g=" + "+v(f)),f=e[0]+" ("+N(a,e[1])+")"+g,c&&a.i(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.G)&&(g=" - "+v(f)),f=e[4]+" ("+N(a,e[5])+")"+g,c&&a.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
function Xi(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trm\tdump misc registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=!1,e=a.b;null==c&&(c=!0);if(b&&1<b.length){var f=b[1];if("m"==f)d=!0;else{var g=f.indexOf("=");if(0<g)b=f.substr(g+1),f=f.substr(0,g);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}g=Ai(a,b);if(void 0===g)return;b=f.toUpperCase();switch(b){case "SP":case "R6":e.u[6]=g&65535;break;case "PC":case "R7":Wd(e,
g);a.K=Y(e.u[7]);break;case "N":e.X=g?32768:0;break;case "Z":e.Z=g?0:1;break;case "V":e.W=g?32768:0;break;case "C":e.V=g?65536:0;break;case "PS":md(e,g);break;case "IR":kd(e,g);break;case "ER":e.oa=g;d=!0;break;case "SL":e.fb=g|255;break;case "MMR0":gd(e,g);d=!0;break;case "MMR3":jd(e,g);d=!0;break;case "AR":a.v&&(d=a.v,rc(d,d.Da=g));d=!0;break;case "DR":a.v&&(d=a.v,$b(d,d.Bb=g));d=!0;break;case "SR":if(a.v&&uc(a.v)){sc(a.v,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.u[b]=
g);a.K=Y(e.u[7]);break;case "N":e.X=g?32768:0;break;case "Z":e.Z=g?0:1;break;case "V":e.W=g?32768:0;break;case "C":e.V=g?65536:0;break;case "PS":md(e,g);break;case "IR":kd(e,g);break;case "ER":e.oa=g;d=!0;break;case "SL":e.gb=g|255;break;case "MMR0":gd(e,g);d=!0;break;case "MMR3":jd(e,g);d=!0;break;case "AR":a.v&&(d=a.v,rc(d,d.Da=g));d=!0;break;case "DR":a.v&&(d=a.v,$b(d,d.Bb=g));d=!0;break;case "SR":if(a.v&&uc(a.v)){sc(a.v,g);d=!0;break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){e.u[b]=
g&65535;break}a.i("unknown register: "+f);return}a.B.za();a.i("updated registers:")}}a.i(fj(a,d));c&&(a.K=Y(e.u[7]),Yi(a,N(a,a.K.G)))}}function kj(a,b){b=va(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):Di(a,null,c[2].charCodeAt(0)):Ai(a,b,!0)}
function lj(a,b,c){if("?"==c)a.i("trace commands:"),a.i("\tt [#]\ttrace # instructions"),a.i("\ttr [#]\ttrace # instructions with register updates"),a.i("\ttc [#]\ttrace # cycles"),a.i("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=Ci(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.ub=b;Sa(c,function(){return tb(a,!0)&&a.qb(e,d,!1)},function(){a.v&&a.v.stop();a.B.za(-1);tb(a,!1)})}}
function lj(a,b,c){if("?"==c)a.i("trace commands:"),a.i("\tt [#]\ttrace # instructions"),a.i("\ttr [#]\ttrace # instructions with register updates"),a.i("\ttc [#]\ttrace # cycles"),a.i("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=Ci(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.vb=b;Sa(c,function(){return tb(a,!0)&&a.rb(e,d,!1)},function(){a.v&&a.v.stop();a.B.za(-1);tb(a,!1)})}}
function Yi(a,b,c,d){if(b=Qi(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ci(a,c.substr(1)),null!=c&&(d=c);else{d=Qi(a,c,!0);if(!d||d.G<b.G)return;e=d.G-b.G;if(256<e){a.i("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=zb(a,!1)||a.P?a.J:null;var g=null!=f?"cycles":null,h=gj(a,b),l=b.G;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=dj(a,b,g,f);a.i(f);a.K=b;e-=b.G-l;c++}}}
function cj(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.T&&(a.i("ended assemble at "+N(a,a.S.G)),a.K=a.S,a.T=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.na=null;if(Ab(a)&&0<b.length){a.T&&(b="a "+N(a,a.S.G)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}switch(g[0].charAt(0)){case "a":var t=
Qi(a,g[1],!0);if(t)if(a.S=t,void 0===g[2])a.i("begin assemble at "+N(a,t.G)),a.T=!0,a.B.za();else{var r;a.i("not supported yet");r=[];if(r.length){for(var u=0;u<r.length;u++)a.Rb(t,r[u],1);a.i(dj(a,a.S))}}break;case "b":a:{var z=g[0],A=g[1],C=b;if("?"==A)a.i("breakpoint commands:"),a.i("\tbp [#]\tset exec breakpoint at addr #"),a.i("\tbr [#]\tset read breakpoint at addr #"),a.i("\tbw [#]\tset write breakpoint at addr #"),a.i("\tbc [#]\tclear breakpoint at addr #"),a.i("\tbl\tlist all breakpoints"),
a.i("\tbn [#]\tbreak after # instruction(s)");else{var ta=z.charAt(1);if("l"==ta){var Va;Va=0+bj(a,a.f);Va+=bj(a,a.N);(Va+=bj(a,a.F))||a.i("no breakpoints")}else if("n"==ta)a.wa=Ci(a,A),a.i("break after "+a.wa+" instruction(s)");else if(void 0===A)a.i("missing breakpoint address");else{var S=Y();if("*"!=A&&(S=Qi(a,A,!0),!S))break a;"c"==ta?null==S.G?(Gi(a),a.i("all breakpoints cleared")):$i(a,a.f,S)||$i(a,a.N,S)||$i(a,a.F,S)||a.i("breakpoint missing: "+N(a,S.G)):null!=S.G&&(Ui(a,S,C),"p"==ta?a.vb(a.f,
S):"r"==ta?a.vb(a.N,S):"w"==ta?a.vb(a.F,S):a.i("unknown breakpoint command: "+ta))}}}break;case "c":a.bb&&(a.bb.value="");break;case "d":a:{var ub,Ma=g[0],wa=g[1],Xa=g[2],Ej=g[3];if("?"==wa){var vb="";for(ub in Gb)a.Pa[ub]&&(vb&&(vb+=","),vb+=ub);vb+=",state,symbols";a.i("dump memory commands:");a.i("\tda [a] dump info for address a");a.i("\tdb [a] [n] dump n bytes at address a");a.i("\tdw [a] [n] dump n words at address a");a.i("\tdd [a] [n] dump n dwords at address a");a.i("\tds [a] [n] dump n words at address a as JSON");
a.i("\tdh [p] [n] dump n instructions from history position p");vb.length&&a.i("dump extension commands:\n\t"+vb)}else if("state"==wa){var ih=mj(a.B,!0);"console"==Xa?console.log(ih):(a.bb&&(a.bb.value=""),a.i(ih))}else if("symbols"==wa)for(var ee=0;ee<a.I.length;ee++){var fe=a.I[ee],wb;for(wb in fe.ja)if("."!=wb.charAt(0)){var jh=fe.ja[wb].o;if(void 0!==jh){var kh=fe.ja[wb].l;kh&&(wb=kh);a.i(N(a,jh)+" "+wb)}}}else{if("d"==Ma){for(ub in Gb)if(g[1]==ub){var lh=a.Pa[ub];lh?(g.shift(),g.shift(),lh(g)):
a.i("no dump registered for "+wa);break a}wa||(Ma=a.Vb||"dw")}else a.Vb=Ma;if("dh"==Ma){var mh=wa,nh=Xa,oh="",ph=0,la=a.da,xa=a.H;if(xa.length){var ga=+mh||a.sb,bc=+nh||10;isNaN(ga)?ga=bc:oh="more ";ga>xa.length&&(a.i("note: only "+xa.length+" available"),ga=xa.length);la-=ga;0>la&&(null==xa[xa.length-1].G?(ga=la+ga,la=0):la+=xa.length);var ge=[];"call"==nh&&(bc=1E5,ge=["CALL"]);for(void 0!==mh&&a.i(ga+" instructions earlier:");0<bc&&la!=a.da;){var qh=xa[la++];if(null==qh.G)break;var cc=Y(qh.G),Fj=
ga--,rh=dj(a,cc,"history",Fj);(!ge.length||0<=rh.indexOf(ge[0]))&&a.i(rh);cc.oc&&(la+=cc.oc,bc-=cc.oc,ga-=cc.oc);la>=xa.length&&(la=0);a.sb=ga;ph++;bc--}}ph||(a.i("no "+oh+"history available"),a.sb=void 0)}else{var ya=Qi(a,wa);if(ya)if("da"==Ma){var ha=a.b,he=ya.G,za,I=[];if(ha.ca){var sh=ha.A<<1,Uc=he>>13;7<Uc&&(sh|=1);ha.Ma&ha.Ec[ha.A]||(Uc&=7);var th=he&8191,uh=ha.ga[ha.A][Uc]<<6;za=uh+th&ha.S;3932160<=za&&(za=ha.Ia(za));I.push(za);I.push(th);I.push(sh);I.push(Uc&7);I.push(uh);I.push(ha.S)}else za=
a.i("\tbn [#]\tbreak after # instruction(s)");else{var ta=z.charAt(1);if("l"==ta){var Va;Va=0+bj(a,a.f);Va+=bj(a,a.N);(Va+=bj(a,a.F))||a.i("no breakpoints")}else if("n"==ta)a.wa=Ci(a,A),a.i("break after "+a.wa+" instruction(s)");else if(void 0===A)a.i("missing breakpoint address");else{var S=Y();if("*"!=A&&(S=Qi(a,A,!0),!S))break a;"c"==ta?null==S.G?(Gi(a),a.i("all breakpoints cleared")):$i(a,a.f,S)||$i(a,a.N,S)||$i(a,a.F,S)||a.i("breakpoint missing: "+N(a,S.G)):null!=S.G&&(Ui(a,S,C),"p"==ta?a.wb(a.f,
S):"r"==ta?a.wb(a.N,S):"w"==ta?a.wb(a.F,S):a.i("unknown breakpoint command: "+ta))}}}break;case "c":a.cb&&(a.cb.value="");break;case "d":a:{var ub,Ma=g[0],wa=g[1],Xa=g[2],Ej=g[3];if("?"==wa){var vb="";for(ub in Gb)a.Pa[ub]&&(vb&&(vb+=","),vb+=ub);vb+=",state,symbols";a.i("dump memory commands:");a.i("\tda [a] dump info for address a");a.i("\tdb [a] [n] dump n bytes at address a");a.i("\tdw [a] [n] dump n words at address a");a.i("\tdd [a] [n] dump n dwords at address a");a.i("\tds [a] [n] dump n words at address a as JSON");
a.i("\tdh [p] [n] dump n instructions from history position p");vb.length&&a.i("dump extension commands:\n\t"+vb)}else if("state"==wa){var ih=mj(a.B,!0);"console"==Xa?console.log(ih):(a.cb&&(a.cb.value=""),a.i(ih))}else if("symbols"==wa)for(var ee=0;ee<a.I.length;ee++){var fe=a.I[ee],wb;for(wb in fe.ja)if("."!=wb.charAt(0)){var jh=fe.ja[wb].o;if(void 0!==jh){var kh=fe.ja[wb].l;kh&&(wb=kh);a.i(N(a,jh)+" "+wb)}}}else{if("d"==Ma){for(ub in Gb)if(g[1]==ub){var lh=a.Pa[ub];lh?(g.shift(),g.shift(),lh(g)):
a.i("no dump registered for "+wa);break a}wa||(Ma=a.Vb||"dw")}else a.Vb=Ma;if("dh"==Ma){var mh=wa,nh=Xa,oh="",ph=0,la=a.da,xa=a.H;if(xa.length){var ga=+mh||a.tb,bc=+nh||10;isNaN(ga)?ga=bc:oh="more ";ga>xa.length&&(a.i("note: only "+xa.length+" available"),ga=xa.length);la-=ga;0>la&&(null==xa[xa.length-1].G?(ga=la+ga,la=0):la+=xa.length);var ge=[];"call"==nh&&(bc=1E5,ge=["CALL"]);for(void 0!==mh&&a.i(ga+" instructions earlier:");0<bc&&la!=a.da;){var qh=xa[la++];if(null==qh.G)break;var cc=Y(qh.G),Fj=
ga--,rh=dj(a,cc,"history",Fj);(!ge.length||0<=rh.indexOf(ge[0]))&&a.i(rh);cc.oc&&(la+=cc.oc,bc-=cc.oc,ga-=cc.oc);la>=xa.length&&(la=0);a.tb=ga;ph++;bc--}}ph||(a.i("no "+oh+"history available"),a.tb=void 0)}else{var ya=Qi(a,wa);if(ya)if("da"==Ma){var ha=a.b,he=ya.G,za,I=[];if(ha.ca){var sh=ha.A<<1,Uc=he>>13;7<Uc&&(sh|=1);ha.Ma&ha.Ec[ha.A]||(Uc&=7);var th=he&8191,uh=ha.ga[ha.A][Uc]<<6;za=uh+th&ha.S;3932160<=za&&(za=ha.Ia(za));I.push(za);I.push(th);I.push(sh);I.push(Uc&7);I.push(uh);I.push(ha.S)}else za=
he&65535,57344<=za&&(za|=ha.ab),I.push(za);a.i(ua("",19)+oa(ya.G,17,3)+" "+p(ya.G,8));1<I.length&&(a.i(ua("",24)+oa(I[1],13,3)+" "+p(I[1],8)),a.i("+ "+Mi[I[2]]+"PAR["+I[3]+"]: "+oa(I[4],22,3)+" "+p(I[4],8)),a.i("& MMU MASK: "+oa(I[5],22,3)+" "+p(I[5],8)),a.i("= PHYSICAL: "+oa(I[0],22,3)+" "+p(I[0],8)))}else{var dc=0,ie=!1,je="ds"==Ma;Xa&&(ie=!0,"l"==Xa.charAt(0)&&(ie=!1,Xa=Xa.substr(1)||Ej),dc=Ci(a,Xa)>>>0,65536<dc&&(dc=65536));for(var Ya="dd"==Ma?4:"db"==Ma?1:2,Vc=(ie?dc-ya.G:Ya*dc)||128,ke=
je?16:a.ma,Gj=(Vc+ke-1)/ke|0||1,Za="";Gj--&&0<Vc;){for(var $a="",le="",wa=N(a,ya.G),Wc=ke,ec=0,fc=0;0<Wc&&0<Vc;){var xb=1,Xc=1==Ya?a.dc(ya,xb):a.xa(ya,xb=2),ec=ec|Xc<<(fc<<3),fc=fc+xb;fc==Ya&&(je?($a&&($a+=","),$a+="0x"+q(ec,2*Ya)):($a+=N(a,ec,Ya),$a+=1==Ya?9==Wc?"-":" ":" "),ec=fc=0);Wc-=xb;for(Vc-=xb;1==Ya&&xb--;)var me=Xc&255,le=le+(32<=me&&128>me?String.fromCharCode(me):"."),Xc=Xc>>8}Za&&(Za+="\n");Za=je?Za+($a+","):Za+(wa+": "+$a+(0==Wc?" "+le:""))}Za&&a.i(Za);a.Wa=ya}}}}break;case "e":if("else"==
g[0])break;var yb,ne,oe,pe,qe=g[0],re=g[1];"eb"==qe?(yb=1,ne=255,oe=a.dc,pe=a.Rb):"e"==qe||"ew"==qe?(yb=2,ne=65535,oe=a.xa,pe=a.Eb):re=null;if(null==re)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Yc=Qi(a,re);if(Yc)for(var Zc=2;Zc<g.length;Zc++){var gc=Ai(a,g[Zc]);if(void 0===gc){a.i("unrecognized value: "+g[Zc]);break}gc&~ne&&a.i("warning: "+q(gc)+" exceeds "+yb+"-byte value");a.i("changing "+N(a,Yc.G)+(K(a,16)?
"":" from "+N(a,oe.call(a,Yc),yb))+" to "+N(a,gc,yb));pe.call(a,Yc,gc,yb)}}break;case "g":a:{var vh=g[1],Hj=b;if(void 0!==vh){var se=Qi(a,vh,!0);if(!se)break a;Ui(a,se,Hj);a.vb(a.f,se,!0)}a.hb(!0,c)}break;case "h":a.C.U?(c||a.i("halting"),a.aa()):zb(a,!0)||c||a.i("already halted");break;case "i":if("if"==g[0]){var te;var hc=b.substr(2),hc=va(hc);Ai(a,hc)?(c||a.i("true: "+hc),te=!0):(c||a.i("false: "+hc),te=!1);te||(d=!1);break}f=!0;break;case "k":var Ij=g[0];if("?"==g[1])a.i("stack trace commands:"),
"":" from "+N(a,oe.call(a,Yc),yb))+" to "+N(a,gc,yb));pe.call(a,Yc,gc,yb)}}break;case "g":a:{var vh=g[1],Hj=b;if(void 0!==vh){var se=Qi(a,vh,!0);if(!se)break a;Ui(a,se,Hj);a.wb(a.f,se,!0)}a.ib(!0,c)}break;case "h":a.C.U?(c||a.i("halting"),a.aa()):zb(a,!0)||c||a.i("already halted");break;case "i":if("if"==g[0]){var te;var hc=b.substr(2),hc=va(hc);Ai(a,hc)?(c||a.i("true: "+hc),te=!0):(c||a.i("false: "+hc),te=!1);te||(d=!1);break}f=!0;break;case "k":var Ij=g[0];if("?"==g[1])a.i("stack trace commands:"),
a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var ue=0,ve=Y(),ic=Y(a.b.u[6]);for(a.i("stack trace for "+N(a,ic.G));10>ue;){for(var ab=null,Jj=256;65536>ic.G>>>0;){ve.G=a.xa(ic,2);if(null==ic.G||!Jj--)break;if(!(ve.G&1)){for(var Kj=a,$c=ve,wh=null,jc=$c.G,xh=jc,we=1;6>=we&&jc;we++){if(2<we){$c.G=jc;var ad=dj(Kj,$c);if(0<=ad.indexOf("JSR")){var yh=ad.indexOf(" ");if(jc+(ad.indexOf(" ",yh+1)-yh-1)/2==xh){wh=ad;break}}}jc-=2}$c.G=xh;if(ab=wh)break}}if(!ab||null==ab)break;
var zh=null;if("ks"==Ij){var Ah=ab.match(/[0-9A-F]+$/);Ah&&(zh=jj(a,Ah[0]))}ab=ua(ab,50)+" ;"+(zh||"stack="+N(a,ic.G));a.i(ab);ue++}ue||a.i("no return addresses found")}break;case "l":if("ln"==g[0]){jj(a,g[1],!0);break}f=!0;break;case "m":a:{var Aa,Ba=null,J=g[1];"?"==J&&(J=void 0);if(void 0!==J){var Na=0;if("all"==J)Na=1879046143,J=null;else if("on"==J)Ba=!0,J=null;else if("off"==J)Ba=!1,J=null;else{"keys"==J&&(J="key");"kbd"==J&&(J="keyboard");for(Aa in Gb)if(J==Aa){Na=Gb[Aa];Ba=!!(a.pa&Na);break}if(!Na){a.i("unknown message category: "+
J);break a}}if(Na)if("on"==g[2])a.pa|=Na,Ba=!0;else if("off"==g[2]&&(a.pa&=~Na,Ba=!1,1073741824==Na)){for(var Bh=1E3<=a.Y.length?a.Y.length-1E3:0;Bh<a.Y.length;)a.i(a.Y[Bh++]);a.Y=[]}}var Lj=0,kc="";for(Aa in Gb)if(!J||J==Aa){var Mj=!!(a.pa&Gb[Aa]);if(null===Ba||Ba==Mj)kc&&(kc+=","),++Lj%10||(kc+="\n\t"),"key"==Aa&&(Aa="keys"),kc+=Aa}void 0===J&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==Ba?Ba?"messages on: ":"messages off: ":"message categories:\n\t")+
(kc||"none"));Hi(a)}break;case "p":if("print"==g[0]){kj(a,b.substr(5));break}var Nj=g[0];if("?"==g[1])a.i("step commands:"),a.i("\tp\tstep over instruction"),a.i("\tpr\tstep over instruction with register update");else{var Ch="pr"==Nj?1:0,Dh=1+Ch;if(a.P)a.i("step in progress");else{var bd=Y(a.b.u[7]),lc=a.xa(bd);3==lc||4==lc||34816==(lc&65280)||35072==(lc&65280)?(a.P=Dh,Ri(bd,2)):2048==(lc&65024)&&(dj(a,bd),a.P=Dh);a.P?(a.vb(a.f,bd,!0),a.hb()||(a.B&&a.B.pb(),a.P=0)):lj(a,Ch?"tr":"t")}}break;case "r":if("reset"==
(kc||"none"));Hi(a)}break;case "p":if("print"==g[0]){kj(a,b.substr(5));break}var Nj=g[0];if("?"==g[1])a.i("step commands:"),a.i("\tp\tstep over instruction"),a.i("\tpr\tstep over instruction with register update");else{var Ch="pr"==Nj?1:0,Dh=1+Ch;if(a.P)a.i("step in progress");else{var bd=Y(a.b.u[7]),lc=a.xa(bd);3==lc||4==lc||34816==(lc&65280)||35072==(lc&65280)?(a.P=Dh,Ri(bd,2)):2048==(lc&65024)&&(dj(a,bd),a.P=Dh);a.P?(a.wb(a.f,bd,!0),a.ib()||(a.B&&a.B.qb(),a.P=0)):lj(a,Ch?"tr":"t")}}break;case "r":if("reset"==
b){a.B&&a.B.reset();break}Xi(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var mc=+g[2];if(8==mc||10==mc||16==mc)a.ma=mc;else{a.i("invalid base: "+mc);break}}a.i("default base: "+a.ma);break;case "cs":var nc;void 0!==g[3]&&(nc=+g[3]);switch(g[2]){case "int":a.b.Nb=nc;break;case "start":a.b.Xb=nc;break;case "stop":a.b.Ob=nc;break;default:a.i("unknown cs option");break a}void 0!==nc&&Id(a.b);a.i("checksums "+(a.b.C.Jb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Md(a.b,+g[2])||a.i("warning: using 1x multiplier, previous target not reached"));
a.i("target speed: "+(a.b.Ab.toFixed(2)+"Mhz")+" ("+a.b.nb+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":lj(a,g[0],g[1]);break;case "u":Yi(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ij(a,
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.i("PDPjs version 1.30.6 ("+a.b.mb+",RELEASE"+(Db?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){kj(a,b.substr(1));break}var xe="commands:",ye;for(ye in Ji)xe+="\n"+ua(ye,9)+Ji[ye];Qe(a)||(xe+="\nnote: history disabled if no exec breakpoints");a.i(xe);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(Eh){a.i("debugger error: "+(Eh.stack||Eh.message)),d=!1}return d}
a.i("target speed: "+(a.b.Ab.toFixed(2)+"Mhz")+" ("+a.b.ob+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":lj(a,g[0],g[1]);break;case "u":Yi(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ij(a,
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.i("PDPjs version 1.30.6 ("+a.b.nb+",RELEASE"+(Db?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){kj(a,b.substr(1));break}var xe="commands:",ye;for(ye in Ji)xe+="\n"+ua(ye,9)+Ji[ye];Qe(a)||(xe+="\nnote: history disabled if no exec breakpoints");a.i(xe);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(Eh){a.i("debugger error: "+(Eh.stack||Eh.message)),d=!1}return d}
function Kd(a,b,c){b=yi(a,b,c);for(var d in b)if(!cj(a,b[+d]))return!1;return!0}eb(function(){for(var a=G(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Fi(d);F(d,c)}});
function nj(a,b,c){y.call(this,"Computer",a,nj,33554432);this.C.la=!1;oj(this,b);this.K=Gd(this,"autoPower",a);this.g=0;this.Y=a.busWidth||a.buswidth;this.f=pj;this.I=null;this.F=this.S=!1;this.ca=Gd(this,"url")||"";(Math.random()+.1).toString(36);this.B=qj(this);if(this.b=sb("CPU",this.id)){this.j=sb("Debugger",this.id);this.w=new wc({id:this.jb+".bus",busWidth:this.Y},this.b,this.j);var d,e=qb(this.id);if((this.v=sb("Panel",this.id))&&this.v.bb)for(b=0;b<e.length;b++)d=e[b],d.M=this.v.M,d.i=this.v.i,
d.bb=this.v.bb;this.i("PDPjs v1.30.6\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ha&&d.Ha(this,this.w,this.b,this.j);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Gd(this,"state")||(f=!0,a.state))b=this.N=a,f||(this.F=!0,this.f=pj),this.f&&(this.J=
function nj(a,b,c){y.call(this,"Computer",a,nj,33554432);this.C.la=!1;oj(this,b);this.K=Gd(this,"autoPower",a);this.g=0;this.Y=a.busWidth||a.buswidth;this.f=pj;this.I=null;this.F=this.S=!1;this.ca=Gd(this,"url")||"";(Math.random()+.1).toString(36);this.B=qj(this);if(this.b=sb("CPU",this.id)){this.j=sb("Debugger",this.id);this.w=new wc({id:this.kb+".bus",busWidth:this.Y},this.b,this.j);var d,e=qb(this.id);if((this.v=sb("Panel",this.id))&&this.v.cb)for(b=0;b<e.length;b++)d=e[b],d.M=this.v.M,d.i=this.v.i,
d.cb=this.v.cb;this.i("PDPjs v1.30.6\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ha&&d.Ha(this,this.w,this.b,this.j);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Gd(this,"state")||(f=!0,a.state))b=this.N=a,f||(this.F=!0,this.f=pj),this.f&&(this.J=
new U(this,"1.30.6"),rj(this.J)?b=null:delete this.J);!b&&this.f&&(b=sj(this))&&(this.F=!0);if(b){var g=this;Ga(b,null,!0,function(a,b,c){c?(g.H=null,g.F=!1,g.M("Unable to load machine state from server (error "+c+(b?": "+va(b):"")+")")):(g.I=b,g.S=!0);L(g)})}else L(this);this.D.power||(this.K=!0);!c&&this.K&&tj(this,this.Yb)}else x("Unable to find CPU component")}D(nj);var pj=0;
function oj(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){x(d.message+" ("+c+")")}}a.T=b}function Gd(a,b,c){var d=b.toLowerCase(),d=jb[b]||jb[d];void 0===d&&a.T&&(d=a.T[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function tj(a,b,c){for(var d=qb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ab(f)){Ab(f,function(){tj(a,b,c)});return}}b.call(a,c)}
function uj(a,b){var c=new U(a,"1.30.6","validate");if(rj(c)&&vj(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.M("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=nj.prototype;
k.Yb=function(a){void 0===a&&(a=this.f||(this.I?1:pj));if(!this.g){this.g++;var b=!1,c=!1;this.P=!1;var d=this.J||new U(this,"1.30.6");if(-1==a)b=!0;else if(a>pj){if(rj(d,this.I)){this.A=new U(this,"1.30.6","failsafe");rj(this.A)&&(wj(this,d),a=2,xj(this.A));this.A.set("timestamp",Fa());yj(this.A);var e=this.f&&!this.F;if(1==a||Ja("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=vj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?rj(d,g):("error"==
f&&"no machine state"!=g?(this.M("Error: "+g),"unable to verify user"==g&&(Pa("user",""),this.B=null)):this.i(f+": "+g),xj(d),rj(d)?(c=vj(d),e=!0):c=!1))}e&&uj(this,c?d:null)}else 2==a&&d.clear()}else uj(this);delete this.I;delete this.J}e=qb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=zj(this,g,d,b,c));b=[d,a,c];-1!=a?tj(this,this.Mc,b):this.Mc(b)}};
function zj(a,b,c,d,e){if(!b.C.la){b.C.la=!0;if(b.La){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.La(f,d)&&f&&(x("Unable to restore state for "+b.type),a.N&&!a.S?(c.clear(),a.f=pj,window&&window.location.reload()):a.P=!0,b.La(null),e=!1)}if(!d&&b.Dc)for(a=b.Dc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
k.Mc=function(a){var b=a[0],c=0>a[1];a=a[2];this.da=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(zj(this,this.b,b,c,a),this.za(),this.b.wb());this.P&&(wj(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.g=0};
k.Mc=function(a){var b=a[0],c=0>a[1];a=a[2];this.da=!0;this.C.la=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(zj(this,this.b,b,c,a),this.za(),this.b.bb());this.P&&(wj(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.g=0};
function wj(a,b){if(Ja("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.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.6"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ga("http://www.pcjs.org/api/v1/report",d,!0)}}
function mj(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new U(a,"1.30.6"),g=new U(a,"1.30.6","validate"),h=Fa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.6");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ka&&(c&&a.b.aa(),d=a.b.Ka(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.la=!1,!1===d&&(e=null)));for(var h=qb(a.id),l=0;l<h.length;l++){var m=h[l];m.C.la&&(m.Ka&&(d=m.Ka(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.C.la=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&Aj(a,a.B,f.toString()),yj(g)&&yj(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.C.la=!1,b=a.D.power)&&(b.textContent="Power");a.g=0;return e}
@ -345,12 +346,12 @@ k.reset=function(){this.w&&this.w.reset&&(H(this,"Resetting "+this.w.type),this.
k.stop=function(a,b){for(var c=qb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.za(-1)};
k.za=function(a){if(this.b){var b=this.b,c=a||0,d=b.D.speed;d&&(0>=c||30<=(b.Vb+=c))&&(d.textContent=b.C.U?b.Aa.toFixed(2)+"Mhz":"Stopped",b.Vb=0)}if(this.v&&(b=this.v,a=a||0,b.F)){c=b.b.C.U;d=!!(b.b.L&8);if(0>=a||60<=(b.A+=a)){for(var e=0;e<b.b.u.length;e++)Ub(b,"R"+e,b.b.u[e]);e=ld(b.b);Ub(b,"PS",e);Ub(b,"NF",e&8?1:0,1);Ub(b,"ZF",e&4?1:0,1);Ub(b,"VF",e&2?1:0,1);Ub(b,"CF",e&1?1:0,1);b.A=0}rc(b,0<a&&c&&!d?b.b.Ib:b.Da);$b(b,b.Bb);a=b.b;a=a.ca?a.Ma&16?1:2:4;tc(b,"B22",a&1);tc(b,"B18",a&2);tc(b,"B16",
a&4)}};
k.ya=function(a,b,c){var d=this;switch(b){case "power":return this.D[b]=c,c.onclick=function(){d.g||(d.C.la?mj(d,!1,!0):tj(d,d.Yb))},!0;case "reset":return this.D[b]=c,c.onclick=function(){if(d.C.la&&!d.g)if(d.f&&!d.H){var a=Ja("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");mj(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.pc=!0),d.Yb(pj),d.pc=!1)}else d.reset(),d.b&&d.b.wb()},!0;case "save":if(qa(Ia(),"pcjs.org"))c.parentNode.removeChild(c);else return this.D[b]=
k.ya=function(a,b,c){var d=this;switch(b){case "power":return this.D[b]=c,c.onclick=function(){d.g||(d.C.la?mj(d,!1,!0):tj(d,d.Yb))},!0;case "reset":return this.D[b]=c,c.onclick=function(){if(d.C.la&&!d.g)if(d.f&&!d.H){var a=Ja("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");mj(d,a,!0);!a&&d.N?window&&window.location.reload():(a||(d.pc=!0),d.Yb(pj),d.pc=!1)}else d.reset(),d.b&&d.b.bb()},!0;case "save":if(qa(Ia(),"pcjs.org"))c.parentNode.removeChild(c);else return this.D[b]=
c,c.onclick=function(){var a=qj(d,!0);if(a){var b=!!(d.f&&!d.H||d.N),c=mj(d,b);b?Aj(d,a,c):d.M("Resume disabled, machine state not saved")}},!0}return!1};
function qj(a,b){var c=a.B;c||((c=Oa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Bj(a,c))||a.M("The user ID is invalid.")):b&&a.M("Browser local storage is not available"));return c}
function Bj(a,b){a.B=null;b=Ga(Ia()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Pa("user",b.data),a.B=b.data)}catch(d){x(d.message+" ("+c+")")}return a.B}function sj(a){var b=null;a.B&&(b=Ia()+"/api/v1/user?req=load&user="+a.B+"&state="+Cj(a,"1.30.6"));return b}
function Aj(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Cj(a,"1.30.6");d.data=c;b=Ga(Ia()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.M("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.M(c),Pa("user",""),a.B=null)}}
function Hh(a){var b;a=qb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.pb=function(a){if(this.bb){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.bb.focus();!a&&window&&window.scrollTo(b,c)}};eb(function(){for(var a=G(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=E(c),c=G(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=E(f),g=new nj(g,d,!0);F(g,f);g.K&&tj(g,g.Yb)}});
function Hh(a){var b;a=qb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.qb=function(a){if(this.cb){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.cb.focus();!a&&window&&window.scrollTo(b,c)}};eb(function(){for(var a=G(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=E(c),c=G(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=E(f),g=new nj(g,d,!0);F(g,f);g.K&&tj(g,g.Yb)}});
Ua.show.push(function(){for(var a=G(document,"pdp11","computer"),b=0;b<a.length;b++){var c=E(a[b]);(c=sb("Computer",c.id))&&c.da&&!c.C.la&&c.Yb(-1)}});Ua.exit.push(function(){for(var a=G(document,"pdp11","computer"),b=0;b<a.length;b++){var c=E(a[b]);(c=sb("Computer",c.id))&&c.C.la&&mj(c,!(!c.f||c.H),!0)}});function U(a,b,c){this.id=a.id;this.key=Cj(a,b,c);this.j=a.j;xj(this,a.jd)}function Cj(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
U.prototype={constructor:U,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){xj(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
1);c=0}}};function xj(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function yj(a){var b=!0;if(La()){var c=JSON.stringify(a[a.id]);Pa(a.key,c)||(x("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function vj(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){x(c.message||c),b=!1}return b}function rj(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:La()&&(b=Oa(a.key))?(a[a.id]=b,a.b=!0):!1}var Dj=0;

View file

@ -40,7 +40,7 @@ var ia={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[4
function q(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==
e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function ja(a,b){var c="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)c="?"+c;else for(;0<b--;)c=String.fromCharCode((a&7)+48)+c,a>>=3;return""+c}function r(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function ka(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function la(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ma={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})}
function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},qa=Date.now||function(){return+new Date};
function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},qa=Date.now||function(){return+new Date};
function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
function w(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"==
typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}
@ -50,41 +50,41 @@ function ta(){return"http://"+(window?window.location.host:"www.pcjs.org")}funct
function za(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}
function Ca(a,b){var c=null;a="data:application/octet-stream;base64,"+a;b&&(c=document.createElement("a"),"string"!=typeof c.download&&(c=null));c?(c.href=a,c.download=b,document.body.appendChild(c),c.click(),document.body.removeChild(c),b="Check your Downloads folder for "+b+"."):(window.open(a),b="Check your browser for a new window/tab containing the requested data"+(b?" ("+b+")":"")+".");return b}var Da={init:[],show:[],exit:[]},Ea=!1,Fa=!1,Ga=!0;
function Ha(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ia(a){Da.init.push(a)}function Ja(a){if(Ga)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){x(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ka(a){!Ga&&a?(Ga=!0,Ea&&La("init"),Fa&&La("show")):Ga=a}function La(a){Da[a]&&Ja(Da[a])}Ha("onload",function(){Ea=!0;Ja(Da.init)});Ha("onpageshow",function(){Fa=!0;Ja(Da.show)});
Ha(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ja(Da.exit)});function z(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.cc=b.comment;this.Oc=b;b=this.id.indexOf(".");0>b?this.Aa=this.id:(this.Ba=this.id.substr(0,b),this.Aa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Ia:!1,Ib:!1,R:!1,error:!1};this.yb=null;this.o.error=!1;this.j={};this.G=null;this.Mc=d||0;A.push(this)}var Ma=void 0,Na={};
Ha(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ja(Da.exit)});function z(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.cc=b.comment;this.Oc=b;b=this.id.indexOf(".");0>b?this.Aa=this.id:(this.Ba=this.id.substr(0,b),this.Aa=this.id.substr(b+1));this[a]=c;this.m={ready:!1,Ja:!1,Ib:!1,R:!1,error:!1};this.yb=null;this.m.error=!1;this.j={};this.F=null;this.Mc=d||0;A.push(this)}var Ma=void 0,Na={};
if(window){Ma||(Ma=window.location.search.substr(1));for(var Oa,Pa=/\+/g,Qa=/([^&=]+)=?([^&]*)/g;Oa=Qa.exec(Ma);)Na[decodeURIComponent(Oa[1].replace(Pa," "))]=decodeURIComponent(Oa[2].replace(Pa," "))}function Ra(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
function B(a,b){b||(b=z);a.prototype=Ra(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Sa=window.PCjs.Machines||(window.PCjs.Machines={}),A=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},A=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function C(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<A.length;b++){var d=A[b];a&&d.id.indexOf(a)||c.push(d)}return c}
function Ua(a){if(void 0!==a){var b;for(b=0;b<A.length;b++)if(A[b].id===a)return A[b]}return null}function Va(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<A.length;d++)if(c)c==A[d]&&(c=null);else if(!(a!=A[d].type||b&&A[d].id.indexOf(b)))return A[d]}return null}function D(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){x(c.message+" ("+a+")")}return b}
function E(a,b){b=F(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=D(f))&&g.binding&&a.ba(g.type,g.binding,f,g.value),l=k.length}}}}
function F(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
z.prototype={constructor:z,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ba:function(a,b,c){switch(b){case "clear":return this.j[b]||(this.j[b]=c,c.onclick=function(a){return function(){a.j.print&&(a.j.print.value="")}}(this)),!0;case "print":return this.j[b]||(this.kb=this.j[b]=c,c.value="",this.W=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.B=function(a){this.W(a,this.Aa)}),!0;default:return!1}},log:function(){},W:function(){},status:function(a){this.W(this.Aa+": "+a)},B:function(a,b,c){c=c||this.type;b||x((c?c+": ":"")+a)},ka:function(){return this.o.R=!0},ja:function(a,b){b&&(this.o.R=!1);return!0}};function Wa(a,b){a.o.Ib?(a.o.Ia=!1,a.o.Ib=!1):a.o.error?a.W(a.toString()+" error"):a.o.Ia=b}function G(a,b){a.o.error||(a.o.ready=!1!==b,a.o.ready&&(b=a.yb,a.yb=null,b&&b()))}
function Xa(a,b){b&&(a.o.ready?b():a.yb=b);return a.o.ready}function Ya(a,b){a.o.error=!0;a.B(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
z.prototype={constructor:z,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ba:function(a,b,c){switch(b){case "clear":return this.j[b]||(this.j[b]=c,c.onclick=function(a){return function(){a.j.print&&(a.j.print.value="")}}(this)),!0;case "print":return this.j[b]||(this.kb=this.j[b]=c,c.value="",this.U=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.B=function(a){this.U(a,this.Aa)}),!0;default:return!1}},log:function(){},U:function(){},status:function(a){this.U(this.Aa+": "+a)},B:function(a,b,c){c=c||this.type;b||x((c?c+": ":"")+a)},ka:function(){return this.m.R=!0},ja:function(a,b){b&&(this.m.R=!1);return!0}};function Wa(a,b){a.m.Ib?(a.m.Ja=!1,a.m.Ib=!1):a.m.error?a.U(a.toString()+" error"):a.m.Ja=b}function G(a,b){a.m.error||(a.m.ready=!1!==b,a.m.ready&&(b=a.yb,a.yb=null,b&&b()))}
function Xa(a,b){b&&(a.m.ready?b():a.yb=b);return a.m.ready}function Ya(a,b){a.m.error=!0;a.B(b)}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Za="undefined"!==typeof ArrayBuffer,$a={48:"DL11R",52:"DL11X",56:"PC11R",60:"PC11X",64:"KW11",112:"RL11",144:"RK11"};
function ab(a){z.call(this,"Panel",a,ab,512);this.la=this.i=this.c=this.m=this.s=this.u=0;this.A=this.C=this.v=!1;this.F=bb;this.f={};this.b={START:[1,1,!0,!1,this.Vc],STEP:[1,1,!1,!1,this.Wc],ENABLE:[1,1,!1,!1,this.Rc],CONT:[1,1,!0,!1,this.Pc],DEP:[0,0,!0,!1,this.Qc],EXAM:[1,1,!0,!1,this.Sc],LOAD:[1,1,!0,!1,this.Uc],TEST:[0,0,!0,!1,this.Tc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Xc,a]}B(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()};
function ab(a){z.call(this,"Panel",a,ab,512);this.la=this.i=this.c=this.o=this.s=this.u=0;this.A=this.C=this.v=!1;this.G=bb;this.f={};this.b={START:[1,1,!0,!1,this.Vc],STEP:[1,1,!1,!1,this.Wc],ENABLE:[1,1,!1,!1,this.Rc],CONT:[1,1,!0,!1,this.Pc],DEP:[0,0,!0,!1,this.Qc],EXAM:[1,1,!0,!1,this.Sc],LOAD:[1,1,!0,!1,this.Uc],TEST:[0,0,!0,!1,this.Tc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Xc,a]}B(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()};
h.ba=function(a,b,c,d){if(this.l&&this.l.ba(a,b,c,d)||this.a&&this.a.ba(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a,
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.ba.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ka=function(a,b){b||(kb(),this.reset());return!0};h.ja=function(){return!0};
function lb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.f)lb(a,c,null!=b?b:a.f[c])}function mb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.j[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),H(a.a)),c=8==(a.G&&a.G.b||8)?ja(c,d):r(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vc=function(a){a||this.a.o.O||(a=this.a,a.h.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Wc=function(){};h.Rc=function(a){a||H(this.a)};
h.Pc=function(a){if(!a&&!this.a.o.O)if(cb(this,"ENABLE"))pb(this.a);else{a=this.G;var b;if(b=a)a.o.Ia&&(a.o.Ib=!0),b=!a.o.Ia;if(b)Wa(a,!0),a.Ab(0,null),Wa(a,!1);else try{var c=this.a.Ab(1);0<c&&(qb(this.a,c),rb(this.a,c,!0),sb(this.a,c))}catch(d){"number"!=typeof d&&Ya(this.a,d.stack||d.message)}this.stop();this.l&&this.l.za()}};h.Qc=function(a){if(a&&!this.a.o.O)if(this.A&&tb(this),a=ub(this,this.c),this.F==bb)vb(this.h,this.la,a);else{var b=this.a,c=this.la;b.Ra++;b.pc(wb(b,c,4),a);b.Ra--}};
h.Sc=function(a){if(!a&&!this.a.o.O){this.C&&tb(this);if(this.F==bb)a=xb(this.h,this.la);else{a=this.a;var b=this.la;a.Ra++;b=a.lc(wb(a,b,2));a.Ra--;a=b}ub(this,a)}};h.Uc=function(a){a||this.a.o.O||yb(this,this.c)};h.Tc=function(a){if(a)this.v=!0,ib(this,!0);else if(this.v=!1,ib(this),void 0!==this.j.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;jb(this)}};h.Xc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
function tb(a){var b=1145>a.a.Wa?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.h.Ea;cb(a,"STEP")||(b=-b);yb(a,a.la&~c|a.la+b&c)}function yb(a,b){a.la=b&a.h.Ea;b=a.la;for(var c=0;22>c;c++)zb(a,"A"+c,b&1<<c)}function ub(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)zb(a,"D"+c,b&1<<c);return a.i}function zb(a,b,c){a.f[b]=c;a.v||lb(a,b,c)}h.stop=function(){yb(this,this.a.g[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.Yc=function(a,b){return(b?this.m:this.c)&65535};h.Zd=function(a){this.m=a};
b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.ba.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ka=function(a,b){b||(kb(),this.reset());return!0};h.ja=function(){return!0};
function lb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.f)lb(a,c,null!=b?b:a.f[c])}function mb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.j[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),H(a.a)),c=8==(a.F&&a.F.b||8)?ja(c,d):r(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))}
function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vc=function(a){a||this.a.m.O||(a=this.a,a.h.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Wc=function(){};h.Rc=function(a){a||H(this.a)};
h.Pc=function(a){if(!a&&!this.a.m.O)if(cb(this,"ENABLE"))pb(this.a);else{a=this.F;var b;if(b=a)a.m.Ja&&(a.m.Ib=!0),b=!a.m.Ja;if(b)Wa(a,!0),a.Ab(0,null),Wa(a,!1);else try{var c=this.a.Ab(1);0<c&&(qb(this.a,c),rb(this.a,c,!0),sb(this.a,c))}catch(d){"number"!=typeof d&&Ya(this.a,d.stack||d.message)}this.stop();this.l&&this.l.za()}};h.Qc=function(a){if(a&&!this.a.m.O)if(this.A&&tb(this),a=ub(this,this.c),this.G==bb)vb(this.h,this.la,a);else{var b=this.a,c=this.la;b.Sa++;b.pc(wb(b,c,4),a);b.Sa--}};
h.Sc=function(a){if(!a&&!this.a.m.O){this.C&&tb(this);if(this.G==bb)a=xb(this.h,this.la);else{a=this.a;var b=this.la;a.Sa++;b=a.lc(wb(a,b,2));a.Sa--;a=b}ub(this,a)}};h.Uc=function(a){a||this.a.m.O||yb(this,this.c)};h.Tc=function(a){if(a)this.v=!0,ib(this,!0);else if(this.v=!1,ib(this),void 0!==this.j.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;jb(this)}};h.Xc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
function tb(a){var b=1145>a.a.Wa?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.h.Fa;cb(a,"STEP")||(b=-b);yb(a,a.la&~c|a.la+b&c)}function yb(a,b){a.la=b&a.h.Fa;b=a.la;for(var c=0;22>c;c++)zb(a,"A"+c,b&1<<c)}function ub(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)zb(a,"D"+c,b&1<<c);return a.i}function zb(a,b,c){a.f[b]=c;a.v||lb(a,b,c)}h.stop=function(){yb(this,this.a.g[7])};h.setData=function(a,b){b?this.o=a:this.i=a};h.Yc=function(a,b){return(b?this.o:this.c)&65535};h.Zd=function(a){this.o=a};
var Ab={},gb=(Ab[65400]=[null,null,ab.prototype.Yc,ab.prototype.Zd,"CNSW"],Ab);function kb(){for(var a=!1,b=F(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=D(d),f=Ua(e.id);f||(a=!0,f=new ab(e));E(f,d);a&&G(f)}}Ia(kb);
function Bb(a,b,c){z.call(this,"Bus",a,Bb,16);this.a=b;this.G=c;this.L=a.busWidth||16;this.v=1<<this.L;this.Ea=this.v-1;this.c=Cb;this.b=Math.log2(this.c);this.J=this.c>>2;this.l=this.c-1;this.u=this.v/this.c|0;this.Da=[];this.m=0;this.s=!1;this.A=[];this.Bc=[Db,Eb,Fb,Gb];a=new I(this);Hb(a,this.G);this.h=Array(this.u);this.f=Array(this.u);for(b=0;b<this.u;b++)this.h[b]=this.f[b]=a;a=this.v-Cb;Ib(this,a,Cb,Jb,this);this.I=this.F=(a&this.Ea)>>>this.b;this.C=0;this.i=this.Ea;G(this)}B(Bb);
function Bb(a,b,c){z.call(this,"Bus",a,Bb,16);this.a=b;this.F=c;this.L=a.busWidth||16;this.v=1<<this.L;this.Fa=this.v-1;this.c=Cb;this.b=Math.log2(this.c);this.J=this.c>>2;this.l=this.c-1;this.u=this.v/this.c|0;this.Da=[];this.o=0;this.s=!1;this.A=[];this.Bc=[Db,Eb,Fb,Gb];a=new I(this);Hb(a,this.F);this.h=Array(this.u);this.f=Array(this.u);for(b=0;b<this.u;b++)this.h[b]=this.f[b]=a;a=this.v-Cb;Ib(this,a,Cb,Jb,this);this.I=this.G=(a&this.Fa)>>>this.b;this.C=0;this.i=this.Fa;G(this)}B(Bb);
var Cb=8192,Kb=Cb-1;function Db(a,b){var c=-1,d=this.controller,e=d.Da[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Da[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
function Eb(a,b,c){var d=!1,e=this.controller,f=e.Da[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Da[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Fb(a,b){var c=-1,d=this.controller;a=d.Da[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535}
function Gb(a,b,c){var d=!1,e=this.controller;a=e.Da[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Lb(a,b){if(b!=a.C){for(var c=0;c<a.u;c++)a.f[c]=a.h[c];a.C=0;a.i=a.Ea;b&&(a.C=b,b=1<<b,a.i=b-1,b-=Cb,a.I=(b&a.i)>>>a.b,a.f[a.I]=a.h[a.F])}}Bb.prototype.reset=function(){for(var a=0;a<this.A.length;a++)this.A[a]();Lb(this,16)};Bb.prototype.ka=function(a,b){b||this.reset();return!0};
function Ib(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.b;0<g&&k<a.h.length;){var l=a.h[k],m=k*a.c,p=a.c-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ha)return l.nb+=l.Ha-f,l.Ha=f,!0;if(f>=l.Ha+l.nb){p=l.size-(f-m);p>g&&(p=g);l.nb=f-l.Ha+p;f=m+a.c;g-=p;k++;continue}}return Mb(1,f,g)}f=new I(a,f,p,a.c,d,e);Hb(f,a.G,l);a.h[k++]=f;f=m+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Nb[d]+" at "+ja(b)),!0):Mb(2,b,c)}function Ob(a,b){return a.f[(b&a.i)>>>a.b].Nb(b&a.l,b)}
function Pb(a,b){return a.f[(b&a.i)>>>a.b].aa(b&a.l,b)}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].Cb(b&a.l,c,b)}function xb(a,b){a.s=!1;a.m++;b=a.h[(b&a.Ea)>>>a.b].kc(b&a.l,b);a.m--;return b}function Rb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ea)>>>a.b].Ub(b&a.l,c&255,b);a.m--}function vb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ea)>>>a.b].oc(b&a.l,c&65535,b);a.m--}
function Sb(a){for(var b=0,c=[],d=0;d<a.u;d++){var e=a.h[d];if(e.wa||e.Hc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;l[k++]=p-g;l[k++]=m;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Tb(a){for(var b=Ub,c=0,d=0;d<a.h.length;d++){var e=a.h[d];e.type==b&&(c=e.Ha+e.nb)}return c}
function Gb(a,b,c){var d=!1,e=this.controller;a=e.Da[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Lb(a,b){if(b!=a.C){for(var c=0;c<a.u;c++)a.f[c]=a.h[c];a.C=0;a.i=a.Fa;b&&(a.C=b,b=1<<b,a.i=b-1,b-=Cb,a.I=(b&a.i)>>>a.b,a.f[a.I]=a.h[a.G])}}Bb.prototype.reset=function(){for(var a=0;a<this.A.length;a++)this.A[a]();Lb(this,16)};Bb.prototype.ka=function(a,b){b||this.reset();return!0};
function Ib(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.b;0<g&&k<a.h.length;){var l=a.h[k],m=k*a.c,p=a.c-(f-m);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ia)return l.nb+=l.Ia-f,l.Ia=f,!0;if(f>=l.Ia+l.nb){p=l.size-(f-m);p>g&&(p=g);l.nb=f-l.Ia+p;f=m+a.c;g-=p;k++;continue}}return Mb(1,f,g)}f=new I(a,f,p,a.c,d,e);Hb(f,a.F,l);a.h[k++]=f;f=m+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Nb[d]+" at "+ja(b)),!0):Mb(2,b,c)}function Ob(a,b){return a.f[(b&a.i)>>>a.b].Nb(b&a.l,b)}
function Pb(a,b){return a.f[(b&a.i)>>>a.b].aa(b&a.l,b)}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].Cb(b&a.l,c,b)}function xb(a,b){a.s=!1;a.o++;b=a.h[(b&a.Fa)>>>a.b].kc(b&a.l,b);a.o--;return b}function Rb(a,b,c){a.s=!1;a.o++;a.h[(b&a.Fa)>>>a.b].Ub(b&a.l,c&255,b);a.o--}function vb(a,b,c){a.s=!1;a.o++;a.h[(b&a.Fa)>>>a.b].oc(b&a.l,c&65535,b);a.o--}
function Sb(a){for(var b=0,c=[],d=0;d<a.u;d++){var e=a.h[d];if(e.wa||e.Hc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var m=e[g],p=g+1;p<e.length&&e[p]===m;)p++;l[k++]=p-g;l[k++]=m;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Tb(a){for(var b=Ub,c=0,d=0;d<a.h.length;d++){var e=a.h[d];e.type==b&&(c=e.Ia+e.nb)}return c}
function Vb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var m=b&Kb;if(void 0!==a.Da[m])return x("I/O address already registered: "+r(b,8,!0)),!1;a.Da[m]=[d,e,f,g,l||"unknown",k||16,!1]}return!0}
function fb(a,b,c,d){for(var e in c){var f=+e+(d||0),g=c[e];if(!(g[6]&&g[6]>a.a.Wa)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&m&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var t=g[4],v=g[5]||1,y=0;y<v;y++,f+=2)if(t&&1<v&&(t=g[4]+y),!Vb(a,f,f,k,l,m,p,g[7]||b.Mc,t||b.Aa))return!1}}return!0}
function hb(a,b){a.A.push(b)}function J(a,b,c){a.s=!0;a.m||(c&&(a.a.X|=c),K(a.a,4,0,b))}function Wb(a){var b=a.s;a.s=!1;return b}function Mb(a,b,c){x("Memory block error ("+a+": "+r(b)+","+r(c)+")");return!1}function L(a){z.call(this,"Device",a,L,256);this.b={Rf:0,Sb:-1}}B(L);h=L.prototype;
h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.G=d;var e=this;this.b.Sb=Xb(c,function(){e.b.Va|=128;e.b.Va&64&&M(e.a,e.b.Ua);e.l&&e.l.za(1);Yb(e.a,e.b.Sb,1E3/60)});this.b.Ua=$b(c,64,6,524288);fb(b,this,ac);hb(b,this.reset.bind(this));G(this)};h.reset=function(){this.b.Va=128;Yb(this.a,this.b.Sb,1E3/60,!0)};h.ed=function(){return this.b.Va};h.fe=function(a){this.b.Va=a&192;this.b.Va&64||bc(this.a,this.b.Ua)};h.gd=function(){var a=this.a,b=a.Y;b&57344||(b=b&-3199|a.eb<<5|a.fb<<1);return b};
h.he=function(a){cc(this.a,a&-129|this.a.Y&128)};h.hd=function(){var a=this.a;a.Y&57344||(a.ub=a.A>>16&65535);a=a.ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.jd=function(){var a=this.a;a.Y&57344||(a.vb=a.A&65535);return a.vb};h.kd=function(){return this.a.ya};h.ie=function(a){var b=this.a;1170>b.Wa&&(a&=-49);b.ya!=a&&(b.ya=a,b.Pa=a&16?4194303:262143,dc(b))};h.Sd=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};
function hb(a,b){a.A.push(b)}function J(a,b,c){a.s=!0;a.o||(c&&(a.a.X|=c),K(a.a,4,0,b))}function Wb(a){var b=a.s;a.s=!1;return b}function Mb(a,b,c){x("Memory block error ("+a+": "+r(b)+","+r(c)+")");return!1}function L(a){z.call(this,"Device",a,L,256);this.b={Rf:0,Sb:-1}}B(L);h=L.prototype;
h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.F=d;var e=this;this.b.Sb=Xb(c,function(){e.b.Va|=128;e.b.Va&64&&M(e.a,e.b.Ua);e.l&&e.l.za(1);Yb(e.a,e.b.Sb,1E3/60)});this.b.Ua=$b(c,64,6,524288);fb(b,this,ac);hb(b,this.reset.bind(this));G(this)};h.reset=function(){this.b.Va=128;Yb(this.a,this.b.Sb,1E3/60,!0)};h.ed=function(){return this.b.Va};h.fe=function(a){this.b.Va=a&192;this.b.Va&64||bc(this.a,this.b.Ua)};h.gd=function(){var a=this.a,b=a.Y;b&57344||(b=b&-3199|a.eb<<5|a.fb<<1);return b};
h.he=function(a){cc(this.a,a&-129|this.a.Y&128)};h.hd=function(){var a=this.a;a.Y&57344||(a.ub=a.A>>16&65535);a=a.ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.jd=function(){var a=this.a;a.Y&57344||(a.vb=a.A&65535);return a.vb};h.kd=function(){return this.a.ya};h.ie=function(a){var b=this.a;1170>b.Wa&&(a&=-49);b.ya!=a&&(b.ya=a,b.Qa=a&16?4194303:262143,dc(b))};h.Sd=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};
h.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.Ld=function(a){return this.a.H[1][a>>1&7]};h.Je=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Jd=function(a){return this.a.H[1][(a>>1&7)+8]};h.He=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.Kd=function(a){return this.a.Z[1][a>>1&7]};h.Ie=function(a,b){b=b>>1&7;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.Id=function(a){return this.a.Z[1][(a>>1&7)+8]};
h.Ge=function(a,b){b=(b>>1&7)+8;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.dd=function(a){return this.a.H[0][a>>1&7]};h.ee=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[0][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.cd=function(a){return this.a.Z[0][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.ad=function(a){return this.a.Z[0][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};
h.Rd=function(a){return this.a.H[3][a>>1&7]};h.Pe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Pd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Ne=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Qd=function(a){return this.a.Z[3][a>>1&7]};h.Oe=function(a,b){b=b>>1&7;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Od=function(a){return this.a.Z[3][(a>>1&7)+8]};h.Me=function(a,b){b=(b>>1&7)+8;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Ya=function(a){a&=7;return this.a.D&2048?this.a.Fa[a]:this.a.g[a]};
h.bb=function(a,b){b&=7;this.a.D&2048?this.a.Fa[b]=a:this.a.g[b]=a};h.pd=function(){return this.a.D&49152?this.a.qa[0]:this.a.g[6]};h.ne=function(a){this.a.D&49152?this.a.qa[0]=a:this.a.g[6]=a};h.sd=function(){return this.a.g[7]};h.qe=function(a){this.a.g[7]=a};h.Za=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Fa[a]};h.cb=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Fa[b]=a};h.qd=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[1]};
h.Rd=function(a){return this.a.H[3][a>>1&7]};h.Pe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Pd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Ne=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Qd=function(a){return this.a.Z[3][a>>1&7]};h.Oe=function(a,b){b=b>>1&7;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Od=function(a){return this.a.Z[3][(a>>1&7)+8]};h.Me=function(a,b){b=(b>>1&7)+8;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Ya=function(a){a&=7;return this.a.D&2048?this.a.Ga[a]:this.a.g[a]};
h.bb=function(a,b){b&=7;this.a.D&2048?this.a.Ga[b]=a:this.a.g[b]=a};h.pd=function(){return this.a.D&49152?this.a.qa[0]:this.a.g[6]};h.ne=function(a){this.a.D&49152?this.a.qa[0]=a:this.a.g[6]=a};h.sd=function(){return this.a.g[7]};h.qe=function(a){this.a.g[7]=a};h.Za=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Ga[a]};h.cb=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Ga[b]=a};h.qd=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[1]};
h.oe=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.qa[1]=a};h.rd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[3]};h.pe=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.qa[3]=a};h.$c=function(a){return this.a.Pb[a-65504>>1]};h.ae=function(a,b){this.a.Pb[b-65504>>1]=a};h.jc=function(a){return 65520==a?(Tb(this.h)>>6)-1:0};h.nc=function(){};h.Nd=function(){return 1};h.Le=function(){};h.Zc=function(){return this.a.X};h.$d=function(){this.a.X=0};h.fd=function(){return this.a.Ob};
h.ge=function(a,b){b&1||(a&=255);this.a.Ob=a};h.ld=function(a,b){return b?0:this.a.mb};h.je=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.w|=1}b.mb=a};h.Md=function(a,b){return b?0:this.a.$a&65280};h.Ke=function(a){this.a.$a=a|255};h.od=function(){return ec(this.a)};h.me=function(a){fc(this.a,a&-1793|ec(this.a)&1792)};h.mc=function(){};
var N={},ac=(N[61568]=[null,null,L.prototype.Sd,L.prototype.Qe,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Ld,L.prototype.Je,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.Jd,L.prototype.He,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.Kd,L.prototype.Ie,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.Id,L.prototype.Ge,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.dd,L.prototype.ee,"KIPDR",8,1145,64],N[62672]=[null,null,L.prototype.bd,L.prototype.ce,"KDPDR",8,1145,64],N[62688]=
@ -94,173 +94,174 @@ L.prototype.bb,"R4SET0"],N[65477]=[null,null,L.prototype.Ya,L.prototype.bb,"R5SE
L.prototype.cb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Za,L.prototype.cb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.qd,L.prototype.oe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.rd,L.prototype.pe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.$c,L.prototype.ae,"CTRL",8,1170],N[65520]=[null,null,L.prototype.jc,L.prototype.nc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.jc,L.prototype.nc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Nd,L.prototype.Le,"SYSID",1,1170],N[65526]=
[null,null,L.prototype.Zc,L.prototype.$d,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.fd,L.prototype.ge,"MB",1,1170],N[65530]=[null,null,L.prototype.ld,L.prototype.je,"PIR"],N[65532]=[null,null,L.prototype.Md,L.prototype.Ke,"SL"],N[65534]=[null,null,L.prototype.od,L.prototype.me,"PSW"],N);
Ia(function(){for(var a=F(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=D(d);switch(c.type){case "default":c=new L(c);E(c,d);break;case "pc11":c=new gc(c);E(c,d);break;case "rl11":c=new O(c);E(c,d);break;case "rk11":c=new P(c),E(c,d)}}});var hc;if(Za){var ic=new ArrayBuffer(2);(new DataView(ic)).setUint16(0,256,!0);hc=256===(new Uint16Array(ic))[0]}else hc=!1;var jc=hc;
function I(a,b,c,d,e,f){this.h=a;this.id=kc+=2;this.a=null;this.Ha=b;this.nb=c;this.size=d||0;this.type=e||lc;this.l=e==mc;this.controller=null;Hb(this);this.wa=this.Hc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],nc(this,f.Bc);else if(Za)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.j=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),nc(this,jc?oc:pc);else{a=this.a=Array(this.size>>
function I(a,b,c,d,e,f){this.h=a;this.id=kc+=2;this.a=null;this.Ia=b;this.nb=c;this.size=d||0;this.type=e||lc;this.l=e==mc;this.controller=null;Hb(this);this.wa=this.Hc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],nc(this,f.Bc);else if(Za)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.j=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),nc(this,jc?oc:pc);else{a=this.a=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;nc(this,rc)}else nc(this)}var lc=0,Ub=1,mc=2,Jb=4,Nb=["NONE","RAM","ROM","VID","H/W"],kc=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Za)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Za)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.wa=!0}return!1},u:function(a,b){J(this.h,b,32);return 255},f:function(a,b,c){J(this.h,c,32)},v:function(a,b){return this.Nb(a++,b++)|
this.Nb(a,b)<<8},A:function(a,b,c){this.Bb(a++,b&255,c++);this.Bb(a,b>>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ma:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.wa=!0},Ca:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
b>>8);this.wa=!0},F:function(a,b){return this.I(a,b)},U:function(a,b){return this.kc(a,b)},Ba:function(a,b,c){this.l?this.f(a,b,c):this.Ub(a,b,c)},ua:function(a,b,c){this.l?this.f(a,b,c):this.oc(a,b,c)},C:function(a){return this.j[a]},J:function(a){return this.j[a]},S:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},fa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},Aa:function(a,b){this.j[a]=b;this.wa=!0},sa:function(a,b){this.j[a]=b;this.wa=!0},na:function(a,b,c){a&1&&J(this.h,
c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Hb(a,b,c){a.G=b;a.i=a.m=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.m=c.m)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.m||(a.Bb=!a.l&&b[1]||a.f,a.Cb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ub=b[1]||a.f,a.oc=b[3]||a.A}function sc(a,b,c){c&&a.i||(a.Nb=b[0]||a.u,a.aa=b[2]||a.v);if(c||void 0===c)a.I=b[0]||a.u,a.kc=b[2]||a.v}function nc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)}
var vc=[],rc=[I.prototype.L,I.prototype.ma,I.prototype.ga,I.prototype.Ca],tc=[I.prototype.F,I.prototype.Ba,I.prototype.U,I.prototype.ua];if(Za)var pc=[I.prototype.C,I.prototype.Aa,I.prototype.S,I.prototype.na],oc=[I.prototype.J,I.prototype.sa,I.prototype.fa,I.prototype.va];
function wc(a,b){z.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Eb=0;this.rb=b;this.na=c;this.Jb=Math.round(this.rb/1E4)/100;this.Na=this.Jb*this.na;this.o.O=!1;this.o.Rb=!1;this.o.Ta=a.autoStart;this.o.wb=!1;this.pb=this.Qa=0;this.qb=a.csStart;this.gb=a.csInterval;this.hb=a.csStop;this.L=[];this.ic=this.Xd.bind(this);G(this)}B(wc);var xc=["power","reset"];h=wc.prototype;
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.G=d;this.u=a.u;for(b=0;b<xc.length;b++)(c=this.j[xc[b]])&&this.l.ba(null,xc[b],c);a=yc(a,"autoStart");null!=a&&(this.o.Ta="true"==a?!0:"false"==a?!1:!!a);void 0===this.j.run&&(this.o.Ta=!0);G(this)};h.Wb=function(){};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){this.Wb();if(a&&this.restore){zc(this);if(!this.restore(a))return!1;Ac(this)}else this.reset();this.W("No debugger detected")}return!0};
h.ja=function(a){return a?this.save():!0};h.Ta=function(){return this.o.O?!0:this.o.Ta?(pb(this),!0):!1};h.dc=function(){return 0};function Ac(a){void 0===a.qb&&(a.qb=0);void 0===a.gb&&(a.gb=-1);void 0===a.hb&&(a.hb=-1);a.o.wb=0<=a.qb&&0<a.gb;a.o.wb&&(a.pb=0,a.Qa=a.qb-a.ua)}function sb(a,b){if(a.o.wb){var c=!1;a.pb=a.pb+a.dc()|0;a.Qa-=b;0>=a.Qa&&(a.Qa+=a.gb,c=!0);0<=a.hb&&a.hb<=Bc(a)&&(a.gb=a.hb=-1,Ac(a),H(a),c=!0);c&&a.W(Bc(a)+" cycles: checksum="+r(a.pb))}}
h.ba=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.R)a=!0;else{var b=null,c,k=C(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.o.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.o.R);c++);c==k.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.o.ready?"powered yet":"ready yet"+(b.yb?" (waiting for notification)":""))+".");a=!1}a&&(d.o.O?H(d):pb(d))},!0;case "speed":return this.j[b]=
c,!0;case "setSpeed":return this.j[b]=c,c.onclick=function(){Cc(d,d.na<<1,!0)},c.textContent=this.Na.toFixed(2)+"Mhz",!0}return!1};h.za=function(a){this.l&&this.l.za(a)};function rb(a,b,c){a.ua+=b;c&&(a.ma=a.a=a.J=0)}function Dc(a,b){var c=1;b&&1<a.na&&a.Ma&&(c=a.Ma/a.Jb);a.fc=Math.round(1E3/30);a.sb=Math.floor(a.rb/30*c);b||(a.ib=a.sb);a.Kb=0}function Bc(a){return a.ua+a.ga+a.ma-a.a}function zc(a){a.Ma=0;a.hc=0;a.ua=a.ga=a.ma=a.a=a.J=0;Ac(a);Cc(a,1)}
function Cc(a,b,c){if(void 0!==b){.8>a.Ma/a.Na&&(b=1);a.na=b;b=a.Jb*a.na;if(a.Na!=b){a.Na=b;b=a.Na.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.W("target speed: "+b)}c&&a.l&&Ec(a.l)}rb(a,a.ga);a.ga=0;a.fa=qa();a.sa=0;Dc(a)}function Xb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.rb*a.na/1E3*c|0,a.o.O&&(c+=Fc(a)),a.L[b][0]=c)}
b>>8);this.wa=!0},G:function(a,b){return this.I(a,b)},V:function(a,b){return this.kc(a,b)},Ba:function(a,b,c){this.l?this.f(a,b,c):this.Ub(a,b,c)},ua:function(a,b,c){this.l?this.f(a,b,c):this.oc(a,b,c)},C:function(a){return this.j[a]},J:function(a){return this.j[a]},S:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},fa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},Aa:function(a,b){this.j[a]=b;this.wa=!0},sa:function(a,b){this.j[a]=b;this.wa=!0},na:function(a,b,c){a&1&&J(this.h,
c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Hb(a,b,c){a.F=b;a.i=a.o=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.o=c.o)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.o||(a.Bb=!a.l&&b[1]||a.f,a.Cb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ub=b[1]||a.f,a.oc=b[3]||a.A}function sc(a,b,c){c&&a.i||(a.Nb=b[0]||a.u,a.aa=b[2]||a.v);if(c||void 0===c)a.I=b[0]||a.u,a.kc=b[2]||a.v}function nc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)}
var vc=[],rc=[I.prototype.L,I.prototype.ma,I.prototype.ga,I.prototype.Ca],tc=[I.prototype.G,I.prototype.Ba,I.prototype.V,I.prototype.ua];if(Za)var pc=[I.prototype.C,I.prototype.Aa,I.prototype.S,I.prototype.na],oc=[I.prototype.J,I.prototype.sa,I.prototype.fa,I.prototype.va];
function wc(a,b){z.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Eb=0;this.rb=b;this.na=c;this.Jb=Math.round(this.rb/1E4)/100;this.Oa=this.Jb*this.na;this.m.O=!1;this.m.Rb=!1;this.m.Ea=a.autoStart;this.m.wb=!1;this.pb=this.Ra=0;this.qb=a.csStart;this.gb=a.csInterval;this.hb=a.csStop;this.L=[];this.ic=this.Xd.bind(this);G(this)}B(wc);var xc=["power","reset"];h=wc.prototype;
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.F=d;this.u=a.u;for(a=0;a<xc.length;a++)(b=this.j[xc[a]])&&this.l.ba(null,xc[a],b);G(this)};h.Wb=function(){};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};
h.ka=function(a,b){var c=yc(this.l,"autoStart");null!=c?this.m.Ea="true"==c?!0:"false"==c?!1:!!c:null==this.m.Ea&&(this.m.Ea=void 0===this.j.run);if(!b){this.Wb();if(a&&this.restore){zc(this);if(!this.restore(a))return!1;Ac(this)}else this.reset();this.U("No debugger detected");this.m.Ea?this.U("CPU will auto-start"):this.U("CPU will not be auto-started, click Run to start")}return!0};h.ja=function(a){return a?this.save():!0};h.Ea=function(){return this.m.O?!0:this.m.Ea?(pb(this),!0):!1};h.dc=function(){return 0};
function Ac(a){void 0===a.qb&&(a.qb=0);void 0===a.gb&&(a.gb=-1);void 0===a.hb&&(a.hb=-1);a.m.wb=0<=a.qb&&0<a.gb;a.m.wb&&(a.pb=0,a.Ra=a.qb-a.ua)}function sb(a,b){if(a.m.wb){var c=!1;a.pb=a.pb+a.dc()|0;a.Ra-=b;0>=a.Ra&&(a.Ra+=a.gb,c=!0);0<=a.hb&&a.hb<=Bc(a)&&(a.gb=a.hb=-1,Ac(a),H(a),c=!0);c&&a.U(Bc(a)+" cycles: checksum="+r(a.pb))}}
h.ba=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.m.R)a=!0;else{var b=null,c,k=C(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.m.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.m.R);c++);c==k.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.m.ready?"powered yet":"ready yet"+(b.yb?" (waiting for notification)":""))+".");a=!1}a&&(d.m.O?H(d):pb(d))},!0;case "speed":return this.j[b]=
c,!0;case "setSpeed":return this.j[b]=c,c.onclick=function(){Cc(d,d.na<<1,!0)},c.textContent=this.Oa.toFixed(2)+"Mhz",!0}return!1};h.za=function(a){this.l&&this.l.za(a)};function rb(a,b,c){a.ua+=b;c&&(a.ma=a.a=a.J=0)}function Dc(a,b){var c=1;b&&1<a.na&&a.Na&&(c=a.Na/a.Jb);a.fc=Math.round(1E3/30);a.sb=Math.floor(a.rb/30*c);b||(a.ib=a.sb);a.Kb=0}function Bc(a){return a.ua+a.ga+a.ma-a.a}function zc(a){a.Na=0;a.hc=0;a.ua=a.ga=a.ma=a.a=a.J=0;Ac(a);Cc(a,1)}
function Cc(a,b,c){if(void 0!==b){.8>a.Na/a.Oa&&(b=1);a.na=b;b=a.Jb*a.na;if(a.Oa!=b){a.Oa=b;b=a.Oa.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.U("target speed: "+b)}c&&a.l&&Ec(a.l)}rb(a,a.ga);a.ga=0;a.fa=qa();a.sa=0;Dc(a)}function Xb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.rb*a.na/1E3*c|0,a.m.O&&(c+=Fc(a)),a.L[b][0]=c)}
function qb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ma-=a.a;a.a=a.J=0;b&&(a.ma=0);return c}
h.Xd=function(){if(this.o.O){this.Kb>=this.rb&&Dc(this,!0);this.jb=0;this.ob=qa();if(this.sa){var a=this.ob-this.sa;a>this.fc&&(this.fa+=a,this.fa>this.ob&&(this.fa=this.ob))}try{do{for(var b,c=this.o.wb?1:this.sb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Ab(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.jb+=b;this.ga+=b;sb(this,b);qb(this,b);this.ib-=b;if(0>=this.ib){this.ib+=this.sb;15<=++this.hc&&(this.za(),this.hc=0);break}}while(this.o.O)}catch(f){H(this);
this.l&&this.l.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.O){a=setTimeout;b=this.ic;this.sa=qa();c=this.fc;this.jb&&(c=Math.round(c*this.jb/this.sb));c-=this.sa-this.ob;if(d=this.sa-this.fa)this.Ma=Math.round(this.ga/(10*d))/100,864E5<=d&&(this.ua=0,Cc(this));if(0>c||this.Ma<this.Na)-1E3>c&&(this.fa-=c),c=0;this.Kb+=this.jb;this.sa+=c;a(b,c)}}};
function pb(a){var b;a.o.error?(a.W(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.O)a.W(a.toString()+" busy");else{Cc(a);a.o.O=!0;a.o.Rb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.fa,Bc(a));setTimeout(a.ic,0)}}h.Ab=function(){return 0};function H(a){var b=!1;if(a.o.O){Fc(a);rb(a,a.ga);a.ga=0;a.o.O=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(qa(),Bc(a));b=!0;a.G||a.status("Stopped")}a.o.complete=void 0;return b}
function Gc(a){this.Wa=+a.model||1170;this.bc=a.addrReset||0;wc.call(this,a,6666667);this.tb=0;this.ec=255;1120==this.Wa?(this.decode=Hc.bind(this),this.Ca=this.Fc,this.tb=8,this.ec=-1):(this.decode=Ic.bind(this),this.Ca=this.Gc);Jc(this);this.Ra=0;this.I=null;this.Db=[];this.o.complete=!1}B(Gc,wc);h=Gc.prototype;h.Wb=function(){for(var a=192,b=0;b<this.Db.length;b++){var c=this.Db[b];0>c.Tb&&(c.Tb=a,a+=4)}};
h.reset=function(){this.status("Model "+this.Wa);this.o.O&&H(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)};
function Jc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.bc,-1,-2,-3,-4,-5,-6,-7,-8];a.Fa=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.v=0;a.Nc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Z=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.ab=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Pb=[0,0,0,0,0,0,0,0];a.Ob=0;a.w=0;a.C=a.F=0;a.c=a.b=a.Hb=0;a.va=-1;ob(a)}function ob(a){a.Y=0;a.ub=0;a.vb=0;a.ya=0;a.X=0;a.mb=0;a.$a=255;a.Oa=0;a.eb=0;a.fb=0;a.Pa=262143;a.Sa=0;a.A=0;a.I=null;a.h&&(dc(a),a.Lc=Tb(a.h))}function dc(a){a.Oa?(a.U=65536,a.Fb=a.ya&16?4186112:253952,a.S=a.Jc,a.aa=a.Td,a.Cb=a.Re,Lb(a.h,a.ya&16?22:18)):(a.U=0,a.Fb=57344,a.S=a.Ic,a.aa=a.lc,a.Cb=a.pc,Lb(a.h,16))}
function cc(a,b){b&=-3073;if(a.Y!=b){b&57344&&!(a.Y&57344)&&(a.ub=a.A>>16&65535,a.vb=a.A&65535);a.Y=b;a.eb=(b&96)>>5;a.fb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Oa!=c&&(a.Oa=c,dc(a))}}function Kc(a,b,c){a.bc=b;a.h.reset();ob(a);Q(a,b);fc(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.o.O||pb(a)}else a.G?H(a)||a.G.h():!1===c&&H(a);!a.o.O&&a.u&&a.u.stop()}h.dc=function(){return 0};
h.save=function(){var a=new R(this);a.set(0,[this.g,this.Fa,this.qa,this.ab,this.Pb,this.X,this.Ob,this.mb,this.$a,ec(this),this.va,this.v,this.w,this.Y,this.ub,this.vb,this.ya,this.eb,this.fb,this.H,this.Z,this.Oa,this.Pa,this.Sa,this.A]);a.set(1,[this.ua,this.na]);a.set(2,Sb(this.h));return a.data()};
h.restore=function(a){var b=a[1];this.ua=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.h[d];if(!f||!f.restore(e)){x("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function S(a){return a.m&65536?1:0}function Lc(a){return a.s&32768?8:0}function Mc(a){var b=a.g[7];a.A=b;var c=a.aa(b);a.g[7]=b+2&65535;return c}
h.Xd=function(){if(this.m.O){this.Kb>=this.rb&&Dc(this,!0);this.jb=0;this.ob=qa();if(this.sa){var a=this.ob-this.sa;a>this.fc&&(this.fa+=a,this.fa>this.ob&&(this.fa=this.ob))}try{do{for(var b,c=this.m.wb?1:this.sb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Ab(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.jb+=b;this.ga+=b;sb(this,b);qb(this,b);this.ib-=b;if(0>=this.ib){this.ib+=this.sb;15<=++this.hc&&(this.za(),this.hc=0);break}}while(this.m.O)}catch(f){H(this);
this.l&&this.l.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.m.O){a=setTimeout;b=this.ic;this.sa=qa();c=this.fc;this.jb&&(c=Math.round(c*this.jb/this.sb));c-=this.sa-this.ob;if(d=this.sa-this.fa)this.Na=Math.round(this.ga/(10*d))/100,864E5<=d&&(this.ua=0,Cc(this));if(0>c||this.Na<this.Oa)-1E3>c&&(this.fa-=c),c=0;this.Kb+=this.jb;this.sa+=c;a(b,c)}}};
function pb(a){var b;a.m.error?(a.U(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.m.O)a.U(a.toString()+" busy");else{Cc(a);a.m.O=!0;a.m.Rb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.fa,Bc(a));a.F||a.status("Started");setTimeout(a.ic,0)}}h.Ab=function(){return 0};function H(a){var b=!1;if(a.m.O){Fc(a);rb(a,a.ga);a.ga=0;a.m.O=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(qa(),Bc(a));b=!0;a.F||a.status("Stopped")}a.m.complete=void 0;return b}
function Gc(a){this.Wa=+a.model||1170;this.bc=a.addrReset||0;wc.call(this,a,6666667);this.tb=0;this.ec=255;1120==this.Wa?(this.decode=Hc.bind(this),this.Ca=this.Fc,this.tb=8,this.ec=-1):(this.decode=Ic.bind(this),this.Ca=this.Gc);Jc(this);this.Sa=0;this.I=null;this.Db=[];this.m.complete=!1}B(Gc,wc);h=Gc.prototype;h.Wb=function(){for(var a=192,b=0;b<this.Db.length;b++){var c=this.Db[b];0>c.Tb&&(c.Tb=a,a+=4)}};
h.reset=function(){this.status("Model "+this.Wa);this.m.O&&H(this);Jc(this);zc(this);this.m.error=!1;this.parent.reset.call(this)};
function Jc(a){a.o=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.bc,-1,-2,-3,-4,-5,-6,-7,-8];a.Ga=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.v=0;a.Nc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Z=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.ab=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Pb=[0,0,0,0,0,0,0,0];a.Ob=0;a.w=0;a.C=a.G=0;a.c=a.b=a.Hb=0;a.va=-1;ob(a)}function ob(a){a.Y=0;a.ub=0;a.vb=0;a.ya=0;a.X=0;a.mb=0;a.$a=255;a.Pa=0;a.eb=0;a.fb=0;a.Qa=262143;a.Ta=0;a.A=0;a.I=null;a.h&&(dc(a),a.Lc=Tb(a.h))}function dc(a){a.Pa?(a.V=65536,a.Fb=a.ya&16?4186112:253952,a.S=a.Jc,a.aa=a.Td,a.Cb=a.Re,Lb(a.h,a.ya&16?22:18)):(a.V=0,a.Fb=57344,a.S=a.Ic,a.aa=a.lc,a.Cb=a.pc,Lb(a.h,16))}
function cc(a,b){b&=-3073;if(a.Y!=b){b&57344&&!(a.Y&57344)&&(a.ub=a.A>>16&65535,a.vb=a.A&65535);a.Y=b;a.eb=(b&96)>>5;a.fb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Pa!=c&&(a.Pa=c,dc(a))}}function Kc(a,b,c){a.bc=b;a.h.reset();ob(a);Q(a,b);fc(a,0);if(c){for(b=2;5>=b;b++)a.g[b]=0;a.m.O||pb(a)}else a.F?H(a)||a.F.h():!1===c&&H(a);!a.m.O&&a.u&&a.u.stop()}h.dc=function(){return 0};
h.save=function(){var a=new R(this);a.set(0,[this.g,this.Ga,this.qa,this.ab,this.Pb,this.X,this.Ob,this.mb,this.$a,ec(this),this.va,this.v,this.w,this.Y,this.ub,this.vb,this.ya,this.eb,this.fb,this.H,this.Z,this.Pa,this.Qa,this.Ta,this.A]);a.set(1,[this.ua,this.na]);a.set(2,Sb(this.h));return a.data()};
h.restore=function(a){var b=a[1];this.ua=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.J){for(var f=0,g=Array(b.J),k=0;k<e.length-1;)for(var l=e[k++],m=e[k++];l--;)g[f++]=m;e=g}f=b.h[d];if(!f||!f.restore(e)){x("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function S(a){return a.o&65536?1:0}function Lc(a){return a.s&32768?8:0}function Mc(a){var b=a.g[7];a.A=b;var c=a.aa(b);a.g[7]=b+2&65535;return c}
function Nc(a,b){var c=a.g[7];a.g[7]=c+b&65535;return c}function Q(a,b){a.g[7]=b&65535}function $b(a,b,c,d){c={Tb:b,Xa:c,message:d||0,next:null};c.name=$a[b];a.Db.push(c);return c}function bc(a,b){var c=a.I;if(c==b)a.I=b.next;else for(;c;){var d=c.next;if(d==b){c.next=d.next;break}c=d}a.I&&(a.w|=1)}function M(a,b){if(b!=a.I){var c=a.I;if(!c||c.Xa<=b.Xa)b.next=c,a.I=b;else{do{var d=c.next;if(!d||d.Xa<=b.Xa){b.next=d;c.next=b;break}c=d}while(c)}}a.w|=1}
function Oc(a){return a.w&64?(K(a,168,64,-6),!0):a.w&32?(K(a,4,32,-5),!0):a.w&16?(K(a,12,16,-7),!0):!1}function ec(a){return a.D=a.D&63728|Lc(a)|(a.i&65535?0:4)|(a.f&32768?2:0)|S(a)}function fc(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.m=b<<16;if((b^a.D)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.g[c];a.g[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.D>>14&3;a.v!=c&&(a.qa[c]=a.g[6],a.g[6]=a.qa[a.v]);a.D=b;a.w&=-3;a.w|=a.I?2:1}h.ca=function(a){this.s=this.i=a;this.f=0};
h.Ga=function(a,b){this.s=this.i=this.m=a;this.f=b||0};function Pc(a,b){a.s=a.i=a.m=b;a.f=a.s^a.m>>1}function Qc(a,b,c,d){a.s=a.i=a.m=b;a.f=(c^d)&(d^b)}function K(a,b,c,d){if(!a.Ra){0>a.va?a.va=ec(a):a.v||(d=-4);-4==d&&(a.w&256&&(d=-1),a.w|=256,a.X|=4,a.g[6]=b=4);if(-1!=d){a.A=b|4143316992;a.v=0;var e=a.aa(b|a.U),f=a.aa(b+2&65535|a.U);fc(a,f&-12289|a.va>>2&12288);Rc(a,a.va);Rc(a,a.g[7]);Q(a,e)}a.a-=5;a.w&=~(c|19);a.w|=129;a.va=-1;-1==d&&H(a);if(-4<=d)throw b;}}
function Oc(a){return a.w&64?(K(a,168,64,-6),!0):a.w&32?(K(a,4,32,-5),!0):a.w&16?(K(a,12,16,-7),!0):!1}function ec(a){return a.D=a.D&63728|Lc(a)|(a.i&65535?0:4)|(a.f&32768?2:0)|S(a)}function fc(a,b){a.s=b<<12;a.i=~b&4;a.f=b<<14;a.o=b<<16;if((b^a.D)&2048)for(var c=a.Ga.length;0<=--c;){var d=a.g[c];a.g[c]=a.Ga[c];a.Ga[c]=d}a.v=b>>14&3;c=a.D>>14&3;a.v!=c&&(a.qa[c]=a.g[6],a.g[6]=a.qa[a.v]);a.D=b;a.w&=-3;a.w|=a.I?2:1}h.ca=function(a){this.s=this.i=a;this.f=0};
h.Ha=function(a,b){this.s=this.i=this.o=a;this.f=b||0};function Pc(a,b){a.s=a.i=a.o=b;a.f=a.s^a.o>>1}function Qc(a,b,c,d){a.s=a.i=a.o=b;a.f=(c^d)&(d^b)}function K(a,b,c,d){if(!a.Sa){0>a.va?a.va=ec(a):a.v||(d=-4);-4==d&&(a.w&256&&(d=-1),a.w|=256,a.X|=4,a.g[6]=b=4);if(-1!=d){a.A=b|4143316992;a.v=0;var e=a.aa(b|a.V),f=a.aa(b+2&65535|a.V);fc(a,f&-12289|a.va>>2&12288);Rc(a,a.va);Rc(a,a.g[7]);Q(a,e)}a.a-=5;a.w&=~(c|19);a.w|=129;a.va=-1;-1==d&&H(a);if(-4<=d)throw b;}}
function Sc(a){var b=Tc(a),c=Tc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);Q(a,b);fc(a,c);a.w&=-17}function Uc(a,b){var c=b>>13&31;31>c&&(b=a.ya&32?a.ab[c]+(b&8190)&4194302:b&-3932161);return b}
function wb(a,b,c){var d,e,f;if(!(c&a.Oa))return f=b&65535,57344<=f&&(f|=a.Fb),f;d=b>>13;a.ya&a.Nc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Z[a.v][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=Uc(a,f));if(a.Ra)return f;f>=a.Lc&&f<a.Fb?(a.X|=32,K(a,4,0,f)):f&1&&!(c&1)&&(a.X|=64,K(a,4,0,f));var g=0;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.H[a.v][d]=e;if(f!=(4194170&a.Pa)||a.v)a.eb=a.v,a.fb=d;g&&(g&57344&&(0<=a.va&&(g|=128),a.Y&57344||(g|=a.Y&4096|a.eb<<5|a.fb<<1,cc(a,a.Y&-61695|g&61694)),K(a,168,64,-2)),a.Y&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Y|=4096,a.Y&512&&(a.w|=64)));return f}function Tc(a){var b=a.aa(a.g[6]|a.U);a.g[6]=a.g[6]+2&65535;return b}function Rc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;a.w&256||a.Ca(4,-2,c);a.Cb(c,b)}
function Vc(a,b,c,d){var e,f,g=d&8?0:a.U;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ca(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ca(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.aa(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ca(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.aa(e)|g;a.a-=8;break;case 6:return e=a.aa(Nc(a,2)),e=e+a.g[c]&65535,6==c&&a.Ca(d,
0,e),a.a-=6,e|g;case 7:return e=a.aa(Nc(a,2)),e=e+a.g[c]&65535,e=a.aa(e|a.U),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fc=function(a,b,c){!this.v&&0>=b&&c<=this.$a&&(this.w|=32)};h.Gc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.$a&&(c<=this.$a-32?K(this,4,0,-4):(this.X|=8,this.w|=32)))};h.Ic=function(a,b,c){a=Vc(this,a,b,c);3932160<=a&&(a=Uc(this,a));return a};h.Jc=function(a,b,c){return wb(this,Vc(this,a,b,c),c)};
h.lc=function(a){3932160<=a&&(a=Uc(this,a));return Pb(this.h,this.Sa=a)};h.Td=function(a){return Pb(this.h,this.Sa=wb(this,a,2))};h.pc=function(a,b){3932160<=a&&(a=Uc(this,a));Qb(this.h,this.Sa=a,b)};h.Re=function(a,b){Qb(this.h,this.Sa=wb(this,a,4),b)};function Wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Vc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.v=a.D>>12&3,c=a.aa(d|c&a.U),a.v=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.qa[a.D>>12&3];return c}
function Xc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Vc(a,b,e,4),c&65536||(e&=65535),a.v=a.D>>12&3,e=wb(a,e|c&65536,4),a.v=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.qa[a.D>>12&3]=d}function Yc(a,b){b>>=6;var c=a.F=b&7;(b=a.C=(b&56)>>3)?(c=a.S(b,c,3),a=Ob(a.h,c)):a=a.g[c+a.tb]&a.ec;return a}function Zc(a,b){b>>=6;var c=a.F=b&7;return(b=a.C=(b&56)>>3)?Pb(a.h,a.S(b,c,2)):a.g[c+a.tb]}
function wb(a,b,c){var d,e,f;if(!(c&a.Pa))return f=b&65535,57344<=f&&(f|=a.Fb),f;d=b>>13;a.ya&a.Nc[a.v]||(d&=7);e=a.H[a.v][d];f=(a.Z[a.v][d]<<6)+(b&8191)&a.Qa;3932160<=f&&(f=Uc(a,f));if(a.Sa)return f;f>=a.Lc&&f<a.Fb?(a.X|=32,K(a,4,0,f)):f&1&&!(c&1)&&(a.X|=64,K(a,4,0,f));var g=0;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.H[a.v][d]=e;if(f!=(4194170&a.Qa)||a.v)a.eb=a.v,a.fb=d;g&&(g&57344&&(0<=a.va&&(g|=128),a.Y&57344||(g|=a.Y&4096|a.eb<<5|a.fb<<1,cc(a,a.Y&-61695|g&61694)),K(a,168,64,-2)),a.Y&61440||!(f<(4191360&a.Qa)||f>(4194239&a.Qa))||(a.Y|=4096,a.Y&512&&(a.w|=64)));return f}function Tc(a){var b=a.aa(a.g[6]|a.V);a.g[6]=a.g[6]+2&65535;return b}function Rc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;a.w&256||a.Ca(4,-2,c);a.Cb(c,b)}
function Vc(a,b,c,d){var e,f,g=d&8?0:a.V;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ca(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ca(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.aa(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ca(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.aa(e)|g;a.a-=8;break;case 6:return e=a.aa(Nc(a,2)),e=e+a.g[c]&65535,6==c&&a.Ca(d,
0,e),a.a-=6,e|g;case 7:return e=a.aa(Nc(a,2)),e=e+a.g[c]&65535,e=a.aa(e|a.V),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fc=function(a,b,c){!this.v&&0>=b&&c<=this.$a&&(this.w|=32)};h.Gc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.$a&&(c<=this.$a-32?K(this,4,0,-4):(this.X|=8,this.w|=32)))};h.Ic=function(a,b,c){a=Vc(this,a,b,c);3932160<=a&&(a=Uc(this,a));return a};h.Jc=function(a,b,c){return wb(this,Vc(this,a,b,c),c)};
h.lc=function(a){3932160<=a&&(a=Uc(this,a));return Pb(this.h,this.Ta=a)};h.Td=function(a){return Pb(this.h,this.Ta=wb(this,a,2))};h.pc=function(a,b){3932160<=a&&(a=Uc(this,a));Qb(this.h,this.Ta=a,b)};h.Re=function(a,b){Qb(this.h,this.Ta=wb(this,a,4),b)};function Wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Vc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.v=a.D>>12&3,c=a.aa(d|c&a.V),a.v=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.qa[a.D>>12&3];return c}
function Xc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Vc(a,b,e,4),c&65536||(e&=65535),a.v=a.D>>12&3,e=wb(a,e|c&65536,4),a.v=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.qa[a.D>>12&3]=d}function Yc(a,b){b>>=6;var c=a.G=b&7;(b=a.C=(b&56)>>3)?(c=a.S(b,c,3),a=Ob(a.h,c)):a=a.g[c+a.tb]&a.ec;return a}function Zc(a,b){b>>=6;var c=a.G=b&7;return(b=a.C=(b&56)>>3)?Pb(a.h,a.S(b,c,2)):a.g[c+a.tb]}
function $c(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Vc(a,b,c,8)}function ad(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.S(b,c,3),a=Ob(a.h,c)):a=a.g[c]&255;return a}function bd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.h,a.S(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Hb=a.S(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Ob(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].Bb(e&a.l,c,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))}
function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.S(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Pb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function cd(a,b,c,d,e){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].Bb(d&a.l,c,d)):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))}
function dd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.S(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),Qb(a.h,e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}function V(a,b,c){c&&(Q(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3}
h.Ab=function(a){this.o.complete=!0;var b=a?this.o.Rb?0:1:-1;this.o.Rb=!1;this.ma=this.a=a;do{if(this.w){if(a=this.w&11){a=!1;if(this.w&2){var c=160,d=(this.mb&224)>>5,e=this.I&&this.I.Xa>d?this.I:null;e&&(c=e.Tb,d=e.Xa);d>(this.D&224)>>5?(this.w&8&&(Nc(this,2),this.w&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.I||this.mb||(this.w&=-3)}else this.w&1&&this.w++;a=a&&0>b}if(a)break;if(this.w&112&&Oc(this)&&0>b)break}this.w=this.w&15|this.D&16;this.decode(Mc(this))}while(0<this.a);return this.o.complete?
this.ma-this.a:void 0===this.o.complete?0:-1};Ia(function(){for(var a=F(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Gc(d);E(d,c)}});function ed(a,b){var c=b+a;this.s=this.i=this.m=c;this.f=(a^c)&(b^c);return c&65535}function fd(a,b){var c=b+a,d=c<<8;this.s=this.i=this.m=d;this.f=(a<<8^d)&(b<<8^d);return c&255}function gd(a,b){a=b<<1;Pc(this,a);return a&65535}function hd(a,b){a=b<<1;Pc(this,a<<8);return a&255}function id(a,b){a=b&32768|b>>1|b<<16;Pc(this,a);return a&65535}
function jd(a,b){a=b&128|b>>1|b<<8;Pc(this,a<<8);return a&255}function kd(a,b){a=b&~a;this.ca(a);return a}function ld(a,b){a=b&~a;this.ca(a<<8);return a}function md(a,b){a|=b;this.ca(a);return a}function nd(a,b){a|=b;this.ca(a<<8);return a}function od(a,b){a=~b|65536;this.Ga(a);return a&65535}function pd(a,b){a=~b|256;this.Ga(a<<8);return a&255}function qd(a,b){this.s=this.i=a=b-a;this.f=b&(b^a);return a&65535}function rd(a,b){a=b-a;var c=a<<8;b<<=8;this.s=this.i=c;this.f=b&(b^c);return a&255}
function sd(a,b){this.s=this.i=a=b+a;this.f=a&(b^a);return a&65535}function td(a,b){a=b+a;var c=a<<8;this.s=this.i=c;this.f=c&(b<<8^c);return a&255}function ud(a,b){a=-b;this.Ga(a,a&b&32768);return a&65535}function vd(a,b){a=-b;this.Ga(a<<8,(a&b&128)<<8);return a&255}function wd(a,b){a=b<<1|this.m>>16&1;Pc(this,a);return a&65535}function xd(a,b){a=b<<1|this.m>>16&1;Pc(this,a<<8);return a&255}function yd(a,b){a=(this.m&65536|b)>>1|b<<16;Pc(this,a);return a&65535}
function zd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Pc(this,a<<8);return a&255}function Ad(a,b){var c=b-a;Qc(this,c,a,b);return c&65535}function Bd(a,b){var c=b-a;Qc(this,c<<8,a<<8,b<<8);return c&255}function Cd(a,b){this.s=this.i=b&65280;this.f=this.m=0;return(b<<8|b>>8)&65535}function Dd(a,b){a^=b;this.ca(a);return a&65535}function Ed(a){U(this,a,Zc(this,a),ed);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}
function Fd(a){var b=bd(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
function Gd(a){var b=bd(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Hd(a){V(this,a,!S(this))}function Id(a){V(this,a,S(this))}
function Jd(a){U(this,a,Zc(this,a),kd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Kd(a){T(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Ld(a){U(this,a,Zc(this,a),md);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Md(a){T(this,a,Yc(this,a),nd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}
function Nd(a){var b=Zc(this,a);a=bd(this,a);this.ca((0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Od(a){var b=Yc(this,a);a=ad(this,a);this.ca(((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Pd(a){V(this,a,this.i&65535?0:4)}function Qd(a){V(this,a,!Lc(this)==!(this.f&32768))}function Rd(a){V(this,a,!!(this.i&65535)&&!Lc(this)==!(this.f&32768))}
h.Ab=function(a){this.m.complete=!0;var b=a?this.m.Rb?0:1:-1;this.m.Rb=!1;this.ma=this.a=a;do{if(this.w){if(a=this.w&11){a=!1;if(this.w&2){var c=160,d=(this.mb&224)>>5,e=this.I&&this.I.Xa>d?this.I:null;e&&(c=e.Tb,d=e.Xa);d>(this.D&224)>>5?(this.w&8&&(Nc(this,2),this.w&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.I||this.mb||(this.w&=-3)}else this.w&1&&this.w++;a=a&&0>b}if(a)break;if(this.w&112&&Oc(this)&&0>b)break}this.w=this.w&15|this.D&16;this.decode(Mc(this))}while(0<this.a);return this.m.complete?
this.ma-this.a:void 0===this.m.complete?0:-1};Ia(function(){for(var a=F(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Gc(d);E(d,c)}});function ed(a,b){var c=b+a;this.s=this.i=this.o=c;this.f=(a^c)&(b^c);return c&65535}function fd(a,b){var c=b+a,d=c<<8;this.s=this.i=this.o=d;this.f=(a<<8^d)&(b<<8^d);return c&255}function gd(a,b){a=b<<1;Pc(this,a);return a&65535}function hd(a,b){a=b<<1;Pc(this,a<<8);return a&255}function id(a,b){a=b&32768|b>>1|b<<16;Pc(this,a);return a&65535}
function jd(a,b){a=b&128|b>>1|b<<8;Pc(this,a<<8);return a&255}function kd(a,b){a=b&~a;this.ca(a);return a}function ld(a,b){a=b&~a;this.ca(a<<8);return a}function md(a,b){a|=b;this.ca(a);return a}function nd(a,b){a|=b;this.ca(a<<8);return a}function od(a,b){a=~b|65536;this.Ha(a);return a&65535}function pd(a,b){a=~b|256;this.Ha(a<<8);return a&255}function qd(a,b){this.s=this.i=a=b-a;this.f=b&(b^a);return a&65535}function rd(a,b){a=b-a;var c=a<<8;b<<=8;this.s=this.i=c;this.f=b&(b^c);return a&255}
function sd(a,b){this.s=this.i=a=b+a;this.f=a&(b^a);return a&65535}function td(a,b){a=b+a;var c=a<<8;this.s=this.i=c;this.f=c&(b<<8^c);return a&255}function ud(a,b){a=-b;this.Ha(a,a&b&32768);return a&65535}function vd(a,b){a=-b;this.Ha(a<<8,(a&b&128)<<8);return a&255}function wd(a,b){a=b<<1|this.o>>16&1;Pc(this,a);return a&65535}function xd(a,b){a=b<<1|this.o>>16&1;Pc(this,a<<8);return a&255}function yd(a,b){a=(this.o&65536|b)>>1|b<<16;Pc(this,a);return a&65535}
function zd(a,b){a=((this.o&65536)>>8|b)>>1|b<<8;Pc(this,a<<8);return a&255}function Ad(a,b){var c=b-a;Qc(this,c,a,b);return c&65535}function Bd(a,b){var c=b-a;Qc(this,c<<8,a<<8,b<<8);return c&255}function Cd(a,b){this.s=this.i=b&65280;this.f=this.o=0;return(b<<8|b>>8)&65535}function Dd(a,b){a^=b;this.ca(a);return a&65535}function Ed(a){U(this,a,Zc(this,a),ed);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}
function Fd(a){var b=bd(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.o=this.f=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.o=c<<17-b,c>>=b;else if(b)if(16<b)this.f=c,c=0;else{this.o=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
function Gd(a){var b=bd(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.o=this.f=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.o=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.o=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.f=32768)):d=c;this.g[a]=d>>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Hd(a){V(this,a,!S(this))}function Id(a){V(this,a,S(this))}
function Jd(a){U(this,a,Zc(this,a),kd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Kd(a){T(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Ld(a){U(this,a,Zc(this,a),md);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function Md(a){T(this,a,Yc(this,a),nd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}
function Nd(a){var b=Zc(this,a);a=bd(this,a);this.ca((0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Od(a){var b=Yc(this,a);a=ad(this,a);this.ca(((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function Pd(a){V(this,a,this.i&65535?0:4)}function Qd(a){V(this,a,!Lc(this)==!(this.f&32768))}function Rd(a){V(this,a,!!(this.i&65535)&&!Lc(this)==!(this.f&32768))}
function Sd(a){V(this,a,!S(this)&&!!(this.i&65535))}function Td(a){V(this,a,(this.i&65535?0:4)||!Lc(this)!=!(this.f&32768))}function Ud(a){V(this,a,S(this)||(this.i&65535?0:4))}function Vd(a){V(this,a,!Lc(this)!=!(this.f&32768))}function Wd(a){V(this,a,Lc(this))}function Xd(a){V(this,a,!!(this.i&65535))}function Yd(a){V(this,a,!Lc(this))}function Zd(){K(this,12,0,-9)}function $d(a){V(this,a,!0)}function ae(a){V(this,a,!(this.f&32768))}function be(a){V(this,a,this.f&32768?2:0)}
function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ce(a){var b=Zc(this,a);a=bd(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Qc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function de(a){var b=Yc(this,a);a=ad(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Qc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}
function ee(a){var b=bd(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function fe(){K(this,24,0,-9);this.a-=20}
function ge(){this.D&49152?(this.X|=128,K(this,4,0,-8)):(this.u&&1120==this.Wa&&this.u.setData(this.g[0],!0),this.G?this.G.c():H(this));this.a-=7}function he(){K(this,16,0,-9);this.a-=20}var ie=[0,7,7,10,7,11,9,13];function je(a){this.J=this.a;Q(this,$c(this,a));this.a=this.J-ie[this.c]}var ke=[0,14,14,17,14,18,16,20];function le(a){this.J=this.a;var b=$c(this,a);a=a>>6&7;Rc(this,this.g[a]);this.g[a]=this.g[7];Q(this,b);this.a=this.J-ke[this.c]}var me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function ne(a){var b=Zc(this,a);this.J=this.a;dd(this,a,b,this.ca);this.a=this.J-me[(this.C?8:0)+this.c]+(7!=this.b||this.c?0:2)}function oe(a){var b=Yc(this,a);cd(this,a,b,65535,this.ca);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}var pe=[7,13,13,17,14,18,17,21];
function qe(a){var b=bd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.s=b>>16;this.i=this.s|b;this.f=0;this.m=-32768>b||32767<b?65536:0;this.a-=23}function re(){this.a-=5}function se(){this.D&49152||(this.h.reset(),ob(this),this.u&&this.u.setData(this.g[0],!0));this.a-=667}function te(a){if(a&8)K(this,8,0,-9);else{var b=Tc(this);a&=7;7==a?Q(this,b):(Q(this,this.g[a]),this.g[a]=b);this.a-=9}}
function ue(){Sc(this);this.a-=13}function X(a){a&1&&(this.m=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function ve(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)Q(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function we(a){U(this,a,Zc(this,a),Ad);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function xe(a){U(this,a,0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function ye(){K(this,28,0,-9)}
function W(a){a&1&&(this.o=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function ce(a){var b=Zc(this,a);a=bd(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Qc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}function de(a){var b=Yc(this,a);a=ad(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Qc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.C?4:3)+(7==this.b?2:0)}
function ee(a){var b=bd(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.o=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.o=65536,this.a-=7}function fe(){K(this,24,0,-9);this.a-=20}
function ge(){this.D&49152?(this.X|=128,K(this,4,0,-8)):(this.u&&1120==this.Wa&&this.u.setData(this.g[0],!0),this.F?this.F.c():H(this));this.a-=7}function he(){K(this,16,0,-9);this.a-=20}var ie=[0,7,7,10,7,11,9,13];function je(a){this.J=this.a;Q(this,$c(this,a));this.a=this.J-ie[this.c]}var ke=[0,14,14,17,14,18,16,20];function le(a){this.J=this.a;var b=$c(this,a);a=a>>6&7;Rc(this,this.g[a]);this.g[a]=this.g[7];Q(this,b);this.a=this.J-ke[this.c]}var me=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function ne(a){var b=Zc(this,a);this.J=this.a;dd(this,a,b,this.ca);this.a=this.J-me[(this.C?8:0)+this.c]+(7!=this.b||this.c?0:2)}function oe(a){var b=Yc(this,a);cd(this,a,b,65535,this.ca);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}var pe=[7,13,13,17,14,18,17,21];
function qe(a){var b=bd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.s=b>>16;this.i=this.s|b;this.f=0;this.o=-32768>b||32767<b?65536:0;this.a-=23}function re(){this.a-=5}function se(){this.D&49152||(this.h.reset(),ob(this),this.u&&this.u.setData(this.g[0],!0));this.a-=667}function te(a){if(a&8)K(this,8,0,-9);else{var b=Tc(this);a&=7;7==a?Q(this,b):(Q(this,this.g[a]),this.g[a]=b);this.a-=9}}
function ue(){Sc(this);this.a-=13}function X(a){a&1&&(this.o=65536);a&2&&(this.f=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function ve(a){var b=(a&448)>>6;if(this.g[b]=this.g[b]-1&65535)Q(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function we(a){U(this,a,Zc(this,a),Ad);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.C?5:3)+(7==this.b?2:0)}function xe(a){U(this,a,0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function ye(){K(this,28,0,-9)}
function ze(){this.u&&(this.u.la=this.g[7],this.u.setData(this.g[0],!0));this.w|=8;Nc(this,-2);this.a-=3}function Ae(a){U(this,a,this.g[(a>>6&7)+this.tb],Dd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-9)}function Hc(a){Be[a>>12].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a>>6&3].call(this,a)}function Ge(a){He[a>>6&3].call(this,a)}function Ie(a){Je[a&15].call(this,a)}function Ke(a){Le[a&15].call(this,a)}function Me(a){Ne[a>>6&3].call(this,a)}
function Oe(a){Pe[a>>6&3].call(this,a)}function Qe(a){Re[a>>6&3].call(this,a)}
var Be=[function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,Ed,Y,function(a){Te[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,we,Y],Se=[function(a){Ue[a>>4&15].call(this,a)},$d,Xd,Pd,Qd,Vd,Rd,Td,le,le,Ce,Ee,Ge,Y,Y,Y],De=[function(a){dd(this,a,0,this.Ga);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Fe=[function(a){U(this,a,0,ud);
this.a-=this.c?11:6},function(a){U(this,a,S(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,S(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bd(this,a);this.Ga(a);this.a-=this.c?4:3+(7==this.b?2:0)}],He=[function(a){U(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ue=[function(a){Ve[a&
15].call(this,a)},Y,Y,Y,je,je,je,je,te,Y,Ie,Ke,xe,xe,xe,xe],Ve=[ge,ze,ue,Zd,he,se,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Je=[re,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Le=[re,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Te=[Yd,Wd,Sd,Ud,ae,be,Hd,Id,fe,ye,Me,Oe,Qe,Y,Y,Y],Ne=[function(a){cd(this,a,0,
255,this.Ga);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)}],Pe=[function(a){T(this,a,0,vd);this.a-=this.c?11:6},function(a){T(this,a,S(this)?1:0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,S(this)?1:0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);this.Ga(a<<8);this.a-=this.c?4:3+(7==this.b?
var Be=[function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,Ed,Y,function(a){Te[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,we,Y],Se=[function(a){Ue[a>>4&15].call(this,a)},$d,Xd,Pd,Qd,Vd,Rd,Td,le,le,Ce,Ee,Ge,Y,Y,Y],De=[function(a){dd(this,a,0,this.Ha);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Fe=[function(a){U(this,a,0,ud);
this.a-=this.c?11:6},function(a){U(this,a,S(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,S(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bd(this,a);this.Ha(a);this.a-=this.c?4:3+(7==this.b?2:0)}],He=[function(a){U(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ue=[function(a){Ve[a&
15].call(this,a)},Y,Y,Y,je,je,je,je,te,Y,Ie,Ke,xe,xe,xe,xe],Ve=[ge,ze,ue,Zd,he,se,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Je=[re,function(){this.o=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Le=[re,function(){this.o=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Te=[Yd,Wd,Sd,Ud,ae,be,Hd,Id,fe,ye,Me,Oe,Qe,Y,Y,Y],Ne=[function(a){cd(this,a,0,
255,this.Ha);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)}],Pe=[function(a){T(this,a,0,vd);this.a-=this.c?11:6},function(a){T(this,a,S(this)?1:0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,S(this)?1:0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);this.Ha(a<<8);this.a-=this.c?4:3+(7==this.b?
2:0)}],Re=[function(a){T(this,a,0,zd);this.a-=this.c?9+(this.Hb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,jd);this.a-=this.c?9+(this.Hb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){We[a>>12].call(this,a)}
var We=[function(a){Xe[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,Ed,function(a){Ye[a>>8&15].call(this,a)},function(a){Ze[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,we,Y],Xe=[function(a){$e[a>>4&15].call(this,a)},$d,Xd,Pd,Qd,Vd,Rd,Td,le,le,Ce,Ee,Ge,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.aa(a|this.U);Q(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Wc(this,a,0);this.ca(a);Rc(this,a);this.a-=11},function(a){var b=Tc(this);this.J=
var We=[function(a){Xe[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,Ed,function(a){Ye[a>>8&15].call(this,a)},function(a){Ze[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,we,Y],Xe=[function(a){$e[a>>4&15].call(this,a)},$d,Xd,Pd,Qd,Vd,Rd,Td,le,le,Ce,Ee,Ge,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.aa(a|this.V);Q(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Wc(this,a,0);this.ca(a);Rc(this,a);this.a-=11},function(a){var b=Tc(this);this.J=
this.a;this.ca(b);Xc(this,a,0,b);this.a=this.J-pe[this.c]},function(a){dd(this,a,Lc(this)?65535:0,this.ca);this.a-=this.c?9:3+(7==this.b?2:0)}],$e=[function(a){bf[a&15].call(this,a)},Y,Y,Y,je,je,je,je,te,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.w|=1,this.w&=-3),this.a-=5):K(this,8,0,-9)},Ie,Ke,xe,xe,xe,xe],bf=[ge,ze,function(){Sc(this);this.w|=this.D&16;this.a-=13},Zd,he,se,ue,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],Ye=[qe,qe,ee,ee,Fd,Fd,Gd,Gd,Ae,Ae,Y,Y,Y,Y,ve,ve],Ze=
[Yd,Wd,Sd,Ud,ae,be,Hd,Id,fe,ye,Me,Oe,Qe,function(a){cf[a>>6&3].call(this,a)},Y,Y],cf=[Y,function(a){a=Wc(this,a,65536);this.ca(a);Rc(this,a);this.a-=11},function(a){var b=Tc(this);this.J=this.a;this.ca(b);Xc(this,a,65536,b);this.a=this.J-pe[this.c]},Y];
function df(a){z.call(this,"ROM",a,df,128);this.da=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.l=a.file;this.s=u(this.l);if(this.l){a=this.l;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.Ba,a,b),(a=sa(a,b))?(c.c=a.M,c.da=a.da):c.l=null);ef(c)})}}B(df);h=df.prototype;
h.ia=function(a,b,c,d){this.h=b;this.a=c;this.G=d;ef(this)};h.ka=function(){this.da&&(this.G&&this.G.a(this.id,this.i,this.b,this.da),delete this.da);return!0};h.ja=function(){return!0};
function ef(a){if(!Xa(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Cb){var c={};b=(c[b]=[df.prototype.Hd,df.prototype.Fe,null,null,null,a.b>>1],c);if(fb(a.h,a,b)){b=a.m=!0;break a}}else if(Ib(a.h,b,a.b,mc)){for(c=0;c<a.c.length;c++)Rb(a.h,b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.f?b.push(a.f):
null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.h,g=d.b,k=[],l=d.i>>>f.b;0<g&&l<f.h.length;)k.push(f.h[l++]),g-=f.c;f=d.h;d=d.b;g=0;for(e>>>=f.b;0<d&&e<f.h.length;){l=k[g++];if(!l)break;f.h[e++]=l;d-=f.c}}a.m||delete a.c}}}G(a)}}h.Hd=function(a){return this.c[a-this.i]};h.Fe=function(){};Ia(function(){for(var a=F(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new df(d);E(d,c)}});
function ff(a){z.call(this,"RAM",a,ff);this.da=this.c=null;this.l=a.addr;this.f=a.size;this.pa=a.load;this.oa=a.exec;this.i=!1;this.b=a.file;this.m=u(this.b);if(this.b){a=this.b;var b=ka(this.m);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.B("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ta(c.Ba,a,b),(a=sa(a,b))?(c.c=a.M,c.da=a.da,null==c.pa&&(c.pa=a.pa),null==c.oa&&(c.oa=a.oa)):c.b=null);gf(c)})}}
B(ff);ff.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.G=d;gf(this)};ff.prototype.ka=function(){this.da&&(this.G&&this.G.a(this.id,this.l,this.f,this.da),delete this.da);return!0};ff.prototype.ja=function(){return!0};function gf(a){if(a.h&&(!a.i&&a.f&&(Ib(a.h,a.l,a.f,Ub)?a.i=!0:a.f=0),!Xa(a))){if(!a.i)x("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;hf(a,a.c,a.pa,a.oa,a.l)}G(a)}}
ff.prototype.reset=function(){if(this.i){for(var a=this.h,b=this.l,c=this.f,d=b&a.l,b=b>>>a.b;0<c&&b<a.h.length;){var e=a.h[b],f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Za&&e.j)for(k=d;f--&&k<e.j.length;k++)e.j[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ub(d,g,e.Ha+d);c-=a.c;b++;d=0}this.c&&hf(this,this.c,this.pa,this.oa,this.l,!0)}};
function df(a){z.call(this,"ROM",a,df,128);this.da=this.c=null;this.i=a.addr;this.b=a.size;this.o=!1;this.f=a.alias;this.l=a.file;this.s=u(this.l);if(this.l){a=this.l;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.B("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.Ba,a,b),(a=sa(a,b))?(c.c=a.M,c.da=a.da):c.l=null);ef(c)})}}B(df);h=df.prototype;
h.ia=function(a,b,c,d){this.h=b;this.a=c;this.F=d;ef(this)};h.ka=function(){this.da&&(this.F&&this.F.a(this.id,this.i,this.b,this.da),delete this.da);return!0};h.ja=function(){return!0};
function ef(a){if(!Xa(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Cb){var c={};b=(c[b]=[df.prototype.Hd,df.prototype.Fe,null,null,null,a.b>>1],c);if(fb(a.h,a,b)){b=a.o=!0;break a}}else if(Ib(a.h,b,a.b,mc)){for(c=0;c<a.c.length;c++)Rb(a.h,b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.f?b.push(a.f):
null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],f=d.h,g=d.b,k=[],l=d.i>>>f.b;0<g&&l<f.h.length;)k.push(f.h[l++]),g-=f.c;f=d.h;d=d.b;g=0;for(e>>>=f.b;0<d&&e<f.h.length;){l=k[g++];if(!l)break;f.h[e++]=l;d-=f.c}}a.o||delete a.c}}}G(a)}}h.Hd=function(a){return this.c[a-this.i]};h.Fe=function(){};Ia(function(){for(var a=F(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new df(d);E(d,c)}});
function ff(a){z.call(this,"RAM",a,ff);this.da=this.c=null;this.l=a.addr;this.f=a.size;this.pa=a.load;this.oa=a.exec;this.i=!1;this.b=a.file;this.o=u(this.b);if(this.b){a=this.b;var b=ka(this.o);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.B("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ta(c.Ba,a,b),(a=sa(a,b))?(c.c=a.M,c.da=a.da,null==c.pa&&(c.pa=a.pa),null==c.oa&&(c.oa=a.oa)):c.b=null);gf(c)})}}
B(ff);ff.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.F=d;gf(this)};ff.prototype.ka=function(){this.da&&(this.F&&this.F.a(this.id,this.l,this.f,this.da),delete this.da);return!0};ff.prototype.ja=function(){return!0};function gf(a){if(a.h&&(!a.i&&a.f&&(Ib(a.h,a.l,a.f,Ub)?a.i=!0:a.f=0),!Xa(a))){if(!a.i)x("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;hf(a,a.c,a.pa,a.oa,a.l)}G(a)}}
ff.prototype.reset=function(){if(this.i){for(var a=this.h,b=this.l,c=this.f,d=b&a.l,b=b>>>a.b;0<c&&b<a.h.length;){var e=a.h[b],f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Za&&e.j)for(k=d;f--&&k<e.j.length;k++)e.j[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ub(d,g,e.Ia+d);c-=a.c;b++;d=0}this.c&&hf(this,this.c,this.pa,this.oa,this.l,!0)}};
function hf(a,b,c,d,e,f){var g=!1,k=!1;if(null==c)for(var l=0;l<b.length-1;){var m=b[l]&255|(b[l+1]&255)<<8;if(m)if(m&255){if(1!=m)break;if(l+6>=b.length)break;for(var l=l+2,p=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,m=m+((p&255)+(p>>8)+(t&255)+(t>>8)),v=l,y=p-=6;0<p&&l<b.length;)m+=b[l++]&255,p--;if(p||l>=b.length)break;m+=b[l++]&255;if(m&255)break;if(y)for(;y--;)Rb(a.h,t++,b[v++]&255);else t&1?g=!0:null==d&&(d=t);k=!0}else l++;else l+=2}if(!k&&(null==c&&(c=e),null!=c)){for(e=0;e<
b.length;e++)Rb(a.h,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.a),f=!1;null!=d&&Kc(a.a,d,f)}return k}Ia(function(){for(var a=F(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new ff(d);E(d,c)}});function jf(a){z.call(this,"Keyboard",a,jf,1024);G(this)}B(jf);jf.prototype.ba=function(){return!1};jf.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.G=d};Ia(function(){for(var a=F(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new jf(d);E(d,c)}});
function Z(a){this.A=a.adapter;this.L=a.baudReceive||9600;this.ma=a.baudTransmit||9600;this.sa=a.upperCase;this.f=this.m=null;this.fa=a.tabSize;this.S=a.charBOL;this.s=0;this.v=!0;z.call(this,"SerialPort",a,Z,262144);var b=a.binding;if("console"==b)this.m="";else{var c;a=kf;b&&(void 0===c&&(c="Panel"),(c=Va(c,this.id))&&(b=c.j[b])&&this.ba(null,a,b))}this.i=this.F=this.I=null;this.exports={connect:this.gc,receiveData:this.zb,receiveStatus:this.Wd}}B(Z);var kf="buffer";h=Z.prototype;
b.length;e++)Rb(a.h,c+e,b[e]);k=!0}if(k){if(null==d||g)H(a.a),f=!1;null!=d&&Kc(a.a,d,f)}return k}Ia(function(){for(var a=F(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new ff(d);E(d,c)}});function jf(a){z.call(this,"Keyboard",a,jf,1024);G(this)}B(jf);jf.prototype.ba=function(){return!1};jf.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.F=d};Ia(function(){for(var a=F(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new jf(d);E(d,c)}});
function Z(a){this.A=a.adapter;this.L=a.baudReceive||9600;this.ma=a.baudTransmit||9600;this.sa=a.upperCase;this.f=this.o=null;this.fa=a.tabSize;this.S=a.charBOL;this.s=0;this.v=!0;z.call(this,"SerialPort",a,Z,262144);var b=a.binding;if("console"==b)this.o="";else{var c;a=kf;b&&(void 0===c&&(c="Panel"),(c=Va(c,this.id))&&(b=c.j[b])&&this.ba(null,a,b))}this.i=this.G=this.I=null;this.exports={connect:this.gc,receiveData:this.zb,receiveStatus:this.Wd}}B(Z);var kf="buffer";h=Z.prototype;
h.ba=function(a,b,c){var d=this;switch(b){case kf:return this.j[b]=this.f=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?n.Xb:n.tc:46==c?b=n.Xb:a.ctrlKey&&c>=n.Vb&&c<=n.Ac&&(b=c-(n.Vb-n.qc));b&&(a.preventDefault&&a.preventDefault(),d.zb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==n.sc&&(b=n.rc);d.zb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&
a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.zb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;var e=this;this.U=$b(this.a,this.A?-1:48,4,262144);this.ga=Xb(this.a,function(){var a;a=-1;e.u.length&&(a=e.u.shift()&255,e.sa&&97<=a&&122>a&&(a-=32),Yb(e.a,e.ga,1E3/Math.round(e.L/10)));0<=a&&(e.C=a,e.b&128?e.C|=49152:e.b|=128,e.b&64&&M(c,e.U))});this.J=$b(this.a,this.A?-1:52,4,262144);this.na=Xb(this.a,function(){e.c|=128;e.c&64&&M(c,e.J)});fb(b,this,lf,this.A?64832+8*(this.A-1)-65392:0);hb(b,this.reset.bind(this));G(this)};
h.gc=function(a){if(!this.i){var b=yc(this.l,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.Aa)return;c=oa(c[1]);if(this.i=Ua(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.v);if(this.F=e.receiveData){this.v=a;this.I=e.receiveStatus;this.status(this.Ba+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;var e=this;this.V=$b(this.a,this.A?-1:48,4,262144);this.ga=Xb(this.a,function(){var a;a=-1;e.u.length&&(a=e.u.shift()&255,e.sa&&97<=a&&122>a&&(a-=32),Yb(e.a,e.ga,1E3/Math.round(e.L/10)));0<=a&&(e.C=a,e.b&128?e.C|=49152:e.b|=128,e.b&64&&M(c,e.V))});this.J=$b(this.a,this.A?-1:52,4,262144);this.na=Xb(this.a,function(){e.c|=128;e.c&64&&M(c,e.J)});fb(b,this,lf,this.A?64832+8*(this.A-1)-65392:0);hb(b,this.reset.bind(this));G(this)};
h.gc=function(a){if(!this.i){var b=yc(this.l,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.Aa)return;c=oa(c[1]);if(this.i=Ua(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.v);if(this.G=e.receiveData){this.v=a;this.I=e.receiveStatus;this.status(this.Ba+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
h.ka=function(a,b){if(!b)if(this.gc(this.v),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){mf(this)};h.save=function(){var a=new R(this);a.set(0,[]);return a.data()};h.restore=function(){return mf(this)};function mf(a){a.C=0;a.b=8192;a.c=128;a.u=[];return!0}
h.zb=function(a){if("number"==typeof a)this.u.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.u.push(b)}else this.u=this.u.concat(a);Yb(this.a,this.ga,1E3/Math.round(this.L/10));return!0};h.Wd=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&M(this.a,this.U))};h.ud=function(){var a=this.b&65534;this.b&=-32769;return a};
h.zb=function(a){if("number"==typeof a)this.u.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.u.push(b)}else this.u=this.u.concat(a);Yb(this.a,this.ga,1E3/Math.round(this.L/10));return!0};h.Wd=function(a){var b=this.b;this.b&=-12289;a&32&&(this.b|=8192);a&256&&(this.b|=4096);b!=this.b&&(this.b|=32768,this.b&32&&M(this.a,this.V))};h.ud=function(){var a=this.b&65534;this.b&=-32769;return a};
h.se=function(a){var b=a^this.b;this.b=this.b&-112|a&111;this.I&&b&6&&(b=0,b=this.v?b|(a&4?32:0)|(a&2?320:0):b|(a&4?16:0)|(a&2?1048576:0),this.I.call(this.i,b))};h.td=function(){this.b&=-129;return this.C};h.re=function(){};h.Vd=function(){return this.c};h.Te=function(a){this.c&128&&(a&64?M(this.a,this.J):bc(this.a,this.J));this.c=this.c&-70|a&69};h.Ud=function(){return 0};
h.Se=function(a){a&=255;this.F&&this.F.call(this.i,a);a&=127;if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{if(a){var b;b=(b=pa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.fa||8,c=a-this.s%a,this.fa&&(b=" ".slice(0,c)));this.S&&!this.s&&c&&(b=String.fromCharCode(this.S)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}}else if(null!=this.m){if(10==
a||1024<=this.m.length)this.W(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}Yb(this.a,this.na,1E3/Math.round(this.ma/10));this.c&=-129};var nf={},lf=(nf[65392]=[null,null,Z.prototype.ud,Z.prototype.se,"RCSR"],nf[65394]=[null,null,Z.prototype.td,Z.prototype.re,"RBUF"],nf[65396]=[null,null,Z.prototype.Vd,Z.prototype.Te,"XCSR"],nf[65398]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XBUF"],nf);
Ia(function(){for(var a=F(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Z(d);E(d,c)}});function gc(a){z.call(this,"PC11",a,gc);this.C=of(this,a.autoMount);this.c=0;this.S=a.baudReceive||3600;this.u=this.v=this.b=0;this.s=[];this.m=pf;this.f=qf;this.A=this.i="";this.M=this.pa=this.oa=null;this.J=-1;this.F=!Ba("Mobi")&&window&&"FileReader"in window}B(gc);var pf="",qf=0;
h.Se=function(a){a&=255;this.G&&this.G.call(this.i,a);a&=127;if(this.f)if(13==a)this.s=0;else if(8==a)this.f.value=this.f.value.slice(0,-1),0<this.s&&this.s--;else{if(a){var b;b=(b=13!=a&&10!=a?pa[a]:null)?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.fa||8,c=a-this.s%a,this.fa&&(b=" ".slice(0,c)));this.S&&!this.s&&c&&(b=String.fromCharCode(this.S)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}}else if(null!=
this.o){if(10==a||1024<=this.o.length)this.U(this.o),this.o="";10!=a&&(this.o+=String.fromCharCode(a))}Yb(this.a,this.na,1E3/Math.round(this.ma/10));this.c&=-129};var nf={},lf=(nf[65392]=[null,null,Z.prototype.ud,Z.prototype.se,"RCSR"],nf[65394]=[null,null,Z.prototype.td,Z.prototype.re,"RBUF"],nf[65396]=[null,null,Z.prototype.Vd,Z.prototype.Te,"XCSR"],nf[65398]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XBUF"],nf);
Ia(function(){for(var a=F(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Z(d);E(d,c)}});function gc(a){z.call(this,"PC11",a,gc);this.C=of(this,a.autoMount);this.c=0;this.S=a.baudReceive||3600;this.u=this.v=this.b=0;this.s=[];this.o=pf;this.f=qf;this.A=this.i="";this.M=this.pa=this.oa=null;this.J=-1;this.G=!Ba("Mobi")&&window&&"FileReader"in window}B(gc);var pf="",qf=0;
function of(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){x(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=gc.prototype;
h.ba=function(a,b,c){var d=this,e=qf;switch(b){case "listTapes":return this.j[b]=c,c.onchange=function(){var a=d.j.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){x("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "readTape":e=2;case "loadTape":return e||(e=1),this.j[b]=c,c.onclick=function(){var a=
d.j.listTapes;a&&rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;rf(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;this.L=sf(a);var e=this;if(a=of(this,yc(this.l,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.I=$b(this.a,56,4,4096);this.U=Xb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.u<e.s.length&&(e.v=e.s[e.u++]&255,tf(e,e.u/e.s.length*100),e.b|=128,e.b&=-2049,e.b&64&&M(e.a,e.I))});fb(b,this,uf);hb(b,this.reset.bind(this));vf(this,"None",pf,!0);this.F&&vf(this,"Local Tape","?");vf(this,"Remote Tape","??");wf(this)||G(this)};
d.j.listTapes;a&&rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.G){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;rf(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;this.L=sf(a);var e=this;if(a=of(this,yc(this.l,"autoMount")))for(var f in a)"PTR"==f&&(this.C[f]=a[f]);this.I=$b(this.a,56,4,4096);this.V=Xb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.u<e.s.length&&(e.v=e.s[e.u++]&255,tf(e,e.u/e.s.length*100),e.b|=128,e.b&=-2049,e.b&64&&M(e.a,e.I))});fb(b,this,uf);hb(b,this.reset.bind(this));vf(this,"None",pf,!0);this.G&&vf(this,"Local Tape","?");vf(this,"Remote Tape","??");wf(this)||G(this)};
h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.v=0};function wf(a){a.c=0;var b=a.C.PTR;if(b){var c=b.path||"";if(!(b=b.name))a:{if((b=a.j.listTapes)&&b.options)for(var d=0;d<b.options.length;d++){var e=b.options[d];if(e.value==c){b=e.text;break a}}b=u(c,!0)}c&&b?xf(a,b,c,1,!0):yf(a)}return!!a.c}
function rf(a,b,c,d,e){if(c)if("?"==c)a.B('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=u(c);a.status("Attempting to load "+c+' as "'+b+'"');a.m="??"}else a.m=c;xf(a,b,c,d,!1,e)}else zf(a,!1)}function xf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,zf(a,!0),a.o.Ia?a.B("PC11 busy"):(e&&a.c++,Af(a,b,c,d,f)?g++:a.o.Ia=!0);g&&Bf(a,a.A,a.i,a.f,a.M,a.pa,a.oa)}
function Af(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),Bf(a,b,c,d,e),a.m="?");yf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.Ba,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.M,e.pa,e.oa));
a.o.Ia=!1;a.c&&(a.c--,a.c||G(a));yf(a)})}function vf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function yf(a){var b=a.j.listTapes;if(b&&b.options){a=a.m||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
function tf(a,b){b|=0;if(b!==a.J){var c=a.j.readProgress;c&&(c=(c=F(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.J=b}}function Bf(a,b,c,d,e,f,g){a.A=b;a.i=c;a.f=d;a.M=e;a.pa=f;a.oa=g;2==d?a.L&&hf(a.L,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.B('No valid memory address for tape "'+b+'"'):(a.u=0,a.s=e,a.status('Loaded tape "'+b+'"'),tf(a,0))}function zf(a,b){if(a.i||!1===b)a.A="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.m=pf,a.f=qf,yf(a))}h.save=function(){return(new R(this)).data()};
h.restore=function(){return!0};h.nd=function(){return this.b&65534};h.le=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&M(this.a,this.I)):(this.b&=-129,this.b|=2048,this.v=0,Yb(this.a,this.U,1E3/Math.round(this.S/10))));this.b=this.b&-66|a&65};h.md=function(){this.b&=-129;this.b|=2048;return this.v};h.ke=function(){};var Cf={},uf=(Cf[65384]=[null,null,gc.prototype.nd,gc.prototype.le,"PRS"],Cf[65386]=[null,null,gc.prototype.md,gc.prototype.ke,"PRB"],Cf);
function Df(a,b,c){z.call(this,"Disk",{id:a.Ba+".disk"+r(++Ef,4)},Df,8192);this.controller=a;this.l=a.l;this.G=a.G;this.f=b;this.ra=b.name;this.xb=b.xb;Ff(this,c,b.K,b.P,b.N,b.V);G(this)}var Ef=0;B(Df);h=Df.prototype;h.ia=function(a,b,c,d){this.G=d};
function Ff(a,b,c,d,e,f){a.mode=b;a.K=c;a.P=d;a.N=e;a.V=f;a.a=[];if("preload"!=a.mode){b=Array(a.K);for(c=0;c<b.length;c++){d=Array(a.P);for(e=0;e<d.length;e++){f=Array(a.N);for(var g=1;g<=f.length;g++)f[g-1]=Gf(null,c,e,g,a.V,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
function Hf(a,b,c,d,e){var f=c;if(a.h)return!0;a.ra=b;a.ea=c;a.Qb=u(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.K=e[0];a.P=e[1];a.N=e[2];a.V=e[3]||512;c=a.V>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;d<a.a.length;d++)for(var v=a.a[d]=Array(a.P),y=0;y<v.length;y++)for(var xa=v[y]=Array(a.N),ya=0;ya<xa.length;ya++){for(var Zb=Gf(null,d,y,ya+1,a.V,0),tg=Zb.data,qc=0;qc<c;qc++,f+=4)var ug=tg[qc]=b.getInt32(f,
function rf(a,b,c,d,e){if(c)if("?"==c)a.B('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=u(c);a.status("Attempting to load "+c+' as "'+b+'"');a.o="??"}else a.o=c;xf(a,b,c,d,!1,e)}else zf(a,!1)}function xf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.f!=d)g++,zf(a,!0),a.m.Ja?a.B("PC11 busy"):(e&&a.c++,Af(a,b,c,d,f)?g++:a.m.Ja=!0);g&&Bf(a,a.A,a.i,a.f,a.M,a.pa,a.oa)}
function Af(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),Bf(a,b,c,d,e),a.o="?");yf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.m.R;g?a.B('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.Ba,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.M,e.pa,e.oa));
a.m.Ja=!1;a.c&&(a.c--,a.c||G(a));yf(a)})}function vf(a,b,c,d){if((a=a.j.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}function yf(a){var b=a.j.listTapes;if(b&&b.options){a=a.o||a.i;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}
function tf(a,b){b|=0;if(b!==a.J){var c=a.j.readProgress;c&&(c=(c=F(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.J=b}}function Bf(a,b,c,d,e,f,g){a.A=b;a.i=c;a.f=d;a.M=e;a.pa=f;a.oa=g;2==d?a.L&&hf(a.L,e,f,g,null,!1)?a.status('Read tape "'+b+'"'):a.B('No valid memory address for tape "'+b+'"'):(a.u=0,a.s=e,a.status('Loaded tape "'+b+'"'),tf(a,0))}function zf(a,b){if(a.i||!1===b)a.A="",a.i="",b||(a.f&&a.status(1==a.f?"tape detached":"tape unloaded"),a.o=pf,a.f=qf,yf(a))}h.save=function(){return(new R(this)).data()};
h.restore=function(){return!0};h.nd=function(){return this.b&65534};h.le=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&M(this.a,this.I)):(this.b&=-129,this.b|=2048,this.v=0,Yb(this.a,this.V,1E3/Math.round(this.S/10))));this.b=this.b&-66|a&65};h.md=function(){this.b&=-129;this.b|=2048;return this.v};h.ke=function(){};var Cf={},uf=(Cf[65384]=[null,null,gc.prototype.nd,gc.prototype.le,"PRS"],Cf[65386]=[null,null,gc.prototype.md,gc.prototype.ke,"PRB"],Cf);
function Df(a,b,c){z.call(this,"Disk",{id:a.Ba+".disk"+r(++Ef,4)},Df,8192);this.controller=a;this.l=a.l;this.F=a.F;this.f=b;this.ra=b.name;this.xb=b.xb;Ff(this,c,b.K,b.P,b.N,b.W);G(this)}var Ef=0;B(Df);h=Df.prototype;h.ia=function(a,b,c,d){this.F=d};
function Ff(a,b,c,d,e,f){a.mode=b;a.K=c;a.P=d;a.N=e;a.W=f;a.a=[];if("preload"!=a.mode){b=Array(a.K);for(c=0;c<b.length;c++){d=Array(a.P);for(e=0;e<d.length;e++){f=Array(a.N);for(var g=1;g<=f.length;g++)f[g-1]=Gf(null,c,e,g,a.W,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
function Hf(a,b,c,d,e){var f=c;if(a.h)return!0;a.ra=b;a.ea=c;a.Qb=u(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.K=e[0];a.P=e[1];a.N=e[2];a.W=e[3]||512;c=a.W>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;d<a.a.length;d++)for(var v=a.a[d]=Array(a.P),y=0;y<v.length;y++)for(var xa=v[y]=Array(a.N),ya=0;ya<xa.length;ya++){for(var Zb=Gf(null,d,y,ya+1,a.W,0),tg=Zb.data,qc=0;qc<c;qc++,f+=4)var ug=tg[qc]=b.getInt32(f,
!0),e=e+ug&-1;Zb.ha=c;xa[ya]=Zb}a.b=e;c=a}else a.B("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.f,c,a.ra,a.ea),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.xb?"":e)+"&format=json"));return!!w(f,
null,!0,function(b,c,d){If(a,b,c,d)})}
function If(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.R;if(d)a.controller.B('Unable to load disk "'+a.ra+'" (error '+d+": "+b+")",f);else{Ta(a.controller.Ba,b,c);try{if(0<u(a.Qb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ra]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(k.length)if(1==k.length)x(k[0]);else{a.K=k.length;a.P=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.V=l&&l.length||512;for(d=c=0;d<a.K;d++)for(f=0;f<a.P;f++)for(g=0;g<a.N;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var v=l.bytes;if(void 0!==v&&v.length){for(var y=m<<2,xa=v.length;xa<y;xa++)v[xa]=p;Jf(l,v)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Gf(l,d,f);for(y=
function If(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.m.R;if(d)a.controller.B('Unable to load disk "'+a.ra+'" (error '+d+": "+b+")",f);else{Ta(a.controller.Ba,b,c);try{if(0<u(a.Qb,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.ra]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
c+")");if(k.length)if(1==k.length)x(k[0]);else{a.K=k.length;a.P=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.W=l&&l.length||512;for(d=c=0;d<a.K;d++)for(f=0;f<a.P;f++)for(g=0;g<a.N;g++)if(l=k[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var t=l.data;if(void 0===t){var v=l.bytes;if(void 0!==v&&v.length){for(var y=m<<2,xa=v.length;xa<y;xa++)v[xa]=p;Jf(l,v)}else t=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=t;delete l.bytes}Gf(l,d,f);for(y=
0;y<t.length;y++)c=c+t[y]&-1}a.a=k;a.b=c;e=a}else x("Empty disk image: "+a.ra)}catch(ya){x("Disk image error ("+b+"): "+ya.message)}}a.h&&(a.h.call(a.i,a.f,e,a.ra,a.ea),a.h=null)}function Gf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Wf=b;a.Xf=c;a.ta=a.ha=0;a.wa=!1;return a}
h.seek=function(a,b,c,d,e){d=null;var f=this.f,g=this.a[a];if(g){var k=g[b];if(!k&&f.Dc&&b<f.P)for(k=g[b]=Array(f.$b),g=0;g<k.length;g++)k[g]=Gf(null,a,b,g+1,f.Mb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.Dc&&9==f.Gb&&(d=k[g]=Gf(null,a,b,f.Gb,f.Mb,0))}}e&&e(d,!1);return d};function Jf(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
h.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ha?f<a.ta?(a.ha+=a.ta-f,a.ta=f):f>=a.ta+a.ha&&(a.ha+=f-(a.ta+a.ha)+1):(a.ta=f,a.ha=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
function Kf(a,b){var c=a.P*a.N,d=b/c|0;return d<a.K?(b%=c,a.seek(d,b/a.N|0,b%a.N+1)):null}function Lf(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}function Mf(a){for(var b="",c=0,d;d=Kf(a,c++);)for(var e=0,f=d.length;e<f;e++)b+=String.fromCharCode(Lf(a,d,e));return btoa(b)}
h.save=function(){var a=0,b=[];b[a++]=[this.ea,this.b,this.K,this.P,this.N,this.V];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ha){for(var k=[],l=0,m=g.ta,p=g.ta+g.ha;m<p;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.ta,k]}}return b};
h.save=function(){var a=0,b=[];b[a++]=[this.ea,this.b,this.K,this.P,this.N,this.W];if(!this.c)for(var c=this.a,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.ha){for(var k=[],l=0,m=g.ta,p=g.ta+g.ha;m<p;)k[l++]=g.data[m++];b[a++]=[d,e,f,g.ta,k]}}return b};
h.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.a.length&&6<=e.length?Ff(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],m=g[f++];if(k>=this.a.length||l>=this.a[k].length||m>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+m+") out of range ("+
b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][m]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.ta=e;for(k.ha=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.B("Unable to restore disk '"+this.ra+": "+c);return b};
h.toJSON=function(){var a;a=0;for(var b;b=Kf(this,a++);)Nf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
function Nf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function P(a){z.call(this,"RK11",a,P,65536);this.v=Of(this,a.autoMount);this.m=0;this.c=Array(8);this.A=!Ba("Mobi")&&window&&"FileReader"in window}B(P);function Of(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){x(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=P.prototype;
function Nf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function P(a){z.call(this,"RK11",a,P,65536);this.v=Of(this,a.autoMount);this.o=0;this.c=Array(8);this.A=!Ba("Mobi")&&window&&"FileReader"in window}B(P);function Of(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){x(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=P.prototype;
h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Pf(d,a)},
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&Qf(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&q(b.value);null==b||0>b||b>=d.c.length||!(a=d.c[b])?d.B("Unable to boot the selected drive"):a.T?(Kc(d.a,0,!0),(a=d.Yb(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.A){c.parentNode.removeChild(c);
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.T)?(a=Ca(Mf(a),a.Qb.replace(".json",".img")),x(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.A)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Qf(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;if(a=Of(this,yc(this.l,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.v[e]=a[e]);Rf(this);this.Ua=$b(this.a,144,5,65536);fb(b,this,Sf);hb(b,this.reset.bind(this));Tf(this,"None","",!0);this.A&&Tf(this,"Local Disk","?");Tf(this,"Remote Disk","??");Uf(this)||G(this)};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if(a=Of(this,yc(this.l,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.v[e]=a[e]);Rf(this);this.Ua=$b(this.a,144,5,65536);fb(b,this,Sf);hb(b,this.reset.bind(this));Tf(this,"None","",!0);this.A&&Tf(this,"Local Disk","?");Tf(this,"Remote Disk","??");Uf(this)||G(this)};
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Lb){for(a=0;a<this.c.length;a++)Vf(this,a,!0);Uf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;8>b;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Pf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Rf(this)};h.save=function(){return(new R(this)).data()};
h.restore=function(a){return Rf(this,a[0])};function Uf(a,b){b||(a.m=0);for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=u(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.c.length)){!Wf(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.m}
h.restore=function(a){return Rf(this,a[0])};function Uf(a,b){b||(a.o=0);for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=u(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.c.length)){!Wf(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.o}
function Qf(a,b,c,d){var e=a.j.listDrives,e=e&&q(e.value);if(void 0===e||0>e||e>=a.c.length)a.B("Unable to load the selected drive");else if(c)if("?"==c)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}Wf(a,e,b,c,!1,d)}else Vf(a,e)}
function Wf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Vf(a,b,!0),k.Ka?a.B("RK11 busy"):(k.Ka=!0,e&&(k.Ja=!0,a.m++),k.xa=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.vc)&&g++));return g}h.vc=function(a,b,c,d,e){a.Ka=!1;b&&(b.K>a.K||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.La)),b=null);b?(a.T=b,a.ra=c,a.ea=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.La),a.Ja||e),this.l&&Ec(this.l)):a.xa=!1;a.Ja&&(a.Ja=!1,--this.m||G(this));Pf(this,a.La)};
function Wf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Vf(a,b,!0),k.La?a.B("RK11 busy"):(k.La=!0,e&&(k.Ka=!0,a.o++),k.xa=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.vc)&&g++));return g}h.vc=function(a,b,c,d,e){a.La=!1;b&&(b.K>a.K||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RK"+a.Ma)),b=null);b?(a.T=b,a.ra=c,a.ea=d,this.B('Loaded disk "'+c+'" in drive '+("RK"+a.Ma),a.Ka||e),this.l&&Ec(this.l)):a.xa=!1;a.Ka&&(a.Ka=!1,--this.o||G(this));Pf(this,a.Ma)};
function Tf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Pf(a,b){if(0<=b&&b<a.c.length){var c=a.c[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=q(a.value),c=c.xa?"?":c.ea,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Vf(a,b,c){var d=a.c[b];if(d.T||!1===c)d.ra="",d.ea="",d.T=null,d.xa=!1,c||(a.B("Drive RK"+b+" unloaded",c),Pf(a,b))}
function Rf(a,b){var c=0;b||(b=[]);a.F=b[c++]||2496;a.i=b[c++]||0;a.b=b[c++]||128;a.u=b[c++]||0;a.s=b[c++]||0;a.f=b[c++]||0;a.C=b[c]||0;for(b=0;b<a.c.length;b++){var d=a.c[b];void 0===d&&(d=a.c[b]={});c=a;d.La=b;d.name=c.Aa;d.Ka=d.xa=!1;d.K=203;d.P=2;d.N=12;d.V=512;d.xb=!0;d.Ec=0;d.Cc=0;d.Gb=1;d.$b=d.N;d.Mb=d.V;d.Kc=0;d.Yd=null;d.T||(d.ea="");d.status=2368}return!0}
function Rf(a,b){var c=0;b||(b=[]);a.G=b[c++]||2496;a.i=b[c++]||0;a.b=b[c++]||128;a.u=b[c++]||0;a.s=b[c++]||0;a.f=b[c++]||0;a.C=b[c]||0;for(b=0;b<a.c.length;b++){var d=a.c[b];void 0===d&&(d=a.c[b]={});c=a;d.Ma=b;d.name=c.Aa;d.La=d.xa=!1;d.K=203;d.P=2;d.N=12;d.W=512;d.xb=!0;d.Ec=0;d.Cc=0;d.Gb=1;d.$b=d.N;d.Mb=d.W;d.Kc=0;d.Yd=null;d.T||(d.ea="");d.status=2368}return!0}
h.uc=function(a,b,c,d,e,f){this.s=f&65535;this.b=this.b&-49|f>>12&48;this.u=65536-e&65535;this.f=this.f&-16|d&15;a&&(this.i=this.i|a|32768,this.b|=49152);return!0};
h.Yb=function(a,b,c,d,e,f,g,k){var l=0;a=a.T;var m=null,p;a||(l=128,e=0);for(;e--;){if(!m){m=a.seek(b,c,d+1);if(!m){l=4096;break}p=0}var t,v;if(0>(t=a.read(m,p++))||0>(v=a.read(m,p++))){l=32;break}if(!g&&(vb(this.h,f,t|v<<8),Wb(this.h))){l=1024;break}f+=2;if(p>=a.V&&(m=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){l=64;break}}return k?k(l,b,c,d,e,f):l};
h.wc=function(a,b,c,d,e,f,g,k){var l=0;a=a.T;var m=null,p;a||(l=128,e=0);for(;e--;){var t=xb(this.h,f);if(Wb(this.h)){l=1024;break}f+=2;if(!m){m=a.seek(b,c,d+1,!0);if(!m){l=4096;break}p=0}if(g){var v,y;if(0>(v=a.read(m,p++))||0>(y=a.read(m,p++))){l=32;break}if(t!=(v|y<<8)){l=1;break}}else if(!a.write(m,p++,t&255)||!a.write(m,p++,t>>8)){l=32;break}if(p>=a.V&&(m=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){l=64;break}}return k?k(l,b,c,d,e,f):l};h.zd=function(){return this.F};h.xe=function(){};
h.Yb=function(a,b,c,d,e,f,g,k){var l=0;a=a.T;var m=null,p;a||(l=128,e=0);for(;e--;){if(!m){m=a.seek(b,c,d+1);if(!m){l=4096;break}p=0}var t,v;if(0>(t=a.read(m,p++))||0>(v=a.read(m,p++))){l=32;break}if(!g&&(vb(this.h,f,t|v<<8),Wb(this.h))){l=1024;break}f+=2;if(p>=a.W&&(m=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){l=64;break}}return k?k(l,b,c,d,e,f):l};
h.wc=function(a,b,c,d,e,f,g,k){var l=0;a=a.T;var m=null,p;a||(l=128,e=0);for(;e--;){var t=xb(this.h,f);if(Wb(this.h)){l=1024;break}f+=2;if(!m){m=a.seek(b,c,d+1,!0);if(!m){l=4096;break}p=0}if(g){var v,y;if(0>(v=a.read(m,p++))||0>(y=a.read(m,p++))){l=32;break}if(t!=(v|y<<8)){l=1;break}}else if(!a.write(m,p++,t&255)||!a.write(m,p++,t>>8)){l=32;break}if(p>=a.W&&(m=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){l=64;break}}return k?k(l,b,c,d,e,f):l};h.zd=function(){return this.G};h.xe=function(){};
h.Ad=function(){return this.i};h.ye=function(){};h.wd=function(){return this.b&61438};
h.ue=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c=(this.f&57344)>>13,d=this.c[c],e,f,g,k,l;this.b&=-129;var m=(this.b&14)>>1;switch(m){case 0:this.i=0;this.b=128;this.f=0;break;case 4:e=(this.f&8160)>>5;e>=d.K&&(this.i|=32832,this.b|=49152);break;case 5:case 2:b=this.Yb;case 3:case 1:b||(b=this.wc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,k=65536-this.u&65535,l=(this.b&48)<<12|this.s,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):a=b.call(this,
d,e,f,g,k,l,3<=m,this.uc.bind(this))}this.F=d.status|(d.T?128:0)|c<<13|this.f&15;a&&(this.b&=-2,this.b|=128,this.b&64&&M(this.a,this.Ua))}};h.Bd=function(){return this.u};h.ze=function(a){this.u=a};h.vd=function(){return this.s};h.te=function(a){this.s=a};h.xd=function(){return this.f};h.ve=function(a){this.f=a};h.yd=function(){return this.C};h.we=function(a){this.C=a};
d,e,f,g,k,l,3<=m,this.uc.bind(this))}this.G=d.status|(d.T?128:0)|c<<13|this.f&15;a&&(this.b&=-2,this.b|=128,this.b&64&&M(this.a,this.Ua))}};h.Bd=function(){return this.u};h.ze=function(a){this.u=a};h.vd=function(){return this.s};h.te=function(a){this.s=a};h.xd=function(){return this.f};h.ve=function(a){this.f=a};h.yd=function(){return this.C};h.we=function(a){this.C=a};
var Xf={},Sf=(Xf[65280]=[null,null,P.prototype.zd,P.prototype.xe,"RKDS"],Xf[65282]=[null,null,P.prototype.Ad,P.prototype.ye,"RKER"],Xf[65284]=[null,null,P.prototype.wd,P.prototype.ue,"RKCS"],Xf[65286]=[null,null,P.prototype.Bd,P.prototype.ze,"RKWC"],Xf[65288]=[null,null,P.prototype.vd,P.prototype.te,"RKBA"],Xf[65290]=[null,null,P.prototype.xd,P.prototype.ve,"RKDA"],Xf[65294]=[null,null,P.prototype.yd,P.prototype.we,"RKDB"],Xf);
function O(a){z.call(this,"RL11",a,O,131072);this.A=Yf(this,a.autoMount);this.u=0;this.c=Array(4);this.C=!Ba("Mobi")&&window&&"FileReader"in window}B(O);function Yf(a,b){if(b&&"string"==typeof b)try{b=eval("("+b+")")}catch(c){x(a.type+" auto-mount error: "+c.message+" ("+b+")"),b=null}return b||{}}h=O.prototype;
h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options&&c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Zf(d,a)},
!0;case "loadDisk":return this.j[b]=c,c.onclick=function(){var a=d.j.listDisks;a&&a.options&&$f(d,a.options[a.selectedIndex].text,a.value)},!0;case "bootDisk":return this.j[b]=c,c.onclick=function(){var a,b=d.j.listDrives,b=b&&q(b.value);null==b||0>b||b>=d.c.length||!(a=d.c[b])?d.B("Unable to boot the selected drive"):a.T?(Kc(d.a,0,!0),(a=d.Zb(a,0,0,0,512,0))&&d.B("Unable to read the boot sector ("+a+")")):d.B("Load a disk into the drive first")},!0;case "saveDisk":if(!this.C){c.parentNode.removeChild(c);
break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.T)?(a=Ca(Mf(a),a.Qb.replace(".json",".img")),x(a)):d.B("No disk loaded in drive."):d.B("No disk drive selected."))};return!0;case "mountDisk":if(this.C)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;$f(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.G=d;if(a=Yf(this,yc(this.l,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);ag(this);this.Ua=$b(this.a,112,5,131072);fb(b,this,bg);hb(b,this.reset.bind(this));cg(this,"None","",!0);this.C&&cg(this,"Local Disk","?");cg(this,"Remote Disk","??");dg(this)||G(this)};
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if(a=Yf(this,yc(this.l,"autoMount")))for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);ag(this);this.Ua=$b(this.a,112,5,131072);fb(b,this,bg);hb(b,this.reset.bind(this));cg(this,"None","",!0);this.C&&cg(this,"Local Disk","?");cg(this,"Remote Disk","??");dg(this)||G(this)};
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Lb){for(a=0;a<this.c.length;a++)eg(this,a,!0);dg(this,!0)}}else if(!this.restore(a))return!1;if(a=this.j.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Zf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){ag(this)};h.save=function(){return(new R(this)).data()};
h.restore=function(a){return ag(this,a[0])};function dg(a,b){b||(a.u=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=u(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.c.length)){!fg(a,g,f,e,!0)&&b&&G(a,!1);continue}a.B("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.u}
function $f(a,b,c,d){var e=a.j.listDrives,e=e&&q(e.value);if(void 0===e||0>e||e>=a.c.length)a.B("Unable to load the selected drive");else if(c)if("?"==c)a.B('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}fg(a,e,b,c,!1,d)}else eg(a,e)}
function fg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,eg(a,b,!0),k.Ka?a.B("RL11 busy"):(k.Ka=!0,e&&(k.Ja=!0,a.u++),k.xa=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.yc)&&g++));return g}h.yc=function(a,b,c,d,e){a.Ka=!1;b&&(b.K>a.K||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.La)),b=null);b?(a.T=b,a.ra=c,a.ea=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.La),a.Ja||e),this.l&&Ec(this.l)):a.xa=!1;a.Ja&&(a.Ja=!1,--this.u||G(this));Zf(this,a.La)};
function fg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,eg(a,b,!0),k.La?a.B("RL11 busy"):(k.La=!0,e&&(k.Ka=!0,a.u++),k.xa=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.yc)&&g++));return g}h.yc=function(a,b,c,d,e){a.La=!1;b&&(b.K>a.K||b.P>a.P)&&(this.B('Disk "'+c+'" too large for drive '+("RL"+a.Ma)),b=null);b?(a.T=b,a.ra=c,a.ea=d,this.B('Loaded disk "'+c+'" in drive '+("RL"+a.Ma),a.Ka||e),this.l&&Ec(this.l)):a.xa=!1;a.Ka&&(a.Ka=!1,--this.u||G(this));Zf(this,a.Ma)};
function cg(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
function Zf(a,b){if(0<=b&&b<a.c.length){var c=a.c[b],d=a.j.listDisks;a=a.j.listDrives;if(d&&a&&d.options&&a.options&&(a=q(a.value),c=c.xa?"?":c.ea,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function eg(a,b,c){var d=a.c[b];if(d.T||!1===c)d.ra="",d.ea="",d.T=null,d.xa=!1,c||(a.B("Drive RL"+b+" unloaded",c),Zf(a,b))}
function ag(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.v=b[c++]||0;a.f=b[c++]||0;a.i=b[c++]||0;a.s=b[c++]||0;a.m=b[c]||0;for(b=0;b<a.c.length;b++){var d=a.c[b];void 0===d&&(d=a.c[b]={});c=a;d.La=b;d.name=c.Aa;d.Ka=d.xa=!1;d.K=512;d.P=2;d.N=40;d.V=256;d.xb=!0;d.Ec=0;d.Cc=0;d.Gb=1;d.$b=d.N;d.Mb=d.V;d.Kc=0;d.Yd=null;d.T||(d.ea="");d.status=29}return!0}
h.xc=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.m=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};
h.Zb=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var p,t;if(0>(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}vb(this.h,Uc(this.a,f),p|t<<8);if(Wb(this.h)){k=8192;break}f+=2;if(m>=a.V&&(l=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
h.zc=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e--;){var p=xb(this.h,Uc(this.a,f));if(Wb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.V&&(l=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};h.Ed=function(){return this.b&65535};
h.Ce=function(a){this.b=this.b&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c=this.c[(this.b&768)>>8],d=c.T,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.Zb;case 10:b||(b=this.zc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>=d.N?
this.b|=37888:(a=65536-this.s&65535,d=(this.m&63)<<16|this.v,a=b.call(this,c,e,f,g,a,d,this.xc.bind(this)))}a&&(this.b|=129,this.b&64&&M(this.a,this.Ua))}};h.Cd=function(){return this.v};h.Ae=function(a){this.v=a&65534};h.Fd=function(){return this.f};h.De=function(a){this.f=a};h.Gd=function(){return this.s};h.Ee=function(a){this.s=a};h.Dd=function(){return this.m};h.Be=function(a){this.m=a&63;this.b=this.b&-49|(this.m&3)<<4};
function ag(a,b){var c=0;b||(b=[]);a.b=b[c++]||129;a.v=b[c++]||0;a.f=b[c++]||0;a.i=b[c++]||0;a.s=b[c++]||0;a.o=b[c]||0;for(b=0;b<a.c.length;b++){var d=a.c[b];void 0===d&&(d=a.c[b]={});c=a;d.Ma=b;d.name=c.Aa;d.La=d.xa=!1;d.K=512;d.P=2;d.N=40;d.W=256;d.xb=!0;d.Ec=0;d.Cc=0;d.Gb=1;d.$b=d.N;d.Mb=d.W;d.Kc=0;d.Yd=null;d.T||(d.ea="");d.status=29}return!0}
h.xc=function(a,b,c,d,e,f){this.v=f&65535;this.b=this.b&-49|f>>12&48;this.o=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0};
h.Zb=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}m=0}var p,t;if(0>(p=a.read(l,m++))||0>(t=a.read(l,m++))){k=5120;break}vb(this.h,Uc(this.a,f),p|t<<8);if(Wb(this.h)){k=8192;break}f+=2;if(m>=a.W&&(l=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};
h.zc=function(a,b,c,d,e,f,g){var k=0;a=a.T;var l=null,m;a||(k=5120,e=0);for(;e--;){var p=xb(this.h,Uc(this.a,f));if(Wb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}m=0}if(!a.write(l,m++,p&255)||!a.write(l,m++,p>>8)){k=5120;break}if(m>=a.W&&(l=null,++d>=a.N&&(d=0,++c>=a.P&&(c=0,++b>=a.K)))){k=5120;break}}return g?g(k,b,c,d,e,f):k};h.Ed=function(){return this.b&65535};
h.Ce=function(a){this.b=this.b&-1023|a&1022;this.o=this.o&60|(a&48)>>4;if(!(this.b&128)){a=!0;var b,c=this.c[(this.b&768)>>8],d=c.T,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.Zb;case 10:b||(b=this.zc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>=d.N?
this.b|=37888:(a=65536-this.s&65535,d=(this.o&63)<<16|this.v,a=b.call(this,c,e,f,g,a,d,this.xc.bind(this)))}a&&(this.b|=129,this.b&64&&M(this.a,this.Ua))}};h.Cd=function(){return this.v};h.Ae=function(a){this.v=a&65534};h.Fd=function(){return this.f};h.De=function(a){this.f=a};h.Gd=function(){return this.s};h.Ee=function(a){this.s=a};h.Dd=function(){return this.o};h.Be=function(a){this.o=a&63;this.b=this.b&-49|(this.o&3)<<4};
var gg={},bg=(gg[63744]=[null,null,O.prototype.Ed,O.prototype.Ce,"RLCS"],gg[63746]=[null,null,O.prototype.Cd,O.prototype.Ae,"RLBA"],gg[63748]=[null,null,O.prototype.Fd,O.prototype.De,"RLDA"],gg[63750]=[null,null,O.prototype.Gd,O.prototype.Ee,"RLMP"],gg[63752]=[null,null,O.prototype.Dd,O.prototype.Be,"RLBE"],gg);
function hg(a,b,c){z.call(this,"Computer",a,hg,33554432);this.o.R=!1;ig(this,b);this.A=yc(this,"autoPower",a);this.l=0;this.L=a.busWidth||a.buswidth;this.b=jg;this.s=null;this.i=this.I=!1;this.S=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=kg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.h=new Bb({id:this.Ba+".bus",busWidth:this.L},this.a,this.G);var d,e=C(this.id);if((this.u=Va("Panel",this.id))&&this.u.kb)for(b=0;b<e.length;b++)d=e[b],d.B=this.u.B,d.W=this.u.W,
d.kb=this.u.kb;this.W("PDPjs v1.30.6\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.W("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ia&&d.ia(this,this.h,this.a,this.G);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=yc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=jg),this.b&&(this.v=
new R(this,"1.30.6"),lg(this.v)?b=null:delete this.v);!b&&this.b&&(b=mg(this))&&(this.i=!0);if(b){var g=this;w(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.s=b,g.I=!0);G(g)})}else G(this);this.j.power||(this.A=!0);!c&&this.A&&ng(this,this.lb)}else x("Unable to find CPU component")}B(hg);var jg=0;
function hg(a,b,c){z.call(this,"Computer",a,hg,33554432);this.m.R=!1;ig(this,b);this.A=yc(this,"autoPower",a);this.l=0;this.L=a.busWidth||a.buswidth;this.b=jg;this.s=null;this.i=this.I=!1;this.S=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=kg(this);if(this.a=Va("CPU",this.id)){this.F=Va("Debugger",this.id);this.h=new Bb({id:this.Ba+".bus",busWidth:this.L},this.a,this.F);var d,e=C(this.id);if((this.u=Va("Panel",this.id))&&this.u.kb)for(b=0;b<e.length;b++)d=e[b],d.B=this.u.B,d.U=this.u.U,
d.kb=this.u.kb;this.U("PDPjs v1.30.6\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.U("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.ia&&d.ia(this,this.h,this.a,this.F);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.o=d:this.b=parseInt(d,10));var f;if(a=yc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=jg),this.b&&(this.v=
new R(this,"1.30.6"),lg(this.v)?b=null:delete this.v);!b&&this.b&&(b=mg(this))&&(this.i=!0);if(b){var g=this;w(b,null,!0,function(a,b,c){c?(g.o=null,g.i=!1,g.B("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.s=b,g.I=!0);G(g)})}else G(this);this.j.power||(this.A=!0);!c&&this.A&&ng(this,this.lb)}else x("Unable to find CPU component")}B(hg);var jg=0;
function ig(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){x(d.message+" ("+c+")")}}a.J=b}function yc(a,b,c){var d=b.toLowerCase(),d=Na[b]||Na[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function ng(a,b,c){for(var d=C(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Xa(f)){Xa(f,function(){ng(a,b,c)});return}}b.call(a,c)}
function og(a,b){var c=new R(a,"1.30.6","validate");if(lg(c)&&pg(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.B("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=hg.prototype;
h.lb=function(a){void 0===a&&(a=this.b||(this.s?1:jg));if(!this.l){this.l++;var b=!1,c=!1;this.F=!1;var d=this.v||new R(this,"1.30.6");if(-1==a)b=!0;else if(a>jg){if(lg(d,this.s)){this.f=new R(this,"1.30.6","failsafe");lg(this.f)&&(qg(this,d),a=2,rg(this.f));this.f.set("timestamp",ra());sg(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=pg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?lg(d,g):("error"==
f&&"no machine state"!=g?(this.B("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.W(f+": "+g),rg(d),lg(d)?(c=pg(d),e=!0):c=!1))}e&&og(this,c?d:null)}else 2==a&&d.clear()}else og(this);delete this.s;delete this.v}e=C(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=vg(this,g,d,b,c));b=[d,a,c];-1!=a?ng(this,this.ac,b):this.ac(b)}};
function vg(a,b,c,d,e){if(!b.o.R){b.o.R=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(x("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=jg,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.cc)for(a=b.cc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
h.ac=function(a){var b=a[0],c=0>a[1];a=a[2];this.U=!0;this.o.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(vg(this,this.a,b,c,a),this.za(),this.a.Ta());this.F&&(qg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0};
h.lb=function(a){void 0===a&&(a=this.b||(this.s?1:jg));if(!this.l){this.l++;var b=!1,c=!1;this.G=!1;var d=this.v||new R(this,"1.30.6");if(-1==a)b=!0;else if(a>jg){if(lg(d,this.s)){this.f=new R(this,"1.30.6","failsafe");lg(this.f)&&(qg(this,d),a=2,rg(this.f));this.f.set("timestamp",ra());sg(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=pg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?lg(d,g):("error"==
f&&"no machine state"!=g?(this.B("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.U(f+": "+g),rg(d),lg(d)?(c=pg(d),e=!0):c=!1))}e&&og(this,c?d:null)}else 2==a&&d.clear()}else og(this);delete this.s;delete this.v}e=C(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=vg(this,g,d,b,c));b=[d,a,c];-1!=a?ng(this,this.ac,b):this.ac(b)}};
function vg(a,b,c,d,e){if(!b.m.R){b.m.R=!0;if(b.ka){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ka(f,d)&&f&&(x("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=jg,window&&window.location.reload()):a.G=!0,b.ka(null),e=!1)}if(!d&&b.cc)for(a=b.cc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
h.ac=function(a){var b=a[0],c=0>a[1];a=a[2];this.V=!0;this.m.R=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(vg(this,this.a,b,c,a),this.za(),this.a.Ea());this.G&&(qg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0};
function qg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.6"};d.url=a.S;d.user=c;d.type="bug";d.data=b;w("http://www.pcjs.org/api/v1/report",d,!0)}}
function wg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new R(a,"1.30.6"),g=new R(a,"1.30.6","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.6");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&H(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.R=!1,!1===d&&(e=null)));for(var k=C(a.id),l=0;l<k.length;l++){var m=k[l];m.o.R&&(m.ja&&(d=m.ja(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.o.R=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&xg(a,a.c,f.toString()),sg(g)&&sg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.o.R=!1,b=a.j.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=C(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.za(-1)};
function wg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new R(a,"1.30.6"),g=new R(a,"1.30.6","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.6");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&H(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.m.R=!1,!1===d&&(e=null)));for(var k=C(a.id),l=0;l<k.length;l++){var m=k[l];m.m.R&&(m.ja&&(d=m.ja(b,c),"object"===typeof d&&f.set(m.id,
d)),c&&(m.m.R=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&xg(a,a.c,f.toString()),sg(g)&&sg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.m.R=!1,b=a.j.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=C(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.za(-1)};
h.start=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.za(-1)};h.stop=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.za(-1)};
h.za=function(a){if(this.a){var b=this.a,c=a||0,d=b.j.speed;d&&(0>=c||30<=(b.Eb+=c))&&(d.textContent=b.o.O?b.Ma.toFixed(2)+"Mhz":"Stopped",b.Eb=0)}if(this.u&&(b=this.u,a=a||0,b.u)){c=b.a.o.O;d=!!(b.a.w&8);if(0>=a||60<=(b.s+=a)){for(var e=0;e<b.a.g.length;e++)nb(b,"R"+e,b.a.g[e]);e=ec(b.a);nb(b,"PS",e);nb(b,"NF",e&8?1:0,1);nb(b,"ZF",e&4?1:0,1);nb(b,"VF",e&2?1:0,1);nb(b,"CF",e&1?1:0,1);b.s=0}yb(b,0<a&&c&&!d?b.a.Sa:b.la);ub(b,b.m);a=b.a;a=a.Oa?a.ya&16?1:2:4;zb(b,"B22",a&1);zb(b,"B18",a&2);zb(b,"B16",
h.za=function(a){if(this.a){var b=this.a,c=a||0,d=b.j.speed;d&&(0>=c||30<=(b.Eb+=c))&&(d.textContent=b.m.O?b.Na.toFixed(2)+"Mhz":"Stopped",b.Eb=0)}if(this.u&&(b=this.u,a=a||0,b.u)){c=b.a.m.O;d=!!(b.a.w&8);if(0>=a||60<=(b.s+=a)){for(var e=0;e<b.a.g.length;e++)nb(b,"R"+e,b.a.g[e]);e=ec(b.a);nb(b,"PS",e);nb(b,"NF",e&8?1:0,1);nb(b,"ZF",e&4?1:0,1);nb(b,"VF",e&2?1:0,1);nb(b,"CF",e&1?1:0,1);b.s=0}yb(b,0<a&&c&&!d?b.a.Ta:b.la);ub(b,b.o);a=b.a;a=a.Pa?a.ya&16?1:2:4;zb(b,"B22",a&1);zb(b,"B18",a&2);zb(b,"B16",
a&4)}};
h.ba=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.l||(d.o.R?wg(d,!1,!0):ng(d,d.lb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.o.R&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");wg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Lb=!0),d.lb(jg),d.Lb=!1)}else d.reset(),d.a&&d.a.Ta()},!0;case "save":if(la(ta(),"pcjs.org"))c.parentNode.removeChild(c);else return this.j[b]=
c,c.onclick=function(){var a=kg(d,!0);if(a){var b=!!(d.b&&!d.m||d.C),c=wg(d,b);b?xg(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
h.ba=function(a,b,c){var d=this;switch(b){case "power":return this.j[b]=c,c.onclick=function(){d.l||(d.m.R?wg(d,!1,!0):ng(d,d.lb))},!0;case "reset":return this.j[b]=c,c.onclick=function(){if(d.m.R&&!d.l)if(d.b&&!d.o){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");wg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Lb=!0),d.lb(jg),d.Lb=!1)}else d.reset(),d.a&&d.a.Ea()},!0;case "save":if(la(ta(),"pcjs.org"))c.parentNode.removeChild(c);else return this.j[b]=
c,c.onclick=function(){var a=kg(d,!0);if(a){var b=!!(d.b&&!d.o||d.C),c=wg(d,b);b?xg(d,a,c):d.B("Resume disabled, machine state not saved")}},!0}return!1};
function kg(a,b){var c=a.c;c||((c=za("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=yg(a,c))||a.B("The user ID is invalid.")):b&&a.B("Browser local storage is not available"));return c}
function yg(a,b){a.c=null;b=w(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Aa("user",b.data),a.c=b.data)}catch(d){x(d.message+" ("+c+")")}return a.c}function mg(a){var b=null;a.c&&(b=ta()+"/api/v1/user?req=load&user="+a.c+"&state="+zg(a,"1.30.6"));return b}
function xg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=zg(a,"1.30.6");d.data=c;b=w(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.B("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.B(c),Aa("user",""),a.c=null)}}
function sf(a){var b;a=C(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}function Ec(a){if(a.kb){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.kb.focus();window&&window.scrollTo(b,c)}}Ia(function(){for(var a=F(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=D(c),c=F(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=D(f),g=new hg(g,d,!0);E(g,f);g.A&&ng(g,g.lb)}});
Da.show.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Va("Computer",c.id))&&c.U&&!c.o.R&&c.lb(-1)}});Da.exit.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Va("Computer",c.id))&&c.o.R&&wg(c,!(!c.b||c.m),!0)}});function R(a,b,c){this.id=a.id;this.key=zg(a,b,c);this.G=a.G;rg(this,a.Oc)}function zg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
Da.show.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Va("Computer",c.id))&&c.V&&!c.m.R&&c.lb(-1)}});Da.exit.push(function(){for(var a=F(document,"pdp11","computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=Va("Computer",c.id))&&c.m.R&&wg(c,!(!c.b||c.o),!0)}});function R(a,b,c){this.id=a.id;this.key=zg(a,b,c);this.F=a.F;rg(this,a.Oc)}function zg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
R.prototype={constructor:R,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){rg(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
1);c=0}}};function rg(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function sg(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);Aa(a.key,c)||(x("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function pg(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){x(c.message||c),b=!1}return b}function lg(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=za(a.key))?(a[a.id]=b,a.a=!0):!1}var Ag=0;
function Bg(a,b,c,d,e,f){e("Loading "+a+"...");w(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):Cg(k,a,b,c,d,e,f)})}