(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/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,ba="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)},ca="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,da=["Math","log2"],ea=0;ea>=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 sa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function wa(a){return a.replace(/[&<>"']/g,function(a){return va[a]})} function xa(a,b){return(a+" ").slice(0,b)}function ya(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",13:"CR",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 Ea(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 Fa(a,b){var c,d={da:null,ha:null,La:null,Ka: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.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.da=e;else if(e=g.words)for(d.da=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.da=Array(4*e.length),f=c=0;c>8&255,d.da[f++]=e[c]>>16&255,d.da[f++]=e[c]>>24&255;else d.da=g;d.ha=g.symbols;d.da.length?1==d.da.length&&(q(d.da[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Ya=this.id:(this.Qa=this.id.substr(0,b),this.Ya=this.id.substr(b+1));this[a]=c;this.A={ready:!1,ab:!1,bc:!1,ia:!1,error:!1};this.Tb=null;this.A.error=!1;this.G={};this.i=null;this.na=d||0;u.push(this)}var ab=void 0,bb={}; if(window){ab||(ab=window.location.search.substr(1));for(var cb,db=/\+/g,eb=/([^&=]+)=?([^&]*)/g;cb=eb.exec(ab);)bb[decodeURIComponent(cb[1].replace(db," "))]=decodeURIComponent(cb[2].replace(db," "))}function fb(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=t);a.prototype=fb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var mb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else mb={},u=[];function nb(a,b,c){mb[a]&&b&&(mb[a][b]=c)}function ob(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.g["S"+a]=[0,!1,!1,this.ed,a]}z(yb);var zb=7;function Ab(a,b){return a.g[b]&&a.g[b][0]}k=yb.prototype;k.reset=function(){this.stop()}; k.ta=function(a,b,c,d){if(this.B&&this.B.ta(a,b,c,d)||this.b&&this.b.ta(a,b,c,d)||this.i&&this.i.ta(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.G[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.C[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){var c= a.g[b];Bb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);"STEP"!=b&&(a.K="DEP"==b,a.L="EXAM"==b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.g[b];c[1]&&c[2]&&(Bb(a,b,c[0]=1-c[0]),c[3]&&c[3].call(a,c[0],c[4]));c[2]=!1}}(this,b),!0):this.parent.ta.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;Cb(b,this,Db);Eb(b,this.reset.bind(this));Fb(this);Gb(this)};k.Ha=function(a,b){b||(Hb(),this.reset());return!0};k.Ga=function(){return!0}; function Ib(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Fb(a,b){for(var c in a.C)Ib(a,c,null!=b?b:a.C[c])}function Bb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Gb(a){for(var b in a.g)Bb(a,b,a.g[b][0])}function Jb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ga()),c=8==(a.i&&a.i.ca||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} k.cd=function(a){a||this.b.A.Z||(this.w.reset(),Yb(this.b),Ab(this,"ENABLE")&&this.b.jb())};k.dd=function(){};k.Zc=function(a){a||this.b.ga()};k.Xc=function(a){if(!a&&!this.b.A.Z)if(Ab(this,"ENABLE"))this.b.jb();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.kb(0),rb(a,!1);else try{var b=this.b.kb(1);0a.b.pb?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.w.Fa;Ab(a,"STEP")||(b=-b);a.f=a.f&~c|a.f+b&c;dc(a,"A",a.f,22)}function cc(a,b){a.v=b&65535;dc(a,"D",a.v,16);return a.v}function fc(a,b,c){a.C[b]=c;a.H||Ib(a,b,c)}function dc(a,b,c,d){for(var e=0;ec;c++)a.g["S"+c][0]=b&1<>2;this.w=this.ya-1;this.D=this.H/this.ya|0;this.$a=[];this.la=0;this.f=!1;this.Ob=0;this.C=[];this.Jc=[kc,lc,mc,nc];a=new I(this);oc(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&e[2]&&(c=e[2](f&-2)>>8);if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,3);c=255;this.i&&F(this.i,e[5])&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} function lc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](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.$a[a&-2])&&f[3]&&(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0);d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,5),this.i&&F(this.i,f[5])&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} function mc(a,b){var c=-1,d=this.controller;a=d.$a[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.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c} function nc(a,b,c){var d=!1,e=this.controller;a=e.$a[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.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Da(c,16,4),this.i&&F(this.i,a[5])&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))} function qc(a,b){if(b!=a.B){var c;a.B&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Mb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Mb){n=l.size-(f-m);n>g&&(n=g);l.Mb=f-l.F+n;f=m+a.ya;g-=n;h++;continue}}return vc(1,f,g)}f=new I(a,f,n,a.ya,d,e);oc(f,a.i,l);a.W[h++]=f;f=m+a.ya;g-=n}return 0>=g?(d!=wc||a.Ob||(a.Ob+=c),a.status((c>>10)+"Kb "+xc[d]+" at "+ra(b)),!0):vc(2,b,c)} function sc(a,b,c){var d=[];for(b>>>=a.ka;0>>=a.ka;0>>this.ka].Xb(a&this.w,a)};k.Vb=function(a){3932160<=a&&(a=yc(this.b,a));this.f=!1;this.la++;a=this.W[(a&this.Fa)>>>this.ka].hc(a&this.w,a);this.la--;return a}; k.oa=function(a){3932160<=a&&(a=yc(this.b,a));return this.W[(a&this.Fa)>>>this.ka].sa(a&this.w,a)};k.bb=function(a){3932160<=a&&(a=yc(this.b,a));var b=a&this.w,c=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;a=this.W[c].ic(b,a);this.la--;return a};k.Yb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.W[(a&this.Fa)>>>this.ka].$b(a&this.w,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=yc(this.b,a));this.f=!1;this.la++;this.W[(a&this.Fa)>>>this.ka].ac(a&this.w,b&255,a);this.la--}; k.ib=function(a,b){3932160<=a&&(a=yc(this.b,a));this.W[(a&this.Fa)>>>this.ka].Nb(a&this.w,b&65535,a)};k.Db=function(a,b){3932160<=a&&(a=yc(this.b,a));var c=a&this.w,d=(a&this.Fa)>>>this.ka;this.f=!1;this.la++;this.W[d].mc(c,b&65535,a);this.la--}; function zc(a){for(var b=0,c=[],d=0;da.b.pb)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y>5&3;b.Na=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Oc(b))}};k.rd=function(){var a=this.b.fb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.sd=function(){return this.b.Kb};k.td=function(){return this.b.qb};k.le=function(a){var b=this.b;1170>b.pb&&(a&=-49);b.qb!=a&&(b.qb=a,b.Sb=a&16?4194303:262143,Oc(b))};k.Ud=function(a){a=a>>1&63;var b=this.b.Lb[a>>1];return a&1?b>>16:b&65535}; k.Me=function(a,b){b=b>>1&63;var c=b>>1;this.b.Lb[c]=b&1?this.b.Lb[c]&65535|(a&63)<<16:this.b.Lb[c]&-65536|a&65534};k.Nd=function(a){return this.b.V[1][a>>1&7]};k.Fe=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Ld=function(a){return this.b.V[1][(a>>1&7)+8]};k.De=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Md=function(a){return this.b.xa[1][a>>1&7]};k.Ee=function(a,b){b=b>>1&7;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.Kd=function(a){return this.b.xa[1][(a>>1&7)+8]}; k.Ce=function(a,b){b=(b>>1&7)+8;this.b.xa[1][b]=a;this.b.V[1][b]&=65295};k.nd=function(a){return this.b.V[0][a>>1&7]};k.he=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.ld=function(a){return this.b.V[0][(a>>1&7)+8]};k.fe=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.md=function(a){return this.b.xa[0][a>>1&7]};k.ge=function(a,b){b=b>>1&7;this.b.xa[0][b]=a;this.b.V[0][b]&=65295};k.kd=function(a){return this.b.xa[0][(a>>1&7)+8]};k.ee=function(a,b){b=(b>>1&7)+8;this.b.xa[0][b]=a;this.b.V[0][b]&=65295}; k.Td=function(a){return this.b.V[3][a>>1&7]};k.Le=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Rd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Je=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Sd=function(a){return this.b.xa[3][a>>1&7]};k.Ke=function(a,b){b=b>>1&7;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Qd=function(a){return this.b.xa[3][(a>>1&7)+8]};k.Ie=function(a,b){b=(b>>1&7)+8;this.b.xa[3][b]=a;this.b.V[3][b]&=65295};k.Bb=function(a){a&=7;return this.b.N&2048?this.b.Wa[a]:this.b.u[a]}; k.Eb=function(a,b){b&=7;this.b.N&2048?this.b.Wa[b]=a:this.b.u[b]=a};k.yd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.qe=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Bd=function(){return this.b.u[7]};k.te=function(a){this.b.u[7]=a};k.Cb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Wa[a]};k.Fb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Wa[b]=a};k.zd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]}; k.re=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ad=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.se=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.hd=function(a){return this.b.Cc[a-65504>>1]};k.ce=function(a,b){this.b.Cc[b-65504>>1]=a};k.zc=function(a){if(65520==a){a=0;switch(wc){case wc:a=this.w.Ob}a=(a>>6)-1}else a=0;return a};k.Gc=function(){};k.Pd=function(){return 1};k.He=function(){};k.gd=function(){return this.b.fa}; k.be=function(){this.b.fa=0};k.pd=function(){return this.b.Bc};k.je=function(a,b){b&1||(a&=255);this.b.Bc=a};k.ud=function(a){return a?this.b.kc:0};k.me=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.kc=a;b.I|=2};k.Od=function(a){return a?this.b.gb&65280:0};k.Ge=function(a){this.b.gb=a|255};k.xd=function(){return Pc(this.b)};k.pe=function(a){Qc(this.b,a&-1809|Pc(this.b)&1808);this.b.I|=128};k.Fc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; var M={},L=(M[61568]=[null,null,K.prototype.Ud,K.prototype.Me,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Nd,K.prototype.Fe,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Ld,K.prototype.De,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Md,K.prototype.Ee,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Kd,K.prototype.Ce,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.nd,K.prototype.he,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.ld,K.prototype.fe,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.md, K.prototype.ge,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.kd,K.prototype.ee,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.td,K.prototype.le,"MMR3",1,1145],M[65382]=[null,null,K.prototype.od,K.prototype.ie,"LKS"],M[65402]=[null,null,K.prototype.qd,K.prototype.ke,"MMR0",1,1145],M[65404]=[null,null,K.prototype.rd,K.prototype.Fc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.sd,K.prototype.Fc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Td,K.prototype.Le,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Rd, K.prototype.Je,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Sd,K.prototype.Ke,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Qd,K.prototype.Ie,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Bb,K.prototype.Eb,"R0SET0"],M[65473]=[null,null,K.prototype.Bb,K.prototype.Eb,"R1SET0"],M[65474]=[null,null,K.prototype.Bb,K.prototype.Eb,"R2SET0"],M[65475]=[null,null,K.prototype.Bb,K.prototype.Eb,"R3SET0"],M[65476]=[null,null,K.prototype.Bb,K.prototype.Eb,"R4SET0"],M[65477]=[null,null,K.prototype.Bb,K.prototype.Eb, "R5SET0"],M[65478]=[null,null,K.prototype.yd,K.prototype.qe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Bd,K.prototype.te,"R7KERNEL"],M[65480]=[null,null,K.prototype.Cb,K.prototype.Fb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Cb,K.prototype.Fb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Cb,K.prototype.Fb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Cb,K.prototype.Fb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Cb,K.prototype.Fb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Cb, K.prototype.Fb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.zd,K.prototype.re,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Ad,K.prototype.se,"R6USER",1,1145],M[65504]=[null,null,K.prototype.hd,K.prototype.ce,"CTRL",1,1170],M[65520]=[null,null,K.prototype.zc,K.prototype.Gc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.zc,K.prototype.Gc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Pd,K.prototype.He,"SYSID",1,1170],M[65526]=[null,null,K.prototype.gd,K.prototype.be,"CPUERR",1,1170],M[65528]= [null,null,K.prototype.pd,K.prototype.je,"MB",1,1170],M[65530]=[null,null,K.prototype.ud,K.prototype.me,"PIR"],M[65532]=[null,null,K.prototype.Od,K.prototype.Ge,"SL"],M[65534]=[null,null,K.prototype.xd,K.prototype.pe,"PSW"],M);L[65506]=L[65504];L[65508]=L[65504];L[65510]=L[65504];L[65512]=L[65504];L[65514]=L[65504];L[65516]=L[65504];L[65518]=L[65504]; Xa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,this.size>>2),Yc(this,Uc?Zc:$c);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.w.Da(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},ua: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.Sa=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;ed(c,this.F+a,1,c.M)&&c.ga(!0)}return this.hc(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;ed(c,this.F+a,2,c.M)&&c.ga(!0)}return this.ic(a,b)},Ya:function(a, b,c){if(this.i&&null!=this.F){var d=this.i;ed(d,this.F+a,1,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.ac(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;ed(d,this.F+a,2,d.D)&&d.ga(!0)}this.f?this.v(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Qa:function(a,b){a&1&&this.w.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.w.Da(b,64,2); a=this.J[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ja:function(a,b){this.G[a]=b;this.Sa=!0},ma:function(a,b,c){this.G[a]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&this.w.Da(c,64,4);this.D.setUint16(a,b,!0);this.Sa=!0},Ja:function(a,b,c){a&1&&this.w.Da(c,64,4);this.J[a>>1]=b;this.Sa=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, b)+")",!0)}};function oc(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&dd(a,cd,!1),(a.B=c.B)&&bd(a,cd,!1))}function fd(a,b){b?--a.B||(a.$b=a.f?a.v:a.ac,a.Nb=a.f?a.H:a.mc):--a.g||(a.Xb=a.hc,a.sa=a.ic)}function bd(a,b,c){c&&a.B||(a.$b=!a.f&&b[1]||a.v,a.Nb=!a.f&&b[3]||a.H);if(c||void 0===c)a.ac=b[1]||a.v,a.mc=b[3]||a.H}function dd(a,b,c){c&&a.g||(a.Xb=b[0]||a.K,a.sa=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.K,a.ic=b[2]||a.L}function Yc(a,b){b||(b=gd);dd(a,b,void 0);bd(a,b,void 0)} var gd=[],ad=[I.prototype.S,I.prototype.ua,I.prototype.ca,I.prototype.Na],cd=[I.prototype.P,I.prototype.Ya,I.prototype.Y,I.prototype.Aa];if(wb)var $c=[I.prototype.M,I.prototype.ja,I.prototype.Qa,I.prototype.wa],Zc=[I.prototype.R,I.prototype.ma,I.prototype.$,I.prototype.Ja]; function hd(a,b){t.call(this,"CPU",a,hd,1);var c=a.multiplier||1;this.mb=a.cycles||b;this.eb=c;this.vb=Math.round(this.mb/1E4)/100;this.ob=this.vb*this.eb;this.A.Z=!1;this.A.Zb=!1;this.A.ub=a.autoStart;this.A.xb=!1;this.Hb=this.ma=0;this.Ib=a.csStart;this.yb=a.csInterval;this.zb=a.csStop;this.K=[];this.wc=this.Yd.bind(this);H(this)}z(hd);var id=["power","reset"];k=hd.prototype; k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.yb,c=!0);0<=a.zb&&a.zb<=od(a)&&(a.yb=a.zb=-1,ld(a),a.ga(),c=!0);c&&a.j(od(a)+" cycles: checksum="+p(a.Hb))}} k.ta=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.A.ia)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.Y/a.ob?b=1:d=!0;a.eb=b;b=a.vb*a.eb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.sb()}$b(a,a.S);a.S=0;a.R=Ba();a.$=0;qd(a);return d}function Kc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Mc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.mb*a.eb/1E3*c|0,a.K[b][0]=c+rd(a))} function sd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function Zb(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function rd(a,b){var c=a.ca-=a.b;a.b=a.J=0;b&&(a.ca=0);return c} k.Yd=function(){if(this.A.Z){this.wb>=this.mb&&qd(this,!0);this.Aa=0;this.Za=Ba();if(this.$){var a=this.Za-this.$;a>this.Ub&&(this.R+=a,this.R>this.Za&&(this.R=this.Za))}try{do{var b=sd(this,this.A.xb?1:this.lb);try{this.kb(b)}catch(e){if("number"!=typeof e)throw e;}b=rd(this,!0);this.Aa+=b;this.S+=b;ac(this,b);Zb(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.lb;15<=++this.Wb&&(this.qa(),this.Wb=0);break}}while(this.A.Z)}catch(e){this.ga();this.B&&this.B.stop(Ba(),od(this));vb(this,e.stack||e.message); return}if(this.A.Z){a=setTimeout;b=this.wc;this.$=Ba();var c=this.Ub;this.Aa&&(c=Math.round(c*this.Aa/this.lb));var c=c-(this.$-this.Za),d=this.$-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.ja=0,pd(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.wb+=this.Aa;this.$+=c;a(b,c)}}}; k.jb=function(a){if(ub(this))return!1;if(this.A.Z)return this.j(this.toString()+" busy"),!1;pd(this);this.A.Z=!0;this.A.Zb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.sb(!0),this.B.start(this.R,od(this)));setTimeout(this.wc,0);return!0};k.kb=function(){return 0};k.ga=function(a){var b=!1;if(this.A.Z){rd(this);$b(this,this.S);this.S=0;this.A.Z=!1;if(b=this.G.run)b.textContent="Run";this.B&&this.B.stop(Ba(),od(this));b=!0}this.A.complete=a;return b}; function td(a){this.pb=+a.model||1170;this.Pb=a.addrReset||0;hd.call(this,a,6666667);this.decode=1120==this.pb?ud.bind(this):vd.bind(this);wd(this);this.L=0;this.M=null;this.A.complete=!1}z(td,hd);k=td.prototype;k.reset=function(){this.status("model "+this.pb);this.A.Z&&this.ga();wd(this);kd(this);this.A.error=!1;this.parent.reset.call(this)}; function wd(a){a.T=65536;a.U=32768;a.aa=65535;a.X=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.Pb];a.Wa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.v=0;a.Na=0;a.Sc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.xa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Cc=[0,0,0,0,0,0,0,0];a.Bc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.tb=0;a.wa=-1;Yb(a)}function Yb(a){a.gb=255;a.fa=0;a.kc=0;a.C=0;a.fb=0;a.Kb=0;a.qb=0;a.Ua=0;a.Ja=0;a.Sb=262143;a.M=null;a.w&&Oc(a)}function Oc(a){a.Ua?(a.P=65536,a.ba=a.Rc,a.sa=a.Vd,a.Nb=a.Ne,qc(a.w,a.qb&16?22:18)):(a.P=0,a.ba=a.Qc,a.sa=a.Ac,a.Nb=a.Hc,qc(a.w,16))}function xd(a,b,c){a.Pb=b;O(a,b);!c&&a.i&&(a.ga()||md(a.i))}k.tc=function(){return 0}; k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.ja,this.eb]);a.set(2,zc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.ja=b[1];pd(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.N>>14&3;a.v!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.v]);a.N=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.aa=b,a.U=0)}function Dd(a,b,c){a.I&128||(a.X=a.aa=a.T=b,a.U=c||0)}function Ed(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^b)&(d^b))} function Fd(a,b){a.I&128||(a.X=a.aa=a.T=b,a.U=a.X^a.T>>1)}function Gd(a,b,c,d){a.I&128||(a.X=a.aa=a.T=b,a.U=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.wa?this.wa=Pc(this):this.v||(a=4,c=!0);this.C&57344||(this.fb=63222,this.Kb=a);this.v=0;var d=this.sa(a|this.P),e=this.sa(a+2&65535|this.P);Qc(this,e&-12289|this.wa>>2&12288);c&&(this.fa|=4,this.u[6]=4);Yd(this,this.wa);Yd(this,this.u[7]);O(this,d);this.I&=-113;this.wa=-1;this.I|=8;this.Wc=a;this.Uc=b;if(26!=b)throw a;}}; function Zd(a){var b=$d(a),c=$d(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Qc(a,c);a.I&=-17}function yc(a,b){var c=b>>13&31;31>c&&a.qb&32&&(b=a.Lb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function ae(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.qb&a.Sc[a.v]||(d&=7);e=a.V[a.v][d];f=(a.xa[a.v][d]<<6)+(b&8191)&a.Sb;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.V[a.v][d]=e;if(4194170!==f||a.v)a.Ja=a.v,a.Na=d;b=!1;g&&(g&57344&&(0<=a.wa&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ja<<5|a.Na<<1), b=!0),a.C&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.sa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.sa(e)| g;a.b-=8;break;case 6:return e=a.sa(Cd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Cd(a,2)),e=e+a.u[c]&65535,e=a.sa(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.fb=a.fb<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.u[6]<=a.gb||65534<=a.u[6])&&(a.u[6]<=a.gb-32?(a.fa|=4,a.u[6]=4,a.pa(4,24)):(a.fa|=8,a.I|=64));return e}k.Vb=function(a){if(!this.Ua)return this.w.Vb(a);this.L++;a=be(this,ae(this,a,3));this.L--;return a}; k.bb=function(a){if(!this.Ua)return this.w.bb(a);this.L++;a=this.Ac(ae(this,a,2));this.L--;return a};k.rb=function(a,b){this.Ua?(this.L++,ce(this,ae(this,a,5),b),this.L--):this.w.rb(a,b)};k.Db=function(a,b){this.Ua?(this.L++,this.Hc(ae(this,a,4),b),this.L--):this.w.Db(a,b)};k.Qc=function(a,b,c){return de(this,a,b,c)};k.Rc=function(a,b,c){return ae(this,de(this,a,b,c),c)};k.Ac=function(a){return this.w.oa(a)};k.Vd=function(a){return this.w.oa(ae(this,a,2))};k.Hc=function(a,b){this.w.ib(a,b&65535)}; k.Ne=function(a,b){this.w.ib(ae(this,a,4),b)};function ee(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=de(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.v=a.N>>12&3,c=a.sa(d|c&a.P),a.v=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function fe(a,b,c,d){a.C&57344||(a.fb=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=de(a,b,e,4),c&65536||(e&=65535),a.v=a.N>>12&3,e=ae(a,e|c&65536,4),a.v=a.N>>14&3,a.w.ib(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d} function ge(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?be(a,a.ba(b,c,3)):a.u[c]&255}function he(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]}function ie(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return de(a,b,c,8)}function je(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?be(a,a.ba(b,c,3)):a.u[c]&255}function ke(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.ba(b,c,2)):a.u[c]} function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.tb=a.ba(b,e,7),ce(a,e,d.call(a,c,be(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function T(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.w.ib(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function le(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?ce(a,a.ba(b,e,5),c):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c} function me(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.ib(a.ba(b,d,4),c):a.u[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} k.kb=function(a){this.A.complete=!0;var b=this.i&&ne(this.i)?1:this.A.Zb?-1:0,c=a?this.A.Zb?0:1:-1;this.A.Zb=!1;this.ca=this.b=a;do{if(b){if(this.i&&oe(this.i,this.u[7],c)){this.ga();break}c||c++;b++}if(this.I){this.I&112&&(this.I&32?this.pa(168,28):this.I&64?this.pa(4,30):this.I&16&&this.pa(12,32),this.I&=-113);if(a=this.I&7){a=!1;if(this.I&2){this.I&=-3;var d=160,e=(this.kc&224)>>5,f=this.M&&this.M.Ab>e?this.M:null;f&&(d=f.$d,e=f.Ab);e>(this.N&224)>>5?(this.I&4&&(Cd(this,2),this.I&=-5),this.pa(d, 26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.M,f==a)this.M=a.next;else for(;f;){e=f.next;if(e==a){f.next=e.next;break}f=e}a=!0}}else this.I&1&&this.I++;a=a&&0>c}if(a)break}this.I=this.I&7|this.N&16;this.decode(Bd(this))}while(0>1|b<<16;Fd(this,a);return a&65535}function ue(a,b){a=b&2048|b>>1|b<<8;Fd(this,a<<8);return a&255}function ve(a,b){a=b&~a;R(this,a);return a}function we(a,b){a=b&~a;R(this,a<<8);return a}function xe(a,b){a|=b;R(this,a);return a}function ye(a,b){a|=b;R(this,a<<8);return a} function ze(a,b){a=~b|65536;Dd(this,a);return a&65535}function Ae(a,b){a=~b|256;Dd(this,a<<8);return a&255}function Be(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.U=b&(b^a));return a&65535}function Ce(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.aa=c,this.U=b&(b^c));return a&255}function De(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.U=a&(b^a));return a&65535}function Ee(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.aa=c,this.U=c&(b<<8^c));return a&255} function Fe(a,b){a=-b;Dd(this,a,a&b&32768);return a&65535}function Ge(a,b){a=-b;Dd(this,a<<8,(a&b&128)<<8);return a&255}function He(a,b){a=b<<1|this.T>>16&1;Fd(this,a);return a&65535}function Ie(a,b){a=b<<1|this.T>>16&1;Fd(this,a<<8);return a&255}function Je(a,b){a=(this.T&65536|b)>>1|b<<16;Fd(this,a);return a&65535}function Ke(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;Fd(this,a<<8);return a&255}function Le(a,b){var c=b-a;Gd(this,c,a,b);return c&65535} function Me(a,b){var c=b-a;Gd(this,c<<8,a<<8,b<<8);return c&255}function Ne(a,b){this.I&128||(this.X=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Oe(a,b){a^=b;R(this,a);return a&65535}function Pe(a){T(this,a,he(this,a),pe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Qe(a){var b=ke(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b} function Re(a){var b=ke(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32>b-1;this.T=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.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Se(a){U(this,a,!yd(this))}function Te(a){U(this,a,yd(this))} function Ue(a){T(this,a,he(this,a),ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Ve(a){S(this,a,ge(this,a),we);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function We(a){T(this,a,he(this,a),xe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Xe(a){S(this,a,ge(this,a),ye);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Ye(a){R(this,he(this,a)&ke(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Ze(a){R(this,(ge(this,a)&je(this,a))<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function $e(a){U(this,a,Ad(this))}function af(a){U(this,a,!this.Ta()==!zd(this))}function bf(a){U(this,a,!Ad(this)&&!this.Ta()==!zd(this))}function cf(a){U(this,a,!yd(this)&&!Ad(this))}function df(a){U(this,a,Ad(this)||!this.Ta()!=!zd(this))} function ef(a){U(this,a,yd(this)||Ad(this))}function ff(a){U(this,a,!this.Ta()!=!zd(this))}function gf(a){U(this,a,this.Ta())}function hf(a){U(this,a,!Ad(this))}function jf(a){U(this,a,!this.Ta())}function kf(){this.pa(12,1);this.b-=5}function lf(a){U(this,a,!0)}function mf(a){U(this,a,!zd(this))}function nf(a){U(this,a,zd(this))}function V(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5} function of(a){var b=he(this,a);a=ke(this,a);Gd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function pf(a){var b=ge(this,a)<<8;a=je(this,a)<<8;Gd(this,b-a,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)} function qf(a){var b=ke(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=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.aa=d>>16|d,this.X=d>>16):(this.U=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.U=32768,this.T=65536,this.b-=7}function rf(){this.pa(24,2);this.b-=25} function sf(){this.N&49152?(this.fa|=128,this.pa(4,3)):this.i?tf(this.i):this.ga();this.b-=7}function uf(){this.pa(16,4);this.b-=25}var vf=[0,7,7,10,7,11,9,13];function wf(a){this.J=this.b;O(this,ie(this,a));this.b=this.J-vf[this.g]}var xf=[0,14,14,17,14,18,16,20];function yf(a){this.J=this.b;var b=ie(this,a);a=a>>6&7;Yd(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.J-xf[this.g]}var zf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function Af(a){var b=he(this,a);this.J=this.b;R(this,me(this,a,b));this.b=this.J-zf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Bf(a){var b=ge(this,a);R(this,le(this,a,b,1)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Cf=[7,13,13,17,14,18,17,21]; function Df(a){var b=ke(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.I&128||(this.X=b>>16,this.aa=this.X|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Jf(a){T(this,a,he(this,a),Le);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Kf(a){T(this,a,0,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}function Lf(){this.pa(28,5);this.b-=5}function Mf(){this.I|=4;Cd(this,-2);this.b-=3}function Nf(a){T(this,a,he(this,a),Oe);this.b-=this.g?9:3+(7==this.f?2:0)}function W(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=tf(b);b||this.pa(8,6)}function ud(a){Of[a>>12].call(this,a)}function Pf(a){Qf[a>>6&3].call(this,a)}function Rf(a){Sf[a>>6&3].call(this,a)}function Tf(a){Uf[a>>6&3].call(this,a)} function Vf(a){Wf[a&15].call(this,a)}function Xf(a){Yf[a&15].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)} var Of=[function(a){eg[a>>8&15].call(this,a)},Af,of,Ye,Ue,We,Pe,W,function(a){fg[a>>8&15].call(this,a)},Bf,pf,Ze,Ve,Xe,Jf,W],eg=[function(a){gg[a>>4&15].call(this,a)},lf,hf,$e,af,ff,bf,df,yf,yf,Pf,Rf,Tf,W,W,W],Qf=[function(a){Dd(this,me(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,Be);this.b-=this.g?9:3+(7==this.f?2:0)}],Sf=[function(a){T(this,a,0, Fe);this.b-=this.g?11:6},function(a){T(this,a,yd(this)?1:0,pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,yd(this)?1:0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ke(this,a);Dd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Uf=[function(a){T(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,He);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,re);this.b-=this.g?9:3+(7==this.f?2:0)}], gg=[function(a){hg[a&15].call(this,a)},W,W,W,wf,wf,wf,wf,Hf,W,Vf,Xf,Kf,Kf,Kf,Kf],hg=[sf,Mf,Gf,kf,uf,Ff,W,W,W,W,W,W,W,W,W,W],Wf=[Ef,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},V,function(){this.aa=1;this.b-=5},V,V,V,function(){this.X=0;this.b-=5},V,V,V,V,V,V,V],Yf=[Ef,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},X,function(){this.aa=0;this.b-=5},X,X,X,function(){this.X=32768;this.b-=5},X,X,X,X,X,X,X],fg=[jf,gf,cf,ef,mf,nf,Se,Te,rf,Lf,Zf,ag,cg,W,W,W],$f=[function(a){Dd(this, le(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){S(this,a,0,Ge);this.b-=this.g?11:6},function(a){S(this,a,yd(this)?1:0,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,yd(this)?1:0,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=je(this,a);Dd(this,a<<8);this.b-=this.g?4:3+(7== this.f?2:0)}],dg=[function(a){S(this,a,0,Ke);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ue);this.b-=this.g?9+(this.tb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)}];function vd(a){ig[a>>12].call(this,a)} var ig=[function(a){jg[a>>8&15].call(this,a)},Af,of,Ye,Ue,We,Pe,function(a){kg[a>>8&15].call(this,a)},function(a){lg[a>>8&15].call(this,a)},Bf,pf,Ze,Ve,Xe,Jf,W],jg=[function(a){mg[a>>4&15].call(this,a)},lf,hf,$e,af,ff,bf,df,yf,yf,Pf,Rf,Tf,function(a){ng[a>>6&3].call(this,a)},W,W],ng=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.sa(a|this.P);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=ee(this,a,0);Yd(this,a);R(this,a);this.b-=11},function(a){var b=$d(this);this.J= this.b;fe(this,a,0,b);R(this,b);this.b=this.J-Cf[this.g]},function(a){R(this,me(this,a,this.Ta?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){og[a&15].call(this,a)},W,W,W,wf,wf,wf,wf,Hf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.I|=1),this.b-=5):W.call(this,a)},Vf,Xf,Kf,Kf,Kf,Kf],og=[sf,Mf,Gf,kf,uf,Ff,function(){Zd(this);this.b-=13},W,W,W,W,W,W,W,W,W],kg=[Df,Df,qf,qf,Qe,Qe,Re,Re,Nf,Nf,W,W,W,W,If,If],lg=[jf,gf,cf,ef,mf,nf,Se,Te,rf,Lf,Zf,ag,cg,function(a){pg[a>> 6&3].call(this,a)},W,W],pg=[W,function(a){a=ee(this,a,65536);Yd(this,a);R(this,a);this.b-=11},function(a){var b=$d(this);this.J=this.b;fe(this,a,65536,b);R(this,b);this.b=this.J-Cf[this.g]},W]; function qg(a){t.call(this,"ROM",a,qg);this.ha=this.g=null;this.C=a.addr;this.f=a.size;this.D=!1;this.v=a.alias;this.B=a.file;this.H=sa(this.B);if(this.B){a=this.B;var b=ta(this.H);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Ea(a,null,!0,function(a,b,f){f?(c.O("Unable to load ROM resource (error "+f+": "+a+")"),c.B=null):(nb(c.Qa,a,b),(a=Fa(a,b))?(c.g=a.da,c.ha=a.ha):c.B=null);rg(c)})}}z(qg);k=qg.prototype; k.Ea=function(a,b,c,d){this.w=b;this.b=c;this.i=d;rg(this)};k.Ha=function(){this.ha&&(this.i&&sg(this.i,this.id,this.C,this.f,this.ha),delete this.ha);return!0};k.Ga=function(){return!0}; function rg(a){if(!tb(a)){if(a.B){if(!a.g||!a.w)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)vb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.C;a.status(a.f+"-byte ROM at "+ra(b));if(57344<=b&&b<57344+jc){var c={};b=(c[b]=[qg.prototype.Jd,qg.prototype.Be,null,null,null,a.f>>1],c);if(Cb(a.w,a,b,256,a.Ya)){b=a.D=!0;break a}}else if(tc(a.w,b,a.f,Xc)){for(c=0;c>>a.ka;0=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(;r--;)a.b.rb(n++,b[v++]&255);else n&1?a.b.ga():xd(a.b,n,f);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(e=0;e=b)a.preventDefault&&a.preventDefault(),64e.K&&(e.K-=32),e.f|=128,e.f&64&&Lc(e.b,e.ja))});this.ma=Nc(52,4);this.$=Kc(this.b,function(){e.g|=128;e.g&64&&Lc(e.b,e.ma)});Cb(b,this,Rg);H(this)}; k.xc=function(){if(!this.J){var a=jd(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.Ya)return;b=ya(b[1]);if(this.J=pb(b)){var d=this.J.exports;if(d){var e=d.connect;e&&e.call(this.J);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ha=function(a,b){if(!b)if(this.xc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.Ga=function(a){return a?this.save():!0};k.reset=function(){Sg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Sg(this)};function Sg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.jc=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=xa("",c)));this.P&&!this.H&&c&&(b=String.fromCharCode(this.P)+b);this.v.value+=b;this.v.scrollTop=this.v.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D), this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Mc(this.b,this.$,1E3/Math.round(this.R/10))}};var Tg={},Rg=(Tg[65392]=[null,null,Y.prototype.Dd,Y.prototype.ve,"RCSR"],Tg[65394]=[null,null,Y.prototype.Cd,Y.prototype.ue,"RBUF"],Tg[65396]=[null,null,Y.prototype.Xd,Y.prototype.Pe,"XCSR"],Tg[65398]=[null,null,Y.prototype.Wd,Y.prototype.Oe,"XBUF"],Tg);Xa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick= function(){var a=d.G.listTapes;a&&Wg(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.P){c.parentNode.removeChild(c);break}this.G[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;Wg(d,sa(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1}; k.Ea=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.S=Xg(a);var e=this;if((this.g=jd(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.Y=Nc(56,4);this.ca=Kc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=ta(c),f="json"==e||"gz"==e?encodeURI(c):Ga()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Ea(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.A.ia;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Qa,e,f),(e=Fa(e,f))&&fh(a,b,c,d,e.da,e.La, e.Ka));a.A.ab=!1;a.D&&(a.D--,a.D||H(a));ch(a)})}function $g(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;dc.indexOf("/api/v1/dump")&&(b=ta(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"):ua(c,"/")&&(d="dir"),f=Ga()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Ea(f, null,!0,function(b,c,d){mh(a,b,c,d)})} function mh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.A.ia;if(d)a.controller.O('Unable to load disk "'+a.Xa+'" (error '+d+": "+b+")",f);else{nb(a.controller.Qa,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)q(h[0]);else{a.va=h.length;a.za=h[0].length;a.ra=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y>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.Ba?f=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=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.Xa+": "+c);return b}; k.toJSON=function(){var a;a=0;for(var b;b=oh(this,a++);)qh(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 qh(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){t.call(this,"RL11",a,N,2097152);this.v=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype; k.ta=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("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.G[b]=c,c.onchange=function(){var a=qa(c.value,10);null!=a&&rh(d,a)},!0;case "loadDrive":return this.G[b]= c,c.onclick=function(){var a=d.G.listDisks;a&&sh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[qa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=oh(a,c++);)for(var l=0,m=h.length;lb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";rh(this,0)}}return!0};k.Ga=function(a){return a?this.save():!0};k.reset=function(){th(this)};k.save=function(){return(new P(this)).data()}; k.restore=function(a){return th(this,a[0])};function wh(a,b){b||(a.H=0);if(a.v)for(var c in a.v){var d=a.v[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;gg||9e||e>=a.f.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=sa(c);a.status("Attempting to load "+c+' as "'+b+'"')}yh(a,e,b,c,!1,d)}else xh(a,e)} function yh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.hb.toLowerCase()!=d.toLowerCase()&&(g++,xh(a,b,!0),h.ec?a.O("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,lh(new hh(a,h,"preload"),c,d,f,a.Nc)&&g++));return g} k.Nc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.za)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ca=b,a.Xa=c,a.hb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.B&&this.B.sb()):a.Qb=!1;a.dc&&(a.dc=!1,--this.H||H(this));rh(this,a.gc)}; function vh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e>12&48;this.K=f>>16&63;this.C=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.ea=this.ea|a|32768);return!0}; k.jd=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.w.ib(f,v|r<<8);if(Bc(this.w)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.de=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var v=this.w.oa(f);if(Bc(this.w)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.ra&&(d=0,++c>=l.za&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Gd=function(){return this.ea&65535}; k.ye=function(a){this.ea=this.ea&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.ea&128)){var b;a=!0;var c=this.f[(this.ea&768)>>8],d,e,f,g;this.ea&=-2;switch(this.ea&14){case 4:this.g&8&&(this.ea&=63);this.D=c.status|this.C&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.C=this.g&4?this.C+b:this.C-b,this.g=this.C=this.C&65408|c);break;case 8:this.D=this.C;break;case 12:b=this.jd;case 10:b||(b=this.de),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.va||f>=c.ra?this.ea|=37888: (g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Oc.bind(this)))}a&&(this.ea|=129,this.ea&64&&Lc(this.b,this.P))}};k.Ed=function(){return this.J};k.we=function(a){this.J=a&65534};k.Hd=function(){return this.g};k.ze=function(a){this.g=a};k.Id=function(){return this.D};k.Ae=function(a){this.D=a};k.Fd=function(){return this.K};k.xe=function(a){this.K=a&63}; var zh={},uh=(zh[63744]=[null,null,N.prototype.Gd,N.prototype.ye,"RLCS"],zh[63746]=[null,null,N.prototype.Ed,N.prototype.we,"RLBA"],zh[65284]=[null,null,N.prototype.Hd,N.prototype.ze,"RLDA"],zh[65286]=[null,null,N.prototype.Id,N.prototype.Ae,"RLMP"],zh[65288]=[null,null,N.prototype.Fd,N.prototype.xe,"RLBE"],zh);function Ah(a){t.call(this,"Debugger",a,Ah);this.ca=a.base||16;this.Ja=!1;this.K=0;this.R=!1;this.C=-1;this.v=[];this.Y={}}z(Ah); var Bh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Ah.prototype.uc=function(){return-1};Ah.prototype.vc=function(){}; function Ch(a,b,c,d){if(c)if(b){0>a.C&&a.v.length&&(a.C=0);if(0>a.C||b!=a.v[a.C])a.v.splice(0,0,b),a.C=0;a.C--}else a.R?b="end":b=a.v[a.C+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(ya(b.substring(c,f))),c=f+1}}return a} function Dh(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 Eh(a,b,c){var d;if(b){b=Fh(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+". "+ra(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Ih(a,b){if(b)return Hh(a,b,a.Y[b]);var c=0;for(b in a.Y)Hh(a,b,a.Y[b]),c++;return 0this.b.pb?Rh:[];Sh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Th(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=xc[c],n&&d.j(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.vc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Wa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Pc(this.b):21==a&&this.f&&gc(this.f)&&(b=this.f.Va));return b}; k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Kb).F));this.na&1073741824?this.wa.push(a):this.ja&&a==this.ja||(this.ja=a,this.na&-2147483648&&this.b&&this.b.A.Z&&(this.ga(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,rd(a),a.ua=0,a.qa()))};function Lh(a){var b;if(!ne(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.j("trapped to "+J(a,c&255,1)+(d?" ("+J(a,d)+")":""))}a.L=Z(a.b.u[7]);b&&1!=a.S?$h(a):ai(a)}}function Zh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.A.ia?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ha=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.Ga=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Lh(this);this.Aa=0;this.ja=null;this.K=0;this.L=Z(this.b.u[7]);this.A.Z=!1;bi(this);a||md(this)};k.save=function(){var a=new P(this);a.set(0,Vh(this.L));a.set(1,Vh(this.P));a.set(2,[this.v,this.R,this.na]);a.set(3,this.J);return a.data()}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=Wh(a[b++]),this.P=Wh(a[b++]),this.v=a[b][0],"string"==typeof this.v&&(this.v=[this.v]),this.R=a[b][1],this.na|=a[b][2]);a[3]&&(this.J=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.A.Z=!0;this.Sb=a;this.Ub=b}; k.stop=function(a,b){if(this.A.Z){this.A.Z=!1;this.K=b-this.Ub;if(!this.S){b="stopped";if(this.K){a-=this.Sb;var c=0d&&(d=a.b.bb(b)),65535!=(d&65535)&&(c=a.H[a.$],c.F=b,c.Oa=!1,++a.$==a.H.length&&(a.$=0)));return!1}function tf(a){var b=a.b;if(b.A.Z)throw O(b,a.b.Kb),a.ga(),-1;return!1} function Kh(a){var b,c;a.g=["bp"];if(a.M)for(b=1;b>>d.ka],!1)}a.M=["br"];if(a.D)for(b=1;b>>d.ka],!0);a.D=["bw"];a.tb=0}k.nb=function(a,b,c){var d=!0;c||ci(this,a,b,!1,!0);if(a!=this.g){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.w;f.W[e>>>f.ka].nb(e&f.w,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(di(this,a,a.length-1,"set"),Lh(this)));return d}; function ci(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ka],b==a.D));h.Oa||Lh(a);break}}return f}function ei(a,b){for(var c=1;c>23)&65535,x=J(w,r);else if(8192==A)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==A)x=J(w,f&7,1);else if(24576==A)x=J(w,f&63,1);else if(32768==A)x=J(w,f&255,1);else if(A=f&y,y&4032&&(A>>=6,y>>=6), y&63)switch(y=A&7,A&56){case 0:x=Yh(y);break;case 8:x="@"+Yh(y);break;case 16:7>y?x="("+Yh(y)+")+":(A=w.oa(r,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Yh(y)+")+":(A=w.oa(r,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Yh(y)+")";break;case 40:x="@-("+Yh(y)+")";break;case 48:A=w.oa(r,2);x=J(w,A,0,!0)+"("+Yh(y)+")";7==y&&(x=J(w,A+r.F&65535));break;case 56:A=w.oa(r,2),x="@"+J(w,A)+"("+Yh(y)+")",7==y&&(x="@"+J(w,A+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); 0b?(c=Yh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Wa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Pc(d)):21==b&&a.f&&gc(a.f)&&(c="SW="+J(a,a.f.Va,3));c&&(c+=" ");return c}function ji(a){var b,c="";for(b=0;6>b;b++)c+=ii(a,b);c=c+"\n"+(ii(a,6)+ii(a,7));c+=ii(a,20)+ii(a,21);return c+=hi(a,"T")+hi(a,"N")+hi(a,"Z")+hi(a,"V")+hi(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],v=Aa(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.J.push({Ve:b,F:c,Vc:d,ha:e,nc:f})}function ki(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b>>0,h=f.Vc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.qa();a.j("updated registers:")}a.j(ji(a));c&&(a.L=Z(d.u[7]),ai(a,J(a,a.L.F)))}}function oi(a,b){b=ya(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=gi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}} function fi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.P.F)),a.L=a.P,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ja=null;if(tb(a)&&0n||"z"na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);ga-=aa;0>ga&&(null==na[na.length-1].F?(aa=ga+aa,ga=0):ga+=na.length);var Jd=[];"call"==Ag&&(Kb=1E5,Jd=["CALL"]);for(void 0!==zg&&a.j(aa+" instructions earlier:");0=na.length&&(ga=0);a.vb=aa;Cg++;Kb--}}Cg||(a.j("no "+Bg+"history available"),a.vb=void 0)}else{var Mb=Th(a,ma);if(Mb){var Cc=0;Ma&&("l"==Ma.charAt(0)&&(Ma=Ma.substr(1)||Ii),Cc=Gh(a,Ma)>>>0,65536>4||1,Ob="";Ki--&&0Fc?String.fromCharCode(Fc):"."}Ob&&(Ob+="\n");Ob+=ma+" "+Kd+(0==Pb?" "+Fg:"")}Ob&&a.j(Ob);a.mb=Mb}}}}break;case "e":if("else"==g[0])break;var lb,Ld,Md,Nd,Od=g[0],Pd=g[1];"eb"==Od?(lb=1,Ld=255,Md=a.Gb,Nd=a.Yb):"e"==Od||"ew"==Od?(lb=2,Ld=65535,Md=a.oa,Nd=a.ib):Pd=null;if(null==Pd)a.j("edit memory commands:"),a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Gc=Th(a,Pd);if(Gc)for(var Hc= 2;HcSd;){for(var Na=null,Ni=256;65536>Tb.F>>>0;){Td.F=a.oa(Tb,2);if(null==Tb.F||!Ni--)break;if(!(Td.F&1)){for(var Oi=a,Ic=Td,Hg=null,Ub=Ic.F,Ig=Ub,Ud=1;6>=Ud&&Ub;Ud++){if(2< Ud){Ic.F=Ub;var Jc=gi(Oi,Ic);if(0<=Jc.indexOf("JSR")){var Jg=Jc.indexOf(" ");if(Ub+(Jc.indexOf(" ",Jg+1)-Jg-1)/2==Ig){Hg=Jc;break}}}Ub-=2}Ic.F=Ig;if(Na=Hg)break}}if(!Na||null==Na)break;var Kg=null;if("ks"==Mi){var Lg=Na.match(/[0-9A-F]+$/);Lg&&(Kg=ni(a,Lg[0]))}Na=xa(Na,50)+" ;"+(Kg||"stack="+J(a,Tb.F));a.j(Na);Sd++}Sd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){ni(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Da=0;if("all"== G)Da=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in xb)if(G==oa){Da=xb[oa];pa=!!(a.na&Da);break}if(!Da){a.j("unknown message category: "+G);break a}}if(Da)if("on"==g[2])a.na|=Da,pa=!0;else if("off"==g[2]&&(a.na&=~Da,pa=!1,1073741824==Da)){for(var Vd=0;Vd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bti){if(vi(d,this.J)){this.C=new P(this,"1.30.3","failsafe");vi(this.C)&&(Ai(this,d),a=2,Bi(this.C));this.C.set("timestamp",Ca());Ci(this.C);var e=this.g&&!this.D;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=zi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?vi(d,g):("error"== f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.B=null)):this.j(f+": "+g),Bi(d),vi(d)?(c=zi(d),e=!0):c=!1))}e&&yi(this,c?d:null)}else 2==a&&d.clear()}else yi(this);delete this.J;delete this.K}e=ob(this.id);for(f=0;fa[1];a=a[2];this.ca=!0;this.A.ia=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Di(this,this.b,b,c,a),this.qa(),this.b.ub());this.P&&(Ai(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.v=0}; function Ai(a,b){if(Ha("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.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} function qi(a,b,c){var d,e="none";if(a.v)return null;a.v--;var f=new P(a,"1.30.3"),g=new P(a,"1.30.3","validate"),h=Ca();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ga&&(c&&a.b.ga(),d=a.b.Ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.A.ia=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;l(b.J+=a))){for(a=0;af.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+"...");Ea(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);Ui(a,b,c)}})}else c(a,null)} function Vi(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=wa(a))}function f(a){e("Error: "+a);l&&(--Hi||Za(!0));l=!1}var g,h,l=!0;Hi++;mb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c|| (c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?Si(c,null,null,!1,e,function(d,l){l?(nb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Hi||Za(!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),--Hi||Za(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Si(b,a,d,!0,e,m):Ti(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){Za(!1);return Vi(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map