|
|
|
|
@ -9,222 +9,222 @@ typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encod
|
|
|
|
|
function t(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
|
|
|
|
function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
|
|
|
|
function Fa(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}var Ga={init:[],show:[],exit:[]},Ha=!1,Ia=!1,Ja=!0;function Ka(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function La(a){Ga.init.push(a)}
|
|
|
|
|
function Ma(a){if(Ja)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ta(a){!Ja&&a?(Ja=!0,Ha&&Ua("init"),Ia&&Ua("show")):Ja=a}function Ua(a){Ga[a]&&Ma(Ga[a])}Ka("onload",function(){Ha=!0;Ma(Ga.init)});Ka("onpageshow",function(){Ia=!0;Ma(Ga.show)});Ka(Da("Opera")||Da("iOS")?"onunload":"onbeforeunload",function(){Ma(Ga.exit)});
|
|
|
|
|
function w(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.sc=b.comment;this.Qc=b;b=this.id.indexOf(".");0>b?this.pb=this.id:(this.dc=this.id.substr(0,b),this.pb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Hb:!1,ec:!1,ia:!1,error:!1};this.Xb=null;this.v.error=!1;this.K={};this.j=null;this.ka=d||0;x.push(this)}var Va=void 0,Wa={};
|
|
|
|
|
if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function $a(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 y(a,b){b||(b=w);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},x=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<x.length;b++){var d=x[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
|
|
|
|
function db(a){if(void 0!==a){var b;for(b=0;b<x.length;b++)if(x[b].id===a)return x[b]}return null}function eb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<x.length;d++)if(c)c==x[d]&&(c=null);else if(!(a!=x[d].type||b&&x[d].id.indexOf(b)))return x[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
|
|
|
|
function fb(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.pa(g.type,g.binding,f,g.value),l=h.length}}}}
|
|
|
|
|
function Ma(a){if(Ja)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Sa(a){!Ja&&a?(Ja=!0,Ha&&Ta("init"),Ia&&Ta("show")):Ja=a}function Ta(a){Ga[a]&&Ma(Ga[a])}Ka("onload",function(){Ha=!0;Ma(Ga.init)});Ka("onpageshow",function(){Ia=!0;Ma(Ga.show)});Ka(Da("Opera")||Da("iOS")?"onunload":"onbeforeunload",function(){Ma(Ga.exit)});
|
|
|
|
|
function w(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.tc=b.comment;this.Rc=b;b=this.id.indexOf(".");0>b?this.Pb=this.id:(this.cc=this.id.substr(0,b),this.Pb=this.id.substr(b+1));this[a]=c;this.v={ready:!1,Bb:!1,dc:!1,ia:!1,error:!1};this.Rb=null;this.v.error=!1;this.K={};this.j=null;this.ka=d||0;x.push(this)}var Ua=void 0,Va={};
|
|
|
|
|
if(window){Ua||(Ua=window.location.search.substr(1));for(var Wa,Xa=/\+/g,Ya=/([^&=]+)=?([^&]*)/g;Wa=Ya.exec(Ua);)Va[decodeURIComponent(Wa[1].replace(Xa," "))]=decodeURIComponent(Wa[2].replace(Xa," "))}function Za(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 y(a,b){b||(b=w);a.prototype=Za(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var $a=window.PCjs.Machines||(window.PCjs.Machines={}),x=window.PCjs.Components||(window.PCjs.Components=[])}else $a={},x=[];function ab(a,b,c){$a[a]&&b&&($a[a][b]=c)}function bb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<x.length;b++){var d=x[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
|
|
|
|
function cb(a){if(void 0!==a){var b;for(b=0;b<x.length;b++)if(x[b].id===a)return x[b]}return null}function db(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<x.length;d++)if(c)c==x[d]&&(c=null);else if(!(a!=x[d].type||b&&x[d].id.indexOf(b)))return x[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
|
|
|
|
function eb(a,b){b=D(b.parentNode,"pdp11-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),l=0;l<h.length;l++)switch(g=h[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.pa(g.type,g.binding,f,g.value),l=h.length}}}}
|
|
|
|
|
function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
|
|
|
|
|
w.prototype={constructor:w,parent:null,toString:function(){return this.name?this.name:this.id||this.type},pa:function(a,b,c){switch(b){case "clear":return this.K[b]||(this.K[b]=c,c.onclick=function(a){return function(){a.K.print&&(a.K.print.value="")}}(this)),!0;case "print":return this.K[b]||(this.hb=this.K[b]=c,c.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
|
|
|
|
|
this.sa=function(a){this.i(a,this.pb)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.pb+": "+a)},sa:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},Ja:function(){return this.v.ia=!0},Ia:function(a,b){b&&(this.v.ia=!1);return!0}};function E(a,b,c,d){a.j&&(!0===c||F(a,c|0))&&a.j.message(b,d)}function F(a,b){if(a.j){a===a.j?b|=0:b=b||a.ka;var c=a.j.ka&b;return!!b&&c===b||!!(c&a.j.Nc)}return!1}
|
|
|
|
|
function gb(a,b){if(a.v.ec)return a.v.Hb=!1,a.v.ec=!1;if(a.v.error)return a.i(a.toString()+" error"),!1;a.v.Hb=b;return a.v.Hb}function hb(a,b){a.v.Hb&&(b?a.v.ec=!0:void 0===b&&a.i(a.toString()+" busy"));return a.v.Hb}function G(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.Xb;a.Xb=null;b&&b()}}function ib(a,b){b&&(a.v.ready?b():a.Xb=b);return a.v.ready}function jb(a){return a.v.error?(a.i(a.toString()+" error"),!0):!1}function kb(a,b){a.v.error=!0;a.sa(b)}
|
|
|
|
|
this.sa=function(a){this.i(a,this.Pb)}),!0;default:return!1}},log:function(){},i:function(){},status:function(a){this.i(this.Pb+": "+a)},sa:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},Ja:function(){return this.v.ia=!0},Ia:function(a,b){b&&(this.v.ia=!1);return!0}};function E(a,b,c,d){a.j&&(!0===c||F(a,c|0))&&a.j.message(b,d)}function F(a,b){if(a.j){a===a.j?b|=0:b=b||a.ka;var c=a.j.ka&b;return!!b&&c===b||!!(c&a.j.Mc)}return!1}
|
|
|
|
|
function fb(a,b){if(a.v.dc)return a.v.Bb=!1,a.v.dc=!1;if(a.v.error)return a.i(a.toString()+" error"),!1;a.v.Bb=b;return a.v.Bb}function gb(a,b){a.v.Bb&&(b?a.v.dc=!0:void 0===b&&a.i(a.toString()+" busy"));return a.v.Bb}function G(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.Rb;a.Rb=null;b&&b()}}function hb(a,b){b&&(a.v.ready?b():a.Rb=b);return a.v.ready}function ib(a){return a.v.error?(a.i(a.toString()+" error"),!0):!1}function jb(a,b){a.v.error=!0;a.sa(b)}
|
|
|
|
|
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
|
|
|
|
|
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
|
|
|
|
|
var xb="undefined"!==typeof ArrayBuffer,H={cpu:1,trap:16,bus:64,mem:128,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function yb(a){w.call(this,"Panel",a,yb)}y(yb);k=yb.prototype;k.pa=function(a,b,c,d){return this.C&&this.C.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.j&&this.j.pa(a,b,c,d)?!0:this.parent.pa.call(this,a,b,c,d)};k.Oa=function(a,b,c,d){this.C=a;this.H=b;this.b=c;this.j=d};
|
|
|
|
|
k.Ja=function(a,b){b||zb();return!0};k.Ia=function(){return!0};k.Fa=function(){};function zb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=db(e.id);f||(a=!0,f=new yb(e));fb(f,d);a&&G(f)}}La(zb);
|
|
|
|
|
function Ab(a,b,c){w.call(this,"Bus",a,Ab,64);this.b=b;this.j=c;this.G=a.busWidth||16;this.B=Math.pow(2,this.G);this.g=this.B-1|0;this.ca=(this.G>>1)+2;10>this.ca&&(this.ca=10);15<this.ca&&(this.ca=15);this.Ca=1<<this.ca;this.I=this.Ca>>2;this.f=this.Ca-1;this.w=this.B/this.Ca|0;this.C=this.w-1;this.Ra=[];this.F=null;this.Jb=this.Jc;a=new I;Bb(a,this.j);this.O=Array(this.w);for(b=0;b<this.w;b++)this.O[b]=a;this.Db=Array(4);this.Db[0]=Cb;this.Db[1]=Db;this.Db[2]=Eb;this.Db[3]=Fb;Gb(this,this.B-8192,
|
|
|
|
|
8192,Hb,this);Gb(this,57344,8192,Hb,this);G(this)}y(Ab);function Cb(a,b){var c=-1,d=this.controller,e=d.Ra[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ra[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&F(this.j,64)&&E(this.j,e[5]+".readByte("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=d.Jb(b|4186112,-1,1);this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to byte @"+J(this.j,b)+": "+J(this.j,c));return c}
|
|
|
|
|
function Db(a,b,c){var d=!1,e=this.controller,f=e.Ra[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):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.Ra[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&F(this.j,64)&&E(this.j,f[5]+".writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(e.Jb(c|4186112,b,1),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to byte @"+J(this.j,c)+": "+J(this.j,b)))}
|
|
|
|
|
function Eb(a,b){var c=-1,d=this.controller;(a=d.Ra[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&F(this.j,64)&&E(this.j,a[5]+".readWord("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=d.Jb(b|4186112,-1,0);this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to word @"+J(this.j,b)+": "+J(this.j,c));return c}
|
|
|
|
|
function Fb(a,b,c){var d=!1,e=this.controller;if(a=e.Ra[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.j&&F(this.j,64)&&E(this.j,a[5]+".writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(e.Jb(c|4186112,b,0),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to word @"+J(this.j,c)+": "+J(this.j,b)))}k=Ab.prototype;k.reset=function(){this.F&&this.F()};
|
|
|
|
|
k.Jc=function(a,b,c){this.j&&F(this.j,64)&&E(this.j,"warning: unrecognized access("+J(this.j,a)+","+J(this.j,b)+","+c+")");return 0};k.Ja=function(a,b){b||this.reset();return!0};
|
|
|
|
|
function Gb(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ca;0<g&&h<a.O.length;){var l=a.O[h],m=h*a.Ca,n=a.Ca-(f-m);n>g&&(n=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.A)return l.Ub+=l.A-f,l.A=f,!0;if(f>=l.A+l.Ub){n=l.size-(f-m);n>g&&(n=g);l.Ub=f-l.A+n;f=m+a.Ca;g-=n;h++;continue}}return Ib(1,f,g)}f=new I(f,n,a.Ca,d,e);Bb(f,a.j,l);a.O[h++]=f;f=m+a.Ca;g-=n}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Jb[d]+" at "+p(b,8,!0)),!0):Ib(2,b,c)}
|
|
|
|
|
k.jb=function(a){return this.O[(a&this.g)>>>this.ca].ub(a&this.f,a)};k.Ha=function(a){var b=a&this.f,c=(a&this.g)>>>this.ca;return b!=this.f?this.O[c].Bc(b,a):this.O[c++].ub(b,a)|this.O[c&this.C].ub(0,a+1)<<8};function Kb(a,b){var c=b&a.f,d=(b&a.g)>>>a.ca;return c!=a.f?a.O[d].kc(c,b):a.O[d++].Nb(c,b)|a.O[d&a.C].Nb(0,b+1)<<8}k.Rb=function(a,b){this.O[(a&this.g)>>>this.ca].Ab(a&this.f,b&255,a)};
|
|
|
|
|
k.nb=function(a,b){var c=a&this.f,d=(a&this.g)>>>this.ca;c!=this.f?this.O[d].Ic(c,b&65535,a):(this.O[d++].Ab(c,b&255,a),this.O[d&this.C].Ab(0,b>>8&255,a+1))};function Lb(a){for(var b=0,c=[],d=0;d<a.w;d++){var e=a.O[d];if(e.Ua||e.Pc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}
|
|
|
|
|
function Mb(a,b,c){for(var d in c)for(var e=c[d],f=e[0]?e[0].bind(b):null,g=e[1]?e[1].bind(b):null,h=e[2]?e[2].bind(b):null,l=e[3]?e[3].bind(b):null,m=a,n=+d,e=e[4],r=+d;r<=n;r+=2){var q=r&8191;void 0!==m.Ra[q]?t("I/O address already registered: "+p(r,8,!0)):m.Ra[q]=[f,g,h,l,!1,e||"unknown"]}}function Nb(a,b,c){a.F=b;a.Jb=c}function Ib(a,b,c){t("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}
|
|
|
|
|
function K(a){w.call(this,"Device",a,K);this.g={data:0,wd:0,rb:20,od:0};this.f={M:0,pc:-1};this.C={Pb:2496,oa:0,R:128,Qb:0,Ob:0,va:0,Cc:0,ra:[],cb:[406,406,406,406],da:[12,12,12,12]};this.w={M:129,Gb:0,fa:0,Wa:0,Sa:0,ab:0,ra:[],da:[40,40,40,40],cb:[1024,1024,512,512],Lc:[157,157,29,29]};this.B={b:[8210,8208,8210,8226],da:[22,22,22,50],bb:[19,19,19,32],cc:[815,411,815,630],ra:[],T:2176,xb:0,vb:0,Ea:[0,0,0,0,0,0,0,0],Da:0,ta:[4544,4544,4544,4544,4544,4544,4544,4544],wb:[0,0,0,0,0,0,0,0],mb:0,ld:[0,
|
|
|
|
|
0,0,0,0,0,0,0],Dc:0,Ec:[0,0,0,0,0,0,0,0],j:[0,0,0,0,0,0,0,0],md:[1,2,3,4,5,6,7,8],Fc:[0,0,0,0,0,0,0,0],Qa:[0,0,0,0,0,0,0,0],bc:[0,0,0,0,0,0,0,0],jd:[0,0,0,0,0,0,0,0],kd:[0,0,0,0,0,0,0,0],gd:[0,0,0,0,0,0,0,0],hd:[0,0,0,0,0,0,0,0],$a:0,nc:0}}y(K);
|
|
|
|
|
var Ob=[4127,448,4191,450,4383,452,2591,454,21983,32768,65534,13791,16384,65534,770,2719,454,2591,65534,257,0,2566,33028,34051,33282,1281,33537,0,2758,32771,770,1025,1793,0,3078,33794,34305,513,0,5574,43690,4480,4097,4162,4227,4292,4357,57665,1281,769,0,3138,34305,1281,0,24707,2691,2627,24769,34561,1793,0,3076,20739,24899,2691,34562,2753,1281,0,2624,33537,0,16385,24641,1537,1793,0,193,8279,21589,516,12549,1538,2629,513,0,38336,65281,32769,0,32258,2561,2689,32258,3008,514,3009,769,0,5574,510,2551,
|
|
|
|
|
var kb="undefined"!==typeof ArrayBuffer,H={cpu:1,trap:16,bus:64,mem:128,keyboard:65536,key:131072,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function xb(a){w.call(this,"Panel",a,xb)}y(xb);k=xb.prototype;k.pa=function(a,b,c,d){return this.D&&this.D.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.j&&this.j.pa(a,b,c,d)?!0:this.parent.pa.call(this,a,b,c,d)};k.Oa=function(a,b,c,d){this.D=a;this.F=b;this.b=c;this.j=d};
|
|
|
|
|
k.Ja=function(a,b){b||yb();return!0};k.Ia=function(){return!0};k.Fa=function(){};function yb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=cb(e.id);f||(a=!0,f=new xb(e));eb(f,d);a&&G(f)}}La(yb);
|
|
|
|
|
function zb(a,b,c){w.call(this,"Bus",a,zb,64);this.b=b;this.j=c;this.B=a.busWidth||16;this.F=Math.pow(2,this.B);this.g=this.F-1|0;this.ca=(this.B>>1)+2;10>this.ca&&(this.ca=10);15<this.ca&&(this.ca=15);this.Ca=1<<this.ca;this.G=this.Ca>>2;this.f=this.Ca-1;this.w=this.F/this.Ca|0;this.Ra=[];this.D=null;this.Eb=this.od;a=new I;Ab(a,this.j);this.X=Array(this.w);for(b=0;b<this.w;b++)this.X[b]=a;this.xb=Array(4);this.xb[0]=Bb;this.xb[1]=Cb;this.xb[2]=Db;this.xb[3]=Eb;Fb(this,this.F-8192,8192,Gb,this);
|
|
|
|
|
Fb(this,57344,8192,Gb,this);G(this)}y(zb);function Bb(a,b){var c=-1,d=this.controller,e=d.Ra[a];e?e[0]?c=e[0](b):e[2]&&(c=b&1?e[2](b&-2)>>8:e[2](b)&255):b&1&&(e=d.Ra[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&F(this.j,64)&&E(this.j,e[5]+".readByte("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=d.Eb(b|4186112,-1,1);this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to byte @"+J(this.j,b)+": "+J(this.j,c));return c}
|
|
|
|
|
function Cb(a,b,c){var d=!1,e=this.controller,f=e.Ra[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):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.Ra[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&F(this.j,64)&&E(this.j,f[5]+".writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(e.Eb(c|4186112,b,1),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to byte @"+J(this.j,c)+": "+J(this.j,b)))}
|
|
|
|
|
function Db(a,b){var c=-1,d=this.controller;(a=d.Ra[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&F(this.j,64)&&E(this.j,a[5]+".readWord("+J(this.j,b)+"): "+J(this.j,c),!0,!0),c;c=d.Eb(b|4186112,-1,0);this.j&&F(this.j,64)&&E(this.j,"warning: unconverted read access to word @"+J(this.j,b)+": "+J(this.j,c));return c}
|
|
|
|
|
function Eb(a,b,c){var d=!1,e=this.controller;if(a=e.Ra[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.j&&F(this.j,64)&&E(this.j,a[5]+".writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0,!0):(e.Eb(c|4186112,b,0),this.j&&F(this.j,64)&&E(this.j,"warning: unconverted write access to word @"+J(this.j,c)+": "+J(this.j,b)))}k=zb.prototype;k.reset=function(){this.D&&this.D()};
|
|
|
|
|
k.od=function(a,b,c){this.j&&F(this.j,64)&&E(this.j,"warning: unrecognized I/O access("+J(this.j,a)+","+J(this.j,b)+","+c+")");return 0};k.Ja=function(a,b){b||this.reset();return!0};
|
|
|
|
|
function Fb(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ca;0<g&&h<a.X.length;){var l=a.X[h],m=h*a.Ca,n=a.Ca-(f-m);n>g&&(n=g);if(l&&l.size){if(l.type==d&&l.controller==e){if(f+g<=l.A)return l.Ob+=l.A-f,l.A=f,!0;if(f>=l.A+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.A+n;f=m+a.Ca;g-=n;h++;continue}}return Hb(1,f,g)}f=new I(f,n,a.Ca,d,e);Ab(f,a.j,l);a.X[h++]=f;f=m+a.Ca;g-=n}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Ib[d]+" at "+p(b,8,!0)),!0):Hb(2,b,c)}
|
|
|
|
|
k.jb=function(a){return this.X[(a&this.g)>>>this.ca].Wb(a&this.f,a)};k.Ha=function(a){return this.X[(a&this.g)>>>this.ca].Bc(a&this.f,a)};function Jb(a,b){return a.X[(b&a.g)>>>a.ca].jc(b&a.f,b)}k.Lb=function(a,b){this.X[(a&this.g)>>>this.ca].$b(a&this.f,b&255,a)};k.nc=function(a,b){this.X[(a&this.g)>>>this.ca].Ic(a&this.f,b&65535,a)};
|
|
|
|
|
function Kb(a){for(var b=0,c=[],d=0;d<a.w;d++){var e=a.X[d];if(e.Ua||e.Oc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}
|
|
|
|
|
function Lb(a,b,c){for(var d in c)for(var e=c[d],f=e[0]?e[0].bind(b):null,g=e[1]?e[1].bind(b):null,h=e[2]?e[2].bind(b):null,l=e[3]?e[3].bind(b):null,m=a,n=+d,e=e[4],r=+d;r<=n;r+=2){var q=r&8191;void 0!==m.Ra[q]?t("I/O address already registered: "+p(r,8,!0)):m.Ra[q]=[f,g,h,l,!1,e||"unknown"]}}function Mb(a,b,c){a.D=b;a.Eb=c}function Hb(a,b,c){t("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}
|
|
|
|
|
function K(a){w.call(this,"Device",a,K);this.g={data:0,wd:0,pb:20,nd:0};this.f={M:0,pc:-1};this.D={Jb:2496,oa:0,P:128,Kb:0,Ib:0,va:0,Cc:0,ra:[],eb:[406,406,406,406],da:[12,12,12,12]};this.w={M:129,Ab:0,fa:0,Wa:0,Sa:0,bb:0,ra:[],da:[40,40,40,40],eb:[1024,1024,512,512],Jc:[157,157,29,29]};this.B={b:[8210,8208,8210,8226],da:[22,22,22,50],cb:[19,19,19,32],bc:[815,411,815,630],ra:[],S:2176,ub:0,sb:0,Ea:[0,0,0,0,0,0,0,0],Da:0,ta:[4544,4544,4544,4544,4544,4544,4544,4544],tb:[0,0,0,0,0,0,0,0],mb:0,kd:[0,
|
|
|
|
|
0,0,0,0,0,0,0],Dc:0,Ec:[0,0,0,0,0,0,0,0],j:[0,0,0,0,0,0,0,0],ld:[1,2,3,4,5,6,7,8],Fc:[0,0,0,0,0,0,0,0],Qa:[0,0,0,0,0,0,0,0],Zb:[0,0,0,0,0,0,0,0],hd:[0,0,0,0,0,0,0,0],jd:[0,0,0,0,0,0,0,0],fd:[0,0,0,0,0,0,0,0],gd:[0,0,0,0,0,0,0,0],$a:0,mc:0}}y(K);
|
|
|
|
|
var Nb=[4127,448,4191,450,4383,452,2591,454,21983,32768,65534,13791,16384,65534,770,2719,454,2591,65534,257,0,2566,33028,34051,33282,1281,33537,0,2758,32771,770,1025,1793,0,3078,33794,34305,513,0,5574,43690,4480,4097,4162,4227,4292,4357,57665,1281,769,0,3138,34305,1281,0,24707,2691,2627,24769,34561,1793,0,3076,20739,24899,2691,34562,2753,1281,0,2624,33537,0,16385,24641,1537,1793,0,193,8279,21589,516,12549,1538,2629,513,0,38336,65281,32769,0,32258,2561,2689,32258,3008,514,3009,769,0,5574,510,2551,
|
|
|
|
|
2,0,9678,208,769,0,5582,226,135,0,2598,5606,236,2,0,95,242,128,5573,57344,2591,6,5599,256,4,5574,510,3045,5599,460,76,2591,78,5571,65510,5579,12,5570,512,4224,4104,3024,8197,33788,4224,4609,8193,769,0,2640,8197,33785,6145,2625,8193,769,0,8194,761,2574,5572,43690,5579,24,5568,2048,5570,512,2628,4360,2632,2632,8708,769,0,3103,65514,34562,0,305,35406,754,258,119,65160,3024,32403,5579,36,5568,3072,35446,1,740,5570,512,4224,4104,3024,8197,33788,5569,3,2574,3039,454,528,5582,24,4224,2632,2632,8200,769,
|
|
|
|
|
0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];k=K.prototype;k.Oa=function(a,b,c,d){this.H=b;this.b=c;this.j=d;var e=this;this.f.pc=Pb(this.b,function(){e.f.Va|=128;e.f.Va&64&&(L(e.b,0,6,64),Qb(e.b,e.f.pc,1E3/60))});Mb(b,this,Rb);Nb(b,this.reset.bind(this),this.Kc.bind(this));G(this)};k.Xc=function(){var a=this.f.Va;this.f.Va&=-129;return a};
|
|
|
|
|
k.pd=function(a){this.f.Va=a;a&64&&Qb(this.b,this.f.pc,1E3/60);this.f.Va=a&-129};k.Yc=function(){var a=this.b;return a.F&62337|a.wa<<5|a.xa<<1};k.qd=function(a){var b=4,c=this.b;c.F=a&=62337;c.wa=a>>5&3;c.xa=a>>1&15;c.Yb=a&257?a&1?6:4:0;Sb(c);a=c.F;a&1|256&&(b=this.b.lb&16?1:2);this.g.rb=this.g.rb&-8|b};k.Zc=function(){return Tb(this.b)};k.rd=function(a){Ub(this.b,a&-1809|Tb(this.b)&1808);this.b.D|=128};
|
|
|
|
|
function Vb(a){var b=a.C,c,d,e,f=b.va>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.dd,drive:f,blocksize:256,mapped:0,maxblock:b.cb[f]*b.da[f],url:"rk"+f+".dsk"});b.R&=-129;switch(b.R>>1&7){case 0:b.Pb=2496;b.oa=0;b.R=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.cb[f]){b.oa|=32832;b.R|=49152;break}if((b.va&15)>=b.da[f]){b.oa|=32800;b.R|=49152;break}c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.R&48)<<12|b.Ob;e=65536-b.Qb&65535;Wb(a,b.ra[f],c,d,e);return;case 2:if((b.va>>4&511)>=b.cb[f])b.oa|=
|
|
|
|
|
32832,b.R|=49152;else if((b.va&15)>=b.da[f])b.oa|=32800,b.R|=49152;else{c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.R&48)<<12|b.Ob;e=65536-b.Qb&65535;a.$b(b.ra[f],c,d,e);return}}b.Pb=f<<13|b.Pb&8176|b.va%9&15;L(a.b,20,5,144,function(){b.R=b.R&65534|128;return!!(b.R&64)})}k.dd=function(a,b,c,d,e){var f=this.C;f.Ob=d&65535;f.R=f.R&-49|d>>12&48;f.Qb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.R|=49152;break;case 2:f.oa|=33792,f.R|=49152}L(this.b,20,5,144,function(){f.R=f.R&65534|128;return!!(f.R&64)})};
|
|
|
|
|
function Xb(a){var b=a.w,c,d,e,f=b.M>>8&3;b.M&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.ed,drive:f,blocksize:128,mapped:1,maxblock:b.cb[f]*b.da[f],url:"rl"+f+".dsk"});switch(b.M>>1&7){case 2:b.Wa&8&&(b.M&=63);b.Wa=b.Lc[f]|b.ab&64;break;case 3:1==(b.fa&3)&&(b.ab=b.fa&4?b.ab+(b.fa&65408)&65408|b.fa<<2&64:b.ab-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.ab);break;case 4:b.Wa=b.ab;break;case 5:if(b.fa>>6>=b.cb[f]){b.M|=37888;break}if((b.fa&63)>=b.da[f]){b.M|=37888;break}c=(b.fa>>6)*
|
|
|
|
|
b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Gb;e=65536-b.Wa&65535;Wb(a,b.ra[f],c,d,e);return;case 6:if(b.fa>>6>=b.cb[f])b.M|=37888;else if((b.fa&63)>=b.da[f])b.M|=37888;else{c=(b.fa>>6)*b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Gb;e=65536-b.Wa&65535;a.$b(b.ra[f],c,d,e);return}}L(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})}
|
|
|
|
|
k.ed=function(a,b,c,d,e){var f=this.w;f.Gb=d&65535;f.M=f.M&-49|d>>12&48;f.Sa=d>>16&63;f.fa=~~(c/f.da[b.Ma])<<6|c%f.da[b.Ma];f.ab=f.fa;f.Wa=65536-e&65535;switch(a){case 1:f.M|=33792;break;case 2:f.M|=40960}L(this.b,20,5,112,function(){f.M|=129;return!!(f.M&64)})};function Yb(a){a=a.B;a.T=2176;a.Da=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.wb=[0,0,0,0,0,0,0,0];a.mb=a.xb=a.vb=a.$a=a.nc=0}
|
|
|
|
|
function gc(a,b){var c=a.B,d,e,f;c.T&=-16513;c.Da&=-2049;c.ta[b]&=-1153;L(a.b,-1,0,172);"undefined"===typeof c.ra[b]&&(c.ra[b]={cache:[],postProcess:a.fd,drive:b,blocksize:256,mapped:0,maxblock:c.cc[0]*c.bb[0]*c.da[0],url:"rp"+b+".dsk"});switch(c.T&63){case 5:c.bc[b]=c.Qa[b];c.T|=32896;c.ta[b]|=32896;c.mb|=1<<b;break;case 9:Yb(a);break;case 19:c.ta[b]|=64;break;case 49:if(c.Qa[b]>=c.cc[0]||c.Ea[b]>>8>=c.bb[0]||(c.Ea[b]&255)>=c.da[0]){c.wb[b]|=1024;c.T|=49152;break}d=(c.Qa[b]*c.bb[0]+(c.Ea[b]>>8))*
|
|
|
|
|
c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.vb;f=65536-c.xb&65535;Wb(a,c.ra[b],d,e,f);return;case 57:if(c.Qa[b]>=c.cc[0]||c.Ea[b]>>8>=c.bb[0]||(c.Ea[b]&255)>=c.da[0])c.wb[b]|=1024,c.T|=49152;else{d=(c.Qa[b]*c.bb[0]+(c.Ea[b]>>8))*c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.vb;f=65536-c.xb&65535;a.$b(c.ra[b],d,e,f);return}}L(a.b,3,5,172,function(){c.T=c.T&65534|128;c.ta[b]|=128;return!!(c.T&64)})}
|
|
|
|
|
k.fd=function(a,b,c,d,e){var f=this.B;f.xb=65536-e&65535;f.vb=d&65535;f.T=f.T&-769|d>>8&768;f.$a=d>>16&63;e=~~(c/f.da[0]);d=~~(e/f.bb[0]);f.Ea[b.Ma]=e%f.bb[0]<<8|c%f.da[0];f.bc[b.Ma]=f.Qa[b.Ma]=d;f.mb|=1<<b.Ma;c>=b.Vc-1&&(f.ta[b.Ma]|=1024);switch(a){case 1:f.Da|=512;f.T|=49152;break;case 2:f.Da|=2048,f.T|=49152}L(this.b,20,5,172,function(){f.ta[b.Ma]|=128;f.T=f.T&65534|128;return!!(f.T&64)})};
|
|
|
|
|
function hc(a,b,c,d,e,f){var g=~~((f+c.Ta-1)/c.Ta),h=new XMLHttpRequest;2048>g&&d+2048<c.Vc&&(g=2048);h.open("GET",c.url,!0);h.setRequestHeader("Range","bytes="+(d*c.Ta<<1)+"-"+(((d+g)*c.Ta<<1)-1));h.responseType="arraybuffer";h.onreadystatechange=function(){if(4==h.readyState){var g=b.bind(a),m,n,r,q;m=h.response;if(h.status&&206!=h.status||!m)c.jc(1,c,d,e,f);else{m=new Uint8Array(m);n=d;for(q=0;q<m.length;){if("undefined"===typeof c.cache[n])for(c.cache[n]=[],r=0;r<c.Ta;r++)c.cache[n][r]=q<m.length?
|
|
|
|
|
m[q]&255|m[q+1]<<8&65280:0,q+=2;else q+=c.Ta<<1;n++}g(c,d,e,f)}}};h.send(null)}function M(a,b,c,d,e){c&1?e?d=0<=d?d<<8&65280|b&255:b:a.b.L(4,122):0<=d?e&&(d=b&65280|d&255):d=b;return d}k.$b=function(a,b,c,d){for(var e;0<d;){if("undefined"===typeof a.cache[b]){hc(this,this.$b,a,b,c,d);return}for(e=0;e<a.Ta&&0<d;e++){var f=a.Uc?ic(this.b,c):c;this.b.H.nb(f,a.cache[b][e]&65535);c+=2;--d}b++}a.jc(0,a,b,c,d)};
|
|
|
|
|
function Wb(a,b,c,d,e){for(var f,g;0<e;){if("undefined"===typeof b.cache[c])for(b.cache[c]=[],f=0;f<b.Ta;f++)b.cache[c][f]=0;for(f=0;f<b.Ta&&0<e;f++){g=jc(a.b,b.Uc?ic(a.b,d):d);if(0>g){b.jc(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.jc(0,b,c,d,e)}k.reset=function(){this.g.rb=this.g.rb&-120|20;this.f.Va=0;this.C.R=128;this.w.M=128;Yb(this)};
|
|
|
|
|
k.Kc=function(a,b,c){var d,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.Za&65280:(a&1&&(b<<=8),f.Za=b|255,d=0);break;case 4194298:if(0>b)d=f.mc;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.mc=d;f.D|=2}break;case 4194294:if(70!==f.ib)return f.L(4,222);0>b?d=f.J:d=f.J=0;break;case 4194292:if(70!==f.ib)return f.L(4,224);d=1;break;case 4194290:if(70!==f.ib)return f.L(4,226);d=0;break;case 4194288:if(70!==f.ib)return f.L(4,228);d=61183;break;case 4194296:0<=
|
|
|
|
|
b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.ib)return f.L(4,232);e=a-4194272>>1;0>b?d=f.hc[e]:(d=M(this,f.hc[e],a,b,c),0<=d&&(f.hc[e]=d));break;case 4194254:return a&1?f.P>>14&1?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[3]=b),d=f.ya[3]):f.P>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[1]=b),d=f.ya[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.P&2048?(0<=b&&(f.u[e]=b),d=f.u[e]):(0<=b&&(f.Pa[e]=
|
|
|
|
|
b),d=f.Pa[e]),d;case 4194246:return a&1?(0<=b&&(f.u[7]=b),d=f.u[7]):f.P>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[0]=b),d=f.ya[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.P&2048?(0<=b&&(f.Pa[e]=b),d=f.Pa[e]):(0<=b&&(f.u[e]=b),d=f.u[e]),d;default:return f.J|=16,f.L(4,124)}break;case 4194176:e=a>>1&31;d=M(this,f.na[3][e],a,b,c);0<=d&&(f.na[3][e]=d,f.na[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=M(this,f.ac,a,b,c);0<=d&&(f.ac=d);break;case 4194172:d=f.Ya;d&65280&&
|
|
|
|
|
(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.g.od&65535:(d=M(this,this.g.data,a,b,c),0<=d&&(this.g.data=d));break;default:return f.J|=16,f.L(4,126)}break;case 4194048:e=this.C;switch(a&-2){case 4194048:d=M(this,e.Pb,a,b,c);0<=d&&(e.Pb=d);break;case 4194050:d=M(this,e.oa,a,b,c);0<=d&&(e.oa=d);break;case 4194052:d=M(this,e.R,a,b,c);0<=b&&0<=d&&(e.R=d&-36993|e.R&36992,e.R&1&&Vb(this));break;case 4194054:d=M(this,e.Qb,a,b,c);0<=d&&(e.Qb=d);break;case 4194056:d=M(this,e.Ob,a,b,c);0<=d&&(e.Ob=d);
|
|
|
|
|
break;case 4194058:d=M(this,e.va,a,b,c);0<=d&&(e.va=d);break;case 4194060:break;case 4194062:d=M(this,e.Cc,a,b,c);0<=d&&(e.Cc=d);break;default:return f.J|=16,f.L(4,128)}break;case 4193728:var g=this.B;e=g.Da&7;switch(a&-2){case 4193728:d=M(this,g.T,a,b,c);0<=b&&0<=d&&(g.$a=g.$a&60|d>>8&3,g.T=d&17279|g.T&34944|2048,d&1&&g.T&128?gc(this,e):192==(d&192)&&L(f,0,5,172));break;case 4193730:d=M(this,g.xb,a,b,c);0<=d&&(g.xb=d);break;case 4193732:d=M(this,g.vb,a,b,c);0<=d&&(g.vb=d&65534);break;case 4193734:d=
|
|
|
|
|
M(this,g.Ea[e],a,b,c);0<=d&&(g.Ea[e]=d&7967);break;case 4193736:d=M(this,g.Da,a,b,c);0<=d&&(g.Da=d&63|g.Da&65472,d&128&&Yb(this));break;case 4193738:d=g.ta[e];break;case 4193740:d=g.wb[e];break;case 4193742:d=M(this,g.mb,a,b,c);0<=d&&(g.mb=d&255);break;case 4193744:d=g.ld[e];break;case 4193746:d=M(this,g.Dc,a,b,c);0<=d&&(g.Dc=d);break;case 4193748:d=M(this,g.Ec[e],a,b,c);0<=d&&(g.Ec[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.md[e];break;case 4193754:d=M(this,g.Fc[e],a,b,c);0<=d&&
|
|
|
|
|
(g.Fc[e]=d);break;case 4193756:d=M(this,g.Qa[e],a,b,c);0<=d&&(g.Qa[e]=d&511);break;case 4193758:g.bc[e]=g.Qa[e];d=g.bc[e];break;case 4193760:d=g.jd[e];break;case 4193762:d=g.kd[e];break;case 4193764:d=g.gd[e];break;case 4193766:d=g.hd[e];break;case 4193768:d=M(this,g.$a,a,b,c);0<=d&&(g.$a=d&63,g.T=g.T&-769|(d&3)<<8);break;case 4193770:d=M(this,g.nc,a,b,c);0<=d&&(g.nc=d);break;default:return f.J|=16,f.L(4,132)}break;case 4192512:e=this.w;switch(a&-2){case 4192512:d=M(this,e.M,a,b,c);0<=b&&0<=d&&(e.Sa=
|
|
|
|
|
e.Sa&60|d>>4&3,e.M=e.M&-1023|d&1022,e.M&128||Xb(this));break;case 4192514:d=M(this,e.Gb,a,b,c);0<=d&&(e.Gb=d&65534);break;case 4192516:d=M(this,e.fa,a,b,c);0<=d&&(e.fa=d);break;case 4192518:d=M(this,e.Wa,a,b,c);0<=d&&(e.Wa=d);break;case 4192520:d=M(this,e.Sa,a,b,c);0<=d&&(e.Sa=d&63,e.M=e.M&-49|(e.Sa&3)<<4);break;default:return f.J|=16,f.L(4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.lb:(d=M(this,f.lb,a,b,c),0<=d&&(70!==f.ib&&(d&=-49),f.lb=d,f.Zb[0]=d&4?15:7,f.Zb[1]=d&2?15:7,f.Zb[3]=
|
|
|
|
|
d&1?15:7,f.Yb&&(e=2,f.lb&16&&(e=1),this.g.rb=this.g.rb&-8|e)));break;default:return f.J|=16,f.L(4,136)}break;case 4191424:e=a>>1&31;d=M(this,f.na[0][e],a,b,c);0<=d&&(f.na[0][e]=d,f.na[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=M(this,f.na[1][e],a,b,c);0<=d&&(f.na[1][e]=d,f.na[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.ib)return f.L(4,234);e=a>>2&31;d=f.Sb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=M(this,d,a,b,c),0<=d&&(f.Sb[e]=a&2?d<<16|f.Sb[e]&65535:f.Sb[e]&4294901760|d&65534));break;
|
|
|
|
|
case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Ob[a>>1&255];else return f.J|=16,f.L(4,138);break;default:return f.J|=16,f.L(4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var kc={},Rb=(kc[65382]=[null,null,K.prototype.Xc,K.prototype.pd,"LKS"],kc[65402]=[null,null,K.prototype.Yc,K.prototype.qd,"MMR0"],kc[65534]=[null,null,K.prototype.Zc,K.prototype.rd,"PSW"],kc);
|
|
|
|
|
La(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new K(d);fb(d,c)}});var lc;if(xb){var mc=new ArrayBuffer(2);(new DataView(mc)).setUint16(0,256,!0);lc=256===(new Uint16Array(mc))[0]}else lc=!1;var nc=lc;
|
|
|
|
|
function I(a,b,c,d,e){this.id=oc+=2;this.b=null;this.A=a;this.Ub=b;this.size=c||0;this.type=d||pc;this.g=d==qc;this.controller=null;Bb(this);this.Ua=this.Pc=!1;if(c)if(e)this.controller=e,this.b=null,rc(this,e.Db);else if(xb)this.B=new ArrayBuffer(c),this.F=new DataView(this.B,0,c),this.f=new Uint8Array(this.B,0,c),this.I=new Uint16Array(this.B,0,c>>1),this.b=new Int32Array(this.B,0,c>>2),rc(this,nc?sc:tc);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;rc(this,uc)}else rc(this)}
|
|
|
|
|
var pc=0,qc=2,Hb=4,Jb=["NONE","RAM","ROM","VID","H/W"],oc=0;
|
|
|
|
|
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(xb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.F.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(xb)for(b=0;b<a.length;b++)this.F.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ua=!0}return!1},gb:function(a,b){b?this.C++||vc(this,wc,!1):this.K++||xc(this,wc,!1)},N:function(){this.j&&F(this.j,128)&&(E(this.j,"attempt to read invalid block %"+
|
|
|
|
|
p(this.A),!0),this.j.ja());return 255},w:function(a,b){this.j&&F(this.j,128)&&(E(this.j,"attempt to write "+p(b,4,!0)+" to invalid block %"+p(this.A),!0),this.j.ja())},S:function(a,b){return this.ub(a++,b++)|this.ub(a,b)<<8},G:function(a,b,c){this.Ab(a++,b&255,c++);this.Ab(a,b>>8,c)},$:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ma:function(a){var 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},xa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<
|
|
|
|
|
a)|b<<a;this.Ua=!0},pb:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ua=!0},Y:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,1,c.U)&&c.ja(!0)}return this.Nb(a,b)},ha:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,2,c.U)&&c.ja(!0)}return this.kc(a,b)},ua:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;yc(d,this.A+a,1,d.F)&&d.ja(!0)}this.g?this.w(a,
|
|
|
|
|
b,c):this.Bb(a,b,c)},Aa:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;yc(d,this.A+a,2,d.F)&&d.ja(!0)}this.g?this.w(a,b,c):this.qc(a,b,c)},U:function(a){return this.f[a]},Z:function(a,b){a=this.f[a];this.j&&F(this.j,128)&&E(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ea:function(a){return this.F.getUint16(a,!0)},la:function(a,b){a=a&1?this.f[a]|this.f[a+1]<<8:this.I[a>>1];this.j&&F(this.j,128)&&E(this.j,"Memory.readWord("+J(this.j,b)+"): "+J(this.j,a),!0);return a},
|
|
|
|
|
qa:function(a,b){this.f[a]=b;this.Ua=!0},wa:function(a,b,c){this.f[a]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},za:function(a,b){this.F.setUint16(a,b,!0);this.Ua=!0},Ba:function(a,b,c){a&1?(this.f[a]=b,this.f[a+1]=b>>8):this.I[a>>1]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0)}};function Bb(a,b,c){a.j=b;a.K=a.C=0;c&&((a.K=c.K)&&xc(a,wc,!1),(a.C=c.C)&&vc(a,wc,!1))}
|
|
|
|
|
function zc(a,b){b?--a.C||(a.Ab=a.g?a.w:a.Bb,a.Ic=a.g?a.G:a.qc):--a.K||(a.ub=a.Nb,a.Bc=a.kc)}function vc(a,b,c){c&&a.C||(a.Ab=!a.g&&b[1]||a.w,a.Ic=!a.g&&b[3]||a.G);if(c||void 0===c)a.Bb=b[1]||a.w,a.qc=b[3]||a.G}function xc(a,b,c){c&&a.K||(a.ub=b[0]||a.N,a.Bc=b[2]||a.S);if(c||void 0===c)a.Nb=b[0]||a.N,a.kc=b[2]||a.S}function rc(a,b){b||(b=Ac);xc(a,b,void 0);vc(a,b,void 0)}var Ac=[],uc=[I.prototype.$,I.prototype.xa,I.prototype.ma,I.prototype.pb],wc=[I.prototype.Y,I.prototype.ua,I.prototype.ha,I.prototype.Aa];
|
|
|
|
|
if(xb)var tc=[I.prototype.U,I.prototype.qa,I.prototype.ea,I.prototype.za],sc=[I.prototype.Z,I.prototype.wa,I.prototype.la,I.prototype.Ba];function Bc(a,b){w.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Aa=a.cycles||b;this.Xa=c;this.fb=Math.round(this.Aa/1E4)/100;this.kb=this.fb*this.Xa;this.v.ga=!1;this.v.oc=!1;this.v.Eb=a.autoStart;this.v.uc=!1;this.v.qb=!1;this.Kb=this.ha=0;this.Lb=a.csStart;this.sb=a.csInterval;this.tb=a.csStop;this.N=[];this.Wb=this.nd.bind(this);G(this)}y(Bc);
|
|
|
|
|
var Cc=["power","reset"];k=Bc.prototype;k.Oa=function(a,b,c,d){this.C=a;this.H=b;this.j=d;for(b=0;b<Cc.length;b++)(c=this.K[Cc[b]])&&this.C.pa(null,Cc[b],c);this.qa=null;a=Dc(a,"autoStart");null!=a&&(this.v.Eb="true"==a?!0:"false"==a?!1:!!a);G(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
|
|
|
|
k.Ja=function(a,b){if(!b){if(a&&this.restore){Ec(this);if(!this.restore(a))return!1;Fc(this)}else this.reset();this.j?(a=this.j,a.i("Type ? for help with PDP11 Debugger commands"),a.Fa(),a.fb&&(b=a.fb,a.fb=null,Gc(a,b))):this.i("No debugger detected")}N(this);return!0};k.Ia=function(a){return a?this.save():!0};k.Eb=function(){return this.v.Eb||!this.j&&void 0===this.K.run?(this.yb(!0),!0):!1};k.wc=function(){return 0};
|
|
|
|
|
function Fc(a){void 0===a.Lb&&(a.Lb=0);void 0===a.sb&&(a.sb=-1);void 0===a.tb&&(a.tb=-1);a.v.qb=0<=a.Lb&&0<a.sb;a.v.qb&&(a.Kb=0,a.ha=a.Lb-a.ea)}function Hc(a,b){if(a.v.qb){var c=!1;a.Kb=a.Kb+a.wc()|0;a.ha-=b;0>=a.ha&&(a.ha+=a.sb,c=!0);0<=a.tb&&a.tb<=Ic(a)&&(a.sb=a.tb=-1,Fc(a),a.ja(),c=!0);c&&a.i(Ic(a)+" cycles: checksum="+p(a.Kb))}}
|
|
|
|
|
function Jc(a,b,c,d){if(a.K[b]){void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.ja());var e=a.j&&a.j.ea||8;c=!a.v.ga||a.v.uc?8==e?ca(c,d):p(c,d):"--------".substr(0,d||4);a.K[b].textContent!=c&&(a.K[b].textContent=c)}}
|
|
|
|
|
k.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.K[b]=c;a=!0;break;case "run":this.K[b]=c;c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.v.ia)a=!0;else{var b=null,c,h=cb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.v.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.v.ia);c++);c==h.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.Xb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ga?d.ja():d.yb())};
|
|
|
|
|
a=!0;break;case "speed":this.K[b]=c;a=!0;break;case "setSpeed":this.K[b]=c,c.onclick=function(){Kc(d,d.Xa<<1,!0)},c.textContent=this.kb.toFixed(2)+"Mhz",a=!0}return a};function Lc(a,b,c){a.ea+=b;c&&(a.$=a.b=0)}function Mc(a,b){var c=1;b&&1<a.Xa&&a.Y&&(c=a.Y/a.fb);a.Ib=Math.round(1E3/30);a.Ba=Math.floor(a.Aa/30*c);b||(a.la=a.Ba);a.ob=0}function Ic(a){return a.ea+a.U+a.$-a.b}function Ec(a){a.Y=0;a.Vb=0;a.ea=a.U=a.$=a.b=0;Fc(a);Kc(a,1)}
|
|
|
|
|
function Kc(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.kb?b=1:d=!0;a.Xa=b;b=a.fb*a.Xa;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.K.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.C&&a.C.Tb()}Lc(a,a.U);a.U=0;a.S=ra();a.Z=0;Mc(a);return d}function Pb(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Qb(a,b,c){0<=b&&b<a.N.length&&0>a.N[b][0]&&(c*=a.Aa*a.Xa/1E3,a.N[b][0]=c)}function fd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b}
|
|
|
|
|
function gd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function hd(a){a.$-=a.b;a.b=0}
|
|
|
|
|
k.nd=function(){if(this.v.ga){this.ob>=this.Aa&&Mc(this,!0);this.ua=0;this.za=ra();if(this.Z){var a=this.za-this.Z;a>this.Ib&&(this.S+=a,this.S>this.za&&(this.S=this.za))}try{do{var b=fd(this,this.v.qb?1:this.Ba);try{this.zb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.$-this.b;gd(this,c);this.ua+=c;this.U+=c;Lc(this,0,!0);Hc(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ba;15<=++this.Vb&&(this.C&&this.C.Fa(),this.Vb=0);break}}while(this.v.ga)}catch(e){this.ja();N(this);this.C&&this.C.stop(ra(),
|
|
|
|
|
Ic(this));kb(this,e.stack||e.message);return}if(this.v.ga){a=setTimeout;b=this.Wb;this.Z=ra();c=this.Ib;this.ua&&(c=Math.round(c*this.ua/this.Ba));var c=c-(this.Z-this.za),d=this.Z-this.S;d&&(this.Y=Math.round(this.U/(10*d))/100,864E5<=d&&(this.ea=0,Kc(this)));if(0>c||this.Y<this.kb)-1E3>c&&(this.S-=c),c=0;this.ob+=this.ua;this.Z+=c;a(b,c)}}};
|
|
|
|
|
k.yb=function(a){if(jb(this))return!1;if(this.v.ga)return this.i(this.toString()+" busy"),!1;Kc(this);this.v.ga=!0;this.v.oc=!0;this.qa&&this.qa.start();var b=this.K.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.Tb(!0),this.C.start(this.S,Ic(this)));N(this,!0);setTimeout(this.Wb,0);return!0};k.zb=function(){return 0};
|
|
|
|
|
k.ja=function(a){if(this.v.ga){hd(this);Lc(this,this.U);this.U=0;this.v.ga=!1;this.qa&&this.qa.stop();var b=this.K.run;b&&(b.textContent="Run");this.C&&this.C.stop(ra(),Ic(this));N(this)}this.v.complete=a};function N(a,b){a.C&&a.C.Fa(b)}
|
|
|
|
|
function id(a){this.Wc=+a.model||1170;this.ic=a.resetAddr||0;Bc.call(this,a,6666667);this.Fb=0;this.decode=jd.bind(this);this.V=65536;this.W=32768;this.aa=65535;this.X=32768;this.P=15;this.u=[0,0,0,0,0,0,0,this.ic];this.Pa=[0,0,0,0,0,0];this.ya=[0,0,0,0];this.xa=this.B=0;this.na=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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,0,0,0,0,
|
|
|
|
|
0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Sb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.hc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=this.f=this.eb=this.G=this.I=this.D=0;this.ib=70;this.ma=-1;kd(this);this.v.complete=this.v.Oc=!1}y(id,Bc);k=id.prototype;k.reset=function(){this.v.ga&&this.ja();kd(this);Ec(this);this.v.error=!1;this.parent.reset.call(this)};
|
|
|
|
|
function kd(a){a.Za=255;a.J=0;a.mc=0;a.F=0;a.Ya=0;a.ac=0;a.lb=0;a.Yb=0;a.wa=0;a.Zb=[7,7,7,7];a.w=[];a.D|=2;Sb(a)}function Sb(a){a.Yb?(a.Cb=65536,a.ba=a.Sc):(a.Cb=0,a.ba=a.Rc)}k.wc=function(){return 0};k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ea,this.Xa]);a.set(2,Lb(this.H));return a.data()};
|
|
|
|
|
k.restore=function(a){var b=a[1];this.ea=b[1];Kc(this,b[3]);a:{b=this.H;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.I){for(var f=0,g=Array(b.I),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.O[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
|
|
|
|
k.pa=function(a,b,c){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":this.K[b]=c;this.Fb++;a=!0;break;default:a=this.parent.pa.call(this,a,b,c)}return a};
|
|
|
|
|
k.Fa=function(a){if(this.Fb&&(a||!this.v.ga||this.v.uc)){for(a=0;a<this.u.length;a++)Jc(this,"R"+a,this.u[a]);a=Tb(this);Jc(this,"PS",a);Jc(this,"NF",a&8?1:0,1);Jc(this,"ZF",a&4?1:0,1);Jc(this,"VF",a&2?1:0,1);Jc(this,"CF",a&1?1:0,1)}if(a=this.K.speed)a.textContent=this.v.ga&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped"};function ld(a){return a.V&65536?1:0}function md(a){return a.W&32768?2:0}function nd(a){return a.aa&65535?0:4}k.Na=function(){return this.X&32768?8:0};
|
|
|
|
|
function od(a){var b=pd(a,a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function qd(a,b){a.u[7]=b&65535}function L(a,b,c,d,e){for(var f=a.w.length;0<f--;)if(a.w[f].Hc===d){0<f&&(a.w[f-1].La+=a.w[f].La);a.w.splice(f,1);break}if(0<=b){for(f=a.w.length;0<f--;){if(a.w[f].La>b){a.w[f].La-=b;break}b-=a.w[f].La}a.w.splice(f+1,0,{La:b,Ac:c<<5&224,Hc:d,gc:e})}a.D|=2}function Tb(a){return a.P=a.P&63728|a.Na()|nd(a)|md(a)|ld(a)}
|
|
|
|
|
function Ub(a,b){a.X=b<<12;a.aa=~b&4;a.W=b<<14;a.V=b<<16;if((b^a.P)&2048)for(var c=a.Pa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Pa[c];a.Pa[c]=d}a.B=b>>14&3;c=a.P>>14&3;a.B!=c&&(a.ya[c]=a.u[6],a.u[6]=a.ya[a.B]);a.D|=2;a.P=b}function P(a,b){a.D&128||(a.X=a.aa=b,a.W=0)}function rd(a,b,c){a.D&128||(a.X=a.aa=a.V=b,a.W=c||0)}function sd(a,b,c,d){a.D&128||(a.X=a.aa=a.V=b,a.W=(c^b)&(d^b))}function td(a,b){a.D&128||(a.X=a.aa=a.V=b,a.W=a.X^a.V>>1)}
|
|
|
|
|
function ud(a,b,c,d){a.D&128||(a.X=a.aa=a.V=b,a.W=(c^d)&(d^b))}k.L=function(a){var b=!1;0>this.ma?this.ma=Tb(this):this.B||(a=4,b=!0);this.F&57344||(this.Ya=63222,this.ac=a);this.B=0;var c=pd(this,a|65536),d=pd(this,a+2&65535|65536);Ub(this,d&-12289|this.ma>>2&12288);b&&(this.J|=4,this.u[6]=4);vd(this,this.ma);vd(this,this.u[7]);qd(this,c);this.D&=-113;this.ma=-1;throw a;};function wd(a){var b=xd(a),c=xd(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);qd(a,b);Ub(a,c);a.D&=-17}
|
|
|
|
|
function ic(a,b){var c=b>>13&31;31>c?a.lb&32&&(b=a.Sb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b}
|
|
|
|
|
function yd(a,b,c){var d,e,f,g=0;if(c&a.Yb){d=b>>13&a.Zb[a.B];e=a.na[a.B][d];f=(a.na[a.B][d+16]<<6)+(b&8191)&4194303;a.lb&16?3932160<=f&&4186112>f&&(f=ic(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&(3915776<=f&&(a.J|=32,a.L(4,12)),f&1&&!(c&1)&&(a.J|=64,a.L(4,14)));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.na[a.B][d]=e;if(4194170!==f||a.B)a.wa=a.B,a.xa=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.F&57344||(a.F=a.F|g|a.wa<<5|a.xa<<1),a.L(168,16)),a.F&61440||!(4191360>f||4194239<f)||(a.F|=4096,a.F&512&&(a.D|=32)))}else f=b&65535,57344<=f?f|=4186112:f&1&&!(c&1)&&(a.J|=64,a.L(4,10));return f}function jc(a,b){return a.H.Ha(b)}function pd(a,b){return jc(a,yd(a,b,2))}function xd(a){var b=pd(a,a.u[6]|65536);a.u[6]=a.u[6]+2&65535;return b}
|
|
|
|
|
function vd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.F&57344||(a.Ya=a.Ya<<8|246);!a.B&&c<=a.Za&&4<c&&(c<=a.Za-32?(a.J|=4,a.u[6]=4,a.L(4,18)):(a.J|=8,a.D|=4));c=yd(a,c|65536,4);a.H.nb(c,b&65535)}
|
|
|
|
|
function zd(a,b,c,d){var e,f,g=d&8?0:a.Cb;switch(b){case 0:return a.L(4,20),0;case 1:return 6===c&&!a.B&&d&4&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32||65534<=a.u[6]?(a.J|=4,a.u[6]=4,a.L(4,22)):(a.J|=8,a.D|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=pd(a,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=pd(a,e)|g;
|
|
|
|
|
a.b-=8;break;case 6:return e=od(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=od(a),e=e+a.u[c]&65535,e=pd(a,e|65536)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.F&57344||(a.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32?(a.J|=4,a.u[6]=4,a.L(4,24)):(a.J|=8,a.D|=64));return e}k.Rc=function(a,b,c){return zd(this,a,b,c)};k.Sc=function(a,b,c){return yd(this,zd(this,a,b,c),c)};
|
|
|
|
|
function Ad(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=zd(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.B=a.P>>12&3,c=pd(a,d|c&65536),a.B=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.ya[a.P>>12&3];return c}function Bd(a,b,c,d){a.F&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=zd(a,b,e,4),c&65536||(e&=65535),a.B=a.P>>12&3,e=yd(a,e|c&65536,4),a.B=a.P>>14&3,a.H.nb(e,d&65535)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.ya[a.P>>12&3]=d}
|
|
|
|
|
function Cd(a,b){b>>=6;var c=a.I=b&7;(b=a.G=(b&56)>>3)?(c=a.ba(b,c,3),a=a.H.jb(c)):a=a.u[c]&255;return a}function Dd(a,b){var c;b>>=6;var d=a.I=b&7;(b=a.G=(b&56)>>3)?c=jc(a,a.ba(b,d,2)):c=a.u[d];return c}function Ed(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return zd(a,b,c,8)}function Fd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.ba(b,c,3),a=a.H.jb(c)):a=a.u[c]&255;return a}function Gd(a,b){var c,d=a.f=b&7;(b=a.g=(b&56)>>3)?c=jc(a,a.ba(b,d,2)):c=a.u[d];return c}
|
|
|
|
|
function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.eb=a.ba(b,e,7),c=d.call(a,c,a.H.jb(e)),e&1&&a.b--,a.H.Rb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),c=d.call(a,c,jc(a,e)),a.H.nb(e,c&65535)):a.u[e]=d.call(a,c,a.u[e])}function Hd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),d&1&&a.b--,a.H.Rb(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}
|
|
|
|
|
function Id(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.H.nb(d,c&65535)):a.u[d]=c&65535;return c}function T(a,b,c){c&&(qd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
|
|
|
|
k.zb=function(a){this.v.complete=!0;var b=this.v.Oc=this.j&&Jd(this.j),c=a?this.v.oc?0:1:-1;this.v.oc=!1;this.$=this.b=a;do{if(b){if(Kd(this.j,this.u[7],c)){this.ja();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.L(168,28):this.D&64?this.L(4,30):this.D&16&&this.L(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;a=null;for(var d=this.mc&224,e=this.w.length;0<=--e;){if(0<this.w[e].La){this.w[e].La--;this.D|=2;break}if(this.w[e].gc){if(!this.w[e].gc()){this.w.splice(e,1);continue}this.w[e].gc=
|
|
|
|
|
null}this.w[e].Ac>d&&(d=this.w[e].Ac,a=this.w[e],this.w.splice(e,1))}d>(this.P&224)&&(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),a?this.L(a.Hc,26):this.L(160,26))}else this.D&1&&this.D++;this.F&57344||(this.Ya=0,this.ac=this.u[7]);this.D=this.D&7|this.P&16;this.decode(od(this))}while(0<this.b);return this.v.complete?this.$-this.b:void 0===this.v.complete?0:-1};La(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new id(d);fb(d,c)}});
|
|
|
|
|
function Ld(a,b){var c=b+a;sd(this,c,a,b);return c&65535}function Md(a,b){var c=b+a;sd(this,c<<8,a<<8,b<<8);return c&255}function Nd(a,b){a=b<<1;td(this,a);return a&65535}function Od(a,b){a=b<<1;td(this,a<<8);return a&255}function Pd(a,b){a=b&32768|b>>1|b<<16;td(this,a);return a&65535}function Qd(a,b){a=b&2048|b>>1|b<<8;td(this,a<<8);return a&255}function Rd(a,b){a=b&~a;P(this,a);return a}function Sd(a,b){a=b&~a;P(this,a<<8);return a}function Td(a,b){a|=b;P(this,a);return a}
|
|
|
|
|
function Ud(a,b){a|=b;P(this,a<<8);return a}function Vd(a,b){a=~b|65536;rd(this,a);return a&65535}function Wd(a,b){a=~b|256;rd(this,a<<8);return a&255}function Xd(a,b){a=b-a;this.D&128||(this.X=this.aa=a,this.W=b&(b^a));return a&65535}function Yd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.X=this.aa=c,this.W=b&(b^c));return a&255}function Zd(a,b){a=b+a;this.D&128||(this.X=this.aa=a,this.W=a&(b^a));return a&65535}
|
|
|
|
|
function $d(a,b){a=b+a;var c=a<<8;this.D&128||(this.X=this.aa=c,this.W=c&(b<<8^c));return a&255}function ae(a,b){a=-b;rd(this,a,a&b&32768);return a&65535}function be(a,b){a=-b;rd(this,a<<8,(a&b&128)<<8);return a&255}function ce(a,b){a=b<<1|this.V>>16&1;td(this,a);return a&65535}function de(a,b){a=b<<1|this.V>>16&1;td(this,a<<8);return a&255}function ee(a,b){a=(this.V&65536|b)>>1|b<<16;td(this,a);return a&65535}function fe(a,b){a=((this.V&65536)>>8|b)>>1|b<<8;td(this,a<<8);return a&255}
|
|
|
|
|
function ge(a,b){var c=b-a;ud(this,c,a,b);return c&65535}function he(a,b){var c=b-a;ud(this,c<<8,a<<8,b<<8);return c&255}function ie(a,b){this.D&128||(this.X=this.aa=b&65280,this.W=this.V=0);return(b<<8|b>>8)&65535}function je(a,b){a^=b;P(this,a);return a&65535}
|
|
|
|
|
function ke(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.V=this.W=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.V=c<<17-b,c>>=b;else if(b)if(16<b)this.W=c,c=0;else{this.V=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.W=32768)}this.u[a]=c&65535;this.X=this.aa=c;this.b-=(this.g?6:7)+b}
|
|
|
|
|
function le(a){var b=Gd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.V=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.V=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.W=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.X=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function U(a){a&1&&(this.V=0);a&2&&(this.W=0);a&4&&(this.aa=1);a&8&&(this.X=0);this.b-=5}
|
|
|
|
|
function me(a){var b=Gd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.V=this.W=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.X=d>>16):(this.W=32768,this.aa=d>>15|d,this.X=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.X=0,this.W=32768,this.V=65536,this.b-=7}var ne=[0,7,7,10,7,11,9,13];function oe(a){var b=this.b;qd(this,Ed(this,a));this.b=b-ne[this.g]}
|
|
|
|
|
var pe=[0,14,14,17,14,18,16,20];function qe(a){var b=this.b,c=Ed(this,a);a=a>>6&7;vd(this,this.u[a]);this.u[a]=this.u[7];qd(this,c);this.b=b-pe[this.g]}var re=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],se=[7,13,13,17,14,18,17,21];function te(a){var b=Gd(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.D&128||(this.X=b>>16,this.aa=this.X|b,this.W=0,this.V=-32768>b||32767<b?65536:0);this.b-=23}
|
|
|
|
|
function ue(){this.b-=5}function V(a){a&1&&(this.V=65536);a&2&&(this.W=32768);a&4&&(this.aa=0);a&8&&(this.X=32768);this.b-=5}function ve(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)qd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Pe(a){R(this,a,0,ie);this.b-=this.g?9:3+(7==this.f?2:0)}function Qe(a){R(this,a,Dd(this,a),je);this.b-=this.g?9:3+(7==this.f?2:0)}function W(){this.L(8,6)}function jd(a){Re[a>>12].call(this,a)}
|
|
|
|
|
var Re=[function(a){Se[a>>8&15].call(this,a)},function(a){var b=Dd(this,a),c=this.b;P(this,Id(this,a,b));this.b=c-re[(this.G?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=Dd(this,a);a=Gd(this,a);ud(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(a){P(this,Dd(this,a)&Gd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.G?4:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Rd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?
|
|
|
|
|
2:0)},function(a){R(this,a,Dd(this,a),Td);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),Ld);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){Te[a>>8&15].call(this,a)},function(a){Ue[a>>8&15].call(this,a)},function(a){var b=Cd(this,a);P(this,Hd(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)},function(a){var b=Cd(this,a)<<8;a=Fd(this,a)<<8;ud(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(a){P(this,(Cd(this,a)&Fd(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(a){Q(this,a,Cd(this,a),Sd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Cd(this,a),Ud);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},function(a){R(this,a,Dd(this,a),ge);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.G?5:3)+(7==this.f?2:0)},W],Se=
|
|
|
|
|
[function(a){Ve[a>>4&15].call(this,a)},function(a){T(this,a,!0)},function(a){T(this,a,!nd(this))},function(a){T(this,a,nd(this))},function(a){T(this,a,!this.Na()==!md(this))},function(a){T(this,a,!this.Na()!=!md(this))},function(a){T(this,a,!nd(this)&&!this.Na()==!md(this))},function(a){T(this,a,nd(this)||!this.Na()!=!md(this))},qe,qe,function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},W,W],We=[function(a){rd(this,
|
|
|
|
|
Id(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Vd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Xd);this.b-=this.g?9:3+(7==this.f?2:0)}],Xe=[function(a){R(this,a,0,ae);this.b-=this.g?11:6},function(a){R(this,a,ld(this)?1:0,Ld);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,ld(this)?1:0,ge);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);rd(this,a);this.b-=this.g?4:3+(7==this.f?
|
|
|
|
|
2:0)}],Ye=[function(a){R(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ce);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Pd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)}],Ze=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=pd(this,a|65536);qd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Ad(this,a,0);vd(this,a);P(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,
|
|
|
|
|
0,b);P(this,b);this.b=c-se[this.g]},function(a){P(this,Id(this,a,this.Na?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ve=[function(a){$e[a&15].call(this,a)},W,W,W,oe,oe,oe,oe,function(a){if(a&8)this.L(8,6);else{var b=xd(this);a&=7;qd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.P&49152||(this.P=this.P&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.L(8,6)},function(a){af[a&15].call(this,a)},function(a){bf[a&15].call(this,a)},Pe,Pe,Pe,Pe],$e=[function(){this.P&49152?(this.J|=128,this.L(4,
|
|
|
|
|
3)):hd(this);this.b-=7},function(){this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){wd(this);this.D|=this.P&16;this.b-=13},function(){this.L(12,1);this.b-=5},function(){this.L(16,4);this.b-=25},function(){this.P&49152||(kd(this),this.H.reset());this.b-=667},function(){wd(this);this.b-=13},W,W,W,W,W,W,W,W,W],af=[ue,function(){this.V=0;this.b-=5},function(){this.W=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.X=0;this.b-=5},U,U,U,U,U,U,U],bf=[ue,function(){this.V=
|
|
|
|
|
65536;this.b-=5},function(){this.W=32768;this.b-=5},V,function(){this.aa=0;this.b-=5},V,V,V,function(){this.X=32768;this.b-=5},V,V,V,V,V,V,V],Te=[te,te,me,me,ke,ke,le,le,Qe,Qe,W,W,W,W,ve,ve],Ue=[function(a){T(this,a,!this.Na())},function(a){T(this,a,this.Na())},function(a){T(this,a,!ld(this)&&!nd(this))},function(a){T(this,a,ld(this)||nd(this))},function(a){T(this,a,!md(this))},function(a){T(this,a,md(this))},function(a){T(this,a,!ld(this))},function(a){T(this,a,ld(this))},function(){this.L(24,2);
|
|
|
|
|
this.b-=25},function(){this.L(28,5);this.b-=5},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},W,W],cf=[function(a){rd(this,Hd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Yd);this.b-=this.g?9:3+(7==this.f?2:0)}],df=[function(a){Q(this,a,0,be);this.b-=
|
|
|
|
|
this.g?11:6},function(a){Q(this,a,ld(this)?1:0,Md);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,ld(this)?1:0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Fd(this,a);rd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,fe);this.b-=this.g?9+(this.eb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Qd);this.b-=this.g?9+(this.eb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Od);this.b-=this.g?9:3+(7==
|
|
|
|
|
this.f?2:0)}],ff=[W,function(a){a=Ad(this,a,65536);vd(this,a);P(this,a);this.b-=11},function(a){var b=xd(this),c=this.b;Bd(this,a,65536,b);P(this,b);this.b=c-se[this.g]},W];function gf(a){w.call(this,"ROM",a,gf);this.f=null;this.B=a.addr;this.g=a.size;this.F=a.writable;this.C=a.alias;this.w=a.file;this.G=da(this.w);if(this.w){a=this.w;var b=ea(this.G);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.w+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){hf(c,a,b,f)})}}y(gf);
|
|
|
|
|
gf.prototype.Oa=function(a,b,c,d){this.H=b;this.b=c;this.j=d;jf(this)};gf.prototype.Ja=function(){if(this.Ka){if(this.j){var a=this.j,b=this.id,c=this.B,d=this.g,e=this.Ka,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=qa(n,l,a.tc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.G.push({xd:b,A:c,Tc:d,Ka:e,rc:f})}delete this.Ka}return!0};gf.prototype.Ia=function(){return!0};
|
|
|
|
|
function hf(a,b,c,d){if(d)a.sa("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.dc,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,h=eval("("+c+")");if(f=h.bytes)a.f=f;else if(f=h.words)for(a.f=Array(2*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255;else if(f=h.data)for(a.f=Array(4*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=h;a.Ka=h.symbols;if(!a.f.length){t("Empty ROM: "+
|
|
|
|
|
b);return}if(1==a.f.length){t(a.f[0]);return}}catch(l){a.sa("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e<b.length;e++)a.f[e]=aa(b[e],16);jf(a)}}
|
|
|
|
|
function jf(a){if(!ib(a))if(!a.w)G(a);else if(a.f&&a.H){a.g||(a.g=a.f.length);if(a.f.length!=a.g)kb(a,"ROM size ("+p(a.f.length,8,!0)+") does not match specified size ("+p(a.g,8,!0)+")");else{var b;b=a.B;if(Gb(a.H,b,a.g,a.F?1:qc)){var c;for(c=0;c<a.f.length;c++){a.j&&a.j.g++;var d=a.H,e=b+c;d.O[(e&d.g)>>>d.ca].Bb(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.C?b.push(a.C):null!=a.C&&a.C.length&&(b=a.C);for(c=0;c<b.length;c++){for(var f=a,d=b[c],e=f.H,g=f.g,h=[],l=f.B>>>
|
|
|
|
|
e.ca;0<g&&l<e.O.length;)h.push(e.O[l++]),g-=e.Ca;e=f.H;f=f.g;g=0;for(d>>>=e.ca;0<f&&d<e.O.length;){l=h[g++];if(!l)break;e.O[d++]=l;f-=e.Ca}}delete a.f}}G(a)}}La(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new gf(d);fb(d,c)}});function kf(a){w.call(this,"RAM",a,kf);this.C=a.addr;this.g=a.size;this.f=!1}y(kf);k=kf.prototype;k.Oa=function(a,b,c,d){this.H=b;this.b=c;this.j=d;G(this)};k.Ja=function(a,b){b||this.reset();return!0};
|
|
|
|
|
k.Ia=function(a){return a?this.save():!0};k.reset=function(){!this.f&&this.g&&Gb(this.H,this.C,this.g,1)&&(this.f=!0);this.f||t("No RAM allocated")};k.save=function(){return null};k.restore=function(){return!0};La(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new kf(d);fb(d,c)}});function lf(a){w.call(this,"Keyboard",a,lf,65536);G(this)}y(lf);lf.prototype.pa=function(){return!1};lf.prototype.Oa=function(a,b,c,d){this.C=a;this.b=c;this.j=d;this.qa=null};
|
|
|
|
|
La(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new lf(d);fb(d,c)}});function Y(a){this.w=this.F=null;this.Z=a.tabSize;this.S=a.charBOL;this.G=0;w.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.F="";else{var c;a=mf;b&&(void 0===c&&(c="Panel"),(c=eb(c,this.id))&&(b=c.K[b])&&this.pa(null,a,b))}this.I=this.N=null;this.exports={connect:this.zc,receiveData:this.lc}}y(Y);var mf="buffer";k=Y.prototype;
|
|
|
|
|
k.pa=function(a,b,c){var d=this;switch(b){case mf:return this.K[b]=this.w=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.lc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.lc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
|
|
|
|
k.Oa=function(a,b,c,d){this.C=a;this.H=b;this.b=c;this.j=d;var e=this;this.$=Pb(this.b,function(){e.f&128||!e.B.length||(e.Y=e.B.shift(),e.f|=128,e.f&64&&L(e.b,40,4,48))});this.U=function(){e.g|=128;return!!(e.g&64)};Mb(b,this,nf);G(this)};
|
|
|
|
|
k.zc=function(){if(!this.I){var a=Dc(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.pb)return;b=oa(b[1]);if(this.I=db(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.N=d.receiveData){this.status(this.dc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ja=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
|
|
|
|
k.Ia=function(a){return a?this.save():!0};k.reset=function(){of(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return of(this)};function of(a){a.Y=0;a.f=0;a.g=128;a.B=[];return!0}k.lc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.B.push(a.charCodeAt(b));else this.B=this.B.concat(a);Qb(this.b,this.$,50);return!0};k.ad=function(){return this.f&65535};k.td=function(a){this.f=this.f&-112|a&111};
|
|
|
|
|
k.$c=function(){this.f&=-129;0<this.B.length&&Qb(this.b,this.$,50);return this.Y};k.sd=function(){};k.cd=function(){return this.g};k.vd=function(a){128==(this.g&192)&&a&64&&L(this.b,8,4,52,this.U);this.g=this.g&-70|a&69};k.bd=function(){return 0};
|
|
|
|
|
k.ud=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.N&&this.N.call(this.I,a);if(this.w)if(13==a)this.G=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0<this.G&&this.G--;else{var b;b=(b=pa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.Z||8,c=a-this.G%a,this.Z&&(b=na("",c)));this.S&&!this.G&&c&&(b=String.fromCharCode(this.S)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.G+=c}else if(null!=this.F){if(10==a||1024<=this.F.length)this.i(this.F),
|
|
|
|
|
this.F="";10!=a&&(this.F+=String.fromCharCode(a))}this.g&=-129;L(this.b,100,4,52,this.U)}};var pf={},nf=(pf[65392]=[null,null,Y.prototype.ad,Y.prototype.td,"RCSR"],pf[65394]=[null,null,Y.prototype.$c,Y.prototype.sd,"RBUF"],pf[65396]=[null,null,Y.prototype.cd,Y.prototype.vd,"XCSR"],pf[65398]=[null,null,Y.prototype.bd,Y.prototype.ud,"XBUF"],pf);La(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Y(d);fb(d,c)}});
|
|
|
|
|
function qf(a){w.call(this,"Debugger",a,qf);this.ea=a.base||16;this.Ba=!1;this.Y=this.Aa=this.I=0;this.$=!1;this.B=-1;this.w=[];this.la={}}y(qf);var rf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};qf.prototype.xc=function(){return-1};qf.prototype.yc=function(){};
|
|
|
|
|
function sf(a,b,c,d){if(c)if(b){0>a.B&&a.w.length&&(a.B=0);if(0>a.B||b!=a.w[a.B])a.w.splice(0,0,b),a.B=0;a.B--}else a.$?b="end":b=a.w[a.B+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(oa(b.substring(c,f))),c=f+1}}return a}
|
|
|
|
|
function tf(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<<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;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?1:0;break;case "&":d=f&e;break;
|
|
|
|
|
0,3024,3103,65514,34562,0,264,8197,33779,5003,2574,32337,260,0,258,5579,12,6080,448,6081,450,6084,452,116,2,6084,65400,17860,65024,21956,62976,38848,65401,3200,161,76,0,16944,10797];k=K.prototype;k.Oa=function(a,b,c,d){this.F=b;this.b=c;this.j=d;var e=this;this.f.pc=Ob(this.b,function(){e.f.Va|=128;e.f.Va&64&&(L(e.b,0,6,64),Pb(e.b,e.f.pc,1E3/60))});Lb(b,this,Qb);Mb(b,this.reset.bind(this),this.Lc.bind(this));G(this)};k.Wc=function(){var a=this.f.Va;this.f.Va&=-129;return a};
|
|
|
|
|
k.pd=function(a){this.f.Va=a;a&64&&Pb(this.b,this.f.pc,1E3/60);this.f.Va=a&-129};k.Xc=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};k.qd=function(a){var b=4,c=this.b;c.G=a&=62337;c.wa=a>>5&3;c.xa=a>>1&15;c.Tb=a&257?a&1?6:4:0;Rb(c);a=c.G;a&1|256&&(b=this.b.lb&16?1:2);this.g.pb=this.g.pb&-8|b};k.Yc=function(){return Sb(this.b)};k.rd=function(a){Tb(this.b,a&-1809|Sb(this.b)&1808);this.b.C|=128};
|
|
|
|
|
function Ub(a){var b=a.D,c,d,e,f=b.va>>13&7;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.cd,drive:f,blocksize:256,mapped:0,maxblock:b.eb[f]*b.da[f],url:"rk"+f+".dsk"});b.P&=-129;switch(b.P>>1&7){case 0:b.Jb=2496;b.oa=0;b.P=128;b.va=0;break;case 1:if((b.va>>4&511)>=b.eb[f]){b.oa|=32832;b.P|=49152;break}if((b.va&15)>=b.da[f]){b.oa|=32800;b.P|=49152;break}c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.P&48)<<12|b.Ib;e=65536-b.Kb&65535;Vb(a,b.ra[f],c,d,e);return;case 2:if((b.va>>4&511)>=b.eb[f])b.oa|=
|
|
|
|
|
32832,b.P|=49152;else if((b.va&15)>=b.da[f])b.oa|=32800,b.P|=49152;else{c=(b.va>>4&511)*b.da[f]+(b.va&15);d=(b.P&48)<<12|b.Ib;e=65536-b.Kb&65535;a.Xb(b.ra[f],c,d,e);return}}b.Jb=f<<13|b.Jb&8176|b.va%9&15;L(a.b,20,5,144,function(){b.P=b.P&65534|128;return!!(b.P&64)})}k.cd=function(a,b,c,d,e){var f=this.D;f.Ib=d&65535;f.P=f.P&-49|d>>12&48;f.Kb=65536-e&65535;switch(a){case 1:f.oa|=33024;f.P|=49152;break;case 2:f.oa|=33792,f.P|=49152}L(this.b,20,5,144,function(){f.P=f.P&65534|128;return!!(f.P&64)})};
|
|
|
|
|
function Wb(a){var b=a.w,c,d,e,f=b.M>>8&3;b.M&=-2;"undefined"===typeof b.ra[f]&&(b.ra[f]={cache:[],postProcess:a.dd,drive:f,blocksize:128,mapped:1,maxblock:b.eb[f]*b.da[f],url:"rl"+f+".dsk"});switch(b.M>>1&7){case 2:b.Wa&8&&(b.M&=63);b.Wa=b.Jc[f]|b.bb&64;break;case 3:1==(b.fa&3)&&(b.bb=b.fa&4?b.bb+(b.fa&65408)&65408|b.fa<<2&64:b.bb-(b.fa&65408)&65408|b.fa<<2&64,b.fa=b.bb);break;case 4:b.Wa=b.bb;break;case 5:if(b.fa>>6>=b.eb[f]){b.M|=37888;break}if((b.fa&63)>=b.da[f]){b.M|=37888;break}c=(b.fa>>6)*
|
|
|
|
|
b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Ab;e=65536-b.Wa&65535;Vb(a,b.ra[f],c,d,e);return;case 6:if(b.fa>>6>=b.eb[f])b.M|=37888;else if((b.fa&63)>=b.da[f])b.M|=37888;else{c=(b.fa>>6)*b.da[f]+(b.fa&63);d=(b.Sa&63)<<16|b.Ab;e=65536-b.Wa&65535;a.Xb(b.ra[f],c,d,e);return}}L(a.b,20,5,112,function(){b.M|=129;return!!(b.M&64)})}
|
|
|
|
|
k.dd=function(a,b,c,d,e){var f=this.w;f.Ab=d&65535;f.M=f.M&-49|d>>12&48;f.Sa=d>>16&63;f.fa=~~(c/f.da[b.Ma])<<6|c%f.da[b.Ma];f.bb=f.fa;f.Wa=65536-e&65535;switch(a){case 1:f.M|=33792;break;case 2:f.M|=40960}L(this.b,20,5,112,function(){f.M|=129;return!!(f.M&64)})};function Xb(a){a=a.B;a.S=2176;a.Da=0;a.ta=[4544,4544,4544,4544,4544,4544,4544,4544];a.tb=[0,0,0,0,0,0,0,0];a.mb=a.ub=a.sb=a.$a=a.mc=0}
|
|
|
|
|
function gc(a,b){var c=a.B,d,e,f;c.S&=-16513;c.Da&=-2049;c.ta[b]&=-1153;L(a.b,-1,0,172);"undefined"===typeof c.ra[b]&&(c.ra[b]={cache:[],postProcess:a.ed,drive:b,blocksize:256,mapped:0,maxblock:c.bc[0]*c.cb[0]*c.da[0],url:"rp"+b+".dsk"});switch(c.S&63){case 5:c.Zb[b]=c.Qa[b];c.S|=32896;c.ta[b]|=32896;c.mb|=1<<b;break;case 9:Xb(a);break;case 19:c.ta[b]|=64;break;case 49:if(c.Qa[b]>=c.bc[0]||c.Ea[b]>>8>=c.cb[0]||(c.Ea[b]&255)>=c.da[0]){c.tb[b]|=1024;c.S|=49152;break}d=(c.Qa[b]*c.cb[0]+(c.Ea[b]>>8))*
|
|
|
|
|
c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.sb;f=65536-c.ub&65535;Vb(a,c.ra[b],d,e,f);return;case 57:if(c.Qa[b]>=c.bc[0]||c.Ea[b]>>8>=c.cb[0]||(c.Ea[b]&255)>=c.da[0])c.tb[b]|=1024,c.S|=49152;else{d=(c.Qa[b]*c.cb[0]+(c.Ea[b]>>8))*c.da[0]+(c.Ea[b]&255);e=(c.$a&63)<<16|c.sb;f=65536-c.ub&65535;a.Xb(c.ra[b],d,e,f);return}}L(a.b,3,5,172,function(){c.S=c.S&65534|128;c.ta[b]|=128;return!!(c.S&64)})}
|
|
|
|
|
k.ed=function(a,b,c,d,e){var f=this.B;f.ub=65536-e&65535;f.sb=d&65535;f.S=f.S&-769|d>>8&768;f.$a=d>>16&63;e=~~(c/f.da[0]);d=~~(e/f.cb[0]);f.Ea[b.Ma]=e%f.cb[0]<<8|c%f.da[0];f.Zb[b.Ma]=f.Qa[b.Ma]=d;f.mb|=1<<b.Ma;c>=b.Uc-1&&(f.ta[b.Ma]|=1024);switch(a){case 1:f.Da|=512;f.S|=49152;break;case 2:f.Da|=2048,f.S|=49152}L(this.b,20,5,172,function(){f.ta[b.Ma]|=128;f.S=f.S&65534|128;return!!(f.S&64)})};
|
|
|
|
|
function hc(a,b,c,d,e,f){var g=~~((f+c.Ta-1)/c.Ta),h=new XMLHttpRequest;2048>g&&d+2048<c.Uc&&(g=2048);h.open("GET",c.url,!0);h.setRequestHeader("Range","bytes="+(d*c.Ta<<1)+"-"+(((d+g)*c.Ta<<1)-1));h.responseType="arraybuffer";h.onreadystatechange=function(){if(4==h.readyState){var g=b.bind(a),m,n,r,q;m=h.response;if(h.status&&206!=h.status||!m)c.Vb(1,c,d,e,f);else{m=new Uint8Array(m);n=d;for(q=0;q<m.length;){if("undefined"===typeof c.cache[n])for(c.cache[n]=[],r=0;r<c.Ta;r++)c.cache[n][r]=q<m.length?
|
|
|
|
|
m[q]&255|m[q+1]<<8&65280:0,q+=2;else q+=c.Ta<<1;n++}g(c,d,e,f)}}};h.send(null)}function M(a,b,c,d,e){c&1?e?d=0<=d?d<<8&65280|b&255:b:a.b.L(4,122):0<=d?e&&(d=b&65280|d&255):d=b;return d}k.Xb=function(a,b,c,d){for(var e;0<d;){if("undefined"===typeof a.cache[b]){hc(this,this.Xb,a,b,c,d);return}for(e=0;e<a.Ta&&0<d;e++){if(0>ic(this.b,a.Tc?jc(this.b,c):c,a.cache[b][e])){a.Vb(2,a,b,c,d);return}c+=2;--d}b++}a.Vb(0,a,b,c,d)};
|
|
|
|
|
function Vb(a,b,c,d,e){for(var f,g;0<e;){if("undefined"===typeof b.cache[c])for(b.cache[c]=[],f=0;f<b.Ta;f++)b.cache[c][f]=0;for(f=0;f<b.Ta&&0<e;f++){g=kc(a.b,b.Tc?jc(a.b,d):d);if(0>g){b.Vb(2,b,c,d,e);return}b.cache[c][f]=g;d+=2;--e}c++}b.Vb(0,b,c,d,e)}k.reset=function(){this.g.pb=this.g.pb&-120|20;this.f.Va=0;this.D.P=128;this.w.M=128;Xb(this)};
|
|
|
|
|
k.Lc=function(a,b,c){var d,e,f=this.b;switch(a&-64){case 4194240:switch(a&-2){case 4194300:0>b?d=f.Za&65280:(a&1&&(b<<=8),f.Za=b|255,d=0);break;case 4194298:if(0>b)d=f.lc;else{a&1&&(b<<=8);if(d=b&65024){e=d>>9;do d+=34;while(e>>=1)}f.lc=d;f.C|=2}break;case 4194294:if(70!==f.ib)return f.L(4,222);0>b?d=f.J:d=f.J=0;break;case 4194292:if(70!==f.ib)return f.L(4,224);d=1;break;case 4194290:if(70!==f.ib)return f.L(4,226);d=0;break;case 4194288:if(70!==f.ib)return f.L(4,228);d=61183;break;case 4194296:0<=
|
|
|
|
|
b&&!(a&1)&&(b&=255);case 4194286:case 4194284:case 4194282:case 4194280:case 4194278:case 4194276:case 4194274:case 4194272:if(70!==f.ib)return f.L(4,232);e=a-4194272>>1;0>b?d=f.gc[e]:(d=M(this,f.gc[e],a,b,c),0<=d&&(f.gc[e]=d));break;case 4194254:return a&1?f.O>>14&1?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[3]=b),d=f.ya[3]):f.O>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[1]=b),d=f.ya[1]),d;case 4194252:case 4194250:case 4194248:return e=a&7,f.O&2048?(0<=b&&(f.u[e]=b),d=f.u[e]):(0<=b&&(f.Pa[e]=
|
|
|
|
|
b),d=f.Pa[e]),d;case 4194246:return a&1?(0<=b&&(f.u[7]=b),d=f.u[7]):f.O>>14&0?(0<=b&&(f.u[6]=b),d=f.u[6]):(0<=b&&(f.ya[0]=b),d=f.ya[0]),d;case 4194244:case 4194242:case 4194240:return e=a&7,f.O&2048?(0<=b&&(f.Pa[e]=b),d=f.Pa[e]):(0<=b&&(f.u[e]=b),d=f.u[e]),d;default:return f.J|=16,f.L(4,124)}break;case 4194176:e=a>>1&31;d=M(this,f.na[3][e],a,b,c);0<=d&&(f.na[3][e]=d,f.na[3][e&15]&=65295);break;case 4194112:switch(a&-2){case 4194174:d=M(this,f.Yb,a,b,c);0<=d&&(f.Yb=d);break;case 4194172:d=f.Ya;d&65280&&
|
|
|
|
|
(d=(d<<8|d>>8)&65535);break;case 4194168:0>b?d=this.g.nd&65535:(d=M(this,this.g.data,a,b,c),0<=d&&(this.g.data=d));break;default:return f.J|=16,f.L(4,126)}break;case 4194048:e=this.D;switch(a&-2){case 4194048:d=M(this,e.Jb,a,b,c);0<=d&&(e.Jb=d);break;case 4194050:d=M(this,e.oa,a,b,c);0<=d&&(e.oa=d);break;case 4194052:d=M(this,e.P,a,b,c);0<=b&&0<=d&&(e.P=d&-36993|e.P&36992,e.P&1&&Ub(this));break;case 4194054:d=M(this,e.Kb,a,b,c);0<=d&&(e.Kb=d);break;case 4194056:d=M(this,e.Ib,a,b,c);0<=d&&(e.Ib=d);
|
|
|
|
|
break;case 4194058:d=M(this,e.va,a,b,c);0<=d&&(e.va=d);break;case 4194060:break;case 4194062:d=M(this,e.Cc,a,b,c);0<=d&&(e.Cc=d);break;default:return f.J|=16,f.L(4,128)}break;case 4193728:var g=this.B;e=g.Da&7;switch(a&-2){case 4193728:d=M(this,g.S,a,b,c);0<=b&&0<=d&&(g.$a=g.$a&60|d>>8&3,g.S=d&17279|g.S&34944|2048,d&1&&g.S&128?gc(this,e):192==(d&192)&&L(f,0,5,172));break;case 4193730:d=M(this,g.ub,a,b,c);0<=d&&(g.ub=d);break;case 4193732:d=M(this,g.sb,a,b,c);0<=d&&(g.sb=d&65534);break;case 4193734:d=
|
|
|
|
|
M(this,g.Ea[e],a,b,c);0<=d&&(g.Ea[e]=d&7967);break;case 4193736:d=M(this,g.Da,a,b,c);0<=d&&(g.Da=d&63|g.Da&65472,d&128&&Xb(this));break;case 4193738:d=g.ta[e];break;case 4193740:d=g.tb[e];break;case 4193742:d=M(this,g.mb,a,b,c);0<=d&&(g.mb=d&255);break;case 4193744:d=g.kd[e];break;case 4193746:d=M(this,g.Dc,a,b,c);0<=d&&(g.Dc=d);break;case 4193748:d=M(this,g.Ec[e],a,b,c);0<=d&&(g.Ec[e]=d&1023);break;case 4193750:d=8210;break;case 4193752:d=g.ld[e];break;case 4193754:d=M(this,g.Fc[e],a,b,c);0<=d&&
|
|
|
|
|
(g.Fc[e]=d);break;case 4193756:d=M(this,g.Qa[e],a,b,c);0<=d&&(g.Qa[e]=d&511);break;case 4193758:g.Zb[e]=g.Qa[e];d=g.Zb[e];break;case 4193760:d=g.hd[e];break;case 4193762:d=g.jd[e];break;case 4193764:d=g.fd[e];break;case 4193766:d=g.gd[e];break;case 4193768:d=M(this,g.$a,a,b,c);0<=d&&(g.$a=d&63,g.S=g.S&-769|(d&3)<<8);break;case 4193770:d=M(this,g.mc,a,b,c);0<=d&&(g.mc=d);break;default:return f.J|=16,f.L(4,132)}break;case 4192512:e=this.w;switch(a&-2){case 4192512:d=M(this,e.M,a,b,c);0<=b&&0<=d&&(e.Sa=
|
|
|
|
|
e.Sa&60|d>>4&3,e.M=e.M&-1023|d&1022,e.M&128||Wb(this));break;case 4192514:d=M(this,e.Ab,a,b,c);0<=d&&(e.Ab=d&65534);break;case 4192516:d=M(this,e.fa,a,b,c);0<=d&&(e.fa=d);break;case 4192518:d=M(this,e.Wa,a,b,c);0<=d&&(e.Wa=d);break;case 4192520:d=M(this,e.Sa,a,b,c);0<=d&&(e.Sa=d&63,e.M=e.M&-49|(e.Sa&3)<<4);break;default:return f.J|=16,f.L(4,134)}break;case 4191552:switch(a&-2){case 4191566:0>b?d=f.lb:(d=M(this,f.lb,a,b,c),0<=d&&(70!==f.ib&&(d&=-49),f.lb=d,f.Ub[0]=d&4?15:7,f.Ub[1]=d&2?15:7,f.Ub[3]=
|
|
|
|
|
d&1?15:7,f.Tb&&(e=2,f.lb&16&&(e=1),this.g.pb=this.g.pb&-8|e)));break;default:return f.J|=16,f.L(4,136)}break;case 4191424:e=a>>1&31;d=M(this,f.na[0][e],a,b,c);0<=d&&(f.na[0][e]=d,f.na[0][e&15]&=65295);break;case 4191360:e=a>>1&31;d=M(this,f.na[1][e],a,b,c);0<=d&&(f.na[1][e]=d,f.na[1][e&15]&=65295);break;case 4190400:case 4190336:if(70!==f.ib)return f.L(4,234);e=a>>2&31;d=f.Mb[e];a&2&&(d>>=16);d&=65535;0<=b&&(d=M(this,d,a,b,c),0<=d&&(f.Mb[e]=a&2?d<<16|f.Mb[e]&65535:f.Mb[e]&4294901760|d&65534));break;
|
|
|
|
|
case 4188672:case 4188736:case 4188800:case 4188864:case 4188928:case 4188992:case 4189056:case 4189120:if(0>b)d=Nb[a>>1&255];else return f.J|=16,f.L(4,138);break;default:return f.J|=16,f.L(4,142)}c&&0<=d&&(a&1?d>>=8:d&=255);"undefined"===typeof d&&console.log("panic(76)");return d};var lc={},Qb=(lc[65382]=[null,null,K.prototype.Wc,K.prototype.pd,"LKS"],lc[65402]=[null,null,K.prototype.Xc,K.prototype.qd,"MMR0"],lc[65534]=[null,null,K.prototype.Yc,K.prototype.rd,"PSW"],lc);
|
|
|
|
|
La(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new K(d);eb(d,c)}});var mc;if(kb){var nc=new ArrayBuffer(2);(new DataView(nc)).setUint16(0,256,!0);mc=256===(new Uint16Array(nc))[0]}else mc=!1;var oc=mc;
|
|
|
|
|
function I(a,b,c,d,e){this.id=pc+=2;this.b=null;this.A=a;this.Ob=b;this.size=c||0;this.type=d||qc;this.f=d==rc;this.controller=null;Ab(this);this.Ua=this.Oc=!1;if(c)if(e)this.controller=e,this.b=null,sc(this,e.xb);else if(kb)this.D=new ArrayBuffer(c),this.B=new DataView(this.D,0,c),this.w=new Uint8Array(this.D,0,c),this.H=new Uint16Array(this.D,0,c>>1),this.b=new Int32Array(this.D,0,c>>2),sc(this,oc?tc:uc);else{this.b=Array(c>>2);for(a=0;a<this.b.length;a++)this.b[a]=0;sc(this,vc)}else sc(this)}
|
|
|
|
|
var qc=0,rc=2,Gb=4,Ib=["NONE","RAM","ROM","VID","H/W"],pc=0;
|
|
|
|
|
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(kb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.B.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(kb)for(b=0;b<a.length;b++)this.B.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ua=!0}return!1},gb:function(a,b){b?this.F++||wc(this,xc,!1):this.g++||yc(this,xc,!1)},I:function(){this.j&&F(this.j,128)&&(E(this.j,"attempt to read invalid block %"+
|
|
|
|
|
p(this.A),!0),this.j.ja());return 255},K:function(a,b){this.j&&F(this.j,128)&&(E(this.j,"attempt to write "+p(b,4,!0)+" to invalid block %"+p(this.A),!0),this.j.ja())},N:function(a,b){return this.Wb(a++,b++)|this.Wb(a,b)<<8},G:function(a,b,c){this.$b(a++,b&255,c++);this.$b(a,b>>8,c)},Z:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},la:function(a){var 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},wa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<
|
|
|
|
|
a)|b<<a;this.Ua=!0},Ba:function(a,b){var c=a>>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<<a)|b<<a:(this.b[c]=this.b[c]&16777215|b<<24,c++,this.b[c]=this.b[c]&-256|b>>8);this.Ua=!0},T:function(a,b){if(this.j&&null!=this.A){var c=this.j;zc(c,this.A+a,1,c.T)&&c.ja(!0)}return this.ic(a,b)},ea:function(a,b){if(this.j&&null!=this.A){var c=this.j;zc(c,this.A+a,2,c.T)&&c.ja(!0)}return this.jc(a,b)},qa:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;zc(d,this.A+a,1,d.G)&&d.ja(!0)}this.f?this.K(a,
|
|
|
|
|
b,c):this.ac(a,b,c)},za:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;zc(d,this.A+a,2,d.G)&&d.ja(!0)}this.f?this.K(a,b,c):this.qc(a,b,c)},R:function(a){return this.w[a]},Y:function(a,b){a=this.w[a];this.j&&F(this.j,128)&&E(this.j,"Memory.readByte("+J(this.j,b)+"): "+J(this.j,a),!0);return a},$:function(a){return this.B.getUint16(a,!0)},ha:function(a,b){a=this.H[a>>1];this.j&&F(this.j,128)&&E(this.j,"Memory.readWord("+J(this.j,b)+"): "+J(this.j,a),!0);return a},ma:function(a,b){this.w[a]=b;
|
|
|
|
|
this.Ua=!0},ua:function(a,b,c){this.w[a]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeByte("+J(this.j,c)+","+J(this.j,b)+")",!0)},xa:function(a,b){this.B.setUint16(a,b,!0);this.Ua=!0},Aa:function(a,b,c){this.H[a>>1]=b;this.Ua=!0;this.j&&F(this.j,128)&&E(this.j,"Memory.writeWord("+J(this.j,c)+","+J(this.j,b)+")",!0)}};function Ab(a,b,c){a.j=b;a.g=a.F=0;c&&((a.g=c.g)&&yc(a,xc,!1),(a.F=c.F)&&wc(a,xc,!1))}
|
|
|
|
|
function Ac(a,b){b?--a.F||(a.$b=a.f?a.K:a.ac,a.Ic=a.f?a.G:a.qc):--a.g||(a.Wb=a.ic,a.Bc=a.jc)}function wc(a,b,c){c&&a.F||(a.$b=!a.f&&b[1]||a.K,a.Ic=!a.f&&b[3]||a.G);if(c||void 0===c)a.ac=b[1]||a.K,a.qc=b[3]||a.G}function yc(a,b,c){c&&a.g||(a.Wb=b[0]||a.I,a.Bc=b[2]||a.N);if(c||void 0===c)a.ic=b[0]||a.I,a.jc=b[2]||a.N}function sc(a,b){b||(b=Bc);yc(a,b,void 0);wc(a,b,void 0)}var Bc=[],vc=[I.prototype.Z,I.prototype.wa,I.prototype.la,I.prototype.Ba],xc=[I.prototype.T,I.prototype.qa,I.prototype.ea,I.prototype.za];
|
|
|
|
|
if(kb)var uc=[I.prototype.R,I.prototype.ma,I.prototype.$,I.prototype.xa],tc=[I.prototype.Y,I.prototype.ua,I.prototype.ha,I.prototype.Aa];function Cc(a,b){w.call(this,"CPU",a,Cc,1);var c=a.multiplier||1;this.Aa=a.cycles||b;this.Xa=c;this.ab=Math.round(this.Aa/1E4)/100;this.kb=this.ab*this.Xa;this.v.ga=!1;this.v.oc=!1;this.v.yb=a.autoStart;this.v.uc=!1;this.v.ob=!1;this.Fb=this.ha=0;this.Gb=a.csStart;this.qb=a.csInterval;this.rb=a.csStop;this.N=[];this.Sb=this.md.bind(this);G(this)}y(Cc);
|
|
|
|
|
var Dc=["power","reset"];k=Cc.prototype;k.Oa=function(a,b,c,d){this.D=a;this.F=b;this.j=d;for(b=0;b<Dc.length;b++)(c=this.K[Dc[b]])&&this.D.pa(null,Dc[b],c);this.qa=null;a=Ec(a,"autoStart");null!=a&&(this.v.yb="true"==a?!0:"false"==a?!1:!!a);G(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
|
|
|
|
k.Ja=function(a,b){if(!b){if(a&&this.restore){Fc(this);if(!this.restore(a))return!1;Gc(this)}else this.reset();this.j?(a=this.j,a.i("Type ? for help with PDP11 Debugger commands"),a.Fa(),a.ab&&(b=a.ab,a.ab=null,Hc(a,b))):this.i("No debugger detected")}N(this);return!0};k.Ia=function(a){return a?this.save():!0};k.yb=function(){return this.v.yb||!this.j&&void 0===this.K.run?(this.vb(!0),!0):!1};k.wc=function(){return 0};
|
|
|
|
|
function Gc(a){void 0===a.Gb&&(a.Gb=0);void 0===a.qb&&(a.qb=-1);void 0===a.rb&&(a.rb=-1);a.v.ob=0<=a.Gb&&0<a.qb;a.v.ob&&(a.Fb=0,a.ha=a.Gb-a.ea)}function Ic(a,b){if(a.v.ob){var c=!1;a.Fb=a.Fb+a.wc()|0;a.ha-=b;0>=a.ha&&(a.ha+=a.qb,c=!0);0<=a.rb&&a.rb<=Jc(a)&&(a.qb=a.rb=-1,Gc(a),a.ja(),c=!0);c&&a.i(Jc(a)+" cycles: checksum="+p(a.Fb))}}
|
|
|
|
|
function Kc(a,b,c,d){if(a.K[b]){void 0===c&&(jb(a,"Value for "+b+" is invalid"),a.ja());var e=a.j&&a.j.qa||8;c=!a.v.ga||a.v.uc?8==e?ca(c,d):p(c,d):"--------".substr(0,d||4);a.K[b].textContent!=c&&(a.K[b].textContent=c)}}
|
|
|
|
|
k.pa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.K[b]=c;a=!0;break;case "run":this.K[b]=c;c.onclick=function(){var a;if(a=d.D)if(a=d.D,a.v.ia)a=!0;else{var b=null,c,h=bb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.v.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.v.ia);c++);c==h.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.Rb?" (waiting for notification)":""))+".");a=!1}a&&(d.v.ga?d.ja():d.vb())};
|
|
|
|
|
a=!0;break;case "speed":this.K[b]=c;a=!0;break;case "setSpeed":this.K[b]=c,c.onclick=function(){Lc(d,d.Xa<<1,!0)},c.textContent=this.kb.toFixed(2)+"Mhz",a=!0}return a};function Mc(a,b,c){a.ea+=b;c&&(a.$=a.b=0)}function Nc(a,b){var c=1;b&&1<a.Xa&&a.Y&&(c=a.Y/a.ab);a.Db=Math.round(1E3/30);a.Ba=Math.floor(a.Aa/30*c);b||(a.la=a.Ba);a.nb=0}function Jc(a){return a.ea+a.T+a.$-a.b}function Fc(a){a.Y=0;a.Qb=0;a.ea=a.T=a.$=a.b=0;Gc(a);Lc(a,1)}
|
|
|
|
|
function Lc(a,b,c){var d=!1;if(void 0!==b){.8>a.Y/a.kb?b=1:d=!0;a.Xa=b;b=a.ab*a.Xa;if(a.kb!=b){a.kb=b;b=a.kb.toFixed(2)+"Mhz";var e=a.K.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.D&&a.D.Nb()}Mc(a,a.T);a.T=0;a.R=ra();a.Z=0;Nc(a);return d}function Ob(a,b){var c=a.N.length;a.N.push([-1,b]);return c}function Pb(a,b,c){0<=b&&b<a.N.length&&0>a.N[b][0]&&(c*=a.Aa*a.Xa/1E3,a.N[b][0]=c)}function gd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b}
|
|
|
|
|
function hd(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function id(a){a.$-=a.b;a.b=0}
|
|
|
|
|
k.md=function(){if(this.v.ga){this.nb>=this.Aa&&Nc(this,!0);this.ua=0;this.za=ra();if(this.Z){var a=this.za-this.Z;a>this.Db&&(this.R+=a,this.R>this.za&&(this.R=this.za))}try{do{var b=gd(this,this.v.ob?1:this.Ba);try{this.wb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.$-this.b;hd(this,c);this.ua+=c;this.T+=c;Mc(this,0,!0);Ic(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ba;15<=++this.Qb&&(this.D&&this.D.Fa(),this.Qb=0);break}}while(this.v.ga)}catch(e){this.ja();N(this);this.D&&this.D.stop(ra(),
|
|
|
|
|
Jc(this));jb(this,e.stack||e.message);return}if(this.v.ga){a=setTimeout;b=this.Sb;this.Z=ra();c=this.Db;this.ua&&(c=Math.round(c*this.ua/this.Ba));var c=c-(this.Z-this.za),d=this.Z-this.R;d&&(this.Y=Math.round(this.T/(10*d))/100,864E5<=d&&(this.ea=0,Lc(this)));if(0>c||this.Y<this.kb)-1E3>c&&(this.R-=c),c=0;this.nb+=this.ua;this.Z+=c;a(b,c)}}};
|
|
|
|
|
k.vb=function(a){if(ib(this))return!1;if(this.v.ga)return this.i(this.toString()+" busy"),!1;Lc(this);this.v.ga=!0;this.v.oc=!0;this.qa&&this.qa.start();var b=this.K.run;b&&(b.textContent="Halt");this.D&&(a&&this.D.Nb(!0),this.D.start(this.R,Jc(this)));N(this,!0);setTimeout(this.Sb,0);return!0};k.wb=function(){return 0};
|
|
|
|
|
k.ja=function(a){if(this.v.ga){id(this);Mc(this,this.T);this.T=0;this.v.ga=!1;this.qa&&this.qa.stop();var b=this.K.run;b&&(b.textContent="Run");this.D&&this.D.stop(ra(),Jc(this));N(this)}this.v.complete=a};function N(a,b){a.D&&a.D.Fa(b)}
|
|
|
|
|
function jd(a){this.Vc=+a.model||1170;this.hc=a.resetAddr||0;Cc.call(this,a,6666667);this.Cb=0;this.decode=kd.bind(this);this.U=65536;this.V=32768;this.aa=65535;this.W=32768;this.O=15;this.u=[0,0,0,0,0,0,0,this.hc];this.Pa=[0,0,0,0,0,0];this.ya=[0,0,0,0];this.xa=this.B=0;this.na=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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,0,0,0,0,
|
|
|
|
|
0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.Mb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.gc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.g=this.f=this.fb=this.H=this.I=this.C=0;this.ib=70;this.ma=-1;ld(this);this.v.complete=this.v.Nc=!1}y(jd,Cc);k=jd.prototype;k.reset=function(){this.v.ga&&this.ja();ld(this);Fc(this);this.v.error=!1;this.parent.reset.call(this)};
|
|
|
|
|
function ld(a){a.Za=255;a.J=0;a.lc=0;a.G=0;a.Ya=0;a.Yb=0;a.lb=0;a.Tb=0;a.wa=0;a.Ub=[7,7,7,7];a.w=[];a.C|=2;Rb(a)}function Rb(a){a.Tb?(a.zb=65536,a.ba=a.Qc):(a.zb=0,a.ba=a.Pc)}k.wc=function(){return 0};k.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ea,this.Xa]);a.set(2,Kb(this.F));return a.data()};
|
|
|
|
|
k.restore=function(a){var b=a[1];this.ea=b[1];Lc(this,b[3]);a:{b=this.F;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.G){for(var f=0,g=Array(b.G),h=0;h<e.length-1;)for(var l=e[h++],m=e[h++];l--;)g[f++]=m;e=g}f=b.X[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};
|
|
|
|
|
k.pa=function(a,b,c){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":this.K[b]=c;this.Cb++;a=!0;break;default:a=this.parent.pa.call(this,a,b,c)}return a};
|
|
|
|
|
k.Fa=function(a){if(this.Cb&&(a||!this.v.ga||this.v.uc)){for(a=0;a<this.u.length;a++)Kc(this,"R"+a,this.u[a]);a=Sb(this);Kc(this,"PS",a);Kc(this,"NF",a&8?1:0,1);Kc(this,"ZF",a&4?1:0,1);Kc(this,"VF",a&2?1:0,1);Kc(this,"CF",a&1?1:0,1)}if(a=this.K.speed)a.textContent=this.v.ga&&this.Y?this.Y.toFixed(2)+"Mhz":"Stopped"};function md(a){return a.U&65536?1:0}function nd(a){return a.V&32768?2:0}function od(a){return a.aa&65535?0:4}k.Na=function(){return this.W&32768?8:0};
|
|
|
|
|
function pd(a){var b=qd(a,a.u[7]);a.u[7]=a.u[7]+2&65535;return b}function rd(a,b){a.u[7]=b&65535}function L(a,b,c,d,e){for(var f=a.w.length;0<f--;)if(a.w[f].Hc===d){0<f&&(a.w[f-1].La+=a.w[f].La);a.w.splice(f,1);break}if(0<=b){for(f=a.w.length;0<f--;){if(a.w[f].La>b){a.w[f].La-=b;break}b-=a.w[f].La}a.w.splice(f+1,0,{La:b,Ac:c<<5&224,Hc:d,fc:e})}a.C|=2}function Sb(a){return a.O=a.O&63728|a.Na()|od(a)|nd(a)|md(a)}
|
|
|
|
|
function Tb(a,b){a.W=b<<12;a.aa=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.O)&2048)for(var c=a.Pa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Pa[c];a.Pa[c]=d}a.B=b>>14&3;c=a.O>>14&3;a.B!=c&&(a.ya[c]=a.u[6],a.u[6]=a.ya[a.B]);a.C|=2;a.O=b}function P(a,b){a.C&128||(a.W=a.aa=b,a.V=0)}function sd(a,b,c){a.C&128||(a.W=a.aa=a.U=b,a.V=c||0)}function td(a,b,c,d){a.C&128||(a.W=a.aa=a.U=b,a.V=(c^b)&(d^b))}function ud(a,b){a.C&128||(a.W=a.aa=a.U=b,a.V=a.W^a.U>>1)}
|
|
|
|
|
function vd(a,b,c,d){a.C&128||(a.W=a.aa=a.U=b,a.V=(c^d)&(d^b))}k.L=function(a){var b=!1;0>this.ma?this.ma=Sb(this):this.B||(a=4,b=!0);this.G&57344||(this.Ya=63222,this.Yb=a);this.B=0;var c=qd(this,a|65536),d=qd(this,a+2&65535|65536);Tb(this,d&-12289|this.ma>>2&12288);b&&(this.J|=4,this.u[6]=4);wd(this,this.ma);wd(this,this.u[7]);rd(this,c);this.C&=-113;this.ma=-1;throw a;};function xd(a){var b=yd(a),c=yd(a)&-1793;a.O&49152&&(c=c&-225|a.O&63712);rd(a,b);Tb(a,c);a.C&=-17}
|
|
|
|
|
function jc(a,b){var c=b>>13&31;31>c?a.lb&32&&(b=a.Mb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)")):b|=4186112;return b}
|
|
|
|
|
function zd(a,b,c){var d,e,f,g=0;if(c&a.Tb){d=b>>13&a.Ub[a.B];e=a.na[a.B][d];f=(a.na[a.B][d+16]<<6)+(b&8191)&4194303;a.lb&16?3932160<=f&&4186112>f&&(f=jc(a,f&262143)):(f&=262143,253952<=f&&(f|=4186112));3932160>f&&3915776<=f&&(a.J|=32,a.L(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.na[a.B][d]=e;if(4194170!==
|
|
|
|
|
f||a.B)a.wa=a.B,a.xa=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.L(168,16)),a.G&61440||!(4191360>f||4194239<f)||(a.G|=4096,a.G&512&&(a.C|=32)))}else f=b&65535,57344<=f&&(f|=4186112);return f}function kc(a,b){b&1&&(a.J|=64,a.L(4,10));return a.F.Ha(b)}function qd(a,b){return kc(a,zd(a,b,2))}function ic(a,b,c){b&1&&(a.J|=64,a.L(4,10));a.F.nc(b,c&65535)}function yd(a){var b=qd(a,a.u[6]|65536);a.u[6]=a.u[6]+2&65535;return b}
|
|
|
|
|
function wd(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.G&57344||(a.Ya=a.Ya<<8|246);!a.B&&c<=a.Za&&4<c&&(c<=a.Za-32?(a.J|=4,a.u[6]=4,a.L(4,18)):(a.J|=8,a.C|=4));c=zd(a,c|65536,4);ic(a,c,b)}
|
|
|
|
|
function Ad(a,b,c,d){var e,f,g=d&8?0:a.zb;switch(b){case 0:return a.L(4,20),0;case 1:return 6===c&&!a.B&&d&4&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32||65534<=a.u[6]?(a.J|=4,a.u[6]=4,a.L(4,22)):(a.J|=8,a.C|=64)),a.b-=3,7===c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!==c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=qd(a,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=qd(a,e)|g;
|
|
|
|
|
a.b-=8;break;case 6:return e=pd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=pd(a),e=e+a.u[c]&65535,e=qd(a,e|65536)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Ya=a.Ya<<8|f<<3&248|c);6==c&&!a.B&&d&4&&0>=f&&(a.u[6]<=a.Za||65534<=a.u[6])&&(a.u[6]<=a.Za-32?(a.J|=4,a.u[6]=4,a.L(4,24)):(a.J|=8,a.C|=64));return e}k.Pc=function(a,b,c){return Ad(this,a,b,c)};k.Qc=function(a,b,c){return zd(this,Ad(this,a,b,c),c)};
|
|
|
|
|
function Bd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=Ad(a,b,d,2),c&65536||61440!==(a.O&61440)&&(d&=65535),a.B=a.O>>12&3,c=qd(a,d|c&65536),a.B=a.O>>14&3):c=6!=d||(a.O>>2&12288)===(a.O&12288)?a.u[d]:a.ya[a.O>>12&3];return c}function Cd(a,b,c,d){a.G&57344||(a.Ya=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=Ad(a,b,e,4),c&65536||(e&=65535),a.B=a.O>>12&3,e=zd(a,e|c&65536,4),a.B=a.O>>14&3,ic(a,e,d)):6!=e||(a.O>>2&12288)===(a.O&12288)?a.u[e]=d:a.ya[a.O>>12&3]=d}
|
|
|
|
|
function Dd(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.ba(b,c,3),a=a.F.jb(c)):a=a.u[c]&255;return a}function Ed(a,b){var c;b>>=6;var d=a.I=b&7;(b=a.H=(b&56)>>3)?c=kc(a,a.ba(b,d,2)):c=a.u[d];return c}function Fd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return Ad(a,b,c,8)}function Gd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.ba(b,c,3),a=a.F.jb(c)):a=a.u[c]&255;return a}function Hd(a,b){var c,d=a.f=b&7;(b=a.g=(b&56)>>3)?c=kc(a,a.ba(b,d,2)):c=a.u[d];return c}
|
|
|
|
|
function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.fb=a.ba(b,e,7),c=d.call(a,c,a.F.jb(e)),e&1&&a.b--,a.F.Lb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),ic(a,e,d.call(a,c,kc(a,e)))):a.u[e]=d.call(a,c,a.u[e])}function Id(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),d&1&&a.b--,a.F.Lb(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}
|
|
|
|
|
function Jd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?ic(a,a.ba(b,d,4),c):a.u[d]=c&65535;return c}function T(a,b,c){c&&(rd(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
|
|
|
|
k.wb=function(a){this.v.complete=!0;var b=this.v.Nc=this.j&&Kd(this.j),c=a?this.v.oc?0:1:-1;this.v.oc=!1;this.$=this.b=a;do{if(b){if(Ld(this.j,this.u[7],c)){this.ja();break}c=1}if(this.C&&(this.C&112&&(this.C&32?this.L(168,28):this.C&64?this.L(4,30):this.C&16&&this.L(12,32),this.C&=-113),this.C&7))if(this.C&2){this.C&=-3;a=null;for(var d=this.lc&224,e=this.w.length;0<=--e;){if(0<this.w[e].La){this.w[e].La--;this.C|=2;break}if(this.w[e].fc){if(!this.w[e].fc()){this.w.splice(e,1);continue}this.w[e].fc=
|
|
|
|
|
null}this.w[e].Ac>d&&(d=this.w[e].Ac,a=this.w[e],this.w.splice(e,1))}d>(this.O&224)&&(this.C&4&&(this.u[7]=this.u[7]+2&65535,this.C&=-5),a?this.L(a.Hc,26):this.L(160,26))}else this.C&1&&this.C++;this.G&57344||(this.Ya=0,this.Yb=this.u[7]);this.C=this.C&7|this.O&16;this.decode(pd(this))}while(0<this.b);return this.v.complete?this.$-this.b:void 0===this.v.complete?0:-1};La(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new jd(d);eb(d,c)}});
|
|
|
|
|
function Md(a,b){var c=b+a;td(this,c,a,b);return c&65535}function Nd(a,b){var c=b+a;td(this,c<<8,a<<8,b<<8);return c&255}function Od(a,b){a=b<<1;ud(this,a);return a&65535}function Pd(a,b){a=b<<1;ud(this,a<<8);return a&255}function Qd(a,b){a=b&32768|b>>1|b<<16;ud(this,a);return a&65535}function Rd(a,b){a=b&2048|b>>1|b<<8;ud(this,a<<8);return a&255}function Sd(a,b){a=b&~a;P(this,a);return a}function Td(a,b){a=b&~a;P(this,a<<8);return a}function Ud(a,b){a|=b;P(this,a);return a}
|
|
|
|
|
function Vd(a,b){a|=b;P(this,a<<8);return a}function Wd(a,b){a=~b|65536;sd(this,a);return a&65535}function Xd(a,b){a=~b|256;sd(this,a<<8);return a&255}function Yd(a,b){a=b-a;this.C&128||(this.W=this.aa=a,this.V=b&(b^a));return a&65535}function Zd(a,b){a=b-a;var c=a<<8;b<<=8;this.C&128||(this.W=this.aa=c,this.V=b&(b^c));return a&255}function $d(a,b){a=b+a;this.C&128||(this.W=this.aa=a,this.V=a&(b^a));return a&65535}
|
|
|
|
|
function ae(a,b){a=b+a;var c=a<<8;this.C&128||(this.W=this.aa=c,this.V=c&(b<<8^c));return a&255}function be(a,b){a=-b;sd(this,a,a&b&32768);return a&65535}function ce(a,b){a=-b;sd(this,a<<8,(a&b&128)<<8);return a&255}function de(a,b){a=b<<1|this.U>>16&1;ud(this,a);return a&65535}function ee(a,b){a=b<<1|this.U>>16&1;ud(this,a<<8);return a&255}function fe(a,b){a=(this.U&65536|b)>>1|b<<16;ud(this,a);return a&65535}function ge(a,b){a=((this.U&65536)>>8|b)>>1|b<<8;ud(this,a<<8);return a&255}
|
|
|
|
|
function he(a,b){var c=b-a;vd(this,c,a,b);return c&65535}function ie(a,b){var c=b-a;vd(this,c<<8,a<<8,b<<8);return c&255}function je(a,b){this.C&128||(this.W=this.aa=b&65280,this.V=this.U=0);return(b<<8|b>>8)&65535}function ke(a,b){a^=b;P(this,a);return a&65535}
|
|
|
|
|
function le(a){var b=Hd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.U=this.V=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.U=c<<17-b,c>>=b;else if(b)if(16<b)this.V=c,c=0;else{this.U=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.V=32768)}this.u[a]=c&65535;this.W=this.aa=c;this.b-=(this.g?6:7)+b}
|
|
|
|
|
function me(a){var b=Hd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.U=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.U=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.V=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.W=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function U(a){a&1&&(this.U=0);a&2&&(this.V=0);a&4&&(this.aa=1);a&8&&(this.W=0);this.b-=5}
|
|
|
|
|
function ne(a){var b=Hd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.U=this.V=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.W=d>>16):(this.V=32768,this.aa=d>>15|d,this.W=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.W=0,this.V=32768,this.U=65536,this.b-=7}var oe=[0,7,7,10,7,11,9,13];function pe(a){var b=this.b;rd(this,Fd(this,a));this.b=b-oe[this.g]}
|
|
|
|
|
var qe=[0,14,14,17,14,18,16,20];function re(a){var b=this.b,c=Fd(this,a);a=a>>6&7;wd(this,this.u[a]);this.u[a]=this.u[7];rd(this,c);this.b=b-qe[this.g]}var se=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],te=[7,13,13,17,14,18,17,21];function ue(a){var b=Hd(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.C&128||(this.W=b>>16,this.aa=this.W|b,this.V=0,this.U=-32768>b||32767<b?65536:0);this.b-=23}
|
|
|
|
|
function ve(){this.b-=5}function V(a){a&1&&(this.U=65536);a&2&&(this.V=32768);a&4&&(this.aa=0);a&8&&(this.W=32768);this.b-=5}function we(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)rd(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Qe(a){R(this,a,0,je);this.b-=this.g?9:3+(7==this.f?2:0)}function Re(a){R(this,a,Ed(this,a),ke);this.b-=this.g?9:3+(7==this.f?2:0)}function W(){this.L(8,6)}function kd(a){Se[a>>12].call(this,a)}
|
|
|
|
|
var Se=[function(a){Te[a>>8&15].call(this,a)},function(a){var b=Ed(this,a),c=this.b;P(this,Jd(this,a,b));this.b=c-se[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=Ed(this,a);a=Hd(this,a);vd(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,Ed(this,a)&Hd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){R(this,a,Ed(this,a),Sd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?
|
|
|
|
|
2:0)},function(a){R(this,a,Ed(this,a),Ud);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Ed(this,a),Md);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Ue[a>>8&15].call(this,a)},function(a){Ve[a>>8&15].call(this,a)},function(a){var b=Dd(this,a);P(this,Id(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=Dd(this,a)<<8;a=Gd(this,a)<<8;vd(this,b-a,a,b);this.b-=this.g?
|
|
|
|
|
4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,(Dd(this,a)&Gd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Dd(this,a),Td);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Dd(this,a),Vd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){R(this,a,Ed(this,a),he);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},W],Te=
|
|
|
|
|
[function(a){We[a>>4&15].call(this,a)},function(a){T(this,a,!0)},function(a){T(this,a,!od(this))},function(a){T(this,a,od(this))},function(a){T(this,a,!this.Na()==!nd(this))},function(a){T(this,a,!this.Na()!=!nd(this))},function(a){T(this,a,!od(this)&&!this.Na()==!nd(this))},function(a){T(this,a,od(this)||!this.Na()!=!nd(this))},re,re,function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},function(a){Ze[a>>6&3].call(this,a)},function(a){$e[a>>6&3].call(this,a)},W,W],Xe=[function(a){sd(this,
|
|
|
|
|
Jd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Yd);this.b-=this.g?9:3+(7==this.f?2:0)}],Ye=[function(a){R(this,a,0,be);this.b-=this.g?11:6},function(a){R(this,a,md(this)?1:0,Md);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,md(this)?1:0,he);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Hd(this,a);sd(this,a);this.b-=this.g?4:3+(7==this.f?
|
|
|
|
|
2:0)}],Ze=[function(a){R(this,a,0,fe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,de);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Qd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Od);this.b-=this.g?9:3+(7==this.f?2:0)}],$e=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=qd(this,a|65536);rd(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=Bd(this,a,0);wd(this,a);P(this,a);this.b-=11},function(a){var b=yd(this),c=this.b;Cd(this,a,
|
|
|
|
|
0,b);P(this,b);this.b=c-te[this.g]},function(a){P(this,Jd(this,a,this.Na?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],We=[function(a){af[a&15].call(this,a)},W,W,W,pe,pe,pe,pe,function(a){if(a&8)this.L(8,6);else{var b=yd(this);a&=7;rd(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.O&49152||(this.O=this.O&-2017|(a&7)<<5,this.C|=1),this.b-=5):this.L(8,6)},function(a){bf[a&15].call(this,a)},function(a){cf[a&15].call(this,a)},Qe,Qe,Qe,Qe],af=[function(){this.O&49152?(this.J|=128,this.L(4,
|
|
|
|
|
3)):id(this);this.b-=7},function(){this.C|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){xd(this);this.C|=this.O&16;this.b-=13},function(){this.L(12,1);this.b-=5},function(){this.L(16,4);this.b-=25},function(){this.O&49152||(ld(this),this.F.reset());this.b-=667},function(){xd(this);this.b-=13},W,W,W,W,W,W,W,W,W],bf=[ve,function(){this.U=0;this.b-=5},function(){this.V=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.W=0;this.b-=5},U,U,U,U,U,U,U],cf=[ve,function(){this.U=
|
|
|
|
|
65536;this.b-=5},function(){this.V=32768;this.b-=5},V,function(){this.aa=0;this.b-=5},V,V,V,function(){this.W=32768;this.b-=5},V,V,V,V,V,V,V],Ue=[ue,ue,ne,ne,le,le,me,me,Re,Re,W,W,W,W,we,we],Ve=[function(a){T(this,a,!this.Na())},function(a){T(this,a,this.Na())},function(a){T(this,a,!md(this)&&!od(this))},function(a){T(this,a,md(this)||od(this))},function(a){T(this,a,!nd(this))},function(a){T(this,a,nd(this))},function(a){T(this,a,!md(this))},function(a){T(this,a,md(this))},function(){this.L(24,2);
|
|
|
|
|
this.b-=25},function(){this.L(28,5);this.b-=5},function(a){df[a>>6&3].call(this,a)},function(a){ef[a>>6&3].call(this,a)},function(a){ff[a>>6&3].call(this,a)},function(a){gf[a>>6&3].call(this,a)},W,W],df=[function(a){sd(this,Id(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Xd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Zd);this.b-=this.g?9:3+(7==this.f?2:0)}],ef=[function(a){Q(this,a,0,ce);this.b-=
|
|
|
|
|
this.g?11:6},function(a){Q(this,a,md(this)?1:0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,md(this)?1:0,ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=Gd(this,a);sd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],ff=[function(a){Q(this,a,0,ge);this.b-=this.g?9+(this.fb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Rd);this.b-=this.g?9+(this.fb&1):3+(7==this.f?2:0)},function(a){Q(this,a,0,Pd);this.b-=this.g?9:3+(7==
|
|
|
|
|
this.f?2:0)}],gf=[W,function(a){a=Bd(this,a,65536);wd(this,a);P(this,a);this.b-=11},function(a){var b=yd(this),c=this.b;Cd(this,a,65536,b);P(this,b);this.b=c-te[this.g]},W];function hf(a){w.call(this,"ROM",a,hf);this.f=null;this.B=a.addr;this.g=a.size;this.G=a.writable;this.D=a.alias;this.w=a.file;this.H=da(this.w);if(this.w){a=this.w;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.w+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){jf(c,a,b,f)})}}y(hf);
|
|
|
|
|
hf.prototype.Oa=function(a,b,c,d){this.F=b;this.b=c;this.j=d;kf(this)};hf.prototype.Ja=function(){if(this.Ka){if(this.j){var a=this.j,b=this.id,c=this.B,d=this.g,e=this.Ka,f=[],g;for(g in e){var h=e[g];"number"==typeof h&&(e[g]=h={o:h});var l=h.o,m=h.a;if(void 0!==l){var n=f,l=[l>>>0,g],r=qa(n,l,a.sc);0>r&&n.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({xd:b,A:c,Sc:d,Ka:e,rc:f})}delete this.Ka}return!0};hf.prototype.Ia=function(){return!0};
|
|
|
|
|
function jf(a,b,c,d){if(d)a.sa("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.cc,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,h=eval("("+c+")");if(f=h.bytes)a.f=f;else if(f=h.words)for(a.f=Array(2*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255;else if(f=h.data)for(a.f=Array(4*f.length),g=e=0;e<f.length;e++)a.f[g++]=f[e]&255,a.f[g++]=f[e]>>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=h;a.Ka=h.symbols;if(!a.f.length){t("Empty ROM: "+
|
|
|
|
|
b);return}if(1==a.f.length){t(a.f[0]);return}}catch(l){a.sa("ROM data error: "+l.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e<b.length;e++)a.f[e]=aa(b[e],16);kf(a)}}
|
|
|
|
|
function kf(a){if(!hb(a))if(!a.w)G(a);else if(a.f&&a.F){a.g||(a.g=a.f.length);if(a.f.length!=a.g)jb(a,"ROM size ("+p(a.f.length,8,!0)+") does not match specified size ("+p(a.g,8,!0)+")");else{var b;b=a.B;if(Fb(a.F,b,a.g,a.G?1:rc)){var c;for(c=0;c<a.f.length;c++){a.j&&a.j.g++;var d=a.F,e=b+c;d.X[(e&d.g)>>>d.ca].ac(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.D?b.push(a.D):null!=a.D&&a.D.length&&(b=a.D);for(c=0;c<b.length;c++){for(var f=a,d=b[c],e=f.F,g=f.g,h=[],l=f.B>>>
|
|
|
|
|
e.ca;0<g&&l<e.X.length;)h.push(e.X[l++]),g-=e.Ca;e=f.F;f=f.g;g=0;for(d>>>=e.ca;0<f&&d<e.X.length;){l=h[g++];if(!l)break;e.X[d++]=l;f-=e.Ca}}delete a.f}}G(a)}}La(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new hf(d);eb(d,c)}});function lf(a){w.call(this,"RAM",a,lf);this.D=a.addr;this.g=a.size;this.f=!1}y(lf);k=lf.prototype;k.Oa=function(a,b,c,d){this.F=b;this.b=c;this.j=d;G(this)};k.Ja=function(a,b){b||this.reset();return!0};
|
|
|
|
|
k.Ia=function(a){return a?this.save():!0};k.reset=function(){!this.f&&this.g&&Fb(this.F,this.D,this.g,1)&&(this.f=!0);this.f||t("No RAM allocated")};k.save=function(){return null};k.restore=function(){return!0};La(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new lf(d);eb(d,c)}});function mf(a){w.call(this,"Keyboard",a,mf,65536);G(this)}y(mf);mf.prototype.pa=function(){return!1};mf.prototype.Oa=function(a,b,c,d){this.D=a;this.b=c;this.j=d;this.qa=null};
|
|
|
|
|
La(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new mf(d);eb(d,c)}});function Y(a){this.w=this.G=null;this.Z=a.tabSize;this.R=a.charBOL;this.H=0;w.call(this,"SerialPort",a,Y,8388608);var b=a.binding;if("console"==b)this.G="";else{var c;a=nf;b&&(void 0===c&&(c="Panel"),(c=db(c,this.id))&&(b=c.K[b])&&this.pa(null,a,b))}this.I=this.N=null;this.exports={connect:this.zc,receiveData:this.kc}}y(Y);var nf="buffer";k=Y.prototype;
|
|
|
|
|
k.pa=function(a,b,c){var d=this;switch(b){case nf:return this.K[b]=this.w=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.kc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.kc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
|
|
|
|
k.Oa=function(a,b,c,d){this.D=a;this.F=b;this.b=c;this.j=d;var e=this;this.$=Ob(this.b,function(){e.f&128||!e.B.length||(e.Y=e.B.shift(),e.f|=128,e.f&64&&L(e.b,40,4,48))});this.T=function(){e.g|=128;return!!(e.g&64)};Lb(b,this,of);G(this)};
|
|
|
|
|
k.zc=function(){if(!this.I){var a=Ec(this.D,"connection");if(a){var b=a.split("->");if(2==b.length){var c=oa(b[0]);if(c!=this.Pb)return;b=oa(b[1]);if(this.I=cb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.N=d.receiveData){this.status(this.cc+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ja=function(a,b){if(!b)if(this.zc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
|
|
|
|
k.Ia=function(a){return a?this.save():!0};k.reset=function(){pf(this)};k.save=function(){var a=new O(this);a.set(0,[]);return a.data()};k.restore=function(){return pf(this)};function pf(a){a.Y=0;a.f=0;a.g=128;a.B=[];return!0}k.kc=function(a){if("number"==typeof a)this.B.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.B.push(a.charCodeAt(b));else this.B=this.B.concat(a);Pb(this.b,this.$,50);return!0};k.$c=function(){return this.f&65535};k.td=function(a){this.f=this.f&-112|a&111};
|
|
|
|
|
k.Zc=function(){this.f&=-129;0<this.B.length&&Pb(this.b,this.$,50);return this.Y};k.sd=function(){};k.bd=function(){return this.g};k.vd=function(a){128==(this.g&192)&&a&64&&L(this.b,8,4,52,this.T);this.g=this.g&-70|a&69};k.ad=function(){return 0};
|
|
|
|
|
k.ud=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.N&&this.N.call(this.I,a);if(this.w)if(13==a)this.H=0;else if(8==a)this.w.value=this.w.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=pa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.Z||8,c=a-this.H%a,this.Z&&(b=na("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.w.value+=b;this.w.scrollTop=this.w.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.i(this.G),
|
|
|
|
|
this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;L(this.b,100,4,52,this.T)}};var qf={},of=(qf[65392]=[null,null,Y.prototype.$c,Y.prototype.td,"RCSR"],qf[65394]=[null,null,Y.prototype.Zc,Y.prototype.sd,"RBUF"],qf[65396]=[null,null,Y.prototype.bd,Y.prototype.vd,"XCSR"],qf[65398]=[null,null,Y.prototype.ad,Y.prototype.ud,"XBUF"],qf);La(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Y(d);eb(d,c)}});
|
|
|
|
|
function rf(a){w.call(this,"Debugger",a,rf);this.qa=a.base||16;this.Ba=!1;this.Y=this.Aa=this.I=0;this.$=!1;this.B=-1;this.w=[];this.ha={}}y(rf);var sf={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};rf.prototype.xc=function(){return-1};rf.prototype.yc=function(){};
|
|
|
|
|
function tf(a,b,c,d){if(c)if(b){0>a.B&&a.w.length&&(a.B=0);if(0>a.B||b!=a.w[a.B])a.w.splice(0,0,b),a.B=0;a.B--}else a.$?b="end":b=a.w[a.B+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(oa(b.substring(c,f))),c=f+1}}return a}
|
|
|
|
|
function uf(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<<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;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?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 uf(a,b,c){var d;if(b){b=vf(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=oa(n);if(!n){f=!0;break}n=wf(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],q=n.length;l.length&&rf[n]<rf[l[l.length-1]]&&tf(h,l,1);l.push(n);b=b.substr(r+q)}tf(h,l)&&1==h.length||(f=!0);f?c&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&xf(a,null,
|
|
|
|
|
d))}return d}function vf(a,b){for(var c,d=a.Ba?"(":"{",e=a.Ba?")":"}",f=new RegExp(a.Ba?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=uf(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.Y-a.Aa}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
|
|
|
|
function wf(a,b,c,d){var e;null!=b?(e=a.xc(b),0<=e?e=a.yc(e):(e=a.la[b],null==e&&(e=aa(b,a.ea))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
|
|
|
|
function xf(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function yf(a,b){if(b)return xf(a,b,a.la[b]);var c=0;for(b in a.la)xf(a,b,a.la[b]),c++;return 0<c}
|
|
|
|
|
function J(a,b,c,d){switch(a.ea){case 8:a=ca(b,3*c);break;case 10:a=b.toString();break;default:a=p(b,2*c)}d&&"0"==a.charAt(0)&&(a=a.replace(/^0+([0-9A-F]+)$/i,"$1"));return a}
|
|
|
|
|
function zf(a){qf.call(this,a);this.Ba=!0;this.S=Z(0);this.ob=Z(0);this.Z=Z(0);this.G=[];this.f=this.U=this.F=[];Af(this);this.wa=0;Bf(this);this.eb={};Cf(this,a.messages);this.fb=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Gc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Gc(b,a)})}y(zf,qf);
|
|
|
|
|
var Df={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Ef="NONE ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
|
|
|
|
|
Ff={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
|
|
|
|
|
function vf(a,b,c){var d;if(b){b=wf(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=oa(n);if(!n){f=!0;break}n=xf(a,n,null,!1===c);if(void 0===n){f=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],q=n.length;l.length&&sf[n]<sf[l[l.length-1]]&&uf(h,l,1);l.push(n);b=b.substr(r+q)}uf(h,l)&&1==h.length||(f=!0);f?c&&a.i("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&yf(a,null,
|
|
|
|
|
d))}return d}function wf(a,b){for(var c,d=a.Ba?"(":"{",e=a.Ba?")":"}",f=new RegExp(a.Ba?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=vf(a,c[1]);b=b.replace(d+c[1]+e,null!=g?J(a,g):"undefined")}for(;(c=b.match(/\[(.*?)]/))&&!(0<=c[1].indexOf("["));)b=b.replace("["+c[1]+"]","unimplemented");for(;c=b.match(/\$([a-z]+)/i);){d=null;switch(c[1].toLowerCase()){case "ops":d=a.Y-a.Aa}if(null==d)break;b=b.replace(c[0],d.toString())}return b}
|
|
|
|
|
function xf(a,b,c,d){var e;null!=b?(e=a.xc(b),0<=e?e=a.yc(e):(e=a.ha[b],null==e&&(e=aa(b,a.qa))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
|
|
|
|
function yf(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var f=0,g="";if(!f||4<f)f=4;for(var h=0;h<f;h++){g&&(g=","+g);var l=d&255,m=8,n="";m?32<m&&(m=32):m=32;if(null==l||isNaN(l))for(;0<m--;)n="?"+n;else for(;0<m--;)n=(l&1?"1":"0")+n,l>>=1;g=n+g;d>>=8}d=p(c,0,!0)+" "+c+". "+ca(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function zf(a,b){if(b)return yf(a,b,a.ha[b]);var c=0;for(b in a.ha)yf(a,b,a.ha[b]),c++;return 0<c}
|
|
|
|
|
function J(a,b,c,d){switch(a.qa){case 8:a=ca(b,3*c);break;case 10:a=b.toString();break;default:a=p(b,2*c)}d&&"0"==a.charAt(0)&&(a=a.replace(/^0+([0-9A-F]+)$/i,"$1"));return a}
|
|
|
|
|
function Af(a){rf.call(this,a);this.Ba=!0;this.R=Z(0);this.nb=Z(0);this.Z=Z(0);this.H=[];this.f=this.T=this.G=[];Bf(this);this.wa=0;Cf(this);this.fb={};Df(this,a.messages);this.ab=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return Hc(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return Hc(b,a)})}y(Af,rf);
|
|
|
|
|
var Ef={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory","g [#]":"go [to #]",h:"halt","if":"eval expression","int [#]":"request interrupt",k:"stack trace",ln:"list nearest symbol(s)",m:"messages",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine",s:"set options","t [#]":"trace","u [#]":"unassemble","var":"assign variable",ver:"print version"},Ff="NONE ADC ADCB ADD ASL ASLB ASR ASRB BCC BCS BEQ BGE BGT BHI BIC BICB BIS BISB BIT BITB BLE BLOS BLT BMI BNE BPL BPT BR BVC BVS CCC CLC CLCN CLCV CLCVN CLCVZ CLCZ CLCZN CLN CLR CLRB CLV CLVN CLVZ CLVZN CLZ CLZN CMP CMPB COM COMB DEC DECB INC INCB HALT JMP JSR MARK MFPD MFPI MFPS MOV MOVB MTPD MTPI MTPS NEG NEGB NOP RESET ROL ROLB ROR RORB RTI RTS SBC SBCB SCC SEC SECN SECV SECVN SECVZ SECZ SECZN SEN SEV SEVN SEVZ SEVZN SEZ SEZN SUB SWAB SXT TST TSTB WAIT MUL DIV ASH ASHC XOR SOB EMT TRAP SPL IOT RTT MFPT".split(" "),
|
|
|
|
|
Gf={61440:{4096:[62,4032,63],8192:[47,4032,63],12288:[18,4032,63],16384:[14,4032,63],20480:[16,4032,63],24576:[3,4032,63],36864:[63,4032,63],40960:[48,4032,63],45056:[19,4032,63],49152:[15,4032,63],53248:[17,4032,63],57344:[94,4032,63]},65024:{2048:[57,448,63],28672:[100,63,448],29184:[101,63,448],29696:[102,63,448],30208:[103,63,448],30720:[104,448,63],32256:[105,448,8192]},65280:{256:[27,4096],512:[24,4096],768:[10,4096],1024:[11,4096],1280:[22,4096],1536:[12,4096],1792:[20,4096],32768:[25,4096],
|
|
|
|
|
33024:[23,4096],33280:[13,4096],33536:[21,4096],33792:[28,4096],34048:[29,4096],34304:[8,4096],34560:[9,4096],34816:[106],35072:[107]},65472:{64:[56,63],192:[95,63],2560:[39,63],2624:[49,63],2688:[53,63],2752:[51,63],2816:[67,63],2880:[1,63],2944:[77,63],3008:[97,63],3072:[73,63],3136:[71,63],3200:[6,63],3264:[4,63],3328:[58,24576],3392:[60,63],3456:[65,63],3520:[96,63],35328:[40,63],35392:[50,63],35456:[54,63],35520:[52,63],35584:[68,63],35648:[2,63],35712:[78,63],35776:[98,63],35840:[74,63],35904:[72,
|
|
|
|
|
63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}};k=zf.prototype;
|
|
|
|
|
k.Oa=function(a,b,c,d){this.H=b;this.b=c;this.C=a;(a=Dc(a,"messages"))&&Cf(this,a);this.Ib=Ff;Gf(this,function(a){a:{var b=d.H.O,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(Hf(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.H.ca;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Jb[c],n&&d.i(p(n.id,8)+" %"+p(e<<d.H.ca,8)+" %%"+p(n.A,8)+" "+p(n.Ub,
|
|
|
|
|
4,!0)+" "+p(n.size,4,!0)+" "+m),c!=pc&&(c=-1),m=0);a+=d.H.Ca;e++}}});G(this)};
|
|
|
|
|
k.pa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ua=this.K[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Gc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.w.length-1&&(b=d.w[++d.B])):40==a.keyCode&&(0<d.B?b=d.w[--d.B]:(b="",d.B=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.K[b]=c,Fa(c,function(){if(d.ua){var a=d.ua.value;
|
|
|
|
|
d.ua.value="";Gc(d,a,!0);return!0}return!1}),!0;case "step":return this.K[b]=c,Fa(c,function(a){var b=!1;hb(d,!0)||(gb(d,!0),b=d.zb(a?1:0),gb(d,!1));return b}),!0}return!1};k.Tb=function(){this.ua&&this.ua.focus()};k.ba=function(a){a=a&&a.A;null==a&&(a=-1);return a};k.jb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(this.g++,c=this.H,c=c.O[(d&c.g)>>>c.ca].Nb(d&c.f,d),this.g--,b&&If(a,b));return c};
|
|
|
|
|
k.Ha=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(this.g++,c=Kb(this.H,d),this.g--,b&&If(a,b));return c};k.Rb=function(a,b,c){var d=this.ba(a,!0,1);if(-1!==d){this.g++;var e=this.H;e.O[(d&e.g)>>>e.ca].Bb(d&e.f,b&255,d);this.g--;c&&If(a,c);N(this.b,!0)}};k.nb=function(a,b,c){var d=this.ba(a,!0,2);if(-1!==d){this.g++;var e=this.H,f=d&e.f,g=(d&e.g)>>>e.ca;f!=e.f?e.O[g].qc(f,b&65535,d):(e.O[g++].Bb(f,b&255,d),e.O[g&e.C].Bb(0,b>>8&255,d+1));this.g--;c&&If(a,c);N(this.b,!0)}};
|
|
|
|
|
function Z(a){return{A:a,Ga:!1}}function Jf(a){return[a.A,a.Ga]}function Kf(a){return{A:a[0],Ga:a[1]}}function Hf(a,b,c){var d;c=(c?a.S:a.ob).A;if(void 0!==b){d=b=vf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.G.length;c++){var f=a.G[c].Ka[d];if(void 0!==f){d=f.o;void 0!==d&&(e=Z(d));break}}if(d=e)return d;c=uf(a,b,void 0)}null!=c&&(d=Z(c));return d}function Lf(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Mc=sf(a,b.Gc=c[2]))}function If(a,b){null!=a.A&&(a.A+=b||1)}
|
|
|
|
|
function Cf(a,b){a.j=a;a.ka=a.Nc=536870912;a.xa=null;a.za=[];a.g=0;b=sf(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in H){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ka|=H[c],a.i(c+" messages enabled"))}}function Gf(a,b){for(var c in H)if(64==H[c]){a.eb[c]=b;break}}
|
|
|
|
|
k.xc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Mf(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.yc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Pa[a-8]:20>a?b=this.b.ya[a-16]:20==a&&(b=Tb(this.b)));return b};
|
|
|
|
|
k.message=function(a,b){this.g||(b&&(a+=" @"+J(this,Z(this.b.u[7]).A)),this.ka&1073741824?this.za.push(a):this.xa&&a==this.xa||(this.xa=a,this.ka&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,hd(a),a.la=0,N(a))))};
|
|
|
|
|
function Bf(a){var b;if(Jd(a)){if(!a.N||!a.N.length){a.N=Array(1E3);for(b=0;b<a.N.length;b++)a.N[b]=Z();a.qa=0;a.i("instruction history buffer allocated")}if(!a.ma||!a.ma.length)for(a.ma=Array(256),b=0;b<a.ma.length;b++)a.ma[b]=[b,0]}else a.N&&a.N.length&&a.i("instruction history buffer freed"),a.qa=0,a.N=[],a.ma=[]}k.yb=function(a){if(!Nf(this))return!1;this.b.yb(a);return!0};
|
|
|
|
|
k.zb=function(a,b,c){if(!Nf(this))return!1;this.I=0;a||Jd(this)&&Kd(this,this.b.u[7],0);try{a=fd(this.b,a);var d=this.b.zb(a);0<d&&(gd(this.b,a),this.I+=d,Lc(this.b,d,!0),Hc(this.b,d),this.Y++)}catch(e){"number"!=typeof e&&(this.I=0,kb(this.b,e.stack||e.message))}!1!==c&&N(this.b);this.Fa(b||!1);return 0<this.I};k.ja=function(a){this.b&&this.b.ja(a)};k.Fa=function(a){void 0===a&&(a=!0);this.S=Z(this.b.u[7]);a&&1!=this.ha?Of(this):Pf(this)};
|
|
|
|
|
function Nf(a){var b;if(b=a.b&&ib(a.b))b=a.b,b.v.ia?b=!0:(b.i(b.toString()+" not powered"),b=!1);return b&&!a.b.v.ga?!jb(a.b):!1}k.Ja=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};k.Ia=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Bf(this);this.Y=this.Aa=0;this.xa=null;this.I=0;this.S=Z(this.b.u[7]);this.v.ga=!1;Qf(this);a||this.Fa()};
|
|
|
|
|
k.save=function(){var a=new O(this);a.set(0,Jf(this.S));a.set(1,Jf(this.Z));a.set(2,[this.w,this.$,this.ka]);a.set(3,this.G);return a.data()};k.restore=function(a){var b=0;void 0!==a[2]&&(this.S=Kf(a[b++]),this.Z=Kf(a[b++]),this.w=a[b][0],"string"==typeof this.w&&(this.w=[this.w]),this.$=a[b][1],this.ka|=a[b][2]);a[3]&&(this.G=a[3]);return!0};k.start=function(a,b){this.ha||this.i("running");this.v.ga=!0;this.Vb=a;this.Wb=b};
|
|
|
|
|
k.stop=function(a,b){if(this.v.ga){this.v.ga=!1;this.I=b-this.Wb;if(!this.ha){b="stopped";if(this.I){a-=this.Vb;var c=0<a?Math.round(1E3*this.I/a):0;b+=" (";Jd(this)&&(b+=this.Y+" opcodes, ",this.Aa-=this.Y,this.Y=0);b+=this.I+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}this.Fa(!0);this.Tb();Qf(this,this.b.u[7])}};function Jd(a){return 1<a.f.length||!!a.wa}
|
|
|
|
|
function Kd(a,b,c){var d=a.b;if(0<c&&(a.wa&&!--a.wa||yc(a,b,1,a.f)))return!0;0<=c&&a.ma.length&&(a.Y++,a.g++,b=Kb(a.H,b),a.g--,null!=b&&(b=a.N[a.qa],b.A=d.u[7],b.Ga=!1,++a.qa==a.N.length&&(a.qa=0)));return!1}function Af(a){var b,c;a.f=["bp"];if(a.U)for(b=1;b<a.U.length;b++){c=a.U[b];var d=a.H;c=a.ba(c);zc(d.O[c>>>d.ca],!1)}a.U=["br"];if(a.F)for(b=1;b<a.F.length;b++)c=a.F[b],d=a.H,c=a.ba(c),zc(d.O[c>>>d.ca],!0);a.F=["bw"];a.Cb=0}
|
|
|
|
|
k.gb=function(a,b,c){var d=!0;c||Rf(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.i("invalid address: "+J(this,b.A)),d=!1;else{var f=this.H;f.O[e>>>f.ca].gb(e&f.f,a==this.F)}}d&&(a.push(b),c?b.Ga=!0:(Sf(this,a,a.length-1,"set"),Bf(this)));return d};function Rf(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Ga)){f=!0;h.Ga||e||Sf(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.H,zc(d.O[c>>>d.ca],b==a.F));h.Ga||Bf(a);break}}return f}
|
|
|
|
|
function Tf(a,b){for(var c=1;c<b.length;c++)Sf(a,b,c);return b.length-1}function Sf(a,b,c,d){c=b[c];a.i(b[0]+" "+J(a,c.A)+(d?" "+d:c.Gc?' "'+c.Gc+'"':""))}function Qf(a,b){if(void 0!==b)yc(a,b,1,a.f,!0),a.ha=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ga){if(!Rf(a,a.f,c,!0))break;b=0}}}
|
|
|
|
|
function yc(a,b,c,d,e){var f=!1;if(!a.Cb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ga)for(var l=a.ba(h),m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ga&&(Rf(a,d,h,!0),e=!0);if(n=h.Mc){for(var f=!1,r=0;r<n.length;r++)if(!Uf(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var q=r+1;q<n.length&&n[q].indexOf("else");q++)r++;if(q==n.length){f=!0;break}}a.b.v.ga||(f=!0)}if(f){e||Sf(a,d,g,"hit");break}}}a.Cb--;return f}
|
|
|
|
|
function Vf(a,b,c,d){var e=Z(b.A),f=a.Ha(b,2),g,h;for(h in a.Ib)if(g=a.Ib[h][f&h])break;g||(g=[0]);for(var l=h="",m=Ef[g[0]],n=g.length-1,r=1;r<=n;r++){var q=g[r];if(void 0!==q){var u;u=a;var z=q,q=b,v="",A=z&61440;if(4096==A)q=q.A+((f&255)<<24>>23)&65535,v=J(u,q);else if(8192==A)q=q.A-((f&63)<<1)&65535,v=J(u,q);else if(12288==A)v=J(u,f&7,1);else if(24576==A)v=J(u,f&63,1);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:v=Mf(z);break;case 8:v="@"+Mf(z);break;case 16:7>z?v="("+Mf(z)+
|
|
|
|
|
")+":(A=u.Ha(q,2),v="#"+J(u,A,0,!0));break;case 24:7>z?v="@("+Mf(z)+")+":(A=u.Ha(q,2),v="@#"+J(u,A,0,!0));break;case 32:v="-("+Mf(z)+")";break;case 40:v="@-("+Mf(z)+")";break;case 48:A=u.Ha(q,2);v=J(u,A,0,!0)+"("+Mf(z)+")";7==z&&(v=[v,J(u,A+q.A&65535)]);break;case 56:A=u.Ha(q,2),v="@"+J(u,A)+"("+Mf(z)+")",7==z&&(v=[v,J(u,A+q.A&65535)])}u=v;if(!u||!u.length){h="INVALID";break}"string"!=typeof u&&(l=u[1],u=u[0]);0<h.length&&(h+=",");h+=u||"???"}}f="";g=J(a,e.A)+":";if(-1!==e.A&&-1!==b.A){do if(f+=" "+
|
|
|
|
|
J(a,a.Ha(e,2)),null==e.A)break;while(e.A!=b.A)}g+=na(f,24);g+=na(m,5);h&&(g+=" "+h);if(c||l)g=na(g,60)+";"+(c||""),g=a.b.v.qb?g+("cycles="+Ic(a.b).toString()+" cs="+p(a.b.Kb)):g+(null!=d?"="+d.toString():""),l&&(g+=" @"+l);return g}function Wf(a,b){switch(b){case "N":a=a.b.Na();break;case "Z":a=nd(a.b);break;case "V":a=md(a.b);break;case "C":a=ld(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
|
|
|
|
function Xf(a,b){var c="",d=a.b;8>b?(c=Mf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Pa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.ya[b-16]):20==b&&(c="PS="+J(a,Tb(d)));c&&(c+=" ");return c}function Yf(a){var b,c="";for(b=0;6>b;b++)c+=Xf(a,b);c=c+"\n"+(Xf(a,6)+Xf(a,7)+Xf(a,20));return c+=Wf(a,"T")+Wf(a,"N")+Wf(a,"Z")+Wf(a,"V")+Wf(a,"C")}k.tc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
|
|
|
|
function Zf(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.G.length;b++){var f=a.G[b],g=f.A>>>0,h=f.Tc;if(e>=g&&e<g+h){e=qa(f.rc,[e-g],a.tc);0<=e?$f(a,b,e,d):c&&(e=~e,$f(a,b,e-1,d),$f(a,b,e,d));break}}return d}function $f(a,b,c,d){var e={},f=a.G[b].rc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.G[b].Ka[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
|
|
|
|
|
function ag(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return yf(a)||a.i("no variables"),!0;if(!c[2])return yf(a,c[1]);if(!c[3])return delete a.la[c[1]],!0;b=uf(a,c[3]);return void 0!==b?(a.la[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
|
|
|
|
function bg(a,b,c){var d=null;if(b=Hf(a,b,!0)){a.ba(b);var e=Zf(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.A-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.i(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.A)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
|
|
|
|
|
function Of(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}f=uf(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":qd(d,f);a.S=Z(d.u[7]);break;case "N":d.X=f?32768:0;break;
|
|
|
|
|
case "Z":d.aa=f?0:1;break;case "V":d.W=f?32768:0;break;case "C":d.V=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}N(d);a.i("updated registers:")}a.i(Yf(a));c&&(a.S=Z(d.u[7]),Pf(a,J(a,a.S.A)))}}function cg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):xf(a,null,c[2].charCodeAt(0)):uf(a,b,!0)}
|
|
|
|
|
function dg(a,b,c){var d="t"!=b;c=wf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ea(c,function(){return gb(a,!0)&&a.zb(e,d,!1)},function(){N(a.b);gb(a,!1)})}
|
|
|
|
|
function Pf(a,b,c,d){if(b=Hf(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=Hf(a,c,!0);if(!d||d.A<b.A)return;e=d.A-b.A;if(256<e){a.i("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=hb(a,!1)||a.ha?a.I:null;var g=null!=f?"cycles":null,h=Zf(a,b),l=b.A;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Vf(a,b,g,f);a.i(f);a.S=b;e-=b.A-l;c++}}}
|
|
|
|
|
function Uf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.$&&(a.i("ended assemble at "+J(a,a.Z.A)),a.S=a.Z,a.$=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(ib(a)&&0<b.length){a.$&&(b="a "+J(a,a.Z.A)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var r=
|
|
|
|
|
Hf(a,g[1],!0);if(r)if(a.Z=r,void 0===g[2])a.i("begin assemble at "+J(a,r.A)),a.$=!0,N(a.b);else{var q;a.i("not supported yet");q=[];if(q.length){for(var u=0;u<q.length;u++)a.Rb(r,q[u],1);a.i(Vf(a,a.Z))}}break;case "b":a:{var z=g[0],v=g[1],A=b;if("?"==v)a.i("breakpoint commands:"),a.i("\tbp [a]\tset exec breakpoint at addr [a]"),a.i("\tbr [a]\tset read breakpoint at addr [a]"),a.i("\tbw [a]\tset write breakpoint at addr [a]"),a.i("\tbc [a]\tclear breakpoint at addr [a]"),a.i("\tbl\tlist all breakpoints"),
|
|
|
|
|
a.i("\tbn [n]\tbreak after [n] instruction(s)");else{var ya=z.charAt(1);if("l"==ya){var Nc;Nc=0+Tf(a,a.f);Nc+=Tf(a,a.U);(Nc+=Tf(a,a.F))||a.i("no breakpoints")}else if("n"==ya)a.wa=wf(a,v),a.i("break after "+a.wa+" instruction(s)");else if(void 0===v)a.i("missing breakpoint address");else{var S=Z();if("*"!=v&&(S=Hf(a,v,!0),!S))break a;"c"==ya?null==S.A?(Af(a),a.i("all breakpoints cleared")):Rf(a,a.f,S)||Rf(a,a.U,S)||Rf(a,a.F,S)||a.i("breakpoint missing: "+J(a,S.A)):null!=S.A&&(Lf(a,S,A),"p"==ya?a.gb(a.f,
|
|
|
|
|
S):"r"==ya?a.gb(a.U,S):"w"==ya?a.gb(a.F,S):a.i("unknown breakpoint command: "+ya))}}}break;case "c":a.hb&&(a.hb.value="");break;case "d":a:{var Na,Oa=g[0],ia=g[1],za=g[2],wg=g[3];if("?"==ia){var Pa="";for(Na in H)a.eb[Na]&&(Pa&&(Pa+=","),Pa+=Na);Pa+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");Pa.length&&
|
|
|
|
|
a.i("dump extension commands:\n\t"+Pa)}else if("state"==ia){var we=eg(a.C,!0);"console"==za?console.log(we):(a.hb&&(a.hb.value=""),a.i(we))}else if("symbols"==ia)for(var Oc=0;Oc<a.G.length;Oc++){var Pc=a.G[Oc],Qa;for(Qa in Pc.Ka)if("."!=Qa.charAt(0)){var xe=Pc.Ka[Qa].o;if(void 0!==xe){var ye=Pc.Ka[Qa].l;ye&&(Qa=ye);a.i(J(a,xe)+" "+Qa)}}}else{if("d"==Oa){for(Na in H)if(g[1]==Na){var ze=a.eb[Na];ze?(g.shift(),g.shift(),ze(g)):a.i("no dump registered for "+ia);break a}ia||(Oa=a.ic||"db")}else a.ic=Oa;
|
|
|
|
|
if("dh"==Oa){var Ae=ia,Be=za,Ce="",De=0,ba=a.qa,ja=a.N;if(ja.length){var X=+Ae||a.Fb,lb=+Be||10;isNaN(X)?X=lb:Ce="more ";X>ja.length&&(a.i("note: only "+ja.length+" available"),X=ja.length);ba-=X;0>ba&&(null==ja[ja.length-1].A?(X=ba+X,ba=0):ba+=ja.length);var Qc=[];"call"==Be&&(lb=1E5,Qc=["CALL"]);for(void 0!==Ae&&a.i(X+" instructions earlier:");0<lb&&ba!=a.qa;){var Ee=ja[ba++];if(null==Ee.A)break;var mb=Z(Ee.A),xg=X--,Fe=Vf(a,mb,"history",xg);(!Qc.length||0<=Fe.indexOf(Qc[0]))&&a.i(Fe);mb.fc&&(ba+=
|
|
|
|
|
mb.fc,lb-=mb.fc,X-=mb.fc);ba>=ja.length&&(ba=0);a.Fb=X;De++;lb--}}De||(a.i("no "+Ce+"history available"),a.Fb=void 0)}else{var Zb=Hf(a,ia);if(Zb){var $b=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||wg),$b=wf(a,za)>>>0,65536<$b&&($b=65536));for(var nb="",Ra="dd"==Oa?4:"dw"==Oa?2:1,ac=Ra*$b||128,yg=ac+15>>4||1;yg--&&0<ac;){var ob=0,Rc=0,pb,Sc="",Ge="",ia=J(a,Zb.A);for(pb=4==Ra?16:a.ea;0<pb&&0<ac;pb--){var bc=a.jb(Zb,1),ob=ob|bc<<(Rc++<<3);Rc==Ra&&(Sc+=8==a.ea?ca(ob,3*Ra):p(ob,2*Ra),Sc+=1==Ra?9==pb?"-":
|
|
|
|
|
" ":" ",ob=Rc=0);Ge+=32<=bc&&128>bc?String.fromCharCode(bc):".";ac--}nb&&(nb+="\n");nb+=ia+" "+Sc+(0==pb?" "+Ge:"")}nb&&a.i(nb);a.ob=Zb}}}}break;case "e":if("else"==g[0])break;var Sa,Tc,Uc,Vc,Wc=g[0],Xc=g[1];"eb"==Wc?(Sa=1,Tc=255,Uc=a.jb,Vc=a.Rb):"e"==Wc||"ew"==Wc?(Sa=2,Tc=65535,Uc=a.Ha,Vc=a.nb):Xc=null;if(null==Xc)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var cc=Hf(a,Xc);if(cc)for(var dc=2;dc<g.length;dc++){var qb=
|
|
|
|
|
uf(a,g[dc]);if(void 0===qb){a.i("unrecognized value: "+g[dc]);break}qb&~Tc&&a.i("warning: "+p(qb)+" exceeds "+Sa+"-byte value");var zg=Uc.call(a,cc);a.i("changing "+J(a,cc.A)+" from "+J(a,zg,Sa)+" to "+J(a,qb,Sa));Vc.call(a,cc,qb,Sa)}}break;case "g":a:{var He=g[1],Ag=b;if(void 0!==He){var Yc=Hf(a,He,!0);if(!Yc)break a;Lf(a,Yc,Ag);a.gb(a.f,Yc,!0)}a.yb(!0)||c||a.i("cpu busy or unavailable, run command ignored")}break;case "h":a.v.ga?(c||a.i("halting"),a.ja()):hb(a,!0)||c||a.i("already halted");break;
|
|
|
|
|
case "i":if("if"==g[0]){var Zc;var rb=b.substr(2),rb=oa(rb);uf(a,rb)?(c||a.i("true: "+rb),Zc=!0):(c||a.i("false: "+rb),Zc=!1);Zc||(d=!1);break}f=!0;break;case "k":var Bg=g[0];if("?"==g[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var $c=0,ad=Z(),sb=Z(a.b.u[6]);for(a.i("stack trace for "+J(a,sb.A));10>$c;){for(var Aa=null,Cg=256;65536>sb.A>>>0;){ad.A=a.Ha(sb,2);if(null==sb.A||!Cg--)break;if(!(ad.A&1)){for(var Dg=a,ec=ad,Ie=null,tb=ec.A,
|
|
|
|
|
Je=tb,bd=1;6>=bd&&tb;bd++){if(2<bd){ec.A=tb;var fc=Vf(Dg,ec);if(0<=fc.indexOf("JSR")){var Ke=fc.indexOf(" ");if(tb+(fc.indexOf(" ",Ke+1)-Ke-1)/2==Je){Ie=fc;break}}}tb-=2}ec.A=Je;if(Aa=Ie)break}}if(!Aa||null==Aa)break;var Le=null;if("ks"==Bg){var Me=Aa.match(/[0-9A-F]+$/);Me&&(Le=bg(a,Me[0]))}Aa=na(Aa,50)+" ;"+(Le||"stack="+J(a,sb.A));a.i(Aa);$c++}$c||a.i("no return addresses found")}break;case "l":if("ln"==g[0]){bg(a,g[1],!0);break}f=!0;break;case "m":a:{var ka,la=null,C=g[1];"?"==C&&(C=void 0);
|
|
|
|
|
if(void 0!==C){var ta=0;if("all"==C)ta=1878917119,C=null;else if("on"==C)la=!0,C=null;else if("off"==C)la=!1,C=null;else{"keys"==C&&(C="key");"kbd"==C&&(C="keyboard");for(ka in H)if(C==ka){ta=H[ka];la=!!(a.ka&ta);break}if(!ta){a.i("unknown message category: "+C);break a}}if(ta)if("on"==g[2])a.ka|=ta,la=!0;else if("off"==g[2]&&(a.ka&=~ta,la=!1,1073741824==ta)){for(var cd=0;cd<a.za.length;cd++)a.i(a.za[cd]);a.za=[]}}var Eg=0,ub="";for(ka in H)if(!C||C==ka){var Fg=!!(a.ka&H[ka]);if(null===la||la==Fg)ub&&
|
|
|
|
|
(ub+=","),++Eg%10||(ub+="\n\t"),"key"==ka&&(ka="keys"),ub+=ka}void 0===C&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==la?la?"messages on: ":"messages off: ":"message categories:\n\t")+(ub||"none"));Bf(a)}break;case "p":if("print"==g[0]){cg(a,b.substr(5));break}var Gg="pr"==g[0]?1:0;if(a.ha)a.i("step in progress");else{var Ne=Z(a.b.u[7]);a.jb(Ne);a.ha?(a.gb(a.f,Ne,!0),a.yb()||(a.C&&a.C.Tb(),a.ha=0)):dg(a,Gg?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();
|
|
|
|
|
break}Of(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var vb=+g[2];if(8==vb||10==vb||16==vb)a.ea=vb;else{a.i("invalid base: "+vb);break}}a.i("default base: "+a.ea);break;case "cs":var wb;void 0!==g[3]&&(wb=+g[3]);switch(g[2]){case "int":a.b.sb=wb;break;case "start":a.b.Lb=wb;break;case "stop":a.b.tb=wb;break;default:a.i("unknown cs option");break a}void 0!==wb&&Fc(a.b);a.i("checksums "+(a.b.v.qb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Kc(a.b,+g[2])||a.i("warning: using 1x multiplier, previous target not reached"));
|
|
|
|
|
a.i("target speed: "+(a.b.kb.toFixed(2)+"Mhz")+" ("+a.b.Xa+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":dg(a,g[0],g[1]);break;case "u":Pf(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ag(a,
|
|
|
|
|
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.i("PDPjs version 1.30.1 ("+a.b.Wc+",RELEASE"+(xb?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){cg(a,b.substr(1));break}var dd="commands:",ed;for(ed in Df)dd+="\n"+na(ed,9)+Df[ed];Jd(a)||(dd+="\nnote: history disabled if no exec breakpoints");a.i(dd);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(Oe){a.i("debugger error: "+(Oe.stack||Oe.message)),d=!1}return d}
|
|
|
|
|
function Gc(a,b,c){b=sf(a,b,c);for(var d in b)if(!Uf(a,b[+d]))return!1;return!0}La(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new zf(d);fb(d,c)}});
|
|
|
|
|
function fg(a,b,c){w.call(this,"Computer",a,fg,67108864);this.v.ia=!1;gg(this,b);this.S=Dc(this,"autoPower",a);this.C=0;this.ea=a.busWidth||a.buswidth;this.f=hg;this.I=null;this.F=this.Z=!1;this.url=Dc(this,"url")||"";(Math.random()+.1).toString(36);this.g=ig(this);if(this.b=eb("CPU",this.id)){this.j=eb("Debugger",this.id);this.H=new Ab({id:this.dc+".bus",busWidth:this.ea},this.b,this.j);var d,e=cb(this.id);if((this.w=eb("Panel",this.id))&&this.w.hb)for(b=0;b<e.length;b++)d=e[b],d.sa=this.w.sa,d.i=
|
|
|
|
|
this.w.i,d.hb=this.w.hb;this.i("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Oa&&d.Oa(this,this.H,this.b,this.j);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.G=d:this.f=parseInt(d,10));var f;if(a=Dc(this,"state")||(f=!0,a.state))b=this.U=a,f||(this.F=!0,this.f=hg),this.f&&
|
|
|
|
|
(this.N=new O(this,"1.30.1"),jg(this.N)?b=null:delete this.N);!b&&this.f&&(b=kg(this))&&(this.F=!0);if(b){var g=this;ua(b,null,!0,function(a,b,c){c?(g.G=null,g.F=!1,g.sa("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.I=b,g.Z=!0);G(g)})}else G(this);this.K.power||(this.S=!0);!c&&this.S&&lg(this,this.Mb)}else t("Unable to find CPU component")}y(fg);var hg=0;
|
|
|
|
|
function gg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.$=b}function Dc(a,b,c){var d=b.toLowerCase(),d=Wa[b]||Wa[d];void 0===d&&a.$&&(d=a.$[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function lg(a,b,c){for(var d=cb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ib(f)){ib(f,function(){lg(a,b,c)});return}}b.call(a,c)}
|
|
|
|
|
function mg(a,b){var c=new O(a,"1.30.1","validate");if(jg(c)&&ng(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.sa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=fg.prototype;
|
|
|
|
|
k.Mb=function(a){void 0===a&&(a=this.f||(this.I?1:hg));if(!this.C){this.C++;var b=!1,c=!1;this.Y=!1;var d=this.N||new O(this,"1.30.1");if(-1==a)b=!0;else if(a>hg){if(jg(d,this.I)){this.B=new O(this,"1.30.1","failsafe");jg(this.B)&&(og(this,d),a=2,pg(this.B));this.B.set("timestamp",sa());qg(this.B);var e=this.f&&!this.F;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ng(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?jg(d,g):("error"==
|
|
|
|
|
f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.g=null)):this.i(f+": "+g),pg(d),jg(d)?(c=ng(d),e=!0):c=!1))}e&&mg(this,c?d:null)}else 2==a&&d.clear()}else mg(this);delete this.I;delete this.N}e=cb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=rg(this,g,d,b,c));b=[d,a,c];-1!=a?lg(this,this.vc,b):this.vc(b)}};
|
|
|
|
|
function rg(a,b,c,d,e){if(!b.v.ia){b.v.ia=!0;if(b.Ja){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ja(f,d)&&f&&(t("Unable to restore state for "+b.type),a.U&&!a.Z?(c.clear(),a.f=hg,window&&window.location.reload()):a.Y=!0,b.Ja(null),e=!1)}if(!d&&b.sc)for(a=b.sc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
|
|
|
k.vc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ha=!0;this.v.ia=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(rg(this,this.b,b,c,a),this.b.Eb());this.Y&&(og(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
|
|
|
|
|
function og(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.url;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
|
|
|
function eg(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ja(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var h=cb(a.id),l=0;l<h.length;l++){var m=h[l];m.v.ia&&(m.Ia&&(d=m.Ia(b,c),"object"===typeof d&&f.set(m.id,
|
|
|
|
|
d)),c&&(m.v.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&sg(a,a.g,f.toString()),qg(g)&&qg(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.v.ia=!1,b=a.K.power)&&(b.textContent="Power");a.C=0;return e}k.reset=function(){this.H&&this.H.reset&&(E(this,"Resetting "+this.H.type),this.H.reset());for(var a=cb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.H&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}};
|
|
|
|
|
k.start=function(a,b){for(var c=cb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};k.stop=function(a,b){for(var c=cb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
|
|
|
|
k.pa=function(a,b,c){var d=this;switch(b){case "power":return this.K[b]=c,c.onclick=function(){d.C||(d.v.ia?eg(d,!1,!0):lg(d,d.Mb))},!0;case "reset":return this.K[b]=c,c.onclick=function(){if(d.v.ia&&!d.C)if(d.f&&!d.G){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");eg(d,a,!0);!a&&d.U?window&&window.location.reload():d.Mb(hg)}else d.reset(),d.b&&d.b.Eb()},!0;case "save":if(fa())c.parentNode.removeChild(c);else return this.K[b]=
|
|
|
|
|
c,c.onclick=function(){var a=ig(d,!0);if(a){var b=!!(d.f&&!d.G||d.U),c=eg(d,b);b?sg(d,a,c):d.sa("Resume disabled, machine state not saved")}},!0}return!1};
|
|
|
|
|
function ig(a,b){var c=a.g;c||((c=Ba("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=tg(a,c))||a.sa("The user ID is invalid.")):b&&a.sa("Browser local storage is not available"));return c}
|
|
|
|
|
function tg(a,b){a.g=null;b=ua(ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ca("user",b.data),a.g=b.data)}catch(d){t(d.message+" ("+c+")")}return a.g}function kg(a){var b=null;a.g&&(b=ga()+"/api/v1/user?req=load&user="+a.g+"&state="+ug(a,"1.30.1"));return b}
|
|
|
|
|
function sg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ug(a,"1.30.1");d.data=c;b=ua(ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.sa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.sa(c),Ca("user",""),a.g=null)}}k.Tb=function(){};
|
|
|
|
|
k.Fa=function(a){this.b&&this.b.Fa(a);this.w&&this.w.Fa(a)};La(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new fg(g,d,!0);fb(g,f);g.S&&lg(g,g.Mb)}});Ga.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=eb("Computer",c.id))&&c.ha&&!c.v.ia&&c.Mb(-1)}});
|
|
|
|
|
Ga.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=eb("Computer",c.id))&&c.v.ia&&eg(c,!(!c.f||c.G),!0)}});function O(a,b,c){this.id=a.id;this.key=ug(a,b,c);this.j=a.j;pg(this,a.Qc)}function ug(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
|
|
|
|
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){pg(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
|
|
|
|
1);c=0}}};function pg(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function qg(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);Ca(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ng(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function jg(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:xa()&&(b=Ba(a.key))?(a[a.id]=b,a.b=!0):!1}var vg=0;
|
|
|
|
|
function Hg(a,b,c,d,e,f){e("Loading "+a+"...");ua(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Ig(h,a,b,c,d,e,f)})}
|
|
|
|
|
function Ig(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(bb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
|
|
|
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Jg(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
|
|
|
function Jg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(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);Jg(a,b,c)}})}else c(a,null)}
|
|
|
|
|
function Kg(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=ma(a))}function f(a){e("Error: "+a);l&&(--vg||Ta(!0));l=!1}var g,h,l=!0;vg++;ab[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/pdp11/1.30.1/components.xsl");m=function(d,h){h?Hg(c,null,null,!1,e,function(d,l){l?(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--vg||Ta(!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),--vg||Ta(!0)):f("invalid machine element: "+
|
|
|
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Hg(b,a,d,!0,e,m):Ig(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(q){f(q.message)}return l}window.embedPDP11=function(a,b,c,d){Ta(!1);return Kg(a,b,c,d)};window.enableEvents=Ta;window.sendEvent=Ua;})();
|
|
|
|
|
63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}};k=Af.prototype;
|
|
|
|
|
k.Oa=function(a,b,c,d){this.F=b;this.b=c;this.D=a;(a=Ec(a,"messages"))&&Df(this,a);this.Db=Gf;Hf(this,function(a){a:{var b=d.F.X,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(If(d,c));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.F.ca;l=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Ib[c],n&&d.i(p(n.id,8)+" %"+p(e<<d.F.ca,8)+" %%"+p(n.A,8)+" "+p(n.Ob,
|
|
|
|
|
4,!0)+" "+p(n.size,4,!0)+" "+m),c!=qc&&(c=-1),m=0);a+=d.F.Ca;e++}}});G(this)};
|
|
|
|
|
k.pa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ua=this.K[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",Hc(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.w.length-1&&(b=d.w[++d.B])):40==a.keyCode&&(0<d.B?b=d.w[--d.B]:(b="",d.B=-1)),null!=b){var e=b.length;c.value=b;c.setSelectionRange(e,e)}null!=b&&a.preventDefault&&a.preventDefault()},!0;case "debugEnter":return this.K[b]=c,Fa(c,function(){if(d.ua){var a=d.ua.value;
|
|
|
|
|
d.ua.value="";Hc(d,a,!0);return!0}return!1}),!0;case "step":return this.K[b]=c,Fa(c,function(a){var b=!1;gb(d,!0)||(fb(d,!0),b=d.wb(a?1:0),fb(d,!1));return b}),!0}return!1};k.Nb=function(){this.ua&&this.ua.focus()};k.ba=function(a){a=a&&a.A;null==a&&(a=-1);return a};k.jb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(this.g++,c=this.F,c=c.X[(d&c.g)>>>c.ca].ic(d&c.f,d),this.g--,b&&Jf(a,b));return c};
|
|
|
|
|
k.Ha=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(this.g++,c=Jb(this.F,d),this.g--,b&&Jf(a,b));return c};k.Lb=function(a,b,c){var d=this.ba(a,!0,1);if(-1!==d){this.g++;var e=this.F;e.X[(d&e.g)>>>e.ca].ac(d&e.f,b&255,d);this.g--;c&&Jf(a,c);N(this.b,!0)}};k.nc=function(a,b,c){var d=this.ba(a,!0,2);if(-1!==d){this.g++;var e=this.F;e.X[(d&e.g)>>>e.ca].qc(d&e.f,b&65535,d);this.g--;c&&Jf(a,c);N(this.b,!0)}};function Z(a){return{A:a,Ga:!1}}function Kf(a){return[a.A,a.Ga]}
|
|
|
|
|
function Lf(a){return{A:a[0],Ga:a[1]}}function If(a,b,c){var d;c=(c?a.R:a.nb).A;if(void 0!==b){d=b=wf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;c<a.H.length;c++){var f=a.H[c].Ka[d];if(void 0!==f){d=f.o;void 0!==d&&(e=Z(d));break}}if(d=e)return d;c=vf(a,b,void 0)}null!=c&&(d=Z(c));return d}function Mf(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Kc=tf(a,b.Gc=c[2]))}function Jf(a,b){null!=a.A&&(a.A+=b||1)}
|
|
|
|
|
function Df(a,b){a.j=a;a.ka=a.Mc=536870912;a.xa=null;a.za=[];a.g=0;b=tf(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in H){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.ka|=H[c],a.i(c+" messages enabled"))}}function Hf(a,b){for(var c in H)if(64==H[c]){a.fb[c]=b;break}}
|
|
|
|
|
k.xc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function Nf(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.yc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Pa[a-8]:20>a?b=this.b.ya[a-16]:20==a&&(b=Sb(this.b)));return b};
|
|
|
|
|
k.message=function(a,b){this.g||(b&&(a+=" @"+J(this,Z(this.b.u[7]).A)),this.ka&1073741824?this.za.push(a):this.xa&&a==this.xa||(this.xa=a,this.ka&-2147483648&&(this.ja(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,id(a),a.la=0,N(a))))};
|
|
|
|
|
function Cf(a){var b;if(Kd(a)){if(!a.N||!a.N.length){a.N=Array(1E3);for(b=0;b<a.N.length;b++)a.N[b]=Z();a.ma=0;a.i("instruction history buffer allocated")}if(!a.la||!a.la.length)for(a.la=Array(256),b=0;b<a.la.length;b++)a.la[b]=[b,0]}else a.N&&a.N.length&&a.i("instruction history buffer freed"),a.ma=0,a.N=[],a.la=[]}k.vb=function(a){if(!Of(this))return!1;this.b.vb(a);return!0};
|
|
|
|
|
k.wb=function(a,b,c){if(!Of(this))return!1;this.I=0;a||Kd(this)&&Ld(this,this.b.u[7],0);try{a=gd(this.b,a);var d=this.b.wb(a);0<d&&(hd(this.b,a),this.I+=d,Mc(this.b,d,!0),Ic(this.b,d),this.Y++)}catch(e){"number"!=typeof e&&(this.I=0,jb(this.b,e.stack||e.message))}!1!==c&&N(this.b);this.Fa(b||!1);return 0<this.I};k.ja=function(a){this.b&&this.b.ja(a)};k.Fa=function(a){void 0===a&&(a=!0);this.R=Z(this.b.u[7]);a&&1!=this.ea?Pf(this):Qf(this)};
|
|
|
|
|
function Of(a){var b;if(b=a.b&&hb(a.b))b=a.b,b.v.ia?b=!0:(b.i(b.toString()+" not powered"),b=!1);return b&&!a.b.v.ga?!ib(a.b):!1}k.Ja=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};k.Ia=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Cf(this);this.Y=this.Aa=0;this.xa=null;this.I=0;this.R=Z(this.b.u[7]);this.v.ga=!1;Rf(this);a||this.Fa()};
|
|
|
|
|
k.save=function(){var a=new O(this);a.set(0,Kf(this.R));a.set(1,Kf(this.Z));a.set(2,[this.w,this.$,this.ka]);a.set(3,this.H);return a.data()};k.restore=function(a){var b=0;void 0!==a[2]&&(this.R=Lf(a[b++]),this.Z=Lf(a[b++]),this.w=a[b][0],"string"==typeof this.w&&(this.w=[this.w]),this.$=a[b][1],this.ka|=a[b][2]);a[3]&&(this.H=a[3]);return!0};k.start=function(a,b){this.ea||this.i("running");this.v.ga=!0;this.Qb=a;this.Sb=b};
|
|
|
|
|
k.stop=function(a,b){if(this.v.ga){this.v.ga=!1;this.I=b-this.Sb;if(!this.ea){b="stopped";if(this.I){a-=this.Qb;var c=0<a?Math.round(1E3*this.I/a):0;b+=" (";Kd(this)&&(b+=this.Y+" opcodes, ",this.Aa-=this.Y,this.Y=0);b+=this.I+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}this.Fa(!0);this.Nb();Rf(this,this.b.u[7])}};function Kd(a){return 1<a.f.length||!!a.wa}
|
|
|
|
|
function Ld(a,b,c){var d=a.b;if(0<c&&(a.wa&&!--a.wa||zc(a,b,1,a.f)))return!0;0<=c&&a.la.length&&(a.Y++,a.g++,b=Jb(a.F,b),a.g--,null!=b&&(b=a.N[a.ma],b.A=d.u[7],b.Ga=!1,++a.ma==a.N.length&&(a.ma=0)));return!1}function Bf(a){var b,c;a.f=["bp"];if(a.T)for(b=1;b<a.T.length;b++){c=a.T[b];var d=a.F;c=a.ba(c);Ac(d.X[c>>>d.ca],!1)}a.T=["br"];if(a.G)for(b=1;b<a.G.length;b++)c=a.G[b],d=a.F,c=a.ba(c),Ac(d.X[c>>>d.ca],!0);a.G=["bw"];a.zb=0}
|
|
|
|
|
k.gb=function(a,b,c){var d=!0;c||Sf(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.i("invalid address: "+J(this,b.A)),d=!1;else{var f=this.F;f.X[e>>>f.ca].gb(e&f.f,a==this.G)}}d&&(a.push(b),c?b.Ga=!0:(Tf(this,a,a.length-1,"set"),Cf(this)));return d};function Sf(a,b,c,d,e){var f=!1;c=a.ba(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.ba(h)&&(!d||h.Ga)){f=!0;h.Ga||e||Tf(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.F,Ac(d.X[c>>>d.ca],b==a.G));h.Ga||Cf(a);break}}return f}
|
|
|
|
|
function Uf(a,b){for(var c=1;c<b.length;c++)Tf(a,b,c);return b.length-1}function Tf(a,b,c,d){c=b[c];a.i(b[0]+" "+J(a,c.A)+(d?" "+d:c.Gc?' "'+c.Gc+'"':""))}function Rf(a,b){if(void 0!==b)zc(a,b,1,a.f,!0),a.ea=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Ga){if(!Sf(a,a.f,c,!0))break;b=0}}}
|
|
|
|
|
function zc(a,b,c,d,e){var f=!1;if(!a.zb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Ga)for(var l=a.ba(h),m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Ga&&(Sf(a,d,h,!0),e=!0);if(n=h.Kc){for(var f=!1,r=0;r<n.length;r++)if(!Vf(a,n[r],!0)){if(n[r].indexOf("if")){f=!0;break}for(var q=r+1;q<n.length&&n[q].indexOf("else");q++)r++;if(q==n.length){f=!0;break}}a.b.v.ga||(f=!0)}if(f){e||Tf(a,d,g,"hit");break}}}a.zb--;return f}
|
|
|
|
|
function Wf(a,b,c,d){var e=Z(b.A),f=a.Ha(b,2),g,h;for(h in a.Db)if(g=a.Db[h][f&h])break;g||(g=[0]);for(var l=h="",m=Ff[g[0]],n=g.length-1,r=1;r<=n;r++){var q=g[r];if(void 0!==q){var u;u=a;var z=q,q=b,v="",A=z&61440;if(4096==A)q=q.A+((f&255)<<24>>23)&65535,v=J(u,q);else if(8192==A)q=q.A-((f&63)<<1)&65535,v=J(u,q);else if(12288==A)v=J(u,f&7,1);else if(24576==A)v=J(u,f&63,1);else if(A=f&z,z&4032&&(A>>=6,z>>=6),z&63)switch(z=A&7,A&56){case 0:v=Nf(z);break;case 8:v="@"+Nf(z);break;case 16:7>z?v="("+Nf(z)+
|
|
|
|
|
")+":(A=u.Ha(q,2),v="#"+J(u,A,0,!0));break;case 24:7>z?v="@("+Nf(z)+")+":(A=u.Ha(q,2),v="@#"+J(u,A,0,!0));break;case 32:v="-("+Nf(z)+")";break;case 40:v="@-("+Nf(z)+")";break;case 48:A=u.Ha(q,2);v=J(u,A,0,!0)+"("+Nf(z)+")";7==z&&(v=[v,J(u,A+q.A&65535)]);break;case 56:A=u.Ha(q,2),v="@"+J(u,A)+"("+Nf(z)+")",7==z&&(v=[v,J(u,A+q.A&65535)])}u=v;if(!u||!u.length){h="INVALID";break}"string"!=typeof u&&(l=u[1],u=u[0]);0<h.length&&(h+=",");h+=u||"???"}}f="";g=J(a,e.A)+":";if(-1!==e.A&&-1!==b.A){do if(f+=" "+
|
|
|
|
|
J(a,a.Ha(e,2)),null==e.A)break;while(e.A!=b.A)}g+=na(f,24);g+=na(m,5);h&&(g+=" "+h);if(c||l)g=na(g,60)+";"+(c||""),g=a.b.v.ob?g+("cycles="+Jc(a.b).toString()+" cs="+p(a.b.Fb)):g+(null!=d?"="+d.toString():""),l&&(g+=" @"+l);return g}function Xf(a,b){switch(b){case "N":a=a.b.Na();break;case "Z":a=od(a.b);break;case "V":a=nd(a.b);break;case "C":a=md(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
|
|
|
|
function Yf(a,b){var c="",d=a.b;8>b?(c=Nf(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Pa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.ya[b-16]):20==b&&(c="PS="+J(a,Sb(d)));c&&(c+=" ");return c}function Zf(a){var b,c="";for(b=0;6>b;b++)c+=Yf(a,b);c=c+"\n"+(Yf(a,6)+Yf(a,7)+Yf(a,20));return c+=Xf(a,"T")+Xf(a,"N")+Xf(a,"Z")+Xf(a,"V")+Xf(a,"C")}k.sc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
|
|
|
|
function $f(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.H.length;b++){var f=a.H[b],g=f.A>>>0,h=f.Sc;if(e>=g&&e<g+h){e=qa(f.rc,[e-g],a.sc);0<=e?ag(a,b,e,d):c&&(e=~e,ag(a,b,e-1,d),ag(a,b,e,d));break}}return d}function ag(a,b,c,d){var e={},f=a.H[b].rc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.H[b].Ka[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}
|
|
|
|
|
function bg(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return zf(a)||a.i("no variables"),!0;if(!c[2])return zf(a,c[1]);if(!c[3])return delete a.ha[c[1]],!0;b=vf(a,c[3]);return void 0!==b?(a.ha[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
|
|
|
|
function cg(a,b,c){var d=null;if(b=If(a,b,!0)){a.ba(b);var e=$f(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.A-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.i(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.A)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.i(f),d||(d=f))}else c&&a.i("no symbols")}return d}
|
|
|
|
|
function Pf(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=a.b;null==c&&(c=!0);if(b&&1<b.length){var e=b[1],f=e.indexOf("=");if(0<f)b=e.substr(f+1),e=e.substr(0,f);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}f=vf(a,b);if(void 0===f)return;b=e.toUpperCase();switch(b){case "SP":case "R6":d.u[6]=f&65535;break;case "PC":case "R7":rd(d,f);a.R=Z(d.u[7]);break;case "N":d.W=f?32768:0;break;
|
|
|
|
|
case "Z":d.aa=f?0:1;break;case "V":d.V=f?32768:0;break;case "C":d.U=f?65536:0;break;default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}N(d);a.i("updated registers:")}a.i(Zf(a));c&&(a.R=Z(d.u[7]),Qf(a,J(a,a.R.A)))}}function dg(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):yf(a,null,c[2].charCodeAt(0)):vf(a,b,!0)}
|
|
|
|
|
function eg(a,b,c){var d="t"!=b;c=xf(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ea(c,function(){return fb(a,!0)&&a.wb(e,d,!1)},function(){N(a.b);fb(a,!1)})}
|
|
|
|
|
function Qf(a,b,c,d){if(b=If(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=If(a,c,!0);if(!d||d.A<b.A)return;e=d.A-b.A;if(256<e){a.i("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=gb(a,!1)||a.ea?a.I:null;var g=null!=f?"cycles":null,h=$f(a,b),l=b.A;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(g=h[3],f=null);f=Wf(a,b,g,f);a.i(f);a.R=b;e-=b.A-l;c++}}}
|
|
|
|
|
function Vf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.$&&(a.i("ended assemble at "+J(a,a.Z.A)),a.R=a.Z,a.$=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.xa=null;if(hb(a)&&0<b.length){a.$&&(b="a "+J(a,a.Z.A)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");if(g&&g.length)for(var h=g[0],l=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==l||"r"==l||"a">n||"z"<n){g[0]=h.substr(m);g.unshift(h.substr(0,m));break}}g[0]=g[0].toLowerCase();switch(g[0].charAt(0)){case "a":var r=
|
|
|
|
|
If(a,g[1],!0);if(r)if(a.Z=r,void 0===g[2])a.i("begin assemble at "+J(a,r.A)),a.$=!0,N(a.b);else{var q;a.i("not supported yet");q=[];if(q.length){for(var u=0;u<q.length;u++)a.Lb(r,q[u],1);a.i(Wf(a,a.Z))}}break;case "b":a:{var z=g[0],v=g[1],A=b;if("?"==v)a.i("breakpoint commands:"),a.i("\tbp [a]\tset exec breakpoint at addr [a]"),a.i("\tbr [a]\tset read breakpoint at addr [a]"),a.i("\tbw [a]\tset write breakpoint at addr [a]"),a.i("\tbc [a]\tclear breakpoint at addr [a]"),a.i("\tbl\tlist all breakpoints"),
|
|
|
|
|
a.i("\tbn [n]\tbreak after [n] instruction(s)");else{var ya=z.charAt(1);if("l"==ya){var Oc;Oc=0+Uf(a,a.f);Oc+=Uf(a,a.T);(Oc+=Uf(a,a.G))||a.i("no breakpoints")}else if("n"==ya)a.wa=xf(a,v),a.i("break after "+a.wa+" instruction(s)");else if(void 0===v)a.i("missing breakpoint address");else{var S=Z();if("*"!=v&&(S=If(a,v,!0),!S))break a;"c"==ya?null==S.A?(Bf(a),a.i("all breakpoints cleared")):Sf(a,a.f,S)||Sf(a,a.T,S)||Sf(a,a.G,S)||a.i("breakpoint missing: "+J(a,S.A)):null!=S.A&&(Mf(a,S,A),"p"==ya?a.gb(a.f,
|
|
|
|
|
S):"r"==ya?a.gb(a.T,S):"w"==ya?a.gb(a.G,S):a.i("unknown breakpoint command: "+ya))}}}break;case "c":a.hb&&(a.hb.value="");break;case "d":a:{var Na,Oa=g[0],ia=g[1],za=g[2],xg=g[3];if("?"==ia){var Pa="";for(Na in H)a.fb[Na]&&(Pa&&(Pa+=","),Pa+=Na);Pa+=",state,symbols";a.i("dump memory commands:");a.i("\tdb [a] [#] dump # bytes at address a");a.i("\tdw [a] [#] dump # words at address a");a.i("\tdd [a] [#] dump # dwords at address a");a.i("\tdh [#] [#] dump # instructions from history");Pa.length&&
|
|
|
|
|
a.i("dump extension commands:\n\t"+Pa)}else if("state"==ia){var xe=fg(a.D,!0);"console"==za?console.log(xe):(a.hb&&(a.hb.value=""),a.i(xe))}else if("symbols"==ia)for(var Pc=0;Pc<a.H.length;Pc++){var Qc=a.H[Pc],Qa;for(Qa in Qc.Ka)if("."!=Qa.charAt(0)){var ye=Qc.Ka[Qa].o;if(void 0!==ye){var ze=Qc.Ka[Qa].l;ze&&(Qa=ze);a.i(J(a,ye)+" "+Qa)}}}else{if("d"==Oa){for(Na in H)if(g[1]==Na){var Ae=a.fb[Na];Ae?(g.shift(),g.shift(),Ae(g)):a.i("no dump registered for "+ia);break a}ia||(Oa=a.hc||"db")}else a.hc=Oa;
|
|
|
|
|
if("dh"==Oa){var Be=ia,Ce=za,De="",Ee=0,ba=a.ma,ja=a.N;if(ja.length){var X=+Be||a.Cb,lb=+Ce||10;isNaN(X)?X=lb:De="more ";X>ja.length&&(a.i("note: only "+ja.length+" available"),X=ja.length);ba-=X;0>ba&&(null==ja[ja.length-1].A?(X=ba+X,ba=0):ba+=ja.length);var Rc=[];"call"==Ce&&(lb=1E5,Rc=["CALL"]);for(void 0!==Be&&a.i(X+" instructions earlier:");0<lb&&ba!=a.ma;){var Fe=ja[ba++];if(null==Fe.A)break;var mb=Z(Fe.A),yg=X--,Ge=Wf(a,mb,"history",yg);(!Rc.length||0<=Ge.indexOf(Rc[0]))&&a.i(Ge);mb.ec&&(ba+=
|
|
|
|
|
mb.ec,lb-=mb.ec,X-=mb.ec);ba>=ja.length&&(ba=0);a.Cb=X;Ee++;lb--}}Ee||(a.i("no "+De+"history available"),a.Cb=void 0)}else{var Yb=If(a,ia);if(Yb){var Zb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||xg),Zb=xf(a,za)>>>0,65536<Zb&&(Zb=65536));for(var nb="",ob="dd"==Oa?4:"dw"==Oa?2:1,$b=ob*Zb||128,zg=$b+15>>4||1;zg--&&0<$b;){var ac=0,Sc=0,pb,Tc="",He="",ia=J(a,Yb.A);for(pb=4==ob?16:a.qa;0<pb&&0<$b;pb--){var bc=a.jb(Yb,1),ac=ac|bc<<(Sc++<<3);Sc==ob&&(Tc+=J(a,ac,ob),Tc+=1==ob?9==pb?"-":" ":" ",ac=Sc=0);
|
|
|
|
|
He+=32<=bc&&128>bc?String.fromCharCode(bc):".";$b--}nb&&(nb+="\n");nb+=ia+" "+Tc+(0==pb?" "+He:"")}nb&&a.i(nb);a.nb=Yb}}}}break;case "e":if("else"==g[0])break;var Ra,Uc,Vc,Wc,Xc=g[0],Yc=g[1];"eb"==Xc?(Ra=1,Uc=255,Vc=a.jb,Wc=a.Lb):"e"==Xc||"ew"==Xc?(Ra=2,Uc=65535,Vc=a.Ha,Wc=a.nc):Yc=null;if(null==Yc)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var cc=If(a,Yc);if(cc)for(var dc=2;dc<g.length;dc++){var qb=vf(a,g[dc]);
|
|
|
|
|
if(void 0===qb){a.i("unrecognized value: "+g[dc]);break}qb&~Uc&&a.i("warning: "+p(qb)+" exceeds "+Ra+"-byte value");var Ag=Vc.call(a,cc);a.i("changing "+J(a,cc.A)+" from "+J(a,Ag,Ra)+" to "+J(a,qb,Ra));Wc.call(a,cc,qb,Ra)}}break;case "g":a:{var Ie=g[1],Bg=b;if(void 0!==Ie){var Zc=If(a,Ie,!0);if(!Zc)break a;Mf(a,Zc,Bg);a.gb(a.f,Zc,!0)}a.vb(!0)||c||a.i("cpu busy or unavailable, run command ignored")}break;case "h":a.v.ga?(c||a.i("halting"),a.ja()):gb(a,!0)||c||a.i("already halted");break;case "i":if("if"==
|
|
|
|
|
g[0]){var $c;var rb=b.substr(2),rb=oa(rb);vf(a,rb)?(c||a.i("true: "+rb),$c=!0):(c||a.i("false: "+rb),$c=!1);$c||(d=!1);break}f=!0;break;case "k":var Cg=g[0];if("?"==g[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var ad=0,bd=Z(),sb=Z(a.b.u[6]);for(a.i("stack trace for "+J(a,sb.A));10>ad;){for(var Aa=null,Dg=256;65536>sb.A>>>0;){bd.A=a.Ha(sb,2);if(null==sb.A||!Dg--)break;if(!(bd.A&1)){for(var Eg=a,ec=bd,Je=null,tb=ec.A,Ke=tb,cd=1;6>=cd&&
|
|
|
|
|
tb;cd++){if(2<cd){ec.A=tb;var fc=Wf(Eg,ec);if(0<=fc.indexOf("JSR")){var Le=fc.indexOf(" ");if(tb+(fc.indexOf(" ",Le+1)-Le-1)/2==Ke){Je=fc;break}}}tb-=2}ec.A=Ke;if(Aa=Je)break}}if(!Aa||null==Aa)break;var Me=null;if("ks"==Cg){var Ne=Aa.match(/[0-9A-F]+$/);Ne&&(Me=cg(a,Ne[0]))}Aa=na(Aa,50)+" ;"+(Me||"stack="+J(a,sb.A));a.i(Aa);ad++}ad||a.i("no return addresses found")}break;case "l":if("ln"==g[0]){cg(a,g[1],!0);break}f=!0;break;case "m":a:{var ka,la=null,C=g[1];"?"==C&&(C=void 0);if(void 0!==C){var ta=
|
|
|
|
|
0;if("all"==C)ta=1878917119,C=null;else if("on"==C)la=!0,C=null;else if("off"==C)la=!1,C=null;else{"keys"==C&&(C="key");"kbd"==C&&(C="keyboard");for(ka in H)if(C==ka){ta=H[ka];la=!!(a.ka&ta);break}if(!ta){a.i("unknown message category: "+C);break a}}if(ta)if("on"==g[2])a.ka|=ta,la=!0;else if("off"==g[2]&&(a.ka&=~ta,la=!1,1073741824==ta)){for(var dd=0;dd<a.za.length;dd++)a.i(a.za[dd]);a.za=[]}}var Fg=0,ub="";for(ka in H)if(!C||C==ka){var Gg=!!(a.ka&H[ka]);if(null===la||la==Gg)ub&&(ub+=","),++Fg%10||
|
|
|
|
|
(ub+="\n\t"),"key"==ka&&(ka="keys"),ub+=ka}void 0===C&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.i((null!==la?la?"messages on: ":"messages off: ":"message categories:\n\t")+(ub||"none"));Cf(a)}break;case "p":if("print"==g[0]){dg(a,b.substr(5));break}var Hg="pr"==g[0]?1:0;if(a.ea)a.i("step in progress");else{var Oe=Z(a.b.u[7]);a.jb(Oe);a.ea?(a.gb(a.f,Oe,!0),a.vb()||(a.D&&a.D.Nb(),a.ea=0)):eg(a,Hg?"tr":"t")}break;case "r":if("reset"==b){a.D&&a.D.reset();break}Pf(a,
|
|
|
|
|
g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var vb=+g[2];if(8==vb||10==vb||16==vb)a.qa=vb;else{a.i("invalid base: "+vb);break}}a.i("default base: "+a.qa);break;case "cs":var wb;void 0!==g[3]&&(wb=+g[3]);switch(g[2]){case "int":a.b.qb=wb;break;case "start":a.b.Gb=wb;break;case "stop":a.b.rb=wb;break;default:a.i("unknown cs option");break a}void 0!==wb&&Gc(a.b);a.i("checksums "+(a.b.v.ob?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(Lc(a.b,+g[2])||a.i("warning: using 1x multiplier, previous target not reached"));
|
|
|
|
|
a.i("target speed: "+(a.b.kb.toFixed(2)+"Mhz")+" ("+a.b.Xa+"x)");break;default:if(g[1]){a.i("unknown option: "+g[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":eg(a,g[0],g[1]);break;case "u":Qf(a,g[1],g[2],8);break;case "v":if("var"==g[0]){bg(a,
|
|
|
|
|
b.substr(3))||(d=!1);break}if("ver"==g[0]){a.i("PDPjs version 1.30.1 ("+a.b.Vc+",RELEASE"+(kb?",TYPEDARRAYS":",LONGARRAYS")+")");a.i(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){dg(a,b.substr(1));break}var ed="commands:",fd;for(fd in Ef)ed+="\n"+na(fd,9)+Ef[fd];Kd(a)||(ed+="\nnote: history disabled if no exec breakpoints");a.i(ed);break;default:f=!0}f&&(a.i("unknown command: "+b),d=!1)}}catch(Pe){a.i("debugger error: "+(Pe.stack||Pe.message)),d=!1}return d}
|
|
|
|
|
function Hc(a,b,c){b=tf(a,b,c);for(var d in b)if(!Vf(a,b[+d]))return!1;return!0}La(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Af(d);eb(d,c)}});
|
|
|
|
|
function gg(a,b,c){w.call(this,"Computer",a,gg,67108864);this.v.ia=!1;hg(this,b);this.R=Ec(this,"autoPower",a);this.D=0;this.ea=a.busWidth||a.buswidth;this.f=ig;this.I=null;this.G=this.Z=!1;this.url=Ec(this,"url")||"";(Math.random()+.1).toString(36);this.g=jg(this);if(this.b=db("CPU",this.id)){this.j=db("Debugger",this.id);this.F=new zb({id:this.cc+".bus",busWidth:this.ea},this.b,this.j);var d,e=bb(this.id);if((this.w=db("Panel",this.id))&&this.w.hb)for(b=0;b<e.length;b++)d=e[b],d.sa=this.w.sa,d.i=
|
|
|
|
|
this.w.i,d.hb=this.w.hb;this.i("PDPjs v1.30.1\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Oa&&d.Oa(this,this.F,this.b,this.j);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=Ec(this,"state")||(f=!0,a.state))b=this.T=a,f||(this.G=!0,this.f=ig),this.f&&
|
|
|
|
|
(this.N=new O(this,"1.30.1"),kg(this.N)?b=null:delete this.N);!b&&this.f&&(b=lg(this))&&(this.G=!0);if(b){var g=this;ua(b,null,!0,function(a,b,c){c?(g.H=null,g.G=!1,g.sa("Unable to load machine state from server (error "+c+(b?": "+oa(b):"")+")")):(g.I=b,g.Z=!0);G(g)})}else G(this);this.K.power||(this.R=!0);!c&&this.R&&mg(this,this.Hb)}else t("Unable to find CPU component")}y(gg);var ig=0;
|
|
|
|
|
function hg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.$=b}function Ec(a,b,c){var d=b.toLowerCase(),d=Va[b]||Va[d];void 0===d&&a.$&&(d=a.$[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function mg(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!hb(f)){hb(f,function(){mg(a,b,c)});return}}b.call(a,c)}
|
|
|
|
|
function ng(a,b){var c=new O(a,"1.30.1","validate");if(kg(c)&&og(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.sa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=gg.prototype;
|
|
|
|
|
k.Hb=function(a){void 0===a&&(a=this.f||(this.I?1:ig));if(!this.D){this.D++;var b=!1,c=!1;this.Y=!1;var d=this.N||new O(this,"1.30.1");if(-1==a)b=!0;else if(a>ig){if(kg(d,this.I)){this.B=new O(this,"1.30.1","failsafe");kg(this.B)&&(pg(this,d),a=2,qg(this.B));this.B.set("timestamp",sa());rg(this.B);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=og(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?kg(d,g):("error"==
|
|
|
|
|
f&&"no machine state"!=g?(this.sa("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.g=null)):this.i(f+": "+g),qg(d),kg(d)?(c=og(d),e=!0):c=!1))}e&&ng(this,c?d:null)}else 2==a&&d.clear()}else ng(this);delete this.I;delete this.N}e=bb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=sg(this,g,d,b,c));b=[d,a,c];-1!=a?mg(this,this.vc,b):this.vc(b)}};
|
|
|
|
|
function sg(a,b,c,d,e){if(!b.v.ia){b.v.ia=!0;if(b.Ja){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.Ja(f,d)&&f&&(t("Unable to restore state for "+b.type),a.T&&!a.Z?(c.clear(),a.f=ig,window&&window.location.reload()):a.Y=!0,b.Ja(null),e=!1)}if(!d&&b.tc)for(a=b.tc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
|
|
|
k.vc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ha=!0;this.v.ia=!0;var d=this.K.power;d&&(d.textContent="Shutdown");this.b&&(sg(this,this.b,b,c,a),this.b.yb());this.Y&&(pg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.D=0};
|
|
|
|
|
function pg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.url;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
|
|
|
function fg(a,b,c){var d,e="none";if(a.D)return null;a.D--;var f=new O(a,"1.30.1"),g=new O(a,"1.30.1","validate"),h=sa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ia&&(c&&a.b.ja(),d=a.b.Ia(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.ia=!1,!1===d&&(e=null)));for(var h=bb(a.id),l=0;l<h.length;l++){var m=h[l];m.v.ia&&(m.Ia&&(d=m.Ia(b,c),"object"===typeof d&&f.set(m.id,
|
|
|
|
|
d)),c&&(m.v.ia=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&tg(a,a.g,f.toString()),rg(g)&&rg(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.v.ia=!1,b=a.K.power)&&(b.textContent="Power");a.D=0;return e}k.reset=function(){this.F&&this.F.reset&&(E(this,"Resetting "+this.F.type),this.F.reset());for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.F&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}};
|
|
|
|
|
k.start=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};k.stop=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
|
|
|
|
k.pa=function(a,b,c){var d=this;switch(b){case "power":return this.K[b]=c,c.onclick=function(){d.D||(d.v.ia?fg(d,!1,!0):mg(d,d.Hb))},!0;case "reset":return this.K[b]=c,c.onclick=function(){if(d.v.ia&&!d.D)if(d.f&&!d.H){var a=va("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");fg(d,a,!0);!a&&d.T?window&&window.location.reload():d.Hb(ig)}else d.reset(),d.b&&d.b.yb()},!0;case "save":if(fa())c.parentNode.removeChild(c);else return this.K[b]=
|
|
|
|
|
c,c.onclick=function(){var a=jg(d,!0);if(a){var b=!!(d.f&&!d.H||d.T),c=fg(d,b);b?tg(d,a,c):d.sa("Resume disabled, machine state not saved")}},!0}return!1};
|
|
|
|
|
function jg(a,b){var c=a.g;c||((c=Ba("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ug(a,c))||a.sa("The user ID is invalid.")):b&&a.sa("Browser local storage is not available"));return c}
|
|
|
|
|
function ug(a,b){a.g=null;b=ua(ga()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ca("user",b.data),a.g=b.data)}catch(d){t(d.message+" ("+c+")")}return a.g}function lg(a){var b=null;a.g&&(b=ga()+"/api/v1/user?req=load&user="+a.g+"&state="+vg(a,"1.30.1"));return b}
|
|
|
|
|
function tg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=vg(a,"1.30.1");d.data=c;b=ua(ga()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.sa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.sa(c),Ca("user",""),a.g=null)}}k.Nb=function(){};
|
|
|
|
|
k.Fa=function(a){this.b&&this.b.Fa(a);this.w&&this.w.Fa(a)};La(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new gg(g,d,!0);eb(g,f);g.R&&mg(g,g.Hb)}});Ga.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=db("Computer",c.id))&&c.ha&&!c.v.ia&&c.Hb(-1)}});
|
|
|
|
|
Ga.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=db("Computer",c.id))&&c.v.ia&&fg(c,!(!c.f||c.H),!0)}});function O(a,b,c){this.id=a.id;this.key=vg(a,b,c);this.j=a.j;qg(this,a.Rc)}function vg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
|
|
|
|
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){qg(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,
|
|
|
|
|
1);c=0}}};function qg(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function rg(a){var b=!0;if(xa()){var c=JSON.stringify(a[a.id]);Ca(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function og(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function kg(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:xa()&&(b=Ba(a.key))?(a[a.id]=b,a.b=!0):!1}var wg=0;
|
|
|
|
|
function Ig(a,b,c,d,e,f){e("Loading "+a+"...");ua(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):Jg(h,a,b,c,d,e,f)})}
|
|
|
|
|
function Jg(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(ab(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
|
|
|
|
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\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<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?Kg(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
|
|
|
function Kg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(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);Kg(a,b,c)}})}else c(a,null)}
|
|
|
|
|
function Lg(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=ma(a))}function f(a){e("Error: "+a);l&&(--wg||Sa(!0));l=!1}var g,h,l=!0;wg++;$a[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/pdp11/1.30.1/components.xsl");m=function(d,h){h?Ig(c,null,null,!1,e,function(d,l){l?(ab(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--wg||Sa(!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),--wg||Sa(!0)):f("invalid machine element: "+
|
|
|
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Ig(b,a,d,!0,e,m):Jg(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(q){f(q.message)}return l}window.embedPDP11=function(a,b,c,d){Sa(!1);return Lg(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ta;})();
|
|
|
|
|
|