(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,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da>=3;return(c?"0o":"")+d}function l(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d} function ra(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function va(a){return a.replace(/[&<>"']/g,function(a){return ua[a]})} function wa(a,b){return(a+" ").slice(0,b)}function xa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ya={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 za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"== typeof b){var m="",n;for(n in b)b.hasOwnProperty(n)&&(m&&(m+="&"),m+=n+"="+encodeURIComponent(b[n]));m=m.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(m)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} function Ea(a,b){var c,d={ea:null,ga:null,Ca:null,Ba: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.Ca=g.load;d.Ba=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.ga=g.symbols;d.ea.length?1==d.ea.length&&(p(d.ea[0]),d=null):(p("Empty resource: "+a),d=null)}catch(h){p("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;cb?this.Za=this.id:(this.Ia=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Qa:!1,Vb:!1,ha:!1,error:!1};this.Lb=null;this.v.error=!1;this.F={};this.i=null;this.na=d||0;t.push(this)}var $a=void 0,ab={}; if(window){$a||($a=window.location.search.substr(1));for(var hb,ib=/\+/g,jb=/([^&=]+)=?([^&]*)/g;hb=jb.exec($a);)ab[decodeURIComponent(hb[1].replace(ib," "))]=decodeURIComponent(hb[2].replace(ib," "))}function kb(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 u(a,b){b||(b=r);a.prototype=kb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var lb=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else lb={},t=[];function mb(a,b,c){lb[a]&&b&&(lb[a][b]=c)}function nb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>2;this.w=this.ua-1;this.C=this.I/this.ua|0;this.Pa=[];this.f=0;this.A=[];this.Fc=[Rb,Sb,Tb,Ub];a=new I(this);Vb(a,this.i);this.W=Array(this.C);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Pa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&F(this.i,64)&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Xb(d,b,!0);this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} function Sb(a,b,c){var d=!1,e=this.controller,f=e.Pa[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.Pa[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,64)&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Xb(e,c,!0,b),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} function Tb(a,b){var c=-1,d=this.controller;(a=d.Pa[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,64)&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Xb(d,b,!1);this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} function Ub(a,b,c){var d=!1,e=this.controller;if(a=e.Pa[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,64)&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Xb(e,c,!1,b),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} function Yb(a,b){if(b!=a.B){var c;a.B&&(c=(1<>>a.ka;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.D)return m.Eb+=m.D-f,m.D=f,!0;if(f>=m.D+m.Eb){q=m.size-(f-n);q>g&&(q=g);m.Eb=f-m.D+q;f=n+a.ua;g-=q;h++;continue}}return dc(1,f,g)}f=new I(a,f,q,a.ua,d,e);Vb(f,a.i,m);a.W[h++]=f;f=n+a.ua;g-=q}if(0>=g){c/=1024;var w;e="";w?10>>=a.ka;0>>=a.ka;0>>this.ka].Pb(a&this.w,a)};k.Mb=function(a){this.f++;a=this.W[(a&this.g)>>>this.ka].ac(a&this.w,a);this.f--;return a};k.oa=function(a){return this.W[(a&this.g)>>>this.ka].pa(a&this.w,a)}; k.lb=function(a){var b=a&this.w,c=(a&this.g)>>>this.ka;this.f++;a=this.W[c].bc(b,a);this.f--;return a};k.Qb=function(a,b){this.W[(a&this.g)>>>this.ka].Tb(a&this.w,b&255,a)};k.fb=function(a,b){this.f++;this.W[(a&this.g)>>>this.ka].Ub(a&this.w,b&255,a);this.f--};k.hb=function(a,b){this.W[(a&this.g)>>>this.ka].Fb(a&this.w,b&65535,a)};k.Rb=function(a,b){var c=a&this.w,d=(a&this.g)>>>this.ka;this.f++;this.W[d].fc(c,b&65535,a);this.f--}; function fc(a){for(var b=0,c=[],d=0;da.b.mb)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!h&&n&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));gc(a,e,e,g,h,m,n,f[4])}}}function ic(a,b){a.A.push(b)} function jc(a,b,c){a.f||(a.i&&F(a.i,64)&&(E(a.i,"memory fault ("+c+") on address "+J(a.i,b),!0,!0),cc(a.i)),a.b.ja(4,b))}function dc(a,b,c){p("Memory block error ("+a+": "+l(b)+","+l(c)+")");return!1}function K(a){r.call(this,"Device",a,K,256);this.g={data:0,oe:0,Ob:20,Ed:0};this.f={se:0,ec:-1}}u(K);k=K.prototype; k.wa=function(a,b,c,d){this.w=b;this.b=c;this.i=d;var e=this;this.f.ec=kc(c,function(){e.f.Ra|=128;e.f.Ra&64&&(lc(e.b,e.f.Fd),mc(e.b,e.f.ec,1E3/60))});this.f.Fd=nc(64,6);hc(b,this,L);ic(b,this.reset.bind(this));G(this)};k.reset=function(){this.g.Ob=this.g.Ob&-120|20;this.f.Ra=0};k.$c=function(){var a=this.f.Ra;this.f.Ra&=-129;return a};k.Od=function(a){this.f.Ra=a;a&64&&mc(this.b,this.f.ec,1E3/60);this.f.Ra=a&-129};k.Tc=function(a){return(a?this.g.Ed:this.g.data)&65535}; k.Hd=function(a){this.g.data=a};k.bd=function(){var a=this.b;return a.C&62337|a.Ea<<5|a.Fa<<1};k.Qd=function(a){var b=this.b;a&=62337;if(b.C!=a){b.C=a;b.Ea=a>>5&3;b.Fa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Sa!=c&&(b.Sa=c,oc(b))}pc(this)};k.cd=function(){var a=this.b.Ua;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.dd=function(){return this.b.Db};k.ed=function(){return this.b.Va}; k.Rd=function(a){var b=this.b;1170>b.mb&&(a&=-49);b.Va!=a&&(b.Va=a,a&16?(b.xb=4194303,b.$a=3915776):(b.xb=262143,b.$a=253952),oc(b));pc(this)};function pc(a){a.g.Ob=a.g.Ob&-8|(a.b.Sa?a.b.Va&16?1:2:4)}k.td=function(a){return this.b.V[1][a>>1&7]};k.ee=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.rd=function(a){return this.b.V[1][(a>>1&7)+8]};k.ce=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.sd=function(a){return this.b.ta[1][a>>1&7]}; k.de=function(a,b){b=b>>1&7;this.b.ta[1][b]=a;this.b.V[1][b]&=65295};k.qd=function(a){return this.b.ta[1][(a>>1&7)+8]};k.be=function(a,b){b=(b>>1&7)+8;this.b.ta[1][b]=a;this.b.V[1][b]&=65295};k.Zc=function(a){return this.b.V[0][a>>1&7]};k.Nd=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.Xc=function(a){return this.b.V[0][(a>>1&7)+8]};k.Ld=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.Yc=function(a){return this.b.ta[0][a>>1&7]};k.Md=function(a,b){b=b>>1&7;this.b.ta[0][b]=a;this.b.V[0][b]&=65295}; k.Wc=function(a){return this.b.ta[0][(a>>1&7)+8]};k.Kd=function(a,b){b=(b>>1&7)+8;this.b.ta[0][b]=a;this.b.V[0][b]&=65295};k.zd=function(a){return this.b.V[3][a>>1&7]};k.ke=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.xd=function(a){return this.b.V[3][(a>>1&7)+8]};k.ie=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.yd=function(a){return this.b.ta[3][a>>1&7]};k.je=function(a,b){b=b>>1&7;this.b.ta[3][b]=a;this.b.V[3][b]&=65295};k.wd=function(a){return this.b.ta[3][(a>>1&7)+8]}; k.he=function(a,b){b=(b>>1&7)+8;this.b.ta[3][b]=a;this.b.V[3][b]&=65295};k.qb=function(a){a&=7;return this.b.M&2048?this.b.Na[a]:this.b.u[a]};k.ub=function(a,b){b&=7;this.b.M&2048?this.b.Na[b]=a:this.b.u[b]=a};k.kd=function(){return this.b.M&49152?this.b.Aa[0]:this.b.u[6]};k.Wd=function(a){this.b.M&49152?this.b.Aa[0]=a:this.b.u[6]=a};k.nd=function(){return this.b.u[7]};k.Zd=function(a){this.b.u[7]=a};k.rb=function(a){a&=7;return this.b.M&2048?this.b.u[a]:this.b.Na[a]}; k.vb=function(a,b){b&=7;this.b.M&2048?this.b.u[b]=a:this.b.Na[b]=a};k.ld=function(){return 1==(this.b.M&49152)>>14?this.b.u[6]:this.b.Aa[1]};k.Xd=function(a){1==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Aa[1]=a};k.md=function(){return 3==(this.b.M&49152)>>14?this.b.u[6]:this.b.Aa[3]};k.Yd=function(a){3==(this.b.M&49152)>>14?this.b.u[6]=a:this.b.Aa[3]=a};k.Vc=function(a){return this.b.yc[a-65504>>1]};k.Jd=function(a,b){this.b.yc[b-65504>>1]=a};k.vc=function(a){return 65520==a?61183:0};k.Cc=function(){}; k.vd=function(){return 1};k.ge=function(){};k.Uc=function(){return this.b.ca};k.Id=function(){this.b.ca=0};k.ad=function(){return this.b.xc};k.Pd=function(a,b){b&1||(a&=255);this.b.xc=a};k.fd=function(a){return a?this.b.dc:0};k.Sd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.dc=a;b.H|=2};k.ud=function(a){return a?this.b.Wa&65280:0};k.fe=function(a){this.b.Wa=a|255};k.jd=function(){return Bb(this.b)};k.Vd=function(a){qc(this.b,a&-1809|Bb(this.b)&1808);this.b.H|=128}; k.Bc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)}; var M={},L=(M[62592]=[null,null,K.prototype.td,K.prototype.ee,"SISDR",1145],M[62608]=[null,null,K.prototype.rd,K.prototype.ce,"SDSDR",1145],M[62624]=[null,null,K.prototype.sd,K.prototype.de,"SISAR",1145],M[62640]=[null,null,K.prototype.qd,K.prototype.be,"SDSAR",1145],M[62656]=[null,null,K.prototype.Zc,K.prototype.Nd,"KISDR",1145],M[62672]=[null,null,K.prototype.Xc,K.prototype.Ld,"KDSDR",1145],M[62688]=[null,null,K.prototype.Yc,K.prototype.Md,"KISAR",1145],M[62704]=[null,null,K.prototype.Wc,K.prototype.Kd, "KDSAR",1145],M[62798]=[null,null,K.prototype.ed,K.prototype.Rd,"MMR3",1145],M[65382]=[null,null,K.prototype.$c,K.prototype.Od,"LKS"],M[65400]=[null,null,K.prototype.Tc,K.prototype.Hd,"CNSL"],M[65402]=[null,null,K.prototype.bd,K.prototype.Qd,"MMR0",1145],M[65404]=[null,null,K.prototype.cd,K.prototype.Bc,"MMR1",1145],M[65406]=[null,null,K.prototype.dd,K.prototype.Bc,"MMR2",1145],M[65408]=[null,null,K.prototype.zd,K.prototype.ke,"UISDR",1145],M[65424]=[null,null,K.prototype.xd,K.prototype.ie,"UDSDR", 1145],M[65440]=[null,null,K.prototype.yd,K.prototype.je,"UISAR",1145],M[65456]=[null,null,K.prototype.wd,K.prototype.he,"UDSAR",1145],M[65472]=[null,null,K.prototype.qb,K.prototype.ub,"R0SET0"],M[65473]=[null,null,K.prototype.qb,K.prototype.ub,"R1SET0"],M[65474]=[null,null,K.prototype.qb,K.prototype.ub,"R2SET0"],M[65475]=[null,null,K.prototype.qb,K.prototype.ub,"R3SET0"],M[65476]=[null,null,K.prototype.qb,K.prototype.ub,"R4SET0"],M[65477]=[null,null,K.prototype.qb,K.prototype.ub,"R5SET0"],M[65478]= [null,null,K.prototype.kd,K.prototype.Wd,"R6KERNEL"],M[65479]=[null,null,K.prototype.nd,K.prototype.Zd,"R7KERNEL"],M[65480]=[null,null,K.prototype.rb,K.prototype.vb,"R0SET1",1145],M[65481]=[null,null,K.prototype.rb,K.prototype.vb,"R1SET1",1145],M[65482]=[null,null,K.prototype.rb,K.prototype.vb,"R2SET1",1145],M[65483]=[null,null,K.prototype.rb,K.prototype.vb,"R3SET1",1145],M[65484]=[null,null,K.prototype.rb,K.prototype.vb,"R4SET1",1145],M[65485]=[null,null,K.prototype.rb,K.prototype.vb,"R5SET1",1145], M[65486]=[null,null,K.prototype.ld,K.prototype.Xd,"R6SUPER",1145],M[65487]=[null,null,K.prototype.md,K.prototype.Yd,"R6USER",1145],M[65504]=[null,null,K.prototype.Vc,K.prototype.Jd,"CTRL",1170],M[65520]=[null,null,K.prototype.vc,K.prototype.Cc,"LSIZE",1170],M[65522]=[null,null,K.prototype.vc,K.prototype.Cc,"HSIZE",1170],M[65524]=[null,null,K.prototype.vd,K.prototype.ge,"SYSID",1170],M[65526]=[null,null,K.prototype.Uc,K.prototype.Id,"CPUERR",1170],M[65528]=[null,null,K.prototype.ad,K.prototype.Pd, "MB",1170],M[65530]=[null,null,K.prototype.fd,K.prototype.Sd,"PIR"],M[65532]=[null,null,K.prototype.ud,K.prototype.fe,"SL"],M[65534]=[null,null,K.prototype.jd,K.prototype.Vd,"PSW"],M);L[62594]=L[62592];L[62596]=L[62592];L[62598]=L[62592];L[62600]=L[62592];L[62602]=L[62592];L[62604]=L[62592];L[62606]=L[62592];L[62610]=L[62608];L[62612]=L[62608];L[62614]=L[62608];L[62616]=L[62608];L[62618]=L[62608];L[62620]=L[62608];L[62622]=L[62608];L[62626]=L[62624];L[62628]=L[62624];L[62630]=L[62624];L[62632]=L[62624]; L[62634]=L[62624];L[62636]=L[62624];L[62638]=L[62624];L[62642]=L[62640];L[62644]=L[62640];L[62646]=L[62640];L[62648]=L[62640];L[62650]=L[62640];L[62652]=L[62640];L[62654]=L[62640];L[62658]=L[62656];L[62660]=L[62656];L[62662]=L[62656];L[62664]=L[62656];L[62666]=L[62656];L[62668]=L[62656];L[62670]=L[62656];L[62674]=L[62672];L[62676]=L[62672];L[62678]=L[62672];L[62680]=L[62672];L[62682]=L[62672];L[62684]=L[62672];L[62686]=L[62672];L[62690]=L[62688];L[62692]=L[62688];L[62694]=L[62688];L[62696]=L[62688]; L[62698]=L[62688];L[62700]=L[62688];L[62702]=L[62688];L[62706]=L[62704];L[62708]=L[62704];L[62710]=L[62704];L[62712]=L[62704];L[62714]=L[62704];L[62716]=L[62704];L[62718]=L[62704];L[65410]=L[65408];L[65412]=L[65408];L[65414]=L[65408];L[65416]=L[65408];L[65418]=L[65408];L[65420]=L[65408];L[65422]=L[65408];L[65426]=L[65424];L[65428]=L[65424];L[65430]=L[65424];L[65432]=L[65424];L[65434]=L[65424];L[65436]=L[65424];L[65438]=L[65424];L[65442]=L[65440];L[65444]=L[65440];L[65446]=L[65440];L[65448]=L[65440]; L[65450]=L[65440];L[65452]=L[65440];L[65454]=L[65440];L[65458]=L[65456];L[65460]=L[65456];L[65462]=L[65456];L[65464]=L[65456];L[65466]=L[65456];L[65468]=L[65456];L[65470]=L[65456];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]; Wa(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.C,0,this.size>>2),Ic(this,Ec?Jc:Kc);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},ba:function(a,b){a&1&&jc(this.w,b,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},sa: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.La=!0},P:function(a,b){if(this.i&&null!=this.D){var c=this.i;Pc(c,this.D+a,1,c.L)&&c.ia(!0)}return this.ac(a,b)},Y:function(a,b){if(this.i&&null!=this.D){var c=this.i;Pc(c,this.D+a,2,c.L)&&c.ia(!0)}return this.bc(a, b)},ma:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Pc(d,this.D+a,1,d.C)&&d.ia(!0)}this.f?this.A(a,b,c):this.Ub(a,b,c)},va:function(a,b,c){if(this.i&&null!=this.D){var d=this.i;Pc(d,this.D+a,2,d.C)&&d.ia(!0)}this.f?this.A(a,b,c):this.fc(a,b,c)},N:function(a){return this.F[a]},R:function(a,b){a=this.F[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},Ia:function(a,b){a&1&&jc(this.w,b,2);return this.G.getUint16(a,!0)},Z:function(a,b){a&1&&jc(this.w, b,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.F[a]=b;this.La=!0},ra:function(a,b,c){this.F[a]=b;this.La=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},Za:function(a,b,c){a&1&&jc(this.w,c,4);this.G.setUint16(a,b,!0);this.La=!0},Ea:function(a,b,c){a&1&&jc(this.w,c,4);this.J[a>>1]=b;this.La=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i, b)+")",!0)}};function Vb(a,b,c){a.i=b;a.g=a.B=0;c&&((a.g=c.g)&&Oc(a,Nc,!1),(a.B=c.B)&&Mc(a,Nc,!1))}function Qc(a,b){b?--a.B||(a.Tb=a.f?a.A:a.Ub,a.Fb=a.f?a.I:a.fc):--a.g||(a.Pb=a.ac,a.pa=a.bc)}function Mc(a,b,c){c&&a.B||(a.Tb=!a.f&&b[1]||a.A,a.Fb=!a.f&&b[3]||a.I);if(c||void 0===c)a.Ub=b[1]||a.A,a.fc=b[3]||a.I}function Oc(a,b,c){c&&a.g||(a.Pb=b[0]||a.K,a.pa=b[2]||a.L);if(c||void 0===c)a.ac=b[0]||a.K,a.bc=b[2]||a.L}function Ic(a,b){b||(b=Rc);Oc(a,b,void 0);Mc(a,b,void 0)} var Rc=[],Lc=[I.prototype.S,I.prototype.sa,I.prototype.ba,I.prototype.Fa],Nc=[I.prototype.P,I.prototype.ma,I.prototype.Y,I.prototype.va];if(vb)var Kc=[I.prototype.N,I.prototype.la,I.prototype.Ia,I.prototype.Za],Jc=[I.prototype.R,I.prototype.ra,I.prototype.Z,I.prototype.Ea]; function Sc(a,b){r.call(this,"CPU",a,Sc,1);var c=a.multiplier||1;this.Ya=a.cycles||b;this.Ta=c;this.wb=Math.round(this.Ya/1E4)/100;this.eb=this.wb*this.Ta;this.v.fa=!1;this.v.Sb=!1;this.v.ib=a.autoStart;this.v.kb=!1;this.Ab=this.ma=0;this.Bb=a.csStart;this.nb=a.csInterval;this.ob=a.csStop;this.K=[];this.tc=this.Dd.bind(this);G(this)}u(Sc);var Tc=["power","reset"];k=Sc.prototype; k.wa=function(a,b,c,d){this.B=a;this.w=b;this.i=d;for(b=0;b=a.ma&&(a.ma+=a.nb,c=!0);0<=a.ob&&a.ob<=Zc(a)&&(a.nb=a.ob=-1,Wc(a),a.ia(),c=!0);c&&a.j(Zc(a)+" cycles: checksum="+l(a.Ab))}} k.qa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.F[b]=c,!0;case "run":return this.F[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.v.ha)a=!0;else{var b=null,c,h=nb(a.id);for(c=0;ca.Y/a.eb?b=1:d=!0;a.Ta=b;b=a.wb*a.Ta;if(a.eb!=b){a.eb=b;b=a.eb.toFixed(2)+"Mhz";var e=a.F.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.B&&a.B.gb()}ad(a,a.S);a.S=0;a.R=Aa();a.Z=0;bd(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.Ya*a.Ta/1E3*c|0,a.K[b][0]=c+cd(a))} function dd(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 ed(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 cd(a,b){var c=a.ba-=a.b;a.b=a.J=0;b&&(a.ba=0);return c} k.Dd=function(){if(this.v.fa){this.yb>=this.Ya&&bd(this,!0);this.va=0;this.ab=Aa();if(this.Z){var a=this.ab-this.Z;a>this.qc&&(this.R+=a,this.R>this.ab&&(this.R=this.ab))}try{do{var b=dd(this,this.v.kb?1:this.bb);try{this.tb(b)}catch(e){if("number"!=typeof e)throw e;}b=cd(this,!0);this.va+=b;this.S+=b;Yc(this,b);ed(this,b);this.ra-=b;if(0>=this.ra){this.ra+=this.bb;15<=++this.rc&&(this.B&&this.B.da(),this.rc=0);break}}while(this.v.fa)}catch(e){this.ia();this.B&&this.B.stop(Aa(),Zc(this));ub(this, e.stack||e.message);return}if(this.v.fa){a=setTimeout;b=this.tc;this.Z=Aa();var c=this.qc;this.va&&(c=Math.round(c*this.va/this.bb));var c=c-(this.Z-this.ab),d=this.Z-this.R;d&&(this.Y=Math.round(this.S/(10*d))/100,864E5<=d&&(this.la=0,$c(this)));if(0>c||this.Yc&&(this.R-=c),c=0;this.yb+=this.va;this.Z+=c;a(b,c)}}}; k.sb=function(a){if(tb(this))return!1;if(this.v.fa)return this.j(this.toString()+" busy"),!1;$c(this);this.v.fa=!0;this.v.Sb=!0;var b=this.F.run;b&&(b.textContent="Halt");this.B&&(a&&this.B.gb(!0),this.B.start(this.R,Zc(this)));setTimeout(this.tc,0);return!0};k.tb=function(){return 0};k.ia=function(a){var b=!1;if(this.v.fa){cd(this);ad(this,this.S);this.S=0;this.v.fa=!1;if(b=this.F.run)b.textContent="Run";this.B&&this.B.stop(Aa(),Zc(this));b=!0}this.v.complete=a;return b}; function fd(a){this.mb=+a.model||1170;this.Kb=a.addrReset||0;Sc.call(this,a,6666667);this.decode=1120==this.mb?gd.bind(this):hd.bind(this);id(this);this.L=0;this.N=null;this.v.complete=!1}u(fd,Sc);k=fd.prototype;k.reset=function(){this.status("model "+this.mb);this.v.fa&&this.ia();id(this);Vc(this);this.v.error=!1;this.parent.reset.call(this)}; function id(a){a.T=65536;a.U=32768;a.$=65535;a.X=32768;a.M=15;a.u=[0,0,0,0,0,0,0,a.Kb];a.Na=[0,0,0,0,0,0];a.Aa=[0,0,0,0];a.A=0;a.Fa=0;a.Nc=[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.ta=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.Sc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.yc=[0,0,0,0,0,0,0,0];a.xc=0;a.H=0;a.G=a.I=0;a.g=a.f=a.jb=0;a.sa=-1;jd(a)}function jd(a){a.Wa=255;a.ca=0;a.dc=0;a.C=0;a.Ua=0;a.Db=0;a.Va=0;a.Sa=0;a.Ea=0;a.xb=262143;a.$a=253952;a.N=null;a.w&&oc(a)}function oc(a){a.Sa?(a.P=65536,a.aa=a.Mc,a.pa=a.Ad,a.Fb=a.le,Yb(a.w,a.Va&16?22:18)):(a.P=0,a.aa=a.Lc,a.pa=a.wc,a.Fb=a.Dc,Yb(a.w,16))}function kd(a,b,c){a.Kb=b;N(a,b);!c&&a.i&&(a.ia()||a.i.da())}k.nc=function(){return 0}; k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.la,this.Ta]);a.set(2,fc(this.w));return a.data()};k.restore=function(a){var b=a[1];this.la=b[1];$c(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;c>14&3;c=a.M>>14&3;a.A!=c&&(a.Aa[c]=a.u[6],a.u[6]=a.Aa[a.A]);a.M=b;a.H|=2}function Q(a,b){a.H&128||(a.X=a.$=b,a.U=0)}function qd(a,b,c){a.H&128||(a.X=a.$=a.T=b,a.U=c||0)}function rd(a,b,c,d){a.H&128||(a.X=a.$=a.T=b,a.U=(c^b)&(d^b))}function sd(a,b){a.H&128||(a.X=a.$=a.T=b,a.U=a.X^a.T>>1)} function td(a,b,c,d){a.H&128||(a.X=a.$=a.T=b,a.U=(c^d)&(d^b))}k.ja=function(a,b){if(!this.L){var c=!1;0>this.sa?this.sa=Bb(this):this.A||(a=4,c=!0);this.C&57344||(this.Ua=63222,this.Db=a);this.A=0;var d=this.pa(a|this.P),e=this.pa(a+2&65535|this.P);qc(this,e&-12289|this.sa>>2&12288);c&&(this.ca|=4,this.u[6]=4);ud(this,this.sa);ud(this,this.u[7]);N(this,d);this.H&=-113;this.sa=-1;this.H|=8;this.Rc=a;this.Qc=b;if(26!=b)throw a;}}; function Md(a){var b=Nd(a),c=Nd(a)&-1793;a.M&49152&&(c=c&-225|a.M&63712);N(a,b);qc(a,c);a.H&=-17} function Od(a,b,c){var d,e,f,g=0;d=b>>13;a.Va&a.Nc[a.A]||(d&=7);e=a.V[a.A][d];f=(a.ta[a.A][d]<<6)+(b&8191)&a.xb;if(ff){if(3932160<=f){f&=262143;var h=f>>13&31;31>h?a.Va&32&&(f=a.Sc[h]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.$a&&4186112>f&&(a.ca|=32,a.ja(4,12))}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.A][d]=e;if(4194170!==f||a.A)a.Ea=a.A,a.Fa=d;g&&(g&57344&&(0<=a.sa&&(g|=128),a.C&57344||(a.C=a.C|g|a.Ea<<5|a.Fa<<1),a.ja(168,16)),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.pa(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.pa(e)| g;a.b-=8;break;case 6:return e=a.pa(pd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.pa(pd(a,2)),e=e+a.u[c]&65535,e=a.pa(e|a.P)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.C&57344||(a.Ua=a.Ua<<8|f<<3&248|c);6==c&&!a.A&&d&4&&0>=f&&(a.u[6]<=a.Wa||65534<=a.u[6])&&(a.u[6]<=a.Wa-32?(a.ca|=4,a.u[6]=4,a.ja(4,24)):(a.ca|=8,a.H|=64));return e}k.Mb=function(a){if(!this.Sa)return this.w.Mb(a);this.L++;a=Pd(this,Od(this,a,3));this.L--;return a}; k.lb=function(a){if(!this.Sa)return this.w.lb(a);this.L++;a=this.wc(Od(this,a,2));this.L--;return a};k.fb=function(a,b){this.Sa?(this.L++,Qd(this,Od(this,a,5),b),this.L--):this.w.fb(a,b)};k.Rb=function(a,b){this.Sa?(this.L++,this.Dc(Od(this,a,4),b),this.L--):this.w.Rb(a,b)};k.Lc=function(a,b,c){return Rd(this,a,b,c)};k.Mc=function(a,b,c){return Od(this,Rd(this,a,b,c),c)};k.wc=function(a){return this.w.oa(a)};k.Ad=function(a){return this.w.oa(Od(this,a,2))};k.Dc=function(a,b){this.w.hb(a,b&65535)}; k.le=function(a,b){this.w.hb(Od(this,a,4),b)};function Sd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Rd(a,b,d,2),c&65536||61440!==(a.M&61440)&&(d&=65535),a.A=a.M>>12&3,c=a.pa(d|c&a.P),a.A=a.M>>14&3):c=6!=d||(a.M>>2&12288)===(a.M&12288)?a.u[d]:a.Aa[a.M>>12&3];return c}function Td(a,b,c,d){a.C&57344||(a.Ua=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Rd(a,b,e,4),c&65536||(e&=65535),a.A=a.M>>12&3,e=Od(a,e|c&65536,4),a.A=a.M>>14&3,a.w.hb(e,d)):6!=e||(a.M>>2&12288)===(a.M&12288)?a.u[e]=d:a.Aa[a.M>>12&3]=d} function Ud(a,b){b>>=6;var c=a.I=b&7;return(b=a.G=(b&56)>>3)?Pd(a,a.aa(b,c,3)):a.u[c]&255}function Vd(a,b){b>>=6;var c=a.I=b&7;return(b=a.G=(b&56)>>3)?a.w.oa(a.aa(b,c,2)):a.u[c]}function Wd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Rd(a,b,c,8)}function Xd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?Pd(a,a.aa(b,c,3)):a.u[c]&255}function Yd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.w.oa(a.aa(b,c,2)):a.u[c]} function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.jb=a.aa(b,e,7),Qd(a,e,d.call(a,c,Pd(a,e)))):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.w.hb(e,d.call(a,c,a.w.oa(e)))):a.u[e]=d.call(a,c,a.u[e])}function Zd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?Qd(a,a.aa(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 $d(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.w.hb(a.aa(b,d,4),c):a.u[d]=c&65535;return c}function T(a,b,c){c&&(N(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} k.tb=function(a){this.v.complete=!0;var b=this.i&&ae(this.i)?1:this.v.Sb?-1:0,c=a?this.v.Sb?0:1:-1;this.v.Sb=!1;this.ba=this.b=a;do{if(b){if(this.i&&be(this.i,this.u[7],c)){this.ia();break}c||c++;b++}if(this.H){this.H&112&&(this.H&32?this.ja(168,28):this.H&64?this.ja(4,30):this.H&16&&this.ja(12,32),this.H&=-113);if(a=this.H&7){a=!1;if(this.H&2){this.H&=-3;var d=160,e=(this.dc&224)>>5,f=this.N&&this.N.pb>e?this.N:null;f&&(d=f.Gd,e=f.pb);e>(this.M&224)>>5?(this.H&4&&(pd(this,2),this.H&=-5),this.ja(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.H&1&&this.H++;a=a&&0>c}if(a)break}this.H=this.H&7|this.M&16;this.decode(od(this))}while(0>1|b<<16;sd(this,a);return a&65535}function he(a,b){a=b&2048|b>>1|b<<8;sd(this,a<<8);return a&255}function ie(a,b){a=b&~a;Q(this,a);return a}function je(a,b){a=b&~a;Q(this,a<<8);return a}function ke(a,b){a|=b;Q(this,a);return a}function le(a,b){a|=b;Q(this,a<<8);return a} function me(a,b){a=~b|65536;qd(this,a);return a&65535}function ne(a,b){a=~b|256;qd(this,a<<8);return a&255}function oe(a,b){a=b-a;this.H&128||(this.X=this.$=a,this.U=b&(b^a));return a&65535}function pe(a,b){a=b-a;var c=a<<8;b<<=8;this.H&128||(this.X=this.$=c,this.U=b&(b^c));return a&255}function qe(a,b){a=b+a;this.H&128||(this.X=this.$=a,this.U=a&(b^a));return a&65535}function re(a,b){a=b+a;var c=a<<8;this.H&128||(this.X=this.$=c,this.U=c&(b<<8^c));return a&255} function se(a,b){a=-b;qd(this,a,a&b&32768);return a&65535}function te(a,b){a=-b;qd(this,a<<8,(a&b&128)<<8);return a&255}function ue(a,b){a=b<<1|this.T>>16&1;sd(this,a);return a&65535}function ve(a,b){a=b<<1|this.T>>16&1;sd(this,a<<8);return a&255}function we(a,b){a=(this.T&65536|b)>>1|b<<16;sd(this,a);return a&65535}function xe(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;sd(this,a<<8);return a&255}function ye(a,b){var c=b-a;td(this,c,a,b);return c&65535} function ze(a,b){var c=b-a;td(this,c<<8,a<<8,b<<8);return c&255}function Ae(a,b){this.H&128||(this.X=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Be(a,b){a^=b;Q(this,a);return a&65535}function Ce(a){S(this,a,Vd(this,a),ce);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)} function De(a){var b=Yd(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.$=c;this.b-=(this.g?6:7)+b} function Ee(a){var b=Yd(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.$=d>>16|d;this.b-=(this.g?6:7)+b}function Fe(a){T(this,a,!ld(this))}function Ge(a){T(this,a,ld(this))} function He(a){S(this,a,Vd(this,a),ie);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)}function Ie(a){R(this,a,Ud(this,a),je);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)}function Je(a){S(this,a,Vd(this,a),ke);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)}function Ke(a){R(this,a,Ud(this,a),le);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)} function Le(a){Q(this,Vd(this,a)&Yd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)}function Me(a){Q(this,(Ud(this,a)&Xd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)}function Ne(a){T(this,a,nd(this))}function Oe(a){T(this,a,!this.Ma()==!md(this))}function Pe(a){T(this,a,!nd(this)&&!this.Ma()==!md(this))}function Qe(a){T(this,a,!ld(this)&&!nd(this))}function Re(a){T(this,a,nd(this)||!this.Ma()!=!md(this))} function Se(a){T(this,a,ld(this)||nd(this))}function Te(a){T(this,a,!this.Ma()!=!md(this))}function Ue(a){T(this,a,this.Ma())}function Ve(a){T(this,a,!nd(this))}function We(a){T(this,a,!this.Ma())}function Xe(){this.ja(12,1);this.b-=5}function Ye(a){T(this,a,!0)}function Ze(a){T(this,a,!md(this))}function $e(a){T(this,a,md(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.X=0);this.b-=5} function af(a){var b=Vd(this,a);a=Yd(this,a);td(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)}function bf(a){var b=Ud(this,a)<<8;a=Xd(this,a)<<8;td(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)} function cf(a){var b=Yd(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.$=d>>16|d,this.X=d>>16):(this.U=32768,this.$=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.$=this.X=0,this.U=32768,this.T=65536,this.b-=7}function df(){this.ja(24,2);this.b-=25} function ef(){this.M&49152?(this.ca|=128,this.ja(4,3)):this.i?cc(this.i):this.ia();this.b-=7}function ff(){this.ja(16,4);this.b-=25}var gf=[0,7,7,10,7,11,9,13];function hf(a){this.J=this.b;N(this,Wd(this,a));this.b=this.J-gf[this.g]}var jf=[0,14,14,17,14,18,16,20];function kf(a){this.J=this.b;var b=Wd(this,a);a=a>>6&7;ud(this,this.u[a]);this.u[a]=this.u[7];N(this,b);this.b=this.J-jf[this.g]}var lf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17]; function mf(a){var b=Vd(this,a);this.J=this.b;Q(this,$d(this,a,b));this.b=this.J-lf[(this.G?8:0)+this.g]+(7!=this.f||this.g?0:2)}function nf(a){var b=Ud(this,a);Q(this,Zd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)}var of=[7,13,13,17,14,18,17,21]; function pf(a){var b=Yd(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.H&128||(this.X=b>>16,this.$=this.X|b,this.U=0,this.T=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)N(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function vf(a){S(this,a,Vd(this,a),ye);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)} function wf(a){S(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}function xf(){this.ja(28,5);this.b-=5}function yf(){this.H&4||this.B.da();this.H|=4;pd(this,-2);this.b-=3}function zf(a){S(this,a,Vd(this,a),Be);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,E(b,"undefined opcode "+J(b,a),!0,!0),b=cc(b);b||this.ja(8,6)}function gd(a){Af[a>>12].call(this,a)}function Bf(a){Cf[a>>6&3].call(this,a)}function Df(a){Ef[a>>6&3].call(this,a)} function Ff(a){Gf[a>>6&3].call(this,a)}function Hf(a){If[a&15].call(this,a)}function Jf(a){Kf[a&15].call(this,a)}function Lf(a){Mf[a>>6&3].call(this,a)}function Nf(a){Of[a>>6&3].call(this,a)}function Pf(a){Qf[a>>6&3].call(this,a)} var Af=[function(a){Rf[a>>8&15].call(this,a)},mf,af,Le,He,Je,Ce,V,function(a){Sf[a>>8&15].call(this,a)},nf,bf,Me,Ie,Ke,vf,V],Rf=[function(a){Tf[a>>4&15].call(this,a)},Ye,Ve,Ne,Oe,Te,Pe,Re,kf,kf,Bf,Df,Ff,V,V,V],Cf=[function(a){qd(this,$d(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,qe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,oe);this.b-=this.g?9:3+(7==this.f?2:0)}],Ef=[function(a){S(this,a,0, se);this.b-=this.g?11:6},function(a){S(this,a,ld(this)?1:0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,ld(this)?1:0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Yd(this,a);qd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],Gf=[function(a){S(this,a,0,we);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)}], Tf=[function(a){Uf[a&15].call(this,a)},V,V,V,hf,hf,hf,hf,tf,V,Hf,Jf,wf,wf,wf,wf],Uf=[ef,yf,sf,Xe,ff,rf,V,V,V,V,V,V,V,V,V,V],If=[qf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.X=0;this.b-=5},U,U,U,U,U,U,U],Kf=[qf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.X=32768;this.b-=5},W,W,W,W,W,W,W],Sf=[We,Ue,Qe,Se,Ze,$e,Fe,Ge,df,xf,Lf,Nf,Pf,V,V,V],Mf=[function(a){qd(this, Zd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,pe);this.b-=this.g?9:3+(7==this.f?2:0)}],Of=[function(a){R(this,a,0,te);this.b-=this.g?11:6},function(a){R(this,a,ld(this)?1:0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,ld(this)?1:0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Xd(this,a);qd(this,a<<8);this.b-=this.g?4:3+(7== this.f?2:0)}],Qf=[function(a){R(this,a,0,xe);this.b-=this.g?9+(this.jb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,he);this.b-=this.g?9+(this.jb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,fe);this.b-=this.g?9:3+(7==this.f?2:0)}];function hd(a){Vf[a>>12].call(this,a)} var Vf=[function(a){Wf[a>>8&15].call(this,a)},mf,af,Le,He,Je,Ce,function(a){Xf[a>>8&15].call(this,a)},function(a){Yf[a>>8&15].call(this,a)},nf,bf,Me,Ie,Ke,vf,V],Wf=[function(a){Zf[a>>4&15].call(this,a)},Ye,Ve,Ne,Oe,Te,Pe,Re,kf,kf,Bf,Df,Ff,function(a){$f[a>>6&3].call(this,a)},V,V],$f=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.pa(a|this.P);N(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Sd(this,a,0);ud(this,a);Q(this,a);this.b-=11},function(a){var b=Nd(this);this.J= this.b;Td(this,a,0,b);Q(this,b);this.b=this.J-of[this.g]},function(a){Q(this,$d(this,a,this.Ma?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Zf=[function(a){ag[a&15].call(this,a)},V,V,V,hf,hf,hf,hf,tf,function(a){a&8?(this.M&49152||(this.M=this.M&-2017|(a&7)<<5,this.H|=1),this.b-=5):V.call(this,a)},Hf,Jf,wf,wf,wf,wf],ag=[ef,yf,sf,Xe,ff,rf,function(){Md(this);this.b-=13},V,V,V,V,V,V,V,V,V],Xf=[pf,pf,cf,cf,De,De,Ee,Ee,zf,zf,V,V,V,V,uf,uf],Yf=[We,Ue,Qe,Se,Ze,$e,Fe,Ge,df,xf,Lf,Nf,Pf,function(a){bg[a>> 6&3].call(this,a)},V,V],bg=[V,function(a){a=Sd(this,a,65536);ud(this,a);Q(this,a);this.b-=11},function(a){var b=Nd(this);this.J=this.b;Td(this,a,65536,b);Q(this,b);this.b=this.J-of[this.g]},V]; function cg(a){r.call(this,"ROM",a,cg);this.ga=this.f=null;this.C=a.addr;this.g=a.size;this.A=a.alias;this.B=a.file;this.G=ra(this.B);if(this.B){a=this.B;var b=sa(this.G);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?c.O("Unable to load ROM resource (error "+f+": "+a+")"):(mb(c.Ia,a,b),(a=Ea(a,b))?(c.f=a.ea,c.ga=a.ga):c.B=null,dg(c))})}}u(cg);cg.prototype.wa=function(a,b,c,d){this.w=b;this.b=c;this.i=d;dg(this)}; cg.prototype.za=function(){this.ga&&(this.i&&eg(this.i,this.id,this.C,this.g,this.ga),delete this.ga);return!0};cg.prototype.ya=function(){return!0}; function dg(a){if(!sb(a)){if(a.B){if(!a.f||!a.w)return;a.g||(a.g=a.f.length);if(a.f.length!=a.g)ub(a,"ROM size ("+l(a.f.length,8,!0)+") does not match specified size ("+l(a.g,8,!0)+")");else{var b;b=a.C;if(ac(a.w,b,a.g,Hc)){var c;for(c=0;c>>a.ka;0=b.length)break;for(var h=h+2,n=b[h++]&255|(b[h++]&255)<<8,q=b[h++]&255|(b[h++]&255)<<8,m=m+((n&255)+(n>>8)+(q&255)+(q>>8)),w=h,v=n-=6;0=b.length)break;m+=b[h++]&255;if(m&255)break;if(v)for(;v--;)a.b.fb(q++,b[w++]&255);else q&1?a.b.ia():kd(a.b,q,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.la))});this.ma=nc(52,4);this.Z=kc(this.b,function(){e.g|=128;e.g&64&&lc(e.b,e.ma)});hc(b,this,Dg);G(this)}; k.sc=function(){if(!this.J){var a=Uc(this.B,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.J=ob(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.Ia+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.za=function(a,b){if(!b)if(this.sc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; k.ya=function(a){return a?this.save():!0};k.reset=function(){Eg(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return Eg(this)};function Eg(a){a.K=0;a.f=0;a.g=128;a.C=[];return!0}k.cc=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.I%a,this.S&&(b=wa("",c)));this.P&&!this.I&&c&&(b=String.fromCharCode(this.P)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.I+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.j(this.G), this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;mc(this.b,this.Z,1E3/Math.round(this.R/10))}};var Fg={},Dg=(Fg[65392]=[null,null,X.prototype.pd,X.prototype.ae,"RCSR"],Fg[65394]=[null,null,X.prototype.od,X.prototype.$d,"RBUF"],Fg[65396]=[null,null,X.prototype.Cd,X.prototype.ne,"XCSR"],Fg[65398]=[null,null,X.prototype.Bd,X.prototype.me,"XBUF"],Fg);Wa(function(){for(var a=D(document,"pdp11","serial"),b=0;b'+b+"");a.innerHTML=b}},!0;case "descTape":return this.F[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.F[b]=c,c.onclick= function(){var a=d.F.listTapes;a&&Ig(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.R){c.parentNode.removeChild(c);break}this.F[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;Ig(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.F[b]=c,!0}return!1}; k.wa=function(a,b,c,d){this.B=a;this.w=b;this.b=c;this.i=d;this.Y=Jg(a);var e=this;if((this.g=Uc(this.B,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){p("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.P=nc(56,4);this.ba=kc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.Kc.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.B&&!a.B.v.ha;g?a.O('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(mb(a.Ia,e,f),(e=Ea(e,f))&&Sg(a,b,c,d,e.ea,e.Ca, e.Ba));a.v.Qa=!1;a.G&&(a.G--,a.G||G(a));Pg(a)})}function Mg(a,b,c,d){if((a=a.F.listTapes)&&a.options){for(var e=0;e>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.Ha);for(d=0;dc.indexOf("/api/v1/dump")&&(b=sa(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"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.Zb?"":e)+"&format=json"));return!!Da(f, null,!0,function(b,c,d){Zg(a,b,c,d)})} function Zg(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.B&&!a.B.v.ha;if(d)a.controller.O('Unable to load disk "'+a.Oa+'" (error '+d+": "+b+")",f);else{mb(a.controller.Ia,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)p(h[0]);else{a.Ha=h.length;a.Da=h[0].length;a.xa=h[0][0].length;var m=h[0][0][0];a.Ja=m&&m.length||512;for(d=c=0;d>2,q=m.pattern;void 0===q&&(q=m.pattern=0);var w=m.data;if(void 0===w){var v=m.bytes;if(void 0!==v&&v.length){for(var x=n<<2,z=v.length;z>2,e=Array(d),f=0;f>2,g=(h>((f&3)<<3)&255;f=g;if(0>f)break;d|=f<=this.b.length||m>=this.b[h].length||n>=this.b[h][m].length){c="sector (CHS="+h+":"+m+":"+n+") 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][m][n]){for(m=h.data.length;mb&&-2!=b&&this.controller.O("Unable to restore disk '"+this.Oa+": "+c);return b}; Ug.prototype.toJSON=function(){var a;a=0;for(var b;b=ah(this,a++);)ch(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 ch(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 sc(a){r.call(this,"RL11",a,sc,2097152);this.g=a.autoMount||null;this.A=0;this.f=Array(1);this.C=!Oa("Mobi")&&window&&"FileReader"in window}u(sc);k=sc.prototype; k.qa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.F[b]=c,c.onchange=function(){var a=d.F.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){p("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.F[b]=c,c.onchange=function(){var a=pa(c.value,10);null!=a&&dh(d,a)},!0;case "loadDrive":return this.F[b]= c,c.onclick=function(){var a=d.F.listDisks;a&&eh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.C){c.parentNode.removeChild(c);break}this.F[b]=c;c.onclick=function(){var a=d.F.listDrives;if(a&&a.options&&d.f)if(a=d.f[pa(a.value,10)||0])if(a=a.Hb){var b;b="";for(var c=0,h;h=ah(a,c++);)for(var m=0,n=h.length;mb;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";dh(this,0)}}return!0};k.ya=function(a){return a?this.save():!0};k.reset=function(){fh(this)};k.save=function(){return(new O(this)).data()}; k.restore=function(){return!0};function fh(a){for(var b=0;bg||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=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}kh(a,e,b,c,!1,d)}else jh(a,e)} function kh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.Xa.toLowerCase()!=d.toLowerCase()&&(g++,jh(a,b,!0),h.Yb?a.O("RL11 busy"):(h.Yb=!0,e&&(h.Xb=!0,a.A++,F(a)&&E(a,"auto-loading disk: "+c)),h.Ib=!!f,Yg(new Ug(a,h,"preload"),c,d,f,a.Jc)&&g++));return g} k.Jc=function(a,b,c,d,e){var f;a.Yb=!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.Ha||f[1]>a.Da)&&(this.O('Disk "'+c+'" too large for drive '+("RL"+a.$b)),b=null);b?(a.Hb=b,a.Oa=c,a.Xa=d,this.O('Mounted disk "'+c+'" in drive '+("RL"+a.$b),a.Xb||e),this.B&&this.B.gb()):a.Ib=!1;a.Xb&&(a.Xb=!1,--this.A||G(this));dh(this,a.$b)}; function hh(a,b,c,d){if((a=a.F.listDisks)&&a.options){for(var e=0;e=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};lh.prototype.oc=function(){return-1};lh.prototype.pc=function(){}; function nh(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.P?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a} function oh(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 ph(a,b,c){var d;if(b){b=qh(a,b);for(var e=0,f=!1,g=b,h=[],m=[],n=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=l(c,0,!0)+" "+c+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function th(a,b){if(b)return sh(a,b,a.S[b]);var c=0;for(b in a.S)sh(a,b,a.S[b]),c++;return 0this.b.mb?Ch:[];Dh(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=d.aa(Eh(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.w.ka;m=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,n=0;m--;){var q=b[e];q.type==c?n++||d.j("..."):(c=q.type,n=ec[c],q&&d.j(l(q.id,8)+" %"+l(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}k.pc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Na[a-8]:20>a?b=this.b.Aa[a-16]:20==a&&(b=Bb(this.b)));return b}; k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Db).D));this.na&1073741824?this.ra.push(a):this.ba&&a==this.ba||(this.ba=a,this.na&-2147483648&&(this.ia(),a+=" (cpu halted)"),this.j(a),this.b&&(a=this.b,cd(a),a.ra=0,a.B.da()))};function wh(a){var b;if(!ae(a))a.G&&a.G.length&&a.j("instruction history buffer freed"),a.Y=0,a.G=[];else if(!a.G||!a.G.length){a.G=Array(1E3);for(b=0;b>8;this.j("trapped to "+J(this,b&255,1)+(c?" ("+J(this,c)+")":""))}this.K=Y(this.b.u[7]);a&&1!=this.R?Lh(this):Mh(this)}};function Kh(a,b){var c;(c=!a.b||!sb(a.b))||(c=a.b,c.v.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.v.fa?(b||a.j("cpu busy or unavailable, command ignored"),!1):!tb(a.b)}k.za=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; k.ya=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){wh(this);this.sa=0;this.ba=null;this.J=0;this.K=Y(this.b.u[7]);this.v.fa=!1;Nh(this);a||this.da()};k.save=function(){var a=new O(this);a.set(0,Gh(this.K));a.set(1,Gh(this.N));a.set(2,[this.g,this.P,this.na]);a.set(3,this.I);return a.data()}; k.restore=function(a){var b=0;void 0!==a[2]&&(this.K=Hh(a[b++]),this.N=Hh(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.I=a[3]);return!0};k.start=function(a,b){this.R||this.j("running");this.v.fa=!0;this.xb=a;this.yb=b}; k.stop=function(a,b){if(this.v.fa){this.v.fa=!1;this.J=b-this.yb;if(!this.R){b="stopped";if(this.J){a-=this.xb;var c=0d&&(d=a.b.lb(b)),65535!=(d&65535)&&(c=a.G[a.Y],c.D=b,c.Ga=!1,++a.Y==a.G.length&&(a.Y=0)));return!1}function cc(a){var b=a.b;if(b.v.fa)throw N(b,a.b.Db),a.ia(),-1;return!1} function vh(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.Ya=0}k.cb=function(a,b,c){var d=!0;c||Oh(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.D)),d=!1;else{var f=this.w;f.W[e>>>f.ka].cb(e&f.w,a==this.C)}}d&&(a.push(b),c?b.Ga=!0:(Ph(this,a,a.length-1,"set"),wh(this)));return d}; function Oh(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g>>d.ka],b==a.C));h.Ga||wh(a);break}}return f}function Qh(a,b){for(var c=1;c>23)&65535,y=J(x,v);else if(8192==B)v=v.D-((f&63)<<1)&65535,y=J(x,v);else if(12288==B)y=J(x,f&7,1);else if(24576==B)y=J(x,f&63,1);else if(32768==B)y=J(x,f&255,1);else if(B=f&z,z&4032&&(B>>=6,z>>=6), z&63)switch(z=B&7,B&56){case 0:y=Jh(z);break;case 8:y="@"+Jh(z);break;case 16:7>z?y="("+Jh(z)+")+":(B=x.oa(v,2),y="#"+J(x,B,0,!0));break;case 24:7>z?y="@("+Jh(z)+")+":(B=x.oa(v,2),y="@#"+J(x,B,0,!0));break;case 32:y="-("+Jh(z)+")";break;case 40:y="@-("+Jh(z)+")";break;case 48:B=x.oa(v,2);y=J(x,B,0,!0)+"("+Jh(z)+")";7==z&&(y=J(x,B+v.D&65535));break;case 56:B=x.oa(v,2),y="@"+J(x,B)+"("+Jh(z)+")",7==z&&(y="@"+J(x,B+v.D&65535))}x=y;if(!x||!x.length){h="INVALID";break}"string"!=typeof x&&(n=x[1],x=x[0]); 0b?(c=Jh(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Na[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Aa[b-16]):20==b&&(c="PS="+J(a,Bb(d)));c&&(c+=" ");return c}function Vh(a){var b,c="";for(b=0;6>b;b++)c+=Uh(a,b);c=c+"\n"+(Uh(a,6)+Uh(a,7)+Uh(a,20));return c+=Th(a,"T")+Th(a,"N")+Th(a,"Z")+Th(a,"V")+Th(a,"C")}k.ic=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],w=za(q,m,a.ic);0>w&&q.splice(-(w+1),0,m)}n&&(h.a=n.replace(/''/g,'"'))}a.I.push({we:b,D:c,Pc:d,ga:e,gc:f})}function Wh(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b>>0,h=f.Pc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.B.da();a.j("updated registers:")}a.j(Vh(a));c&&(a.K=Y(d.u[7]),Mh(a,J(a,a.K.D)))}}function $h(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var n=h[0]+":";h[2]&&(n+=" "+h[2]);a.j(n)}h[3]&&(g=h[3],f=null);f=Sh(a,b,g,f);a.j(f);a.K=b;e-=b.D-m;c++}}} function Rh(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.D)),a.K=a.N,a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ba=null;if(sb(a)&&0q||"z"ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);ea-=Z;0>ea&&(null==ma[ma.length-1].D?(Z=ea+Z,ea=0):ea+=ma.length);var xd=[];"call"==lg&&(Db=1E5,xd=["CALL"]);for(void 0!==kg&&a.j(Z+" instructions earlier:");0=ma.length&&(ea=0);a.bb=Z;ng++;Db--}}ng||(a.j("no "+mg+"history available"),a.bb=void 0)}else{var Fb=Eh(a,la);if(Fb){var vc=0;La&&("l"==La.charAt(0)&&(La=La.substr(1)||ti),vc=rh(a,La)>>>0,65536>4||1;vi--&&0zc?String.fromCharCode(zc):".";wc-=yc}Gb&&(Gb+="\n");Gb+=la+" "+yd+(0==Ib?" "+qg:"")}Gb&&a.j(Gb);a.$a=Fb}}}}break;case "e":if("else"==g[0])break;var gb,zd,Ad,Bd,Cd=g[0],Dd=g[1];"eb"==Cd?(gb=1,zd=255,Ad=a.zb,Bd=a.Qb):"e"==Cd||"ew"==Cd?(gb=2,zd=65535,Ad=a.oa,Bd=a.hb):Dd=null;if(null==Dd)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 Ac=Eh(a,Dd);if(Ac)for(var Bc=2;BcGd;){for(var Ma=null,zi=256;65536>Lb.D>>>0;){Hd.D=a.oa(Lb,2);if(null==Lb.D||!zi--)break;if(!(Hd.D&1)){for(var Ai=a,Cc=Hd,sg=null,Mb=Cc.D,tg=Mb,Id=1;6>=Id&&Mb;Id++){if(2\nLicense: GPL version 3 or later ");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis ");for(b=0;bei){if(gi(d,this.J)){this.C=new O(this,"1.30.2","failsafe");gi(this.C)&&(li(this,d),a=2,mi(this.C));this.C.set("timestamp",Ba());ni(this.C);var e=this.f&&!this.G;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ki(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?gi(d,g):("error"== f&&"no machine state"!=g?(this.O("Error: "+g),"unable to verify user"==g&&(Na("user",""),this.g=null)):this.j(f+": "+g),mi(d),gi(d)?(c=ki(d),e=!0):c=!1))}e&&ji(this,c?d:null)}else 2==a&&d.clear()}else ji(this);delete this.J;delete this.K}e=nb(this.id);for(f=0;fa[1];a=a[2];this.ba=!0;this.v.ha=!0;var d=this.F.power;d&&(d.textContent="Shutdown");this.b&&(oi(this,this.b,b,c,a),this.b.ib());this.P&&(li(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.B=0}; function li(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.2"};d.url=a.Z;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}} function bi(a,b,c){var d,e="none";if(a.B)return null;a.B--;var f=new O(a,"1.30.2"),g=new O(a,"1.30.2","validate"),h=Ba();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.ya&&(c&&a.b.ia(),d=a.b.ya(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ha=!1,!1===d&&(e=null)));for(var h=nb(a.id),m=0;mf.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(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=h[0],n,q=/( [a-z]+=)(['"])(.*?)\2/g;n=q.exec(f);)m=0>m.indexOf(n[1])?m.replace(">",n[0]+">"):m.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=m&&(g=g.replace(h[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, "");a=a.replace(d[0],g);Gi(a,b,c)}})}else c(a,null)} function Hi(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=va(a))}function f(a){e("Error: "+a);m&&(--si||Ya(!0));m=!1}var g,h,m=!0;si++;lb[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],w=document.createElement("style");w.type="text/css";w.styleSheet?w.styleSheet.cssText=n:w.appendChild(document.createTextNode(n));q.appendChild(w)}c|| (c="/versions/pdpjs/1.30.2/components.xsl");n=function(d,h){h?Ei(c,null,null,!1,e,function(d,m){m?(mb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=h.transformNode(m))?(g.outerHTML=m,--si||Ya(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(h,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--si||Ya(!0)):f("invalid machine element: "+ a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ei(b,a,d,!0,e,n):Fi(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(v){f(v.message)}return m}window.embedPDP11=function(a,b,c,d){Ya(!1);return Hi(a,b,c,d)};window.enableEvents=Ya;window.sendEvent=Za;})();//# sourceMappingURL=/tmp/pdpjs/1.30.2/pdp11-dbg.map