(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={ea:null,ia:null,Ja:null,Ia: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.Ja=g.load;d.Ia=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ia=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[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.ib=this.id:(this.Pa=this.id.substr(0,b),this.ib=this.id.substr(b+1));this[a]=c;this.B={ready:!1,Xa:!1,Zb:!1,ja:!1,error:!1};this.Rb=null;this.B.error=!1;this.G={};this.i=null;this.na=d||0;v.push(this)}var ab=void 0,bb={}; if(window){ab||(ab=window.location.search.substr(1));for(var cb,jb=/\+/g,kb=/([^&=]+)=?([^&]*)/g;cb=kb.exec(ab);)bb[decodeURIComponent(cb[1].replace(jb," "))]=decodeURIComponent(cb[2].replace(jb," "))}function lb(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=u);a.prototype=lb(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={}),v=window.PCjs.Components||(window.PCjs.Components=[])}else mb={},v=[];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.f["S"+a]=[0,!1,!1,this.cd,a]}z(yb);k=yb.prototype;k.reset=function(){this.L=this.L&-120|20}; k.sa=function(a,b,c,d){if(this.u&&this.u.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(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.H++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.D[b]=d?1:0,this.H++,!0):"switch"==a?(void 0===this.f[b]&&(this.f[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.f[b];zb(a,b,c[0]=1-c[0]);c[2]=!0;c[3]&&c[3].call(a,c[0],c[4]);a.J="DEP"==b;a.K="EXAM"==b}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){var c=a.f[b];c[1]&&c[2]&&(zb(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.sa.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.u=a;this.A=b;this.b=c;this.i=d;Ab(b,this,Bb);Cb(b,this.reset.bind(this));Db(this);for(var e in this.f)zb(this,e,this.f[e][0])};k.Ga=function(a,b){b||(Eb(),this.stop());return!0}; k.Fa=function(){return!0};function Fb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Db(a,b){for(var c in a.D)Fb(a,c,null!=b?b:a.D[c])}function zb(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Tb(a,b,c,d){a.G[b]&&(void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.b.ha()),c=8==(a.i&&a.i.$||8)?ra(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))} k.ad=function(a){a||this.b.B.Z||(this.A.reset(),Ub(this.b),this.f.ENABLE&&this.f.ENABLE[0]&&this.b.fb())};k.bd=function(){};k.Xc=function(a){a||this.b.ha()};k.Vc=function(a){if(!a&&!this.b.B.Z)if(this.f.ENABLE&&this.f.ENABLE[0])this.b.fb();else{if((a=this.i)&&!sb(a,!0))rb(a,!0),a.gb(0),rb(a,!1);else try{var b=this.b.gb(1);0>2;this.A=this.xa-1;this.C=this.H/this.xa|0;this.Wa=[];this.u=0;this.f=!1;this.w=[];this.Hc=[fc,gc,hc,ic];a=new I(this);jc(a,this.i);this.W=Array(this.C);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Wa[a&-2])&&e[2]&&(c=e[2](b&-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,!0),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,!0);return c} function gc(a,b,c){var d=!1,e=this.controller,f=e.Wa[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Wa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,c),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,!0):(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,!0))} function hc(a,b){var c=-1,d=this.controller;(a=d.Wa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+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,!0),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,!0);return c} function ic(a,b,c){var d=!1,e=this.controller;if(a=e.Wa[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+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,!0):(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,!0))} function lc(a,b){if(b!=a.g){var c;a.g&&(c=(1<>>a.ka;0g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Lb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Lb){n=l.size-(f-m);n>g&&(n=g);l.Lb=f-l.F+n;f=m+a.xa;g-=n;h++;continue}}return qc(1,f,g)}f=new I(a,f,n,a.xa,d,e);jc(f,a.i,l);a.W[h++]=f;f=m+a.xa;g-=n}if(0>=g){c/=1024;var r;e="";r?10>>=a.ka;0>>=a.ka;0>>this.ka].Ub(a&this.A,a)};k.Tb=function(a){this.f=!1;this.u++;a=this.W[(a&this.Ta)>>>this.ka].ec(a&this.A,a);this.u--;return a}; k.oa=function(a){3932160<=a&&(a=sc(this.b,a));return this.W[(a&this.Ta)>>>this.ka].ra(a&this.A,a)};k.mb=function(a){var b=a&this.A,c=(a&this.Ta)>>>this.ka;this.f=!1;this.u++;a=this.W[c].fc(b,a);this.u--;return a};k.Vb=function(a,b){3932160<=a&&(a=sc(this.b,a));this.W[(a&this.Ta)>>>this.ka].Xb(a&this.A,b&255,a)};k.pb=function(a,b){this.f=!1;this.u++;this.W[(a&this.Ta)>>>this.ka].Yb(a&this.A,b&255,a);this.u--}; k.eb=function(a,b){3932160<=a&&(a=sc(this.b,a));this.W[(a&this.Ta)>>>this.ka].Mb(a&this.A,b&65535,a)};k.Jb=function(a,b){var c=a&this.A,d=(a&this.Ta)>>>this.ka;this.f=!1;this.u++;this.W[d].jc(c,b&65535,a);this.u--};function tc(a){for(var b=0,c=[],d=0;da.b.vb)){var h=g[0]?g[0].bind(b):null,l=g[1]?g[1].bind(b):null,m=g[2]?g[2].bind(b):null,n=g[3]?g[3].bind(b):null,r=g[5]||1;65472<=f&&65487>=f&&(!h&&m&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&n&&(l=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var t=g[4],w=0;w>5&3;b.Ma=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Za!=c&&(b.Za=c,Jc(b))}};k.pd=function(){var a=this.b.ab;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.qd=function(){return this.b.Ib};k.rd=function(){return this.b.ob};k.ie=function(a){var b=this.b;1170>b.vb&&(a&=-49);b.ob!=a&&(b.ob=a,b.Qb=a&16?4194303:262143,Jc(b))};k.Rd=function(a){a=a>>1&63;var b=this.b.Kb[a>>1];return a&1?b>>16:b&65535}; k.Ie=function(a,b){b=b>>1&63;var c=b>>1;this.b.Kb[c]=b&1?this.b.Kb[c]&65535|(a&63)<<16:this.b.Kb[c]&-65536|a&65534};k.Kd=function(a){return this.b.U[1][a>>1&7]};k.Be=function(a,b){this.b.U[1][b>>1&7]=a&65295};k.Id=function(a){return this.b.U[1][(a>>1&7)+8]};k.ze=function(a,b){this.b.U[1][(b>>1&7)+8]=a&65295};k.Jd=function(a){return this.b.wa[1][a>>1&7]};k.Ae=function(a,b){b=b>>1&7;this.b.wa[1][b]=a;this.b.U[1][b]&=65295};k.Hd=function(a){return this.b.wa[1][(a>>1&7)+8]}; k.ye=function(a,b){b=(b>>1&7)+8;this.b.wa[1][b]=a;this.b.U[1][b]&=65295};k.ld=function(a){return this.b.U[0][a>>1&7]};k.ee=function(a,b){this.b.U[0][b>>1&7]=a&65295};k.jd=function(a){return this.b.U[0][(a>>1&7)+8]};k.ce=function(a,b){this.b.U[0][(b>>1&7)+8]=a&65295};k.kd=function(a){return this.b.wa[0][a>>1&7]};k.de=function(a,b){b=b>>1&7;this.b.wa[0][b]=a;this.b.U[0][b]&=65295};k.hd=function(a){return this.b.wa[0][(a>>1&7)+8]};k.be=function(a,b){b=(b>>1&7)+8;this.b.wa[0][b]=a;this.b.U[0][b]&=65295}; k.Qd=function(a){return this.b.U[3][a>>1&7]};k.He=function(a,b){this.b.U[3][b>>1&7]=a&65295};k.Od=function(a){return this.b.U[3][(a>>1&7)+8]};k.Fe=function(a,b){this.b.U[3][(b>>1&7)+8]=a&65295};k.Pd=function(a){return this.b.wa[3][a>>1&7]};k.Ge=function(a,b){b=b>>1&7;this.b.wa[3][b]=a;this.b.U[3][b]&=65295};k.Nd=function(a){return this.b.wa[3][(a>>1&7)+8]};k.Ee=function(a,b){b=(b>>1&7)+8;this.b.wa[3][b]=a;this.b.U[3][b]&=65295};k.zb=function(a){a&=7;return this.b.M&2048?this.b.Ua[a]:this.b.v[a]}; k.Bb=function(a,b){b&=7;this.b.M&2048?this.b.Ua[b]=a:this.b.v[b]=a};k.wd=function(){return this.b.M&49152?this.b.Ha[0]:this.b.v[6]};k.ne=function(a){this.b.M&49152?this.b.Ha[0]=a:this.b.v[6]=a};k.zd=function(){return this.b.v[7]};k.qe=function(a){this.b.v[7]=a};k.Ab=function(a){a&=7;return this.b.M&2048?this.b.v[a]:this.b.Ua[a]};k.Cb=function(a,b){b&=7;this.b.M&2048?this.b.v[b]=a:this.b.Ua[b]=a};k.xd=function(){return 1==(this.b.M&49152)>>14?this.b.v[6]:this.b.Ha[1]}; k.oe=function(a){1==(this.b.M&49152)>>14?this.b.v[6]=a:this.b.Ha[1]=a};k.yd=function(){return 3==(this.b.M&49152)>>14?this.b.v[6]:this.b.Ha[3]};k.pe=function(a){3==(this.b.M&49152)>>14?this.b.v[6]=a:this.b.Ha[3]=a};k.fd=function(a){return this.b.Ac[a-65504>>1]};k.$d=function(a,b){this.b.Ac[b-65504>>1]=a};k.xc=function(a){return 65520==a?61183:0};k.Ec=function(){};k.Md=function(){return 1};k.De=function(){};k.ed=function(){return this.b.ga};k.Zd=function(){this.b.ga=0};k.nd=function(){return this.b.zc}; k.ge=function(a,b){b&1||(a&=255);this.b.zc=a};k.sd=function(a){return a?this.b.hc:0};k.je=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.hc=a;b.I|=2};k.Ld=function(a){return a?this.b.bb&65280:0};k.Ce=function(a){this.b.bb=a|255};k.vd=function(){return bc(this.b)};k.me=function(a){Kc(this.b,a&-1809|bc(this.b)&1808);this.b.I|=128};k.Dc=function(a,b){F(this)&&E(this,"writeIgnored("+ra(b)+"): "+ra(a),!0,!0)}; var M={},L=(M[61568]=[null,null,K.prototype.Rd,K.prototype.Ie,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Kd,K.prototype.Be,"SISDR",8,1145],M[62608]=[null,null,K.prototype.Id,K.prototype.ze,"SDSDR",8,1145],M[62624]=[null,null,K.prototype.Jd,K.prototype.Ae,"SISAR",8,1145],M[62640]=[null,null,K.prototype.Hd,K.prototype.ye,"SDSAR",8,1145],M[62656]=[null,null,K.prototype.ld,K.prototype.ee,"KISDR",8,1145],M[62672]=[null,null,K.prototype.jd,K.prototype.ce,"KDSDR",8,1145],M[62688]=[null,null,K.prototype.kd, K.prototype.de,"KISAR",8,1145],M[62704]=[null,null,K.prototype.hd,K.prototype.be,"KDSAR",8,1145],M[62798]=[null,null,K.prototype.rd,K.prototype.ie,"MMR3",1,1145],M[65382]=[null,null,K.prototype.md,K.prototype.fe,"LKS"],M[65402]=[null,null,K.prototype.od,K.prototype.he,"MMR0",1,1145],M[65404]=[null,null,K.prototype.pd,K.prototype.Dc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.qd,K.prototype.Dc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.Qd,K.prototype.He,"UISDR",8,1145],M[65424]=[null,null,K.prototype.Od, K.prototype.Fe,"UDSDR",8,1145],M[65440]=[null,null,K.prototype.Pd,K.prototype.Ge,"UISAR",8,1145],M[65456]=[null,null,K.prototype.Nd,K.prototype.Ee,"UDSAR",8,1145],M[65472]=[null,null,K.prototype.zb,K.prototype.Bb,"R0SET0"],M[65473]=[null,null,K.prototype.zb,K.prototype.Bb,"R1SET0"],M[65474]=[null,null,K.prototype.zb,K.prototype.Bb,"R2SET0"],M[65475]=[null,null,K.prototype.zb,K.prototype.Bb,"R3SET0"],M[65476]=[null,null,K.prototype.zb,K.prototype.Bb,"R4SET0"],M[65477]=[null,null,K.prototype.zb,K.prototype.Bb, "R5SET0"],M[65478]=[null,null,K.prototype.wd,K.prototype.ne,"R6KERNEL"],M[65479]=[null,null,K.prototype.zd,K.prototype.qe,"R7KERNEL"],M[65480]=[null,null,K.prototype.Ab,K.prototype.Cb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Ab,K.prototype.Cb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Ab,K.prototype.Cb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Ab,K.prototype.Cb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Ab,K.prototype.Cb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Ab, K.prototype.Cb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.xd,K.prototype.oe,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.yd,K.prototype.pe,"R6USER",1,1145],M[65504]=[null,null,K.prototype.fd,K.prototype.$d,"CTRL",1,1170],M[65520]=[null,null,K.prototype.xc,K.prototype.Ec,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.xc,K.prototype.Ec,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Md,K.prototype.De,"SYSID",1,1170],M[65526]=[null,null,K.prototype.ed,K.prototype.Zd,"CPUERR",1,1170],M[65528]= [null,null,K.prototype.nd,K.prototype.ge,"MB",1,1170],M[65530]=[null,null,K.prototype.sd,K.prototype.je,"PIR"],M[65532]=[null,null,K.prototype.Ld,K.prototype.Ce,"SL"],M[65534]=[null,null,K.prototype.vd,K.prototype.me,"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),Sc(this,Oc?Tc:Uc);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},da:function(a,b){a&1&&this.A.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},va: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.Ra=!0},P:function(a,b){if(this.i&&null!=this.F){var c=this.i;Zc(c,this.F+a,1,c.L)&&c.ha(!0)}return this.ec(a,b)},Y:function(a,b){if(this.i&&null!=this.F){var c=this.i;Zc(c,this.F+a,2,c.L)&&c.ha(!0)}return this.fc(a,b)},ma:function(a, b,c){if(this.i&&null!=this.F){var d=this.i;Zc(d,this.F+a,1,d.C)&&d.ha(!0)}this.u?this.w(a,b,c):this.Yb(a,b,c)},Aa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;Zc(d,this.F+a,2,d.C)&&d.ha(!0)}this.u?this.w(a,b,c):this.jc(a,b,c)},N: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},Pa:function(a,b){a&1&&this.A.Da(b,64,2);return this.D.getUint16(a,!0)},$:function(a,b){a&1&&this.A.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},la:function(a,b){this.G[a]=b;this.Ra=!0},ua:function(a,b,c){this.G[a]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},ib:function(a,b,c){a&1&&this.A.Da(c,64,4);this.D.setUint16(a,b,!0);this.Ra=!0},La:function(a,b,c){a&1&&this.A.Da(c,64,4);this.J[a>>1]=b;this.Ra=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, b)+")",!0)}};function jc(a,b,c){a.i=b;a.f=a.g=0;c&&((a.f=c.f)&&Yc(a,Xc,!1),(a.g=c.g)&&Wc(a,Xc,!1))}function $c(a,b){b?--a.g||(a.Xb=a.u?a.w:a.Yb,a.Mb=a.u?a.H:a.jc):--a.f||(a.Ub=a.ec,a.ra=a.fc)}function Wc(a,b,c){c&&a.g||(a.Xb=!a.u&&b[1]||a.w,a.Mb=!a.u&&b[3]||a.H);if(c||void 0===c)a.Yb=b[1]||a.w,a.jc=b[3]||a.H}function Yc(a,b,c){c&&a.f||(a.Ub=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.ec=b[0]||a.K,a.fc=b[2]||a.L}function Sc(a,b){b||(b=ad);Yc(a,b,void 0);Wc(a,b,void 0)} var ad=[],Vc=[I.prototype.V,I.prototype.va,I.prototype.da,I.prototype.Ma],Xc=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.Aa];if(wb)var Uc=[I.prototype.N,I.prototype.la,I.prototype.Pa,I.prototype.ib],Tc=[I.prototype.R,I.prototype.ua,I.prototype.$,I.prototype.La]; function bd(a,b){u.call(this,"CPU",a,bd,1);var c=a.multiplier||1;this.kb=a.cycles||b;this.$a=c;this.tb=Math.round(this.kb/1E4)/100;this.nb=this.tb*this.$a;this.B.Z=!1;this.B.Wb=!1;this.B.sb=a.autoStart;this.B.ub=!1;this.Fb=this.ma=0;this.Gb=a.csStart;this.wb=a.csInterval;this.xb=a.csStop;this.K=[];this.uc=this.Vd.bind(this);H(this)}z(bd);var cd=["power","reset"];k=bd.prototype; k.Ea=function(a,b,c,d){this.u=a;this.A=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.wb,c=!0);0<=a.xb&&a.xb<=hd(a)&&(a.wb=a.xb=-1,fd(a),a.ha(),c=!0);c&&a.j(hd(a)+" cycles: checksum="+p(a.Fb))}} k.sa=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.u)if(a=d.u,a.B.ja)a=!0;else{var b=null,c,h=ob(a.id);for(c=0;ca.Y/a.nb?b=1:d=!0;a.$a=b;b=a.tb*a.$a;if(a.nb!=b){a.nb=b;b=a.nb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.u&&a.u.qb()}Wb(a,a.V);a.V=0;a.R=Ba();a.$=0;jd(a);return d}function wc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function yc(a,b,c){0<=b&&ba.K[b][0]&&(c=a.kb*a.$a/1E3*c|0,a.K[b][0]=c+kd(a))} function ld(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 Vb(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 kd(a,b){var c=a.da-=a.b;a.b=a.J=0;b&&(a.da=0);return c} k.Vd=function(){if(this.B.Z){this.Db>=this.kb&&jd(this,!0);this.Aa=0;this.jb=Ba();if(this.$){var a=this.jb-this.$;a>this.Sb&&(this.R+=a,this.R>this.jb&&(this.R=this.jb))}try{do{var b=ld(this,this.B.ub?1:this.hb);try{this.gb(b)}catch(e){if("number"!=typeof e)throw e;}b=kd(this,!0);this.Aa+=b;this.V+=b;Xb(this,b);Vb(this,b);this.ua-=b;if(0>=this.ua){this.ua+=this.hb;15<=++this.tc&&(this.u&&this.u.ca(),this.tc=0);break}}while(this.B.Z)}catch(e){this.ha();this.u&&this.u.stop(Ba(),hd(this));vb(this,e.stack|| e.message);return}if(this.B.Z){a=setTimeout;b=this.uc;this.$=Ba();var c=this.Sb;this.Aa&&(c=Math.round(c*this.Aa/this.hb));var c=c-(this.$-this.jb),d=this.$-this.R;d&&(this.Y=Math.round(this.V/(10*d))/100,864E5<=d&&(this.la=0,id(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.Db+=this.Aa;this.$+=c;a(b,c)}}}; k.fb=function(a){if(ub(this))return!1;if(this.B.Z)return this.j(this.toString()+" busy"),!1;id(this);this.B.Z=!0;this.B.Wb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.u&&(a&&this.u.qb(!0),this.u.start(this.R,hd(this)));setTimeout(this.uc,0);return!0};k.gb=function(){return 0};k.ha=function(a){var b=!1;if(this.B.Z){kd(this);Wb(this,this.V);this.V=0;this.B.Z=!1;if(b=this.G.run)b.textContent="Run";this.u&&this.u.stop(Ba(),hd(this));b=!0}this.B.complete=a;return b}; function md(a){this.vb=+a.model||1170;this.Nb=a.addrReset||0;bd.call(this,a,6666667);this.decode=1120==this.vb?nd.bind(this):od.bind(this);pd(this);this.L=0;this.N=null;this.B.complete=!1}z(md,bd);k=md.prototype;k.reset=function(){this.status("model "+this.vb);this.B.Z&&this.ha();pd(this);ed(this);this.B.error=!1;this.parent.reset.call(this)}; function pd(a){a.S=65536;a.T=32768;a.aa=65535;a.X=32768;a.M=15;a.v=[0,0,0,0,0,0,0,a.Nb];a.Ua=[0,0,0,0,0,0];a.Ha=[0,0,0,0];a.w=0;a.Ma=0;a.Qc=[4,2,0,1];a.U=[[0,0,0,0,0,0,0,0,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.wa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Kb=[0,0,0,0,0,0,0,0,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.Ac=[0,0,0,0,0,0,0,0];a.zc=0;a.I=0;a.D=a.H=0;a.g=a.f=a.rb=0;a.va=-1;Ub(a)}function Ub(a){a.bb=255;a.ga=0;a.hc=0;a.C=0;a.ab=0;a.Ib=0;a.ob=0;a.Za=0;a.La=0;a.Qb=262143;a.N=null;a.A&&Jc(a)}function Jc(a){a.Za?(a.P=65536,a.ba=a.Pc,a.ra=a.Sd,a.Mb=a.Je,lc(a.A,a.ob&16?22:18)):(a.P=0,a.ba=a.Oc,a.ra=a.yc,a.Mb=a.Fc,lc(a.A,16))}function qd(a,b,c){a.Nb=b;O(a,b);!c&&a.i&&(a.ha()||a.i.ca())}k.qc=function(){return 0}; k.save=function(){var a=new P(this);a.set(0,[]);a.set(1,[this.la,this.$a]);a.set(2,tc(this.A));return a.data()};k.restore=function(a){var b=a[1];this.la=b[1];id(this,b[3]);a:{b=this.A;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.w!=c&&(a.Ha[c]=a.v[6],a.v[6]=a.Ha[a.w]);a.M=b;a.I|=2}function R(a,b){a.I&128||(a.X=a.aa=b,a.T=0)}function wd(a,b,c){a.I&128||(a.X=a.aa=a.S=b,a.T=c||0)}function xd(a,b,c,d){a.I&128||(a.X=a.aa=a.S=b,a.T=(c^b)&(d^b))} function yd(a,b){a.I&128||(a.X=a.aa=a.S=b,a.T=a.X^a.S>>1)}function zd(a,b,c,d){a.I&128||(a.X=a.aa=a.S=b,a.T=(c^d)&(d^b))}k.pa=function(a,b){if(!this.L){var c=!1;0>this.va?this.va=bc(this):this.w||(a=4,c=!0);this.C&57344||(this.ab=63222,this.Ib=a);this.w=0;var d=this.ra(a|this.P),e=this.ra(a+2&65535|this.P);Kc(this,e&-12289|this.va>>2&12288);c&&(this.ga|=4,this.v[6]=4);Ad(this,this.va);Ad(this,this.v[7]);O(this,d);this.I&=-113;this.va=-1;this.I|=8;this.Uc=a;this.Sc=b;if(26!=b)throw a;}}; function Bd(a){var b=Td(a),c=Td(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);O(a,b);Kc(a,c);a.I&=-17}function sc(a,b){var c=b>>13&31;31>c&&a.ob&32&&(b=a.Kb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b} function Ud(a,b,c){var d,e,f,g=0;d=b>>13;a.ob&a.Qc[a.w]||(d&=7);e=a.U[a.w][d];f=(a.wa[a.w][d]<<6)+(b&8191)&a.Qb;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.U[a.w][d]=e;if(4194170!==f||a.w)a.La=a.w,a.Ma=d;b=!1;g&&(g&57344&&(0<=a.va&&(g|=128),a.C&57344||(a.C=a.C|g|a.La<<5|a.Ma<<1),b=!0),a.C&61440||!(4191360> f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.v[c];7!==c&&(e|=g);e=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.v[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.v[c]-2&65535;7!==c&&(e|=g);e=a.ra(e)| g;a.b-=8;break;case 6:return e=a.ra(vd(a,2)),e=e+a.v[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(vd(a,2)),e=e+a.v[c]&65535,e=a.ra(e|a.P)|g,a.b-=10,e}a.v[c]=a.v[c]+f&65535;!g||a.C&57344||(a.ab=a.ab<<8|f<<3&248|c);6==c&&!a.w&&d&4&&0>=f&&(a.v[6]<=a.bb||65534<=a.v[6])&&(a.v[6]<=a.bb-32?(a.ga|=4,a.v[6]=4,a.pa(4,24)):(a.ga|=8,a.I|=64));return e}k.Tb=function(a){if(!this.Za)return this.A.Tb(a);this.L++;a=Vd(this,Ud(this,a,3));this.L--;return a}; k.mb=function(a){if(!this.Za)return this.A.mb(a);this.L++;a=this.yc(Ud(this,a,2));this.L--;return a};k.pb=function(a,b){this.Za?(this.L++,Wd(this,Ud(this,a,5),b),this.L--):this.A.pb(a,b)};k.Jb=function(a,b){this.Za?(this.L++,this.Fc(Ud(this,a,4),b),this.L--):this.A.Jb(a,b)};k.Oc=function(a,b,c){return Xd(this,a,b,c)};k.Pc=function(a,b,c){return Ud(this,Xd(this,a,b,c),c)};k.yc=function(a){return this.A.oa(a)};k.Sd=function(a){return this.A.oa(Ud(this,a,2))};k.Fc=function(a,b){this.A.eb(a,b&65535)}; k.Je=function(a,b){this.A.eb(Ud(this,a,4),b)};function Yd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Xd(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.w=a.M>>12&3,c=a.ra(d|c&a.P),a.w=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.v[d]:a.Ha[a.M>>12&3];return c}function Zd(a,b,c,d){a.C&57344||(a.ab=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Xd(a,b,e,4),c&65536||(e&=65535),a.w=a.M>>12&3,e=Ud(a,e|c&65536,4),a.w=a.M>>14&3,a.A.eb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.v[e]=d:a.Ha[a.M>>12&3]=d} function $d(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?Vd(a,a.ba(b,c,3)):a.v[c]&255}function ae(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?a.A.oa(a.ba(b,c,2)):a.v[c]}function be(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Xd(a,b,c,8)}function ce(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Vd(a,a.ba(b,c,3)):a.v[c]&255}function de(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.A.oa(a.ba(b,c,2)):a.v[c]} function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.rb=a.ba(b,e,7),Wd(a,e,d.call(a,c,Vd(a,e)))):a.v[e]=a.v[e]&65280|d.call(a,c,a.v[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.A.eb(e,d.call(a,c,a.A.oa(e)))):a.v[e]=d.call(a,c,a.v[e])}function ee(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Wd(a,a.ba(b,e,5),c):a.v[e]=c?d&1?c<<24>>24&65535:a.v[e]&-256|c&255:a.v[e]&-256;return c} function fe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.A.eb(a.ba(b,d,4),c):a.v[d]=c&65535;return c}function U(a,b,c){c&&(O(a,a.v[7]+(b<<24>>23)),a.b-=2);a.b-=3} k.gb=function(a){this.B.complete=!0;var b=this.i&&ge(this.i)?1:this.B.Wb?-1:0,c=a?this.B.Wb?0:1:-1;this.B.Wb=!1;this.da=this.b=a;do{if(b){if(this.i&&he(this.i,this.v[7],c)){this.ha();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.hc&224)>>5,f=this.N&&this.N.yb>e?this.N:null;f&&(d=f.Xd,e=f.yb);e>(this.M&224)>>5?(this.I&4&&(vd(this,2),this.I&=-5),this.pa(d, 26),e=!0):e=!1;if(e){if(f)if(a=f,f=this.N,f==a)this.N=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.M&16;this.decode(ud(this))}while(0>1|b<<16;yd(this,a);return a&65535}function ne(a,b){a=b&2048|b>>1|b<<8;yd(this,a<<8);return a&255}function oe(a,b){a=b&~a;R(this,a);return a}function pe(a,b){a=b&~a;R(this,a<<8);return a}function qe(a,b){a|=b;R(this,a);return a}function re(a,b){a|=b;R(this,a<<8);return a} function se(a,b){a=~b|65536;wd(this,a);return a&65535}function te(a,b){a=~b|256;wd(this,a<<8);return a&255}function ue(a,b){a=b-a;this.I&128||(this.X=this.aa=a,this.T=b&(b^a));return a&65535}function ve(a,b){a=b-a;var c=a<<8;b<<=8;this.I&128||(this.X=this.aa=c,this.T=b&(b^c));return a&255}function we(a,b){a=b+a;this.I&128||(this.X=this.aa=a,this.T=a&(b^a));return a&65535}function xe(a,b){a=b+a;var c=a<<8;this.I&128||(this.X=this.aa=c,this.T=c&(b<<8^c));return a&255} function ye(a,b){a=-b;wd(this,a,a&b&32768);return a&65535}function ze(a,b){a=-b;wd(this,a<<8,(a&b&128)<<8);return a&255}function Ae(a,b){a=b<<1|this.S>>16&1;yd(this,a);return a&65535}function Be(a,b){a=b<<1|this.S>>16&1;yd(this,a<<8);return a&255}function Ce(a,b){a=(this.S&65536|b)>>1|b<<16;yd(this,a);return a&65535}function De(a,b){a=((this.S&65536)>>8|b)>>1|b<<8;yd(this,a<<8);return a&255}function Ee(a,b){var c=b-a;zd(this,c,a,b);return c&65535} function Fe(a,b){var c=b-a;zd(this,c<<8,a<<8,b<<8);return c&255}function Ge(a,b){this.I&128||(this.X=this.aa=b&65280,this.T=this.S=0);return(b<<8|b>>8)&65535}function He(a,b){a^=b;R(this,a);return a&65535}function Ie(a){T(this,a,ae(this,a),ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Je(a){var b=de(this,a);a=a>>6&7;var c=this.v[a];c&32768&&(c|=4294901760);this.S=this.T=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.T=32768)}this.v[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b} function Ke(a){var b=de(this,a);a=a>>6&7;var c=this.v[a]<<16|this.v[a|1];this.S=this.T=0;b&=63;if(b&32){b=64-b;32>b-1;this.S=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.v[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function Le(a){U(this,a,!rd(this))}function Me(a){U(this,a,rd(this))} function Ne(a){T(this,a,ae(this,a),oe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Oe(a){S(this,a,$d(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 Pe(a){T(this,a,ae(this,a),qe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Qe(a){S(this,a,$d(this,a),re);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Re(a){R(this,ae(this,a)&de(this,a));this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Se(a){R(this,($d(this,a)&ce(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 Te(a){U(this,a,td(this))}function Ue(a){U(this,a,!this.Sa()==!sd(this))}function Ve(a){U(this,a,!td(this)&&!this.Sa()==!sd(this))}function We(a){U(this,a,!rd(this)&&!td(this))}function Xe(a){U(this,a,td(this)||!this.Sa()!=!sd(this))} function Ye(a){U(this,a,rd(this)||td(this))}function Ze(a){U(this,a,!this.Sa()!=!sd(this))}function $e(a){U(this,a,this.Sa())}function af(a){U(this,a,!td(this))}function bf(a){U(this,a,!this.Sa())}function cf(){this.pa(12,1);this.b-=5}function df(a){U(this,a,!0)}function ef(a){U(this,a,!sd(this))}function ff(a){U(this,a,sd(this))}function V(a){a&1&&(this.S=0);a&2&&(this.T=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5} function gf(a){var b=ae(this,a);a=de(this,a);zd(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 hf(a){var b=$d(this,a)<<8;a=ce(this,a)<<8;zd(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 jf(a){var b=de(this,a);if(b){a=a>>6&7;var c=this.v[a]<<16|this.v[a|1];this.S=this.T=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.v[a]=d&65535,this.v[a|1]=c-d*b&65535,this.aa=d>>16|d,this.X=d>>16):(this.T=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.v[a]&&(this.v[a]=this.v[a|1]=1));this.b-=53}else this.aa=this.X=0,this.T=32768,this.S=65536,this.b-=7}function kf(){this.pa(24,2);this.b-=25} function lf(){this.M&49152?(this.ga|=128,this.pa(4,3)):this.i?mf(this.i):this.ha();this.b-=7}function nf(){this.pa(16,4);this.b-=25}var of=[0,7,7,10,7,11,9,13];function pf(a){this.J=this.b;O(this,be(this,a));this.b=this.J-of[this.g]}var qf=[0,14,14,17,14,18,16,20];function rf(a){this.J=this.b;var b=be(this,a);a=a>>6&7;Ad(this,this.v[a]);this.v[a]=this.v[7];O(this,b);this.b=this.J-qf[this.g]}var sf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function tf(a){var b=ae(this,a);this.J=this.b;R(this,fe(this,a,b));this.b=this.J-sf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function uf(a){var b=$d(this,a);R(this,ee(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 vf=[7,13,13,17,14,18,17,21]; function wf(a){var b=de(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.v[a];c&32768&&(c|=-65536);b=~~(b*c);this.v[a]=b>>16&65535;this.v[a|1]=b&65535;this.I&128||(this.X=b>>16,this.aa=this.X|b,this.T=0,this.S=-32768>b||32767>6;if(this.v[b]=this.v[b]-1&65535)O(this,this.v[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Cf(a){T(this,a,ae(this,a),Ee);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)} function Df(a){T(this,a,0,Ge);this.b-=this.g?9:3+(7==this.f?2:0)}function Ef(){this.pa(28,5);this.b-=5}function Ff(){this.I&4||this.u&&this.u.ca();this.I|=4;vd(this,-2);this.b-=3}function Gf(a){T(this,a,ae(this,a),He);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=mf(b);b||this.pa(8,6)}function nd(a){Hf[a>>12].call(this,a)}function If(a){Jf[a>>6&3].call(this,a)}function Kf(a){Lf[a>>6&3].call(this,a)} function Mf(a){Nf[a>>6&3].call(this,a)}function Of(a){Pf[a&15].call(this,a)}function Qf(a){Rf[a&15].call(this,a)}function Sf(a){Tf[a>>6&3].call(this,a)}function Uf(a){Vf[a>>6&3].call(this,a)}function Wf(a){Xf[a>>6&3].call(this,a)} var Hf=[function(a){Yf[a>>8&15].call(this,a)},tf,gf,Re,Ne,Pe,Ie,W,function(a){Zf[a>>8&15].call(this,a)},uf,hf,Se,Oe,Qe,Cf,W],Yf=[function(a){$f[a>>4&15].call(this,a)},df,af,Te,Ue,Ze,Ve,Xe,rf,rf,If,Kf,Mf,W,W,W],Jf=[function(a){wd(this,fe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,1,ue);this.b-=this.g?9:3+(7==this.f?2:0)}],Lf=[function(a){T(this,a,0, ye);this.b-=this.g?11:6},function(a){T(this,a,rd(this)?1:0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,rd(this)?1:0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=de(this,a);wd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Nf=[function(a){T(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){T(this,a,0,ke);this.b-=this.g?9:3+(7==this.f?2:0)}], $f=[function(a){ag[a&15].call(this,a)},W,W,W,pf,pf,pf,pf,Af,W,Of,Qf,Df,Df,Df,Df],ag=[lf,Ff,zf,cf,nf,yf,W,W,W,W,W,W,W,W,W,W],Pf=[xf,function(){this.S=0;this.b-=5},function(){this.T=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],Rf=[xf,function(){this.S=65536;this.b-=5},function(){this.T=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],Zf=[bf,$e,We,Ye,ef,ff,Le,Me,kf,Ef,Sf,Uf,Wf,W,W,W],Tf=[function(a){wd(this, ee(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,ve);this.b-=this.g?9:3+(7==this.f?2:0)}],Vf=[function(a){S(this,a,0,ze);this.b-=this.g?11:6},function(a){S(this,a,rd(this)?1:0,je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,rd(this)?1:0,Fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ce(this,a);wd(this,a<<8);this.b-=this.g?4:3+(7== this.f?2:0)}],Xf=[function(a){S(this,a,0,De);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ne);this.b-=this.g?9+(this.rb&1):3+(7==this.f?2:0)},function(a){S(this,a,0,le);this.b-=this.g?9:3+(7==this.f?2:0)}];function od(a){bg[a>>12].call(this,a)} var bg=[function(a){cg[a>>8&15].call(this,a)},tf,gf,Re,Ne,Pe,Ie,function(a){dg[a>>8&15].call(this,a)},function(a){eg[a>>8&15].call(this,a)},uf,hf,Se,Oe,Qe,Cf,W],cg=[function(a){fg[a>>4&15].call(this,a)},df,af,Te,Ue,Ze,Ve,Xe,rf,rf,If,Kf,Mf,function(a){gg[a>>6&3].call(this,a)},W,W],gg=[function(a){a=this.v[7]+((a&63)<<1)&65535;var b=this.ra(a|this.P);O(this,this.v[5]);this.v[6]=a+2&65535;this.v[5]=b;this.b-=8},function(a){a=Yd(this,a,0);Ad(this,a);R(this,a);this.b-=11},function(a){var b=Td(this);this.J= this.b;Zd(this,a,0,b);R(this,b);this.b=this.J-vf[this.g]},function(a){R(this,fe(this,a,this.Sa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],fg=[function(a){hg[a&15].call(this,a)},W,W,W,pf,pf,pf,pf,Af,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.I|=1),this.b-=5):W.call(this,a)},Of,Qf,Df,Df,Df,Df],hg=[lf,Ff,zf,cf,nf,yf,function(){Bd(this);this.b-=13},W,W,W,W,W,W,W,W,W],dg=[wf,wf,jf,jf,Je,Je,Ke,Ke,Gf,Gf,W,W,W,W,Bf,Bf],eg=[bf,$e,We,Ye,ef,ff,Le,Me,kf,Ef,Sf,Uf,Wf,function(a){ig[a>> 6&3].call(this,a)},W,W],ig=[W,function(a){a=Yd(this,a,65536);Ad(this,a);R(this,a);this.b-=11},function(a){var b=Td(this);this.J=this.b;Zd(this,a,65536,b);R(this,b);this.b=this.J-vf[this.g]},W]; function jg(a){u.call(this,"ROM",a,jg);this.ia=this.u=null;this.C=a.addr;this.f=a.size;this.w=a.alias;this.g=a.file;this.D=sa(this.g);if(this.g){a=this.g;var b=ta(this.D);"json"!=b&&"hex"!=b&&(a=Ga()+"/api/v1/dump?file="+this.g+"&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.g=null):(nb(c.Pa,a,b),(a=Fa(a,b))?(c.u=a.ea,c.ia=a.ia):c.g=null);kg(c)})}}z(jg);jg.prototype.Ea=function(a,b,c,d){this.A=b;this.b=c;this.i=d;kg(this)}; jg.prototype.Ga=function(){this.ia&&(this.i&&lg(this.i,this.id,this.C,this.f,this.ia),delete this.ia);return!0};jg.prototype.Fa=function(){return!0}; function kg(a){if(!tb(a)){if(a.g){if(!a.u||!a.A)return;a.f||(a.f=a.u.length);if(a.u.length!=a.f)vb(a,"ROM size ("+p(a.u.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;b=a.C;if(oc(a.A,b,a.f,Rc)){var c;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)),r=h,t=m-=6;0=b.length)break;l+=b[h++]&255;if(l&255)break;if(t)for(;t--;)a.b.pb(n++,b[r++]&255);else n&1?a.b.ha():qd(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&&xc(e.b,e.la))});this.ma=Ic(52,4);this.$=wc(this.b,function(){e.g|=128;e.g&64&&xc(e.b,e.ma)});Ab(b,this,Kg);H(this)}; k.vc=function(){if(!this.J){var a=dd(this.u,"connection");if(a){var b=a.split("->");if(2==b.length){var c=ya(b[0]);if(c!=this.ib)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.Pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.vc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.Fa=function(a){return a?this.save():!0};k.reset=function(){Lg(this)};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return Lg(this)};function Lg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.gc=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.V||8,c=a-this.H%a,this.V&&(b=xa("",c)));this.P&&!this.H&&c&&(b=String.fromCharCode(this.P)+b);this.w.value+=b;this.w.scrollTop=this.w.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;yc(this.b,this.$,1E3/Math.round(this.R/10))}};var Mg={},Kg=(Mg[65392]=[null,null,Y.prototype.Bd,Y.prototype.se,"RCSR"],Mg[65394]=[null,null,Y.prototype.Ad,Y.prototype.re,"RBUF"],Mg[65396]=[null,null,Y.prototype.Ud,Y.prototype.Le,"XCSR"],Mg[65398]=[null,null,Y.prototype.Td,Y.prototype.Ke,"XBUF"],Mg);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&&Pg(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;Pg(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.u=a;this.A=b;this.b=c;this.i=d;this.V=Qg(a);var e=this;if((this.g=dd(this.u,"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=Ic(56,4);this.da=wc(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.u&&!a.u.B.ja;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(nb(a.Pa,e,f),(e=Fa(e,f))&&Zg(a,b,c,d,e.ea,e.Ja, e.Ia));a.B.Xa=!1;a.D&&(a.D--,a.D||H(a));Wg(a)})}function Tg(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.ta);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.cc?"":e)+"&format=json"));return!!Ea(f, null,!0,function(b,c,d){fh(a,b,c,d)})} function fh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.u&&!a.u.B.ja;if(d)a.controller.O('Unable to load disk "'+a.Va+'" (error '+d+": "+b+")",f);else{nb(a.controller.Pa,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.ta=h.length;a.ya=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Ka=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 w=m<<2,y=t.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.Oa+a.Ba&&(a.Ba+=f-(a.Oa+a.Ba)+1):(a.Oa=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.Va+": "+c);return b}; k.toJSON=function(){var a;a=0;for(var b;b=hh(this,a++);)jh(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 jh(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){u.call(this,"RL11",a,N,2097152);this.w=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Pa("Mobi")&&window&&"FileReader"in window}z(N);k=N.prototype; k.sa=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&&kh(d,a)},!0;case "loadDrive":return this.G[b]= c,c.onclick=function(){var a=d.G.listDisks;a&&lh(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=hh(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";kh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){mh(this)};k.save=function(){return(new P(this)).data()}; k.restore=function(a){return mh(this,a[0])};function ph(a,b){b||(a.H=0);if(a.w)for(var c in a.w){var d=a.w[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+'"')}rh(a,e,b,c,!1,d)}else qh(a,e)} function rh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.cb.toLowerCase()!=d.toLowerCase()&&(g++,qh(a,b,!0),h.bc?a.O("RL11 busy"):(h.bc=!0,e&&(h.ac=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Ob=!!f,eh(new ah(a,h,"preload"),c,d,f,a.Lc)&&g++));return g} k.Lc=function(a,b,c,d,e){var f;a.bc=!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.ta||f[1]>a.ya)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.dc)),b=null);b?(a.Ca=b,a.Va=c,a.cb=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.dc),a.ac||e),this.u&&this.u.qb()):a.Ob=!1;a.ac&&(a.ac=!1,--this.H||H(this));kh(this,a.dc)}; function oh(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.fa=this.fa|a|32768);return!0}; k.gd=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 r,t;if(0>(r=a.Ca.read(m,n++))||0>(t=a.Ca.read(m,n++))){h=5120;break}this.A.eb(f,r|t<<8);if(vc(this.A)){h=8192;break}f+=2;if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ta)))){h=5120;break}}return g(h,b,c,d,e,f)}; k.ae=function(a,b,c,d,e,f,g){for(var h=0,l=a.Ca,m=null,n;e--;){var r=this.A.oa(f);if(vc(this.A)){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++,r&255)||!a.Ca.write(m,n++,r>>8)){h=5120;break}if(n>=l.Ka&&(m=null,++d>=l.qa&&(d=0,++c>=l.ya&&(c=0,++b>=l.ta)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Ed=function(){return this.fa&65535}; k.ve=function(a){this.fa=this.fa&-1023|a&1022;this.N=this.N&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=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.gd;case 10:b||(b=this.ae),d=this.g>>7,e=this.g&64?0:1,f=this.g&63,d>=c.ta||f>=c.qa?this.fa|=37888: (g=(this.K&63)<<16|this.J,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Mc.bind(this)))}a&&(this.fa|=129,this.fa&64&&xc(this.b,this.P))}};k.Cd=function(){return this.J};k.te=function(a){this.J=a&65534};k.Fd=function(){return this.g};k.we=function(a){this.g=a};k.Gd=function(){return this.D};k.xe=function(a){this.D=a};k.Dd=function(){return this.K};k.ue=function(a){this.K=a&63}; var sh={},nh=(sh[63744]=[null,null,N.prototype.Ed,N.prototype.ve,"RLCS"],sh[63746]=[null,null,N.prototype.Cd,N.prototype.te,"RLBA"],sh[65284]=[null,null,N.prototype.Fd,N.prototype.we,"RLDA"],sh[65286]=[null,null,N.prototype.Gd,N.prototype.xe,"RLMP"],sh[65288]=[null,null,N.prototype.Dd,N.prototype.ue,"RLBE"],sh);function th(a){u.call(this,"Debugger",a,th);this.$=a.base||16;this.Aa=!1;this.J=0;this.P=!1;this.w=-1;this.g=[];this.V={}}z(th); var uh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};th.prototype.rc=function(){return-1};th.prototype.sc=function(){}; function vh(a,b,c,d){if(c)if(b){0>a.w&&a.g.length&&(a.w=0);if(0>a.w||b!=a.g[a.w])a.g.splice(0,0,b),a.w=0;a.w--}else a.P?b="end":b=a.g[a.w+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 wh(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 xh(a,b,c){var d;if(b){b=yh(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 Bh(a,b){if(b)return Ah(a,b,a.V[b]);var c=0;for(b in a.V)Ah(a,b,a.V[b]),c++;return 0this.b.vb?Kh:[];Lh(this,function(a){a:{var b=d.A.W,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Mh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.A.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=rc[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.sc=function(a){var b;0<=a&&(8>a?b=this.b.v[a]:16>a?b=this.b.Ua[a-8]:20>a?b=this.b.Ha[a-16]:20==a&&(b=bc(this.b)));return b}; k.message=function(a,b){b&&(a+=" @"+J(this,Z(this.b.Ib).F));this.na&1073741824?this.ua.push(a):this.da&&a==this.da||(this.da=a,this.na&-2147483648&&this.b&&this.b.B.Z&&(this.ha(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,kd(a),a.ua=0,a.u&&a.u.ca()))};function Eh(a){var b;if(!ge(a))a.D&&a.D.length&&a.j("instruction history buffer freed"),a.Y=0,a.D=[];else if(!a.D||!a.D.length){a.D=Array(1E3);for(b=0;b>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Z(this.b.v[7]);a&&1!=this.R?Th(this):Uh(this)}};function Sh(a,b){var c;(c=!a.b||!tb(a.b))||(c=a.b,c.B.ja?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.B.Z?(b||a.j("cpu busy or unavailable, command ignored"),!1):!ub(a.b)}k.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Eh(this);this.va=0;this.da=null;this.J=0;this.K=Z(this.b.v[7]);this.B.Z=!1;Vh(this);a||this.ca()};k.save=function(){var a=new P(this);a.set(0,Oh(this.K));a.set(1,Oh(this.N));a.set(2,[this.g,this.P,this.na]);a.set(3,this.H);return a.data()}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Ph(a[b++]),this.N=Ph(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.P=a[b][1],this.na|=a[b][2]);a[3]&&(this.H=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.B.Z=!0;this.Nb=a;this.Qb=b}; k.stop=function(a,b){if(this.B.Z){this.B.Z=!1;this.J=b-this.Qb;if(!this.R){b="stopped";if(this.J){a-=this.Nb;var c=0d&&(d=a.b.mb(b)),65535!=(d&65535)&&(c=a.D[a.Y],c.F=b,c.Na=!1,++a.Y==a.D.length&&(a.Y=0)));return!1}function mf(a){var b=a.b;if(b.B.Z)throw O(b,a.b.Ib),a.ha(),-1;return!1} function Dh(a){var b,c;a.f=["bp"];if(a.L)for(b=1;b>>d.ka],!1)}a.L=["br"];if(a.C)for(b=1;b>>d.ka],!0);a.C=["bw"];a.hb=0}k.lb=function(a,b,c){var d=!0;c||Wh(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.A;f.W[e>>>f.ka].lb(e&f.A,a==this.C)}}d&&(a.push(b),c?b.Na=!0:(Xh(this,a,a.length-1,"set"),Eh(this)));return d}; function Wh(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g>>d.ka],b==a.C));h.Na||Eh(a);break}}return f}function Yh(a,b){for(var c=1;c>23)&65535,x=J(w,t);else if(8192==A)t=t.F-((f&63)<<1)&65535,x=J(w,t);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=Rh(y);break;case 8:x="@"+Rh(y);break;case 16:7>y?x="("+Rh(y)+")+":(A=w.oa(t,2),x="#"+J(w,A,0,!0));break;case 24:7>y?x="@("+Rh(y)+")+":(A=w.oa(t,2),x="@#"+J(w,A,0,!0));break;case 32:x="-("+Rh(y)+")";break;case 40:x="@-("+Rh(y)+")";break;case 48:A=w.oa(t,2);x=J(w,A,0,!0)+"("+Rh(y)+")";7==y&&(x=J(w,A+t.F&65535));break;case 56:A=w.oa(t,2),x="@"+J(w,A)+"("+Rh(y)+")",7==y&&(x="@"+J(w,A+t.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]); 0b?(c=Rh(b),c+="="+J(a,d.v[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ua[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ha[b-16]):20==b&&(c="PS="+J(a,bc(d)));c&&(c+=" ");return c}function ci(a){var b,c="";for(b=0;6>b;b++)c+=bi(a,b);c=c+"\n"+(bi(a,6)+bi(a,7)+bi(a,20));return c+=ai(a,"T")+ai(a,"N")+ai(a,"Z")+ai(a,"V")+ai(a,"C")}k.mc=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],r=Aa(n,l,a.mc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({Re:b,F:c,Tc:d,ia:e,kc:f})}function di(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b>>0,h=f.Tc;if(e>=g&&eb)){d.v[b]=f&65535;break}a.j("unknown register: "+e);return}a.u.ca();a.j("updated registers:")}a.j(ci(a));c&&(a.K=Z(d.v[7]),Uh(a,J(a,a.K.F)))}}function hi(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=$h(a,b,g,f);a.j(f);a.K=b;e-=b.F-l;c++}}} function Zh(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.P&&(a.j("ended assemble at "+J(a,a.N.F)),a.K=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.da=null;if(tb(a)&&0n||"z"na.length&&(a.j("note: only "+na.length+" available"),aa=na.length);fa-=aa;0>fa&&(null==na[na.length-1].F?(aa=fa+aa,fa=0):fa+=na.length);var Ed=[];"call"==tg&&(Gb=1E5,Ed=["CALL"]);for(void 0!==sg&&a.j(aa+" instructions earlier:");0=na.length&&(fa=0);a.rb=aa;vg++;Gb--}}vg||(a.j("no "+ug+"history available"),a.rb=void 0)}else{var Ib=Mh(a,ma);if(Ib){var zc=0;Ka&&("l"==Ka.charAt(0)&&(Ka=Ka.substr(1)||Bi),zc=zh(a,Ka)>>>0,65536>4||1;Di--&&0Dc?String.fromCharCode(Dc):".";Ac-=Cc}Jb&&(Jb+="\n");Jb+=ma+" "+Fd+(0==Lb?" "+yg:"")}Jb&&a.j(Jb);a.jb=Ib}}}}break;case "e":if("else"==g[0])break;var ib,Gd,Hd,Id,Jd=g[0],Kd=g[1];"eb"==Jd?(ib=1,Gd=255,Hd=a.Eb,Id=a.Vb):"e"==Jd||"ew"==Jd?(ib=2,Gd=65535,Hd=a.oa,Id=a.eb):Kd=null;if(null==Kd)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 Ec=Mh(a,Kd);if(Ec)for(var Fc= 2;FcNd;){for(var La=null,Hi=256;65536>Ob.F>>>0;){Od.F=a.oa(Ob,2);if(null==Ob.F||!Hi--)break;if(!(Od.F&1)){for(var Ii=a,Gc=Od,Ag=null,Pb=Gc.F,Bg=Pb,Pd=1;6>=Pd&&Pb;Pd++){if(2< Pd){Gc.F=Pb;var Hc=$h(Ii,Gc);if(0<=Hc.indexOf("JSR")){var Cg=Hc.indexOf(" ");if(Pb+(Hc.indexOf(" ",Cg+1)-Cg-1)/2==Bg){Ag=Hc;break}}}Pb-=2}Gc.F=Bg;if(La=Ag)break}}if(!La||null==La)break;var Dg=null;if("ks"==Gi){var Eg=La.match(/[0-9A-F]+$/);Eg&&(Dg=gi(a,Eg[0]))}La=xa(La,50)+" ;"+(Dg||"stack="+J(a,Ob.F));a.j(La);Nd++}Nd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){gi(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 Ca=0;if("all"== G)Ca=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){Ca=xb[oa];pa=!!(a.na&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.na|=Ca,pa=!0;else if("off"==g[2]&&(a.na&=~Ca,pa=!1,1073741824==Ca)){for(var Qd=0;Qd\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bmi){if(oi(d,this.H)){this.w=new P(this,"1.30.2","failsafe");oi(this.w)&&(ti(this,d),a=2,ui(this.w));this.w.set("timestamp",Da());vi(this.w);var e=this.u&&!this.C;if(1==a||Ha("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=si(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?oi(d,g):("error"== f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Oa("user",""),this.f=null)):this.j(f+": "+g),ui(d),oi(d)?(c=si(d),e=!0):c=!1))}e&&ri(this,c?d:null)}else 2==a&&d.clear()}else ri(this);delete this.H;delete this.J}e=ob(this.id);for(f=0;fa[1];a=a[2];this.$=!0;this.B.ja=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(wi(this,this.b,b,c,a),this.b.sb());this.N&&(ti(this,b),b.clear());!c&&this.w&&(this.w.clear(),delete this.w);this.g=0}; function ti(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.f||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.Y;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}} function ji(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new P(a,"1.30.2"),g=new P(a,"1.30.2","validate"),h=Da();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.2");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Fa&&(c&&a.b.ha(),d=a.b.Fa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.B.ja=!1,!1===d&&(e=null)));for(var h=ob(a.id),l=0;lf.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);Oi(a,b,c)}})}else c(a,null)} function Pi(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&&(--Ai||Za(!0));l=!1}var g,h,l=!0;Ai++;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],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.2/components.xsl");m=function(d,h){h?Mi(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,--Ai||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),--Ai||Za(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Mi(b,a,d,!0,e,m):Ni(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){Za(!1);return Pi(a,b,c,d)};window.enableEvents=Za;window.sendEvent=$a;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map