Merge branch 'master' into gh-pages

This commit is contained in:
Jeff Parsons 2016-10-23 09:26:27 -07:00
commit c53fea773e
27 changed files with 141 additions and 139 deletions

View file

@ -12,3 +12,6 @@ PDPjs is currently being tested with the following PDP-11/20 machine configurati
* [PDP-11/20 Boot Test](/devices/pdp11/machine/1120/test/) (with [Debugger](/devices/pdp11/machine/1120/test/debugger/))
* [PDP-11/20 Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/) (with [Debugger](/devices/pdp11/machine/1120/bootstrap/debugger/))
* [PDP-11/20 BASIC Demo](/devices/pdp11/machine/1120/basic/) (with [Debugger](/devices/pdp11/machine/1120/basic/debugger/))
The "Demo" machines come with 16Kb of RAM and a [PC11 Paper Tape Reader](/devices/pdp11/pc11/). The "Boot Test" machine
has 56Kb of RAM.

View file

@ -11,7 +11,7 @@ machines:
PDP-11/20 BASIC Demo
--------------------
This machine pre-loads the [DEC PDP-11 BASIC](/apps/pdp11/tapes/basic/) tape image into 16Kb of RAM:
The machine below pre-loads the [DEC PDP-11 BASIC](/apps/pdp11/tapes/basic/) tape image into 16Kb of RAM:
<ram id="ram" addr="0x0000" size="0x4000" file="/apps/pdp11/tapes/basic/DEC-11-AJPB-PB.json"/>

View file

@ -12,7 +12,7 @@ machines:
PDP-11/20 BASIC Demo (with Debugger)
------------------------------------
This machine pre-loads the [DEC PDP-11 BASIC](/apps/pdp11/tapes/basic/) tape image into 16Kb of RAM:
The machine below pre-loads the [DEC PDP-11 BASIC](/apps/pdp11/tapes/basic/) tape image into 16Kb of RAM:
<ram id="ram" addr="0x0000" size="0x4000" file="/apps/pdp11/tapes/basic/DEC-11-AJPB-PB.json"/>

View file

@ -10,7 +10,7 @@ machines:
PDP-11/20 Bootstrap Loader Demo
-------------------------------
This machine pre-loads the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) code into 16Kb of RAM:
The machine below pre-loads the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) code into 16Kb of RAM:
<ram id="ram" addr="0x0000" size="0x4000" file="/apps/pdp11/boot/bootstrap/BOOTSTRAP-16KB.json"/>

View file

@ -11,7 +11,7 @@ machines:
PDP-11/20 Bootstrap Loader Demo (with Debugger)
-----------------------------------------------
This machine pre-loads the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) code into 16Kb of RAM:
The machine below pre-loads the [Bootstrap Loader](/apps/pdp11/boot/bootstrap/) code into 16Kb of RAM:
<ram id="ram" addr="0x0000" size="0x4000" file="/apps/pdp11/boot/bootstrap/BOOTSTRAP-16KB.json"/>

View file

@ -6,7 +6,7 @@
<cpu id="cpu" model="1120" cycles="6666667"/>
<ram id="ram" addr="0x0000" size="0x4000" file="/apps/pdp11/boot/bootstrap/BOOTSTRAP-16KB.json"/>
<device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print"/>
<serial id="dl11" adapter="0" binding="print" upperCase="true"/>
<panel ref="/devices/pdp11/panel/test/debugger/terminal.xml"/>
<debugger id="debugger" base="8" messages="" commands=""/>
<device ref="/devices/pdp11/pc11/default.xml"/>

View file

@ -6,7 +6,7 @@
<cpu id="cpu" model="1120" cycles="6666667"/>
<ram id="ram" addr="0x0000" size="0x4000" file="/apps/pdp11/boot/bootstrap/BOOTSTRAP-16KB.json"/>
<device id="default" type="default"/>
<serial id="dl11" adapter="0" binding="print"/>
<serial id="dl11" adapter="0" binding="print" upperCase="true"/>
<panel ref="/devices/pdp11/panel/test/terminal.xml"/>
<device ref="/devices/pdp11/pc11/default.xml"/>
</machine>

View file

@ -10,7 +10,7 @@ machines:
PDP-11/20 Boot Test
-------------------
This machine pre-loads the [PDP-11 Boot Test](/apps/pdp11/boot/test/) code into RAM:
The machine below pre-loads the [PDP-11 Boot Test](/apps/pdp11/boot/test/) code into RAM:
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json" load="0xC000" exec="0xC000"/>

View file

@ -11,7 +11,7 @@ machines:
PDP-11/20 Boot Test (with Debugger)
-----------------------------------
This machine pre-loads the [PDP-11 Boot Test](/apps/pdp11/boot/test/) code into RAM:
The machine below pre-loads the [PDP-11 Boot Test](/apps/pdp11/boot/test/) code into RAM:
<ram id="ram" addr="0x0000" size="0xE000" file="/apps/pdp11/boot/test/BOOTTEST.json" load="0xC000" exec="0xC000"/>

View file

@ -7,17 +7,13 @@ permalink: /devices/pdp11/pc11/
PC11 High-Speed Paper Tape Reader/Punch
---------------------------------------
PDPjs implements the PC11 component in [pc11.js](/modules/pdp11/lib/pc11.js).
Machines containing the [PC11 Component](/modules/pdp11/lib/pc11.js) include:
PDPjs machines that contain a PC11 Tape Reader include:
- [Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/)
- [PDP-11/20 Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/) (with [Debugger](/devices/pdp11/machine/1120/bootstrap/debugger/))
- [PDP-11/20 BASIC Demo](/devices/pdp11/machine/1120/basic/) (with [Debugger](/devices/pdp11/machine/1120/basic/debugger/))
We have archived a selection of [Paper Tape Images](/apps/pdp11/tapes/) for use by those machines.
To make it easy for PDPjs machines to load those tapes, we created the following High-Speed Paper Tape Reader (PC11)
Device XML file:
PCjs has archived a selection of [Paper Tape Images](/apps/pdp11/tapes/) for use by those machines, most of which are
listed in the following PC11 Device XML file:
- [Default](/devices/pdp11/pc11/default.xml)
@ -25,7 +21,7 @@ which is typically referenced by a Machine XML file as:
<device ref="/devices/pdp11/pc11/default.xml"/>
Device XML files typically configure the device, list all the resource the device will use, and define UI elements
Device XML files not only configure a device, but also list all the resource the device will use, and define UI elements
used to control the device, such as choosing which tape should be "attached" to the PC11 device. For example:
<?xml version="1.0" encoding="UTF-8"?>

View file

@ -121,7 +121,7 @@ var Tc=[],lc=[B.prototype.Ea,B.prototype.tc,B.prototype.sb,B.prototype.Cd,B.prot
if(Ab)var kc=[B.prototype.Ca,B.prototype.Ub,B.prototype.Tb,B.prototype.qd,B.prototype.Oa,B.prototype.ce],jc=[B.prototype.aa,B.prototype.ra,B.prototype.pa,B.prototype.ya,B.prototype.fa,B.prototype.va],Vc=[B.prototype.Ga,B.prototype.uc,B.prototype.Db,B.prototype.Fd,B.prototype.cb,B.prototype.Xc];
function Wc(a,b){bb.call(this,"CPU",a,Wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Y={};this.Y.Id=b;this.Y.Wd=c;this.Y.Ag=Math.round(this.Y.Id/1E4)/100;this.Y.He=this.Y.Ag*this.Y.Wd;this.la.Ib=!1;this.la.yi=!1;this.la.Cf=a.autoStart;this.la.oj=!1;this.la.Xe=!1;this.Y.Lf=this.Y.kf=0;this.Y.Mf=a.csStart;this.Y.jf=a.csInterval;this.Y.lf=a.csStop;this.Ai=this.Ne.bind(this);xb(this)}jb(Wc);var Xc=["power","reset"];l=Wc.prototype;
l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.ha=d;for(b=0;b<Xc.length;b++)(c=this.qa[Xc[b]])&&this.X.Pb(null,Xc[b],c);this.Tb=Jb(a,"FPU");this.N=Jb(a,"ChipSet");a=Yc(a,"autoStart");null!=a&&(this.la.Cf="true"==a?!0:"false"==a?!1:!!a);xb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.hc=function(a,b){if(!b){if(a&&this.restore){Zc(this);if(!this.restore(a))return!1;$c(this)}else this.reset();this.ha?this.ha.qh():this.O("No debugger detected")}ad(this);return!0};l.gc=function(a){return a?this.save():!0};l.Cf=function(){return this.la.Cf||!this.ha&&void 0===this.qa.run?(this.Ne(!0),!0):!1};l.vj=function(){return 0};
l.hc=function(a,b){if(!b){if(a&&this.restore){Zc(this);if(!this.restore(a))return!1;$c(this)}else this.reset();this.ha?this.ha.qh():this.O("No debugger detected")}ad(this);return!0};l.gc=function(a){return a?this.save():!0};l.Cf=function(){return this.la.Cf||!this.ha&&void 0===this.qa.run?(this.Ne(),!0):!1};l.vj=function(){return 0};
function $c(a){void 0===a.Y.Mf&&(a.Y.Mf=0);void 0===a.Y.jf&&(a.Y.jf=-1);void 0===a.Y.lf&&(a.Y.lf=-1);a.la.Xe=0<=a.Y.Mf&&0<a.Y.jf;a.la.Xe&&(a.Y.Lf=0,a.Y.kf=a.Y.Mf-a.uc)}function bd(a,b){if(a.la.Xe){var c=!1;a.Y.Lf=a.Y.Lf+a.vj()|0;a.Y.kf-=b;0>=a.Y.kf&&(a.Y.kf+=a.Y.jf,c=!0);0<=a.Y.lf&&a.Y.lf<=cd(a)&&(a.Y.jf=a.Y.lf=-1,$c(a),a.Wb(),c=!0);c&&a.O(cd(a)+" cycles: checksum="+r(a.Y.Lf))}}
l.Pb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.qa[b]=c;a=!0;break;case "run":this.qa[b]=c;c.onclick=function(){var a;if(a=d.X)if(a=d.X,a.la.ic)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.la.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.la.ic);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.la.ready?"powered yet":"ready yet"+(b.yg?" (waiting for notification)":""))+".");a=!1}a&&(d.la.Ib?d.Wb(!0):
d.Ne(!0))};a=!0;break;case "speed":this.qa[b]=c;a=!0;break;case "setSpeed":this.qa[b]=c,c.onclick=function(){dd(d,d.Y.Wd<<1,!0)},c.textContent=this.Y.He.toFixed(2)+"Mhz",a=!0}return a};function ed(a,b){a.la.Ib&&(b=a.A-b,a.A-=b,a.fb-=b)}function fd(a,b,c){a.uc+=b;c&&(a.fb=a.A=0)}

View file

@ -108,7 +108,7 @@ var jc=[],Ob=[u.prototype.va,u.prototype.Bb,u.prototype.fb,u.prototype.xc,u.prot
if(fb)var Nb=[u.prototype.ra,u.prototype.ub,u.prototype.Ta,u.prototype.vc,u.prototype.Ea,u.prototype.Ob],Mb=[u.prototype.W,u.prototype.ma,u.prototype.ka,u.prototype.qa,u.prototype.Z,u.prototype.pa],kc=[u.prototype.xa,u.prototype.Cb,u.prototype.pb,u.prototype.yc,u.prototype.Ja,u.prototype.ic];
function lc(a,b){Ka.call(this,"CPU",a,lc);b=a.cycles||b;var c=a.multiplier||1;this.T={};this.T.Yc=b;this.T.Bd=c;this.T.Jf=Math.round(this.T.Yc/1E4)/100;this.T.ve=this.T.Jf*this.T.Bd;this.ea.Nb=!1;this.ea.Oj=!1;this.ea.Le=a.autoStart;this.ea.ni=!1;this.ea.Df=!1;this.T.Lf=this.T.we=0;this.T.Mf=a.csStart;this.T.Qe=a.csInterval;this.T.Re=a.csStop;this.$j=this.sh.bind(this);t(this)}Ta(lc);var mc=["power","reset"];l=lc.prototype;
l.pc=function(a,b,c,d){this.ba=a;this.ia=b;this.Ia=d;for(b=0;b<mc.length;b++)(c=this.la[mc[b]])&&this.ba.zb(null,mc[b],c);this.od=mb(a,"FPU");this.S=mb(a,"ChipSet");a=nc(a,"autoStart");null!=a&&(this.ea.Le="true"==a?!0:"false"==a?!1:!!a);t(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.Ub=function(a,b){if(!b){if(a&&this.restore){oc(this);if(!this.restore(a))return!1;pc(this)}else this.reset();this.rc("No debugger detected")}qc(this);return!0};
l.Tb=function(a){return a?this.save():!0};l.Le=function(){return this.ea.Le||void 0===this.la.run?(this.sh(!0),!0):!1};l.ti=function(){return 0};function pc(a){void 0===a.T.Mf&&(a.T.Mf=0);void 0===a.T.Qe&&(a.T.Qe=-1);void 0===a.T.Re&&(a.T.Re=-1);a.ea.Df=0<=a.T.Mf&&0<a.T.Qe;a.ea.Df&&(a.T.Lf=0,a.T.we=a.T.Mf-a.ad)}
l.Tb=function(a){return a?this.save():!0};l.Le=function(){return this.ea.Le||void 0===this.la.run?(this.sh(),!0):!1};l.ti=function(){return 0};function pc(a){void 0===a.T.Mf&&(a.T.Mf=0);void 0===a.T.Qe&&(a.T.Qe=-1);void 0===a.T.Re&&(a.T.Re=-1);a.ea.Df=0<=a.T.Mf&&0<a.T.Qe;a.ea.Df&&(a.T.Lf=0,a.T.we=a.T.Mf-a.ad)}
l.zb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.la[b]=c;a=!0;break;case "run":this.la[b]=c;c.onclick=function(){var a;if(a=d.ba)if(a=d.ba,a.ea.Vb)a=!0;else{var b=null,c,h=Wa(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.ea.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.ea.Vb);c++);c==h.length&&(b=a);r("The "+b.type+" component ("+b.id+") is not "+(b.ea.ready?"powered yet":"ready yet"+(b.Hf?" (waiting for notification)":""))+".");a=!1}a&&(d.ea.Nb?rc(d,!0):
d.sh(!0))};a=!0;break;case "speed":this.la[b]=c;a=!0;break;case "setSpeed":this.la[b]=c,c.onclick=function(){sc(d,d.T.Bd<<1,!0)},c.textContent=this.T.ve.toFixed(2)+"Mhz",a=!0}return a};function tc(a,b){a.ea.Nb&&(b=a.A-b,a.A-=b,a.mc-=b)}function uc(a,b,c){a.ad+=b;c&&(a.mc=a.A=0)}
function vc(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.T.Bd&&a.T.zd&&(d=a.T.zd/a.T.Jf);a.T.zi=Math.round(1E3/30);a.T.Il=Math.floor(a.T.Yc/c*d);a.T.zg=Math.floor(a.T.Yc/30*d);a.T.Bi=Math.floor(a.T.Yc/60*d);a.T.Ai=Math.floor(a.T.Yc/2*d);b||(a.T.Ue=a.T.zg,a.T.Te=a.T.Bi,a.T.Se=a.T.Ai);a.T.Ag=0}function wc(a,b){var c=a.ad+a.zc+a.mc-a.A;b&&1<a.T.Bd&&a.T.zd>a.T.Jf&&(c=Math.round(c/a.T.Bd));return c}function oc(a){a.T.zd=0;a.ad=a.zc=a.mc=a.A=0;pc(a);sc(a,1)}

View file

@ -298,10 +298,11 @@ CPU8080.prototype.autoStart = function()
*/
if (this.flags.autoStart || (!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
/*
* Now we ALSO set fUpdateFocus when calling runCPU(), on the assumption that in the "auto-starting" context,
* a machine without focus is like a day without sunshine.
* We used to also set fUpdateFocus when calling runCPU(), on the assumption that in the "auto-starting"
* context, a machine without focus is like a day without sunshine, but in reality, focus should only be
* forced when the user takes some other machine-related action.
*/
this.runCPU(true);
this.runCPU();
return true;
}
return false;

View file

@ -306,10 +306,11 @@ CPU.prototype.autoStart = function()
*/
if (this.flags.autoStart || (!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
/*
* Now we ALSO set fUpdateFocus when calling runCPU(), on the assumption that in the "auto-starting" context,
* a machine without focus is like a day without sunshine.
* We used to also set fUpdateFocus when calling runCPU(), on the assumption that in the "auto-starting"
* context, a machine without focus is like a day without sunshine, but in reality, focus should only be
* forced when the user takes some other machine-related action.
*/
this.runCPU(true);
this.runCPU();
return true;
}
return false;

View file

@ -319,10 +319,11 @@ CPUPDP11.prototype.autoStart = function()
*/
if (this.flags.autoStart || (!DEBUGGER || !this.dbg) && this.bindings["run"] === undefined) {
/*
* Now we ALSO set fUpdateFocus when calling startCPU(), on the assumption that in the "auto-starting"
* context, a machine without focus is like a day without sunshine.
* We used to also set fUpdateFocus when calling startCPU(), on the assumption that in the "auto-starting"
* context, a machine without focus is like a day without sunshine, but in reality, focus should only be
* forced when the user takes some other machine-related action.
*/
this.startCPU(true);
this.startCPU();
return true;
}
return false;

View file

@ -55,7 +55,7 @@
<p class="common-copyright">
<!-- When using AWS, the pcjs.org domain must redirect to www.pcjs.org, so let's avoid unnecessary redirects in any absolute URLs -->
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-<!-- pcjs:year --> by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</div>

View file

@ -50,7 +50,7 @@
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</xsl:template>

View file

@ -48,7 +48,7 @@
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</xsl:template>

View file

@ -48,7 +48,7 @@
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</xsl:template>

View file

@ -77,7 +77,7 @@ function xb(a,b,c){a.I=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc
var lc=[],fc=[G.prototype.Y,G.prototype.hb,G.prototype.fa,G.prototype.wa],hc=[G.prototype.O,G.prototype.ja,G.prototype.ca,G.prototype.ma];if(qb)var ec=[G.prototype.M,G.prototype.ha,G.prototype.ba,G.prototype.la],dc=[G.prototype.P,G.prototype.gb,G.prototype.ea,G.prototype.na];
function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.eb=this.ha*this.Sa;this.C.za=!1;this.C.Vb=!1;this.C.vb=a.autoStart;this.C.yc=!1;this.C.jb=!1;this.xb=this.O=0;this.yb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.w=[];this.Ha=this.fb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype;
l.Ra=function(a,b,c,d){this.A=a;this.u=b;this.I=d;for(b=0;b<nc.length;b++)(c=this.N[nc[b]])&&this.A.qa(null,nc[b],c);this.F=ub(a,"ChipSet");a=Ac(a,"autoStart");null!=a&&(this.C.vb="true"==a?!0:"false"==a?!1:!!a);F(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.Ga=function(a,b){if(!b){if(a&&this.restore){Bc(this);if(!this.restore(a))return!1;Cc(this)}else this.reset();this.I?(a=this.I,a.g("Type ? for help with PC8080 Debugger commands"),a.La(),a.Ba&&(b=a.Ba,a.Ba=null,Dc(a,b))):this.g("No debugger detected")}Ec(this);return!0};l.Ka=function(a){return a?this.save():!0};l.vb=function(){return this.C.vb||!this.I&&void 0===this.N.run?(this.fb(!0),!0):!1};l.Bc=function(){return 0};
l.Ga=function(a,b){if(!b){if(a&&this.restore){Bc(this);if(!this.restore(a))return!1;Cc(this)}else this.reset();this.I?(a=this.I,a.g("Type ? for help with PC8080 Debugger commands"),a.La(),a.Ba&&(b=a.Ba,a.Ba=null,Dc(a,b))):this.g("No debugger detected")}Ec(this);return!0};l.Ka=function(a){return a?this.save():!0};l.vb=function(){return this.C.vb||!this.I&&void 0===this.N.run?(this.fb(),!0):!1};l.Bc=function(){return 0};
function Cc(a){void 0===a.yb&&(a.yb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.C.jb=0<=a.yb&&0<a.lb;a.C.jb&&(a.xb=0,a.O=a.yb-a.M)}function Fc(a,b){if(a.C.jb){var c=!1;a.xb=a.xb+a.Bc()|0;a.O-=b;0>=a.O&&(a.O+=a.lb,c=!0);0<=a.mb&&a.mb<=Gc(a)&&(a.lb=a.mb=-1,Cc(a),a.ra(),c=!0);c&&a.g(Gc(a)+" cycles: checksum="+t(a.xb))}}
l.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.xa)a=!0;else{var b=null,c,h=db(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.xa);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.C.ready?"powered yet":"ready yet"+(b.Hb?" (waiting for notification)":""))+".");a=!1}a&&(d.C.za?d.ra():d.fb())};
a=!0;break;case "speed":this.N[b]=c;a=!0;break;case "setSpeed":this.N[b]=c,c.onclick=function(){Hc(d,d.Sa<<1,!0)},c.textContent=this.eb.toFixed(2)+"Mhz",a=!0}return a};function Ic(a,b,c){a.M+=b;c&&(a.L=a.b=0)}function Jc(a,b){var c=1;b&&1<a.Sa&&a.K&&(c=a.K/a.ha);a.wa=Math.round(1E3/30);a.fa=Math.floor(a.Y/30*c);b||(a.P=a.fa);a.ja=0}function Gc(a){return a.M+a.H+a.L-a.b}function Bc(a){a.K=0;a.Ba=0;a.M=a.H=a.L=a.b=0;Cc(a);Hc(a,1)}

View file

@ -68,7 +68,7 @@ b,c){this.c||this.X(a,b,c)},u:function(a){return this.b[a]},B:function(a){return
function wb(a,b,c){c&&a.g||(a.Va=!a.c&&b[1]||a.o,a.pd=!a.c&&b[3]||a.s);if(c||void 0===c)a.Lb=b[1]||a.o,a.X=b[3]||a.s}function ub(a,b,c){c&&a.f||(a.Ua=b[0]||a.m,a.od=b[2]||a.A);if(c||void 0===c)a.gb=b[0]||a.m,a.Ib=b[2]||a.A}function qb(a,b){b||(b=xb);ub(a,b,void 0);wb(a,b,void 0)}var xb=[],tb=[C.prototype.C,C.prototype.S,C.prototype.I,C.prototype.Z],vb=[C.prototype.v,C.prototype.N,C.prototype.H,C.prototype.W];
if(Ta)var sb=[C.prototype.u,C.prototype.L,C.prototype.G,C.prototype.U],rb=[C.prototype.B,C.prototype.R,C.prototype.M,C.prototype.za];function yb(a,b){r.call(this,"CPU",a,yb);var c=a.multiplier||1;this.ma=a.cycles||b;this.L=c;this.Ha=Math.round(this.ma/1E4)/100;this.U=this.Ha*this.L;this.l.pa=!1;this.l.Jb=!1;this.l.Sa=a.autoStart;this.l.Cb=!1;this.l.ab=!1;this.ua=this.X=0;this.va=a.csStart;this.Z=a.csInterval;this.ja=a.csStop;this.G=[];this.Za=this.lb.bind(this);B(this)}w(yb);var zb=["power","reset"];
k=yb.prototype;k.ra=function(a,b,c,d){this.A=a;this.j=b;this.O=d;for(b=0;b<zb.length;b++)(c=this.w[zb[b]])&&this.A.V(null,zb[b],c);this.M=Wa(a,"ChipSet");a=Ab(a,"autoStart");null!=a&&(this.l.Sa="true"==a?!0:"false"==a?!1:!!a);B(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.ga=function(a,b){if(!b){if(a&&this.restore){Bb(this);if(!this.restore(a))return!1;Cb(this)}else this.reset();this.ea("No debugger detected")}Db(this);return!0};
k.ia=function(a){return a?this.save():!0};k.Sa=function(){return this.l.Sa||void 0===this.w.run?(this.lb(!0),!0):!1};k.Fb=function(){return 0};function Cb(a){void 0===a.va&&(a.va=0);void 0===a.Z&&(a.Z=-1);void 0===a.ja&&(a.ja=-1);a.l.ab=0<=a.va&&0<a.Z;a.l.ab&&(a.ua=0,a.X=a.va-a.H)}
k.ia=function(a){return a?this.save():!0};k.Sa=function(){return this.l.Sa||void 0===this.w.run?(this.lb(),!0):!1};k.Fb=function(){return 0};function Cb(a){void 0===a.va&&(a.va=0);void 0===a.Z&&(a.Z=-1);void 0===a.ja&&(a.ja=-1);a.l.ab=0<=a.va&&0<a.Z;a.l.ab&&(a.ua=0,a.X=a.va-a.H)}
k.V=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.l.Y)a=!0;else{var b=null,c,h=Ma(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.l.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.l.Y);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.l.ready?"powered yet":"ready yet"+(b.cb?" (waiting for notification)":""))+".");a=!1}a&&(d.l.pa?Eb(d):d.lb())};a=!0;
break;case "speed":this.w[b]=c;a=!0;break;case "setSpeed":this.w[b]=c,c.onclick=function(){Fb(d,d.L<<1,!0)},c.textContent=this.U.toFixed(2)+"Mhz",a=!0}return a};function Gb(a,b){var c=1;b&&1<a.L&&a.R&&(c=a.R/a.Ha);a.Pa=Math.round(1E3/30);a.Ba=Math.floor(a.ma/30*c);b||(a.la=a.Ba);a.Ia=0}function Hb(a){return a.H+a.N+a.W-a.a}function Bb(a){a.R=0;a.Qa=0;a.H=a.N=a.W=a.a=0;Cb(a);Fb(a,1)}
function Fb(a,b,c){if(void 0!==b){.8>a.R/a.U&&(b=1);a.L=b;b=a.Ha*a.L;if(a.U!=b){a.U=b;b=a.U.toFixed(2)+"Mhz";var d=a.w.setSpeed;d&&(d.textContent=b);a.ea("target speed: "+b)}c&&a.A&&Ib(a.A)}a.H+=a.N;a.N=0;a.I=ja();a.S=0;Gb(a)}function Jb(a,b){var c=a.G.length;a.G.push([-1,b]);return c}function Kb(a,b,c){0<=b&&b<a.G.length&&0>a.G[b][0]&&(c*=a.ma*a.L/1E3,a.G[b][0]=c+Mb(a))}function Mb(a,b){var c=a.W-=a.a;a.a=0;b&&(a.W=0);return c}

View file

@ -48,7 +48,7 @@
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</xsl:template>

View file

@ -121,7 +121,7 @@ var Tc=[],lc=[B.prototype.Ea,B.prototype.tc,B.prototype.sb,B.prototype.Cd,B.prot
if(Ab)var kc=[B.prototype.Ca,B.prototype.Ub,B.prototype.Tb,B.prototype.qd,B.prototype.Oa,B.prototype.ce],jc=[B.prototype.aa,B.prototype.ra,B.prototype.pa,B.prototype.ya,B.prototype.fa,B.prototype.va],Vc=[B.prototype.Ga,B.prototype.uc,B.prototype.Db,B.prototype.Fd,B.prototype.cb,B.prototype.Xc];
function Wc(a,b){bb.call(this,"CPU",a,Wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Y={};this.Y.Id=b;this.Y.Wd=c;this.Y.Ag=Math.round(this.Y.Id/1E4)/100;this.Y.He=this.Y.Ag*this.Y.Wd;this.la.Ib=!1;this.la.yi=!1;this.la.Cf=a.autoStart;this.la.oj=!1;this.la.Xe=!1;this.Y.Lf=this.Y.kf=0;this.Y.Mf=a.csStart;this.Y.jf=a.csInterval;this.Y.lf=a.csStop;this.Ai=this.Ne.bind(this);xb(this)}jb(Wc);var Xc=["power","reset"];l=Wc.prototype;
l.Ic=function(a,b,c,d){this.X=a;this.ga=b;this.ha=d;for(b=0;b<Xc.length;b++)(c=this.qa[Xc[b]])&&this.X.Pb(null,Xc[b],c);this.Tb=Jb(a,"FPU");this.N=Jb(a,"ChipSet");a=Yc(a,"autoStart");null!=a&&(this.la.Cf="true"==a?!0:"false"==a?!1:!!a);xb(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.hc=function(a,b){if(!b){if(a&&this.restore){Zc(this);if(!this.restore(a))return!1;$c(this)}else this.reset();this.ha?this.ha.qh():this.O("No debugger detected")}ad(this);return!0};l.gc=function(a){return a?this.save():!0};l.Cf=function(){return this.la.Cf||!this.ha&&void 0===this.qa.run?(this.Ne(!0),!0):!1};l.vj=function(){return 0};
l.hc=function(a,b){if(!b){if(a&&this.restore){Zc(this);if(!this.restore(a))return!1;$c(this)}else this.reset();this.ha?this.ha.qh():this.O("No debugger detected")}ad(this);return!0};l.gc=function(a){return a?this.save():!0};l.Cf=function(){return this.la.Cf||!this.ha&&void 0===this.qa.run?(this.Ne(),!0):!1};l.vj=function(){return 0};
function $c(a){void 0===a.Y.Mf&&(a.Y.Mf=0);void 0===a.Y.jf&&(a.Y.jf=-1);void 0===a.Y.lf&&(a.Y.lf=-1);a.la.Xe=0<=a.Y.Mf&&0<a.Y.jf;a.la.Xe&&(a.Y.Lf=0,a.Y.kf=a.Y.Mf-a.uc)}function bd(a,b){if(a.la.Xe){var c=!1;a.Y.Lf=a.Y.Lf+a.vj()|0;a.Y.kf-=b;0>=a.Y.kf&&(a.Y.kf+=a.Y.jf,c=!0);0<=a.Y.lf&&a.Y.lf<=cd(a)&&(a.Y.jf=a.Y.lf=-1,$c(a),a.Wb(),c=!0);c&&a.O(cd(a)+" cycles: checksum="+r(a.Y.Lf))}}
l.Pb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.qa[b]=c;a=!0;break;case "run":this.qa[b]=c;c.onclick=function(){var a;if(a=d.X)if(a=d.X,a.la.ic)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.la.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.la.ic);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.la.ready?"powered yet":"ready yet"+(b.yg?" (waiting for notification)":""))+".");a=!1}a&&(d.la.Ib?d.Wb(!0):
d.Ne(!0))};a=!0;break;case "speed":this.qa[b]=c;a=!0;break;case "setSpeed":this.qa[b]=c,c.onclick=function(){dd(d,d.Y.Wd<<1,!0)},c.textContent=this.Y.He.toFixed(2)+"Mhz",a=!0}return a};function ed(a,b){a.la.Ib&&(b=a.A-b,a.A-=b,a.fb-=b)}function fd(a,b,c){a.uc+=b;c&&(a.fb=a.A=0)}

View file

@ -108,7 +108,7 @@ var jc=[],Ob=[u.prototype.va,u.prototype.Bb,u.prototype.fb,u.prototype.xc,u.prot
if(fb)var Nb=[u.prototype.ra,u.prototype.ub,u.prototype.Ta,u.prototype.vc,u.prototype.Ea,u.prototype.Ob],Mb=[u.prototype.W,u.prototype.ma,u.prototype.ka,u.prototype.qa,u.prototype.Z,u.prototype.pa],kc=[u.prototype.xa,u.prototype.Cb,u.prototype.pb,u.prototype.yc,u.prototype.Ja,u.prototype.ic];
function lc(a,b){Ka.call(this,"CPU",a,lc);b=a.cycles||b;var c=a.multiplier||1;this.T={};this.T.Yc=b;this.T.Bd=c;this.T.Jf=Math.round(this.T.Yc/1E4)/100;this.T.ve=this.T.Jf*this.T.Bd;this.ea.Nb=!1;this.ea.Oj=!1;this.ea.Le=a.autoStart;this.ea.ni=!1;this.ea.Df=!1;this.T.Lf=this.T.we=0;this.T.Mf=a.csStart;this.T.Qe=a.csInterval;this.T.Re=a.csStop;this.$j=this.sh.bind(this);t(this)}Ta(lc);var mc=["power","reset"];l=lc.prototype;
l.pc=function(a,b,c,d){this.ba=a;this.ia=b;this.Ia=d;for(b=0;b<mc.length;b++)(c=this.la[mc[b]])&&this.ba.zb(null,mc[b],c);this.od=mb(a,"FPU");this.S=mb(a,"ChipSet");a=nc(a,"autoStart");null!=a&&(this.ea.Le="true"==a?!0:"false"==a?!1:!!a);t(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};l.Ub=function(a,b){if(!b){if(a&&this.restore){oc(this);if(!this.restore(a))return!1;pc(this)}else this.reset();this.rc("No debugger detected")}qc(this);return!0};
l.Tb=function(a){return a?this.save():!0};l.Le=function(){return this.ea.Le||void 0===this.la.run?(this.sh(!0),!0):!1};l.ti=function(){return 0};function pc(a){void 0===a.T.Mf&&(a.T.Mf=0);void 0===a.T.Qe&&(a.T.Qe=-1);void 0===a.T.Re&&(a.T.Re=-1);a.ea.Df=0<=a.T.Mf&&0<a.T.Qe;a.ea.Df&&(a.T.Lf=0,a.T.we=a.T.Mf-a.ad)}
l.Tb=function(a){return a?this.save():!0};l.Le=function(){return this.ea.Le||void 0===this.la.run?(this.sh(),!0):!1};l.ti=function(){return 0};function pc(a){void 0===a.T.Mf&&(a.T.Mf=0);void 0===a.T.Qe&&(a.T.Qe=-1);void 0===a.T.Re&&(a.T.Re=-1);a.ea.Df=0<=a.T.Mf&&0<a.T.Qe;a.ea.Df&&(a.T.Lf=0,a.T.we=a.T.Mf-a.ad)}
l.zb=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.la[b]=c;a=!0;break;case "run":this.la[b]=c;c.onclick=function(){var a;if(a=d.ba)if(a=d.ba,a.ea.Vb)a=!0;else{var b=null,c,h=Wa(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.ea.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.ea.Vb);c++);c==h.length&&(b=a);r("The "+b.type+" component ("+b.id+") is not "+(b.ea.ready?"powered yet":"ready yet"+(b.Hf?" (waiting for notification)":""))+".");a=!1}a&&(d.ea.Nb?rc(d,!0):
d.sh(!0))};a=!0;break;case "speed":this.la[b]=c;a=!0;break;case "setSpeed":this.la[b]=c,c.onclick=function(){sc(d,d.T.Bd<<1,!0)},c.textContent=this.T.ve.toFixed(2)+"Mhz",a=!0}return a};function tc(a,b){a.ea.Nb&&(b=a.A-b,a.A-=b,a.mc-=b)}function uc(a,b,c){a.ad+=b;c&&(a.mc=a.A=0)}
function vc(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1<a.T.Bd&&a.T.zd&&(d=a.T.zd/a.T.Jf);a.T.zi=Math.round(1E3/30);a.T.Il=Math.floor(a.T.Yc/c*d);a.T.zg=Math.floor(a.T.Yc/30*d);a.T.Bi=Math.floor(a.T.Yc/60*d);a.T.Ai=Math.floor(a.T.Yc/2*d);b||(a.T.Ue=a.T.zg,a.T.Te=a.T.Bi,a.T.Se=a.T.Ai);a.T.Ag=0}function wc(a,b){var c=a.ad+a.zc+a.mc-a.A;b&&1<a.T.Bd&&a.T.zd>a.T.Jf&&(c=Math.round(c/a.T.Bd));return c}function oc(a){a.T.zd=0;a.ad=a.zc=a.mc=a.A=0;pc(a);sc(a,1)}

View file

@ -48,7 +48,7 @@
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> © 2012-2016 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
<span class="common-copyright"><a href="http://github.com/jeffpar/pcjs">PCjs</a> machines released under <a href="http://gnu.org/licenses/gpl.html">GPLv3</a></span>
</p>
</div>
</xsl:template>

View file

@ -99,7 +99,7 @@ b)+")",!0)}};function Sb(a,b,c){a.i=b;a.I=a.B=0;c&&((a.I=c.I)&&Kc(a,Jc,!1),(a.B=
var Nc=[],Hc=[I.prototype.R,I.prototype.Sa,I.prototype.ka,I.prototype.Aa],Jc=[I.prototype.O,I.prototype.ra,I.prototype.Y,I.prototype.$a];if(sb)var Gc=[I.prototype.N,I.prototype.ma,I.prototype.X,I.prototype.va],Fc=[I.prototype.P,I.prototype.sa,I.prototype.da,I.prototype.za];
function Oc(a,b){r.call(this,"CPU",a,Oc,1);var c=a.multiplier||1;this.Ra=a.cycles||b;this.Na=c;this.qb=Math.round(this.Ra/1E4)/100;this.Xa=this.qb*this.Na;this.v.ca=!1;this.v.Ib=!1;this.v.ab=a.autoStart;this.v.cb=!1;this.ub=this.ma=0;this.vb=a.csStart;this.gb=a.csInterval;this.hb=a.csStop;this.K=[];this.dc=this.hd.bind(this);H(this)}u(Oc);var Pc=["power","reset"];k=Oc.prototype;
k.Ca=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b<Pc.length;b++)(c=this.I[Pc[b]])&&this.B.qa(null,Pc[b],c);a=Qc(a,"autoStart");null!=a&&(this.v.ab="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.ya=function(a,b){if(!b){if(a&&this.restore){Rc(this);if(!this.restore(a))return!1;Sc(this)}else this.reset();this.i?(a=this.i,b=this.v.ab,a.Ua=!0,a.j("Type ? for help with PDP11 Debugger commands"),a.ba(),b||a.lb(),a.Aa&&(b=a.Aa,a.Aa=null,Tc(a,b))):this.j("No debugger detected")}this.B.ba();return!0};k.xa=function(a){return a?this.save():!0};k.ab=function(){return this.v.ab||!this.i&&void 0===this.I.run?(this.mb(!0),!0):!1};k.Yb=function(){return 0};
k.ya=function(a,b){if(!b){if(a&&this.restore){Rc(this);if(!this.restore(a))return!1;Sc(this)}else this.reset();this.i?(a=this.i,b=this.v.ab,a.Ua=!0,a.j("Type ? for help with PDP11 Debugger commands"),a.ba(),b||a.lb(),a.Aa&&(b=a.Aa,a.Aa=null,Tc(a,b))):this.j("No debugger detected")}this.B.ba();return!0};k.xa=function(a){return a?this.save():!0};k.ab=function(){return this.v.ab||!this.i&&void 0===this.I.run?(this.mb(),!0):!1};k.Yb=function(){return 0};
function Sc(a){void 0===a.vb&&(a.vb=0);void 0===a.gb&&(a.gb=-1);void 0===a.hb&&(a.hb=-1);a.v.cb=0<=a.vb&&0<a.gb;a.v.cb&&(a.ub=0,a.ma=a.vb-a.ka)}function Uc(a,b){if(a.v.cb){var c=!1;a.ub=a.ub+a.Yb()|0;a.ma-=b;0>=a.ma&&(a.ma+=a.gb,c=!0);0<=a.hb&&a.hb<=Vc(a)&&(a.gb=a.hb=-1,Sc(a),a.fa(),c=!0);c&&a.j(Vc(a)+" cycles: checksum="+l(a.ub))}}
k.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ja)a=!0;else{var b=null,c,h=kb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.v.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.v.ja);c++);c==h.length&&(b=a);n("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.Cb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ca?d.fa():d.mb())},
!0;case "speed":return this.I[b]=c,!0;case "setSpeed":return this.I[b]=c,c.onclick=function(){Wc(d,d.Na<<1,!0)},c.textContent=this.Xa.toFixed(2)+"Mhz",!0}return!1};k.ba=function(){var a=this.I.speed;a&&(a.textContent=this.v.ca&&this.X?this.X.toFixed(2)+"Mhz":"Stopped")};function Xc(a,b,c){a.ka+=b;c&&(a.da=a.b=a.J=0)}function Yc(a,b){var c=1;b&&1<a.Na&&a.X&&(c=a.X/a.qb);a.ac=Math.round(1E3/30);a.Va=Math.floor(a.Ra/30*c);b||(a.ra=a.Va);a.sb=0}function Vc(a){return a.ka+a.P+a.da-a.b}

View file

@ -90,111 +90,111 @@ b,!0);this.na=!0},ua:function(a,b,c){a&1&&H(this.j,c);this.s[a>>1]=b;this.na=!0}
var Pb=[],Lb=[F.prototype.L,F.prototype.ha,F.prototype.ca,F.prototype.va],Nb=[F.prototype.G,F.prototype.ea,F.prototype.P,F.prototype.ja];if(Ua)var Kb=[F.prototype.C,F.prototype.da,F.prototype.M,F.prototype.ia],Jb=[F.prototype.J,F.prototype.ga,F.prototype.W,F.prototype.ua];
function Qb(a,b){u.call(this,"CPU",a,Qb);var c=a.multiplier||1;this.Ta=a.cycles||b;this.ea=c;this.ab=Math.round(this.Ta/1E4)/100;this.ga=this.ab*this.ea;this.i.X=!1;this.i.yb=!1;this.i.Fa=a.autoStart;this.i.Sa=!1;this.Qa=this.ia=0;this.Ra=a.csStart;this.ua=a.csInterval;this.va=a.csStop;this.H=[];this.ub=this.tc.bind(this);C(this)}w(Qb);var Rb=["power","reset"];g=Qb.prototype;
g.fa=function(a,b,c,d){this.o=a;this.j=b;this.D=d;for(b=0;b<Rb.length;b++)(c=this.u[Rb[b]])&&this.o.Y(null,Rb[b],c);a=Sb(a,"autoStart");null!=a&&(this.i.Fa="true"==a?!0:"false"==a?!1:!!a);C(this)};g.reset=function(){};g.save=function(){return null};g.restore=function(){return!1};g.$=function(a,b){if(!b){if(a&&this.restore){Tb(this);if(!this.restore(a))return!1;Ub(this)}else this.reset();this.R("No debugger detected")}this.o.ba();return!0};g.Z=function(a){return a?this.save():!0};
g.Fa=function(){return this.i.Fa||void 0===this.u.run?(Vb(this,!0),!0):!1};g.ob=function(){return 0};function Ub(a){void 0===a.Ra&&(a.Ra=0);void 0===a.ua&&(a.ua=-1);void 0===a.va&&(a.va=-1);a.i.Sa=0<=a.Ra&&0<a.ua;a.i.Sa&&(a.Qa=0,a.ia=a.Ra-a.L)}
g.Fa=function(){return this.i.Fa||void 0===this.u.run?(Vb(this),!0):!1};g.ob=function(){return 0};function Ub(a){void 0===a.Ra&&(a.Ra=0);void 0===a.ua&&(a.ua=-1);void 0===a.va&&(a.va=-1);a.i.Sa=0<=a.Ra&&0<a.ua;a.i.Sa&&(a.Qa=0,a.ia=a.Ra-a.L)}
g.Y=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.u[b]=c,!0;case "run":return this.u[b]=c,c.onclick=function(){var a;if(a=d.o)if(a=d.o,a.i.O)a=!0;else{var b=null,c,l=x(a.id);for(c=0;c<l.length&&(b=l[c],b===a||b.i.ready);c++);if(c==l.length)for(c=0;c<l.length&&(b=l[c],b===a||b.i.O);c++);c==l.length&&(b=a);m("The "+b.type+" component ("+b.id+") is not "+(b.i.ready?"powered yet":"ready yet"+(b.Va?" (waiting for notification)":""))+".");a=!1}a&&(d.i.X?D(d):Vb(d))},!0;case "speed":return this.u[b]=
c,!0;case "setSpeed":return this.u[b]=c,c.onclick=function(){Wb(d,d.ea<<1,!0)},c.textContent=this.ga.toFixed(2)+"Mhz",!0}return!1};g.ba=function(){var a=this.u.speed;a&&(a.textContent=this.i.X&&this.ca?this.ca.toFixed(2)+"Mhz":"Stopped")};function Xb(a,b){var c=1;b&&1<a.ea&&a.ca&&(c=a.ca/a.ab);a.sb=Math.round(1E3/30);a.Ua=Math.floor(a.Ta/30*c);b||(a.Da=a.Ua);a.cb=0}function Yb(a){return a.L+a.V+a.ha-a.a}function Tb(a){a.ca=0;a.tb=0;a.L=a.V=a.ha=a.a=a.G=0;Ub(a);Wb(a,1)}
function Wb(a,b,c){if(void 0!==b){.8>a.ca/a.ga&&(b=1);a.ea=b;b=a.ab*a.ea;if(a.ga!=b){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var d=a.u.setSpeed;d&&(d.textContent=b);a.R("target speed: "+b)}c&&a.o&&Zb(a.o)}a.L+=a.V;a.V=0;a.P=sa();a.da=0;Xb(a)}function vb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function xb(a,b,c){0<=b&&b<a.H.length&&0>a.H[b][0]&&(c=a.Ta*a.ea/1E3*c|0,a.H[b][0]=c+$b(a))}function $b(a,b){var c=a.ha-=a.a;a.a=a.G=0;b&&(a.ha=0);return c}
g.tc=function(){if(this.i.X){this.cb>=this.Ta&&Xb(this,!0);this.Ea=0;this.Pa=sa();if(this.da){var a=this.Pa-this.da;a>this.sb&&(this.P+=a,this.P>this.Pa&&(this.P=this.Pa))}try{do{for(var b,c=this.i.Sa?1:this.Ua,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.zb(b)}catch(n){if("number"!=typeof n)throw n;}b=$b(this,!0);this.Ea+=b;this.V+=b;a=b;if(this.i.Sa){var f=!1;this.Qa=this.Qa+this.ob()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.ua,f=!0);0<=this.va&&this.va<=Yb(this)&&
function Wb(a,b,c){if(void 0!==b){.8>a.ca/a.ga&&(b=1);a.ea=b;b=a.ab*a.ea;if(a.ga!=b){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var d=a.u.setSpeed;d&&(d.textContent=b);a.R("target speed: "+b)}c&&a.o&&(c=a.o,c.Ga&&(d=b=0,window&&(b=window.scrollX,d=window.scrollY),c.Ga.focus(),window&&window.scrollTo(b,d)))}a.L+=a.V;a.V=0;a.P=sa();a.da=0;Xb(a)}function vb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function xb(a,b,c){0<=b&&b<a.H.length&&0>a.H[b][0]&&(c=a.Ta*a.ea/1E3*c|0,a.H[b][0]=c+Zb(a))}
function Zb(a,b){var c=a.ha-=a.a;a.a=a.G=0;b&&(a.ha=0);return c}
g.tc=function(){if(this.i.X){this.cb>=this.Ta&&Xb(this,!0);this.Ea=0;this.Pa=sa();if(this.da){var a=this.Pa-this.da;a>this.sb&&(this.P+=a,this.P>this.Pa&&(this.P=this.Pa))}try{do{for(var b,c=this.i.Sa?1:this.Ua,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.zb(b)}catch(n){if("number"!=typeof n)throw n;}b=Zb(this,!0);this.Ea+=b;this.V+=b;a=b;if(this.i.Sa){var f=!1;this.Qa=this.Qa+this.ob()|0;this.ia-=a;0>=this.ia&&(this.ia+=this.ua,f=!0);0<=this.va&&this.va<=Yb(this)&&
(this.ua=this.va=-1,Ub(this),D(this),f=!0);f&&this.R(Yb(this)+" cycles: checksum="+ja(this.Qa))}for(var a=b,h=this.H.length-1;0<=h;h--){var l=this.H[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.Da-=b;if(0>=this.Da){this.Da+=this.Ua;15<=++this.tb&&(this.o&&this.o.ba(),this.tb=0);break}}while(this.i.X)}catch(n){D(this);this.o&&this.o.stop(sa(),Yb(this));b=n.stack||n.message;this.i.error=!0;this.K(b);return}if(this.i.X){b=setTimeout;c=this.ub;this.da=sa();d=this.sb;this.Ea&&(d=Math.round(d*this.Ea/
this.Ua));d-=this.da-this.Pa;if(e=this.da-this.P)this.ca=Math.round(this.V/(10*e))/100,864E5<=e&&(this.L=0,Wb(this));if(0>d||this.ca<this.ga)-1E3>d&&(this.P-=d),d=0;this.cb+=this.Ea;this.da+=d;b(c,d)}}};function Vb(a,b){var c;a.i.error?(a.R(a.toString()+" error"),c=!0):c=!1;if(!c)if(a.i.X)a.R(a.toString()+" busy");else{Wb(a);a.i.X=!0;a.i.yb=!0;if(c=a.u.run)c.textContent="Halt";a.o&&(b&&Zb(a.o,!0),a.o.start(a.P,Yb(a)));setTimeout(a.ub,0)}}g.zb=function(){return 0};
function D(a){if(a.i.X){$b(a);a.L+=a.V;a.V=0;a.i.X=!1;var b=a.u.run;b&&(b.textContent="Run");a.o&&a.o.stop(sa(),Yb(a))}a.i.complete=void 0}function ac(a){this.Ka=+a.model||1170;this.qb=a.addrReset||0;Qb.call(this,a,6666667);this.decode=1120==this.Ka?bc.bind(this):cc.bind(this);dc(this);this.eb=0;this.W=null;this.i.complete=!1}w(ac,Qb);g=ac.prototype;g.reset=function(){this.status("model "+this.Ka);this.i.X&&D(this);dc(this);Tb(this);this.i.error=!1;this.parent.reset.call(this)};
function dc(a){a.m=65536;a.g=32768;a.h=65535;a.s=32768;a.A=15;a.f=[0,0,0,0,0,0,0,a.qb];a.wa=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.v=0;a.Na=0;a.Gb=[4,2,0,1];a.F=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.U=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.xb=[0,0,0,0,0,0,0,0];a.wb=0;a.l=0;a.B=a.C=0;a.c=a.b=a.$a=0;a.ja=-1;ec(a)}function ec(a){a.sa=255;a.I=0;a.ib=0;a.w=0;a.qa=0;a.hb=0;a.ra=0;a.Ha=0;a.Ma=0;a.bb=262143;a.Oa=253952;a.l|=2;a.j&&zb(a)}function zb(a){a.Ha?(a.M=65536,a.J=a.Fb,a.S=a.qc,a.Ya=a.cd,hb(a.j,a.ra&16?22:18)):(a.M=0,a.J=a.Eb,a.S=a.pc,a.Ya=a.bd,hb(a.j,16))}function fc(a,b,c){a.qb=b;M(a,b);!c&&a.D&&(D(a),a.D.ba())}g.ob=function(){return 0};
this.Ua));d-=this.da-this.Pa;if(e=this.da-this.P)this.ca=Math.round(this.V/(10*e))/100,864E5<=e&&(this.L=0,Wb(this));if(0>d||this.ca<this.ga)-1E3>d&&(this.P-=d),d=0;this.cb+=this.Ea;this.da+=d;b(c,d)}}};function Vb(a){var b;a.i.error?(a.R(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.X)a.R(a.toString()+" busy");else{Wb(a);a.i.X=!0;a.i.yb=!0;if(b=a.u.run)b.textContent="Halt";a.o&&a.o.start(a.P,Yb(a));setTimeout(a.ub,0)}}g.zb=function(){return 0};
function D(a){if(a.i.X){Zb(a);a.L+=a.V;a.V=0;a.i.X=!1;var b=a.u.run;b&&(b.textContent="Run");a.o&&a.o.stop(sa(),Yb(a))}a.i.complete=void 0}function $b(a){this.Ka=+a.model||1170;this.qb=a.addrReset||0;Qb.call(this,a,6666667);this.decode=1120==this.Ka?ac.bind(this):bc.bind(this);cc(this);this.eb=0;this.W=null;this.i.complete=!1}w($b,Qb);g=$b.prototype;g.reset=function(){this.status("model "+this.Ka);this.i.X&&D(this);cc(this);Tb(this);this.i.error=!1;this.parent.reset.call(this)};
function cc(a){a.m=65536;a.g=32768;a.h=65535;a.s=32768;a.A=15;a.f=[0,0,0,0,0,0,0,a.qb];a.wa=[0,0,0,0,0,0];a.aa=[0,0,0,0];a.v=0;a.Na=0;a.Gb=[4,2,0,1];a.F=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.U=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ib=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.xb=[0,0,0,0,0,0,0,0];a.wb=0;a.l=0;a.B=a.C=0;a.c=a.b=a.$a=0;a.ja=-1;dc(a)}function dc(a){a.sa=255;a.I=0;a.ib=0;a.w=0;a.qa=0;a.hb=0;a.ra=0;a.Ha=0;a.Ma=0;a.bb=262143;a.Oa=253952;a.l|=2;a.j&&zb(a)}function zb(a){a.Ha?(a.M=65536,a.J=a.Fb,a.S=a.qc,a.Ya=a.cd,hb(a.j,a.ra&16?22:18)):(a.M=0,a.J=a.Eb,a.S=a.pc,a.Ya=a.bd,hb(a.j,16))}function ec(a,b,c){a.qb=b;M(a,b);!c&&a.D&&(D(a),a.D.ba())}g.ob=function(){return 0};
g.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.L,this.ea]);a.set(2,rb(this.j));return a.data()};g.restore=function(a){var b=a[1];this.L=b[1];Wb(this,b[3]);a:{b=this.j;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.C){for(var f=0,h=Array(b.C),l=0;l<e.length-1;)for(var n=e[l++],q=e[l++];n--;)h[f++]=q;e=h}f=b.b[d];if(!f||!f.restore(e)){m("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function O(a){return a.m&65536?1:0}
g.oa=function(){return this.s&32768?8:0};function gc(a){var b=a.f[7];a.w&57344||(a.qa=0,a.hb=b);a.f[7]=b+2&65535;return a.S(b)}function hc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function M(a,b){a.f[7]=b&65535}function yb(a,b){return{wc:a,ya:b,next:null}}function wb(a,b){if(b!=a.W){var c=a.W;if(!c||c.ya<=b.ya)b.next=c,a.W=b;else{do{var d=c.next;if(!d||d.ya<=b.ya){b.next=d;c.next=b;break}c=d}while(c)}}a.l|=2}function Za(a){return a.A=a.A&63728|a.oa()|(a.h&65535?0:4)|(a.g&32768?2:0)|O(a)}
function Bb(a,b){a.s=b<<12;a.h=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.A)&2048)for(var c=a.wa.length;0<=--c;){var d=a.f[c];a.f[c]=a.wa[c];a.wa[c]=d}a.v=b>>14&3;c=a.A>>14&3;a.v!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.v]);a.A=b;a.l|=2}function P(a,b){a.l&128||(a.s=a.h=b,a.g=0)}function Q(a,b,c){a.l&128||(a.s=a.h=a.m=b,a.g=c||0)}function ic(a,b,c,d){a.l&128||(a.s=a.h=a.m=b,a.g=(c^b)&(d^b))}function R(a,b){a.l&128||(a.s=a.h=a.m=b,a.g=a.s^a.m>>1)}function jc(a,b,c,d){a.l&128||(a.s=a.h=a.m=b,a.g=(c^d)&(d^b))}
function G(a,b,c){if(!a.eb){var d=!1;0>a.ja?a.ja=Za(a):a.v||(b=4,d=!0);a.w&57344||(a.qa=63222,a.hb=b);a.v=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);Bb(a,f&-12289|a.ja>>2&12288);d&&(a.I|=4,a.f[6]=4);kc(a,a.ja);kc(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;a.l|=8;if(26!=c)throw b;}}function lc(a){var b=mc(a),c=mc(a)&-1793;a.A&49152&&(c=c&-225|a.A&63712);M(a,b);Bb(a,c);a.l&=-17}
function nc(a,b,c){var d,e,f,h=0;d=b>>13;a.ra&a.Gb[a.v]||(d&=7);e=a.F[a.v][d];f=(a.U[a.v][d]<<6)+(b&8191)&a.bb;if(f<a.Oa)f&1&&!(c&1)&&(a.I|=64,G(a,4,10));else if(a.ra&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.ra&32&&(f=a.Ib[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Oa&&4186112>f&&(a.I|=32,G(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:
128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.F[a.v][d]=e;if(4194170!==f||a.v)a.Ma=a.v,a.Na=d;h&&(h&57344&&(0<=a.ja&&(h|=128),a.w&57344||(a.w=a.w|h|a.Ma<<5|a.Na<<1),G(a,168,16)),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.l|=32)));return f}function oc(a,b,c){b&1&&a.a--;a=a.j;a.b[(b&a.h)>>>a.j].kb(b&a.g,c&255,b)}function mc(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b}
function kc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.w&57344||(a.qa=a.qa<<8|246);!a.v&&c<=a.sa&&4<c&&(c<=a.sa-32?(a.I|=4,a.f[6]=4,G(a,4,18)):(a.I|=8,a.l|=4));a.Ya(c,b)}
function pc(a,b,c,d){var e,f,h=d&8?0:a.M;switch(b){case 0:return G(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.f[6]<=a.sa||65534<=a.f[6])&&(a.f[6]<=a.sa-32||65534<=a.f[6]?(a.I|=4,a.f[6]=4,G(a,4,22)):(a.I|=8,a.l|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|h;case 2:f=2;e=a.f[c];7!==c&&(e|=h,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.S(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.S(e)|h;a.a-=
8;break;case 6:return e=a.S(hc(a,2)),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=a.S(hc(a,2)),e=e+a.f[c]&65535,e=a.S(e|a.M)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.w&57344||(a.qa=a.qa<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.sa||65534<=a.f[6])&&(a.f[6]<=a.sa-32?(a.I|=4,a.f[6]=4,G(a,4,24)):(a.I|=8,a.l|=64));return e}g.Ja=function(a,b){this.Ha?(this.eb++,oc(this,nc(this,a,5),b),this.eb--):this.j.Ja(a,b)};g.Eb=function(a,b,c){return pc(this,a,b,c)};
g.Fb=function(a,b,c){return nc(this,pc(this,a,b,c),c)};g.pc=function(a){return pb(this.j,a)};g.qc=function(a){return pb(this.j,nc(this,a,2))};g.bd=function(a,b){qb(this.j,a,b&65535)};g.cd=function(a,b){qb(this.j,nc(this,a,4),b)};function qc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=pc(a,b,d,2),c&65536||61440!==(a.A&61440)&&(d&=65535),a.v=a.A>>12&3,c=a.S(d|c&a.M),a.v=a.A>>14&3):c=6!=d||(a.A>>2&12288)===(a.A&12288)?a.f[d]:a.aa[a.A>>12&3];return c}
function rc(a,b,c,d){a.w&57344||(a.qa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=pc(a,b,e,4),c&65536||(e&=65535),a.v=a.A>>12&3,e=nc(a,e|c&65536,4),a.v=a.A>>14&3,qb(a.j,e,d)):6!=e||(a.A>>2&12288)===(a.A&12288)?a.f[e]=d:a.aa[a.A>>12&3]=d}function sc(a,b){b>>=6;var c=a.C=b&7;(b=a.B=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.j,c)):a=a.f[c]&255;return a}function S(a,b){b>>=6;var c=a.C=b&7;return(b=a.B=(b&56)>>3)?pb(a.j,a.J(b,c,2)):a.f[c]}function tc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return pc(a,b,c,8)}
function uc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.j,c)):a=a.f[c]&255;return a}function vc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.j,a.J(b,c,2)):a.f[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.$a=a.J(b,e,7),oc(a,e,d.call(a,c,ob(a.j,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),qb(a.j,e,d.call(a,c,pb(a.j,e)))):a.f[e]=d.call(a,c,a.f[e])}
function wc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?oc(a,a.J(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function xc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.j,a.J(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
g.zb=function(a){this.i.complete=!0;this.i.yb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?G(this,168,28):this.l&64?G(this,4,30):this.l&16&&G(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.ib&224)>>5;if(a=this.W&&this.W.ya>c?this.W:null)b=a.wc,c=a.ya;c>(this.A&224)>>5?(this.l&4&&(hc(this,2),this.l&=-5),G(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l&1&&this.l++;this.l=this.l&
7|this.A&16;this.decode(gc(this))}while(0<this.a);return this.i.complete?this.ha-this.a:void 0===this.i.complete?0:-1};r(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ac(d);A(d,c)}});function yc(a,b){var c=b+a;ic(this,c,a,b);return c&65535}function zc(a,b){var c=b+a;ic(this,c<<8,a<<8,b<<8);return c&255}function Ac(a,b){a=b<<1;R(this,a);return a&65535}function Bc(a,b){a=b<<1;R(this,a<<8);return a&255}
function Cc(a,b){a=b&32768|b>>1|b<<16;R(this,a);return a&65535}function Dc(a,b){a=b&2048|b>>1|b<<8;R(this,a<<8);return a&255}function Ec(a,b){a=b&~a;P(this,a);return a}function Fc(a,b){a=b&~a;P(this,a<<8);return a}function Gc(a,b){a|=b;P(this,a);return a}function Hc(a,b){a|=b;P(this,a<<8);return a}function Ic(a,b){a=~b|65536;Q(this,a);return a&65535}function Jc(a,b){a=~b|256;Q(this,a<<8);return a&255}function Kc(a,b){a=b-a;this.l&128||(this.s=this.h=a,this.g=b&(b^a));return a&65535}
function Lc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.s=this.h=c,this.g=b&(b^c));return a&255}function Mc(a,b){a=b+a;this.l&128||(this.s=this.h=a,this.g=a&(b^a));return a&65535}function Nc(a,b){a=b+a;var c=a<<8;this.l&128||(this.s=this.h=c,this.g=c&(b<<8^c));return a&255}function Oc(a,b){a=-b;Q(this,a,a&b&32768);return a&65535}function Pc(a,b){a=-b;Q(this,a<<8,(a&b&128)<<8);return a&255}function Qc(a,b){a=b<<1|this.m>>16&1;R(this,a);return a&65535}
function Rc(a,b){a=b<<1|this.m>>16&1;R(this,a<<8);return a&255}function Sc(a,b){a=(this.m&65536|b)>>1|b<<16;R(this,a);return a&65535}function Tc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;R(this,a<<8);return a&255}function Uc(a,b){var c=b-a;jc(this,c,a,b);return c&65535}function Vc(a,b){var c=b-a;jc(this,c<<8,a<<8,b<<8);return c&255}function Wc(a,b){this.l&128||(this.s=this.h=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Xc(a,b){a^=b;P(this,a);return a&65535}
function Yc(a){U(this,a,S(this,a),yc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Zc(a){var b=vc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.h=c;this.a-=(this.c?6:7)+b}
function $c(a){var b=vc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(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.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function ad(a){V(this,a,!O(this))}function bd(a){V(this,a,O(this))}
function cd(a){U(this,a,S(this,a),Ec);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function dd(a){T(this,a,sc(this,a),Fc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ed(a){U(this,a,S(this,a),Gc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function fd(a){T(this,a,sc(this,a),Hc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
function gd(a){P(this,S(this,a)&vc(this,a));this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function hd(a){P(this,(sc(this,a)&uc(this,a))<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function id(a){V(this,a,this.h&65535?0:4)}function jd(a){V(this,a,!this.oa()==!(this.g&32768))}function kd(a){V(this,a,!!(this.h&65535)&&!this.oa()==!(this.g&32768))}function ld(a){V(this,a,!O(this)&&!!(this.h&65535))}
function md(a){V(this,a,(this.h&65535?0:4)||!this.oa()!=!(this.g&32768))}function nd(a){V(this,a,O(this)||(this.h&65535?0:4))}function od(a){V(this,a,!this.oa()!=!(this.g&32768))}function pd(a){V(this,a,this.oa())}function qd(a){V(this,a,!!(this.h&65535))}function rd(a){V(this,a,!this.oa())}function sd(){G(this,12,1);this.a-=5}function td(a){V(this,a,!0)}function ud(a){V(this,a,!(this.g&32768))}function vd(a){V(this,a,this.g&32768?2:0)}
function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.s=0);this.a-=5}function wd(a){var b=S(this,a);a=vc(this,a);jc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function xd(a){var b=sc(this,a)<<8;a=uc(this,a)<<8;jc(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}
function yd(a){var b=vc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.s=d>>16):(this.g=32768,this.h=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.s=0,this.g=32768,this.m=65536,this.a-=7}function zd(){G(this,24,2);this.a-=25}
function Ad(){this.A&49152?(this.I|=128,G(this,4,3)):this.D?this.D.c():D(this);this.a-=7}function Bd(){G(this,16,4);this.a-=25}var Cd=[0,7,7,10,7,11,9,13];function Dd(a){this.G=this.a;M(this,tc(this,a));this.a=this.G-Cd[this.c]}var Ed=[0,14,14,17,14,18,16,20];function Fd(a){this.G=this.a;var b=tc(this,a);a=a>>6&7;kc(this,this.f[a]);this.f[a]=this.f[7];M(this,b);this.a=this.G-Ed[this.c]}var Gd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function Hd(a){var b=S(this,a);this.G=this.a;P(this,xc(this,a,b));this.a=this.G-Gd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Id(a){var b=sc(this,a);P(this,wc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Jd=[7,13,13,17,14,18,17,21];
function Kd(a){var b=vc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.s=b>>16,this.h=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function Ld(){this.a-=5}function Md(){this.A&49152||(ec(this),this.j.reset());this.a-=667}function Nd(){lc(this);this.l|=this.A&16;this.a-=13}
function Od(a){if(a&8)G(this,8,6);else{var b=mc(this);a&=7;7==a?M(this,b):(M(this,this.f[a]),this.f[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.h=0);a&8&&(this.s=32768);this.a-=5}function Pd(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Qd(a){U(this,a,S(this,a),Uc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
function Rd(a){U(this,a,0,Wc);this.a-=this.c?9:3+(7==this.b?2:0)}function Sd(){G(this,28,5);this.a-=5}function Td(){this.l&4||this.o.ba();this.l|=4;hc(this,-2);this.a-=3}function Ud(a){U(this,a,S(this,a),Xc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){G(this,8,6)}function bc(a){Vd[a>>12].call(this,a)}function Wd(a){Xd[a>>6&3].call(this,a)}function Yd(a){Zd[a>>6&3].call(this,a)}function $d(a){ae[a>>6&3].call(this,a)}function be(a){ce[a&15].call(this,a)}function de(a){ee[a&15].call(this,a)}
function fe(a){ge[a>>6&3].call(this,a)}function he(a){ie[a>>6&3].call(this,a)}function je(a){ke[a>>6&3].call(this,a)}
var Vd=[function(a){le[a>>8&15].call(this,a)},Hd,wd,gd,cd,ed,Yc,Y,function(a){me[a>>8&15].call(this,a)},Id,xd,hd,dd,fd,Qd,Y],le=[function(a){ne[a>>4&15].call(this,a)},td,qd,id,jd,od,kd,md,Fd,Fd,Wd,Yd,$d,Y,Y,Y],Xd=[function(a){Q(this,xc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Mc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}],Zd=[function(a){U(this,a,0,Oc);
this.a-=this.c?11:6},function(a){U(this,a,O(this)?1:0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,O(this)?1:0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=vc(this,a);Q(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],ae=[function(a){U(this,a,0,Sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)}],ne=[function(a){oe[a&
15].call(this,a)},Y,Y,Y,Dd,Dd,Dd,Dd,Od,Y,be,de,Rd,Rd,Rd,Rd],oe=[Ad,Td,Nd,sd,Bd,Md,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],ce=[Ld,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],ee=[Ld,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],me=[rd,pd,ld,nd,ud,vd,ad,bd,zd,Sd,fe,he,je,Y,Y,Y],ge=[function(a){Q(this,wc(this,
a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Jc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Nc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)}],ie=[function(a){T(this,a,0,Pc);this.a-=this.c?11:6},function(a){T(this,a,O(this)?1:0,zc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,O(this)?1:0,Vc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=uc(this,a);Q(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],
ke=[function(a){T(this,a,0,Tc);this.a-=this.c?9+(this.$a&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Dc);this.a-=this.c?9+(this.$a&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)}];function cc(a){pe[a>>12].call(this,a)}
var pe=[function(a){qe[a>>8&15].call(this,a)},Hd,wd,gd,cd,ed,Yc,function(a){re[a>>8&15].call(this,a)},function(a){se[a>>8&15].call(this,a)},Id,xd,hd,dd,fd,Qd,Y],qe=[function(a){te[a>>4&15].call(this,a)},td,qd,id,jd,od,kd,md,Fd,Fd,Wd,Yd,$d,function(a){ue[a>>6&3].call(this,a)},Y,Y],ue=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.M);M(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=qc(this,a,0);kc(this,a);P(this,a);this.a-=11},function(a){var b=mc(this);this.G=
this.a;rc(this,a,0,b);P(this,b);this.a=this.G-Jd[this.c]},function(a){P(this,xc(this,a,this.oa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],te=[function(a){ve[a&15].call(this,a)},Y,Y,Y,Dd,Dd,Dd,Dd,Od,function(a){a&8?(this.A&49152||(this.A=this.A&-2017|(a&7)<<5,this.l|=1),this.a-=5):G(this,8,6)},be,de,Rd,Rd,Rd,Rd],ve=[Ad,Td,Nd,sd,Bd,Md,function(){lc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],re=[Kd,Kd,yd,yd,Zc,Zc,$c,$c,Ud,Ud,Y,Y,Y,Y,Pd,Pd],se=[rd,pd,ld,nd,ud,vd,ad,bd,zd,Sd,fe,he,je,function(a){we[a>>6&
3].call(this,a)},Y,Y],we=[Y,function(a){a=qc(this,a,65536);kc(this,a);P(this,a);this.a-=11},function(a){var b=mc(this);this.G=this.a;rc(this,a,65536,b);P(this,b);this.a=this.G-Jd[this.c]},Y];
function xe(a){u.call(this,"ROM",a,xe);this.T=this.b=null;this.o=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.m=ka(this.g);if(this.g){a=this.g;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;k(a,null,!0,function(a,b,f){f?c.K("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.ta,a,b),(a=ua(a,b))?(c.b=a.N,c.T=a.T):c.g=null,ye(c))})}}w(xe);xe.prototype.fa=function(a,b,c,d){this.j=b;this.a=c;this.D=d;ye(this)};
xe.prototype.$=function(){this.T&&(this.D&&this.D.a(this.id,this.o,this.c,this.T),delete this.T);return!0};xe.prototype.Z=function(){return!0};
function ye(a){if(!Ta(a)){if(a.g){if(!a.b||!a.j)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.i.error=!0;a.K(b)}else{b=a.o;if(kb(a.j,b,a.c,Hb)){var c;for(c=0;c<a.b.length;c++)a.j.Ja(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.h?b.push(a.h):null!=a.h&&a.h.length&&(b=a.h);for(c=0;c<b.length;c++){var d=a,e=b[c],f=jb(d.j,d.o,d.c);ib(d.j,e,d.c,f)}delete a.b}}}C(a)}}
r(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new xe(d);A(d,c)}});
function ze(a){u.call(this,"RAM",a,ze);this.T=this.c=null;this.g=a.addr;this.o=a.size;this.ma=a.load;this.la=a.exec;this.h=!1;this.b=a.file;this.m=ka(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;k(a,null,!0,function(a,b,f){f?c.K("Unable to load RAM resource (error "+f+": "+a+")"):(Pa(c.ta,a,b),(a=ua(a,b))?(c.c=a.N,c.T=a.T,null==c.ma&&(c.ma=a.ma),null==c.la&&(c.la=a.la)):c.b=null,Ae(c))})}}w(ze);
ze.prototype.fa=function(a,b,c,d){this.j=b;this.a=c;this.D=d;Ae(this)};ze.prototype.$=function(){this.T&&(this.D&&this.D.a(this.id,this.g,this.o,this.T),delete this.T);return!0};ze.prototype.Z=function(){return!0};function Ae(a){if(a.j&&(!a.h&&a.o&&kb(a.j,a.g,a.o,1)&&(a.h=!0),!Ta(a))){if(!a.h)m("No RAM allocated");else if(a.b){if(!a.c||!a.j)return;Be(a,a.c,a.ma,a.la,a.g)}C(a)}}
ze.prototype.reset=function(){if(this.h){for(var a=this.j,b=this.g,c=this.o,d=b&a.g,b=b>>>a.j;0<c&&b<a.b.length;){var e=a.b[b],f=c,h,d=d||0;void 0===f&&(f=e.size);if(Ua)for(h=d;f--&&h<e.b.length;h++)e.b[h]=0;else for(h=d;f--&&h<e.size;h++)e.lb(d,0,e.xa+d);c-=a.c;b++;d=0}this.c&&Be(this,this.c,this.ma,this.la,this.g,!0)}};
function Be(a,b,c,d,e,f){var h=!1;if(null==c)for(var l=0;l<b.length-1;){var n=b[l]&255|(b[l+1]&255)<<8;if(n)if(n&255){if(1!=n)break;if(l+6>=b.length)break;for(var l=l+2,q=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,n=n+((q&255)+(q>>8)+(t&255)+(t>>8)),z=l,Ra=q-=6;0<q&&l<b.length;)n+=b[l++]&255,q--;if(q||l>=b.length)break;n+=b[l++]&255;if(n&255)break;if(Ra)for(;Ra--;)a.a.Ja(t++,b[z++]&255);else t&1?D(a.a):fc(a.a,t,f);h=!0}else l++;else l+=2}if(!h&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Ja(c+
e,b[e]);null!=d&&fc(a.a,d,f);h=!0}return h}r(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ze(d);A(d,c)}});function Ce(a){u.call(this,"Keyboard",a,Ce);C(this)}w(Ce);Ce.prototype.Y=function(){return!1};Ce.prototype.fa=function(a,b,c,d){this.o=a;this.a=c;this.D=d};r(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Ce(d);A(d,c)}});
function Z(a){this.C=a.baudReceive||9600;this.H=a.baudTransmit||9600;this.P=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.G=a.charBOL;this.s=0;u.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=De;b&&(void 0===c&&(c="Panel"),(c=Sa(c,this.id))&&(b=c.u[b])&&this.Y(null,a,b))}this.v=this.B=null;this.exports={connect:this.pb,receiveData:this.gb}}w(Z);var De="buffer";g=Z.prototype;
g.Y=function(a,b,c){var d=this;switch(b){case De:return this.u[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.gb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.gb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
g.fa=function(a,b,c,d){this.o=a;this.j=b;this.a=c;this.D=d;var e=this;this.V=yb(48,4);this.L=vb(this.a,function(){e.b&128||!e.h.length||(e.w=e.h.shift()&255,e.P&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&wb(e.a,e.V))});this.W=yb(52,4);this.M=vb(this.a,function(){e.c|=128;e.c&64&&wb(e.a,e.W)});tb(b,this,Ee);C(this)};
g.oa=function(){return this.s&32768?8:0};function fc(a){var b=a.f[7];a.w&57344||(a.qa=0,a.hb=b);a.f[7]=b+2&65535;return a.S(b)}function gc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function M(a,b){a.f[7]=b&65535}function yb(a,b){return{wc:a,ya:b,next:null}}function wb(a,b){if(b!=a.W){var c=a.W;if(!c||c.ya<=b.ya)b.next=c,a.W=b;else{do{var d=c.next;if(!d||d.ya<=b.ya){b.next=d;c.next=b;break}c=d}while(c)}}a.l|=2}function Za(a){return a.A=a.A&63728|a.oa()|(a.h&65535?0:4)|(a.g&32768?2:0)|O(a)}
function Bb(a,b){a.s=b<<12;a.h=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.A)&2048)for(var c=a.wa.length;0<=--c;){var d=a.f[c];a.f[c]=a.wa[c];a.wa[c]=d}a.v=b>>14&3;c=a.A>>14&3;a.v!=c&&(a.aa[c]=a.f[6],a.f[6]=a.aa[a.v]);a.A=b;a.l|=2}function P(a,b){a.l&128||(a.s=a.h=b,a.g=0)}function Q(a,b,c){a.l&128||(a.s=a.h=a.m=b,a.g=c||0)}function hc(a,b,c,d){a.l&128||(a.s=a.h=a.m=b,a.g=(c^b)&(d^b))}function R(a,b){a.l&128||(a.s=a.h=a.m=b,a.g=a.s^a.m>>1)}function ic(a,b,c,d){a.l&128||(a.s=a.h=a.m=b,a.g=(c^d)&(d^b))}
function G(a,b,c){if(!a.eb){var d=!1;0>a.ja?a.ja=Za(a):a.v||(b=4,d=!0);a.w&57344||(a.qa=63222,a.hb=b);a.v=0;var e=a.S(b|a.M),f=a.S(b+2&65535|a.M);Bb(a,f&-12289|a.ja>>2&12288);d&&(a.I|=4,a.f[6]=4);jc(a,a.ja);jc(a,a.f[7]);M(a,e);a.l&=-113;a.ja=-1;a.l|=8;if(26!=c)throw b;}}function kc(a){var b=lc(a),c=lc(a)&-1793;a.A&49152&&(c=c&-225|a.A&63712);M(a,b);Bb(a,c);a.l&=-17}
function mc(a,b,c){var d,e,f,h=0;d=b>>13;a.ra&a.Gb[a.v]||(d&=7);e=a.F[a.v][d];f=(a.U[a.v][d]<<6)+(b&8191)&a.bb;if(f<a.Oa)f&1&&!(c&1)&&(a.I|=64,G(a,4,10));else if(a.ra&16||253952<=f&&(f|=4186112),4186112>f){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.ra&32&&(f=a.Ib[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Oa&&4186112>f&&(a.I|=32,G(a,4,12))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:
128;break;default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.F[a.v][d]=e;if(4194170!==f||a.v)a.Ma=a.v,a.Na=d;h&&(h&57344&&(0<=a.ja&&(h|=128),a.w&57344||(a.w=a.w|h|a.Ma<<5|a.Na<<1),G(a,168,16)),a.w&61440||!(4191360>f||4194239<f)||(a.w|=4096,a.w&512&&(a.l|=32)));return f}function nc(a,b,c){b&1&&a.a--;a=a.j;a.b[(b&a.h)>>>a.j].kb(b&a.g,c&255,b)}function lc(a){var b=a.S(a.f[6]|a.M);a.f[6]=a.f[6]+2&65535;return b}
function jc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.w&57344||(a.qa=a.qa<<8|246);!a.v&&c<=a.sa&&4<c&&(c<=a.sa-32?(a.I|=4,a.f[6]=4,G(a,4,18)):(a.I|=8,a.l|=4));a.Ya(c,b)}
function oc(a,b,c,d){var e,f,h=d&8?0:a.M;switch(b){case 0:return G(a,4,20),0;case 1:return 6===c&&!a.v&&d&4&&(a.f[6]<=a.sa||65534<=a.f[6])&&(a.f[6]<=a.sa-32||65534<=a.f[6]?(a.I|=4,a.f[6]=4,G(a,4,22)):(a.I|=8,a.l|=64)),a.a-=3,7===c?a.f[c]:a.f[c]|h;case 2:f=2;e=a.f[c];7!==c&&(e|=h,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.S(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.S(e)|h;a.a-=
8;break;case 6:return e=a.S(gc(a,2)),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=a.S(gc(a,2)),e=e+a.f[c]&65535,e=a.S(e|a.M)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.w&57344||(a.qa=a.qa<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.sa||65534<=a.f[6])&&(a.f[6]<=a.sa-32?(a.I|=4,a.f[6]=4,G(a,4,24)):(a.I|=8,a.l|=64));return e}g.Ja=function(a,b){this.Ha?(this.eb++,nc(this,mc(this,a,5),b),this.eb--):this.j.Ja(a,b)};g.Eb=function(a,b,c){return oc(this,a,b,c)};
g.Fb=function(a,b,c){return mc(this,oc(this,a,b,c),c)};g.pc=function(a){return pb(this.j,a)};g.qc=function(a){return pb(this.j,mc(this,a,2))};g.bd=function(a,b){qb(this.j,a,b&65535)};g.cd=function(a,b){qb(this.j,mc(this,a,4),b)};function pc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=oc(a,b,d,2),c&65536||61440!==(a.A&61440)&&(d&=65535),a.v=a.A>>12&3,c=a.S(d|c&a.M),a.v=a.A>>14&3):c=6!=d||(a.A>>2&12288)===(a.A&12288)?a.f[d]:a.aa[a.A>>12&3];return c}
function qc(a,b,c,d){a.w&57344||(a.qa=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=oc(a,b,e,4),c&65536||(e&=65535),a.v=a.A>>12&3,e=mc(a,e|c&65536,4),a.v=a.A>>14&3,qb(a.j,e,d)):6!=e||(a.A>>2&12288)===(a.A&12288)?a.f[e]=d:a.aa[a.A>>12&3]=d}function rc(a,b){b>>=6;var c=a.C=b&7;(b=a.B=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.j,c)):a=a.f[c]&255;return a}function S(a,b){b>>=6;var c=a.C=b&7;return(b=a.B=(b&56)>>3)?pb(a.j,a.J(b,c,2)):a.f[c]}function sc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return oc(a,b,c,8)}
function tc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=ob(a.j,c)):a=a.f[c]&255;return a}function uc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?pb(a.j,a.J(b,c,2)):a.f[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.$a=a.J(b,e,7),nc(a,e,d.call(a,c,ob(a.j,e)))):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),qb(a.j,e,d.call(a,c,pb(a.j,e)))):a.f[e]=d.call(a,c,a.f[e])}
function vc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?nc(a,a.J(b,e,5),c):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?qb(a.j,a.J(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(M(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
g.zb=function(a){this.i.complete=!0;this.i.yb=!1;this.ha=this.a=a;do{if(this.l&&(this.l&112&&(this.l&32?G(this,168,28):this.l&64?G(this,4,30):this.l&16&&G(this,12,32),this.l&=-113),this.l&7))if(this.l&2){this.l&=-3;var b=160,c=(this.ib&224)>>5;if(a=this.W&&this.W.ya>c?this.W:null)b=a.wc,c=a.ya;c>(this.A&224)>>5?(this.l&4&&(gc(this,2),this.l&=-5),G(this,b,26),c=!0):c=!1;if(c&&a)if(c=this.W,c==a)this.W=a.next;else for(;c;){b=c.next;if(b==a){c.next=b.next;break}c=b}}else this.l&1&&this.l++;this.l=this.l&
7|this.A&16;this.decode(fc(this))}while(0<this.a);return this.i.complete?this.ha-this.a:void 0===this.i.complete?0:-1};r(function(){for(var a=B(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new $b(d);A(d,c)}});function xc(a,b){var c=b+a;hc(this,c,a,b);return c&65535}function yc(a,b){var c=b+a;hc(this,c<<8,a<<8,b<<8);return c&255}function zc(a,b){a=b<<1;R(this,a);return a&65535}function Ac(a,b){a=b<<1;R(this,a<<8);return a&255}
function Bc(a,b){a=b&32768|b>>1|b<<16;R(this,a);return a&65535}function Cc(a,b){a=b&2048|b>>1|b<<8;R(this,a<<8);return a&255}function Dc(a,b){a=b&~a;P(this,a);return a}function Ec(a,b){a=b&~a;P(this,a<<8);return a}function Fc(a,b){a|=b;P(this,a);return a}function Gc(a,b){a|=b;P(this,a<<8);return a}function Hc(a,b){a=~b|65536;Q(this,a);return a&65535}function Ic(a,b){a=~b|256;Q(this,a<<8);return a&255}function Jc(a,b){a=b-a;this.l&128||(this.s=this.h=a,this.g=b&(b^a));return a&65535}
function Kc(a,b){a=b-a;var c=a<<8;b<<=8;this.l&128||(this.s=this.h=c,this.g=b&(b^c));return a&255}function Lc(a,b){a=b+a;this.l&128||(this.s=this.h=a,this.g=a&(b^a));return a&65535}function Mc(a,b){a=b+a;var c=a<<8;this.l&128||(this.s=this.h=c,this.g=c&(b<<8^c));return a&255}function Nc(a,b){a=-b;Q(this,a,a&b&32768);return a&65535}function Oc(a,b){a=-b;Q(this,a<<8,(a&b&128)<<8);return a&255}function Pc(a,b){a=b<<1|this.m>>16&1;R(this,a);return a&65535}
function Qc(a,b){a=b<<1|this.m>>16&1;R(this,a<<8);return a&255}function Rc(a,b){a=(this.m&65536|b)>>1|b<<16;R(this,a);return a&65535}function Sc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;R(this,a<<8);return a&255}function Tc(a,b){var c=b-a;ic(this,c,a,b);return c&65535}function Uc(a,b){var c=b-a;ic(this,c<<8,a<<8,b<<8);return c&255}function Vc(a,b){this.l&128||(this.s=this.h=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Wc(a,b){a^=b;P(this,a);return a&65535}
function Xc(a){U(this,a,S(this,a),xc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Yc(a){var b=uc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.h=c;this.a-=(this.c?6:7)+b}
function Zc(a){var b=uc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(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.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.h=d>>16|d;this.a-=(this.c?6:7)+b}function $c(a){V(this,a,!O(this))}function ad(a){V(this,a,O(this))}
function bd(a){U(this,a,S(this,a),Dc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function cd(a){T(this,a,rc(this,a),Ec);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function dd(a){U(this,a,S(this,a),Fc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ed(a){T(this,a,rc(this,a),Gc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
function fd(a){P(this,S(this,a)&uc(this,a));this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function gd(a){P(this,(rc(this,a)&tc(this,a))<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function hd(a){V(this,a,this.h&65535?0:4)}function id(a){V(this,a,!this.oa()==!(this.g&32768))}function jd(a){V(this,a,!!(this.h&65535)&&!this.oa()==!(this.g&32768))}function kd(a){V(this,a,!O(this)&&!!(this.h&65535))}
function ld(a){V(this,a,(this.h&65535?0:4)||!this.oa()!=!(this.g&32768))}function md(a){V(this,a,O(this)||(this.h&65535?0:4))}function nd(a){V(this,a,!this.oa()!=!(this.g&32768))}function od(a){V(this,a,this.oa())}function pd(a){V(this,a,!!(this.h&65535))}function qd(a){V(this,a,!this.oa())}function rd(){G(this,12,1);this.a-=5}function sd(a){V(this,a,!0)}function td(a){V(this,a,!(this.g&32768))}function ud(a){V(this,a,this.g&32768?2:0)}
function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.h=1);a&8&&(this.s=0);this.a-=5}function vd(a){var b=S(this,a);a=uc(this,a);ic(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function wd(a){var b=rc(this,a)<<8;a=tc(this,a)<<8;ic(this,b-a,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}
function xd(a){var b=uc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.h=d>>16|d,this.s=d>>16):(this.g=32768,this.h=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.h=this.s=0,this.g=32768,this.m=65536,this.a-=7}function yd(){G(this,24,2);this.a-=25}
function zd(){this.A&49152?(this.I|=128,G(this,4,3)):this.D?this.D.c():D(this);this.a-=7}function Ad(){G(this,16,4);this.a-=25}var Bd=[0,7,7,10,7,11,9,13];function Cd(a){this.G=this.a;M(this,sc(this,a));this.a=this.G-Bd[this.c]}var Dd=[0,14,14,17,14,18,16,20];function Ed(a){this.G=this.a;var b=sc(this,a);a=a>>6&7;jc(this,this.f[a]);this.f[a]=this.f[7];M(this,b);this.a=this.G-Dd[this.c]}var Fd=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
function Gd(a){var b=S(this,a);this.G=this.a;P(this,wc(this,a,b));this.a=this.G-Fd[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function Hd(a){var b=rc(this,a);P(this,vc(this,a,b,1)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var Id=[7,13,13,17,14,18,17,21];
function Jd(a){var b=uc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.l&128||(this.s=b>>16,this.h=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function Kd(){this.a-=5}function Ld(){this.A&49152||(dc(this),this.j.reset());this.a-=667}function Md(){kc(this);this.l|=this.A&16;this.a-=13}
function Nd(a){if(a&8)G(this,8,6);else{var b=lc(this);a&=7;7==a?M(this,b):(M(this,this.f[a]),this.f[a]=b);this.a-=9}}function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.h=0);a&8&&(this.s=32768);this.a-=5}function Od(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)M(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function Pd(a){U(this,a,S(this,a),Tc);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}
function Qd(a){U(this,a,0,Vc);this.a-=this.c?9:3+(7==this.b?2:0)}function Rd(){G(this,28,5);this.a-=5}function Sd(){this.l&4||this.o.ba();this.l|=4;gc(this,-2);this.a-=3}function Td(a){U(this,a,S(this,a),Wc);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){G(this,8,6)}function ac(a){Ud[a>>12].call(this,a)}function Vd(a){Wd[a>>6&3].call(this,a)}function Xd(a){Yd[a>>6&3].call(this,a)}function Zd(a){$d[a>>6&3].call(this,a)}function ae(a){be[a&15].call(this,a)}function ce(a){de[a&15].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>>6&3].call(this,a)}
var Ud=[function(a){ke[a>>8&15].call(this,a)},Gd,vd,fd,bd,dd,Xc,Y,function(a){le[a>>8&15].call(this,a)},Hd,wd,gd,cd,ed,Pd,Y],ke=[function(a){me[a>>4&15].call(this,a)},sd,pd,hd,id,nd,jd,ld,Ed,Ed,Vd,Xd,Zd,Y,Y,Y],Wd=[function(a){Q(this,wc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Hc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Lc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,Jc);this.a-=this.c?9:3+(7==this.b?2:0)}],Yd=[function(a){U(this,a,0,Nc);
this.a-=this.c?11:6},function(a){U(this,a,O(this)?1:0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,O(this)?1:0,Tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=uc(this,a);Q(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],$d=[function(a){U(this,a,0,Rc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,zc);this.a-=this.c?9:3+(7==this.b?2:0)}],me=[function(a){ne[a&
15].call(this,a)},Y,Y,Y,Cd,Cd,Cd,Cd,Nd,Y,ae,ce,Qd,Qd,Qd,Qd],ne=[zd,Sd,Md,rd,Ad,Ld,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],be=[Kd,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.h=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],de=[Kd,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.h=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],le=[qd,od,kd,md,td,ud,$c,ad,yd,Rd,ee,ge,ie,Y,Y,Y],fe=[function(a){Q(this,vc(this,
a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Mc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,Kc);this.a-=this.c?9:3+(7==this.b?2:0)}],he=[function(a){T(this,a,0,Oc);this.a-=this.c?11:6},function(a){T(this,a,O(this)?1:0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,O(this)?1:0,Uc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=tc(this,a);Q(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],
je=[function(a){T(this,a,0,Sc);this.a-=this.c?9+(this.$a&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Qc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,Cc);this.a-=this.c?9+(this.$a&1):3+(7==this.b?2:0)},function(a){T(this,a,0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)}];function bc(a){oe[a>>12].call(this,a)}
var oe=[function(a){pe[a>>8&15].call(this,a)},Gd,vd,fd,bd,dd,Xc,function(a){qe[a>>8&15].call(this,a)},function(a){re[a>>8&15].call(this,a)},Hd,wd,gd,cd,ed,Pd,Y],pe=[function(a){se[a>>4&15].call(this,a)},sd,pd,hd,id,nd,jd,ld,Ed,Ed,Vd,Xd,Zd,function(a){te[a>>6&3].call(this,a)},Y,Y],te=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.S(a|this.M);M(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=pc(this,a,0);jc(this,a);P(this,a);this.a-=11},function(a){var b=lc(this);this.G=
this.a;qc(this,a,0,b);P(this,b);this.a=this.G-Id[this.c]},function(a){P(this,wc(this,a,this.oa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],se=[function(a){ue[a&15].call(this,a)},Y,Y,Y,Cd,Cd,Cd,Cd,Nd,function(a){a&8?(this.A&49152||(this.A=this.A&-2017|(a&7)<<5,this.l|=1),this.a-=5):G(this,8,6)},ae,ce,Qd,Qd,Qd,Qd],ue=[zd,Sd,Md,rd,Ad,Ld,function(){kc(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],qe=[Jd,Jd,xd,xd,Yc,Yc,Zc,Zc,Td,Td,Y,Y,Y,Y,Od,Od],re=[qd,od,kd,md,td,ud,$c,ad,yd,Rd,ee,ge,ie,function(a){ve[a>>6&
3].call(this,a)},Y,Y],ve=[Y,function(a){a=pc(this,a,65536);jc(this,a);P(this,a);this.a-=11},function(a){var b=lc(this);this.G=this.a;qc(this,a,65536,b);P(this,b);this.a=this.G-Id[this.c]},Y];
function we(a){u.call(this,"ROM",a,we);this.T=this.b=null;this.o=a.addr;this.c=a.size;this.h=a.alias;this.g=a.file;this.m=ka(this.g);if(this.g){a=this.g;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;k(a,null,!0,function(a,b,f){f?c.K("Unable to load ROM resource (error "+f+": "+a+")"):(Pa(c.ta,a,b),(a=ua(a,b))?(c.b=a.N,c.T=a.T):c.g=null,xe(c))})}}w(we);we.prototype.fa=function(a,b,c,d){this.j=b;this.a=c;this.D=d;xe(this)};
we.prototype.$=function(){this.T&&(this.D&&this.D.a(this.id,this.o,this.c,this.T),delete this.T);return!0};we.prototype.Z=function(){return!0};
function xe(a){if(!Ta(a)){if(a.g){if(!a.b||!a.j)return;a.c||(a.c=a.b.length);if(a.b.length!=a.c){var b="ROM size ("+ja(a.b.length,8,!0)+") does not match specified size ("+ja(a.c,8,!0)+")";a.i.error=!0;a.K(b)}else{b=a.o;if(kb(a.j,b,a.c,Hb)){var c;for(c=0;c<a.b.length;c++)a.j.Ja(b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.h?b.push(a.h):null!=a.h&&a.h.length&&(b=a.h);for(c=0;c<b.length;c++){var d=a,e=b[c],f=jb(d.j,d.o,d.c);ib(d.j,e,d.c,f)}delete a.b}}}C(a)}}
r(function(){for(var a=B(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new we(d);A(d,c)}});
function ye(a){u.call(this,"RAM",a,ye);this.T=this.c=null;this.g=a.addr;this.o=a.size;this.ma=a.load;this.la=a.exec;this.h=!1;this.b=a.file;this.m=ka(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=na()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;k(a,null,!0,function(a,b,f){f?c.K("Unable to load RAM resource (error "+f+": "+a+")"):(Pa(c.ta,a,b),(a=ua(a,b))?(c.c=a.N,c.T=a.T,null==c.ma&&(c.ma=a.ma),null==c.la&&(c.la=a.la)):c.b=null,ze(c))})}}w(ye);
ye.prototype.fa=function(a,b,c,d){this.j=b;this.a=c;this.D=d;ze(this)};ye.prototype.$=function(){this.T&&(this.D&&this.D.a(this.id,this.g,this.o,this.T),delete this.T);return!0};ye.prototype.Z=function(){return!0};function ze(a){if(a.j&&(!a.h&&a.o&&kb(a.j,a.g,a.o,1)&&(a.h=!0),!Ta(a))){if(!a.h)m("No RAM allocated");else if(a.b){if(!a.c||!a.j)return;Ae(a,a.c,a.ma,a.la,a.g)}C(a)}}
ye.prototype.reset=function(){if(this.h){for(var a=this.j,b=this.g,c=this.o,d=b&a.g,b=b>>>a.j;0<c&&b<a.b.length;){var e=a.b[b],f=c,h,d=d||0;void 0===f&&(f=e.size);if(Ua)for(h=d;f--&&h<e.b.length;h++)e.b[h]=0;else for(h=d;f--&&h<e.size;h++)e.lb(d,0,e.xa+d);c-=a.c;b++;d=0}this.c&&Ae(this,this.c,this.ma,this.la,this.g,!0)}};
function Ae(a,b,c,d,e,f){var h=!1;if(null==c)for(var l=0;l<b.length-1;){var n=b[l]&255|(b[l+1]&255)<<8;if(n)if(n&255){if(1!=n)break;if(l+6>=b.length)break;for(var l=l+2,q=b[l++]&255|(b[l++]&255)<<8,t=b[l++]&255|(b[l++]&255)<<8,n=n+((q&255)+(q>>8)+(t&255)+(t>>8)),z=l,Ra=q-=6;0<q&&l<b.length;)n+=b[l++]&255,q--;if(q||l>=b.length)break;n+=b[l++]&255;if(n&255)break;if(Ra)for(;Ra--;)a.a.Ja(t++,b[z++]&255);else t&1?D(a.a):ec(a.a,t,f);h=!0}else l++;else l+=2}if(!h&&(null==c&&(c=e),null!=c)){for(e=0;e<b.length;e++)a.a.Ja(c+
e,b[e]);null!=d&&ec(a.a,d,f);h=!0}return h}r(function(){for(var a=B(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ye(d);A(d,c)}});function Be(a){u.call(this,"Keyboard",a,Be);C(this)}w(Be);Be.prototype.Y=function(){return!1};Be.prototype.fa=function(a,b,c,d){this.o=a;this.a=c;this.D=d};r(function(){for(var a=B(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Be(d);A(d,c)}});
function Z(a){this.C=a.baudReceive||9600;this.H=a.baudTransmit||9600;this.P=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.G=a.charBOL;this.s=0;u.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=Ce;b&&(void 0===c&&(c="Panel"),(c=Sa(c,this.id))&&(b=c.u[b])&&this.Y(null,a,b))}this.v=this.B=null;this.exports={connect:this.pb,receiveData:this.gb}}w(Z);var Ce="buffer";g=Z.prototype;
g.Y=function(a,b,c){var d=this;switch(b){case Ce:return this.u[b]=this.g=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.gb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.gb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
g.fa=function(a,b,c,d){this.o=a;this.j=b;this.a=c;this.D=d;var e=this;this.V=yb(48,4);this.L=vb(this.a,function(){e.b&128||!e.h.length||(e.w=e.h.shift()&255,e.P&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&wb(e.a,e.V))});this.W=yb(52,4);this.M=vb(this.a,function(){e.c|=128;e.c&64&&wb(e.a,e.W)});tb(b,this,De);C(this)};
g.pb=function(){if(!this.v){var a=Sb(this.o,"connection");if(a){var b=a.split("->");if(2==b.length){var c=qa(b[0]);if(c!=this.La)return;b=qa(b[1]);if(this.v=Qa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.B=d.receiveData){this.status(this.ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.$=function(a,b){if(!b)if(this.pb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
g.Z=function(a){return a?this.save():!0};g.reset=function(){Fe(this)};g.save=function(){var a=new N(this);a.set(0,[]);return a.data()};g.restore=function(){return Fe(this)};function Fe(a){a.w=0;a.b=0;a.c=128;a.h=[];return!0}g.gb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.h.push(a.charCodeAt(b));else this.h=this.h.concat(a);xb(this.a,this.L,1E3/Math.round(this.C/10));return!0};g.ec=function(){return this.b&65534};
g.Z=function(a){return a?this.save():!0};g.reset=function(){Ee(this)};g.save=function(){var a=new N(this);a.set(0,[]);return a.data()};g.restore=function(){return Ee(this)};function Ee(a){a.w=0;a.b=0;a.c=128;a.h=[];return!0}g.gb=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.h.push(a.charCodeAt(b));else this.h=this.h.concat(a);xb(this.a,this.L,1E3/Math.round(this.C/10));return!0};g.ec=function(){return this.b&65534};
g.Rc=function(a){this.b=this.b&-112|a&111};g.dc=function(){this.b&=-129;0<this.h.length&&xb(this.a,this.L,1E3/Math.round(this.C/10));return this.w};g.Qc=function(){};g.sc=function(){return this.c};g.ed=function(a){128==(this.c&192)&&a&64&&xb(this.a,this.M,1E3/Math.round(this.H/10));this.c=this.c&-70|a&69};g.rc=function(){return 0};
g.dd=function(a){if(a&=255){this.B&&this.B.call(this.v,a);if(this.g)if(13==a)this.s=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=ra[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.G&&!this.s&&c&&(b=String.fromCharCode(this.G)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.R(this.m),
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;xb(this.a,this.M,1E3/Math.round(this.H/10))}};var Ge={},Ee=(Ge[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],Ge[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],Ge[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],Ge[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],Ge);r(function(){for(var a=B(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Z(d);A(d,c)}});
function L(a){u.call(this,"PC11",a,L);this.c=a.autoMount||null;this.h=0;this.L=a.baudReceive||3600;this.w=this.B=this.b=0;this.v=[];this.s=He;this.g=Ie;this.m="";this.G=-1;this.C=!Aa("Mobi")&&window&&"FileReader"in window}w(L);var He="",Ie=0;g=L.prototype;
g.Y=function(a,b,c){var d=this,e=Ie;switch(b){case "listTapes":return this.u[b]=c,c.onchange=function(){var a=d.u.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(n){m("PC11 option error: "+n.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.u[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.u[b]=c,c.onclick=function(){var a=
d.u.listTapes;a&&Je(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.u[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;Je(d,ka(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.u[b]=c,!0}return!1};
g.fa=function(a,b,c,d){this.o=a;this.j=b;this.a=c;this.D=d;this.H=Ke(a);var e=this;if((this.c=Sb(this.o,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){m("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.J=yb(56,4);this.M=vb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.B=e.v[e.w++]&255,Le(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&wb(e.a,e.J))});tb(b,this,Me);Ne(this,"None",He,!0);this.C&&Ne(this,"Local Tape","?");
Ne(this,"Remote Tape","??");Oe(this)||C(this)};g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0};g.reset=function(){this.b&=-2241;this.B=0};function Oe(a){a.h=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.u.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ka(b,!0)}b&&c?Pe(a,c,b,1,!0):Qe(a)}return!!a.h}
function Je(a,b,c,d,e){if(c)if("?"==c)a.K('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=ka(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;Pe(a,b,c,d,!1,e)}else Re(a,!1)}
function Pe(a,b,c,d,e,f){var h=-1;if(a.m.toLowerCase()!=c.toLowerCase()||a.g!=d)h++,Re(a,!0),a.i.Za?a.K("PC11 busy"):(e&&a.h++,Se(a,b,c,d,f)?h++:a.i.Za=!0);h&&a.status(1==a.g?"tape attached":"tape loaded")}
function Se(a,b,c,d,e){var f=c;if(e){var h=new FileReader;h.onload=function(){var e=h.result;e&&(e=new Uint8Array(e,0,e.byteLength),Te(a,b,c,d,e),a.s="?");Qe(a)};h.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!k(f,null,!0,function(e,f,h){var l=0>h&&a.o&&!a.o.i.O;h?a.K('Unable to load tape "'+b+'" (error '+h+": "+e+")",l):(Pa(a.ta,e,f),(e=ua(e,f))&&Te(a,b,c,d,e.N,e.ma,e.la));
a.i.Za=!1;a.h&&(a.h--,a.h||C(a));Qe(a)})}function Ne(a,b,c,d){if((a=a.u.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 Qe(a){var b=a.u.listTapes;if(b&&b.options){a=a.s||a.m;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 Le(a,b){b|=0;if(b!==a.G){var c=a.u.readProgress;c&&(c=(c=B(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Te(a,b,c,d,e,f,h){a.m=c;a.g=d;2==d?a.H&&Be(a.H,e,f,h)?a.status("tape loaded: "+b):(a.m="",a.s=He,a.g=Ie,a.K("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),Le(a,0))}function Re(a,b){if(a.m||!1===b)a.m="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=He,a.g=Ie,Qe(a))}g.save=function(){return(new N(this)).data()};
g.restore=function(){return!0};g.Yb=function(){return this.b&65534};g.Kc=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&wb(this.a,this.J)):(this.b&=-129,this.b|=2048,this.B=0,xb(this.a,this.M,1E3/Math.round(this.L/10))));this.b=this.b&-66|a&65};g.Xb=function(){this.b&=-129;this.b|=2048;return this.B};g.Jc=function(){};var Ue={},Me=(Ue[65384]=[null,null,L.prototype.Yb,L.prototype.Kc,"PRS"],Ue[65386]=[null,null,L.prototype.Xb,L.prototype.Jc,"PRB"],Ue);
function Ve(a,b,c){u.call(this,"Computer",a,Ve);this.i.O=!1;We(this,b);this.B=Sb(this,"autoPower",a);this.g=0;this.L=a.busWidth||a.buswidth;this.b=Xe;this.v=null;this.m=this.H=!1;this.M=Sb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Ye(this);if(this.a=Sa("CPU",this.id)){this.D=Sa("Debugger",this.id);this.j=new $a({id:this.ta+".bus",busWidth:this.L},this.a,this.D);var d,e=x(this.id);if((this.h=Sa("Panel",this.id))&&this.h.Ga)for(b=0;b<e.length;b++)d=e[b],d.K=this.h.K,d.R=this.h.R,d.Ga=this.h.Ga;
this.R("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.R("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.fa&&d.fa(this,this.j,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=Sb(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.m=!0,this.b=Xe),this.b&&(this.w=new N(this,
"1.30.2"),Ze(this.w)?b=null:delete this.w);!b&&this.b&&(b=$e(this))&&(this.m=!0);if(b){var h=this;k(b,null,!0,function(a,b,c){c?(h.s=null,h.m=!1,h.K("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(h.v=b,h.H=!0);C(h)})}else C(this);this.u.power||(this.B=!0);!c&&this.B&&af(this,this.Ia)}else m("Unable to find CPU component")}w(Ve);var Xe=0;
function We(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){m(d.message+" ("+c+")")}}a.J=b}function Sb(a,b,c){var d=b.toLowerCase(),d=Ja[b]||Ja[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 af(a,b,c){for(var d=x(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ta(f)){Ta(f,function(){af(a,b,c)});return}}b.call(a,c)}
function bf(a,b){var c=new N(a,"1.30.2","validate");if(Ze(c)&&cf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=Ve.prototype;
g.Ia=function(a){void 0===a&&(a=this.b||(this.v?1:Xe));if(!this.g){this.g++;var b=!1,c=!1;this.G=!1;var d=this.w||new N(this,"1.30.2");if(-1==a)b=!0;else if(a>Xe){if(Ze(d,this.v)){this.o=new N(this,"1.30.2","failsafe");Ze(this.o)&&(df(this,d),a=2,ef(this.o));this.o.set("timestamp",ta());ff(this.o);var e=this.b&&!this.m;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=cf(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?Ze(d,h):("error"==
f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(za("user",""),this.c=null)):this.R(f+": "+h),ef(d),Ze(d)?(c=cf(d),e=!0):c=!1))}e&&bf(this,c?d:null)}else 2==a&&d.clear()}else bf(this);delete this.v;delete this.w}e=x(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=gf(this,h,d,b,c));b=[d,a,c];-1!=a?af(this,this.nb,b):this.nb(b)}};
function gf(a,b,c,d,e){if(!b.i.O){b.i.O=!0;if(b.$){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.$(f,d)&&f&&(m("Unable to restore state for "+b.type),a.C&&!a.H?(c.clear(),a.b=Xe,window&&window.location.reload()):a.G=!0,b.$(null),e=!1)}if(!d&&b.rb)for(a=b.rb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
g.nb=function(a){var b=a[0],c=0>a[1];a=a[2];this.P=!0;this.i.O=!0;var d=this.u.power;d&&(d.textContent="Shutdown");this.a&&(gf(this,this.a,b,c,a),this.a.Fa());this.G&&(df(this,b),b.clear());!c&&this.o&&(this.o.clear(),delete this.o);this.g=0};
function df(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.M;d.user=c;d.type="bug";d.data=b;k("http://www.pcjs.org/api/v1/report",d,!0)}}
function hf(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new N(a,"1.30.2"),h=new N(a,"1.30.2","validate"),l=ta();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&D(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.O=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n<l.length;n++){var q=l[n];q.i.O&&(q.Z&&(d=q.Z(b,c),"object"===typeof d&&f.set(q.id,
d)),c&&(q.i.O=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&jf(a,a.c,f.toString()),ff(h)&&ff(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.i.O=!1,b=a.u.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.j&&this.j.reset&&this.j.reset();for(var a=x(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.j&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ba(!0)};
this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;xb(this.a,this.M,1E3/Math.round(this.H/10))}};var Fe={},De=(Fe[65392]=[null,null,Z.prototype.ec,Z.prototype.Rc,"RCSR"],Fe[65394]=[null,null,Z.prototype.dc,Z.prototype.Qc,"RBUF"],Fe[65396]=[null,null,Z.prototype.sc,Z.prototype.ed,"XCSR"],Fe[65398]=[null,null,Z.prototype.rc,Z.prototype.dd,"XBUF"],Fe);r(function(){for(var a=B(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Z(d);A(d,c)}});
function L(a){u.call(this,"PC11",a,L);this.c=a.autoMount||null;this.h=0;this.L=a.baudReceive||3600;this.w=this.B=this.b=0;this.v=[];this.s=Ge;this.g=He;this.m="";this.G=-1;this.C=!Aa("Mobi")&&window&&"FileReader"in window}w(L);var Ge="",He=0;g=L.prototype;
g.Y=function(a,b,c){var d=this,e=He;switch(b){case "listTapes":return this.u[b]=c,c.onchange=function(){var a=d.u.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(n){m("PC11 option error: "+n.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.u[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.u[b]=c,c.onclick=function(){var a=
d.u.listTapes;a&&Ie(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.C){c.parentNode.removeChild(c);break}this.u[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ie(d,ka(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.u[b]=c,!0}return!1};
g.fa=function(a,b,c,d){this.o=a;this.j=b;this.a=c;this.D=d;this.H=Je(a);var e=this;if((this.c=Sb(this.o,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){m("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.J=yb(56,4);this.M=vb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.B=e.v[e.w++]&255,Ke(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&wb(e.a,e.J))});tb(b,this,Le);Me(this,"None",Ge,!0);this.C&&Me(this,"Local Tape","?");
Me(this,"Remote Tape","??");Ne(this)||C(this)};g.$=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};g.Z=function(a){return a?this.save():!0};g.reset=function(){this.b&=-2241;this.B=0};function Ne(a){a.h=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.u.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ka(b,!0)}b&&c?Oe(a,c,b,1,!0):Pe(a)}return!!a.h}
function Ie(a,b,c,d,e){if(c)if("?"==c)a.K('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=ka(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;Oe(a,b,c,d,!1,e)}else Qe(a,!1)}
function Oe(a,b,c,d,e,f){var h=-1;if(a.m.toLowerCase()!=c.toLowerCase()||a.g!=d)h++,Qe(a,!0),a.i.Za?a.K("PC11 busy"):(e&&a.h++,Re(a,b,c,d,f)?h++:a.i.Za=!0);h&&a.status(1==a.g?"tape attached":"tape loaded")}
function Re(a,b,c,d,e){var f=c;if(e){var h=new FileReader;h.onload=function(){var e=h.result;e&&(e=new Uint8Array(e,0,e.byteLength),Se(a,b,c,d,e),a.s="?");Pe(a)};h.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):na()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!k(f,null,!0,function(e,f,h){var l=0>h&&a.o&&!a.o.i.O;h?a.K('Unable to load tape "'+b+'" (error '+h+": "+e+")",l):(Pa(a.ta,e,f),(e=ua(e,f))&&Se(a,b,c,d,e.N,e.ma,e.la));
a.i.Za=!1;a.h&&(a.h--,a.h||C(a));Pe(a)})}function Me(a,b,c,d){if((a=a.u.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 Pe(a){var b=a.u.listTapes;if(b&&b.options){a=a.s||a.m;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 Ke(a,b){b|=0;if(b!==a.G){var c=a.u.readProgress;c&&(c=(c=B(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.G=b}}function Se(a,b,c,d,e,f,h){a.m=c;a.g=d;2==d?a.H&&Ae(a.H,e,f,h)?a.status("tape loaded: "+b):(a.m="",a.s=Ge,a.g=He,a.K("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),Ke(a,0))}function Qe(a,b){if(a.m||!1===b)a.m="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=Ge,a.g=He,Pe(a))}g.save=function(){return(new N(this)).data()};
g.restore=function(){return!0};g.Yb=function(){return this.b&65534};g.Kc=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&wb(this.a,this.J)):(this.b&=-129,this.b|=2048,this.B=0,xb(this.a,this.M,1E3/Math.round(this.L/10))));this.b=this.b&-66|a&65};g.Xb=function(){this.b&=-129;this.b|=2048;return this.B};g.Jc=function(){};var Te={},Le=(Te[65384]=[null,null,L.prototype.Yb,L.prototype.Kc,"PRS"],Te[65386]=[null,null,L.prototype.Xb,L.prototype.Jc,"PRB"],Te);
function Ue(a,b,c){u.call(this,"Computer",a,Ue);this.i.O=!1;Ve(this,b);this.B=Sb(this,"autoPower",a);this.g=0;this.L=a.busWidth||a.buswidth;this.b=We;this.v=null;this.m=this.H=!1;this.M=Sb(this,"url")||"";(Math.random()+.1).toString(36);this.c=Xe(this);if(this.a=Sa("CPU",this.id)){this.D=Sa("Debugger",this.id);this.j=new $a({id:this.ta+".bus",busWidth:this.L},this.a,this.D);var d,e=x(this.id);if((this.h=Sa("Panel",this.id))&&this.h.Ga)for(b=0;b<e.length;b++)d=e[b],d.K=this.h.K,d.R=this.h.R,d.Ga=this.h.Ga;
this.R("PDPjs v1.30.2\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.R("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.fa&&d.fa(this,this.j,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.s=d:this.b=parseInt(d,10));var f;if(a=Sb(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.m=!0,this.b=We),this.b&&(this.w=new N(this,
"1.30.2"),Ye(this.w)?b=null:delete this.w);!b&&this.b&&(b=Ze(this))&&(this.m=!0);if(b){var h=this;k(b,null,!0,function(a,b,c){c?(h.s=null,h.m=!1,h.K("Unable to load machine state from server (error "+c+(b?": "+qa(b):"")+")")):(h.v=b,h.H=!0);C(h)})}else C(this);this.u.power||(this.B=!0);!c&&this.B&&$e(this,this.Ia)}else m("Unable to find CPU component")}w(Ue);var We=0;
function Ve(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){m(d.message+" ("+c+")")}}a.J=b}function Sb(a,b,c){var d=b.toLowerCase(),d=Ja[b]||Ja[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 $e(a,b,c){for(var d=x(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ta(f)){Ta(f,function(){$e(a,b,c)});return}}b.call(a,c)}
function af(a,b){var c=new N(a,"1.30.2","validate");if(Ye(c)&&bf(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.K("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}g=Ue.prototype;
g.Ia=function(a){void 0===a&&(a=this.b||(this.v?1:We));if(!this.g){this.g++;var b=!1,c=!1;this.G=!1;var d=this.w||new N(this,"1.30.2");if(-1==a)b=!0;else if(a>We){if(Ye(d,this.v)){this.o=new N(this,"1.30.2","failsafe");Ye(this.o)&&(cf(this,d),a=2,df(this.o));this.o.set("timestamp",ta());ef(this.o);var e=this.b&&!this.m;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=bf(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?Ye(d,h):("error"==
f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(za("user",""),this.c=null)):this.R(f+": "+h),df(d),Ye(d)?(c=bf(d),e=!0):c=!1))}e&&af(this,c?d:null)}else 2==a&&d.clear()}else af(this);delete this.v;delete this.w}e=x(this.id);for(f=0;f<e.length;f++)h=e[f],h!==this&&h!=this.a&&(c=ff(this,h,d,b,c));b=[d,a,c];-1!=a?$e(this,this.nb,b):this.nb(b)}};
function ff(a,b,c,d,e){if(!b.i.O){b.i.O=!0;if(b.$){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.$(f,d)&&f&&(m("Unable to restore state for "+b.type),a.C&&!a.H?(c.clear(),a.b=We,window&&window.location.reload()):a.G=!0,b.$(null),e=!1)}if(!d&&b.rb)for(a=b.rb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
g.nb=function(a){var b=a[0],c=0>a[1];a=a[2];this.P=!0;this.i.O=!0;var d=this.u.power;d&&(d.textContent="Shutdown");this.a&&(ff(this,this.a,b,c,a),this.a.Fa());this.G&&(cf(this,b),b.clear());!c&&this.o&&(this.o.clear(),delete this.o);this.g=0};
function cf(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.M;d.user=c;d.type="bug";d.data=b;k("http://www.pcjs.org/api/v1/report",d,!0)}}
function gf(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new N(a,"1.30.2"),h=new N(a,"1.30.2","validate"),l=ta();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.Z&&(c&&D(a.a),d=a.a.Z(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.i.O=!1,!1===d&&(e=null)));for(var l=x(a.id),n=0;n<l.length;n++){var q=l[n];q.i.O&&(q.Z&&(d=q.Z(b,c),"object"===typeof d&&f.set(q.id,
d)),c&&(q.i.O=!1,!1===d&&(e=null)))}e&&(c?(l=d=!1,b?(a.c&&hf(a,a.c,f.toString()),ef(h)&&ef(f)||(e=null,d=l=!0)):a.b&&(d=!0,l=3==a.b),d&&f.clear(l)):e=f.toString());c&&(a.i.O=!1,b=a.u.power)&&(b.textContent="Power");a.g=0;return e}g.reset=function(){this.j&&this.j.reset&&this.j.reset();for(var a=x(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.j&&c.reset&&c.reset()}};g.start=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.ba(!0)};
g.stop=function(a,b){for(var c=x(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.ba(!0)};
g.Y=function(a,b,c){var d=this;switch(b){case "power":return this.u[b]=c,c.onclick=function(){d.g||(d.i.O?hf(d,!1,!0):af(d,d.Ia))},!0;case "reset":return this.u[b]=c,c.onclick=function(){if(d.i.O&&!d.g)if(d.b&&!d.s){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");hf(d,a,!0);!a&&d.C?window&&window.location.reload():d.Ia(Xe)}else d.reset(),d.a&&d.a.Fa()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.u[b]=
c,c.onclick=function(){var a=Ye(d,!0);if(a){var b=!!(d.b&&!d.s||d.C),c=hf(d,b);b?jf(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
function Ye(a,b){var c=a.c;c||((c=ya("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=kf(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
function kf(a,b){a.c=null;b=k(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){m(d.message+" ("+c+")")}return a.c}function $e(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+lf(a,"1.30.2"));return b}
function jf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=lf(a,"1.30.2");d.data=c;b=k(na()+"/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.K("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.K(c),za("user",""),a.c=null)}}
function Ke(a){var b;a=x(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 Zb(a,b){if(a.Ga){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.Ga.focus();!b&&window&&window.scrollTo(c,d)}}g.ba=function(a){this.a&&this.a.ba(a);this.h&&this.h.ba(a)};
r(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=B(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new Ve(h,d,!0);A(h,f);h.B&&af(h,h.Ia)}});p.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Sa("Computer",c.id))&&c.P&&!c.i.O&&c.Ia(-1)}});p.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Sa("Computer",c.id))&&c.i.O&&hf(c,!(!c.b||c.s),!0)}});
function N(a,b,c){this.id=a.id;this.key=lf(a,b,c);this.D=a.D;ef(this,a.Hb)}function lf(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}
N.prototype={constructor:N,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){ef(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 ef(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function ff(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(m("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function cf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){m(c.message||c),b=!1}return b}function Ze(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:xa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var mf=0;
function nf(a,b,c,d,e,f){e("Loading "+a+"...");k(a,null,!0,function(h,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):of(l,a,b,c,d,e,f)})}
function of(a,b,c,d,e,f,h){function l(a,f){if(f)h(f,null);else{c&&(Pa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?e?pf(a,f,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
function pf(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");k(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);pf(a,b,c)}})}else c(a,null)}
function qf(a,b,c,d){function e(a){if(void 0===l){var b=h&&B(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--mf||Ga(!0));n=!1}var h,l,n=!0;mf++;Oa[a]={};try{if(h=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=q:z.appendChild(document.createTextNode(q));t.appendChild(z)}c||
(c="/versions/pdpjs/1.30.2/components.xsl");q=function(d,l){l?nf(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--mf||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--mf||Ga(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?nf(b,a,d,!0,e,q):of(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Ra){f(Ra.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return qf(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map
g.Y=function(a,b,c){var d=this;switch(b){case "power":return this.u[b]=c,c.onclick=function(){d.g||(d.i.O?gf(d,!1,!0):$e(d,d.Ia))},!0;case "reset":return this.u[b]=c,c.onclick=function(){if(d.i.O&&!d.g)if(d.b&&!d.s){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");gf(d,a,!0);!a&&d.C?window&&window.location.reload():d.Ia(We)}else d.reset(),d.a&&d.a.Fa()},!0;case "save":if(ma())c.parentNode.removeChild(c);else return this.u[b]=
c,c.onclick=function(){var a=Xe(d,!0);if(a){var b=!!(d.b&&!d.s||d.C),c=gf(d,b);b?hf(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1};
function Xe(a,b){var c=a.c;c||((c=ya("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=jf(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c}
function jf(a,b){a.c=null;b=k(na()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){m(d.message+" ("+c+")")}return a.c}function Ze(a){var b=null;a.c&&(b=na()+"/api/v1/user?req=load&user="+a.c+"&state="+kf(a,"1.30.2"));return b}
function hf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=kf(a,"1.30.2");d.data=c;b=k(na()+"/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.K("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.K(c),za("user",""),a.c=null)}}
function Je(a){var b;a=x(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}g.ba=function(a){this.a&&this.a.ba(a);this.h&&this.h.ba(a)};r(function(){for(var a=B(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=B(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new Ue(h,d,!0);A(h,f);h.B&&$e(h,h.Ia)}});
p.show.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Sa("Computer",c.id))&&c.P&&!c.i.O&&c.Ia(-1)}});p.exit.push(function(){for(var a=B(document,"pdp11","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Sa("Computer",c.id))&&c.i.O&&gf(c,!(!c.b||c.s),!0)}});function N(a,b,c){this.id=a.id;this.key=kf(a,b,c);this.D=a.D;df(this,a.Hb)}function kf(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}
N.prototype={constructor:N,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){df(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 df(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function ef(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(m("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function bf(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){m(c.message||c),b=!1}return b}function Ye(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:xa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var lf=0;
function mf(a,b,c,d,e,f){e("Loading "+a+"...");k(a,null,!0,function(h,l,n){n?(l||(l="unable to load "+a+" ("+n+")"),f(l,null)):nf(l,a,b,c,d,e,f)})}
function nf(a,b,c,d,e,f,h){function l(a,f){if(f)h(f,null);else{c&&(Pa(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?e?of(a,f,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
function of(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");k(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],h);of(a,b,c)}})}else c(a,null)}
function pf(a,b,c,d){function e(a){if(void 0===l){var b=h&&B(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=pa(a))}function f(a){e("Error: "+a);n&&(--lf||Ga(!0));n=!1}var h,l,n=!0;lf++;Oa[a]={};try{if(h=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],z=document.createElement("style");z.type="text/css";z.styleSheet?z.styleSheet.cssText=q:z.appendChild(document.createTextNode(q));t.appendChild(z)}c||
(c="/versions/pdpjs/1.30.2/components.xsl");q=function(d,l){l?mf(c,null,null,!1,e,function(d,n){n?(Pa(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--lf||Ga(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--lf||Ga(!0)):f("invalid machine element: "+
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?mf(b,a,d,!0,e,q):nf(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Ra){f(Ra.message)}return n}window.embedPDP11=function(a,b,c,d){Ga(!1);return pf(a,b,c,d)};window.enableEvents=Ga;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11.map