(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 k,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,vc:65,Df:66,Ff:67,bg:68,E:69,cg:70,dg:71,eg:72,fg:73,gg:74,hg:75,ig:76,jg:77,kg:78,lg:79,mg:80,Q:81,ng:82,og:83,pg:84,qg:85,rg:86,sg:87,tg:88,ug:89,gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,vg:97,wg:98,xg:99,d:100,e:101,yg:102,zg:103,Ag:104,Bg:105,Eg:106,k:107,Fg:108,Gg:109,n:110,Hg:111,p:112,q:113,r:114,Ig:115,t:116,Kg:117,Lg:118,Mg:119,x:120,y:121,z:122,"{":123, "|":124,"}":125,"~":126,Xc:127}; function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function q(a){return p(a,4,!0)} function u(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ra(a){return a.replace(/[&<>"']/g,function(a){return qa[a]})} function ta(a,b){return(a+" ").slice(0,b)}function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var za={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"}; function Aa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"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 Da(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 h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} function Ea(a,b){var c,d={ha:null,ja:null,Sa:null,Ra: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.Sa=g.load;d.Ra=g.exec;if(e=g.bytes)d.ha=e;else if(e=g.words)for(d.ha=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ha=Array(4*e.length),f=c=0;c>8&255,d.ha[f++]=e[c]>>16&255,d.ha[f++]=e[c]>>24&255;else d.ha=g;d.ja=g.symbols;d.ha.length?1==d.ha.length&&(w(d.ha[0]),d=null):(w("Empty resource: "+a),d=null)}catch(h){w("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.hb=this.id:(this.ib=this.id.substr(0,b),this.hb=this.id.substr(b+1));this[a]=c;this.C={ready:!1,kb:!1,nc:!1,ma:!1,error:!1};this.cc=null;this.C.error=!1;this.D={};this.j=null;this.oa=d||0;z.push(this)}var eb=void 0,fb={}; if(window){eb||(eb=window.location.search.substr(1));for(var gb,hb=/\+/g,ib=/([^&=]+)=?([^&]*)/g;gb=ib.exec(eb);)fb[decodeURIComponent(gb[1].replace(hb," "))]=decodeURIComponent(gb[2].replace(hb," "))}function jb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function B(a,b){b||(b=x);a.prototype=jb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var kb=window.PCjs.Machines||(window.PCjs.Machines={}),z=window.PCjs.Components||(window.PCjs.Components=[])}else kb={},z=[];function lb(a,b,c){kb[a]&&b&&(kb[a][b]=c)}function mb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.f["S"+a]=[0,0,!1,!1,this.Gd,a]}B(Eb);var Fb=7;function Gb(a,b){return a.f[b]&&a.f[b][1]}k=Eb.prototype;k.reset=function(){this.stop()}; k.xa=function(a,b,c,d){if(this.B&&this.B.xa(a,b,c,d)||this.b&&this.b.xa(a,b,c,d)||this.j&&this.j.xa(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.D[b]=c,this.F++,!0;default:return"led"==a||"rled"==a?(this.D[b]=c,this.g[b]=d?1:0,this.F++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[b]=[d?1:0,d?1:0]),this.D[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a, b){return function(){Hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Hb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Ib(a,b)}}(this,b),!0):this.parent.xa.call(this,a,b,c,d)}};k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;Jb(b,this,Kb);Lb(b,this.reset.bind(this));Mb(this);Nb(this)};k.Ka=function(a,b){b||(Ob(),this.reset());return!0};k.Ja=function(){return!0}; function Pb(a,b,c){if(a=a.D[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Mb(a,b){for(var c in a.g)Pb(a,c,null!=b?b:a.g[c])}function Qb(a,b,c){if(a=a.D[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Nb(a){for(var b in a.f)Qb(a,b,a.f[b][1])}function Rb(a,b,c,d){a.D[b]&&(void 0===c&&(Ab(a,"Value for "+b+" is invalid"),a.b.ea()),c=8==(a.j&&a.j.na||8)?na(c,d):p(c,d),a.D[b].textContent!=c&&(a.D[b].textContent=c))} function Hb(a,b){var c=a.f[b];Qb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.I="DEP"==b,a.K="EXAM"==b)}function Ib(a,b){var c=a.f[b];c[2]&&c[3]&&(Qb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.Ed=function(a){a||this.b.C.X||(a=this.b,a.v.reset(),Sb(a),Gb(this,"ENABLE")&&this.b.rb())};k.Fd=function(){};k.Ad=function(a){a||this.b.ea()}; k.yd=function(a){if(!a&&!this.b.C.X)if(Gb(this,"ENABLE"))this.b.rb();else{if((a=this.j)&&!qb(a,!0))pb(a,!0),a.sb(0,null),pb(a,!1);else try{var b=this.b.sb(1);0a.b.lb?8:16,c=65472<=a.Ba&&a.Ba<65472+b,b=c?1:2,c=c?15:a.v.Xa;Gb(a,"STEP")||(b=-b);Yb(a,a.Ba&~c|a.Ba+b&c)} function Yb(a,b){a.Ba=b&a.v.Xa;b=a.Ba;for(var c=0;22>c;c++)$b(a,"A"+c,b&1<c;c++)$b(a,"D"+c,b&1<c;c++)a.f["S"+c][1]=b&1<>2;this.v=this.Ia-1;this.K=this.A/this.Ia|0;this.I=this.L=(this.A-qc&this.Xa)>>>this.pa;this.jb=[];this.qa=0;this.f=!1;this.G=0;this.F=[];this.ld=[rc,sc,tc,uc];a=new K(this);vc(a,this.j);this.ba=Array(this.K);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.jb[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.j&&I(this.j,16|e[5])&&G(this.j,e[4]+".readByte("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,3);c=255;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to byte @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} function sc(a,b,c){var d=!1,e=this.controller,f=e.jb[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.jb[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?this.j&&I(this.j,16|f[5])&&G(this.j,f[4]+".writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,5),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to byte @"+L(this.j,c)+": "+L(this.j, b),!0,!e.qa))}function tc(a,b){var c=-1,d=this.controller;a=d.jb[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 this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".readWord("+L(this.j,b)+"): "+L(this.j,c),!0,!d.qa),c;d.Na(b,16,2);c=65535;this.j&&I(this.j,16)&&G(this.j,"warning: unconverted read access to word @"+L(this.j,b)+": "+L(this.j,c),!0,!d.qa);return c} function uc(a,b,c){var d=!1,e=this.controller;a=e.jb[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?this.j&&I(this.j,16|a[5])&&G(this.j,a[4]+".writeWord("+L(this.j,c)+","+L(this.j,b)+")",!0,!e.qa):(e.Na(c,16,4),this.j&&I(this.j,16)&&G(this.j,"warning: unconverted write access to word @"+L(this.j,c)+": "+L(this.j,b),!0,!e.qa))} function xc(a,b){if(b!=a.w){var c;a.w&&(c=(1<>>a.pa,a.g=zc(a,c,qc),a.B?yc(a,c,qc,a.B):(Ac(a,c,qc,Bc,a),a.B=zc(a,c,qc)))}}k=pc.prototype;k.reset=function(){for(var a=0;a>>a.pa;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.H)return l.Zb+=l.H-f,l.H=f,!0;if(f>=l.H+l.Zb){n=l.size-(f-m);n>g&&(n=g);l.Zb=f-l.H+n;f=m+a.Ia;g-=n;h++;continue}}return Cc(1,f,g)}f=new K(a,f,n,a.Ia,d,e);vc(f,a.j,l);a.ba[h++]=f;f=m+a.Ia;g-=n}return 0>=g?(d==Dc&&(a.G+=c),a.status((c>>10)+"Kb "+Ec[d]+" at "+na(b)),!0):Cc(2,b,c)} function zc(a,b,c){var d=[];for(b>>>=a.pa;0>>=a.pa;0>>this.pa].fc(a&this.v,a)};function Gc(a,b){b=(b&a.Xa)>>>a.pa;var c=a.ba[b];b==a.I&&a.g.length?c=a.g[0]:b==a.L&&(c=a.ba[a.I]);return c} k.ec=function(a){this.f=!1;this.qa++;3932160<=a&&(a=Fc(this.b,a));a=Gc(this,a).I(a&this.v,a);this.qa--;return a};k.va=function(a){3932160<=a&&(a=Fc(this.b,a));return this.ba[(a&this.Xa)>>>this.pa].Aa(a&this.v,a)};k.Va=function(a){this.f=!1;this.qa++;3932160<=a&&(a=Fc(this.b,a));a=Gc(this,a).K(a&this.v,a);this.qa--;return a};k.Nb=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.ba[(a&this.Xa)>>>this.pa].ic(a&this.v,b&255,a)}; k.Cb=function(a,b){this.f=!1;this.qa++;3932160<=a&&(a=Fc(this.b,a));Gc(this,a).G(a&this.v,b&255,a);this.qa--};k.Db=function(a,b){3932160<=a&&(a=Fc(this.b,a));this.ba[(a&this.Xa)>>>this.pa].$b(a&this.v,b&65535,a)};k.qb=function(a,b){this.f=!1;this.qa++;3932160<=a&&(a=Fc(this.b,a));Gc(this,a).N(a&this.v,b&65535,a);this.qa--}; function Hc(a){for(var b=0,c=[],d=0;da.b.lb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=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)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],r=f[5]||1,t=0;tb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+L(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Hb=128;Nc(this.b,this.f.tc,1E3/60,!0)};k.Od=function(){return this.f.Hb};k.Ne=function(a){this.f.Hb=a&192;this.f.Hb&64||Rc(this.b,this.f.Gb)};k.Qd=function(){return $c(this.b)};k.Pe=function(a){ad(this.b,a&-129|this.b.Da&128)}; k.Rd=function(){return bd(this.b)};k.Sd=function(){return cd(this.b)};k.Td=function(){return this.b.Ya};k.Qe=function(a){dd(this.b,a)};k.Ae=function(a){a=a>>1&63;var b=this.b.Yb[a>>1];return a&1?b>>16:b&65535};k.zf=function(a,b){b=b>>1&63;var c=b>>1;this.b.Yb[c]=b&1?this.b.Yb[c]&65535|(a&63)<<16:this.b.Yb[c]&-65536|a&65534};k.te=function(a){return this.b.S[1][a>>1&7]};k.sf=function(a,b){this.b.S[1][b>>1&7]=a&65295};k.re=function(a){return this.b.S[1][(a>>1&7)+8]}; k.qf=function(a,b){this.b.S[1][(b>>1&7)+8]=a&65295};k.se=function(a){return this.b.ka[1][a>>1&7]};k.rf=function(a,b){b=b>>1&7;this.b.ka[1][b]=a;this.b.S[1][b]&=65295};k.qe=function(a){return this.b.ka[1][(a>>1&7)+8]};k.pf=function(a,b){b=(b>>1&7)+8;this.b.ka[1][b]=a;this.b.S[1][b]&=65295};k.Nd=function(a){return this.b.S[0][a>>1&7]};k.Me=function(a,b){b=b>>1&7;this.b.S[0][b]=a&=65295;I(this,64)&&G(this,"writeKIPDR["+b+"]: "+na(a),!0)};k.Ld=function(a){return this.b.S[0][(a>>1&7)+8]}; k.Ke=function(a,b){this.b.S[0][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.ka[0][a>>1&7]};k.Le=function(a,b){b=b>>1&7;this.b.ka[0][b]=a;this.b.S[0][b]&=65295};k.Kd=function(a){return this.b.ka[0][(a>>1&7)+8]};k.Je=function(a,b){b=(b>>1&7)+8;this.b.ka[0][b]=a;this.b.S[0][b]&=65295};k.ze=function(a){return this.b.S[3][a>>1&7]};k.yf=function(a,b){this.b.S[3][b>>1&7]=a&65295};k.xe=function(a){return this.b.S[3][(a>>1&7)+8]};k.wf=function(a,b){this.b.S[3][(b>>1&7)+8]=a&65295}; k.ye=function(a){return this.b.ka[3][a>>1&7]};k.xf=function(a,b){b=b>>1&7;this.b.ka[3][b]=a;this.b.S[3][b]&=65295};k.we=function(a){return this.b.ka[3][(a>>1&7)+8]};k.vf=function(a,b){b=(b>>1&7)+8;this.b.ka[3][b]=a;this.b.S[3][b]&=65295};k.Kb=function(a){a&=7;return this.b.P&2048?this.b.gb[a]:this.b.u[a]};k.Ob=function(a,b){b&=7;this.b.P&2048?this.b.gb[b]=a:this.b.u[b]=a};k.Yd=function(){return this.b.P&49152?this.b.Oa[0]:this.b.u[6]};k.Ve=function(a){this.b.P&49152?this.b.Oa[0]=a:this.b.u[6]=a}; k.ae=function(){return this.b.u[7]};k.Ye=function(a){this.b.u[7]=a};k.Lb=function(a){a&=7;return this.b.P&2048?this.b.u[a]:this.b.gb[a]};k.Pb=function(a,b){b&=7;this.b.P&2048?this.b.u[b]=a:this.b.gb[b]=a};k.Zd=function(){return 1==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[1]};k.We=function(a){1==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[1]=a};k.$d=function(){return 3==(this.b.P&49152)>>14?this.b.u[6]:this.b.Oa[3]};k.Xe=function(a){3==(this.b.P&49152)>>14?this.b.u[6]=a:this.b.Oa[3]=a}; k.Jd=function(a){return this.b.Oc[a-65504>>1]};k.Ie=function(a,b){this.b.Oc[b-65504>>1]=a};k.Lc=function(a){return 65520==a?(Ic(this.v)>>6)-1:0};k.Rc=function(){};k.ve=function(){return 1};k.uf=function(){};k.Id=function(){return this.b.sa};k.He=function(){this.b.sa=0};k.Pd=function(){return this.b.Nc};k.Oe=function(a,b){b&1||(a&=255);this.b.Nc=a};k.Ud=function(a,b){return b?0:this.b.Mb};k.Re=function(a){ed(this.b,a)};k.ue=function(a,b){return b?0:this.b.ob&65280};k.tf=function(a){this.b.ob=a|255}; k.Xd=function(){return fd(this.b)};k.Ue=function(a){gd(this.b,a&-1793|fd(this.b)&1792);this.b.J|=256};k.Qc=function(a,b){I(this)&&G(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; var O={},Pc=(O[61568]=[null,null,M.prototype.Ae,M.prototype.zf,"UNIMAP",64,1170],O[62592]=[null,null,M.prototype.te,M.prototype.sf,"SIPDR",8,1145,64],O[62608]=[null,null,M.prototype.re,M.prototype.qf,"SDPDR",8,1145,64],O[62624]=[null,null,M.prototype.se,M.prototype.rf,"SIPAR",8,1145,64],O[62640]=[null,null,M.prototype.qe,M.prototype.pf,"SDPAR",8,1145,64],O[62656]=[null,null,M.prototype.Nd,M.prototype.Me,"KIPDR",8,1145,64],O[62672]=[null,null,M.prototype.Ld,M.prototype.Ke,"KDPDR",8,1145,64],O[62688]= [null,null,M.prototype.Md,M.prototype.Le,"KIPAR",8,1145,64],O[62704]=[null,null,M.prototype.Kd,M.prototype.Je,"KDPAR",8,1145,64],O[62798]=[null,null,M.prototype.Td,M.prototype.Qe,"MMR3",1,1145,64],O[65382]=[null,null,M.prototype.Od,M.prototype.Ne,"LKS"],O[65402]=[null,null,M.prototype.Qd,M.prototype.Pe,"MMR0",1,1145,64],O[65404]=[null,null,M.prototype.Rd,M.prototype.Qc,"MMR1",1,1145,64],O[65406]=[null,null,M.prototype.Sd,M.prototype.Qc,"MMR2",1,1145,64],O[65408]=[null,null,M.prototype.ze,M.prototype.yf, "UIPDR",8,1145,64],O[65424]=[null,null,M.prototype.xe,M.prototype.wf,"UDPDR",8,1145,64],O[65440]=[null,null,M.prototype.ye,M.prototype.xf,"UIPAR",8,1145,64],O[65456]=[null,null,M.prototype.we,M.prototype.vf,"UDPAR",8,1145,64],O[65472]=[null,null,M.prototype.Kb,M.prototype.Ob,"R0SET0"],O[65473]=[null,null,M.prototype.Kb,M.prototype.Ob,"R1SET0"],O[65474]=[null,null,M.prototype.Kb,M.prototype.Ob,"R2SET0"],O[65475]=[null,null,M.prototype.Kb,M.prototype.Ob,"R3SET0"],O[65476]=[null,null,M.prototype.Kb, M.prototype.Ob,"R4SET0"],O[65477]=[null,null,M.prototype.Kb,M.prototype.Ob,"R5SET0"],O[65478]=[null,null,M.prototype.Yd,M.prototype.Ve,"R6KERNEL"],O[65479]=[null,null,M.prototype.ae,M.prototype.Ye,"R7KERNEL"],O[65480]=[null,null,M.prototype.Lb,M.prototype.Pb,"R0SET1",1,1145],O[65481]=[null,null,M.prototype.Lb,M.prototype.Pb,"R1SET1",1,1145],O[65482]=[null,null,M.prototype.Lb,M.prototype.Pb,"R2SET1",1,1145],O[65483]=[null,null,M.prototype.Lb,M.prototype.Pb,"R3SET1",1,1145],O[65484]=[null,null,M.prototype.Lb, M.prototype.Pb,"R4SET1",1,1145],O[65485]=[null,null,M.prototype.Lb,M.prototype.Pb,"R5SET1",1,1145],O[65486]=[null,null,M.prototype.Zd,M.prototype.We,"R6SUPER",1,1145],O[65487]=[null,null,M.prototype.$d,M.prototype.Xe,"R6USER",1,1145],O[65504]=[null,null,M.prototype.Jd,M.prototype.Ie,"CTRL",8,1170],O[65520]=[null,null,M.prototype.Lc,M.prototype.Rc,"LSIZE",1,1170],O[65522]=[null,null,M.prototype.Lc,M.prototype.Rc,"HSIZE",1,1170],O[65524]=[null,null,M.prototype.ve,M.prototype.uf,"SYSID",1,1170],O[65526]= [null,null,M.prototype.Id,M.prototype.He,"CPUERR",1,1170],O[65528]=[null,null,M.prototype.Pd,M.prototype.Oe,"MB",1,1170],O[65530]=[null,null,M.prototype.Ud,M.prototype.Re,"PIR"],O[65532]=[null,null,M.prototype.ue,M.prototype.tf,"SL"],O[65534]=[null,null,M.prototype.Xd,M.prototype.Ue,"PSW"],O); ab(function(){for(var a=F(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.A,0,this.size>>2),od(this,kd?pd:qd);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},fa:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},Ea:function(a,b){a&1&&this.v.Na(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+ 1]&255)<<8},Pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.cb=!0},hb:function(a,b){if(this.j&&null!=this.H){var c=this.j;vd(c,this.H+a,1,c.N)&&c.ea(!0)}return this.I(a,b)},na:function(a,b){if(this.j&&null!=this.H){var c=this.j;vd(c,this.H+a,2,c.N)&&c.ea(!0)}return this.K(a,b)},Fa:function(a, b,c){if(this.j&&null!=this.H){var d=this.j;vd(d,this.H+a,1,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.G(a,b,c)},Za:function(a,b,c){if(this.j&&null!=this.H){var d=this.j;vd(d,this.H+a,2,d.F)&&d.ea(!0)}this.f?this.w(a,b,c):this.N(a,b,c)},aa:function(a){return this.D[a]},ib:function(a,b){a=this.D[a];this.j&&I(this.j,32)&&G(this.j,"Memory.readByte("+L(this.j,b)+"): "+L(this.j,a),!0);return a},ga:function(a,b){a&1&&this.v.Na(b,64,2);return this.F.getUint16(a,!0)},ua:function(a,b){a&1&&this.v.Na(b,64,2); a=this.R[a>>1];this.j&&I(this.j,32)&&G(this.j,"Memory.readWord("+L(this.j,b)+"): "+L(this.j,a),!0);return a},Ca:function(a,b){this.D[a]=b;this.cb=!0},Ga:function(a,b,c){this.D[a]=b;this.cb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeByte("+L(this.j,c)+","+L(this.j,b)+")",!0)},Qa:function(a,b,c){a&1&&this.v.Na(c,64,4);this.F.setUint16(a,b,!0);this.cb=!0},$a:function(a,b,c){a&1&&this.v.Na(c,64,4);this.R[a>>1]=b;this.cb=!0;this.j&&I(this.j,32)&&G(this.j,"Memory.writeWord("+L(this.j,c)+","+L(this.j, b)+")",!0)}};function vc(a,b,c){a.j=b;a.B=a.g=0;c&&((a.B=c.B)&&ud(a,td,!1),(a.g=c.g)&&sd(a,td,!1))}function wd(a,b){b?--a.g||(a.ic=a.f?a.w:a.G,a.$b=a.f?a.L:a.N):--a.B||(a.fc=a.I,a.Aa=a.K)}function sd(a,b,c){c&&a.g||(a.ic=!a.f&&b[1]||a.w,a.$b=!a.f&&b[3]||a.L);if(c||void 0===c)a.G=b[1]||a.w,a.N=b[3]||a.L}function ud(a,b,c){c&&a.B||(a.fc=b[0]||a.T,a.Aa=b[2]||a.U);if(c||void 0===c)a.I=b[0]||a.T,a.K=b[2]||a.U}function od(a,b){b||(b=xd);ud(a,b,void 0);sd(a,b,void 0)} var xd=[],rd=[K.prototype.fa,K.prototype.Pa,K.prototype.Ea,K.prototype.ab],td=[K.prototype.hb,K.prototype.Fa,K.prototype.na,K.prototype.Za];if(Bb)var qd=[K.prototype.aa,K.prototype.Ca,K.prototype.ga,K.prototype.Qa],pd=[K.prototype.ib,K.prototype.Ga,K.prototype.ua,K.prototype.$a]; function yd(a,b){x.call(this,"CPU",a,yd,1);b=a.cycles||b;var c=a.multiplier||1;this.Qb=0;this.tb=b;this.mb=c;this.Tb=Math.round(this.tb/1E4)/100;this.Ab=this.Tb*this.mb;this.C.X=!1;this.C.hc=!1;this.C.Eb=a.autoStart;this.C.Fb=!1;this.Vb=this.Ca=0;this.Wb=a.csStart;this.Ib=a.csInterval;this.Jb=a.csStop;this.N=[];this.Cc=this.Ee.bind(this);J(this)}B(yd);var zd=["power","reset"];k=yd.prototype; k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.j=d;this.w=a.w;for(b=0;b=a.Ca&&(a.Ca+=a.Ib,c=!0);0<=a.Jb&&a.Jb<=Fd(a)&&(a.Ib=a.Jb=-1,Cd(a),a.ea(),c=!0);c&&a.i(Fd(a)+" cycles: checksum="+p(a.Vb))}} k.xa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.ma)a=!0;else{var b=null,c,h=mb(a.id);for(c=0;ca.Ea/a.Ab?b=1:d=!0;a.mb=b;b=a.Tb*a.mb;if(a.Ab!=b){a.Ab=b;b=a.Ab.toFixed(2)+"Mhz";var e=a.D.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.B&&a.B.pb()}Ub(a,a.aa);a.aa=0;a.U=Ba();a.fa=0;Hd(a);return d}function Lc(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Nc(a,b,c,d){0<=b&&ba.N[b][0])&&(c=a.tb*a.mb/1E3*c|0,a.C.X&&(c+=Id(a)),a.N[b][0]=c)} function Jd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Tb(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Id(a,b){var c=a.ga-=a.b;a.b=a.K=0;b&&(a.ga=0);return c} k.Ee=function(){if(this.C.X){this.jc>=this.tb&&Hd(this,!0);this.Qa=0;this.ab=Ba();if(this.fa){var a=this.ab-this.fa;a>this.Ac&&(this.U+=a,this.U>this.ab&&(this.U=this.ab))}try{do{var b=Jd(this,this.C.Fb?1:this.ub);try{this.sb(b)}catch(e){if("number"!=typeof e)throw e;}b=Id(this,!0);this.Qa+=b;this.aa+=b;Vb(this,b);Tb(this,b);this.Fa-=b;if(0>=this.Fa){this.Fa+=this.ub;15<=++this.Bc&&(this.ya(),this.Bc=0);break}}while(this.C.X)}catch(e){this.ea();this.B&&this.B.stop(Ba(),Fd(this));Ab(this,e.stack|| e.message);return}if(this.C.X){a=setTimeout;b=this.Cc;this.fa=Ba();var c=this.Ac;this.Qa&&(c=Math.round(c*this.Qa/this.ub));var c=c-(this.fa-this.ab),d=this.fa-this.U;d&&(this.Ea=Math.round(this.aa/(10*d))/100,864E5<=d&&(this.na=0,Gd(this)));if(0>c||this.Eac&&(this.U-=c),c=0;this.jc+=this.Qa;this.fa+=c;a(b,c)}}}; k.rb=function(a){if(zb(this))return!1;if(this.C.X)return this.i(this.toString()+" busy"),!1;Gd(this);this.C.X=!0;this.C.hc=!0;var b=this.D.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.pb(!0),this.B.start(this.U,Fd(this)));setTimeout(this.Cc,0);return!0};k.sb=function(){return 0};k.ea=function(a){var b=!1;if(this.C.X){Id(this);Ub(this,this.aa);this.aa=0;this.C.X=!1;if(b=this.D.run)b.textContent="Run";this.B&&this.B.stop(Ba(),Fd(this));b=!0}this.C.complete=a;return b}; function Kd(a){this.lb=+a.model||1170;this.xc=a.addrReset||0;yd.call(this,a,6666667);this.vb=0;this.zc=255;1120==this.lb?(this.decode=Ld.bind(this),this.ua=this.rd,this.vb=8,this.zc=-1):(this.decode=Md.bind(this),this.ua=this.sd);Nd(this);this.L=0;this.I=null;this.C.complete=!1}B(Kd,yd);k=Kd.prototype;k.reset=function(){this.status("model "+this.lb);this.C.X&&this.ea();Nd(this);Bd(this);this.C.error=!1;this.parent.reset.call(this)}; function Nd(a){a.V=65536;a.W=32768;a.ca=65535;a.Z=32768;a.P=15;a.u=[0,0,0,0,0,0,0,a.xc,-1,-2,-3,-4,-5,-6,-7,-8];a.gb=[0,0,0,0,0,0];a.Oa=[0,0,0,0];a.A=0;a.$a=0;a.hd=[4,2,0,1];a.S=[[0,0,0,0,0,0,0,0,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.ka=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Yb=[0,0,0,0,0,0,0,0,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.Oc=[0,0,0,0,0,0,0,0];a.Nc=0;a.J=0;a.F=a.G=0;a.g=a.f=a.Sb=0;a.Ga=-1;Sb(a)}function Sb(a){a.Da=0;a.kc=0;a.lc=0;a.Ya=0;a.sa=0;a.Mb=0;a.ob=255;a.R=0;a.Za=0;a.Pa=262143;a.Ub=0;a.wa=0;a.I=null;a.v&&(Od(a),a.fd=Ic(a.v))}function Od(a){a.R?(a.T=65536,a.Rb=a.Ya&16?4186112:253952,a.da=a.vd,a.Aa=a.Be,a.$b=a.Af,xc(a.v,a.Ya&16?22:18)):(a.T=0,a.Rb=57344,a.da=a.ud,a.Aa=a.Mc,a.$b=a.Sc,xc(a.v,16))} function $c(a){var b=a.Da;b&57344||(b=b&-3199|a.Za<<5|a.$a<<1);return b}function ad(a,b){b&=-3073;if(a.Da!=b){b&57344&&!(a.Da&57344)&&(a.kc=a.wa>>16&65535,a.lc=a.wa&65535);a.Da=b;a.Za=b>>5&3;a.$a=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.R!=c&&(a.R=c,Od(a))}}function bd(a){a.Da&57344||(a.kc=a.wa>>16&65535);a=a.kc;a&65280&&(a=(a<<8|a>>8)&65535);return a}function cd(a){a.Da&57344||(a.lc=a.wa&65535);return a.lc}function dd(a,b){1170>a.lb&&(b&=-49);a.Ya!=b&&(a.Ya=b,a.Pa=b&16?4194303:262143,Od(a))} k.Hc=function(){return 0};k.save=function(){var a=new S(this);a.set(0,[]);a.set(1,[this.na,this.mb]);a.set(2,Hc(this.v));return a.data()};k.restore=function(a){var b=a[1];this.na=b[1];Gd(this,b[3]);a:{b=this.v;a=a[2];var c;for(c=0;c>14&3;c=a.P>>14&3;a.A!=c&&(a.Oa[c]=a.u[6],a.u[6]=a.Oa[a.A]);a.P=b;a.J&=-3;a.J|=a.I?2:1}function ed(a,b){if(b&=65024){var c=b>>9;do b+=34;while(c>>=1);a.J|=1}a.Mb=b}function U(a,b){a.J&256||(a.Z=a.ca=b,a.W=0)}function Xd(a,b,c){a.J&256||(a.Z=a.ca=a.V=b,a.W=c||0)} function Yd(a,b,c,d){a.J&256||(a.Z=a.ca=a.V=b,a.W=(c^b)&(d^b))}function Zd(a,b){a.J&256||(a.Z=a.ca=a.V=b,a.W=a.Z^a.V>>1)}function $d(a,b,c,d){a.J&256||(a.Z=a.ca=a.V=b,a.W=(c^d)&(d^b))} k.ta=function(a,b,c){if(!this.L){0>this.Ga?this.Ga=fd(this):this.A||(c=-3);var d=!1;-3==c&&(a=4,this.sa|=4,this.u[6]=4,d=!0);this.wa=a|4143316992;this.A=0;var e=this.Aa(a|this.T),f=this.Aa(a+2&65535|this.T);gd(this,f&-12289|this.Ga>>2&12288);ue(this,this.Ga,d);ue(this,this.u[7],d);T(this,e);this.J&=~(b|19);this.J|=129;this.Ga=-1;this.pd=a;this.kd=c;if(-3<=c)throw a;}};function ve(a){var b=we(a),c=we(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);T(a,b);gd(a,c);a.J&=-17} function Fc(a,b){var c=b>>13&31;31>c&&(b=a.Ya&32?a.Yb[c]+(b&8190)&4194302:b&-3932161);return b} function xe(a,b,c){var d,e,f;if(!(c&a.R))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ya&a.hd[a.A]||(d&=7);e=a.S[a.A][d];f=(a.ka[a.A][d]<<6)+(b&8191)&a.Pa;3932160<=f&&(f=Fc(a,f));if(a.L)return f;f>=a.fd&&f>2&8128)&&(g|=16384):(b&8128)>(e>>2& 8128)&&(g|=16384));a.S[a.A][d]=e;if(f!=(4194170&a.Pa)||a.A)a.Za=a.A,a.$a=d;g&&(g&57344&&(0<=a.Ga&&(g|=128),a.Da&57344||(g|=a.Da&4096|a.Za<<5|a.$a<<1,ad(a,a.Da&-61695|g&61694)),a.ta(168,64,-1)),a.Da&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function ye(a,b){return a.v.dc(b)}function we(a){var b=a.Aa(a.u[6]|a.T);a.u[6]=a.u[6]+2&65535;return b} function ue(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.wa=a.wa&65535|(a.wa&-65536)<<8|16121856;c||a.ua(4,-2,d);a.$b(d,b)} function ze(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return a.ta(4,0,-2),0;case 1:return 6==c&&a.ua(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.ua(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.Aa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.ua(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.Aa(e)|g;a.b-=8;break;case 6:return e=a.Aa(Ud(a,2)),e=e+a.u[c]&65535,6==c&&a.ua(d, 0,e),a.b-=6,e|g;case 7:return e=a.Aa(Ud(a,2)),e=e+a.u[c]&65535,e=a.Aa(e|a.T),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.wa=a.wa&65535|(a.wa&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.ob&&(this.J|=32)};k.sd=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.ob&&(c<=this.ob-32?this.ta(4,0,-3):(this.sa|=8,this.J|=32)))};k.ec=function(a){if(!this.R)return this.v.ec(a);this.L++;a=ye(this,xe(this,a,3));this.L--;return a}; k.Va=function(a){if(!this.R)return this.v.Va(a);this.L++;a=this.Mc(xe(this,a,2));this.L--;return a};k.Cb=function(a,b){this.R?(this.L++,a=xe(this,a,5),a&1&&this.b--,this.v.Nb(a,b),this.L--):this.v.Cb(a,b)};k.qb=function(a,b){this.R?(this.L++,this.Sc(xe(this,a,4),b),this.L--):this.v.qb(a,b)};k.ud=function(a,b,c){return ze(this,a,b,c)};k.vd=function(a,b,c){return xe(this,ze(this,a,b,c),c)};k.Mc=function(a){return this.v.va(this.Ub=a)};k.Be=function(a){return this.v.va(this.Ub=xe(this,a,2))}; k.Sc=function(a,b){this.v.Db(this.Ub=a,b&65535)};k.Af=function(a,b){this.v.Db(this.Ub=xe(this,a,4),b)};function Ae(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ze(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.A=a.P>>12&3,c=a.Aa(d|c&a.T),a.A=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.Oa[a.P>>12&3];return c} function Be(a,b,c,d){a.wa=a.wa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ze(a,b,e,4),c&65536||(e&=65535),a.A=a.P>>12&3,e=xe(a,e|c&65536,4),a.A=a.P>>14&3,a.v.Db(e,d)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.Oa[a.P>>12&3]=d}function Ce(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?ye(a,a.da(b,c,3)):a.u[c+a.vb]&a.zc}function De(a,b){b>>=6;var c=a.G=b&7;return(b=a.F=(b&56)>>3)?a.v.va(a.da(b,c,2)):a.u[c+a.vb]}function Ee(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ze(a,b,c,8)} function Fe(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ye(a,a.da(b,c,3)):a.u[c]&255}function Ge(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.va(a.da(b,c,2)):a.u[c]}function He(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Sb=a.da(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ye(a,e)),e&1&&a.b--,a.v.Nb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))} function V(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.da(b,e,6),a.v.Db(e,d.call(a,0>c?a.u[-c-1]:c,a.v.va(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}function Ie(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.da(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Nb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function Je(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.da(b,d,4),a.v.Db(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c} function W(a,b,c){c&&(T(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} k.sb=function(a){this.C.complete=!0;var b=this.j?Ke(this.j)?1:this.C.hc?-1:0:0,c=a?this.C.hc?0:1:-1;this.C.hc=!1;this.ga=this.b=a;do{if(b){if(Le(this.j,this.u[7],c)){this.ea();break}c||c++;b++}if(this.J){if(a=this.J&11)if(a=!1,this.J&2){var d=160,e=(this.Mb&224)>>5,f=this.I&&this.I.nb>e?this.I:null;f&&(d=f.uc,e=f.nb);e>(this.P&224)>>5?(this.J&8&&(Ud(this,2),this.J&=-9),this.ta(d,0,-9),e=!0):e=!1;e&&(f&&Vd(this,f),a=!0);this.I||this.Mb||(this.J&=-3)}else this.J&1&&this.J++;if(a){if(b&&Le(this.j,this.u[7], c)){this.ea();break}if(0>c)break}if(this.J&112&&Wd(this)){if(b&&Le(this.j,this.u[7],c)){this.ea();break}if(0>c)break}}this.J=this.J&15|this.P&16;this.decode(Td(this))}while(0>1|b<<16;Zd(this,a);return a&65535}function Re(a,b){a=b&128|b>>1|b<<8;Zd(this,a<<8);return a&255}function Se(a,b){a=b&~a;U(this,a);return a}function Te(a,b){a=b&~a;U(this,a<<8);return a}function Ue(a,b){a|=b;U(this,a);return a}function Ve(a,b){a|=b;U(this,a<<8);return a}function We(a,b){a=~b|65536;Xd(this,a);return a&65535} function Xe(a,b){a=~b|256;Xd(this,a<<8);return a&255}function Ye(a,b){a=b-a;this.J&256||(this.Z=this.ca=a,this.W=b&(b^a));return a&65535}function Ze(a,b){a=b-a;var c=a<<8;b<<=8;this.J&256||(this.Z=this.ca=c,this.W=b&(b^c));return a&255}function $e(a,b){a=b+a;this.J&256||(this.Z=this.ca=a,this.W=a&(b^a));return a&65535}function af(a,b){a=b+a;var c=a<<8;this.J&256||(this.Z=this.ca=c,this.W=c&(b<<8^c));return a&255}function bf(a,b){a=-b;Xd(this,a,a&b&32768);return a&65535} function cf(a,b){a=-b;Xd(this,a<<8,(a&b&128)<<8);return a&255}function df(a,b){a=b<<1|this.V>>16&1;Zd(this,a);return a&65535}function ef(a,b){a=b<<1|this.V>>16&1;Zd(this,a<<8);return a&255}function ff(a,b){a=(this.V&65536|b)>>1|b<<16;Zd(this,a);return a&65535}function gf(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;Zd(this,a<<8);return a&255}function hf(a,b){var c=b-a;$d(this,c,a,b);return c&65535}function jf(a,b){var c=b-a;$d(this,c<<8,a<<8,b<<8);return c&255} function kf(a,b){this.J&256||(this.Z=this.ca=b&65280,this.W=this.V=0);return(b<<8|b>>8)&65535}function lf(a,b){a^=b;U(this,a);return a&65535}function mf(a){V(this,a,De(this,a),Me);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} function nf(a){var b=Ge(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.V=this.W=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.W=32768)}this.u[a]=c&65535;this.Z=this.ca=c;this.b-=(this.g?6:7)+b} function of(a){var b=Ge(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&=63;if(b&32){b=64-b;32>b-1;this.V=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.u[a|1]=d&65535;this.Z=d>>16;this.ca=d>>16|d;this.b-=(this.g?6:7)+b}function pf(a){W(this,a,!Pd(this))}function qf(a){W(this,a,Pd(this))} function rf(a){V(this,a,De(this,a),Se);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function sf(a){He(this,a,Ce(this,a),Te);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function tf(a){V(this,a,De(this,a),Ue);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function uf(a){He(this,a,Ce(this,a),Ve);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)} function vf(a){var b=De(this,a);a=Ge(this,a);U(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function wf(a){var b=Ce(this,a);a=Fe(this,a);U(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function xf(a){W(this,a,Rd(this))}function yf(a){W(this,a,!Sd(this)==!Qd(this))}function zf(a){W(this,a,!Rd(this)&&!Sd(this)==!Qd(this))}function Af(a){W(this,a,!Pd(this)&&!Rd(this))} function Bf(a){W(this,a,Rd(this)||!Sd(this)!=!Qd(this))}function Cf(a){W(this,a,Pd(this)||Rd(this))}function Df(a){W(this,a,!Sd(this)!=!Qd(this))}function Ef(a){W(this,a,Sd(this))}function Ff(a){W(this,a,!Rd(this))}function Gf(a){W(this,a,!Sd(this))}function Hf(){this.ta(12,0,-8);this.b-=5}function If(a){W(this,a,!0)}function Jf(a){W(this,a,!Qd(this))}function Kf(a){W(this,a,Qd(this))}function Lf(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.ca=1);a&8&&(this.Z=0);this.b-=5} function Mf(a){var b=De(this,a);a=Ge(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;$d(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)}function Nf(a){var b=Ce(this,a);a=Fe(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);$d(this,c,a,b);this.b-=this.g?4+(this.G&&6<=this.f?1:0):(this.F?4:3)+(7==this.f?2:0)} function Of(a){var b=Ge(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.ca=d>>16|d,this.Z=d>>16):(this.W=32768,this.ca=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.ca=this.Z=0,this.W=32768,this.V=65536,this.b-=7}function Pf(){this.ta(24,0,-8);this.b-=25} function Qf(){this.P&49152?(this.sa|=128,this.ta(4,0,-7)):(this.w&&1120==this.lb&&this.w.setData(this.u[0],!0),this.j?Rf(this.j):this.ea());this.b-=7}function Sf(){this.ta(16,0,-8);this.b-=25}var Tf=[0,7,7,10,7,11,9,13];function Uf(a){this.K=this.b;T(this,Ee(this,a));this.b=this.K-Tf[this.g]}var Vf=[0,14,14,17,14,18,16,20];function Wf(a){this.K=this.b;var b=Ee(this,a);a=a>>6&7;ue(this,this.u[a]);this.u[a]=this.u[7];T(this,b);this.b=this.K-Vf[this.g]} var Xf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Yf(a){var b=De(this,a);this.K=this.b;U(this,Je(this,a,b));this.b=this.K-Xf[(this.F?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Zf(a){var b=Ce(this,a);U(this,Ie(this,a,b,65535)<<8);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}var $f=[7,13,13,17,14,18,17,21]; function ag(a){var b=Ge(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&256||(this.Z=b>>16,this.ca=this.Z|b,this.W=0,this.V=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)T(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function hg(a){V(this,a,De(this,a),hf);this.b-=this.g?9+(this.G&&6<=this.f?1:0):(this.F?5:3)+(7==this.f?2:0)}function ig(a){V(this,a,0,kf);this.b-=this.g?9:3+(7==this.f?2:0)}function jg(){this.ta(28,0,-8);this.b-=5} function kg(){this.w&&(this.w.sc(this.u[7],!0),this.w.setData(this.u[0],!0));this.J|=8;Ud(this,-2);this.b-=3}function lg(a){V(this,a,this.u[(a>>6&7)+this.vb],lf);this.b-=this.g?9:3+(7==this.f?2:0)}function X(a){var b;if(b=this.j)b=this.j,I(b,1)?(G(b,"undefined opcode "+L(b,a),!0,!0),b=Rf(b)):b=!1;b||this.ta(8,0,-8)}function Ld(a){mg[a>>12].call(this,a)}function ng(a){og[a>>6&3].call(this,a)}function pg(a){qg[a>>6&3].call(this,a)}function rg(a){sg[a>>6&3].call(this,a)} function tg(a){ug[a&15].call(this,a)}function vg(a){wg[a&15].call(this,a)}function xg(a){yg[a>>6&3].call(this,a)}function zg(a){Ag[a>>6&3].call(this,a)}function Bg(a){Cg[a>>6&3].call(this,a)} var mg=[function(a){Dg[a>>8&15].call(this,a)},Yf,Mf,vf,rf,tf,mf,X,function(a){Eg[a>>8&15].call(this,a)},Zf,Nf,wf,sf,uf,hg,X],Dg=[function(a){Fg[a>>4&15].call(this,a)},If,Ff,xf,yf,Df,zf,Bf,Wf,Wf,ng,pg,rg,X,X,X],og=[function(a){Xd(this,Je(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,$e);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,1,Ye);this.b-=this.g?9:3+(7==this.f?2:0)}],qg=[function(a){V(this,a,0, bf);this.b-=this.g?11:6},function(a){V(this,a,Pd(this)?1:0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,Pd(this)?1:0,hf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Ge(this,a);Xd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],sg=[function(a){V(this,a,0,ff);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,df);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){V(this,a,0,Oe);this.b-=this.g?9:3+(7==this.f?2:0)}], Fg=[function(a){Gg[a&15].call(this,a)},X,X,X,Uf,Uf,Uf,Uf,dg,X,tg,vg,ig,ig,ig,ig],Gg=[Qf,kg,eg,Hf,Sf,cg,X,X,X,X,X,X,X,X,X,X],ug=[bg,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},Lf,function(){this.ca=1;this.b-=5},Lf,Lf,Lf,function(){this.Z=0;this.b-=5},Lf,Lf,Lf,Lf,Lf,Lf,Lf],wg=[bg,function(){this.V=65536;this.b-=5},function(){this.W=32768;this.b-=5},fg,function(){this.ca=0;this.b-=5},fg,fg,fg,function(){this.Z=32768;this.b-=5},fg,fg,fg,fg,fg,fg,fg],Eg=[Gf,Ef,Af,Cf,Jf,Kf,pf,qf,Pf,jg, xg,zg,Bg,X,X,X],yg=[function(a){Xd(this,Ie(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){He(this,a,0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){He(this,a,1,af);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){He(this,a,1,Ze);this.b-=this.g?9:3+(7==this.f?2:0)}],Ag=[function(a){He(this,a,0,cf);this.b-=this.g?11:6},function(a){He(this,a,Pd(this)?1:0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){He(this,a,Pd(this)?1:0,jf);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a= Fe(this,a);Xd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Cg=[function(a){He(this,a,0,gf);this.b-=this.g?9+(this.Sb&1):3+(7==this.f?2:0)},function(a){He(this,a,0,ef);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){He(this,a,0,Re);this.b-=this.g?9+(this.Sb&1):3+(7==this.f?2:0)},function(a){He(this,a,0,Pe);this.b-=this.g?9:3+(7==this.f?2:0)}];function Md(a){Hg[a>>12].call(this,a)} var Hg=[function(a){Ig[a>>8&15].call(this,a)},Yf,Mf,vf,rf,tf,mf,function(a){Jg[a>>8&15].call(this,a)},function(a){Kg[a>>8&15].call(this,a)},Zf,Nf,wf,sf,uf,hg,X],Ig=[function(a){Lg[a>>4&15].call(this,a)},If,Ff,xf,yf,Df,zf,Bf,Wf,Wf,ng,pg,rg,function(a){Mg[a>>6&3].call(this,a)},X,X],Mg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Aa(a|this.T);T(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ae(this,a,0);ue(this,a);U(this,a);this.b-=11},function(a){var b=we(this);this.K= this.b;Be(this,a,0,b);U(this,b);this.b=this.K-$f[this.g]},function(a){U(this,Je(this,a,Sd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Lg=[function(a){Ng[a&15].call(this,a)},X,X,X,Uf,Uf,Uf,Uf,dg,function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.J|=1,this.J&=-3),this.b-=5):X.call(this,a)},tg,vg,ig,ig,ig,ig],Ng=[Qf,kg,function(){ve(this);this.J|=this.P&16;this.b-=13},Hf,Sf,cg,eg,function(){this.ta(8,0,-8)},X,X,X,X,X,X,X,X],Jg=[ag,ag,Of,Of,nf,nf,of,of,lg,lg,X,X,X,X,gg,gg],Kg= [Gf,Ef,Af,Cf,Jf,Kf,pf,qf,Pf,jg,xg,zg,Bg,function(a){Og[a>>6&3].call(this,a)},X,X],Og=[X,function(a){a=Ae(this,a,65536);ue(this,a);U(this,a);this.b-=11},function(a){var b=we(this);this.K=this.b;Be(this,a,65536,b);U(this,b);this.b=this.K-$f[this.g]},X]; function Pg(a){x.call(this,"ROM",a,Pg,128);this.ja=this.B=null;this.A=a.addr;this.f=a.size;this.F=!1;this.w=a.alias;this.g=a.file;this.G=u(this.g);if(this.g){a=this.g;var b=oa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.g+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.g=null):(lb(c.ib,a,b),(a=Ea(a,b))?(c.B=a.ha,c.ja=a.ja):c.g=null);Qg(c)})}}B(Pg);k=Pg.prototype; k.Ha=function(a,b,c,d){this.v=b;this.b=c;this.j=d;Qg(this)};k.Ka=function(){this.ja&&(this.j&&Rg(this.j,this.id,this.A,this.f,this.ja),delete this.ja);return!0};k.Ja=function(){return!0}; function Qg(a){if(!yb(a)){if(a.g){if(!a.B||!a.v)return;a.f||(a.f=a.B.length);if(a.B.length!=a.f)Ab(a,"ROM size ("+p(a.B.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.A;a.status(a.f+"-byte ROM at "+na(b));if(57344<=b&&b<57344+qc){var c={};b=(c[b]=[Pg.prototype.pe,Pg.prototype.nf,null,null,null,a.f>>1],c);if(Jb(a.v,a,b)){b=a.F=!0;break a}}else if(Ac(a.v,b,a.f,nd)){for(c=0;c>>a.pa;0=b.length){G(a,"invalid block at offset "+q(m),4096);break}for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,r=b[h++]&255|(b[h++]&255)<<8,l=l+((n&255)+(n>>8)+(r&255)+(r>>8)),t=h,v=n-=6;0=b.length){G(a,"insufficient data for block at offset "+q(m),4096);break}l+= b[h++]&255;if(l&255){G(a,"invalid checksum ("+p(l,2,!0)+") for block at offset "+q(m),4096);break}if(v)for(G(a,"loading "+q(v)+" bytes at "+q(r)+"-"+q(r+v-1),4096);v--;)a.b.Cb(r++,b[t++]&255);else r&1?a.b.ea():null==d&&(d=r),null!=d&&G(a,"starting address: "+q(d),4096);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g=la.vc&&c<=la.gd&&(b=c-(la.vc-la.Uc));b&&(a.preventDefault&&a.preventDefault(),d.gc(b));return!0},c.onkeypress=function(a){a=a||window.event;var b=a.which||a.keyCode;a.altKey&&b==la.Wc&&(b=la.Vc);d.gc(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.gc(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1}; k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;var e=this;this.ga=Oc(48,4,262144);this.aa=Lc(this.b,function(){var a;a=-1;e.G.length&&(a=e.G.shift()&255,G(e,"receiveByte("+p(a,2,!0)+")"),e.fa&&97<=a&&122>a&&(a-=32),Nc(e.b,e.aa,1E3/Math.round(e.R/10)));0<=a&&(e.K=a,e.f&128?e.K|=49152:e.f|=128,e.f&64&&Mc(c,e.ga))});this.N=Oc(52,4,262144);this.ua=Lc(this.b,function(){e.g|=128;e.g&64&&Mc(c,e.N)});Jb(b,this,Yg);Lb(b,this.reset.bind(this));J(this)}; k.Kc=function(){if(!this.I){var a=Ad(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ua(b[0]);if(c!=this.hb)return;b=ua(b[1]);if(this.I=nb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.ib+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ka=function(a,b){if(!b)if(this.Kc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.Ja=function(a){return a?this.save():!0};k.reset=function(){Zg(this)};k.save=function(){var a=new S(this);a.set(0,[]);return a.data()};k.restore=function(){return Zg(this)};function Zg(a){a.K=0;a.f=0;a.g=128;a.G=[];return!0}k.gc=function(a){if("number"==typeof a)this.G.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.U||8,c=a-this.F%a,this.U&&(b=ta("",c)));this.T&&!this.F&&c&&(b=String.fromCharCode(this.T)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.F+=c}}else if(null!=this.A){if(10==a||1024<= this.A.length)this.i(this.A),this.A="";10!=a&&(this.A+=String.fromCharCode(a))}Nc(this.b,this.ua,1E3/Math.round(this.na/10));this.g&=-129};var $g={},Yg=($g[65392]=[null,null,Wg.prototype.ce,Wg.prototype.$e,"RCSR"],$g[65394]=[null,null,Wg.prototype.be,Wg.prototype.Ze,"RBUF"],$g[65396]=[null,null,Wg.prototype.De,Wg.prototype.Cf,"XCSR"],$g[65398]=[null,null,Wg.prototype.Ce,Wg.prototype.Bf,"XBUF"],$g); ab(function(){for(var a=F(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.D[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.D[b]=c,c.onclick= function(){var a=d.D.listTapes;a&&wh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.R){c.parentNode.removeChild(c);break}this.D[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;wh(d,u(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.D[b]=c,!0}return!1}; k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;this.aa=xh(a);var e=this;if((this.g=Ad(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){w("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.T=Oc(56,4,4096);this.ga=Lc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=oa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.C.ma;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(lb(a.ib,e,f),(e=Ea(e,f))&&Gh(a,b,c,d,e.ha,e.Sa, e.Ra));a.C.kb=!1;a.F&&(a.F--,a.F||J(a));Dh(a)})}function Ah(a,b,c,d){if((a=a.D.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.la);for(d=0;dc.indexOf("/api/v1/dump")&&(b=oa(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"):pa(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.bc?"":e)+"&format=json"));return!!Da(f, null,!0,function(b,c,d){Nh(a,b,c,d)})} function Nh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.C.ma;if(d)a.controller.O('Unable to load disk "'+a.Ta+'" (error '+d+": "+b+")",f);else{lb(a.controller.ib,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(h.length)if(1==h.length)w(h[0]);else{a.la=h.length;a.ra=h[0].length;a.ia=h[0][0].length;var l=h[0][0][0];a.za=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var r=l.data;if(void 0===r){var t=l.bytes;if(void 0!==t&&t.length){for(var v=m<<2,A=t.length;A>2,e=Array(d),f=0;f>2,c=(d>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ma?f=a.Wa+a.Ma&&(a.Ma+=f-(a.Wa+a.Ma)+1):(a.Wa=f,a.Ma=1);d[f]=d[f]&~(255<g)break;e|=g<=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+ b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;lb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Ta+": "+c);return b}; k.toJSON=function(){var a;a=0;for(var b;b=Qh(this,a++);)Th(b);a=JSON.stringify(this.b,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 Th(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 Q(a){x.call(this,"RK11",a,Q,65536);this.I=a.autoMount||{};this.F=0;this.g=Array(8);this.K=!Ma("Mobi")&&window&&"FileReader"in window}B(Q);k=Q.prototype; k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RK11 option error: "+h.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.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&Uh(d,a)},!0;case "loadDrive":return this.D[b]= c,c.onclick=function(){var a=d.D.listDisks;a&&Vh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.K){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Y)?(a=Na(Sh(a),a.rc.replace(".json",".img")),w(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDrive":if(this.K)return this.D[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;Vh(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;if((a=Ad(this.B,"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.I[e]=a[e]);Wh(this);this.Gb=Oc(144,5,65536);Jb(b,this,Xh);Lb(b,this.reset.bind(this));Yh(this,"None","",!0);this.K&&Yh(this,"Local Disk","?");Yh(this,"Remote Disk","??");Zh(this)||J(this)}; k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RK"+b;a.appendChild(c)}a.value="0";Uh(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){Wh(this)};k.save=function(){return(new S(this)).data()}; k.restore=function(a){return Wh(this,a[0])};function Zh(a,b){b||(a.F=0);for(var c in a.I){var d=a.I[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('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=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}ai(a,e,b,c,!1,d)}else $h(a,e)} function ai(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,$h(a,b,!0),h.yb?a.O("RK11 busy"):(h.yb=!0,e&&(h.xb=!0,a.F++,I(a)&&G(a,"auto-loading disk: "+c)),h.eb=!!f,Mh(new Ih(a,h,"preload"),c,d,f,a.Zc)&&g++));return g} k.Zc=function(a,b,c,d,e){var f;a.yb=!1;b&&(f=Ph(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.O('Disk "'+c+'" too large for drive '+("RK"+a.zb)),b=null);b?(a.Y=b,a.Ta=c,a.La=d,this.O('Mounted disk "'+c+'" in drive '+("RK"+a.zb),a.xb||e),this.B&&this.B.pb()):a.eb=!1;a.xb&&(a.xb=!1,--this.F||J(this));Uh(this,a.zb)}; function Yh(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.G=65536-e&65535;a&&(this.A=this.A|a|32768,this.M|=49152);return!0};k.$c=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=4096;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=32;break}this.v.qb(f,r|t<<8);if(Kc(this.v)){h=1024;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)}; k.ad=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=128,e=0);for(;e--;){var r=this.v.Va(f);if(Kc(this.v)){h=1024;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=4096;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=32;break}if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=64;break}}return g(h,b,c,d,e,f)};k.he=function(){return this.L};k.ef=function(){};k.ie=function(){return this.A};k.ff=function(){};k.ee=function(){return this.M&61438}; k.bf=function(a){this.M=this.M&-3968|a&3967;if(this.M&1){var b,c=!0;a=(this.f&57344)>>13;var d=this.g[a],e,f,g,h;this.M&=-129;switch(this.M&14){case 0:this.L=d.status;this.A=0;this.M=128;this.f=0;break;case 4:b=this.$c;case 2:b||(b=this.ad),e=(this.f&8160)>>5,f=(this.f&16)>>4,g=this.f&15,e>=d.la?(this.A|=32832,this.M|=49152):g>=d.ia?(this.A|=32800,this.M|=49152):(h=(this.M&48)<<12|this.w,c=65536-this.G&65535,c=b.call(this,d,e,f,g,c,h,this.Yc.bind(this)))}this.L=d.status|a<<13|this.f%9&15;c&&(this.M&= -2,this.M|=128,this.M&64&&Mc(this.b,this.Gb))}};k.je=function(){return this.G};k.gf=function(a){this.G=a};k.de=function(){return this.w};k.af=function(a){this.w=a};k.fe=function(){return this.f};k.cf=function(a){this.f=a};k.ge=function(){return this.N};k.df=function(a){this.N=a}; var bi={},Xh=(bi[65280]=[null,null,Q.prototype.he,Q.prototype.ef,"RKDS"],bi[65282]=[null,null,Q.prototype.ie,Q.prototype.ff,"RKER"],bi[65284]=[null,null,Q.prototype.ee,Q.prototype.bf,"RKCS"],bi[65286]=[null,null,Q.prototype.je,Q.prototype.gf,"RKWC"],bi[65288]=[null,null,Q.prototype.de,Q.prototype.af,"RKBA"],bi[65290]=[null,null,Q.prototype.fe,Q.prototype.cf,"RKDA"],bi[65294]=[null,null,Q.prototype.ge,Q.prototype.df,"RKDB"],bi); function P(a){x.call(this,"RL11",a,P,131072);this.K=a.autoMount||{};this.I=0;this.g=Array(4);this.L=!Ma("Mobi")&&window&&"FileReader"in window}B(P);k=P.prototype; k.xa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.D[b]=c,c.onchange=function(){var a=d.D.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){w("RL11 option error: "+h.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.D[b]=c,c.onchange=function(){var a=ma(c.value,10);null!=a&&ci(d,a)},!0;case "loadDrive":return this.D[b]= c,c.onclick=function(){var a=d.D.listDisks;a&&di(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.D[b]=c;c.onclick=function(){var a=d.D.listDrives;a&&a.options&&d.g&&((a=d.g[ma(a.value,10)||0])?(a=a.Y)?(a=Na(Sh(a),a.rc.replace(".json",".img")),w(a)):d.O("No disk loaded in drive."):d.O("No disk drive selected."))};return!0;case "mountDrive":if(this.L)return this.D[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;di(d,u(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1}; k.Ha=function(a,b,c,d){this.B=a;this.v=b;this.b=c;this.j=d;if((a=Ad(this.B,"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.K[e]=a[e]);ei(this);this.Gb=Oc(112,5,131072);Jb(b,this,fi);Lb(b,this.reset.bind(this));gi(this,"None","",!0);this.L&&gi(this,"Local Disk","?");gi(this,"Remote Disk","??");hi(this)||J(this)}; k.Ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.B.pc){for(a=0;ab;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";ci(this,0)}}return!0};k.Ja=function(a){return a?this.save():!0};k.reset=function(){ei(this)};k.save=function(){return(new S(this)).data()}; k.restore=function(a){return ei(this,a[0])};function hi(a,b){b||(a.I=0);for(var c in a.K){var d=a.K[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.D.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.g.length)a.O("Unable to load the selected drive");else if(c)if("?"==c)a.O('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=u(c);a.status("Attempting to load "+c+' as "'+b+'"')}ji(a,e,b,c,!1,d)}else ii(a,e)} function ji(a,b,c,d,e,f){var g=-1,h=a.g[b];h.La.toLowerCase()!=d.toLowerCase()&&(g++,ii(a,b,!0),h.yb?a.O("RL11 busy"):(h.yb=!0,e&&(h.xb=!0,a.I++,I(a)&&G(a,"auto-loading disk: "+c)),h.eb=!!f,Mh(new Ih(a,h,"preload"),c,d,f,a.cd)&&g++));return g} k.cd=function(a,b,c,d,e){var f;a.yb=!1;b&&(f=Ph(b),b&&f[0]>a.la||f[1]>a.ra)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.zb)),b=null);b?(a.Y=b,a.Ta=c,a.La=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.zb),a.xb||e),this.B&&this.B.pb()):a.eb=!1;a.xb&&(a.xb=!1,--this.I||J(this));ci(this,a.zb)}; function gi(a,b,c,d){if((a=a.D.listDisks)&&a.options){for(var e=0;e>12&48;this.F=f>>16&63;this.A=this.f=b<<7|(c?64:0)|d&63;this.G=65536-e&65535;a&&(this.M=this.M|a|32768);return!0}; k.dd=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Y.seek(b,c,d+1);if(!m){h=5120;break}n=0}var r,t;if(0>(r=a.Y.read(m,n++))||0>(t=a.Y.read(m,n++))){h=5120;break}this.v.qb(f,r|t<<8);if(Kc(this.v)){h=8192;break}f+=2;if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.ed=function(a,b,c,d,e,f,g){var h=0,l=a.Y,m=null,n;l||(h=5120,e=0);for(;e--;){var r=this.v.Va(f);if(Kc(this.v)){h=8192;break}f+=2;if(!m){m=a.Y.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Y.write(m,n++,r&255)||!a.Y.write(m,n++,r>>8)){h=5120;break}if(n>=l.za&&(m=null,++d>=l.ia&&(d=0,++c>=l.ra&&(c=0,++b>=l.la)))){h=5120;break}}return g(h,b,c,d,e,f)};k.me=function(){return this.M&65535}; k.kf=function(a){this.M=this.M&-1023|a&1022;this.F=this.F&60|(a&48)>>4;if(!(this.M&128)){var b;a=!0;var c=this.g[(this.M&768)>>8],d,e,f,g;this.M&=-2;switch(this.M&14){case 4:this.f&8&&(this.M&=63);this.G=c.status|this.A&64;break;case 6:1==(this.f&3)&&(b=this.f&65408,c=(this.f&16)<<2,this.A=this.f&4?this.A+b:this.A-b,this.f=this.A=this.A&65408|c);break;case 8:this.G=this.A;break;case 12:b=this.dd;case 10:b||(b=this.ed),d=this.f>>7,e=this.f&64?1:0,f=this.f&63,d>=c.la||f>=c.ia?this.M|=37888:(g=(this.F& 63)<<16|this.w,a=65536-this.G&65535,a=b.call(this,c,d,e,f,a,g,this.bd.bind(this)))}a&&(this.M|=129,this.M&64&&Mc(this.b,this.Gb))}};k.ke=function(){return this.w};k.hf=function(a){this.w=a&65534};k.ne=function(){return this.f};k.lf=function(a){this.f=a};k.oe=function(){return this.G};k.mf=function(a){this.G=a};k.le=function(){return this.F};k.jf=function(a){this.F=a&63;this.M=this.M&-49|(this.F&3)<<4}; var ki={},fi=(ki[63744]=[null,null,P.prototype.me,P.prototype.kf,"RLCS"],ki[63746]=[null,null,P.prototype.ke,P.prototype.hf,"RLBA"],ki[63748]=[null,null,P.prototype.ne,P.prototype.lf,"RLDA"],ki[63750]=[null,null,P.prototype.oe,P.prototype.mf,"RLMP"],ki[63752]=[null,null,P.prototype.le,P.prototype.jf,"RLBE"],ki);function li(a){x.call(this,"Debugger",a,li);this.na=a.base||16;this.Ga=!1;this.K=0;this.U=!1;this.A=-1;this.g=[];this.fa={}}B(li); var mi={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};li.prototype.Ic=function(){return-1};li.prototype.Jc=function(){}; function ni(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.U?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(ua(b.substring(c,f))),c=f+1}}return a} function oi(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} function pi(a,b,c){var d;if(b){b=qi(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+na(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function ti(a,b){if(b)return si(a,b,a.fa[b]);var c=0;for(b in a.fa)si(a,b,a.fa[b]),c++;return 0this.b.lb?Di:[];Qc(this,16,function(a){a:{var b=d.v.ba,c=a[0],e=a=0,l=b.length;if(c){a=d.da(Ei(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.v.pa;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ec[c],n&&d.i(p(n.id,8)+" %"+ p(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} k.Jc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.gb[a-8];else if(20>a)b=this.b.Oa[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=fd(this.b);break;case 21:b=c.Mb;break;case 22:b=c.sa;break;case 23:b=c.ob;break;case 24:b=$c(c);break;case 25:b=bd(c);break;case 26:b=cd(c);break;case 27:b=c.Ya;break;case 28:d&&(b=d.Ba);break;case 29:d&&(b=d.Bb);break;case 30:d&&nc(d)&&(b=d.fb)}}return b}; k.message=function(a,b){b&&(a+=" @"+L(this,Y(this.b.wa&65535).H));if(!this.ua||a!=this.ua)if(this.ua=a,this.oa&1073741824)this.aa.push(a);else{var c;if(this.oa&-2147483648&&this.b&&(c=this.b.C.X)||qb(this,!0))this.ea(),c&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Id(a),a.Fa=0,a.ya())}}; function wi(a){var b;if(!Ke(a))a.G&&a.G.length&&a.i("instruction history buffer freed"),a.ga=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;a.i("trapped to "+L(a,c&255,1)+" ("+(0>d?Cb[-d]:L(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.R?Li(a):Mi(a)}}function Ki(a,b){var c;(c=!a.b||!yb(a.b))||(c=a.b,c.C.ma?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.C.X?(b||a.i("cpu busy or unavailable, command ignored"),!1):!zb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.Ja=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){wi(this);this.Fa=0;this.ua=null;this.K=0;this.L=Y(this.b.u[7]);this.C.X=!1;Ni(this);a||Dd(this)};k.save=function(){var a=new S(this);a.set(0,Gi(this.L));a.set(1,Gi(this.T));a.set(2,[this.g,this.U,this.oa]);a.set(3,this.I);return a.data()}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Hi(a[b++]),this.T=Hi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.U=a[b][1],this.oa|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.R||this.i("running");this.C.X=!0;this.Rb=a;this.Sb=b}; k.stop=function(a,b){if(this.C.X){this.C.X=!1;this.K=b-this.Sb;if(!this.R){b="stopped";if(this.K){a-=this.Rb;var c=0d&&(d=a.b.Va(b)),65535!=(d&65535)&&(a.sc(a.G[a.ga],b),++a.ga==a.G.length&&(a.ga=0)));return!1}function Rf(a){var b=a.b;if(b.C.X)throw T(b,a.b.wa&65535),a.ea(),-1;return!1} function vi(a){var b,c;a.f=["bp"];if(a.N)for(b=1;b>>d.pa],!1)}a.N=["br"];if(a.F)for(b=1;b>>d.pa],!0);a.F=["bw"];a.ab=0}k.wb=function(a,b,c){var d=!0;c||Oi(this,a,b,!1,!0);if(a!=this.f){var e=this.da(b);if(-1===e)this.i("invalid address: "+L(this,b.H)),d=!1;else{var f=this.v;f.ba[e>>>f.pa].wb(e&f.v,a==this.F)}}d&&(a.push(b),c?b.Ua=!0:(Pi(this,a,a.length-1,"set"),wi(this)));return d}; function Oi(a,b,c,d,e){var f=!1;c=a.da(c);for(var g=1;g>>d.pa],b==a.F));h.Ua||wi(a);break}}return f}function Qi(a,b){for(var c=1;c>23)&65535,y=L(v,t);else if(8192==C)t=t.H-((f&63)<<1)&65535,y=L(v,t);else if(12288==C)y=L(v,f&7,1);else if(24576==C)y=L(v,f&63,1);else if(32768==C)y=L(v,f&255,1);else if(C=f&A,A&4032&&(C>>=6,A>>=6), A&63)switch(A=C&7,C&56){case 0:y=Ji(A);break;case 8:y="@"+Ji(A);break;case 16:7>A?y="("+Ji(A)+")+":(C=v.va(t,2),y="#"+L(v,C,0,!0));break;case 24:7>A?y="@("+Ji(A)+")+":(C=v.va(t,2),y="@#"+L(v,C,0,!0));break;case 32:y="-("+Ji(A)+")";break;case 40:y="@-("+Ji(A)+")";break;case 48:C=v.va(t,2);y=L(v,C,0,!0)+"("+Ji(A)+")";7==A&&(y=L(v,C+t.H&65535));break;case 56:C=v.va(t,2),y="@"+L(v,C)+"("+Ji(A)+")",7==A&&(y="@"+L(v,C+t.H&65535))}v=y;if(!v||!v.length){h="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]); 0b)c=Ji(b),c+="="+L(a,d.u[b]);else if(13>b)c="A"+(b-8)+"="+L(a,d.gb[b-8]);else if(16<=b&&20>b)c="S"+(b-16)+"="+L(a,d.Oa[b-16]);else switch(b){case 20:c="PS="+L(a,fd(d));break;case 21:c="IR="+L(a,d.Mb);break;case 22:c="ER="+L(a,d.sa);break;case 23:c="SL="+L(a,d.ob);break;case 24:c="MMR0="+L(a,$c(d));break;case 25:c="MMR1="+L(a,bd(d));break;case 26:c="MMR2="+L(a,cd(d));break;case 27:c="MMR3="+L(a,d.Ya);break;case 28:a.w&&(c="AR="+L(a,a.w.Ba,3));break;case 29:a.w&& (c="DR="+L(a,a.w.Bb));break;case 30:a.w&&nc(a.w)&&(c="SR="+L(a,a.w.fb,3))}c&&(c+=" ");return c}function Ui(a,b){var c,d="";for(c=0;6>c;c++)d+=Z(a,c);d=d+"\n"+(Z(a,6)+Z(a,7));d+=Z(a,20)+Z(a,21)+Z(a,23);d+=Ti(a,"T")+Ti(a,"N")+Ti(a,"Z")+Ti(a,"V")+Ti(a,"C");b&&(b=d,c=""+(Z(a,24)+Z(a,25)),c+=Z(a,26)+Z(a,27)+Z(a,22),c=c+"\n"+(Z(a,30)+Z(a,28)+Z(a,29)),d=b+("\n"+c));return d}k.Fc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.Fc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Jg:b,H:c,xd:d,ja:e,Dc:f})}function Vi(a,b,c){var d=[],e=a.da(b)>>>0;for(b=0;b>>0,h=f.xd;if(e>=g&&eb)){e.u[b]= g&65535;break}a.i("unknown register: "+f);return}a.B.ya();a.i("updated registers:")}}a.i(Ui(a,d));c&&(a.L=Y(e.u[7]),Mi(a,L(a,a.L.H)))}}function Zi(a,b){b=ua(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Si(a,b,g,f);a.i(f);a.L=b;e-=b.H-l;c++}}} function Ri(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.U&&(a.i("ended assemble at "+L(a,a.T.H)),a.L=a.T,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ua=null;if(yb(a)&&0n||"z"wa.length&&(a.i("note: only "+wa.length+" available"),fa=wa.length);ka-=fa;0>ka&&(null==wa[wa.length-1].H?(fa=ka+fa,ka=0):ka+=wa.length);var ce=[];"call"==gh&&(ac=1E5,ce=["CALL"]);for(void 0!==fh&&a.i(fa+" instructions earlier:");0=wa.length&&(ka=0);a.tb=fa;ih++;ac--}}ih||(a.i("no "+hh+"history available"),a.tb=void 0)}else{var ub=Ei(a,va);if(ub){var cc=0,de=!1,ee="ds"==Ua;Va&&(de=!0,"l"==Va.charAt(0)&&(de=!1,Va=Va.substr(1)||sj),cc=ri(a,Va)>>>0,65536he?String.fromCharCode(he):"."),Uc=Uc>>8}Wa&&(Wa+="\n");Wa=ee?Wa+(Xa+","):Wa+(va+" "+Xa+(0==Tc?" "+ge:""))}Wa&&a.i(Wa);a.Za=ub}}}}break;case "e":if("else"==g[0])break;var xb,ie,je,ke,le=g[0],me=g[1];"eb"==le?(xb=1,ie=255,je=a.dc,ke=a.Nb):"e"== le||"ew"==le?(xb=2,ie=65535,je=a.va,ke=a.Db):me=null;if(null==me)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var Vc=Ei(a,me);if(Vc)for(var Wc=2;Wcpe;){for(var Ya=null,xj=256;65536>hc.H>>>0;){qe.H=a.va(hc,2);if(null==hc.H||!xj--)break;if(!(qe.H&1)){for(var yj=a,Xc=qe,mh=null,ic=Xc.H,nh=ic,re=1;6>=re&⁣re++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bdj){if(fj(d,this.I)){this.A=new S(this,"1.30.5","failsafe");fj(this.A)&&(kj(this,d),a=2,lj(this.A));this.A.set("timestamp",Ca());mj(this.A);var e=this.f&&!this.F;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=jj(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?fj(d,g):("error"== f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Ka("user",""),this.B=null)):this.i(f+": "+g),lj(d),fj(d)?(c=jj(d),e=!0):c=!1))}e&&ij(this,c?d:null)}else 2==a&&d.clear()}else ij(this);delete this.I;delete this.K}e=mb(this.id);for(f=0;fa[1];a=a[2];this.ga=!0;this.C.ma=!0;var d=this.D.power;d&&(d.textContent="Shutdown");this.b&&(nj(this,this.b,b,c,a),this.ya(),this.b.Eb());this.R&&(kj(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.g=0}; function kj(a,b){if(Ga("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.B||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.5"};d.url=a.fa;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} function aj(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new S(a,"1.30.5"),g=new S(a,"1.30.5","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.5");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ja&&(c&&a.b.ea(),d=a.b.Ja(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.C.ma=!1,!1===d&&(e=null)));for(var h=mb(a.id),l=0;l=c||30<=(b.Qb+=c))&&(d.textContent=b.C.X?b.Ea.toFixed(2)+"Mhz":"Stopped",b.Qb=0)}if(this.w&&(b=this.w,a=a||0,b.F)){c=b.b.C.X;d=!!(b.b.J&8);if(0>=a||60<=(b.A+=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(n){f=null,a=n.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],g);Ej(a,b,c)}})}else c(a,null)} function Fj(a,b,c,d){function e(a){if(void 0===h){var b=g&&F(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=ra(a))}function f(a){e("Error: "+a);l&&(--rj||cb(!0));l=!1}var g,h,l=!0;rj++;kb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));n.appendChild(r)}c|| (c="/versions/pdpjs/1.30.5/components.xsl");m=function(d,h){h?Cj(c,null,null,!1,e,function(d,l){l?(lb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--rj||cb(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--rj||cb(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Cj(b,a,d,!0,e,m):Dj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPDP11=function(a,b,c,d){cb(!1);return Fj(a,b,c,d)};window.enableEvents=cb;window.sendEvent=db;})();//# sourceMappingURL=/tmp/pdpjs/1.30.5/pdp11-dbg.map