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