(function(){/* http://pcjs.org/modules/shared/lib/diskapi.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/dumpapi.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/reportapi.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/userapi.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/keys.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/strlib.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/usrlib.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/weblib.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/messages.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/debugger.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/embed.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/defines.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/component.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/defines.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/panel.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/bus.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/device.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/memory.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/cpu.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/cpustate.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/cpuops.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/rom.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/ram.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/keyboard.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/serialport.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/pc11.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/disk.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/rk11.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/rl11.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/pdp11/lib/computer.js (C) Jeff Parsons 2012-2016 http://pcjs.org/modules/shared/lib/state.js (C) Jeff Parsons 2012-2016 */ for(var h,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da":62,"?":63,"@":64,Vb:65,Ue:66,We:67,uf:68,E:69,vf:70,wf:71,xf:72,yf:73,zf:74,Af:75,Bf:76,Cf:77,Df:78,Ef:79,Ff:80,Q:81,Gf:82,Hf:83,If:84,Jf:85,Kf:86,Lf:87,Mf:88,Nf:89,Ac:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Of:97,Pf:98,Qf:99,d:100,e:101,Sf:102,Tf:103,Uf:104,Vf:105,Yf:106,k:107,Zf:108,$f:109,n:110,ag:111,p:112,q:113,r:114,bg:115,t:116,cg:117,dg:118,eg:119,x:120,y:121,z:122,"{":123, "|":124,"}":125,"~":126,rc:127}; function q(a){var b=10,c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return""+c}function r(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function t(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function na(a){return a.replace(/[&<>"']/g,function(a){return ma[a]})} function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"},qa=Date.now||function(){return+new Date}; function ra(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function w(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encodeURIComponent(b[n]));l=l.replace(/%20/g,"+");k.open("POST",a,!!c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,!!c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} function sa(a,b){var c,d={M:null,da:null,pa:null,oa:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.pa=g.load;d.oa=g.exec;if(e=g.bytes)d.M=e;else if(e=g.words)for(d.M=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.M=Array(4*e.length),f=c=0;c>8&255,d.M[f++]=e[c]>>16&255,d.M[f++]=e[c]>>24&255;else d.M=g;d.da=g.symbols;d.M.length?1==d.M.length&&(x(d.M[0]),d=null):(x("Empty resource: "+a),d=null)}catch(k){x("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Aa=this.id:(this.Ba=this.id.substr(0,b),this.Aa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Ia:!1,Ib:!1,P:!1,error:!1};this.yb=null;this.o.error=!1;this.l={};this.G=null;this.Mc=d||0;z.push(this)}var Ma=void 0,Na={}; if(window){Ma||(Ma=window.location.search.substr(1));for(var Oa,Pa=/\+/g,Qa=/([^&=]+)=?([^&]*)/g;Oa=Qa.exec(Ma);)Na[decodeURIComponent(Oa[1].replace(Pa," "))]=decodeURIComponent(Oa[2].replace(Pa," "))}function Ra(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function B(a,b){b||(b=y);a.prototype=Ra(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Sa=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},z=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function C(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Xc,a]}B(ab);var bb=7;function cb(a,b){return a.b[b]&&a.b[b][1]}h=ab.prototype;h.reset=function(){this.stop()}; h.ba=function(a,b,c,d){if(this.m&&this.m.ba(a,b,c,d)||this.a&&this.a.ba(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.l[b]=c,this.u++,!0;default:return"led"==a||"rled"==a?(this.l[b]=c,this.f[b]=d?1:0,this.u++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.l[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){db(a, b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){eb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){db(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){eb(a,b)}}(this,b),!0):this.parent.ba.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;fb(b,this,gb);hb(b,this.reset.bind(this));ib(this);jb(this)};h.ka=function(a,b){b||(kb(),this.reset());return!0};h.ja=function(){return!0}; function lb(a,b,c){if(a=a.l[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ib(a,b){for(var c in a.f)lb(a,c,null!=b?b:a.f[c])}function mb(a,b,c){if(a=a.l[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function jb(a){for(var b in a.b)mb(a,b,a.b[b][1])}function nb(a,b,c,d){a.l[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),H(a.a)),c=8==(a.G&&a.G.b||8)?ja(c,d):r(c,d),a.l[b].textContent!=c&&(a.l[b].textContent=c))} function db(a,b){var c=a.b[b];mb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.w="DEP"==b,a.B="EXAM"==b)}function eb(a,b){var c=a.b[b];c[2]&&c[3]&&(mb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Vc=function(a){a||this.a.o.S||(a=this.a,a.h.reset(),ob(a),cb(this,"ENABLE")&&pb(this.a))};h.Wc=function(){};h.Rc=function(a){a||H(this.a)}; h.Pc=function(a){if(!a&&!this.a.o.S)if(cb(this,"ENABLE"))pb(this.a);else{a=this.G;var b;if(b=a)a.o.Ia&&(a.o.Ib=!0),b=!a.o.Ia;if(b)Wa(a,!0),a.Ab(0,null),Wa(a,!1);else try{var c=this.a.Ab(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Va?8:16,c=65472<=a.la&&a.la<65472+b,b=c?1:2,c=c?15:a.h.Ea;cb(a,"STEP")||(b=-b);yb(a,a.la&~c|a.la+b&c)}function yb(a,b){a.la=b&a.h.Ea;b=a.la;for(var c=0;22>c;c++)zb(a,"A"+c,b&1<c;c++)zb(a,"D"+c,b&1<>2;this.m=this.c-1;this.u=this.A/this.c|0;this.Da=[];this.j=0;this.s=!1;this.w=[];this.Bc=[Db,Eb,Fb,Gb];a=new I(this);Hb(a,this.G);this.h=Array(this.u);this.f=Array(this.u);for(b=0;b>>this.b;this.B=0;this.i=this.Ea;G(this)}B(Bb); var Cb=8192,Kb=Cb-1;function Db(a,b){var c=-1,d=this.controller,e=d.Da[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.Da[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255} function Eb(a,b,c){var d=!1,e=this.controller,f=e.Da[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](g,!0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.Da[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](g,!0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d||J(e,c,16)}function Fb(a,b){var c=-1,d=this.controller;a=d.Da[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return c;J(d,b,16);return 65535} function Gb(a,b,c){var d=!1,e=this.controller;a=e.Da[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d||J(e,c,16)}function Lb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.I]=a.h[a.F])}}Bb.prototype.reset=function(){for(var a=0;a>>a.b;0g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ha)return l.nb+=l.Ha-f,l.Ha=f,!0;if(f>=l.Ha+l.nb){p=l.size-(f-n);p>g&&(p=g);l.nb=f-l.Ha+p;f=n+a.c;g-=p;k++;continue}}return Mb(1,f,g)}f=new I(a,f,p,a.c,d,e);Hb(f,a.G,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Nb[d]+" at "+ja(b)),!0):Mb(2,b,c)}function Ob(a,b){return a.f[(b&a.i)>>>a.b].Nb(b&a.m,b)} function Pb(a,b){return a.f[(b&a.i)>>>a.b].aa(b&a.m,b)}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].Cb(b&a.m,c,b)}function xb(a,b){a.s=!1;a.j++;b=a.h[(b&a.Ea)>>>a.b].ic(b&a.m,b);a.j--;return b}function Rb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Ea)>>>a.b].Ub(b&a.m,c&255,b);a.j--}function vb(a,b,c){a.s=!1;a.j++;a.h[(b&a.Ea)>>>a.b].mc(b&a.m,c&65535,b);a.j--} function Sb(a){for(var b=0,c=[],d=0;da.a.Va)){var k=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,n=g[2]?g[2].bind(b):null,p=g[3]?g[3].bind(b):null;65472<=f&&65487>=f&&(!k&&n&&(k=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(p)));for(var u=g[4],v=g[5]||1,A=0;A>16&65535);a=a.ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.jd=function(){var a=this.a;a.Y&57344||(a.vb=a.w&65535);return a.vb};h.kd=function(){return this.a.ya};h.ie=function(a){var b=this.a;1170>b.Va&&(a&=-49);b.ya!=a&&(b.ya=a,b.Pa=a&16?4194303:262143,dc(b))};h.Sd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535}; h.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.Ld=function(a){return this.a.H[1][a>>1&7]};h.Je=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Jd=function(a){return this.a.H[1][(a>>1&7)+8]};h.He=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.Kd=function(a){return this.a.Z[1][a>>1&7]};h.Ie=function(a,b){b=b>>1&7;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.Id=function(a){return this.a.Z[1][(a>>1&7)+8]}; h.Ge=function(a,b){b=(b>>1&7)+8;this.a.Z[1][b]=a;this.a.H[1][b]&=65295};h.dd=function(a){return this.a.H[0][a>>1&7]};h.ee=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[0][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.cd=function(a){return this.a.Z[0][a>>1&7]};h.de=function(a,b){b=b>>1&7;this.a.Z[0][b]=a;this.a.H[0][b]&=65295};h.ad=function(a){return this.a.Z[0][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.Z[0][b]=a;this.a.H[0][b]&=65295}; h.Rd=function(a){return this.a.H[3][a>>1&7]};h.Pe=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Pd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Ne=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Qd=function(a){return this.a.Z[3][a>>1&7]};h.Oe=function(a,b){b=b>>1&7;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Od=function(a){return this.a.Z[3][(a>>1&7)+8]};h.Me=function(a,b){b=(b>>1&7)+8;this.a.Z[3][b]=a;this.a.H[3][b]&=65295};h.Xa=function(a){a&=7;return this.a.D&2048?this.a.Fa[a]:this.a.g[a]}; h.ab=function(a,b){b&=7;this.a.D&2048?this.a.Fa[b]=a:this.a.g[b]=a};h.pd=function(){return this.a.D&49152?this.a.qa[0]:this.a.g[6]};h.ne=function(a){this.a.D&49152?this.a.qa[0]=a:this.a.g[6]=a};h.sd=function(){return this.a.g[7]};h.qe=function(a){this.a.g[7]=a};h.Ya=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Fa[a]};h.bb=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Fa[b]=a};h.qd=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[1]}; h.oe=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.qa[1]=a};h.rd=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.qa[3]};h.pe=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.qa[3]=a};h.$c=function(a){return this.a.Pb[a-65504>>1]};h.ae=function(a,b){this.a.Pb[b-65504>>1]=a};h.hc=function(a){return 65520==a?(Tb(this.h)>>6)-1:0};h.lc=function(){};h.Nd=function(){return 1};h.Le=function(){};h.Zc=function(){return this.a.X};h.$d=function(){this.a.X=0};h.fd=function(){return this.a.Ob}; h.ge=function(a,b){b&1||(a&=255);this.a.Ob=a};h.ld=function(a,b){return b?0:this.a.mb};h.je=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.v|=1}b.mb=a};h.Md=function(a,b){return b?0:this.a.Za&65280};h.Ke=function(a){this.a.Za=a|255};h.od=function(){return ec(this.a)};h.me=function(a){fc(this.a,a&-1793|ec(this.a)&1792)};h.kc=function(){}; var N={},$b=(N[61568]=[null,null,L.prototype.Sd,L.prototype.Qe,"UNIMAP",64,1170],N[62592]=[null,null,L.prototype.Ld,L.prototype.Je,"SIPDR",8,1145,64],N[62608]=[null,null,L.prototype.Jd,L.prototype.He,"SDPDR",8,1145,64],N[62624]=[null,null,L.prototype.Kd,L.prototype.Ie,"SIPAR",8,1145,64],N[62640]=[null,null,L.prototype.Id,L.prototype.Ge,"SDPAR",8,1145,64],N[62656]=[null,null,L.prototype.dd,L.prototype.ee,"KIPDR",8,1145,64],N[62672]=[null,null,L.prototype.bd,L.prototype.ce,"KDPDR",8,1145,64],N[62688]= [null,null,L.prototype.cd,L.prototype.de,"KIPAR",8,1145,64],N[62704]=[null,null,L.prototype.ad,L.prototype.be,"KDPAR",8,1145,64],N[62798]=[null,null,L.prototype.kd,L.prototype.ie,"MMR3",1,1145,64],N[65382]=[null,null,L.prototype.ed,L.prototype.fe,"LKS"],N[65402]=[null,null,L.prototype.gd,L.prototype.he,"MMR0",1,1145,64],N[65404]=[null,null,L.prototype.hd,L.prototype.kc,"MMR1",1,1145,64],N[65406]=[null,null,L.prototype.jd,L.prototype.kc,"MMR2",1,1145,64],N[65408]=[null,null,L.prototype.Rd,L.prototype.Pe, "UIPDR",8,1145,64],N[65424]=[null,null,L.prototype.Pd,L.prototype.Ne,"UDPDR",8,1145,64],N[65440]=[null,null,L.prototype.Qd,L.prototype.Oe,"UIPAR",8,1145,64],N[65456]=[null,null,L.prototype.Od,L.prototype.Me,"UDPAR",8,1145,64],N[65472]=[null,null,L.prototype.Xa,L.prototype.ab,"R0SET0"],N[65473]=[null,null,L.prototype.Xa,L.prototype.ab,"R1SET0"],N[65474]=[null,null,L.prototype.Xa,L.prototype.ab,"R2SET0"],N[65475]=[null,null,L.prototype.Xa,L.prototype.ab,"R3SET0"],N[65476]=[null,null,L.prototype.Xa, L.prototype.ab,"R4SET0"],N[65477]=[null,null,L.prototype.Xa,L.prototype.ab,"R5SET0"],N[65478]=[null,null,L.prototype.pd,L.prototype.ne,"R6KERNEL"],N[65479]=[null,null,L.prototype.sd,L.prototype.qe,"R7KERNEL"],N[65480]=[null,null,L.prototype.Ya,L.prototype.bb,"R0SET1",1,1145],N[65481]=[null,null,L.prototype.Ya,L.prototype.bb,"R1SET1",1,1145],N[65482]=[null,null,L.prototype.Ya,L.prototype.bb,"R2SET1",1,1145],N[65483]=[null,null,L.prototype.Ya,L.prototype.bb,"R3SET1",1,1145],N[65484]=[null,null,L.prototype.Ya, L.prototype.bb,"R4SET1",1,1145],N[65485]=[null,null,L.prototype.Ya,L.prototype.bb,"R5SET1",1,1145],N[65486]=[null,null,L.prototype.qd,L.prototype.oe,"R6SUPER",1,1145],N[65487]=[null,null,L.prototype.rd,L.prototype.pe,"R6USER",1,1145],N[65504]=[null,null,L.prototype.$c,L.prototype.ae,"CTRL",8,1170],N[65520]=[null,null,L.prototype.hc,L.prototype.lc,"LSIZE",1,1170],N[65522]=[null,null,L.prototype.hc,L.prototype.lc,"HSIZE",1,1170],N[65524]=[null,null,L.prototype.Nd,L.prototype.Le,"SYSID",1,1170],N[65526]= [null,null,L.prototype.Zc,L.prototype.$d,"CPUERR",1,1170],N[65528]=[null,null,L.prototype.fd,L.prototype.ge,"MB",1,1170],N[65530]=[null,null,L.prototype.ld,L.prototype.je,"PIR"],N[65532]=[null,null,L.prototype.Md,L.prototype.Ke,"SL"],N[65534]=[null,null,L.prototype.od,L.prototype.me,"PSW"],N); Ia(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),nc(this,jc?oc:qc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},L:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ma:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.wa=!0},F:function(a,b){return this.I(a,b)},T:function(a,b){return this.ic(a,b)},Ba:function(a,b,c){this.m?this.f(a,b,c):this.Ub(a,b,c)},ua:function(a,b,c){this.m?this.f(a,b,c):this.mc(a,b,c)},B:function(a){return this.l[a]},J:function(a){return this.l[a]},R:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},fa:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},Aa:function(a,b){this.l[a]=b;this.wa=!0},sa:function(a,b){this.l[a]=b;this.wa=!0},na:function(a,b,c){a&1&&J(this.h, c,64);this.c.setUint16(a,b,!0);this.wa=!0},va:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.wa=!0}};function Hb(a,b,c){a.G=b;a.i=a.j=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.j=c.j)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.j||(a.Bb=!a.m&&b[1]||a.f,a.Cb=!a.m&&b[3]||a.w);if(c||void 0===c)a.Ub=b[1]||a.f,a.mc=b[3]||a.w}function sc(a,b,c){c&&a.i||(a.Nb=b[0]||a.u,a.aa=b[2]||a.A);if(c||void 0===c)a.I=b[0]||a.u,a.ic=b[2]||a.A}function nc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} var vc=[],rc=[I.prototype.L,I.prototype.ma,I.prototype.ga,I.prototype.Ca],tc=[I.prototype.F,I.prototype.Ba,I.prototype.T,I.prototype.ua];if(Za)var qc=[I.prototype.B,I.prototype.Aa,I.prototype.R,I.prototype.na],oc=[I.prototype.J,I.prototype.sa,I.prototype.fa,I.prototype.va]; function wc(a,b){y.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Eb=0;this.rb=b;this.na=c;this.Jb=Math.round(this.rb/1E4)/100;this.Na=this.Jb*this.na;this.o.S=!1;this.o.Rb=!1;this.o.jb=a.autoStart;this.o.wb=!1;this.pb=this.Qa=0;this.qb=a.csStart;this.fb=a.csInterval;this.gb=a.csStop;this.L=[];this.gc=this.Xd.bind(this);G(this)}B(wc);var xc=["power","reset"];h=wc.prototype; h.ia=function(a,b,c,d){this.m=a;this.h=b;this.G=d;this.A=a.A;for(b=0;b=a.Qa&&(a.Qa+=a.fb,c=!0);0<=a.gb&&a.gb<=Bc(a)&&(a.fb=a.gb=-1,Ac(a),H(a),c=!0);c&&a.W(Bc(a)+" cycles: checksum="+r(a.pb))}} h.ba=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.l[b]=c,!0;case "run":return this.l[b]=c,c.onclick=function(){var a;if(a=d.m)if(a=d.m,a.o.P)a=!0;else{var b=null,c,k=C(a.id);for(c=0;ca.Ma/a.Na&&(b=1);a.na=b;b=a.Jb*a.na;if(a.Na!=b){a.Na=b;b=a.Na.toFixed(2)+"Mhz";var d=a.l.setSpeed;d&&(d.textContent=b);a.W("target speed: "+b)}c&&a.m&&Ec(a.m)}rb(a,a.ga);a.ga=0;a.fa=qa();a.sa=0;Dc(a)}function Xb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Yb(a,b,c,d){0<=b&&ba.L[b][0])&&(c=a.rb*a.na/1E3*c|0,a.o.S&&(c+=Fc(a)),a.L[b][0]=c)} function qb(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Fc(a,b){var c=a.ma-=a.a;a.a=a.J=0;b&&(a.ma=0);return c} h.Xd=function(){if(this.o.S){this.Kb>=this.rb&&Dc(this,!0);this.ib=0;this.ob=qa();if(this.sa){var a=this.ob-this.sa;a>this.dc&&(this.fa+=a,this.fa>this.ob&&(this.fa=this.ob))}try{do{for(var b,c=this.o.wb?1:this.sb,d=this.L.length-1;0<=d;d--){var e=this.L[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Ab(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.ib+=b;this.ga+=b;sb(this,b);qb(this,b);this.hb-=b;if(0>=this.hb){this.hb+=this.sb;15<=++this.fc&&(this.za(),this.fc=0);break}}while(this.o.S)}catch(f){H(this); this.m&&this.m.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.S){a=setTimeout;b=this.gc;this.sa=qa();c=this.dc;this.ib&&(c=Math.round(c*this.ib/this.sb));c-=this.sa-this.ob;if(d=this.sa-this.fa)this.Ma=Math.round(this.ga/(10*d))/100,864E5<=d&&(this.ua=0,Cc(this));if(0>c||this.Mac&&(this.fa-=c),c=0;this.Kb+=this.ib;this.sa+=c;a(b,c)}}}; function pb(a){var b;a.o.error?(a.W(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.S)a.W(a.toString()+" busy");else{Cc(a);a.o.S=!0;a.o.Rb=!0;if(b=a.l.run)b.textContent="Halt";a.m&&a.m.start(a.fa,Bc(a));setTimeout(a.gc,0)}}h.Ab=function(){return 0};function H(a){var b=!1;if(a.o.S){Fc(a);rb(a,a.ga);a.ga=0;a.o.S=!1;if(b=a.l.run)b.textContent="Run";a.m&&a.m.stop(qa(),Bc(a));b=!0;a.G||a.status("Stopped")}a.o.complete=void 0;return b} function Gc(a){this.Va=+a.model||1170;this.$b=a.addrReset||0;wc.call(this,a,6666667);this.tb=0;this.cc=255;1120==this.Va?(this.decode=Hc.bind(this),this.Ca=this.Fc,this.tb=8,this.cc=-1):(this.decode=Ic.bind(this),this.Ca=this.Gc);Jc(this);this.Ra=0;this.I=null;this.Db=[];this.o.complete=!1}B(Gc,wc);h=Gc.prototype;h.Wb=function(){for(var a=192,b=0;bc.Tb&&(c.Tb=a,a+=4)}}; h.reset=function(){this.status("Model "+this.Va);this.o.S&&H(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; function Jc(a){a.j=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.$b,-1,-2,-3,-4,-5,-6,-7,-8];a.Fa=[0,0,0,0,0,0];a.qa=[0,0,0,0];a.u=0;a.Nc=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Z=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0]];a.$a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];a.Pb=[0,0,0,0,0,0,0,0];a.Ob=0;a.v=0;a.B=a.F=0;a.c=a.b=a.Hb=0;a.va=-1;ob(a)}function ob(a){a.Y=0;a.ub=0;a.vb=0;a.ya=0;a.X=0;a.mb=0;a.Za=255;a.Oa=0;a.cb=0;a.eb=0;a.Pa=262143;a.Sa=0;a.w=0;a.I=null;a.h&&(dc(a),a.Lc=Tb(a.h))}function dc(a){a.Oa?(a.T=65536,a.Fb=a.ya&16?4186112:253952,a.R=a.Jc,a.aa=a.Td,a.Cb=a.Re,Lb(a.h,a.ya&16?22:18)):(a.T=0,a.Fb=57344,a.R=a.Ic,a.aa=a.jc,a.Cb=a.nc,Lb(a.h,16))} function cc(a,b){b&=-3073;if(a.Y!=b){b&57344&&!(a.Y&57344)&&(a.ub=a.w>>16&65535,a.vb=a.w&65535);a.Y=b;a.cb=(b&96)>>5;a.eb=(b&30)>>1;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Oa!=c&&(a.Oa=c,dc(a))}}h.bc=function(){return 0}; h.save=function(){var a=new Q(this);a.set(0,[this.g,this.Fa,this.qa,this.$a,this.Pb,this.X,this.Ob,this.mb,this.Za,ec(this),this.va,this.u,this.v,this.Y,this.ub,this.vb,this.ya,this.cb,this.eb,this.H,this.Z,this.Oa,this.Pa,this.Sa,this.w]);a.set(1,[this.ua,this.na]);a.set(2,Sb(this.h));return a.data()}; h.restore=function(a){var b=a[1];this.ua=b[1];Cc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c>14&3;c=a.D>>14&3;a.u!=c&&(a.qa[c]=a.g[6],a.g[6]=a.qa[a.u]);a.D=b;a.v&=-3;a.v|=a.I?2:1}h.ca=function(a){this.s=this.i=a;this.f=0}; h.Ga=function(a,b){this.s=this.i=this.j=a;this.f=b||0};function Oc(a,b){a.s=a.i=a.j=b;a.f=a.s^a.j>>1}function Pc(a,b,c,d){a.s=a.i=a.j=b;a.f=(c^d)&(d^b)}function K(a,b,c,d){if(!a.Ra){0>a.va?a.va=ec(a):a.u||(d=-4);-4==d&&(a.v&256&&(d=-1),a.v|=256,a.X|=4,a.g[6]=b=4);if(-1!=d){a.w=b|4143316992;a.u=0;var e=a.aa(b|a.T),f=a.aa(b+2&65535|a.T);fc(a,f&-12289|a.va>>2&12288);Qc(a,a.va);Qc(a,a.g[7]);S(a,e)}a.a-=5;a.v&=~(c|19);a.v|=129;a.va=-1;-1==d&&H(a);if(-4<=d)throw b;}} function Rc(a){var b=Sc(a),c=Sc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);S(a,b);fc(a,c);a.v&=-17}function Tc(a,b){var c=b>>13&31;31>c&&(b=a.ya&32?a.$a[c]+(b&8190)&4194302:b&-3932161);return b} function wb(a,b,c){var d,e,f;if(!(c&a.Oa))return f=b&65535,57344<=f&&(f|=a.Fb),f;d=b>>13;a.ya&a.Nc[a.u]||(d&=7);e=a.H[a.u][d];f=(a.Z[a.u][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=Tc(a,f));if(a.Ra)return f;f>=a.Lc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& (g|=16384));a.H[a.u][d]=e;if(f!=(4194170&a.Pa)||a.u)a.cb=a.u,a.eb=d;g&&(g&57344&&(0<=a.va&&(g|=128),a.Y&57344||(g|=a.Y&4096|a.cb<<5|a.eb<<1,cc(a,a.Y&-61695|g&61694)),K(a,168,64,-2)),a.Y&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Y|=4096,a.Y&512&&(a.v|=64)));return f}function Sc(a){var b=a.aa(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Qc(a,b){var c=a.g[6]-2&65535;a.g[6]=c;a.w=a.w&65535|(a.w&-65536)<<8|16121856;a.v&256||a.Ca(4,-2,c);a.Cb(c,b)} function Uc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return K(a,4,0,-3),0;case 1:return 6==c&&a.Ca(d,0,a.g[6]),a.a-=3,7==c?a.g[c]:a.g[c]|g;case 2:f=2;e=a.g[c];6==c&&a.Ca(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.g[c];7!=c&&(e|=g);e=a.aa(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.g[c]+f&65535;6==c&&a.Ca(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.g[c]-2&65535;7!=c&&(e|=g);e=a.aa(e)|g;a.a-=8;break;case 6:return e=a.aa(Mc(a,2)),e=e+a.g[c]&65535,6==c&&a.Ca(d, 0,e),a.a-=6,e|g;case 7:return e=a.aa(Mc(a,2)),e=e+a.g[c]&65535,e=a.aa(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.w=a.w&65535|(a.w&-65536)<<8|(f<<3&248|c)<<16;return e}h.Fc=function(a,b,c){!this.u&&0>=b&&c<=this.Za&&(this.v|=32)};h.Gc=function(a,b,c){this.u||(65534<=c&&(c|=-65536),a&4&&c<=this.Za&&(c<=this.Za-32?K(this,4,0,-4):(this.X|=8,this.v|=32)))};h.Ic=function(a,b,c){a=Uc(this,a,b,c);3932160<=a&&(a=Tc(this,a));return a};h.Jc=function(a,b,c){return wb(this,Uc(this,a,b,c),c)}; h.jc=function(a){3932160<=a&&(a=Tc(this,a));return Pb(this.h,this.Sa=a)};h.Td=function(a){return Pb(this.h,this.Sa=wb(this,a,2))};h.nc=function(a,b){3932160<=a&&(a=Tc(this,a));Qb(this.h,this.Sa=a,b)};h.Re=function(a,b){Qb(this.h,this.Sa=wb(this,a,4),b)};function Vc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Uc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.u=a.D>>12&3,c=a.aa(d|c&a.T),a.u=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.qa[a.D>>12&3];return c} function Wc(a,b,c,d){a.w=a.w&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Uc(a,b,e,4),c&65536||(e&=65535),a.u=a.D>>12&3,e=wb(a,e|c&65536,4),a.u=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.qa[a.D>>12&3]=d}function Xc(a,b){b>>=6;var c=a.F=b&7;(b=a.B=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c+a.tb]&a.cc;return a}function Yc(a,b){b>>=6;var c=a.F=b&7;return(b=a.B=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c+a.tb]} function Zc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Uc(a,b,c,8)}function $c(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.R(b,c,3),a=Ob(a.h,c)):a=a.g[c]&255;return a}function ad(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.h,a.R(b,c,2)):a.g[c]}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Hb=a.R(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Ob(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].Bb(e&a.m,c,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Pb(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function bd(a,b,c,d,e){var f=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.R(b,f,5),e.call(a,(c=0>c?a.g[-c-1]&255:c)<<8),d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].Bb(d&a.m,c,d)):(c?(c=0>c?a.g[-c-1]&255:c,a.g[f]=a.g[f]&~d|c<<24>>24&d):a.g[f]&=~d,e.call(a,c<<8))} function cd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.R(b,e,4),d.call(a,c=0>c?a.g[-c-1]:c),Qb(a.h,e,c)):(a.g[e]=c=0>c?a.g[-c-1]:c,d.call(a,c))}function V(a,b,c){c&&(S(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} h.Ab=function(a){this.o.complete=!0;var b=a?this.o.Rb?0:1:-1;this.o.Rb=!1;this.ma=this.a=a;do{if(this.v){if(a=this.v&11){a=!1;if(this.v&2){var c=160,d=(this.mb&224)>>5,e=this.I&&this.I.Wa>d?this.I:null;e&&(c=e.Tb,d=e.Wa);d>(this.D&224)>>5?(this.v&8&&(Mc(this,2),this.v&=-9),K(this,c,0,-10),d=!0):d=!1;d&&(e&&bc(this,e),a=!0);this.I||this.mb||(this.v&=-3)}else this.v&1&&this.v++;a=a&&0>b}if(a)break;if(this.v&112&&Nc(this)&&0>b)break}this.v=this.v&15|this.D&16;this.decode(Lc(this))}while(0>1|b<<16;Oc(this,a);return a&65535} function id(a,b){a=b&128|b>>1|b<<8;Oc(this,a<<8);return a&255}function jd(a,b){a=b&~a;this.ca(a);return a}function kd(a,b){a=b&~a;this.ca(a<<8);return a}function ld(a,b){a|=b;this.ca(a);return a}function md(a,b){a|=b;this.ca(a<<8);return a}function nd(a,b){a=~b|65536;this.Ga(a);return a&65535}function od(a,b){a=~b|256;this.Ga(a<<8);return a&255}function pd(a,b){this.s=this.i=a=b-a;this.f=b&(b^a);return a&65535}function qd(a,b){a=b-a;var c=a<<8;b<<=8;this.s=this.i=c;this.f=b&(b^c);return a&255} function rd(a,b){this.s=this.i=a=b+a;this.f=a&(b^a);return a&65535}function sd(a,b){a=b+a;var c=a<<8;this.s=this.i=c;this.f=c&(b<<8^c);return a&255}function td(a,b){a=-b;this.Ga(a,a&b&32768);return a&65535}function ud(a,b){a=-b;this.Ga(a<<8,(a&b&128)<<8);return a&255}function vd(a,b){a=b<<1|this.j>>16&1;Oc(this,a);return a&65535}function wd(a,b){a=b<<1|this.j>>16&1;Oc(this,a<<8);return a&255}function xd(a,b){a=(this.j&65536|b)>>1|b<<16;Oc(this,a);return a&65535} function yd(a,b){a=((this.j&65536)>>8|b)>>1|b<<8;Oc(this,a<<8);return a&255}function zd(a,b){var c=b-a;Pc(this,c,a,b);return c&65535}function Ad(a,b){var c=b-a;Pc(this,c<<8,a<<8,b<<8);return c&255}function Bd(a,b){this.s=this.i=b&65280;this.f=this.j=0;return(b<<8|b>>8)&65535}function Cd(a,b){a^=b;this.ca(a);return a&65535}function Dd(a){U(this,a,Yc(this,a),dd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} function Ed(a){var b=ad(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.j=this.f=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.f=32768)}this.g[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b} function Fd(a){var b=ad(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.j=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.j=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.g[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Gd(a){V(this,a,!R(this))}function Hd(a){V(this,a,R(this))} function Id(a){U(this,a,Yc(this,a),jd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Jd(a){T(this,a,Xc(this,a),kd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Kd(a){U(this,a,Yc(this,a),ld);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Ld(a){T(this,a,Xc(this,a),md);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} function Md(a){var b=Yc(this,a);a=ad(this,a);this.ca((0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Nd(a){var b=Xc(this,a);a=$c(this,a);this.ca(((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Od(a){V(this,a,this.i&65535?0:4)}function Pd(a){V(this,a,!Kc(this)==!(this.f&32768))}function Qd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.f&32768))} function Rd(a){V(this,a,!R(this)&&!!(this.i&65535))}function Sd(a){V(this,a,(this.i&65535?0:4)||!Kc(this)!=!(this.f&32768))}function Td(a){V(this,a,R(this)||(this.i&65535?0:4))}function Ud(a){V(this,a,!Kc(this)!=!(this.f&32768))}function Vd(a){V(this,a,Kc(this))}function Wd(a){V(this,a,!!(this.i&65535))}function Xd(a){V(this,a,!Kc(this))}function Yd(){K(this,12,0,-9)}function Zd(a){V(this,a,!0)}function $d(a){V(this,a,!(this.f&32768))}function ae(a){V(this,a,this.f&32768?2:0)} function W(a){a&1&&(this.j=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function be(a){var b=Yc(this,a);a=ad(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Pc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ce(a){var b=Xc(this,a);a=$c(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Pc(this,c,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} function de(a){var b=ad(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.j=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.j=65536,this.a-=7}function ee(){K(this,24,0,-9);this.a-=20} function fe(){this.D&49152?(this.X|=128,K(this,4,0,-8)):(this.A&&1120==this.Va&&this.A.setData(this.g[0],!0),this.G?this.G.c():H(this));this.a-=7}function ge(){K(this,16,0,-9);this.a-=20}var he=[0,7,7,10,7,11,9,13];function ie(a){this.J=this.a;S(this,Zc(this,a));this.a=this.J-he[this.c]}var je=[0,14,14,17,14,18,16,20];function ke(a){this.J=this.a;var b=Zc(this,a);a=a>>6&7;Qc(this,this.g[a]);this.g[a]=this.g[7];S(this,b);this.a=this.J-je[this.c]}var le=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function me(a){var b=Yc(this,a);this.J=this.a;cd(this,a,b,this.ca);this.a=this.J-le[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ne(a){var b=Xc(this,a);bd(this,a,b,65535,this.ca);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var oe=[7,13,13,17,14,18,17,21]; function pe(a){var b=ad(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.g[a];c&32768&&(c|=-65536);b=~~(b*c);this.g[a]=b>>16&65535;this.g[a|1]=b&65535;this.s=b>>16;this.i=this.s|b;this.f=0;this.j=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)S(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function ve(a){U(this,a,Yc(this,a),zd);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function we(a){U(this,a,0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)}function xe(){K(this,28,0,-9)} function ye(){this.A&&(this.A.la=this.g[7],this.A.setData(this.g[0],!0));this.v|=8;Mc(this,-2);this.a-=3}function ze(a){U(this,a,this.g[(a>>6&7)+this.tb],Cd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-9)}function Hc(a){Ae[a>>12].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a>>6&3].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a>>6&3].call(this,a)} function Ne(a){Oe[a>>6&3].call(this,a)}function Pe(a){Qe[a>>6&3].call(this,a)} var Ae=[function(a){Re[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,Y,function(a){Se[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],Re=[function(a){Te[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,Y,Y,Y],Ce=[function(a){cd(this,a,0,this.Ga);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,nd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,rd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ee=[function(a){U(this,a,0,td); this.a-=this.c?11:6},function(a){U(this,a,R(this)?1:0,dd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,R(this)?1:0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=ad(this,a);this.Ga(a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ge=[function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,hd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)}],Te=[function(a){Ue[a& 15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,Y,He,Je,we,we,we,we],Ue=[fe,ye,te,Yd,ge,re,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ie=[qe,function(){this.j=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ke=[qe,function(){this.j=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Se=[Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,Y,Y,Y],Me=[function(a){bd(this,a,0, 255,this.Ga);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)}],Oe=[function(a){T(this,a,0,ud);this.a-=this.c?11:6},function(a){T(this,a,R(this)?1:0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,R(this)?1:0,Ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=$c(this,a);this.Ga(a<<8);this.a-=this.c?4:3+(7==this.b? 2:0)}],Qe=[function(a){T(this,a,0,yd);this.a-=this.c?9+(this.Hb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,id);this.a-=this.c?9+(this.Hb&1):3+(7==this.b?2:0)},function(a){T(this,a,0,gd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Ve[a>>12].call(this,a)} var Ve=[function(a){We[a>>8&15].call(this,a)},me,be,Md,Id,Kd,Dd,function(a){Xe[a>>8&15].call(this,a)},function(a){Ye[a>>8&15].call(this,a)},ne,ce,Nd,Jd,Ld,ve,Y],We=[function(a){Ze[a>>4&15].call(this,a)},Zd,Wd,Od,Pd,Ud,Qd,Sd,ke,ke,Be,De,Fe,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.aa(a|this.T);S(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Vc(this,a,0);this.ca(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.J= this.a;this.ca(b);Wc(this,a,0,b);this.a=this.J-oe[this.c]},function(a){cd(this,a,Kc(this)?65535:0,this.ca);this.a-=this.c?9:3+(7==this.b?2:0)}],Ze=[function(a){af[a&15].call(this,a)},Y,Y,Y,ie,ie,ie,ie,se,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.v|=1,this.v&=-3),this.a-=5):K(this,8,0,-9)},He,Je,we,we,we,we],af=[fe,ye,function(){Rc(this);this.v|=this.D&16;this.a-=13},Yd,ge,re,te,function(){K(this,8,0,-9)},Y,Y,Y,Y,Y,Y,Y,Y],Xe=[pe,pe,de,de,Ed,Ed,Fd,Fd,ze,ze,Y,Y,Y,Y,ue,ue],Ye= [Xd,Vd,Rd,Td,$d,ae,Gd,Hd,ee,xe,Le,Ne,Pe,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[Y,function(a){a=Vc(this,a,65536);this.ca(a);Qc(this,a);this.a-=11},function(a){var b=Sc(this);this.J=this.a;this.ca(b);Wc(this,a,65536,b);this.a=this.J-oe[this.c]},Y]; function cf(a){y.call(this,"ROM",a,cf,128);this.da=this.c=null;this.i=a.addr;this.b=a.size;this.j=!1;this.f=a.alias;this.m=a.file;this.s=t(this.m);if(this.m){a=this.m;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.m+"&format=bytes&decimal=true");var c=this;w(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.m=null):(Ta(c.Ba,a,b),(a=sa(a,b))?(c.c=a.M,c.da=a.da):c.m=null);df(c)})}}B(cf);h=cf.prototype; h.ia=function(a,b,c,d){this.h=b;this.a=c;this.G=d;df(this)};h.ka=function(){this.da&&(this.G&&this.G.a(this.id,this.i,this.b,this.da),delete this.da);return!0};h.ja=function(){return!0}; function df(a){if(!Xa(a)){if(a.m){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Cb){var c={};b=(c[b]=[cf.prototype.Hd,cf.prototype.Fe,null,null,null,a.b>>1],c);if(fb(a.h,a,b)){b=a.j=!0;break a}}else if(Ib(a.h,b,a.b,mc)){for(c=0;c>>f.b;0>>=f.b;0>>a.b;0=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,v=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(v)for(;v--;)Rb(a.h,p++,b[u++]&255);else p&1?H(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=m.Vb&&c<=m.Ac&&(b=c-(m.Vb-m.oc));b&&(a.preventDefault&&a.preventDefault(),d.zb(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.qc&&(b=m.pc);d.zb(b);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&& a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.zb(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;var e=this;this.T=Zb(this.a,this.w?-1:48,4,262144);this.ga=Xb(this.a,function(){var a;a=-1;e.u.length&&(a=e.u.shift()&255,e.sa&&97<=a&&122>a&&(a-=32),Yb(e.a,e.ga,1E3/Math.round(e.L/10)));0<=a&&(e.B=a,e.b&128?e.B|=49152:e.b|=128,e.b&64&&M(c,e.T))});this.J=Zb(this.a,this.w?-1:52,4,262144);this.na=Xb(this.a,function(){e.c|=128;e.c&64&&M(c,e.J)});fb(b,this,kf,this.w?64832+8*(this.w-1)-65392:0);hb(b,this.reset.bind(this));G(this)}; h.ec=function(a){if(!this.i){var b=yc(this.m,"connection");if(b){var c=b.split("->");if(2==c.length){var d=oa(c[0]);if(d!=this.Aa)return;c=oa(c[1]);if(this.i=Ua(c)){var e=this.i.exports;if(e){var f=e.connect;f&&f.call(this.i,this.A);if(this.F=e.receiveData){this.A=a;this.I=e.receiveStatus;this.status(this.Ba+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}}; h.ka=function(a,b){if(!b)if(this.ec(this.A),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){lf(this)};h.save=function(){var a=new Q(this);a.set(0,[]);return a.data()};h.restore=function(){return lf(this)};function lf(a){a.B=0;a.b=8192;a.c=128;a.u=[];return!0} h.zb=function(a){if("number"==typeof a)this.u.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.fa||8,c=a-this.s%a,this.fa&&(b=" ".slice(0,c)));this.R&&!this.s&&c&&(b=String.fromCharCode(this.R)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.s+=c}}else if(null!=this.j){if(10== a||1024<=this.j.length)this.W(this.j),this.j="";10!=a&&(this.j+=String.fromCharCode(a))}Yb(this.a,this.na,1E3/Math.round(this.ma/10));this.c&=-129};var mf={},kf=(mf[65392]=[null,null,Z.prototype.ud,Z.prototype.se,"RCSR"],mf[65394]=[null,null,Z.prototype.td,Z.prototype.re,"RBUF"],mf[65396]=[null,null,Z.prototype.Vd,Z.prototype.Te,"XCSR"],mf[65398]=[null,null,Z.prototype.Ud,Z.prototype.Se,"XBUF"],mf); Ia(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.l[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.l[b]=c,c.onclick= function(){var a=d.l.listTapes;a&&pf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.l[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;pf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.l[b]=c,!0}return!1}; h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;this.L=qf(a);var e=this;if((this.c=yc(this.m,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){x("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.I=Zb(this.a,56,4,4096);this.T=Xb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.Ac.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!w(f,null,!0,function(e,f,g){var k=0>g&&a.m&&!a.m.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.Ba,e,f),(e=sa(e,f))&&zf(a,b,c,d,e.M,e.pa,e.oa)); a.o.Ia=!1;a.j&&(a.j--,a.j||G(a));wf(a)})}function tf(a,b,c,d){if((a=a.l.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.K);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ka(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):la(c,"/")&&(d="dir"),f=ta()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.xb?"":e)+"&format=json"));return!!w(f, null,!0,function(b,c,d){Gf(a,b,c,d)})} function Gf(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.m&&!a.m.o.P;if(d)a.controller.C('Unable to load disk "'+a.ra+'" (error '+d+": "+b+")",f);else{Ta(a.controller.Ba,b,c);try{if(0g&&0c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+ c+")");if(k.length)if(1==k.length)x(k[0]);else{a.K=k.length;a.O=k[0].length;a.N=k[0][0].length;var l=k[0][0][0];a.U=l&&l.length||512;for(d=c=0;d>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var v=l.bytes;if(void 0!==v&&v.length){for(var A=n<<2,xa=v.length;xa>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};h.write=function(a,b,c){if(this.c)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.ha?f=a.ta+a.ha&&(a.ha+=f-(a.ta+a.ha)+1):(a.ta=f,a.ha=1);d[f]=d[f]&~(255<g)break;e|=g<=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+ b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;lb&&-2!=b&&this.controller.C("Unable to restore disk '"+this.ra+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=If(this,a++);)Lf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; function Lf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function P(a){y.call(this,"RK11",a,P,65536);this.A=a.autoMount||{};this.j=0;this.c=Array(8);this.w=!Ba("Mobi")&&window&&"FileReader"in window}B(P);h=P.prototype; h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RK11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Mf(d,a)},!0;case "loadDrive":return this.l[b]= c,c.onclick=function(){var a=d.l.listDisks;a&&Nf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.w){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.V)?(a=Ca(Kf(a),a.Qb.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.w)return this.l[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;Nf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.A[e]=a[e]);Of(this);this.Ta=Zb(this.a,144,5,65536);fb(b,this,Pf);hb(b,this.reset.bind(this));Qf(this,"None","",!0);this.w&&Qf(this,"Local Disk","?");Qf(this,"Remote Disk","??");Rf(this)||G(this)}; h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Mf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Of(this)};h.save=function(){return(new Q(this)).data()}; h.restore=function(a){return Of(this,a[0])};function Rf(a,b){b||(a.j=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}Tf(a,e,b,c,!1,d)}else Sf(a,e)} function Tf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,Sf(a,b,!0),k.Ka?a.C("RK11 busy"):(k.Ka=!0,e&&(k.Ja=!0,a.j++),k.xa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.tc)&&g++));return g}h.tc=function(a,b,c,d,e){a.Ka=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.La)),b=null);b?(a.V=b,a.ra=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.La),a.Ja||e),this.m&&Ec(this.m)):a.xa=!1;a.Ja&&(a.Ja=!1,--this.j||G(this));Mf(this,a.La)}; function Qf(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e>12&48;this.u=65536-e&65535;this.f=this.f&-16|d&15;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; h.uc=function(a,b,c,d,e,f,g,k){var l=0;a=a.V;var n=null,p;a||(l=128,e=0);for(;e--;){if(!n){n=a.seek(b,c,d+1);if(!n){l=4096;break}p=0}var u,v;if(0>(u=a.read(n,p++))||0>(v=a.read(n,p++))){l=32;break}if(!g&&(vb(this.h,f,u|v<<8),Wb(this.h))){l=1024;break}f+=2;if(p>=a.U&&(n=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){l=64;break}}return k(l,b,c,d,e,f)}; h.vc=function(a,b,c,d,e,f,g,k){var l=0;a=a.V;var n=null,p;a||(l=128,e=0);for(;e--;){var u=xb(this.h,f);if(Wb(this.h)){l=1024;break}f+=2;if(!n){n=a.seek(b,c,d+1,!0);if(!n){l=4096;break}p=0}if(g){var v,A;if(0>(v=a.read(n,p++))||0>(A=a.read(n,p++))){l=32;break}if(u!=(v|A<<8)){l=1;break}}else if(!a.write(n,p++,u&255)||!a.write(n,p++,u>>8)){l=32;break}if(p>=a.U&&(n=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){l=64;break}}return k(l,b,c,d,e,f)};h.zd=function(){return this.F};h.xe=function(){};h.Ad=function(){return this.i}; h.ye=function(){};h.wd=function(){return this.b&61438}; h.ue=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){a=!0;var b,c=(this.f&57344)>>13,d=this.c[c],e,f,g,k,l;this.b&=-129;var n=(this.b&14)>>1;switch(n){case 0:this.i=0;this.b=128;this.f=0;break;case 4:e=(this.f&8160)>>5;e>=d.K&&(this.i|=32832,this.b|=49152);break;case 5:case 2:b=this.uc;case 3:case 1:e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,k=65536-this.u&65535,l=(this.b&48)<<12|this.s,b||(b=this.vc),e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):a=b.call(this, d,e,f,g,k,l,3<=n,this.sc.bind(this))}this.F=d.status|(d.V?128:0)|c<<13|this.f&15;a&&(this.b&=-2,this.b|=128,this.b&64&&M(this.a,this.Ta))}};h.Bd=function(){return this.u};h.ze=function(a){this.u=a};h.vd=function(){return this.s};h.te=function(a){this.s=a};h.xd=function(){return this.f};h.ve=function(a){this.f=a};h.yd=function(){return this.B};h.we=function(a){this.B=a}; var Uf={},Pf=(Uf[65280]=[null,null,P.prototype.zd,P.prototype.xe,"RKDS"],Uf[65282]=[null,null,P.prototype.Ad,P.prototype.ye,"RKER"],Uf[65284]=[null,null,P.prototype.wd,P.prototype.ue,"RKCS"],Uf[65286]=[null,null,P.prototype.Bd,P.prototype.ze,"RKWC"],Uf[65288]=[null,null,P.prototype.vd,P.prototype.te,"RKBA"],Uf[65290]=[null,null,P.prototype.xd,P.prototype.ve,"RKDA"],Uf[65294]=[null,null,P.prototype.yd,P.prototype.we,"RKDB"],Uf); function O(a){y.call(this,"RL11",a,O,131072);this.w=a.autoMount||{};this.u=0;this.c=Array(4);this.B=!Ba("Mobi")&&window&&"FileReader"in window}B(O);h=O.prototype; h.ba=function(a,b,c){var d=this;switch(b){case "listDisks":return this.l[b]=c,c.onchange=function(){var a=d.l.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){x("RL11 option error: "+k.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.l[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Vf(d,a)},!0;case "loadDrive":return this.l[b]= c,c.onclick=function(){var a=d.l.listDisks;a&&Wf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.l[b]=c;c.onclick=function(){var a=d.l.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.V)?(a=Ca(Kf(a),a.Qb.replace(".json",".img")),x(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.l[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;Wf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; h.ia=function(a,b,c,d){this.m=a;this.h=b;this.a=c;this.G=d;if((a=yc(this.m,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){x(this.type+" auto-mount error: "+f.message+" ("+a+")"),a=null}if(a)for(var e in a)e.substr(0,2)==this.type.substr(0,2)&&(this.w[e]=a[e]);Xf(this);this.Ta=Zb(this.a,112,5,131072);fb(b,this,Yf);hb(b,this.reset.bind(this));Zf(this,"None","",!0);this.B&&Zf(this,"Local Disk","?");Zf(this,"Remote Disk","??");$f(this)||G(this)}; h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.m.Lb){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Vf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Xf(this)};h.save=function(){return(new Q(this)).data()}; h.restore=function(a){return Xf(this,a[0])};function $f(a,b){b||(a.u=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.l.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.c.length)a.C("Unable to load the selected drive");else if(c)if("?"==c)a.C('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=t(c);a.status("Attempting to load "+c+' as "'+b+'"')}bg(a,e,b,c,!1,d)}else ag(a,e)} function bg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.ea.toLowerCase()!=d.toLowerCase()&&(g++,ag(a,b,!0),k.Ka?a.C("RL11 busy"):(k.Ka=!0,e&&(k.Ja=!0,a.u++),k.xa=!!f,Ff(new Bf(a,k,"preload"),c,d,f,a.xc)&&g++));return g}h.xc=function(a,b,c,d,e){a.Ka=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.La)),b=null);b?(a.V=b,a.ra=c,a.ea=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.La),a.Ja||e),this.m&&Ec(this.m)):a.xa=!1;a.Ja&&(a.Ja=!1,--this.u||G(this));Vf(this,a.La)}; function Zf(a,b,c,d){if((a=a.l.listDisks)&&a.options){for(var e=0;e>12&48;this.j=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; h.yc=function(a,b,c,d,e,f,g){var k=0;a=a.V;var l=null,n;a||(k=5120,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=5120;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=5120;break}vb(this.h,Tc(this.a,f),p|u<<8);if(Wb(this.h)){k=8192;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)}; h.zc=function(a,b,c,d,e,f,g){var k=0;a=a.V;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=xb(this.h,Tc(this.a,f));if(Wb(this.h)){k=8192;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=5120;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=5120;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Ed=function(){return this.b&65535}; h.Ce=function(a){this.b=this.b&-1023|a&1022;this.j=this.j&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.V,e,f,g;this.b&=-2;switch(this.b&14){case 4:this.s&8&&(this.b&=63);this.s=c.status|this.i&64|(d&&512==d.K?128:0);break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.i=this.f&4?this.i+b:this.i-b,this.f=this.i=this.i&65408|c);break;case 8:this.s=this.i;break;case 12:b=this.yc;case 10:b||(b=this.zc),e=this.f>>7,f=this.f&64?1:0,g=this.f&63,!d||e>=d.K||g>= d.N?this.b|=37888:(d=(this.j&63)<<16|this.A,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.wc.bind(this)))}a&&(this.b|=129,this.b&64&&M(this.a,this.Ta))}};h.Cd=function(){return this.A};h.Ae=function(a){this.A=a&65534};h.Fd=function(){return this.f};h.De=function(a){this.f=a};h.Gd=function(){return this.s};h.Ee=function(a){this.s=a};h.Dd=function(){return this.j};h.Be=function(a){this.j=a&63;this.b=this.b&-49|(this.j&3)<<4}; var cg={},Yf=(cg[63744]=[null,null,O.prototype.Ed,O.prototype.Ce,"RLCS"],cg[63746]=[null,null,O.prototype.Cd,O.prototype.Ae,"RLBA"],cg[63748]=[null,null,O.prototype.Fd,O.prototype.De,"RLDA"],cg[63750]=[null,null,O.prototype.Gd,O.prototype.Ee,"RLMP"],cg[63752]=[null,null,O.prototype.Dd,O.prototype.Be,"RLBE"],cg); function dg(a,b,c){y.call(this,"Computer",a,dg,33554432);this.o.P=!1;eg(this,b);this.w=yc(this,"autoPower",a);this.m=0;this.L=a.busWidth||a.buswidth;this.b=fg;this.s=null;this.i=this.I=!1;this.R=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=gg(this);if(this.a=Va("CPU",this.id)){this.G=Va("Debugger",this.id);this.h=new Bb({id:this.Ba+".bus",busWidth:this.L},this.a,this.G);var d,e=C(this.id);if((this.A=Va("Panel",this.id))&&this.A.kb)for(b=0;b\nLicense: GPL version 3 or later ");this.W("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bfg){if(hg(d,this.s)){this.f=new Q(this,"1.30.5","failsafe");hg(this.f)&&(mg(this,d),a=2,ng(this.f));this.f.set("timestamp",ra());og(this.f);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hg(d,g):("error"== f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(Aa("user",""),this.c=null)):this.W(f+": "+g),ng(d),hg(d)?(c=lg(d),e=!0):c=!1))}e&&kg(this,c?d:null)}else 2==a&&d.clear()}else kg(this);delete this.s;delete this.u}e=C(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.l.power;d&&(d.textContent="Shutdown");this.a&&(rg(this,this.a,b,c,a),this.za(),this.a.jb());this.F&&(mg(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.m=0}; function mg(a,b){if(ua("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.R;d.user=c;d.type="bug";d.data=b;w("http://www.pcjs.org/api/v1/report",d,!0)}} function sg(a,b,c){var d,e="none";if(a.m)return null;a.m--;var f=new Q(a,"1.30.5"),g=new Q(a,"1.30.5","validate"),k=ra();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&H(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=C(a.id),l=0;l=c||30<=(b.Eb+=c))&&(d.textContent=b.o.S?b.Ma.toFixed(2)+"Mhz":"Stopped",b.Eb=0)}if(this.A&&(b=this.A,a=a||0,b.u)){c=b.a.o.S;d=!!(b.a.v&8);if(0>=a||60<=(b.s+=a)){for(var e=0;ef.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(p){f=null,a=p.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");w(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],g);zg(a,b,c)}})}else c(a,null)} function Ag(a,b,c,d){function e(a){if(void 0===k){var b=g&&F(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--wg||Ka(!0));l=!1}var g,k,l=!0;wg++;Sa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c|| (c="/versions/pdpjs/1.30.5/components.xsl");n=function(d,k){k?xg(c,null,null,!1,e,function(d,l){l?(Ta(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--wg||Ka(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--wg||Ka(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?xg(b,a,d,!0,e,n):yg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(v){f(v.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Ag(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map