Added more PDP-11 paper tape resources

This commit is contained in:
Jeff Parsons 2016-10-23 00:43:20 -07:00 committed by Jeff Parsons
commit d0618c34bc
48 changed files with 309 additions and 152 deletions

View file

@ -8,7 +8,7 @@ DEC PDP-11 Bootstrap Loader
---------------------------
The **Bootstrap Loader** is a small program that loads the [Absolute Loader](/apps/pdp11/tapes/absloader/),
which is then used to load other PDP-11 tapes, such as [BASIC (Single User)](/apps/pdp11/tabes/basic/).
which is then used to load other PDP-11 tapes in the "Absolute Format," such as [BASIC (Single User)](/apps/pdp11/tabes/basic/).
Here's what the **Bootstrap Loader** looks like:

View file

@ -7,32 +7,34 @@ permalink: /apps/pdp11/tapes/
DEC PDP-11 Tape Images
----------------------
We have archived the following DEC PDP-11 Tapes:
To load any of the DEC PDP-11 tapes listed below, you will need to use a [PDPjs Machine](/devices/pdp11/machine/)
with a [PC11 High-Speed Paper Tape Reader/Punch](/devices/pdp11/pc11/), such as this
[PDP-11/20](/devices/pdp11/machine/1120/basic/debugger), and then follow this three-step process:
- [Absolute Loader](absloader/)
- [BASIC (Single User)](basic/)
- Load the [DEC PDP-11 Bootstrap Loader](/apps/pdp11/boot/bootstrap/)
- Attach the [Absolute Loader](absloader/) tape image, and load it with the Bootstrap Loader
- Attach one of the "Absolute Format" tape images below, and load it with the Absolute Loader
along with a copy of the [DEC PDP-11 Bootstrap Loader](/apps/pdp11/boot/bootstrap/), which is required if you actually want
to load any of the above tapes into memory using the [PC11 High-Speed Paper Tape Reader/Punch](/devices/pdp11/pc11/).
This was the real-world process. Fortunately, PDPjs machines include features that simplify the process.
For the most part, the tapes we have archived are in the DEC "Absolute Format". More information about that format
is on the [Absolute Loader](absloader/) page.
For starters, any "Absolute Format" tape (which should include all the tapes listed below) can be loaded directly
into RAM using the machine's "Load" button instead of "Attach". In most cases, this eliminates the first two steps.
DEC Paper Tape Software (circa 1971)
DEC Paper Tape Software (circa 1970)
------------------------------------
As documented in the [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf),
p. 155, "PAPER TAPE SOFTWARE", the following software was available on paper tape:
- PAL-11A ASSEMBLER
- [PAL-11A ASSEMBLER](pal11a/)
- PAL-11S ASSEMBLER (Program Assembly Language for the PDP-11, Relocatable Version)
- ED-11 (Text Editor program)
- DUMPTT (Dump Octal)
- DUMPAB (Dump Absolute Binary Code)
- FPP-11 (Floating-Point and Math Package for the PDP-11)
- ODT-11 (On-line Debugging Technique for the PDP-11)
- IOX (PDP-11 Input/Output eXecutive)
- PDP-11 BASIC (Beginners All-purpose Symbolic Instruction Code)
- [ED-11](ed11/) (Text Editor program)
- [DUMPTT](dumptt/) (Dump Octal)
- [DUMPAB](dumpab/) (Dump Absolute Binary Code)
- [FPP-11](fpp11/) (Floating-Point and Math Package for the PDP-11)
- [ODT-11](odt11/) (On-line Debugging Technique for the PDP-11)
- [IOX](iox/) (PDP-11 Input/Output eXecutive)
- [PDP-11 BASIC](basic/) (Beginners All-purpose Symbolic Instruction Code)
There was a separate DEC publication, [PDP-11 Paper Tape Software Handbook](http://archive.pcjs.org/pubs/dec/pdp11/other/DEC-11-XPTSA-B-D_PDP-11_Paper_Tape_Software_Handbook.pdf),
that described all of the above software in greater detail, and it included some programs that the 1971 Handbook listed under
@ -67,3 +69,6 @@ available as paper tape image files, with the exception of PAL-11S and LINK-11S:
- [DUMPTT-V001A SA=XX7440 RA=XX7440](dumptt/DEC-11-Y1PA-PO.json)
- [DUMPTT-V001A SA=LOAD ADDRESS RA=LOAD ADDRESS](dumptt/DEC-11-Y1PA-PB.json)
- [DUMPAB-V001A SA=LOAD ADDRESS RA=LOAD ADDRESS](dumpab/DEC-11-Y2PA-PB.json)
- [DEC-11-AJPB-PB BASIC-11 v007A SA=16104 RA=0](basic/DEC-11-AJPB-PB.json)
Some additional information on DEC's Paper Tape Software is available at [retrotechnology.com](http://retrotechnology.com/pdp11/11_20_PTS.html).

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -7,8 +7,10 @@ permalink: /apps/pdp11/tapes/absloader/
DEC PDP-11 Absolute Loader
--------------------------
[![DEC-11-L2PC-PO](DEC-11-L2PC-PO.jpg)](DEC-11-L2PC-PO.json)
The Absolute Loader is a special tape image that must be loaded in order to load *other* tapes
that use what we'll call the "Absolute Format." To see the Absolute Loader in action, start with the
that use what we'll call the "Absolute Format." To see the Absolute Loader in action, try the
[PDP-11/20 Bootstrap Loader Demo](/devices/pdp11/machine/1120/bootstrap/debugger/).
The *loadImage()* interface of the [PDPjs RAM Component](/modules/pdp11/lib/ram.js) explains what
@ -39,8 +41,8 @@ we know about the "Absolute Format":
I haven't examined enough tapes (or the Absolute Loader code) to know for sure.
[Other sites](http://www.retrocmp.com/stories/dec-pc05-papertape/242-dec-pc05-working-with-paper-tapes)
have referred to this tape format as the "Standard Absolute" format, but I've not found confirmation of
that terminology in any DEC publication. In fact, I think that term may have been a misreading of instructions
have referred to this tape format as the "Standard Absolute" format, but I've not found that terminology
used in any DEC publication. In fact, I think that term may have arisen from a misreading of instructions
found in DEC manuals like the ["MEM EXER 16K" Diagnostics Manual](http://archive.pcjs.org/pubs/dec/pdp11/other/AC-9045F-MC_CZQMCF0-0-124K-Mem-Exer-16k_Feb78.pdf):
Load the program using any standard absolute loader.

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -13,10 +13,7 @@ machines:
DEC PDP-11 BASIC
----------------
The first PDPjs machine to run DEC PDP-11 BASIC was this [PDP-11/20](/devices/pdp11/machine/1120/basic/debugger/),
shown below.
{% include machine.html id="test1120" %}
[![DEC-11-AJPB-PB](DEC-11-AJPB-PB.jpg)](DEC-11-AJPB-PB.json)
According to the [PDP-11/20 Handbook (1971)](http://archive.pcjs.org/pubs/dec/pdp11/1120/PDP1120_Handbook_1971.pdf), p. 160,
notable features of PDP-11 BASIC included:
@ -29,7 +26,11 @@ notable features of PDP-11 BASIC included:
- User programs can be halted (with CTRL/P) without clearing variables; PRINT can then be used to examine values
- Ability to call assembly language functions
PCjs has also archived the following DEC PDP-11 BASIC resources:
PDP-11 BASIC has been loaded into the [PDP-11/20](/devices/pdp11/machine/1120/basic/debugger/) below.
{% include machine.html id="test1120" %}
We have archived the following DEC PDP-11 BASIC resources:
- [BASIC (Single User) Tape Image](DEC-11-AJPB-PB.json)
- [LISTING OF BASIC/PTS (March 1974)](http://archive.pcjs.org/pubs/dec/pdp11/basic/AB-2045B-SC_BASIC_PTS_Listing_Mar77.pdf)

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View file

@ -0,0 +1,10 @@
---
layout: page
title: DUMPAB (Paper Tape)
permalink: /apps/pdp11/tapes/dumpab/
---
DUMPAB (Paper Tape)
-------------------
[![DEC-11-Y2PA-PB](DEC-11-Y2PA-PB.jpg)](DEC-11-Y2PA-PB.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View file

@ -0,0 +1,12 @@
---
layout: page
title: DUMPTT (Paper Tape)
permalink: /apps/pdp11/tapes/dumptt/
---
DUMPTT (Paper Tape)
-------------------
[![DEC-11-Y1PA-PO](DEC-11-Y1PA-PO.jpg)](DEC-11-Y1PA-PO.json)
[![DEC-11-Y1PA-PB](DEC-11-Y1PA-PB.jpg)](DEC-11-Y1PA-PB.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -0,0 +1,10 @@
---
layout: page
title: ED-11 (Paper Tape)
permalink: /apps/pdp11/tapes/ed11/
---
ED-11 (Paper Tape)
------------------
[![DEC-11-E1PA-PB](DEC-11-E1PA-PB.jpg)](DEC-11-E1PA-PB.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -0,0 +1,30 @@
---
layout: page
title: FPP-11 (Paper Tape)
permalink: /apps/pdp11/tapes/fpp11/
---
FPP-11 (Paper Tape)
-------------------
[![DEC-11-YQPB-PA1](DEC-11-YQPB-PA1.jpg)](DEC-11-YQPB-PA1.json)
[![DEC-11-YQPB-PA2](DEC-11-YQPB-PA2.jpg)](DEC-11-YQPB-PA2.json)
[![DEC-11-YQPB-PA3](DEC-11-YQPB-PA3.jpg)](DEC-11-YQPB-PA3.json)
[![DEC-11-YQPB-PA4](DEC-11-YQPB-PA4.jpg)](DEC-11-YQPB-PA4.json)
[![DEC-11-YQPB-PA5](DEC-11-YQPB-PA5.jpg)](DEC-11-YQPB-PA5.json)
[![DEC-11-YQPB-PA6](DEC-11-YQPB-PA6.jpg)](DEC-11-YQPB-PA6.json)
[![DEC-11-YQPB-PA7](DEC-11-YQPB-PA7.jpg)](DEC-11-YQPB-PA7.json)
[![DEC-11-YQPB-PA8](DEC-11-YQPB-PA8.jpg)](DEC-11-YQPB-PA8.json)
[![DEC-11-YQPB-PA9](DEC-11-YQPB-PA9.jpg)](DEC-11-YQPB-PA9.json)
[![DEC-11-YQPB-PA10](DEC-11-YQPB-PA10.jpg)](DEC-11-YQPB-PA10.json)
[![DEC-11-YQPB-PA11](DEC-11-YQPB-PA11.jpg)](DEC-11-YQPB-PA11.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View file

@ -0,0 +1,14 @@
---
layout: page
title: IOX (Paper Tape)
permalink: /apps/pdp11/tapes/iox/
---
IOX (Paper Tape)
----------------
[![DEC-11-YIPA-PA1](DEC-11-YIPA-PA1.jpg)](DEC-11-YIPA-PA1.json)
[![DEC-11-YIPA-PA2](DEC-11-YIPA-PA2.jpg)](DEC-11-YIPA-PA2.json)
[![DEC-11-YIPA-PB](DEC-11-YIPA-PB.jpg)](DEC-11-YIPA-PB.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -0,0 +1,12 @@
---
layout: page
title: ODT-11 (Paper Tape)
permalink: /apps/pdp11/tapes/odt11/
---
ODT-11 (Paper Tape)
-------------------
[![DEC-11-O1PA-PA](DEC-11-O1PA-PA.jpg)](DEC-11-O1PA-PA.json)
[![DEC-11-O1PA-PB](DEC-11-O1PA-PB.jpg)](DEC-11-O1PA-PB.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View file

@ -0,0 +1,12 @@
---
layout: page
title: ODT-11X (Paper Tape)
permalink: /apps/pdp11/tapes/odt11x/
---
ODT-11X (Paper Tape)
--------------------
[![DEC-11-O2PA-PA](DEC-11-O2PA-PA.jpg)](DEC-11-O2PA-PA.json)
[![DEC-11-O2PA-PB](DEC-11-O2PA-PB.jpg)](DEC-11-O2PA-PB.json)

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View file

@ -0,0 +1,12 @@
---
layout: page
title: PAL-11A Assembler (Paper Tape)
permalink: /apps/pdp11/tapes/pal11a/
---
PAL-11A Assembler (Paper Tape)
------------------------------
[![DEC-11-ASPA-PB](DEC-11-ASPA-PB.jpg)](DEC-11-ASPA-PB.json)
[![DEC-11-ASPA-PB](DEC-11-ASXA-PB.jpg)](DEC-11-ASXA-PB.json)

View file

@ -19,7 +19,7 @@ We have archived a selection of [Paper Tape Images](/apps/pdp11/tapes/) for use
To make it easy for PDPjs machines to load those tapes, we created the following High-Speed Paper Tape Reader (PC11)
Device XML file:
- [PC11 Default](/devices/pdp11/pc11/default.xml)
- [Default](/devices/pdp11/pc11/default.xml)
which is typically referenced by a Machine XML file as:

View file

@ -846,7 +846,7 @@ else return this.qa[b]=c,c.onclick=function(){var a=Ur(d,!0);if(a){var b=!!(d.A&
function Ur(a,b){var c=a.B;c||((c=Ha("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=ds(a,c))||a.Na("The user ID is invalid.")):b&&a.Na("Browser local storage is not available"));return c}
function ds(a,b){a.B=null;b=Aa(Ba()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ia("user",b.data),a.B=b.data)}catch(d){w(d.message+" ("+c+")")}return a.B}function Vr(a){var b=null;a.B&&(b=Ba()+"/api/v1/user?req=load&user="+a.B+"&state="+es(a,"1.30.2"));return b}
function cs(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=es(a,"1.30.2");d.data=c;b=Aa(Ba()+"/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.Na("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.Na(c),Ia("user",""),a.B=null)}}
function Jb(a,b,c){a=nb(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}l.wd=function(a){if(this.L.length){var b=0,c=0;a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.L[0];d.X&&d.X.focus();a&&window&&window.scrollTo(b,c)}};l.pd=function(a){this.F&&this.F.pd(a);this.C&&this.C.pd(a)};
function Jb(a,b,c){a=nb(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}l.wd=function(a){if(this.L.length){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.L[0];d.X&&d.X.focus();!a&&window&&window.scrollTo(b,c)}};l.pd=function(a){this.F&&this.F.pd(a);this.C&&this.C.pd(a)};
function jd(a,b){for(var c=0;c<a.L.length;c++)un(a.L[c],b);if(a.C&&(a=a.C,a.Ja)){Ob(a,18,a.aa,a.Ga);if(a.gb){b=a.ga;var c=a.A,d,e;null==d&&(d=0);null==e&&(e=b.W-d|0);c||(c={ih:0,Td:0,Yg:[]});var f=d>>>b.La;d=d+e-1>>>b.La;c.ih=0;for(c.Td=0;f<=d;)e=b.sa[f],c.ih+=e.size,e.size&&(c.Yg.push(wa(Nb,f,0,0,e.type)),c.Td++),f++;a.A=c;a.ya=a.A.Td*a.ga.Sb/691200;d=0;a.A.fj=0;a.A.Bf||(a.A.Bf=[]);e=-1;b=0;for(var g=-1,c=0;c<a.A.Td;c++){var h=a.A.Yg[c],f=xa(Nb.type,h),h=xa(Nb.Hk,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=
Qb(a,b,g,e)),e=f,b=c;g=h}d+=Qb(a,b,c-b,e);e=a.A.ul!=d;a.A.ul=d;if(e){e=new Hb(0,0,a.aa.width,a.aa.height);a.A.Se=[];b=a.A.Td;for(d=0;d<a.A.fj;d++)c=a.A.Bf[d].Td,a.A.Se.push(Ib(e,c,b,!d)),b-=c;for(d=0;d<a.A.Se.length;d++)e=a.A.Bf[d],b=c=a.A.Se[d],f=a.Ga,(g=Fc[e.type])||(g=new Gb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.ad,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.ad,b.A),b=a,f=c,b.fa=b.ua,b.W=b.va,c=f.x+(f.ad>>1),g=f.y+(f.A>>1),h=f.A,f.ad<f.A&&(h=f.ad,b.ra=!0,b.N.save(),
b.N.translate(c,g),b.N.rotate(-Math.PI/2),c=g=0),h<b.W&&(b.W=h,b.fa=b.W+"px Monaco, Lucida Console, Courier New"),f=g,b.C=c,b.U=f,b=a,e=Yb[e.type]+" ("+(e.Td*a.ga.Sb/1024|0)+"Kb)",b.N.font=b.fa,b.C-=b.N.measureText(e).width>>1,b.U+=(b.W>>1)-2,Pb(b,e),b.ra&&(b.N.restore(),b.ra=!1)}}else Pb(a,"This space intentionally left blank");a.context.drawImage(a.aa,0,0,a.aa.width,a.aa.height,a.sb,a.Jb,a.Ya,a.fb);a.Ja=!1}}

View file

@ -664,7 +664,7 @@ else return this.la[b]=c,c.onclick=function(){var a=qn(d,!0);if(a){var b=!!(d.B&
function qn(a,b){var c=a.C;c||((c=xa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Bn(a,c))||a.Ba("The user ID is invalid.")):b&&a.Ba("Browser local storage is not available"));return c}
function Bn(a,b){a.C=null;b=sa(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.C=b.data)}catch(d){r(d.message+" ("+c+")")}return a.C}function rn(a){var b=null;a.C&&(b=ta()+"/api/v1/user?req=load&user="+a.C+"&state="+Cn(a,"1.30.2"));return b}
function An(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Cn(a,"1.30.2");d.data=c;b=sa(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Ba("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.Ba(c),ya("user",""),a.C=null)}}
function mb(a,b,c){a=Wa(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function xc(a,b){if(a.I.length){var c=0,d=0;b&&window&&(c=window.scrollX,d=window.scrollY);a=a.I[0];a.G&&a.G.focus();b&&window&&window.scrollTo(c,d)}}l.Zd=function(a){this.A&&this.A.Zd(a);this.D&&this.D.Zd(a)};
function mb(a,b,c){a=Wa(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function xc(a,b){if(a.I.length){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a=a.I[0];a.G&&a.G.focus();!b&&window&&window.scrollTo(c,d)}}l.Zd=function(a){this.A&&this.A.Zd(a);this.D&&this.D.Zd(a)};
function Ac(a,b){for(var c=0;c<a.I.length;c++)nl(a.I[c],b);if(a.D&&(a=a.D,a.ua)){rb(a,18,a.S,a.ra);if(a.Ga){b=a.ia;var c=a.B,d,e;null==d&&(d=0);null==e&&(e=b.L-d|0);c||(c={mg:0,fd:0,fg:[]});var f=d>>>b.da;d=d+e-1>>>b.da;c.mg=0;for(c.fd=0;f<=d;)e=b.R[f],c.mg+=e.size,e.size&&(c.fg.push(qa(qb,f,0,0,e.type)),c.fd++),f++;a.B=c;a.ma=a.B.fd*a.ia.xb/691200;d=0;a.B.ii=0;a.B.Ke||(a.B.Ke=[]);e=-1;b=0;for(var g=-1,c=0;c<a.B.fd;c++){var h=a.B.fg[c],f=ra(qb.type,h),h=ra(qb.Cj,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=tb(a,
b,g,e)),e=f,b=c;g=h}d+=tb(a,b,c-b,e);e=a.B.fk!=d;a.B.fk=d;if(e){e=new kb(0,0,a.S.width,a.S.height);a.B.ee=[];b=a.B.fd;for(d=0;d<a.B.ii;d++)c=a.B.Ke[d].fd,a.B.ee.push(lb(e,c,b,!d)),b-=c;for(d=0;d<a.B.ee.length;d++)e=a.B.Ke[d],b=c=a.B.ee[d],f=a.ra,(g=ac[e.type])||(g=new jb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.Fc,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.Fc,b.A),b=a,f=c,b.P=b.ha,b.L=b.ka,c=f.x+(f.Fc>>1),g=f.y+(f.A>>1),h=f.A,f.Fc<f.A&&(h=f.Fc,b.da=!0,b.G.save(),
b.G.translate(c,g),b.G.rotate(-Math.PI/2),c=g=0),h<b.L&&(b.L=h,b.P=b.L+"px Monaco, Lucida Console, Courier New"),f=g,b.D=c,b.K=f,b=a,e=Bb[e.type]+" ("+(e.fd*a.ia.xb/1024|0)+"Kb)",b.G.font=b.P,b.D-=b.G.measureText(e).width>>1,b.K+=(b.L>>1)-2,sb(b,e),b.da&&(b.G.restore(),b.da=!1)}}else sb(a,"This space intentionally left blank");a.context.drawImage(a.S,0,0,a.S.width,a.S.height,a.Oa,a.Xa,a.Da,a.Fa);a.ua=!1}}

View file

@ -1435,7 +1435,7 @@ Computer.prototype.getMachineComponent = function(sType, componentPrev)
* the scroll feature has annoying effect on iOS, so we no longer do it by default (fScroll must be true).
*
* @this {Computer}
* @param {boolean} [fScroll]
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
*/
Computer.prototype.updateFocus = function(fScroll)
{
@ -1446,7 +1446,7 @@ Computer.prototype.updateFocus = function(fScroll)
* is to ensure that keyboard input is fielded properly.
*/
var x = 0, y = 0;
if (fScroll && window) {
if (!fScroll && window) {
x = window.scrollX;
y = window.scrollY;
}
@ -1454,7 +1454,7 @@ Computer.prototype.updateFocus = function(fScroll)
* TODO: We need a mechanism to determine the "active" display, instead of hard-coding this to aVideo[0].
*/
this.aVideo[0].setFocus();
if (fScroll && window) {
if (!fScroll && window) {
window.scrollTo(x, y);
}
}

View file

@ -1405,11 +1405,28 @@ ComputerPDP11.prototype.getMachineComponent = function(sType, componentPrev)
* where the display is more constrained, so we no longer do it by default (fScroll must be true).
*
* @this {ComputerPDP11}
* @param {boolean} [fScroll]
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
*/
ComputerPDP11.prototype.setFocus = function(fScroll)
{
if (this.controlPrint) this.controlPrint.focus();
if (this.controlPrint) {
/*
* This seems to be recommended work-around to prevent the browser from scrolling the focused element
* into view. The CPU is not a visual component, so when the CPU wants to set focus, the primary intent
* is to ensure that keyboard input is fielded properly.
*/
var x = 0, y = 0;
if (!fScroll && window) {
x = window.scrollX;
y = window.scrollY;
}
this.controlPrint.focus();
if (!fScroll && window) {
window.scrollTo(x, y);
}
}
};
/**

View file

@ -572,13 +572,31 @@ if (DEBUGGER) {
};
/**
* setFocus()
* setFocus(fScroll)
*
* @this {DebuggerPDP11}
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
*/
DebuggerPDP11.prototype.setFocus = function()
DebuggerPDP11.prototype.setFocus = function(fScroll)
{
if (this.controlDebug) this.controlDebug.focus();
if (this.controlDebug) {
/*
* This seems to be recommended work-around to prevent the browser from scrolling the focused element
* into view. The CPU is not a visual component, so when the CPU wants to set focus, the primary intent
* is to ensure that keyboard input is fielded properly.
*/
var x = 0, y = 0;
if (!fScroll && window) {
x = window.scrollX;
y = window.scrollY;
}
this.controlDebug.focus();
if (!fScroll && window) {
window.scrollTo(x, y);
}
}
};
/**

View file

@ -846,7 +846,7 @@ else return this.qa[b]=c,c.onclick=function(){var a=Ur(d,!0);if(a){var b=!!(d.A&
function Ur(a,b){var c=a.B;c||((c=Ha("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=ds(a,c))||a.Na("The user ID is invalid.")):b&&a.Na("Browser local storage is not available"));return c}
function ds(a,b){a.B=null;b=Aa(Ba()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ia("user",b.data),a.B=b.data)}catch(d){w(d.message+" ("+c+")")}return a.B}function Vr(a){var b=null;a.B&&(b=Ba()+"/api/v1/user?req=load&user="+a.B+"&state="+es(a,"1.30.2"));return b}
function cs(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=es(a,"1.30.2");d.data=c;b=Aa(Ba()+"/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.Na("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.Na(c),Ia("user",""),a.B=null)}}
function Jb(a,b,c){a=nb(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}l.wd=function(a){if(this.L.length){var b=0,c=0;a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.L[0];d.X&&d.X.focus();a&&window&&window.scrollTo(b,c)}};l.pd=function(a){this.F&&this.F.pd(a);this.C&&this.C.pd(a)};
function Jb(a,b,c){a=nb(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}l.wd=function(a){if(this.L.length){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);var d=this.L[0];d.X&&d.X.focus();!a&&window&&window.scrollTo(b,c)}};l.pd=function(a){this.F&&this.F.pd(a);this.C&&this.C.pd(a)};
function jd(a,b){for(var c=0;c<a.L.length;c++)un(a.L[c],b);if(a.C&&(a=a.C,a.Ja)){Ob(a,18,a.aa,a.Ga);if(a.gb){b=a.ga;var c=a.A,d,e;null==d&&(d=0);null==e&&(e=b.W-d|0);c||(c={ih:0,Td:0,Yg:[]});var f=d>>>b.La;d=d+e-1>>>b.La;c.ih=0;for(c.Td=0;f<=d;)e=b.sa[f],c.ih+=e.size,e.size&&(c.Yg.push(wa(Nb,f,0,0,e.type)),c.Td++),f++;a.A=c;a.ya=a.A.Td*a.ga.Sb/691200;d=0;a.A.fj=0;a.A.Bf||(a.A.Bf=[]);e=-1;b=0;for(var g=-1,c=0;c<a.A.Td;c++){var h=a.A.Yg[c],f=xa(Nb.type,h),h=xa(Nb.Hk,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=
Qb(a,b,g,e)),e=f,b=c;g=h}d+=Qb(a,b,c-b,e);e=a.A.ul!=d;a.A.ul=d;if(e){e=new Hb(0,0,a.aa.width,a.aa.height);a.A.Se=[];b=a.A.Td;for(d=0;d<a.A.fj;d++)c=a.A.Bf[d].Td,a.A.Se.push(Ib(e,c,b,!d)),b-=c;for(d=0;d<a.A.Se.length;d++)e=a.A.Bf[d],b=c=a.A.Se[d],f=a.Ga,(g=Fc[e.type])||(g=new Gb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.ad,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.ad,b.A),b=a,f=c,b.fa=b.ua,b.W=b.va,c=f.x+(f.ad>>1),g=f.y+(f.A>>1),h=f.A,f.ad<f.A&&(h=f.ad,b.ra=!0,b.N.save(),
b.N.translate(c,g),b.N.rotate(-Math.PI/2),c=g=0),h<b.W&&(b.W=h,b.fa=b.W+"px Monaco, Lucida Console, Courier New"),f=g,b.C=c,b.U=f,b=a,e=Yb[e.type]+" ("+(e.Td*a.ga.Sb/1024|0)+"Kb)",b.N.font=b.fa,b.C-=b.N.measureText(e).width>>1,b.U+=(b.W>>1)-2,Pb(b,e),b.ra&&(b.N.restore(),b.ra=!1)}}else Pb(a,"This space intentionally left blank");a.context.drawImage(a.aa,0,0,a.aa.width,a.aa.height,a.sb,a.Jb,a.Ya,a.fb);a.Ja=!1}}

View file

@ -664,7 +664,7 @@ else return this.la[b]=c,c.onclick=function(){var a=qn(d,!0);if(a){var b=!!(d.B&
function qn(a,b){var c=a.C;c||((c=xa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Bn(a,c))||a.Ba("The user ID is invalid.")):b&&a.Ba("Browser local storage is not available"));return c}
function Bn(a,b){a.C=null;b=sa(ta()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya("user",b.data),a.C=b.data)}catch(d){r(d.message+" ("+c+")")}return a.C}function rn(a){var b=null;a.C&&(b=ta()+"/api/v1/user?req=load&user="+a.C+"&state="+Cn(a,"1.30.2"));return b}
function An(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Cn(a,"1.30.2");d.data=c;b=sa(ta()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Ba("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.Ba(c),ya("user",""),a.C=null)}}
function mb(a,b,c){a=Wa(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function xc(a,b){if(a.I.length){var c=0,d=0;b&&window&&(c=window.scrollX,d=window.scrollY);a=a.I[0];a.G&&a.G.focus();b&&window&&window.scrollTo(c,d)}}l.Zd=function(a){this.A&&this.A.Zd(a);this.D&&this.D.Zd(a)};
function mb(a,b,c){a=Wa(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}function xc(a,b){if(a.I.length){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a=a.I[0];a.G&&a.G.focus();!b&&window&&window.scrollTo(c,d)}}l.Zd=function(a){this.A&&this.A.Zd(a);this.D&&this.D.Zd(a)};
function Ac(a,b){for(var c=0;c<a.I.length;c++)nl(a.I[c],b);if(a.D&&(a=a.D,a.ua)){rb(a,18,a.S,a.ra);if(a.Ga){b=a.ia;var c=a.B,d,e;null==d&&(d=0);null==e&&(e=b.L-d|0);c||(c={mg:0,fd:0,fg:[]});var f=d>>>b.da;d=d+e-1>>>b.da;c.mg=0;for(c.fd=0;f<=d;)e=b.R[f],c.mg+=e.size,e.size&&(c.fg.push(qa(qb,f,0,0,e.type)),c.fd++),f++;a.B=c;a.ma=a.B.fd*a.ia.xb/691200;d=0;a.B.ii=0;a.B.Ke||(a.B.Ke=[]);e=-1;b=0;for(var g=-1,c=0;c<a.B.fd;c++){var h=a.B.fg[c],f=ra(qb.type,h),h=ra(qb.Cj,h);if(f!=e||h!=g+1)(g=c-b)&&(d+=tb(a,
b,g,e)),e=f,b=c;g=h}d+=tb(a,b,c-b,e);e=a.B.fk!=d;a.B.fk=d;if(e){e=new kb(0,0,a.S.width,a.S.height);a.B.ee=[];b=a.B.fd;for(d=0;d<a.B.ii;d++)c=a.B.Ke[d].fd,a.B.ee.push(lb(e,c,b,!d)),b-=c;for(d=0;d<a.B.ee.length;d++)e=a.B.Ke[d],b=c=a.B.ee[d],f=a.ra,(g=ac[e.type])||(g=new jb),f.strokeStyle="black",f.strokeRect(b.x,b.y,b.Fc,b.A),f.fillStyle="string"==typeof g?g:g.toString(),f.fillRect(b.x,b.y,b.Fc,b.A),b=a,f=c,b.P=b.ha,b.L=b.ka,c=f.x+(f.Fc>>1),g=f.y+(f.A>>1),h=f.A,f.Fc<f.A&&(h=f.Fc,b.da=!0,b.G.save(),
b.G.translate(c,g),b.G.rotate(-Math.PI/2),c=g=0),h<b.L&&(b.L=h,b.P=b.L+"px Monaco, Lucida Console, Courier New"),f=g,b.D=c,b.K=f,b=a,e=Bb[e.type]+" ("+(e.fd*a.ia.xb/1024|0)+"Kb)",b.G.font=b.P,b.D-=b.G.measureText(e).width>>1,b.K+=(b.L>>1)-2,sb(b,e),b.da&&(b.G.restore(),b.da=!1)}}else sb(a,"This space intentionally left blank");a.context.drawImage(a.S,0,0,a.S.width,a.S.height,a.Oa,a.Xa,a.Da,a.Fa);a.ua=!1}}

View file

@ -200,8 +200,8 @@ fh={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032
k.Ca=function(a,b,c,d){this.w=b;this.b=c;this.B=a;(a=Qc(a,"messages"))&&ch(this,a);this.bb=fh;this.qb=1145>this.b.fb?hh:[];ih(this,function(a){a:{var b=d.w.V,c=a[0],e=a=0,m=b.length;if(c){a=d.$(jh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ha;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.j("..."):(c=q.type,p=bc[c],q&&d.j(l(q.id,8)+" %"+l(e<<d.w.ha,
8)+" %%"+l(q.C,8)+" "+l(q.yb,4,!0)+" "+l(q.size,4,!0)+" "+p),c!=Cc&&(c=-1),p=0);a+=d.w.ua;e++}}});H(this)};
k.qa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.da=this.I[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Tc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.g.length-1&&(b=d.g[++d.A])):40==a.keyCode&&(0<d.A?b=d.g[--d.A]:(b="",d.A=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.I[b]=c,Na(c,function(){if(d.da){var a=d.da.value;
d.da.value="";Tc(d,a,!0);return!0}return!1}),!0;case "step":return this.I[b]=c,Na(c,function(a){var b=!1;ob(d,!0)||(nb(d,!0),b=d.nb(a?1:0),nb(d,!1));return b}),!0}return!1};k.lb=function(){this.da&&this.da.focus()};k.$=function(a){a=a&&a.C;null==a&&(a=-1);return a};k.tb=function(a,b){var c=255,d=this.$(a,!1,1);-1!==d&&(c=a.Ab?this.w.Db(d):this.b.Db(d),b&&kh(a,b));return c};k.oa=function(a,b){var c=65535,d=this.$(a,!1,2);-1!==d&&(c=a.Ab?this.w.eb(d):this.b.eb(d),b&&kh(a,b));return c};
k.Gb=function(a,b,c){var d=this.$(a,!0,1);-1!==d&&(a.Ab?this.w.Ya(d,b):this.b.Ya(d,b),c&&kh(a,c),this.B.ba(!0))};k.Za=function(a,b,c){var d=this.$(a,!0,2);-1!==d&&(a.Ab?this.w.Hb(d,b):this.b.Hb(d,b),c&&kh(a,c),this.B.ba(!0))};function Z(a,b){return{C:a,Ab:b,Ba:!1}}function lh(a){return[a.C,a.Ba]}function mh(a){return{C:a[0],Ba:a[1]}}
d.da.value="";Tc(d,a,!0);return!0}return!1}),!0;case "step":return this.I[b]=c,Na(c,function(a){var b=!1;ob(d,!0)||(nb(d,!0),b=d.nb(a?1:0),nb(d,!1));return b}),!0}return!1};k.lb=function(a){if(this.da){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.da.focus();!a&&window&&window.scrollTo(b,c)}};k.$=function(a){a=a&&a.C;null==a&&(a=-1);return a};k.tb=function(a,b){var c=255,d=this.$(a,!1,1);-1!==d&&(c=a.Ab?this.w.Db(d):this.b.Db(d),b&&kh(a,b));return c};
k.oa=function(a,b){var c=65535,d=this.$(a,!1,2);-1!==d&&(c=a.Ab?this.w.eb(d):this.b.eb(d),b&&kh(a,b));return c};k.Gb=function(a,b,c){var d=this.$(a,!0,1);-1!==d&&(a.Ab?this.w.Ya(d,b):this.b.Ya(d,b),c&&kh(a,c),this.B.ba(!0))};k.Za=function(a,b,c){var d=this.$(a,!0,2);-1!==d&&(a.Ab?this.w.Hb(d,b):this.b.Hb(d,b),c&&kh(a,c),this.B.ba(!0))};function Z(a,b){return{C:a,Ab:b,Ba:!1}}function lh(a){return[a.C,a.Ba]}function mh(a){return{C:a[0],Ba:a[1]}}
function jh(a,b,c){var d,e=(c?a.K:a.Ta).C;c=!1;if(void 0!==b){b=Wg(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.H.length;e++){var g=a.H[e].ea[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Z(d));break}}if(d=f)return d;e=Vg(a,b,void 0)}null!=e&&(d=Z(e,c));return d}function nh(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.mc=Tg(a,b.ic=c[2]))}function kh(a,b){null!=a.C&&(a.C+=b||1)}
function ch(a,b){a.i=a;a.na=a.oc=536870912;a.ma=null;a.ra=[];b=Tg(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in tb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.na|=tb[c],a.j(c+" messages enabled"))}}function ih(a,b){for(var c in tb)if(64==tb[c]){a.za[c]=b;break}}
k.Zb=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function oh(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.$b=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Fa[a-8]:20>a?b=this.b.wa[a-16]:20==a&&(b=Lb(this.b)));return b};
@ -262,8 +262,9 @@ c,c.onclick=function(){var a=Lh(d,!0);if(a){var b=!!(d.f&&!d.H||d.N),c=Hh(d,b);b
function Lh(a,b){var c=a.g;c||((c=Ga("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=Wh(a,c))||a.ia("The user ID is invalid.")):b&&a.ia("Browser local storage is not available"));return c}
function Wh(a,b){a.g=null;b=Ba(ra()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ka("user",b.data),a.g=b.data)}catch(d){n(d.message+" ("+c+")")}return a.g}function Nh(a){var b=null;a.g&&(b=ra()+"/api/v1/user?req=load&user="+a.g+"&state="+Xh(a,"1.30.2"));return b}
function Vh(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Xh(a,"1.30.2");d.data=c;b=Ba(ra()+"/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.ia("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.ia(c),Ka("user",""),a.g=null)}}
function Gg(a){var b;a=kb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.lb=function(){this.Da&&this.Da.focus()};k.ba=function(a){this.b&&this.b.ba(a);this.A&&this.A.ba(a)};Ta(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new Ih(g,d,!0);B(g,f);g.L&&Oh(g,g.wb)}});
Oa.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.da&&!c.v.ja&&c.wb(-1)}});Oa.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.v.ja&&Hh(c,!(!c.f||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=Xh(a,b,c);this.i=a.i;Sh(this,a.tc)}function Xh(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}
function Gg(a){var b;a=kb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.lb=function(a){if(this.Da){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Da.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){this.b&&this.b.ba(a);this.A&&this.A.ba(a)};
Ta(function(){for(var a=C(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=C(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=z(f),g=new Ih(g,d,!0);B(g,f);g.L&&Oh(g,g.wb)}});Oa.show.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.da&&!c.v.ja&&c.wb(-1)}});
Oa.exit.push(function(){for(var a=C(document,"pdp11","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=mb("Computer",c.id))&&c.v.ja&&Hh(c,!(!c.f||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=Xh(a,b,c);this.i=a.i;Sh(this,a.tc)}function Xh(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}
O.prototype={constructor:O,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){Sh(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 Sh(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Th(a){var b=!0;if(Fa()){var c=JSON.stringify(a[a.id]);Ka(a.key,c)||(n("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Qh(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){n(c.message||c),b=!1}return b}function Mh(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Fa()&&(b=Ga(a.key))?(a[a.id]=b,a.b=!0):!1}var Yh=0;
function ji(a,b,c,d,e,f){e("Loading "+a+"...");Ba(a,null,!0,function(g,h,m){m?(h||(h="unable to load "+a+" ("+m+")"),f(h,null)):ki(h,a,b,c,d,e,f)})}

View file

@ -46,7 +46,7 @@ function w(a,b){b||(b=u);a.prototype=Na(b.prototype);a.prototype.constructor=a;a
function Qa(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}function Sa(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<v.length;d++)if(c)c==v[d]&&(c=null);else if(!(a!=v[d].type||b&&v[d].id.indexOf(b)))return v[d]}return null}function y(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){m(c.message+" ("+a+")")}return b}
function A(a,b){b=B(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var h=f.getAttribute("class");if(h)for(var l=h.split(" "),n=0;n<l.length;n++)switch(h=l[n],h){case "pdp11-binding":(h=y(f))&&h.binding&&a.Y(h.type,h.binding,f,h.value),n=l.length}}}}
function B(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Y:function(a,b,c){switch(b){case "clear":return this.u[b]||(this.u[b]=c,c.onclick=function(a){return function(){a.u.print&&(a.u.print.value="")}}(this)),!0;case "print":return this.u[b]||(this.wa=this.u[b]=c,c.value="",this.R=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
u.prototype={constructor:u,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Y:function(a,b,c){switch(b){case "clear":return this.u[b]||(this.u[b]=c,c.onclick=function(a){return function(){a.u.print&&(a.u.print.value="")}}(this)),!0;case "print":return this.u[b]||(this.Ga=this.u[b]=c,c.value="",this.R=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.K=function(a){this.R(a,this.La)}),!0;default:return!1}},log:function(){},R:function(){},status:function(a){this.R(this.La+": "+a)},K:function(a,b,c){c=c||this.type;b||m((c?c+": ":"")+a)},$:function(){return this.i.O=!0},Z:function(a,b){b&&(this.i.O=!1);return!0}};function C(a){if(!a.i.error&&(a.i.ready=!0,a.i.ready)){var b=a.Va;a.Va=null;b&&b()}}function Ta(a,b){b&&(a.i.ready?b():a.Va=b);return a.i.ready}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});var Ua="undefined"!==typeof ArrayBuffer;function Va(a){u.call(this,"Panel",a,Va);this.b=0;this.i.mb=!0}w(Va);g=Va.prototype;
@ -57,7 +57,7 @@ function $a(a,b,c){u.call(this,"Bus",a,$a);this.a=b;this.D=c;this.H=a.busWidth||
function ab(a,b){var c=-1,d=this.controller,e=d.ka[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=gb(d,b)}function bb(a,b,c){var d=!1,e=this.controller,f=e.ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),d=!0);d||gb(e,c)}
function cb(a,b){var c=-1,d=this.controller;(a=d.ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=gb(d,b)}function db(a,b,c){var d=!1,e=this.controller;if(a=e.ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||gb(e,c)}function hb(a,b){if(b!=a.o){var c;a.o&&(c=(1<<a.o)-E,ib(a,c,E,a.G),a.o=0);b&&(a.o=b,c=(1<<b)-E,a.G=jb(a,c,E),a.w?ib(a,c,E,a.w):(kb(a,c,E,lb,a),a.w=jb(a,c,E)))}}
$a.prototype.reset=function(){for(var a=0;a<this.s.length;a++)this.s[a]();hb(this,16)};function gb(a,b){a.m||G(a.a,4,b);return 0}$a.prototype.$=function(a,b){b||this.reset();return!0};
function kb(a,b,c,d,e){for(var f=b,h=c,l=f>>>a.j;0<h&&l<a.b.length;){var n=a.b[l],q=l*a.c,t=a.c-(f-q);t>h&&(t=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.ya)return n.Xa+=n.ya-f,n.ya=f,!0;if(f>=n.ya+n.Xa){t=n.size-(f-q);t>h&&(t=h);n.Xa=f-n.ya+t;f=q+a.c;h-=t;l++;continue}}return mb(1,f,h)}f=new F(a,f,t,a.c,d,e);eb(f,a.D,n);a.b[l++]=f;f=q+a.c;h-=t}if(0>=h){c/=1024;var z;e="";z?10<z&&(z=10):z=c&-65536?10:5;if(null==c||isNaN(c))for(;0<z--;)e="?"+e;else for(;0<z--;)e=String.fromCharCode(c%10+48)+e,c/=
function kb(a,b,c,d,e){for(var f=b,h=c,l=f>>>a.j;0<h&&l<a.b.length;){var n=a.b[l],q=l*a.c,t=a.c-(f-q);t>h&&(t=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.xa)return n.Xa+=n.xa-f,n.xa=f,!0;if(f>=n.xa+n.Xa){t=n.size-(f-q);t>h&&(t=h);n.Xa=f-n.xa+t;f=q+a.c;h-=t;l++;continue}}return mb(1,f,h)}f=new F(a,f,t,a.c,d,e);eb(f,a.D,n);a.b[l++]=f;f=q+a.c;h-=t}if(0>=h){c/=1024;var z;e="";z?10<z&&(z=10):z=c&-65536?10:5;if(null==c||isNaN(c))for(;0<z--;)e="?"+e;else for(;0<z--;)e=String.fromCharCode(c%10+48)+e,c/=
10;a.status(e+"Kb "+nb[d]+" at "+ia(b));return!0}return mb(2,b,c)}function jb(a,b,c){var d=[];for(b>>>=a.j;0<c&&b<a.b.length;)d.push(a.b[b++]),c-=a.c;return d}function ib(a,b,c,d){var e=0;for(b>>>=a.j;0<c&&b<a.b.length;){var f=d[e++];if(!f)break;a.b[b++]=f;c-=a.c}}function ob(a,b){return a.b[(b&a.h)>>>a.j].fb(b&a.g,b)}function pb(a,b){return a.b[(b&a.h)>>>a.j].S(b&a.g,b)}$a.prototype.Ja=function(a,b){this.m++;this.b[(a&this.h)>>>this.j].lb(a&this.g,b&255,a);this.m--};
function qb(a,b,c){a.b[(b&a.h)>>>a.j].Ya(b&a.g,c&65535,b)}function rb(a){for(var b=0,c=[],d=0;d<a.v;d++){var e=a.b[d];if(e.na||e.Db){c[b++]=d;var f=b++;if(e=e.save()){for(var h=0,l=0,n=[];h<e.length;){for(var q=e[h],t=h+1;t<e.length&&e[t]===q;)t++;n[l++]=t-h;n[l++]=q;h=t}n.length<e.length&&(e=n)}c[f]=e}}return c}function sb(a,b,c,d,e,f,h,l){for(;b<=c;b+=2){var n=b&fb;void 0!==a.ka[n]?m("I/O address already registered: "+ja(b,8,!0)):a.ka[n]=[d,e,f,h,l||"unknown",!1]}}
function tb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[5]&&f[5]>a.a.Ka)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,q=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&q&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(q)));sb(a,e,e,h,l,n,q,f[4])}}}function ub(a,b){a.s.push(b)}function H(a,b){a.m||G(a.a,4,b)}
@ -66,133 +66,134 @@ g.Qb=function(){var a=this.b.pa;this.b.pa&=-129;return a};g.Ec=function(a){this.
g.Tb=function(){var a=this.a.qa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Ub=function(){return this.a.hb};g.Vb=function(){return this.a.ra};g.Hc=function(a){var b=this.a;1170>b.Ka&&(a&=-49);b.ra!=a&&(b.ra=a,a&16?(b.bb=4194303,b.Oa=3915776):(b.bb=262143,b.Oa=253952),zb(b));Ab(this)};function Ab(a){a.c.Wa=a.c.Wa&-8|(a.a.Ha?a.a.ra&16?1:2:4)}g.ic=function(a){return this.a.F[1][a>>1&7]};g.Vc=function(a,b){this.a.F[1][b>>1&7]=a&65295};g.gc=function(a){return this.a.F[1][(a>>1&7)+8]};
g.Tc=function(a,b){this.a.F[1][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.U[1][a>>1&7]};g.Uc=function(a,b){b=b>>1&7;this.a.U[1][b]=a;this.a.F[1][b]&=65295};g.fc=function(a){return this.a.U[1][(a>>1&7)+8]};g.Sc=function(a,b){b=(b>>1&7)+8;this.a.U[1][b]=a;this.a.F[1][b]&=65295};g.Pb=function(a){return this.a.F[0][a>>1&7]};g.Dc=function(a,b){this.a.F[0][b>>1&7]=a&65295};g.Nb=function(a){return this.a.F[0][(a>>1&7)+8]};g.Bc=function(a,b){this.a.F[0][(b>>1&7)+8]=a&65295};
g.Ob=function(a){return this.a.U[0][a>>1&7]};g.Cc=function(a,b){b=b>>1&7;this.a.U[0][b]=a;this.a.F[0][b]&=65295};g.Mb=function(a){return this.a.U[0][(a>>1&7)+8]};g.Ac=function(a,b){b=(b>>1&7)+8;this.a.U[0][b]=a;this.a.F[0][b]&=65295};g.oc=function(a){return this.a.F[3][a>>1&7]};g.ad=function(a,b){this.a.F[3][b>>1&7]=a&65295};g.mc=function(a){return this.a.F[3][(a>>1&7)+8]};g.Zc=function(a,b){this.a.F[3][(b>>1&7)+8]=a&65295};g.nc=function(a){return this.a.U[3][a>>1&7]};
g.$c=function(a,b){b=b>>1&7;this.a.U[3][b]=a;this.a.F[3][b]&=65295};g.lc=function(a){return this.a.U[3][(a>>1&7)+8]};g.Yc=function(a,b){b=(b>>1&7)+8;this.a.U[3][b]=a;this.a.F[3][b]&=65295};g.Aa=function(a){a&=7;return this.a.A&2048?this.a.xa[a]:this.a.f[a]};g.Ca=function(a,b){b&=7;this.a.A&2048?this.a.xa[b]=a:this.a.f[b]=a};g.$b=function(){return this.a.A&49152?this.a.aa[0]:this.a.f[6]};g.Mc=function(a){this.a.A&49152?this.a.aa[0]=a:this.a.f[6]=a};g.cc=function(){return this.a.f[7]};
g.Pc=function(a){this.a.f[7]=a};g.Ba=function(a){a&=7;return this.a.A&2048?this.a.f[a]:this.a.xa[a]};g.Da=function(a,b){b&=7;this.a.A&2048?this.a.f[b]=a:this.a.xa[b]=a};g.ac=function(){return 1==(this.a.A&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Nc=function(a){1==(this.a.A&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.bc=function(){return 3==(this.a.A&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Oc=function(a){3==(this.a.A&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Lb=function(a){return this.a.xb[a-65504>>1]};
g.$c=function(a,b){b=b>>1&7;this.a.U[3][b]=a;this.a.F[3][b]&=65295};g.lc=function(a){return this.a.U[3][(a>>1&7)+8]};g.Yc=function(a,b){b=(b>>1&7)+8;this.a.U[3][b]=a;this.a.F[3][b]&=65295};g.za=function(a){a&=7;return this.a.A&2048?this.a.wa[a]:this.a.f[a]};g.Ba=function(a,b){b&=7;this.a.A&2048?this.a.wa[b]=a:this.a.f[b]=a};g.$b=function(){return this.a.A&49152?this.a.aa[0]:this.a.f[6]};g.Mc=function(a){this.a.A&49152?this.a.aa[0]=a:this.a.f[6]=a};g.cc=function(){return this.a.f[7]};
g.Pc=function(a){this.a.f[7]=a};g.Aa=function(a){a&=7;return this.a.A&2048?this.a.f[a]:this.a.wa[a]};g.Ca=function(a,b){b&=7;this.a.A&2048?this.a.f[b]=a:this.a.wa[b]=a};g.ac=function(){return 1==(this.a.A&49152)>>14?this.a.f[6]:this.a.aa[1]};g.Nc=function(a){1==(this.a.A&49152)>>14?this.a.f[6]=a:this.a.aa[1]=a};g.bc=function(){return 3==(this.a.A&49152)>>14?this.a.f[6]:this.a.aa[3]};g.Oc=function(a){3==(this.a.A&49152)>>14?this.a.f[6]=a:this.a.aa[3]=a};g.Lb=function(a){return this.a.xb[a-65504>>1]};
g.zc=function(a,b){this.a.xb[b-65504>>1]=a};g.vb=function(a){return 65520==a?61183:0};g.Bb=function(){};g.kc=function(){return 1};g.Xc=function(){};g.Kb=function(){return this.a.I};g.yc=function(){this.a.I=0};g.Rb=function(){return this.a.wb};g.Fc=function(a,b){b&1||(a&=255);this.a.wb=a};g.Wb=function(a){return a?this.a.ib:0};g.Ic=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ib=a;b.l|=2};g.jc=function(a){return a?this.a.sa&65280:0};g.Wc=function(a){this.a.sa=a|255};
g.Zb=function(){return Za(this.a)};g.Lc=function(a){Bb(this.a,a&-1809|Za(this.a)&1808);this.a.l|=128};g.Ab=function(){};
var K={},J=(K[62592]=[null,null,I.prototype.ic,I.prototype.Vc,"SISDR",1145],K[62608]=[null,null,I.prototype.gc,I.prototype.Tc,"SDSDR",1145],K[62624]=[null,null,I.prototype.hc,I.prototype.Uc,"SISAR",1145],K[62640]=[null,null,I.prototype.fc,I.prototype.Sc,"SDSAR",1145],K[62656]=[null,null,I.prototype.Pb,I.prototype.Dc,"KISDR",1145],K[62672]=[null,null,I.prototype.Nb,I.prototype.Bc,"KDSDR",1145],K[62688]=[null,null,I.prototype.Ob,I.prototype.Cc,"KISAR",1145],K[62704]=[null,null,I.prototype.Mb,I.prototype.Ac,
"KDSAR",1145],K[62798]=[null,null,I.prototype.Vb,I.prototype.Hc,"MMR3",1145],K[65382]=[null,null,I.prototype.Qb,I.prototype.Ec,"LKS"],K[65400]=[null,null,I.prototype.Jb,I.prototype.xc,"CNSL"],K[65402]=[null,null,I.prototype.Sb,I.prototype.Gc,"MMR0",1145],K[65404]=[null,null,I.prototype.Tb,I.prototype.Ab,"MMR1",1145],K[65406]=[null,null,I.prototype.Ub,I.prototype.Ab,"MMR2",1145],K[65408]=[null,null,I.prototype.oc,I.prototype.ad,"UISDR",1145],K[65424]=[null,null,I.prototype.mc,I.prototype.Zc,"UDSDR",
1145],K[65440]=[null,null,I.prototype.nc,I.prototype.$c,"UISAR",1145],K[65456]=[null,null,I.prototype.lc,I.prototype.Yc,"UDSAR",1145],K[65472]=[null,null,I.prototype.Aa,I.prototype.Ca,"R0SET0"],K[65473]=[null,null,I.prototype.Aa,I.prototype.Ca,"R1SET0"],K[65474]=[null,null,I.prototype.Aa,I.prototype.Ca,"R2SET0"],K[65475]=[null,null,I.prototype.Aa,I.prototype.Ca,"R3SET0"],K[65476]=[null,null,I.prototype.Aa,I.prototype.Ca,"R4SET0"],K[65477]=[null,null,I.prototype.Aa,I.prototype.Ca,"R5SET0"],K[65478]=
[null,null,I.prototype.$b,I.prototype.Mc,"R6KERNEL"],K[65479]=[null,null,I.prototype.cc,I.prototype.Pc,"R7KERNEL"],K[65480]=[null,null,I.prototype.Ba,I.prototype.Da,"R0SET1",1145],K[65481]=[null,null,I.prototype.Ba,I.prototype.Da,"R1SET1",1145],K[65482]=[null,null,I.prototype.Ba,I.prototype.Da,"R2SET1",1145],K[65483]=[null,null,I.prototype.Ba,I.prototype.Da,"R3SET1",1145],K[65484]=[null,null,I.prototype.Ba,I.prototype.Da,"R4SET1",1145],K[65485]=[null,null,I.prototype.Ba,I.prototype.Da,"R5SET1",1145],
1145],K[65440]=[null,null,I.prototype.nc,I.prototype.$c,"UISAR",1145],K[65456]=[null,null,I.prototype.lc,I.prototype.Yc,"UDSAR",1145],K[65472]=[null,null,I.prototype.za,I.prototype.Ba,"R0SET0"],K[65473]=[null,null,I.prototype.za,I.prototype.Ba,"R1SET0"],K[65474]=[null,null,I.prototype.za,I.prototype.Ba,"R2SET0"],K[65475]=[null,null,I.prototype.za,I.prototype.Ba,"R3SET0"],K[65476]=[null,null,I.prototype.za,I.prototype.Ba,"R4SET0"],K[65477]=[null,null,I.prototype.za,I.prototype.Ba,"R5SET0"],K[65478]=
[null,null,I.prototype.$b,I.prototype.Mc,"R6KERNEL"],K[65479]=[null,null,I.prototype.cc,I.prototype.Pc,"R7KERNEL"],K[65480]=[null,null,I.prototype.Aa,I.prototype.Ca,"R0SET1",1145],K[65481]=[null,null,I.prototype.Aa,I.prototype.Ca,"R1SET1",1145],K[65482]=[null,null,I.prototype.Aa,I.prototype.Ca,"R2SET1",1145],K[65483]=[null,null,I.prototype.Aa,I.prototype.Ca,"R3SET1",1145],K[65484]=[null,null,I.prototype.Aa,I.prototype.Ca,"R4SET1",1145],K[65485]=[null,null,I.prototype.Aa,I.prototype.Ca,"R5SET1",1145],
K[65486]=[null,null,I.prototype.ac,I.prototype.Nc,"R6SUPER",1145],K[65487]=[null,null,I.prototype.bc,I.prototype.Oc,"R6USER",1145],K[65504]=[null,null,I.prototype.Lb,I.prototype.zc,"CTRL",1170],K[65520]=[null,null,I.prototype.vb,I.prototype.Bb,"LSIZE",1170],K[65522]=[null,null,I.prototype.vb,I.prototype.Bb,"HSIZE",1170],K[65524]=[null,null,I.prototype.kc,I.prototype.Xc,"SYSID",1170],K[65526]=[null,null,I.prototype.Kb,I.prototype.yc,"CPUERR",1170],K[65528]=[null,null,I.prototype.Rb,I.prototype.Fc,
"MB",1170],K[65530]=[null,null,I.prototype.Wb,I.prototype.Ic,"PIR"],K[65532]=[null,null,I.prototype.jc,I.prototype.Wc,"SL"],K[65534]=[null,null,I.prototype.Zb,I.prototype.Lc,"PSW"],K);J[62594]=J[62592];J[62596]=J[62592];J[62598]=J[62592];J[62600]=J[62592];J[62602]=J[62592];J[62604]=J[62592];J[62606]=J[62592];J[62610]=J[62608];J[62612]=J[62608];J[62614]=J[62608];J[62616]=J[62608];J[62618]=J[62608];J[62620]=J[62608];J[62622]=J[62608];J[62626]=J[62624];J[62628]=J[62624];J[62630]=J[62624];J[62632]=J[62624];
J[62634]=J[62624];J[62636]=J[62624];J[62638]=J[62624];J[62642]=J[62640];J[62644]=J[62640];J[62646]=J[62640];J[62648]=J[62640];J[62650]=J[62640];J[62652]=J[62640];J[62654]=J[62640];J[62658]=J[62656];J[62660]=J[62656];J[62662]=J[62656];J[62664]=J[62656];J[62666]=J[62656];J[62668]=J[62656];J[62670]=J[62656];J[62674]=J[62672];J[62676]=J[62672];J[62678]=J[62672];J[62680]=J[62672];J[62682]=J[62672];J[62684]=J[62672];J[62686]=J[62672];J[62690]=J[62688];J[62692]=J[62688];J[62694]=J[62688];J[62696]=J[62688];
J[62698]=J[62688];J[62700]=J[62688];J[62702]=J[62688];J[62706]=J[62704];J[62708]=J[62704];J[62710]=J[62704];J[62712]=J[62704];J[62714]=J[62704];J[62716]=J[62704];J[62718]=J[62704];J[65410]=J[65408];J[65412]=J[65408];J[65414]=J[65408];J[65416]=J[65408];J[65418]=J[65408];J[65420]=J[65408];J[65422]=J[65408];J[65426]=J[65424];J[65428]=J[65424];J[65430]=J[65424];J[65432]=J[65424];J[65434]=J[65424];J[65436]=J[65424];J[65438]=J[65424];J[65442]=J[65440];J[65444]=J[65440];J[65446]=J[65440];J[65448]=J[65440];
J[65450]=J[65440];J[65452]=J[65440];J[65454]=J[65440];J[65458]=J[65456];J[65460]=J[65456];J[65462]=J[65456];J[65464]=J[65456];J[65466]=J[65456];J[65468]=J[65456];J[65470]=J[65456];J[65506]=J[65504];J[65508]=J[65504];J[65510]=J[65504];J[65512]=J[65504];J[65514]=J[65504];J[65516]=J[65504];J[65518]=J[65504];r(function(){for(var a=B(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=y(d);switch(c.type){case "default":c=new I(c);A(c,d);break;case "pc11":c=new L(c),A(c,d)}}});var Cb;
if(Ua){var Db=new ArrayBuffer(2);(new DataView(Db)).setUint16(0,256,!0);Cb=256===(new Uint16Array(Db))[0]}else Cb=!1;var Eb=Cb;
function F(a,b,c,d,e,f){this.j=a;this.id=Fb+=2;this.a=null;this.ya=b;this.Xa=c;this.size=d||0;this.type=e||Gb;this.g=e==Hb;this.controller=null;eb(this);this.na=this.Db=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],Ib(this,f.Cb);else if(Ua)this.c=new ArrayBuffer(this.size),this.u=new DataView(this.c,0,this.size),this.b=new Uint8Array(this.c,0,this.size),this.s=new Uint16Array(this.c,0,this.size>>1),this.a=new Int32Array(this.c,0,this.size>>2),Ib(this,Eb?Jb:Kb);else{a=this.a=Array(this.size>>
function F(a,b,c,d,e,f){this.j=a;this.id=Fb+=2;this.a=null;this.xa=b;this.Xa=c;this.size=d||0;this.type=e||Gb;this.g=e==Hb;this.controller=null;eb(this);this.na=this.Db=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],Ib(this,f.Cb);else if(Ua)this.c=new ArrayBuffer(this.size),this.u=new DataView(this.c,0,this.size),this.b=new Uint8Array(this.c,0,this.size),this.s=new Uint16Array(this.c,0,this.size>>1),this.a=new Int32Array(this.c,0,this.size>>2),Ib(this,Eb?Jb:Kb);else{a=this.a=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;Ib(this,Lb)}else Ib(this)}var Gb=0,Hb=2,lb=4,nb=["NONE","RAM","ROM","VID","H/W"],Fb=0;
F.prototype={constructor:F,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ua)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.u.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ua)for(b=0;b<a.length;b++)this.u.setInt32(b<<2,a[b],!0);else this.a=a;return this.na=!0}return!1},v:function(a,b){H(this.j,b);return 255},h:function(a,b,c){H(this.j,c)},w:function(a,b){return this.fb(a++,b++)|this.fb(a,
b)<<8},B:function(a,b,c){this.kb(a++,b&255,c++);this.kb(a,b>>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&H(this.j,b);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ha:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.na=!0},va:function(a,b,c){a&1&&H(this.j,c);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|b>>8);this.na=!0},
G:function(a,b){return this.H(a,b)},P:function(a,b){return this.V(a,b)},ea:function(a,b,c){this.g?this.h(a,b,c):this.lb(a,b,c)},ja:function(a,b,c){this.g?this.h(a,b,c):this.ta(a,b,c)},C:function(a){return this.b[a]},J:function(a){return this.b[a]},M:function(a,b){a&1&&H(this.j,b);return this.u.getUint16(a,!0)},W:function(a,b){a&1&&H(this.j,b);return this.s[a>>1]},da:function(a,b){this.b[a]=b;this.na=!0},ga:function(a,b){this.b[a]=b;this.na=!0},ia:function(a,b,c){a&1&&H(this.j,c);this.u.setUint16(a,
b,!0);this.na=!0},ua:function(a,b,c){a&1&&H(this.j,c);this.s[a>>1]=b;this.na=!0}};function eb(a,b,c){a.D=b;a.o=a.m=0;c&&((a.o=c.o)&&Mb(a,Nb,!1),(a.m=c.m)&&Ob(a,Nb,!1))}function Ob(a,b,c){c&&a.m||(a.kb=!a.g&&b[1]||a.h,a.Ya=!a.g&&b[3]||a.B);if(c||void 0===c)a.lb=b[1]||a.h,a.ta=b[3]||a.B}function Mb(a,b,c){c&&a.o||(a.fb=b[0]||a.v,a.S=b[2]||a.w);if(c||void 0===c)a.H=b[0]||a.v,a.V=b[2]||a.w}function Ib(a,b){b||(b=Pb);Mb(a,b,void 0);Ob(a,b,void 0)}
var Pb=[],Lb=[F.prototype.L,F.prototype.ha,F.prototype.ca,F.prototype.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.Ga=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.Ga="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.Ga=function(){return this.i.Ga||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)}
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.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.Ea=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&&(c=a.o,c.wa&&c.wa.focus())}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.Fa=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.Fa+=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.Ea-=b;if(0>=this.Ea){this.Ea+=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.Fa&&(d=Math.round(d*this.Fa/
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.Fa;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&&(b=a.o,b.wa&&b.wa.focus()),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.xa=[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};
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)&&
(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};
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 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,za:b,next:null}}function wb(a,b){if(b!=a.W){var c=a.W;if(!c||c.za<=b.za)b.next=c,a.W=b;else{do{var d=c.next;if(!d||d.za<=b.za){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.xa.length;0<=--c;){var d=a.f[c];a.f[c]=a.xa[c];a.xa[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.za>c?this.W:null)b=a.wc,c=a.za;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.ya+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.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.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(){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.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.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 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.wa)for(b=0;b<e.length;b++)d=e[b],d.K=this.h.K,d.R=this.h.R,d.wa=this.h.wa;
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.Ga());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)};
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)};
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?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.Ga()},!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
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