(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,Pb:65,Pe:66,Re:67,pf:68,E:69,qf:70,rf:71,sf:72,tf:73,uf:74,vf:75,wf:76,xf:77,yf:78,zf:79,Af:80,Q:81,Bf:82,Cf:83,Df:84,Ef:85,Ff:86,Gf:87,Hf:88,If:89,vc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Jf:97,Kf:98,Lf:99,d:100,e:101,Nf:102,Of:103,Pf:104,Qf:105,Tf:106,k:107,Uf:108,Vf:109,n:110,Wf:111,p:112,q:113,r:114,Xf:115,t:116,Yf:117,Zf:118,$f:119,x:120,y:121,z:122,"{":123, "|":124,"}":125,"~":126,mc: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 v(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,ba:null,ma:null,la: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.ma=g.load;d.la=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.ba=g.symbols;d.M.length?1==d.M.length&&(w(d.M[0]),d=null):(w("Empty resource: "+a),d=null)}catch(k){w("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.wa=this.id:(this.xa=this.id.substr(0,b),this.wa=this.id.substr(b+1));this[a]=c;this.o={ready:!1,Fa:!1,Gb:!1,P:!1,error:!1};this.tb=null;this.o.error=!1;this.j={};this.F=null;this.Hc=d||0;y.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 A(a,b){b||(b=x);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={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Sa={},y=[];function Ta(a,b,c){Sa[a]&&b&&(Sa[a][b]=c)}function B(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.Sc,a]}A($a);var ab=7;function bb(a,b){return a.b[b]&&a.b[b][1]}h=$a.prototype;h.reset=function(){this.stop()}; h.aa=function(a,b,c,d){if(this.l&&this.l.aa(a,b,c,d)||this.a&&this.a.aa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.j[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.j[b]=c,this.f[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.j[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){cb(a, b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){db(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){cb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){db(a,b)}}(this,b),!0):this.parent.aa.call(this,a,b,c,d)}};h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;eb(b,this,fb);gb(b,this.reset.bind(this));hb(this);ib(this)};h.ha=function(a,b){b||(jb(),this.reset());return!0};h.ga=function(){return!0}; function kb(a,b,c){if(a=a.j[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function hb(a,b){for(var c in a.f)kb(a,c,null!=b?b:a.f[c])}function lb(a,b,c){if(a=a.j[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ib(a){for(var b in a.b)lb(a,b,a.b[b][1])}function mb(a,b,c,d){a.j[b]&&(void 0===c&&(Ya(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.F&&a.F.h||8)?ja(c,d):r(c,d),a.j[b].textContent!=c&&(a.j[b].textContent=c))} function cb(a,b){var c=a.b[b];lb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.B="EXAM"==b)}function db(a,b){var c=a.b[b];c[2]&&c[3]&&(lb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.Qc=function(a){a||this.a.o.R||(a=this.a,a.h.reset(),nb(a),bb(this,"ENABLE")&&ob(this.a))};h.Rc=function(){};h.Mc=function(a){a||G(this.a)}; h.Kc=function(a){if(!a&&!this.a.o.R)if(bb(this,"ENABLE"))ob(this.a);else{a=this.F;var b;if(b=a)a.o.Fa&&(a.o.Gb=!0),b=!a.o.Fa;if(b)Wa(a,!0),a.wb(0,null),Wa(a,!1);else try{var c=this.a.wb(1);0a;a++)this.b["S"+a][1]=0&1<a.a.Qa?8:16,c=65472<=a.ia&&a.ia<65472+b,b=c?1:2,c=c?15:a.h.Ca;bb(a,"STEP")||(b=-b);xb(a,a.ia&~c|a.ia+b&c)}function xb(a,b){a.ia=b&a.h.Ca;b=a.ia;for(var c=0;22>c;c++)yb(a,"A"+c,b&1<c;c++)yb(a,"D"+c,b&1<>2;this.l=this.c-1;this.v=this.w/this.c|0;this.Ba=[];this.m=0;this.s=!1;this.A=[];this.wc=[Cb,Db,Eb,Fb];a=new H(this);Gb(a,this.F);this.h=Array(this.v);this.f=Array(this.v);for(b=0;b>>this.b;this.B=0;this.i=this.Ca;F(this)}A(Ab); var Bb=8192,Jb=Bb-1;function Cb(a,b){var c=-1,d=this.controller,e=d.Ba[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.Ba[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;I(d,b,16);return 255} function Db(a,b,c){var d=!1,e=this.controller,f=e.Ba[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.Ba[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||I(e,c,16)}function Eb(a,b){var c=-1,d=this.controller;a=d.Ba[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;I(d,b,16);return 65535} function Fb(a,b,c){var d=!1,e=this.controller;a=e.Ba[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||I(e,c,16)}function Kb(a,b){if(b!=a.B){for(var c=0;c>>a.b,a.f[a.I]=a.h[a.G])}}Ab.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.Ea)return l.ib+=l.Ea-f,l.Ea=f,!0;if(f>=l.Ea+l.ib){p=l.size-(f-n);p>g&&(p=g);l.ib=f-l.Ea+p;f=n+a.c;g-=p;k++;continue}}return Lb(1,f,g)}f=new H(a,f,p,a.c,d,e);Gb(f,a.F,l);a.h[k++]=f;f=n+a.c;g-=p}return 0>=g?(a.status((c>>10)+"Kb "+Mb[d]+" at "+ja(b)),!0):Lb(2,b,c)}function Nb(a,b){return a.f[(b&a.i)>>>a.b].Kb(b&a.l,b)} function Ob(a,b){return a.f[(b&a.i)>>>a.b].X(b&a.l,b)}function wb(a,b){a.s=!1;a.m++;b=a.h[(b&a.Ca)>>>a.b].bc(b&a.l,b);a.m--;return b}function Pb(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].Ob(b&a.l,c&255,b);a.m--}function Qb(a,b,c){a.f[(b&a.i)>>>a.b].yb(b&a.l,c&65535,b)}function ub(a,b,c){a.s=!1;a.m++;a.h[(b&a.Ca)>>>a.b].hc(b&a.l,c&65535,b);a.m--} function Rb(a){for(var b=0,c=[],d=0;da.a.Qa)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,z=0;z>16&65535);a=a.Fb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.dd=function(){var a=this.a;a.Z&57344||(a.Hb=a.A&65535);return a.Hb};h.ed=function(){return this.a.Da};h.de=function(a){var b=this.a;1170>b.Qa&&(a&=-49);b.Da!=a&&(b.Da=a,b.Xa=a&16?4194303:262143,cc(b))};h.Nd=function(a){a=a>>1&63;var b=this.a.hb[a>>1];return a&1?b>>16:b&65535}; h.Le=function(a,b){b=b>>1&63;var c=b>>1;this.a.hb[c]=b&1?this.a.hb[c]&65535|(a&63)<<16:this.a.hb[c]&-65536|a&65534};h.Gd=function(a){return this.a.H[1][a>>1&7]};h.Ee=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.Ed=function(a){return this.a.H[1][(a>>1&7)+8]};h.Ce=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.Fd=function(a){return this.a.ca[1][a>>1&7]};h.De=function(a,b){b=b>>1&7;this.a.ca[1][b]=a;this.a.H[1][b]&=65295};h.Dd=function(a){return this.a.ca[1][(a>>1&7)+8]}; h.Be=function(a,b){b=(b>>1&7)+8;this.a.ca[1][b]=a;this.a.H[1][b]&=65295};h.Zc=function(a){return this.a.H[0][a>>1&7]};h.$d=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Xc=function(a){return this.a.H[0][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};h.Yc=function(a){return this.a.ca[0][a>>1&7]};h.Zd=function(a,b){b=b>>1&7;this.a.ca[0][b]=a;this.a.H[0][b]&=65295};h.Wc=function(a){return this.a.ca[0][(a>>1&7)+8]};h.Xd=function(a,b){b=(b>>1&7)+8;this.a.ca[0][b]=a;this.a.H[0][b]&=65295}; h.Md=function(a){return this.a.H[3][a>>1&7]};h.Ke=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.Kd=function(a){return this.a.H[3][(a>>1&7)+8]};h.Ie=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.Ld=function(a){return this.a.ca[3][a>>1&7]};h.Je=function(a,b){b=b>>1&7;this.a.ca[3][b]=a;this.a.H[3][b]&=65295};h.Jd=function(a){return this.a.ca[3][(a>>1&7)+8]};h.He=function(a,b){b=(b>>1&7)+8;this.a.ca[3][b]=a;this.a.H[3][b]&=65295};h.Sa=function(a){a&=7;return this.a.D&2048?this.a.Ja[a]:this.a.g[a]}; h.Ua=function(a,b){b&=7;this.a.D&2048?this.a.Ja[b]=a:this.a.g[b]=a};h.kd=function(){return this.a.D&49152?this.a.pa[0]:this.a.g[6]};h.ie=function(a){this.a.D&49152?this.a.pa[0]=a:this.a.g[6]=a};h.nd=function(){return this.a.g[7]};h.le=function(a){this.a.g[7]=a};h.Ta=function(a){a&=7;return this.a.D&2048?this.a.g[a]:this.a.Ja[a]};h.Va=function(a,b){b&=7;this.a.D&2048?this.a.g[b]=a:this.a.Ja[b]=a};h.ld=function(){return 1==(this.a.D&49152)>>14?this.a.g[6]:this.a.pa[1]}; h.je=function(a){1==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.pa[1]=a};h.md=function(){return 3==(this.a.D&49152)>>14?this.a.g[6]:this.a.pa[3]};h.ke=function(a){3==(this.a.D&49152)>>14?this.a.g[6]=a:this.a.pa[3]=a};h.Vc=function(a){return this.a.ec[a-65504>>1]};h.Wd=function(a,b){this.a.ec[b-65504>>1]=a};h.ac=function(a){return 65520==a?(Sb(this.h)>>6)-1:0};h.gc=function(){};h.Id=function(){return 1};h.Ge=function(){};h.Uc=function(){return this.a.Y};h.Vd=function(){this.a.Y=0};h.ad=function(){return this.a.dc}; h.be=function(a,b){b&1||(a&=255);this.a.dc=a};h.fd=function(a,b){return b?0:this.a.vb};h.ee=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1);b.u|=1}b.vb=a};h.Hd=function(a,b){return b?0:this.a.gb&65280};h.Fe=function(a){this.a.gb=a|255};h.jd=function(){return dc(this.a)};h.he=function(a){ec(this.a,a&-1793|dc(this.a)&1792);this.a.u|=256};h.fc=function(){}; var L={},$b=(L[61568]=[null,null,K.prototype.Nd,K.prototype.Le,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Gd,K.prototype.Ee,"SIPDR",8,1145,64],L[62608]=[null,null,K.prototype.Ed,K.prototype.Ce,"SDPDR",8,1145,64],L[62624]=[null,null,K.prototype.Fd,K.prototype.De,"SIPAR",8,1145,64],L[62640]=[null,null,K.prototype.Dd,K.prototype.Be,"SDPAR",8,1145,64],L[62656]=[null,null,K.prototype.Zc,K.prototype.$d,"KIPDR",8,1145,64],L[62672]=[null,null,K.prototype.Xc,K.prototype.Yd,"KDPDR",8,1145,64],L[62688]= [null,null,K.prototype.Yc,K.prototype.Zd,"KIPAR",8,1145,64],L[62704]=[null,null,K.prototype.Wc,K.prototype.Xd,"KDPAR",8,1145,64],L[62798]=[null,null,K.prototype.ed,K.prototype.de,"MMR3",1,1145,64],L[65382]=[null,null,K.prototype.$c,K.prototype.ae,"LKS"],L[65402]=[null,null,K.prototype.bd,K.prototype.ce,"MMR0",1,1145,64],L[65404]=[null,null,K.prototype.cd,K.prototype.fc,"MMR1",1,1145,64],L[65406]=[null,null,K.prototype.dd,K.prototype.fc,"MMR2",1,1145,64],L[65408]=[null,null,K.prototype.Md,K.prototype.Ke, "UIPDR",8,1145,64],L[65424]=[null,null,K.prototype.Kd,K.prototype.Ie,"UDPDR",8,1145,64],L[65440]=[null,null,K.prototype.Ld,K.prototype.Je,"UIPAR",8,1145,64],L[65456]=[null,null,K.prototype.Jd,K.prototype.He,"UDPAR",8,1145,64],L[65472]=[null,null,K.prototype.Sa,K.prototype.Ua,"R0SET0"],L[65473]=[null,null,K.prototype.Sa,K.prototype.Ua,"R1SET0"],L[65474]=[null,null,K.prototype.Sa,K.prototype.Ua,"R2SET0"],L[65475]=[null,null,K.prototype.Sa,K.prototype.Ua,"R3SET0"],L[65476]=[null,null,K.prototype.Sa, K.prototype.Ua,"R4SET0"],L[65477]=[null,null,K.prototype.Sa,K.prototype.Ua,"R5SET0"],L[65478]=[null,null,K.prototype.kd,K.prototype.ie,"R6KERNEL"],L[65479]=[null,null,K.prototype.nd,K.prototype.le,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ta,K.prototype.Va,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ta,K.prototype.Va,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ta,K.prototype.Va,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ta,K.prototype.Va,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ta, K.prototype.Va,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ta,K.prototype.Va,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.ld,K.prototype.je,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.md,K.prototype.ke,"R6USER",1,1145],L[65504]=[null,null,K.prototype.Vc,K.prototype.Wd,"CTRL",8,1170],L[65520]=[null,null,K.prototype.ac,K.prototype.gc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.ac,K.prototype.gc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Id,K.prototype.Ge,"SYSID",1,1170],L[65526]= [null,null,K.prototype.Uc,K.prototype.Vd,"CPUERR",1,1170],L[65528]=[null,null,K.prototype.ad,K.prototype.be,"MB",1,1170],L[65530]=[null,null,K.prototype.fd,K.prototype.ee,"PIR"],L[65532]=[null,null,K.prototype.Hd,K.prototype.Fe,"SL"],L[65534]=[null,null,K.prototype.jd,K.prototype.he,"PSW"],L); Ia(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),mc(this,ic?nc:oc);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},ka:function(a,b){a&1&&I(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},qa: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.ta=!0},G:function(a,b){return this.I(a,b)},T:function(a,b){return this.bc(a,b)},xa:function(a,b,c){this.l?this.f(a,b,c):this.Ob(a,b,c)},sa:function(a,b,c){this.l?this.f(a,b,c):this.hc(a,b,c)},B:function(a){return this.j[a]},J:function(a){return this.j[a]},S:function(a,b){a&1&&I(this.h,b,64);return this.c.getUint16(a,!0)},ja:function(a,b){a&1&&I(this.h,b,64);return this.s[a>>1]},wa:function(a,b){this.j[a]=b;this.ta=!0},ya:function(a,b){this.j[a]=b;this.ta=!0},ra:function(a,b,c){a&1&&I(this.h, c,64);this.c.setUint16(a,b,!0);this.ta=!0},za:function(a,b,c){a&1&&I(this.h,c,64);this.s[a>>1]=b;this.ta=!0}};function Gb(a,b,c){a.F=b;a.i=a.m=0;c&&((a.i=c.i)&&sc(a,tc,!1),(a.m=c.m)&&uc(a,tc,!1))}function uc(a,b,c){c&&a.m||(a.xb=!a.l&&b[1]||a.f,a.yb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ob=b[1]||a.f,a.hc=b[3]||a.A}function sc(a,b,c){c&&a.i||(a.Kb=b[0]||a.v,a.X=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.bc=b[2]||a.w}function mc(a,b){b||(b=vc);sc(a,b,void 0);uc(a,b,void 0)} var vc=[],pc=[H.prototype.L,H.prototype.qa,H.prototype.ka,H.prototype.Aa],tc=[H.prototype.G,H.prototype.xa,H.prototype.T,H.prototype.sa];if(Za)var oc=[H.prototype.B,H.prototype.wa,H.prototype.S,H.prototype.ra],nc=[H.prototype.J,H.prototype.ya,H.prototype.ja,H.prototype.za]; function wc(a,b){x.call(this,"CPU",a,wc,1);b=a.cycles||b;var c=a.multiplier||1;this.Ab=0;this.ob=b;this.ra=c;this.zb=Math.round(this.ob/1E4)/100;this.Ka=this.zb*this.ra;this.o.R=!1;this.o.Mb=!1;this.o.cb=a.autoStart;this.o.rb=!1;this.mb=this.La=0;this.nb=a.csStart;this.Ya=a.csInterval;this.Za=a.csStop;this.L=[];this.$b=this.Rd.bind(this);F(this)}A(wc);var xc=["power","reset"];h=wc.prototype; h.fa=function(a,b,c,d){this.l=a;this.h=b;this.F=d;this.w=a.w;for(b=0;b=a.La&&(a.La+=a.Ya,c=!0);0<=a.Za&&a.Za<=Bc(a)&&(a.Ya=a.Za=-1,Ac(a),G(a),c=!0);c&&a.V(Bc(a)+" cycles: checksum="+r(a.mb))}} h.aa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.j[b]=c,!0;case "run":return this.j[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.o.P)a=!0;else{var b=null,c,k=B(a.id);for(c=0;ca.Aa/a.Ka&&(b=1);a.ra=b;b=a.zb*a.ra;if(a.Ka!=b){a.Ka=b;b=a.Ka.toFixed(2)+"Mhz";var d=a.j.setSpeed;d&&(d.textContent=b);a.V("target speed: "+b)}c&&a.l&&Ec(a.l)}qb(a,a.ka);a.ka=0;a.ja=qa();a.ya=0;Dc(a)}function Wb(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.ob*a.ra/1E3*c|0,a.o.R&&(c+=Fc(a)),a.L[b][0]=c)} function pb(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.qa-=a.a;a.a=a.J=0;b&&(a.qa=0);return c} h.Rd=function(){if(this.o.R){this.Db>=this.ob&&Dc(this,!0);this.ab=0;this.lb=qa();if(this.ya){var a=this.lb-this.ya;a>this.Xb&&(this.ja+=a,this.ja>this.lb&&(this.ja=this.lb))}try{do{for(var b,c=this.o.rb?1:this.pb,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.wb(b)}catch(f){if("number"!=typeof f)throw f;}b=Fc(this,!0);this.ab+=b;this.ka+=b;rb(this,b);pb(this,b);this.$a-=b;if(0>=this.$a){this.$a+=this.pb;15<=++this.Yb&&(this.va(),this.Yb=0);break}}while(this.o.R)}catch(f){G(this); this.l&&this.l.stop(qa(),Bc(this));Ya(this,f.stack||f.message);return}if(this.o.R){a=setTimeout;b=this.$b;this.ya=qa();c=this.Xb;this.ab&&(c=Math.round(c*this.ab/this.pb));c-=this.ya-this.lb;if(d=this.ya-this.ja)this.Aa=Math.round(this.ka/(10*d))/100,864E5<=d&&(this.sa=0,Cc(this));if(0>c||this.Aac&&(this.ja-=c),c=0;this.Db+=this.ab;this.ya+=c;a(b,c)}}}; function ob(a){var b;a.o.error?(a.V(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.o.R)a.V(a.toString()+" busy");else{Cc(a);a.o.R=!0;a.o.Mb=!0;if(b=a.j.run)b.textContent="Halt";a.l&&a.l.start(a.ja,Bc(a));setTimeout(a.$b,0)}}h.wb=function(){return 0};function G(a){var b=!1;if(a.o.R){Fc(a);qb(a,a.ka);a.ka=0;a.o.R=!1;if(b=a.j.run)b.textContent="Run";a.l&&a.l.stop(qa(),Bc(a));b=!0}a.o.complete=void 0;return b} function Gc(a){this.Qa=+a.model||1170;this.Tb=a.addrReset||0;wc.call(this,a,6666667);this.qb=0;this.Vb=255;1120==this.Qa?(this.decode=Hc.bind(this),this.za=this.Ac,this.qb=8,this.Vb=-1):(this.decode=Ic.bind(this),this.za=this.Bc);Jc(this);this.Ma=0;this.I=null;this.o.complete=!1}A(Gc,wc);h=Gc.prototype;h.reset=function(){this.status("model "+this.Qa);this.o.R&&G(this);Jc(this);zc(this);this.o.error=!1;this.parent.reset.call(this)}; function Jc(a){a.m=65536;a.f=32768;a.i=65535;a.s=32768;a.D=15;a.g=[0,0,0,0,0,0,0,a.Tb,-1,-2,-3,-4,-5,-6,-7,-8];a.Ja=[0,0,0,0,0,0];a.pa=[0,0,0,0];a.v=0;a.kb=0;a.Ic=[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.ca=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.hb=[0,0,0,0,0,0,0,0,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.ec=[0,0,0,0,0,0,0,0];a.dc=0;a.u=0;a.B=a.G=0;a.c=a.b=a.Cb=0;a.Na=-1;nb(a)}function nb(a){a.Z=0;a.Fb=0;a.Hb=0;a.Da=0;a.Y=0;a.vb=0;a.gb=255;a.Wa=0;a.jb=0;a.Xa=262143;a.bb=0;a.A=0;a.I=null;a.h&&(cc(a),a.Gc=Sb(a.h))}function cc(a){a.Wa?(a.T=65536,a.Bb=a.Da&16?4186112:253952,a.S=a.Ec,a.X=a.Od,a.yb=a.Me,Kb(a.h,a.Da&16?22:18)):(a.T=0,a.Bb=57344,a.S=a.Dc,a.X=a.cc,a.yb=a.ic,Kb(a.h,16))} function bc(a,b){b&=-3073;if(a.Z!=b){b&57344&&!(a.Z&57344)&&(a.Fb=a.A>>16&65535,a.Hb=a.A&65535);a.Z=b;a.jb=b>>5&3;a.kb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.Wa!=c&&(a.Wa=c,cc(a))}}h.Wb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.sa,this.ra]);a.set(2,Rb(this.h));return a.data()}; h.restore=function(a){var b=a[1];this.sa=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.v!=c&&(a.pa[c]=a.g[6],a.g[6]=a.pa[a.v]);a.D=b;a.u&=-3;a.u|=a.I?2:1}function R(a,b){a.u&256||(a.s=a.i=b,a.f=0)} function Oc(a,b,c){a.u&256||(a.s=a.i=a.m=b,a.f=c||0)}function Pc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.f=(c^b)&(d^b))}function Qc(a,b){a.u&256||(a.s=a.i=a.m=b,a.f=a.s^a.m>>1)}function Rc(a,b,c,d){a.u&256||(a.s=a.i=a.m=b,a.f=(c^d)&(d^b))} function J(a,b,c,d){if(!a.Ma){0>a.Na?a.Na=dc(a):a.v||(d=-3);var e=!1;-3==d&&(b=4,a.Y|=4,a.g[6]=4,e=!0);a.A=b|4143316992;a.v=0;var f=a.X(b|a.T),g=a.X(b+2&65535|a.T);ec(a,g&-12289|a.Na>>2&12288);Sc(a,a.Na,e);Sc(a,a.g[7],e);Q(a,f);a.a-=5;a.u&=~(c|19);a.u|=129;a.Na=-1;if(-3<=d)throw b;}}function Tc(a){var b=Uc(a),c=Uc(a)&-1793;a.D&49152&&(c=c&-225|a.D&63712);Q(a,b);ec(a,c);a.u&=-17}function Vc(a,b){var c=b>>13&31;31>c&&(b=a.Da&32?a.hb[c]+(b&8190)&4194302:b&-3932161);return b} function vb(a,b,c){var d,e,f;if(!(c&a.Wa))return f=b&65535,57344<=f&&(f|=a.Bb),f;d=b>>13;a.Da&a.Ic[a.v]||(d&=7);e=a.H[a.v][d];f=(a.ca[a.v][d]<<6)+(b&8191)&a.Xa;3932160<=f&&(f=Vc(a,f));if(a.Ma)return f;f>=a.Gc&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&& (g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Xa)||a.v)a.jb=a.v,a.kb=d;g&&(g&57344&&(0<=a.Na&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.jb<<5|a.kb<<1,bc(a,a.Z&-61695|g&61694)),J(a,168,64,-1)),a.Z&61440||!(f<(4191360&a.Xa)||f>(4194239&a.Xa))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Uc(a){var b=a.X(a.g[6]|a.T);a.g[6]=a.g[6]+2&65535;return b}function Sc(a,b,c){var d=a.g[6]-2&65535;a.g[6]=d;a.A=a.A&65535|(a.A&-65536)<<8|16121856;c||a.za(4,-2,d);a.yb(d,b)} function Wc(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.za(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.za(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.X(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.za(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.X(e)|g;a.a-=8;break;case 6:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,6==c&&a.za(d,0, e),a.a-=6,e|g;case 7:return e=a.X(Mc(a,2)),e=e+a.g[c]&65535,e=a.X(e|a.T),a.a-=10,e|g}a.g[c]=a.g[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Ac=function(a,b,c){!this.v&&0>=b&&c<=this.gb&&(this.u|=32)};h.Bc=function(a,b,c){this.v||(65534<=c&&(c|=-65536),a&4&&c<=this.gb&&(c<=this.gb-32?J(this,4,0,-3):(this.Y|=8,this.u|=32)))};h.Dc=function(a,b,c){a=Wc(this,a,b,c);3932160<=a&&(a=Vc(this,a));return a};h.Ec=function(a,b,c){return vb(this,Wc(this,a,b,c),c)}; h.cc=function(a){3932160<=a&&(a=Vc(this,a));return Ob(this.h,this.bb=a)};h.Od=function(a){return Ob(this.h,this.bb=vb(this,a,2))};h.ic=function(a,b){3932160<=a&&(a=Vc(this,a));Qb(this.h,this.bb=a,b&65535)};h.Me=function(a,b){Qb(this.h,this.bb=vb(this,a,4),b)};function Xc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Wc(a,b,d,2),c&65536||61440!==(a.D&61440)&&(d&=65535),a.v=a.D>>12&3,c=a.X(d|c&a.T),a.v=a.D>>14&3):c=6!=d||(a.D>>2&12288)===(a.D&12288)?a.g[d]:a.pa[a.D>>12&3];return c} function Yc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Wc(a,b,e,4),c&65536||(e&=65535),a.v=a.D>>12&3,e=vb(a,e|c&65536,4),a.v=a.D>>14&3,Qb(a.h,e,d)):6!=e||(a.D>>2&12288)===(a.D&12288)?a.g[e]=d:a.pa[a.D>>12&3]=d}function Zc(a,b){b>>=6;var c=a.G=b&7;(b=a.B=(b&56)>>3)?(c=a.S(b,c,3),a=Nb(a.h,c)):a=a.g[c+a.qb]&a.Vb;return a}function $c(a,b){b>>=6;var c=a.G=b&7;return(b=a.B=(b&56)>>3)?Ob(a.h,a.S(b,c,2)):a.g[c+a.qb]} function ad(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Wc(a,b,c,8)}function bd(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.S(b,c,3),a=Nb(a.h,c)):a=a.g[c]&255;return a}function cd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Ob(a.h,a.S(b,c,2)):a.g[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Cb=a.S(b,e,7),c=0>c?a.g[-c-1]&255:c,c=d.call(a,c,Nb(a.h,e)),e&1&&a.a--,a=a.h,a.f[(e&a.i)>>>a.b].xb(e&a.l,c&255,e)):(b=a.g[e],c=0>c?a.g[-c-1]&255:c,a.g[e]=b&65280|d.call(a,c,b&255))} function U(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.S(b,e,6),Qb(a.h,e,d.call(a,0>c?a.g[-c-1]:c,Ob(a.h,e)))):a.g[e]=d.call(a,0>c?a.g[-c-1]:c,a.g[e])}function dd(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,e,5),e=c=0>c?a.g[-c-1]&255:c,d&1&&a.a--,a=a.h,a.f[(d&a.i)>>>a.b].xb(d&a.l,e&255,d)):c?(c=0>c?a.g[-c-1]&255:c,a.g[e]=a.g[e]&~d|c<<24>>24&d):a.g[e]&=~d;return c} function ed(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.S(b,d,4),Qb(a.h,d,c=0>c?a.g[-c-1]:c)):a.g[d]=c=0>c?a.g[-c-1]:c;return c}function V(a,b,c){c&&(Q(a,a.g[7]+(b<<24>>23)),a.a-=2);a.a-=3} h.wb=function(a){this.o.complete=!0;var b=a?this.o.Mb?0:1:-1;this.o.Mb=!1;this.qa=this.a=a;do{if(this.u){if(a=this.u&11){a=!1;if(this.u&2){var c=160,d=(this.vb&224)>>5,e=this.I&&this.I.Ra>d?this.I:null;e&&(c=e.Td,d=e.Ra);d>(this.D&224)>>5?(this.u&8&&(Mc(this,2),this.u&=-9),J(this,c,0,-9),d=!0):d=!1;d&&(e&&ac(this,e),a=!0);this.I||this.vb||(this.u&=-3)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Nc(this)&&0>b)break}this.u=this.u&15|this.D&16;this.decode(Lc(this))}while(0>1|b<<16;Qc(this,a);return a&65535} function kd(a,b){a=b&128|b>>1|b<<8;Qc(this,a<<8);return a&255}function ld(a,b){a=b&~a;R(this,a);return a}function md(a,b){a=b&~a;R(this,a<<8);return a}function nd(a,b){a|=b;R(this,a);return a}function od(a,b){a|=b;R(this,a<<8);return a}function pd(a,b){a=~b|65536;Oc(this,a);return a&65535}function qd(a,b){a=~b|256;Oc(this,a<<8);return a&255}function rd(a,b){a=b-a;this.u&256||(this.s=this.i=a,this.f=b&(b^a));return a&65535} function sd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&256||(this.s=this.i=c,this.f=b&(b^c));return a&255}function td(a,b){a=b+a;this.u&256||(this.s=this.i=a,this.f=a&(b^a));return a&65535}function ud(a,b){a=b+a;var c=a<<8;this.u&256||(this.s=this.i=c,this.f=c&(b<<8^c));return a&255}function vd(a,b){a=-b;Oc(this,a,a&b&32768);return a&65535}function wd(a,b){a=-b;Oc(this,a<<8,(a&b&128)<<8);return a&255}function xd(a,b){a=b<<1|this.m>>16&1;Qc(this,a);return a&65535} function yd(a,b){a=b<<1|this.m>>16&1;Qc(this,a<<8);return a&255}function zd(a,b){a=(this.m&65536|b)>>1|b<<16;Qc(this,a);return a&65535}function Ad(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Qc(this,a<<8);return a&255}function Bd(a,b){var c=b-a;Rc(this,c,a,b);return c&65535}function Cd(a,b){var c=b-a;Rc(this,c<<8,a<<8,b<<8);return c&255}function Dd(a,b){this.u&256||(this.s=this.i=b&65280,this.f=this.m=0);return(b<<8|b>>8)&65535}function Ed(a,b){a^=b;R(this,a);return a&65535} function Fd(a){U(this,a,$c(this,a),fd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Gd(a){var b=cd(this,a);a=a>>6&7;var c=this.g[a];c&32768&&(c|=4294901760);this.m=this.f=0;b&=63;if(b&32)b=64-b,16>=b;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 Hd(a){var b=cd(this,a);a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=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 Id(a){V(this,a,!P(this))}function Jd(a){V(this,a,P(this))} function Kd(a){U(this,a,$c(this,a),ld);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Ld(a){S(this,a,Zc(this,a),md);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Md(a){U(this,a,$c(this,a),nd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function Nd(a){S(this,a,Zc(this,a),od);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)} function Od(a){var b=$c(this,a);a=cd(this,a);R(this,(0>b?this.g[-b-1]:b)&a);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Pd(a){var b=Zc(this,a);a=bd(this,a);R(this,((0>b?this.g[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function Qd(a){V(this,a,this.i&65535?0:4)}function Rd(a){V(this,a,!Kc(this)==!(this.f&32768))}function Sd(a){V(this,a,!!(this.i&65535)&&!Kc(this)==!(this.f&32768))} function Td(a){V(this,a,!P(this)&&!!(this.i&65535))}function Ud(a){V(this,a,(this.i&65535?0:4)||!Kc(this)!=!(this.f&32768))}function Vd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Wd(a){V(this,a,!Kc(this)!=!(this.f&32768))}function Xd(a){V(this,a,Kc(this))}function Yd(a){V(this,a,!!(this.i&65535))}function Zd(a){V(this,a,!Kc(this))}function $d(){J(this,12,0,-8)}function ae(a){V(this,a,!0)}function be(a){V(this,a,!(this.f&32768))}function ce(a){V(this,a,this.f&32768?2:0)} function W(a){a&1&&(this.m=0);a&2&&(this.f=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function de(a){var b=$c(this,a);a=cd(this,a);var c=(b=0>b?this.g[-b-1]:b)-a;Rc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)}function ee(a){var b=Zc(this,a);a=bd(this,a);var c=(b=(0>b?this.g[-b-1]&255:b)<<8)-(a<<=8);Rc(this,c,a,b);this.a-=this.c?4+(this.G&&6<=this.b?1:0):(this.B?4:3)+(7==this.b?2:0)} function fe(a){var b=cd(this,a);if(b){a=a>>6&7;var c=this.g[a]<<16|this.g[a|1];this.m=this.f=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.g[a]=d&65535,this.g[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.f=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.g[a]&&(this.g[a]=this.g[a|1]=1));this.a-=53}else this.i=this.s=0,this.f=32768,this.m=65536,this.a-=7}function ge(){J(this,24,0,-8);this.a-=20} function he(){this.D&49152?(this.Y|=128,J(this,4,0,-7)):(this.w&&1120==this.Qa&&this.w.setData(this.g[0],!0),this.F?this.F.b():G(this));this.a-=7}function ie(){J(this,16,0,-8);this.a-=20}var je=[0,7,7,10,7,11,9,13];function ke(a){this.J=this.a;Q(this,ad(this,a));this.a=this.J-je[this.c]}var le=[0,14,14,17,14,18,16,20];function me(a){this.J=this.a;var b=ad(this,a);a=a>>6&7;Sc(this,this.g[a]);this.g[a]=this.g[7];Q(this,b);this.a=this.J-le[this.c]}var ne=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function oe(a){var b=$c(this,a);this.J=this.a;R(this,ed(this,a,b));this.a=this.J-ne[(this.B?8:0)+this.c]+(7!=this.b||this.c?0:2)}function pe(a){var b=Zc(this,a);R(this,dd(this,a,b,65535)<<8);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}var qe=[7,13,13,17,14,18,17,21]; function re(a){var b=cd(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.u&256||(this.s=b>>16,this.i=this.s|b,this.f=0,this.m=-32768>b||32767>6;if(this.g[b]=this.g[b]-1&65535)Q(this,this.g[7]-((a&63)<<1)),this.a+=1;this.a-=6}function xe(a){U(this,a,$c(this,a),Bd);this.a-=this.c?9+(this.G&&6<=this.b?1:0):(this.B?5:3)+(7==this.b?2:0)}function ye(a){U(this,a,0,Dd);this.a-=this.c?9:3+(7==this.b?2:0)}function ze(){J(this,28,0,-8)} function Ae(){this.w&&(this.w.ia=this.g[7],this.w.setData(this.g[0],!0));this.u|=8;Mc(this,-2);this.a-=3}function Be(a){U(this,a,this.g[(a>>6&7)+this.qb],Ed);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){J(this,8,0,-8)}function Hc(a){Ce[a>>12].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>>6&3].call(this,a)}function Je(a){Ke[a&15].call(this,a)}function Le(a){Me[a&15].call(this,a)}function Ne(a){Oe[a>>6&3].call(this,a)} function Pe(a){Qe[a>>6&3].call(this,a)}function Re(a){Se[a>>6&3].call(this,a)} var Ce=[function(a){Te[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,Fd,Y,function(a){Ue[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,xe,Y],Te=[function(a){Ve[a>>4&15].call(this,a)},ae,Yd,Qd,Rd,Wd,Sd,Ud,me,me,De,Fe,He,Y,Y,Y],Ee=[function(a){Oc(this,ed(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,1,td);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)}],Ge=[function(a){U(this,a,0, vd);this.a-=this.c?11:6},function(a){U(this,a,P(this)?1:0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,P(this)?1:0,Bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=cd(this,a);Oc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ie=[function(a){U(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){U(this,a,0,jd);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)}], Ve=[function(a){We[a&15].call(this,a)},Y,Y,Y,ke,ke,ke,ke,ue,Y,Je,Le,ye,ye,ye,ye],We=[he,Ae,ve,$d,ie,te,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ke=[se,function(){this.m=0;this.a-=5},function(){this.f=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Me=[se,function(){this.m=65536;this.a-=5},function(){this.f=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Ue=[Zd,Xd,Td,Vd,be,ce,Id,Jd,ge,ze,Ne,Pe,Re,Y,Y,Y],Oe=[function(a){Oc(this, dd(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,sd);this.a-=this.c?9:3+(7==this.b?2:0)}],Qe=[function(a){S(this,a,0,wd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,gd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,Cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bd(this,a);Oc(this,a<<8);this.a-=this.c?4:3+(7== this.b?2:0)}],Se=[function(a){S(this,a,0,Ad);this.a-=this.c?9+(this.Cb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,kd);this.a-=this.c?9+(this.Cb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,id);this.a-=this.c?9:3+(7==this.b?2:0)}];function Ic(a){Xe[a>>12].call(this,a)} var Xe=[function(a){Ye[a>>8&15].call(this,a)},oe,de,Od,Kd,Md,Fd,function(a){Ze[a>>8&15].call(this,a)},function(a){$e[a>>8&15].call(this,a)},pe,ee,Pd,Ld,Nd,xe,Y],Ye=[function(a){af[a>>4&15].call(this,a)},ae,Yd,Qd,Rd,Wd,Sd,Ud,me,me,De,Fe,He,function(a){bf[a>>6&3].call(this,a)},Y,Y],bf=[function(a){a=this.g[7]+((a&63)<<1)&65535;var b=this.X(a|this.T);Q(this,this.g[5]);this.g[6]=a+2&65535;this.g[5]=b;this.a-=8},function(a){a=Xc(this,a,0);Sc(this,a);R(this,a);this.a-=11},function(a){var b=Uc(this);this.J= this.a;Yc(this,a,0,b);R(this,b);this.a=this.J-qe[this.c]},function(a){R(this,ed(this,a,Kc(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],af=[function(a){cf[a&15].call(this,a)},Y,Y,Y,ke,ke,ke,ke,ue,function(a){a&8?(this.D&49152||(this.D=this.D&-2017|(a&7)<<5,this.u|=1,this.u&=-3),this.a-=5):J(this,8,0,-8)},Je,Le,ye,ye,ye,ye],cf=[he,Ae,function(){Tc(this);this.u|=this.D&16;this.a-=13},$d,ie,te,ve,function(){J(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ze=[re,re,fe,fe,Gd,Gd,Hd,Hd,Be,Be,Y,Y,Y,Y,we,we],$e=[Zd, Xd,Td,Vd,be,ce,Id,Jd,ge,ze,Ne,Pe,Re,function(a){df[a>>6&3].call(this,a)},Y,Y],df=[Y,function(a){a=Xc(this,a,65536);Sc(this,a);R(this,a);this.a-=11},function(a){var b=Uc(this);this.J=this.a;Yc(this,a,65536,b);R(this,b);this.a=this.J-qe[this.c]},Y]; function ef(a){x.call(this,"ROM",a,ef,128);this.ba=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.f=a.alias;this.l=a.file;this.s=t(this.l);if(this.l){a=this.l;var b=ka(this.s);"json"!=b&&"hex"!=b&&(a=ta()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;v(a,null,!0,function(a,b,f){f?(c.C("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ta(c.xa,a,b),(a=sa(a,b))?(c.c=a.M,c.ba=a.ba):c.l=null);ff(c)})}}A(ef);h=ef.prototype; h.fa=function(a,b,c,d){this.h=b;this.a=c;this.F=d;ff(this)};h.ha=function(){this.ba&&(this.F&&this.F.a(this.id,this.i,this.b,this.ba),delete this.ba);return!0};h.ga=function(){return!0}; function ff(a){if(!Xa(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Ya(a,"ROM size ("+r(a.c.length,8,!0)+") does not match specified size ("+r(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ja(b));if(57344<=b&&b<57344+Bb){var c={};b=(c[b]=[ef.prototype.Cd,ef.prototype.Ae,null,null,null,a.b>>1],c);if(eb(a.h,a,b)){b=a.m=!0;break a}}else if(Hb(a.h,b,a.b,lc)){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,z=n-=6;0=b.length)break;l+=b[k++]&255;if(l&255)break;if(z)for(;z--;)Pb(a.h,p++,b[u++]&255);else p&1?G(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.Pb&&c<=m.vc&&(b=c-(m.Pb-m.jc));b&&(a.preventDefault&&a.preventDefault(),d.ub(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==m.lc&&(b=m.kc);d.ub(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.ub(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;var e=this;this.T=Zb(48,4,262144);this.L=Wb(this.a,function(){var a;a=-1;e.s.length&&(a=e.s.shift()&255,e.S&&97<=a&&122>a&&(a-=32),Yb(e.a,e.L,1E3/Math.round(e.G/10)));0<=a&&(e.w=a,e.b&128?e.w|=49152:e.b|=128,e.b&64&&Xb(c,e.T))});this.B=Zb(52,4,262144);this.ka=Wb(this.a,function(){e.c|=128;e.c&64&&Xb(c,e.B)});eb(b,this,mf);gb(b,this.reset.bind(this));F(this)}; h.Zb=function(){if(!this.v){var a=yc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.wa)return;b=oa(b[1]);if(this.v=Ua(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.xa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ha=function(a,b){if(!b)if(this.Zb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; h.ga=function(a){return a?this.save():!0};h.reset=function(){nf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return nf(this)};function nf(a){a.w=0;a.b=0;a.c=128;a.s=[];return!0}h.ub=function(a){if("number"==typeof a)this.s.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.J||8,c=a-this.m%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.m&&c&&(b=String.fromCharCode(this.I)+b);this.f.value+=b;this.f.scrollTop=this.f.scrollHeight;this.m+=c}}else if(null!=this.i){if(10==a|| 1024<=this.i.length)this.V(this.i),this.i="";10!=a&&(this.i+=String.fromCharCode(a))}Yb(this.a,this.ka,1E3/Math.round(this.ja/10));this.c&=-129};var of={},mf=(of[65392]=[null,null,Z.prototype.pd,Z.prototype.ne,"RCSR"],of[65394]=[null,null,Z.prototype.od,Z.prototype.me,"RBUF"],of[65396]=[null,null,Z.prototype.Qd,Z.prototype.Oe,"XCSR"],of[65398]=[null,null,Z.prototype.Pd,Z.prototype.Ne,"XBUF"],of); Ia(function(){for(var a=E(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.j[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.j[b]=c,c.onclick= function(){var a=d.j.listTapes;a&&rf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.G){c.parentNode.removeChild(c);break}this.j[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;rf(d,t(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.j[b]=c,!0}return!1}; h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;this.L=sf(a);var e=this;if((this.c=yc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.I=Zb(56,4,4096);this.T=Wb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.wc.indexOf("/api/v1/dump")&&(e=ka(c),f="json"==e||"gz"==e?encodeURI(c):ta()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!v(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.o.P;g?a.C('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ta(a.xa,e,f),(e=sa(e,f))&&Bf(a,b,c,d,e.M,e.ma,e.la)); a.o.Fa=!1;a.m&&(a.m--,a.m||F(a));yf(a)})}function vf(a,b,c,d){if((a=a.j.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.sb?"":e)+"&format=json"));return!!v(f, null,!0,function(b,c,d){If(a,b,c,d)})} function If(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.o.P;if(d)a.controller.C('Unable to load disk "'+a.na+'" (error '+d+": "+b+")",f);else{Ta(a.controller.xa,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)w(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 z=l.bytes;if(void 0!==z&&z.length){for(var T=n<<2,za=z.length;za>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.ea?f=a.oa+a.ea&&(a.ea+=f-(a.oa+a.ea)+1):(a.oa=f,a.ea=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.na+": "+c);return b}; h.toJSON=function(){var a;a=0;for(var b;b=Kf(this,a++);)Nf(b);a=JSON.stringify(this.a,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")}; function Nf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RK11",a,N,65536);this.w=a.autoMount||{};this.m=0;this.c=Array(8);this.A=!Ba("Mobi")&&window&&"FileReader"in window}A(N);h=N.prototype; h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("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.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Of(d,a)},!0;case "loadDrive":return this.j[b]= c,c.onclick=function(){var a=d.j.listDisks;a&&Pf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Mf(a),a.Lb.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.A)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Pf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if((a=yc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(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]);Qf(this);this.Oa=Zb(144,5,65536);eb(b,this,Rf);gb(b,this.reset.bind(this));Sf(this,"None","",!0);this.A&&Sf(this,"Local Disk","?");Sf(this,"Remote Disk","??");Tf(this)||F(this)}; h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Ib){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Of(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Qf(this)};h.save=function(){return(new O(this)).data()}; h.restore=function(a){return Qf(this,a[0])};function Tf(a,b){b||(a.m=0);for(var c in a.w){var d=a.w[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.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+'"')}Vf(a,e,b,c,!1,d)}else Uf(a,e)} function Vf(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,Uf(a,b,!0),k.Ha?a.C("RK11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.m++),k.ua=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.oc)&&g++));return g}h.oc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RK"+a.Ia)),b=null);b?(a.W=b,a.na=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RK"+a.Ia),a.Ga||e),this.l&&Ec(this.l)):a.ua=!1;a.Ga&&(a.Ga=!1,--this.m||F(this));Of(this,a.Ia)}; function Sf(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.v=65536-e&65535;a&&(this.i=this.i|a|32768,this.b|=49152);return!0}; h.pc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){if(!l){l=a.seek(b,c,d+1);if(!l){k=4096;break}n=0}var p,u;if(0>(p=a.read(l,n++))||0>(u=a.read(l,n++))){k=32;break}ub(this.h,f,p|u<<8);if(Vb(this.h)){k=1024;break}f+=2;if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)}; h.qc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=128,e=0);for(;e--;){var p=wb(this.h,f);if(Vb(this.h)){k=1024;break}f+=2;if(!l){l=a.seek(b,c,d+1,!0);if(!l){k=4096;break}n=0}if(!a.write(l,n++,p&255)||!a.write(l,n++,p>>8)){k=32;break}if(n>=a.U&&(l=null,++d>=a.N&&(d=0,++c>=a.O&&(c=0,++b>=a.K)))){k=64;break}}return g(k,b,c,d,e,f)};h.ud=function(){return this.B};h.se=function(){};h.vd=function(){return this.i};h.te=function(){};h.rd=function(){return this.b&61438}; h.pe=function(a){this.b=this.b&-3968|a&3967;if(this.b&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.c[a],e,f,g,k;this.b&=-129;switch(this.b&14){case 0:this.B=d.status;this.i=0;this.b=128;this.f=0;break;case 4:b=this.pc;case 2:b||(b=this.qc),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.K?(this.i|=32832,this.b|=49152):g>=d.N?(this.i|=32800,this.b|=49152):(k=(this.b&48)<<12|this.s,c=65536-this.v&65535,c=b.call(this,d,e,f,g,c,k,this.nc.bind(this)))}this.B=d.status|a<<13|this.f%9&15;c&&(this.b&= -2,this.b|=128,this.b&64&&Xb(this.a,this.Oa))}};h.wd=function(){return this.v};h.ue=function(a){this.v=a};h.qd=function(){return this.s};h.oe=function(a){this.s=a};h.sd=function(){return this.f};h.qe=function(a){this.f=a};h.td=function(){return this.G};h.re=function(a){this.G=a}; var Wf={},Rf=(Wf[65280]=[null,null,N.prototype.ud,N.prototype.se,"RKDS"],Wf[65282]=[null,null,N.prototype.vd,N.prototype.te,"RKER"],Wf[65284]=[null,null,N.prototype.rd,N.prototype.pe,"RKCS"],Wf[65286]=[null,null,N.prototype.wd,N.prototype.ue,"RKWC"],Wf[65288]=[null,null,N.prototype.qd,N.prototype.oe,"RKBA"],Wf[65290]=[null,null,N.prototype.sd,N.prototype.qe,"RKDA"],Wf[65294]=[null,null,N.prototype.td,N.prototype.re,"RKDB"],Wf); function M(a){x.call(this,"RL11",a,M,131072);this.A=a.autoMount||{};this.v=0;this.c=Array(4);this.B=!Ba("Mobi")&&window&&"FileReader"in window}A(M);h=M.prototype; h.aa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.j[b]=c,c.onchange=function(){var a=d.j.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){w("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.j[b]=c,c.onchange=function(){var a=q(c.value);null!=a&&Xf(d,a)},!0;case "loadDrive":return this.j[b]= c,c.onclick=function(){var a=d.j.listDisks;a&&Yf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.B){c.parentNode.removeChild(c);break}this.j[b]=c;c.onclick=function(){var a=d.j.listDrives;a&&a.options&&d.c&&((a=d.c[q(a.value)||0])?(a=a.W)?(a=Ca(Mf(a),a.Lb.replace(".json",".img")),w(a)):d.C("No disk loaded in drive."):d.C("No disk drive selected."))};return!0;case "mountDrive":if(this.B)return this.j[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled= !a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Yf(d,t(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; h.fa=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.F=d;if((a=yc(this.l,"autoMount"))&&"string"==typeof a)try{a=eval("("+a+")")}catch(f){w(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]);Zf(this);this.Oa=Zb(112,5,131072);eb(b,this,$f);gb(b,this.reset.bind(this));ag(this,"None","",!0);this.B&&ag(this,"Local Disk","?");ag(this,"Remote Disk","??");bg(this)||F(this)}; h.ha=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Ib){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Xf(this,0)}}return!0};h.ga=function(a){return a?this.save():!0};h.reset=function(){Zf(this)};h.save=function(){return(new O(this)).data()}; h.restore=function(a){return Zf(this,a[0])};function bg(a,b){b||(a.v=0);for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.j.listDisks)&&f.options)for(var g=0;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+'"')}dg(a,e,b,c,!1,d)}else cg(a,e)} function dg(a,b,c,d,e,f){var g=-1,k=a.c[b];k.da.toLowerCase()!=d.toLowerCase()&&(g++,cg(a,b,!0),k.Ha?a.C("RL11 busy"):(k.Ha=!0,e&&(k.Ga=!0,a.v++),k.ua=!!f,Hf(new Df(a,k,"preload"),c,d,f,a.sc)&&g++));return g}h.sc=function(a,b,c,d,e){a.Ha=!1;b&&(b.K>a.K||b.O>a.O)&&(this.C('Disk "'+c+'" too large for drive '+("RL"+a.Ia)),b=null);b?(a.W=b,a.na=c,a.da=d,this.C('Mounted disk "'+c+'" in drive '+("RL"+a.Ia),a.Ga||e),this.l&&Ec(this.l)):a.ua=!1;a.Ga&&(a.Ga=!1,--this.v||F(this));Xf(this,a.Ia)}; function ag(a,b,c,d){if((a=a.j.listDisks)&&a.options){for(var e=0;e>12&48;this.m=f>>16&63;this.i=this.f=b<<7|(c?64:0)|d&63;this.s=65536-e&65535;a&&(this.b=this.b|a|32768);return!0}; h.tc=function(a,b,c,d,e,f,g){var k=0;a=a.W;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}ub(this.h,Vc(this.a,f),p|u<<8);if(Vb(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.uc=function(a,b,c,d,e,f,g){var k=0;a=a.W;var l=null,n;a||(k=5120,e=0);for(;e--;){var p=wb(this.h,Vc(this.a,f));if(Vb(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.zd=function(){return this.b&65535}; h.xe=function(a){this.b=this.b&-1023|a&1022;this.m=this.m&60|(a&48)>>4;if(!(this.b&128)){var b;a=!0;var c=this.c[(this.b&768)>>8],d=c.W,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.tc;case 10:b||(b=this.uc),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.m&63)<<16|this.w,a=65536-this.s&65535,a=b.call(this,c,e,f,g,a,d,this.rc.bind(this)))}a&&(this.b|=129,this.b&64&&Xb(this.a,this.Oa))}};h.xd=function(){return this.w};h.ve=function(a){this.w=a&65534};h.Ad=function(){return this.f};h.ye=function(a){this.f=a};h.Bd=function(){return this.s};h.ze=function(a){this.s=a};h.yd=function(){return this.m};h.we=function(a){this.m=a&63;this.b=this.b&-49|(this.m&3)<<4}; var eg={},$f=(eg[63744]=[null,null,M.prototype.zd,M.prototype.xe,"RLCS"],eg[63746]=[null,null,M.prototype.xd,M.prototype.ve,"RLBA"],eg[63748]=[null,null,M.prototype.Ad,M.prototype.ye,"RLDA"],eg[63750]=[null,null,M.prototype.Bd,M.prototype.ze,"RLMP"],eg[63752]=[null,null,M.prototype.yd,M.prototype.we,"RLBE"],eg); function fg(a,b,c){x.call(this,"Computer",a,fg,33554432);this.o.P=!1;gg(this,b);this.A=yc(this,"autoPower",a);this.l=0;this.L=a.busWidth||a.buswidth;this.b=hg;this.s=null;this.i=this.I=!1;this.S=yc(this,"url")||"";(Math.random()+.1).toString(36);this.c=ig(this);if(this.a=Va("CPU",this.id)){this.F=Va("Debugger",this.id);this.h=new Ab({id:this.xa+".bus",busWidth:this.L},this.a,this.F);var d,e=B(this.id);if((this.w=Va("Panel",this.id))&&this.w.eb)for(b=0;b\nLicense: GPL version 3 or later ");this.V("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bhg){if(jg(d,this.s)){this.f=new O(this,"1.30.5","failsafe");jg(this.f)&&(og(this,d),a=2,pg(this.f));this.f.set("timestamp",ra());qg(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=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"== f&&"no machine state"!=g?(this.C("Error: "+g),"unable to verify user"==g&&(ya("user",""),this.c=null)):this.V(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.s;delete this.v}e=B(this.id);for(f=0;fa[1];a=a[2];this.T=!0;this.o.P=!0;var d=this.j.power;d&&(d.textContent="Shutdown");this.a&&(tg(this,this.a,b,c,a),this.va(),this.a.cb());this.G&&(og(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.l=0}; function og(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.S;d.user=c;d.type="bug";d.data=b;v("http://www.pcjs.org/api/v1/report",d,!0)}} function ug(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.5"),g=new O(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.ga&&(c&&G(a.a),d=a.a.ga(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.o.P=!1,!1===d&&(e=null)));for(var k=B(a.id),l=0;l=c||30<=(b.Ab+=c))&&(d.textContent=b.o.R?b.Aa.toFixed(2)+"Mhz":"Stopped",b.Ab=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.o.R;d=!!(b.a.u&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+"...");v(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);Bg(a,b,c)}})}else c(a,null)} function Cg(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=na(a))}function f(a){e("Error: "+a);l&&(--yg||Ka(!0));l=!1}var g,k,l=!0;yg++;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?zg(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,--yg||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),--yg||Ka(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?zg(b,a,d,!0,e,n):Ag(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(z){f(z.message)}return l}window.embedPDP11=function(a,b,c,d){Ka(!1);return Cg(a,b,c,d)};window.enableEvents=Ka;window.sendEvent=La;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11.map