|
|
|
|
@ -40,285 +40,285 @@ function wa(a,b){return(a+" ").slice(0,b)
|
|
|
|
|
function za(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var g=d+e>>1,h;h=c(b,a[g]);0<h?d=g+1:(e=g,f=!h)}return f?d:~d}var Aa=Date.now||function(){return+new Date};function Ba(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
|
|
|
|
function Da(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,f,e))});if(b&&"object"==
|
|
|
|
|
typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");h.open("POST",a,!!c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,!!c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
|
|
|
|
function Ea(a,b){var c,d={ea:null,ga:null,La:null,Ka:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.La=g.load;d.Ka=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]=
|
|
|
|
|
function Ea(a,b){var c,d={ea:null,ga:null,Na:null,Ma:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,f,g;if("<"==b.substr(0,1))throw Error(b);g=0>b.indexOf("0x")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.Na=g.load;d.Ma=g.exec;if(e=g.bytes)d.ea=e;else if(e=g.words)for(d.ea=Array(2*e.length),f=c=0;c<e.length;c++)d.ea[f++]=e[c]&255,d.ea[f++]=e[c]>>8&255;else if(e=g.data)for(d.ea=Array(4*e.length),f=c=0;c<e.length;c++)d.ea[f++]=
|
|
|
|
|
e[c]&255,d.ea[f++]=e[c]>>8&255,d.ea[f++]=e[c]>>16&255,d.ea[f++]=e[c]>>24&255;else d.ea=g;d.ga=g.symbols;d.ea.length?1==d.ea.length&&(q(d.ea[0]),d=null):(q("Empty resource: "+a),d=null)}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.ea=e)}return d}
|
|
|
|
|
function Fa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function q(a){window&&window.alert(a)}function Ga(a){var b=!1;window&&(b=window.confirm(a));return b}var Ha=null;function Ia(){if(null==Ha){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}Ha=a}return Ha}
|
|
|
|
|
function Ja(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ra(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 Sa(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
|
|
|
|
function Ta(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 Ua={init:[],show:[],exit:[]},Va=!1,Wa=!1,Xa=!0;function Ya(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Za(a){Ua.init.push(a)}
|
|
|
|
|
function $a(a){if(Xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ab(a){!Xa&&a?(Xa=!0,Va&&bb("init"),Wa&&bb("show")):Xa=a}function bb(a){Ua[a]&&$a(Ua[a])}Ya("onload",function(){Va=!0;$a(Ua.init)});Ya("onpageshow",function(){Wa=!0;$a(Ua.show)});Ya(Ra("Opera")||Ra("iOS")?"onunload":"onbeforeunload",function(){$a(Ua.exit)});
|
|
|
|
|
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.vc=b.comment;this.Yc=b;b=this.id.indexOf(".");0>b?this.Za=this.id:(this.Qa=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.w={ready:!1,ab:!1,Zb:!1,ha:!1,error:!1};this.Sb=null;this.w.error=!1;this.G={};this.i=null;this.la=d||0;u.push(this)}var cb=void 0,db={};
|
|
|
|
|
function t(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.yc=b.comment;this.Yc=b;b=this.id.indexOf(".");0>b?this.Za=this.id:(this.Sa=this.id.substr(0,b),this.Za=this.id.substr(b+1));this[a]=c;this.w={ready:!1,bb:!1,ac:!1,ha:!1,error:!1};this.Tb=null;this.w.error=!1;this.G={};this.i=null;this.ka=d||0;u.push(this)}var cb=void 0,db={};
|
|
|
|
|
if(window){cb||(cb=window.location.search.substr(1));for(var eb,fb=/\+/g,gb=/([^&=]+)=?([^&]*)/g;eb=gb.exec(cb);)db[decodeURIComponent(eb[1].replace(fb," "))]=decodeURIComponent(eb[2].replace(fb," "))}function hb(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}
|
|
|
|
|
function z(a,b){b||(b=t);a.prototype=hb(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var pb=window.PCjs.Machines||(window.PCjs.Machines={}),u=window.PCjs.Components||(window.PCjs.Components=[])}else pb={},u=[];function qb(a,b,c){pb[a]&&b&&(pb[a][b]=c)}function rb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
|
|
|
|
function sb(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}function tb(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<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function A(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){q(c.message+" ("+a+")")}return b}
|
|
|
|
|
function B(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=A(f))&&g.binding&&a.ra(g.type,g.binding,f,g.value),l=h.length}}}}
|
|
|
|
|
function B(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=A(f))&&g.binding&&a.sa(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}
|
|
|
|
|
t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},ra:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Sa=this.G[b]=c,c.value="",this.j=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.P=function(a){this.j(a,this.Za)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Za+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ga:function(){return this.w.ha=!0},Fa:function(a,b){b&&(this.w.ha=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.la;var c=a.i.la&b;return!!b&&c===b||!!(c&a.i.Qc)}return!1}
|
|
|
|
|
function ub(a,b){if(a.w.Zb)return a.w.ab=!1,a.w.Zb=!1;if(a.w.error)return a.j(a.toString()+" error"),!1;a.w.ab=b;return a.w.ab}function vb(a,b){a.w.ab&&(b?a.w.Zb=!0:void 0===b&&a.j(a.toString()+" busy"));return a.w.ab}function H(a,b){a.w.error||(a.w.ready=!1!==b,a.w.ready&&(b=a.Sb,a.Sb=null,b&&b()))}function wb(a,b){b&&(a.w.ready?b():a.Sb=b);return a.w.ready}function xb(a){return a.w.error?(a.j(a.toString()+" error"),!0):!1}function yb(a,b){a.w.error=!0;a.P(b)}
|
|
|
|
|
t.prototype={constructor:t,parent:null,toString:function(){return this.name?this.name:this.id||this.type},sa:function(a,b,c){switch(b){case "clear":return this.G[b]||(this.G[b]=c,c.onclick=function(a){return function(){a.G.print&&(a.G.print.value="")}}(this)),!0;case "print":return this.G[b]||(this.Ta=this.G[b]=c,c.value="",this.j=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.P=function(a){this.j(a,this.Za)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.Za+": "+a)},P:function(a,b,c){c=c||this.type;b||q((c?c+": ":"")+a)},Ia:function(){return this.w.ha=!0},Ha:function(a,b){b&&(this.w.ha=!1);return!0}};function E(a,b,c,d){a.i&&(!0===c||F(a,c|0))&&a.i.message(b,d)}function F(a,b){if(a.i){a===a.i?b|=0:b=b||a.ka;var c=a.i.ka&b;return!!b&&c===b||!!(c&a.i.Qc)}return!1}
|
|
|
|
|
function ub(a,b){if(a.w.ac)return a.w.bb=!1,a.w.ac=!1;if(a.w.error)return a.j(a.toString()+" error"),!1;a.w.bb=b;return a.w.bb}function vb(a,b){a.w.bb&&(b?a.w.ac=!0:void 0===b&&a.j(a.toString()+" busy"));return a.w.bb}function H(a,b){a.w.error||(a.w.ready=!1!==b,a.w.ready&&(b=a.Tb,a.Tb=null,b&&b()))}function wb(a,b){b&&(a.w.ready?b():a.Tb=b);return a.w.ready}function xb(a){return a.w.error?(a.j(a.toString()+" error"),!0):!1}function yb(a,b){a.w.error=!0;a.P(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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
|
|
|
|
|
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 zb="undefined"!==typeof ArrayBuffer,Ab="UNKNOWN ABORT ILLEGAL RED YELLOW FAULT TRACE HALT OPCODE INTERRUPT".split(" "),Bb={cpu:1,trap:16,fault:32,bus:64,memory:128,rom:256,device:512,panel:1024,keyboard:65536,key:131072,paper:1048576,disk:4194304,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
|
|
|
|
function Cb(a){t.call(this,"Panel",a,Cb,1024);this.f=this.B=this.Wa=this.D=this.H=this.I=0;this.L=this.M=this.J=!1;this.O=Db;this.A={};this.g={START:[1,1,!0,!1,this.ed],STEP:[1,1,!1,!1,this.fd],ENABLE:[1,1,!1,!1,this.ad],CONT:[1,1,!0,!1,this.Zc],DEP:[0,0,!0,!1,this.$c],EXAM:[1,1,!0,!1,this.bd],LOAD:[1,1,!0,!1,this.dd],TEST:[0,0,!0,!1,this.cd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.gd,a]}z(Cb);var Db=7;function Eb(a,b){return a.g[b]&&a.g[b][1]}k=Cb.prototype;k.reset=function(){this.stop()};
|
|
|
|
|
k.ra=function(a,b,c,d){if(this.C&&this.C.ra(a,b,c,d)||this.b&&this.b.ra(a,b,c,d)||this.i&&this.i.ra(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.I++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.A[b]=d?1:0,this.I++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
|
|
|
|
b){return function(){Fb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Gb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Fb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Gb(a,b)}}(this,b),!0):this.parent.ra.call(this,a,b,c,d)}};k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Hb(b,this,Ib);Jb(b,this.reset.bind(this));Kb(this);Lb(this)};k.Ga=function(a,b){b||(Mb(),this.reset());return!0};k.Fa=function(){return!0};
|
|
|
|
|
function Cb(a){t.call(this,"Panel",a,Cb,1024);this.f=this.B=this.Wa=this.D=this.H=this.I=0;this.L=this.M=this.K=!1;this.O=Db;this.A={};this.g={START:[1,1,!0,!1,this.ed],STEP:[1,1,!1,!1,this.fd],ENABLE:[1,1,!1,!1,this.ad],CONT:[1,1,!0,!1,this.Zc],DEP:[0,0,!0,!1,this.$c],EXAM:[1,1,!0,!1,this.bd],LOAD:[1,1,!0,!1,this.dd],TEST:[0,0,!0,!1,this.cd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.gd,a]}z(Cb);var Db=7;function Eb(a,b){return a.g[b]&&a.g[b][1]}k=Cb.prototype;k.reset=function(){this.stop()};
|
|
|
|
|
k.sa=function(a,b,c,d){if(this.C&&this.C.sa(a,b,c,d)||this.b&&this.b.sa(a,b,c,d)||this.i&&this.i.sa(a,b,c,d))return!0;switch(b){case "R0":case "R1":case "R2":case "R3":case "R4":case "R5":case "R6":case "R7":case "NF":case "ZF":case "VF":case "CF":case "PS":return this.G[b]=c,this.I++,!0;default:return"led"==a||"rled"==a?(this.G[b]=c,this.A[b]=d?1:0,this.I++,!0):"switch"==a?(void 0===this.g[b]&&(this.g[b]=[d?1:0,d?1:0]),this.G[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,
|
|
|
|
|
b){return function(){Fb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){Gb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){Fb(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){Gb(a,b)}}(this,b),!0):this.parent.sa.call(this,a,b,c,d)}};k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;Hb(b,this,Ib);Jb(b,this.reset.bind(this));Kb(this);Lb(this)};k.Ia=function(a,b){b||(Mb(),this.reset());return!0};k.Ha=function(){return!0};
|
|
|
|
|
function Nb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Kb(a,b){for(var c in a.A)Nb(a,c,null!=b?b:a.A[c])}function Ob(a,b,c){if(a=a.G[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function Lb(a){for(var b in a.g)Ob(a,b,a.g[b][1])}function Pb(a,b,c,d){a.G[b]&&(void 0===c&&(yb(a,"Value for "+b+" is invalid"),a.b.da()),c=8==(a.i&&a.i.ca||8)?qa(c,d):p(c,d),a.G[b].textContent!=c&&(a.G[b].textContent=c))}
|
|
|
|
|
function Fb(a,b){var c=a.g[b];Ob(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Gb(a,b){var c=a.g[b];c[2]&&c[3]&&(Ob(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.ed=function(a){a||this.b.w.W||(a=this.b,a.v.reset(),bc(a),Eb(this,"ENABLE")&&this.b.gb())};k.fd=function(){};k.ad=function(a){a||this.b.da()};
|
|
|
|
|
k.Zc=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.gb();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.hb(0),ub(a,!1);else try{var b=this.b.hb(1);0<b&&(cc(this.b,b),dc(this.b,b,!0),ec(this.b,b))}catch(c){"number"!=typeof c&&yb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.oa()}};k.$c=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Wa),this.O==Db?this.v.Ab(this.f,a):this.b.Ab(this.f,a))};
|
|
|
|
|
k.bd=function(a){a||this.b.w.W||(this.M&&fc(this),a=this.O==Db?this.v.bb(this.f):this.b.bb(this.f),gc(this,a))};k.dd=function(a){a||this.b.w.W||hc(this,this.Wa)};k.cd=function(a){a?(this.J=!0,Kb(this,!0)):(this.J=!1,Kb(this),ic(this,0))};k.gd=function(a,b){this.Wa=a?this.Wa|1<<b:this.Wa&~(1<<b)};function fc(a){var b=1145>a.b.Va?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Na;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)}
|
|
|
|
|
function hc(a,b){a.f=b&a.v.Na;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<<c)}function gc(a,b){a.B=b&65535;b=a.B;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.B}function jc(a,b,c){a.A[b]=c;a.J||Nb(a,b,c)}function kc(a){return void 0!==a.G.S0}function ic(a,b){if(kc(a)){a.Wa=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Lb(a)}}k.stop=function(){hc(this,this.b.u[7])};k.jc=function(a){this.f=a};k.setData=function(a,b){b?this.D=a:this.B=a};k.kd=function(a){return(a?this.Wa:this.D)&65535};
|
|
|
|
|
function Fb(a,b){var c=a.g[b];Ob(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.L="DEP"==b,a.M="EXAM"==b)}function Gb(a,b){var c=a.g[b];c[2]&&c[3]&&(Ob(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}k.ed=function(a){a||this.b.w.W||(a=this.b,a.v.reset(),bc(a),Eb(this,"ENABLE")&&this.b.ib())};k.fd=function(){};k.ad=function(a){a||this.b.da()};
|
|
|
|
|
k.Zc=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.ib();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.jb(0,null),ub(a,!1);else try{var b=this.b.jb(1);0<b&&(cc(this.b,b),dc(this.b,b,!0),ec(this.b,b))}catch(c){"number"!=typeof c&&yb(this.b,c.stack||c.message)}this.stop();this.C&&this.C.pa()}};k.$c=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Wa),this.O==Db?this.v.Cb(this.f,a):this.b.Cb(this.f,a))};
|
|
|
|
|
k.bd=function(a){a||this.b.w.W||(this.M&&fc(this),a=this.O==Db?this.v.cb(this.f):this.b.cb(this.f),gc(this,a))};k.dd=function(a){a||this.b.w.W||hc(this,this.Wa)};k.cd=function(a){a?(this.K=!0,Kb(this,!0)):(this.K=!1,Kb(this),ic(this,0))};k.gd=function(a,b){this.Wa=a?this.Wa|1<<b:this.Wa&~(1<<b)};function fc(a){var b=1145>a.b.Va?8:16,c=65472<=a.f&&a.f<65472+b,b=c?1:2,c=c?15:a.v.Pa;Eb(a,"STEP")||(b=-b);hc(a,a.f&~c|a.f+b&c)}
|
|
|
|
|
function hc(a,b){a.f=b&a.v.Pa;b=a.f;for(var c=0;22>c;c++)jc(a,"A"+c,b&1<<c)}function gc(a,b){a.B=b&65535;b=a.B;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.B}function jc(a,b,c){a.A[b]=c;a.K||Nb(a,b,c)}function kc(a){return void 0!==a.G.S0}function ic(a,b){if(kc(a)){a.Wa=b;for(var c=0;22>c;c++)a.g["S"+c][1]=b&1<<c?1:0;Lb(a)}}k.stop=function(){hc(this,this.b.u[7])};k.kc=function(a){this.f=a};k.setData=function(a,b){b?this.D=a:this.B=a};k.kd=function(a){return(a?this.Wa:this.D)&65535};
|
|
|
|
|
k.ee=function(a){this.D=a};var lc={},Ib=(lc[65400]=[null,null,Cb.prototype.kd,Cb.prototype.ee,"CNSW"],lc);function Mb(){for(var a=!1,b=D(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=A(d),f=sb(e.id);f||(a=!0,f=new Cb(e));B(f,d);a&&H(f)}}Za(Mb);
|
|
|
|
|
function mc(a,b,c){t.call(this,"Bus",a,mc,64);this.b=b;this.i=c;this.J=a.busWidth||16;this.C=0;this.A=[];this.g=null;this.H=1<<this.J;this.Na=this.H-1;this.za=nc;this.ja=Math.log2(this.za);this.I=this.za>>2;this.v=this.za-1;this.D=this.H/this.za|0;this.$a=[];this.ma=0;this.f=!1;this.ac=0;this.B=[];this.Nc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(mc);var nc=8192,tc=nc-1;
|
|
|
|
|
function oc(a,b){var c=-1,d=this.controller,e=d.$a[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.$a[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Da(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c}
|
|
|
|
|
function pc(a,b,c){var d=!1,e=this.controller,f=e.$a[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.$a[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Da(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),
|
|
|
|
|
!0,!e.ma))}function qc(a,b){var c=-1,d=this.controller;a=d.$a[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.ma),c;d.Da(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.ma);return c}
|
|
|
|
|
function rc(a,b,c){var d=!1,e=this.controller;a=e.$a[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.ma):(e.Da(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.ma))}
|
|
|
|
|
function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.A),a.C=0);b&&(a.C=b,c=1<<b,a.Na=c-1,c-=nc,a.A=wc(a,c,nc),a.g?vc(a,c,nc,a.g):(xc(a,c,nc,yc,a),a.g=wc(a,c,nc)))}}k=mc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();uc(this,16)};k.Ga=function(a,b){b||this.reset();return!0};
|
|
|
|
|
function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.za,n=a.za-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Ob+=l.F-f,l.F=f,!0;if(f>=l.F+l.Ob){n=l.size-(f-m);n>g&&(n=g);l.Ob=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.za,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Ac&&(a.ac+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)}
|
|
|
|
|
function wc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.za;return d}function vc(a,b,c,d){var e=0;for(b>>>=a.ja;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.za}}k.Hb=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].Ub(a&this.v,a)};k.Tb=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.ma++;a=this.Y[(a&this.Na)>>>this.ja].fc(a&this.v,a);this.ma--;return a};
|
|
|
|
|
k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Na)>>>this.ja].qa(a&this.v,a)};k.bb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.ma++;a=this.Y[c].gc(b,a);this.ma--;return a};k.zb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Xb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.ma++;this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a);this.ma--};
|
|
|
|
|
k.fb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Pb(a&this.v,b&65535,a)};k.Ab=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Na)>>>this.ja;this.f=!1;this.ma++;this.Y[d].lc(c,b&65535,a);this.ma--};
|
|
|
|
|
function Dc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Ta||e.Sc){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 Ec(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&tc;if(void 0!==a.$a[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.$a[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
|
|
|
|
|
function Hb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Va)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Ec(a,e,e,g,h,l,m,b.la||64,n||b.Za))return!1}}return!0}function Jb(a,b){a.B.push(b)}
|
|
|
|
|
k.Da=function(a,b,c){this.f=!0;this.ma||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on "+J(this.i,a),!0,!0),b&&(this.b.Ha|=b),this.b.sa(4,0,a))};function Fc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={fa:0,kc:-1}}z(K);k=K.prototype;
|
|
|
|
|
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.kc=Gc(c,function(){e.f.Jb|=128;e.f.Jb&64&&Hc(e.b,e.f.ce);e.C&&e.C.oa(1);Pc(e.b,e.f.kc,1E3/60)});this.f.ce=Qc(64,6);Hb(b,this,Rc);Jb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Jb=128;Pc(this.b,this.f.kc,1E3/60,!0)};k.sd=function(){return this.f.Jb};k.me=function(a){this.f.Jb=a&192};k.ud=function(){var a=this.b;return a.J&62337|a.jb<<5|a.ib<<1};
|
|
|
|
|
k.oe=function(a){var b=this.b;a&=62337;if(b.J!=a){b.J=a;b.jb=a>>5&3;b.ib=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ua!=c&&(b.Ua=c,Sc(b))}};k.vd=function(){var a=this.b;a.J&57344||(a.Ac=a.S&65535);a=a.Ac;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.J&57344||(a.Cc=a.Ib);return a.Cc};k.xd=function(){return this.b.pb};k.pe=function(a){var b=this.b;1170>b.Va&&(a&=-49);b.pb!=a&&(b.pb=a,b.Ja=a&16?4194303:262143,Sc(b))};
|
|
|
|
|
k.Yd=function(a){a=a>>1&63;var b=this.b.Nb[a>>1];return a&1?b>>16:b&65535};k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Nb[c]=b&1?this.b.Nb[c]&65535|(a&63)<<16:this.b.Nb[c]&-65536|a&65534};k.Rd=function(a){return this.b.V[1][a>>1&7]};k.Je=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[1][(a>>1&7)+8]};k.He=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.ya[1][a>>1&7]};k.Ie=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};
|
|
|
|
|
k.Od=function(a){return this.b.ya[1][(a>>1&7)+8]};k.Ge=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.rd=function(a){return this.b.V[0][a>>1&7]};k.le=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.pd=function(a){return this.b.V[0][(a>>1&7)+8]};k.je=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.qd=function(a){return this.b.ya[0][a>>1&7]};k.ke=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.od=function(a){return this.b.ya[0][(a>>1&7)+8]};
|
|
|
|
|
k.ie=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.Xd=function(a){return this.b.V[3][a>>1&7]};k.Pe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Vd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ne=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Wd=function(a){return this.b.ya[3][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Ud=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};
|
|
|
|
|
k.xb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]};k.Bb=function(a,b){b&=7;this.b.N&2048?this.b.Xa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Fd=function(){return this.b.u[7]};k.xe=function(a){this.b.u[7]=a};k.yb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Cb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Xa[b]=a};
|
|
|
|
|
k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]};k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.md=function(a){return this.b.Gc[a-65504>>1]};k.ge=function(a,b){this.b.Gc[b-65504>>1]=a};k.Dc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.ac}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1};
|
|
|
|
|
k.Le=function(){};k.ld=function(){return this.b.Ha};k.fe=function(){this.b.Ha=0};k.td=function(){return this.b.Fc};k.ne=function(a,b){b&1||(a&=255);this.b.Fc=a};k.yd=function(a){return a?this.b.ic:0};k.qe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ic=a;b.K|=2};k.Sd=function(a){return a?this.b.Vb&65280:0};k.Ke=function(a){this.b.Vb=a|255};k.Bd=function(){return Tc(this.b)};k.te=function(a){Uc(this.b,a&-1793|Tc(this.b)&1792);this.b.K|=128};
|
|
|
|
|
k.Jc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
|
|
|
|
|
function mc(a,b,c){t.call(this,"Bus",a,mc,64);this.b=b;this.i=c;this.K=a.busWidth||16;this.C=0;this.A=[];this.g=null;this.H=1<<this.K;this.Pa=this.H-1;this.za=nc;this.ja=Math.log2(this.za);this.I=this.za>>2;this.v=this.za-1;this.D=this.H/this.za|0;this.ab=[];this.la=0;this.f=!1;this.cc=0;this.B=[];this.Nc=[oc,pc,qc,rc];a=new I(this);sc(a,this.i);this.Y=Array(this.D);for(b=0;b<this.D;b++)this.Y[b]=a;H(this)}z(mc);var nc=8192,tc=nc-1;
|
|
|
|
|
function oc(a,b){var c=-1,d=this.controller,e=d.ab[a],f=b&65535;e?e[0]?c=e[0](f):e[2]&&(c=f&1?e[2](f&-2)>>8:e[2](f)&255):f&1&&(e=d.ab[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return this.i&&F(this.i,e[5])&&E(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Fa(b,16,3);c=255;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
|
|
|
|
|
function pc(a,b,c){var d=!1,e=this.controller,f=e.ab[a],g=c&65535;if(f)if(f[1])f[1](b,g),d=!0;else{if(f[3]){a=f[2]?f[2](0):0;if(g&1)f[3](a&255|b<<8,g&-2);else f[3](a&-256|b,g);d=!0}}else g&1&&(f=e.ab[a&-2])&&(f[3]?(g&=-2,a=f[2]?f[2](0):0,f[3](a&255|b<<8,g),d=!0):f[1]&&(f[1](b,g),d=!0));d?this.i&&F(this.i,f[5])&&E(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Fa(c,16,5),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),
|
|
|
|
|
!0,!e.la))}function qc(a,b){var c=-1,d=this.controller;a=d.ab[a];var e=b&65535;a&&(a[2]?c=a[2](e):a[0]&&(c=a[0](e)|a[0](e+1)<<8));if(0<=c)return this.i&&F(this.i,a[5])&&E(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!d.la),c;d.Fa(b,16,2);c=65535;this.i&&F(this.i,64)&&E(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!d.la);return c}
|
|
|
|
|
function rc(a,b,c){var d=!1,e=this.controller;a=e.ab[a];var f=c&65535;a&&(a[3]?(a[3](b,f),d=!0):a[1]&&(a[1](b&255,f),a[1](b>>8,f+1),d=!0));d?this.i&&F(this.i,a[5])&&E(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!e.la):(e.Fa(c,16,4),this.i&&F(this.i,64)&&E(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!e.la))}
|
|
|
|
|
function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.A),a.C=0);b&&(a.C=b,c=1<<b,a.Pa=c-1,c-=nc,a.A=wc(a,c,nc),a.g?vc(a,c,nc,a.g):(xc(a,c,nc,yc,a),a.g=wc(a,c,nc)))}}k=mc.prototype;k.reset=function(){for(var a=0;a<this.B.length;a++)this.B[a]();uc(this,16)};k.Ia=function(a,b){b||this.reset();return!0};
|
|
|
|
|
function xc(a,b,c,d,e){for(var f=b,g=c,h=f>>>a.ja;0<g&&h<a.Y.length;){var l=a.Y[h],m=h*a.za,n=a.za-(f-m);n>g&&(n=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.F)return l.Pb+=l.F-f,l.F=f,!0;if(f>=l.F+l.Pb){n=l.size-(f-m);n>g&&(n=g);l.Pb=f-l.F+n;f=m+a.za;g-=n;h++;continue}}return zc(1,f,g)}f=new I(a,f,n,a.za,d,e);sc(f,a.i,l);a.Y[h++]=f;f=m+a.za;g-=n}return 0>=g?(d==Ac&&(a.cc+=c),a.status((c>>10)+"Kb "+Bc[d]+" at "+qa(b)),!0):zc(2,b,c)}
|
|
|
|
|
function wc(a,b,c){var d=[];for(b>>>=a.ja;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-=a.za;return d}function vc(a,b,c,d){var e=0;for(b>>>=a.ja;0<c&&b<a.Y.length;){var f=d[e++];if(!f)break;a.Y[b++]=f;c-=a.za}}k.Ib=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Pa)>>>this.ja].Vb(a&this.v,a)};k.Ub=function(a){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;a=this.Y[(a&this.Pa)>>>this.ja].hc(a&this.v,a);this.la--;return a};
|
|
|
|
|
k.na=function(a){3932160<=a&&(a=Cc(this.b,a));return this.Y[(a&this.Pa)>>>this.ja].ra(a&this.v,a)};k.cb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Pa)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].ic(b,a);this.la--;return a};k.Bb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Pa)>>>this.ja].Zb(a&this.v,b&255,a)};k.qb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Pa)>>>this.ja].$b(a&this.v,b&255,a);this.la--};
|
|
|
|
|
k.hb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Pa)>>>this.ja].Qb(a&this.v,b&65535,a)};k.Cb=function(a,b){3932160<=a&&(a=Cc(this.b,a));var c=a&this.v,d=(a&this.Pa)>>>this.ja;this.f=!1;this.la++;this.Y[d].mc(c,b&65535,a);this.la--};
|
|
|
|
|
function Dc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Ua||e.Sc){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 Ec(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&tc;if(void 0!==a.ab[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.ab[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
|
|
|
|
|
function Hb(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Va)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Ec(a,e,e,g,h,l,m,b.ka||64,n||b.Za))return!1}}return!0}function Jb(a,b){a.B.push(b)}
|
|
|
|
|
k.Fa=function(a,b,c){this.f=!0;this.la||(this.i&&F(this.i,32)&&E(this.i,"memory fault ("+c+") on "+J(this.i,a),!0,!0),b&&(this.b.Ja|=b),this.b.ta(4,0,a))};function Fc(a){var b=a.f;a.f=!1;return b}function zc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,512);this.f={fa:0,lc:-1}}z(K);k=K.prototype;
|
|
|
|
|
k.Ga=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.i=d;var e=this;this.f.lc=Gc(c,function(){e.f.Kb|=128;e.f.Kb&64&&Hc(e.b,e.f.ce);e.C&&e.C.pa(1);Pc(e.b,e.f.lc,1E3/60)});this.f.ce=Qc(64,6);Hb(b,this,Rc);Jb(b,this.reset.bind(this));H(this)};k.reset=function(){this.f.Kb=128;Pc(this.b,this.f.lc,1E3/60,!0)};k.sd=function(){return this.f.Kb};k.me=function(a){this.f.Kb=a&192};k.ud=function(){var a=this.b;return a.Ba&-3199|a.$a<<5|a.lb<<1};k.oe=function(a){Sc(this.b,a&-129|this.b.Ba&128)};
|
|
|
|
|
k.vd=function(){var a=this.b;a.Ba&57344||(a.Hb=a.oa>>16&65535);a=a.Hb;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.wd=function(){var a=this.b;a.Ba&57344||(a.Jb=a.oa&65535);return a.Jb};k.xd=function(){return this.b.fb};k.pe=function(a){var b=this.b;1170>b.Va&&(a&=-49);b.fb!=a&&(b.fb=a,b.Ca=a&16?4194303:262143,Tc(b))};k.Yd=function(a){a=a>>1&63;var b=this.b.Ob[a>>1];return a&1?b>>16:b&65535};
|
|
|
|
|
k.Qe=function(a,b){b=b>>1&63;var c=b>>1;this.b.Ob[c]=b&1?this.b.Ob[c]&65535|(a&63)<<16:this.b.Ob[c]&-65536|a&65534};k.Rd=function(a){return this.b.V[1][a>>1&7]};k.Je=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Pd=function(a){return this.b.V[1][(a>>1&7)+8]};k.He=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Qd=function(a){return this.b.ya[1][a>>1&7]};k.Ie=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.Od=function(a){return this.b.ya[1][(a>>1&7)+8]};
|
|
|
|
|
k.Ge=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.rd=function(a){return this.b.V[0][a>>1&7]};k.le=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.pd=function(a){return this.b.V[0][(a>>1&7)+8]};k.je=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.qd=function(a){return this.b.ya[0][a>>1&7]};k.ke=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.od=function(a){return this.b.ya[0][(a>>1&7)+8]};k.ie=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};
|
|
|
|
|
k.Xd=function(a){return this.b.V[3][a>>1&7]};k.Pe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Vd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Ne=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Wd=function(a){return this.b.ya[3][a>>1&7]};k.Oe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Ud=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Me=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.zb=function(a){a&=7;return this.b.N&2048?this.b.Xa[a]:this.b.u[a]};
|
|
|
|
|
k.Db=function(a,b){b&=7;this.b.N&2048?this.b.Xa[b]=a:this.b.u[b]=a};k.Cd=function(){return this.b.N&49152?this.b.Ka[0]:this.b.u[6]};k.ue=function(a){this.b.N&49152?this.b.Ka[0]=a:this.b.u[6]=a};k.Fd=function(){return this.b.u[7]};k.xe=function(a){this.b.u[7]=a};k.Ab=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Xa[a]};k.Eb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Xa[b]=a};k.Dd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ka[1]};
|
|
|
|
|
k.ve=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ka[1]=a};k.Ed=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ka[3]};k.we=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ka[3]=a};k.md=function(a){return this.b.Gc[a-65504>>1]};k.ge=function(a,b){this.b.Gc[b-65504>>1]=a};k.Dc=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.cc}a=(a>>6)-1}else a=0;return a};k.Kc=function(){};k.Td=function(){return 1};k.Le=function(){};k.ld=function(){return this.b.Ja};
|
|
|
|
|
k.fe=function(){this.b.Ja=0};k.td=function(){return this.b.Fc};k.ne=function(a,b){b&1||(a&=255);this.b.Fc=a};k.yd=function(a){return a?this.b.jc:0};k.qe=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.J|=2};k.Sd=function(a){return a?this.b.Xb&65280:0};k.Ke=function(a){this.b.Xb=a|255};k.Bd=function(){return Uc(this.b)};k.te=function(a){Vc(this.b,a&-1793|Uc(this.b)&1792);this.b.J|=128};k.Jc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
|
|
|
|
|
var L={},Rc=(L[61568]=[null,null,K.prototype.Yd,K.prototype.Qe,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Rd,K.prototype.Je,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Pd,K.prototype.He,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Qd,K.prototype.Ie,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Od,K.prototype.Ge,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.rd,K.prototype.le,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.pd,K.prototype.je,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.qd,
|
|
|
|
|
K.prototype.ke,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.od,K.prototype.ie,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.xd,K.prototype.pe,"MMR3",1,1145],L[65382]=[null,null,K.prototype.sd,K.prototype.me,"LKS"],L[65402]=[null,null,K.prototype.ud,K.prototype.oe,"MMR0",1,1145],L[65404]=[null,null,K.prototype.vd,K.prototype.Jc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.wd,K.prototype.Jc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Xd,K.prototype.Pe,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Vd,
|
|
|
|
|
K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Ud,K.prototype.Me,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.xb,K.prototype.Bb,"R0SET0"],L[65473]=[null,null,K.prototype.xb,K.prototype.Bb,"R1SET0"],L[65474]=[null,null,K.prototype.xb,K.prototype.Bb,"R2SET0"],L[65475]=[null,null,K.prototype.xb,K.prototype.Bb,"R3SET0"],L[65476]=[null,null,K.prototype.xb,K.prototype.Bb,"R4SET0"],L[65477]=[null,null,K.prototype.xb,K.prototype.Bb,
|
|
|
|
|
"R5SET0"],L[65478]=[null,null,K.prototype.Cd,K.prototype.ue,"R6KERNEL"],L[65479]=[null,null,K.prototype.Fd,K.prototype.xe,"R7KERNEL"],L[65480]=[null,null,K.prototype.yb,K.prototype.Cb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.yb,K.prototype.Cb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.yb,K.prototype.Cb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.yb,K.prototype.Cb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.yb,K.prototype.Cb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.yb,
|
|
|
|
|
K.prototype.Cb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Dd,K.prototype.ve,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ed,K.prototype.we,"R6USER",1,1145],L[65504]=[null,null,K.prototype.md,K.prototype.ge,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Dc,K.prototype.Kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Dc,K.prototype.Kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Td,K.prototype.Le,"SYSID",1,1170],L[65526]=[null,null,K.prototype.ld,K.prototype.fe,"CPUERR",1,1170],L[65528]=
|
|
|
|
|
[null,null,K.prototype.td,K.prototype.ne,"MB",1,1170],L[65530]=[null,null,K.prototype.yd,K.prototype.qe,"PIR"],L[65532]=[null,null,K.prototype.Sd,K.prototype.Ke,"SL"],L[65534]=[null,null,K.prototype.Bd,K.prototype.te,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Vc(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var Wc;
|
|
|
|
|
if(zb){var Xc=new ArrayBuffer(2);(new DataView(Xc)).setUint16(0,256,!0);Wc=256===(new Uint16Array(Xc))[0]}else Wc=!1;var Yc=Wc;
|
|
|
|
|
function I(a,b,c,d,e,f){this.v=a;this.id=Zc+=2;this.b=null;this.F=b;this.Ob=c;this.size=d||0;this.type=e||$c;this.f=e==ad;this.controller=null;sc(this);this.Ta=this.Sc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],bd(this,f.Nc);else if(zb)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>>
|
|
|
|
|
2);for(f=0;f<a.length;f++)a[f]=0;bd(this,ed)}else bd(this)}var $c=0,Ac=1,ad=2,yc=4,Bc=["NONE","RAM","ROM","VID","H/W"],Zc=0;
|
|
|
|
|
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(zb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.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(zb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ta=!0}return!1},lb:function(a,b){b?this.C++||fd(this,gd,!1):this.g++||hd(this,gd,!1)},J:function(a,b){this.i&&F(this.i,128)&&E(this.i,
|
|
|
|
|
"attempt to read invalid address "+J(this.i,b),!0);this.v.Da(b,32,2);return 255},A:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.v.Da(c,32,4)},L:function(a,b){return this.Ub(a++,b++)|this.Ub(a,b)<<8},H:function(a,b,c){this.Xb(a++,b&255,c++);this.Xb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Da(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
|
|
|
|
|
1]&255)<<8},ta:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ta=!0},Ja:function(a,b,c){a&1&&this.v.Da(c,64,4);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.Ta=!0},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,1,c.M)&&c.da(!0)}return this.fc(a,b)},$:function(a,b){if(this.i&&null!=this.F){var c=this.i;id(c,this.F+a,2,c.M)&&c.da(!0)}return this.gc(a,b)},ka:function(a,
|
|
|
|
|
b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.Yb(a,b,c)},wa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;id(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.lc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Da(b,64,2);return this.D.getUint16(a,!0)},Qa:function(a,b){a&1&&this.v.Da(b,64,2);
|
|
|
|
|
a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Ta=!0},Za:function(a,b,c){this.G[a]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},va:function(a,b,c){a&1&&this.v.Da(c,64,4);this.D.setUint16(a,b,!0);this.Ta=!0},xa:function(a,b,c){a&1&&this.v.Da(c,64,4);this.I[a>>1]=b;this.Ta=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
|
|
|
|
|
b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&hd(a,gd,!1),(a.C=c.C)&&fd(a,gd,!1))}function jd(a,b){b?--a.C||(a.Xb=a.f?a.A:a.Yb,a.Pb=a.f?a.H:a.lc):--a.g||(a.Ub=a.fc,a.qa=a.gc)}function fd(a,b,c){c&&a.C||(a.Xb=!a.f&&b[1]||a.A,a.Pb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Yb=b[1]||a.A,a.lc=b[3]||a.H}function hd(a,b,c){c&&a.g||(a.Ub=b[0]||a.J,a.qa=b[2]||a.L);if(c||void 0===c)a.fc=b[0]||a.J,a.gc=b[2]||a.L}function bd(a,b){b||(b=kd);hd(a,b,void 0);fd(a,b,void 0)}
|
|
|
|
|
var kd=[],ed=[I.prototype.S,I.prototype.ta,I.prototype.ca,I.prototype.Ja],gd=[I.prototype.O,I.prototype.ka,I.prototype.$,I.prototype.wa];if(zb)var dd=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.va],cd=[I.prototype.R,I.prototype.Za,I.prototype.Qa,I.prototype.xa];
|
|
|
|
|
function ld(a,b){t.call(this,"CPU",a,ld,1);b=a.cycles||b;var c=a.multiplier||1;this.Db=0;this.mb=b;this.cb=c;this.Fb=Math.round(this.mb/1E4)/100;this.ob=this.Fb*this.cb;this.w.W=!1;this.w.Wb=!1;this.w.sb=a.autoStart;this.w.tb=!1;this.Kb=this.va=0;this.Lb=a.csStart;this.ub=a.csInterval;this.vb=a.csStop;this.L=[];this.zc=this.be.bind(this);H(this)}z(ld);var md=["power","reset"];k=ld.prototype;
|
|
|
|
|
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.A=a.A;for(b=0;b<md.length;b++)(c=this.G[md[b]])&&this.C.ra(null,md[b],c);a=nd(a,"autoStart");null!=a&&(this.w.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
|
|
|
|
k.Ga=function(a,b){if(!b){if(a&&this.restore){od(this);if(!this.restore(a))return!1;pd(this)}else this.reset();this.i?(a=this.i,b=this.w.sb,a.ib=!0,a.j("Type ? for help with PDPjs Debugger commands"),qd(a),b||a.rb(),a.Ra&&(b=a.Ra,a.Ra=null,rd(a,b))):this.j("No debugger detected")}return!0};k.Fa=function(a){return a?this.save():!0};k.sb=function(){return this.w.sb||!this.i&&void 0===this.G.run?(this.gb(),!0):!1};k.rc=function(){return 0};
|
|
|
|
|
function pd(a){void 0===a.Lb&&(a.Lb=0);void 0===a.ub&&(a.ub=-1);void 0===a.vb&&(a.vb=-1);a.w.tb=0<=a.Lb&&0<a.ub;a.w.tb&&(a.Kb=0,a.va=a.Lb-a.ka)}function ec(a,b){if(a.w.tb){var c=!1;a.Kb=a.Kb+a.rc()|0;a.va-=b;0>=a.va&&(a.va+=a.ub,c=!0);0<=a.vb&&a.vb<=sd(a)&&(a.ub=a.vb=-1,pd(a),a.da(),c=!0);c&&a.j(sd(a)+" cycles: checksum="+p(a.Kb))}}
|
|
|
|
|
k.ra=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.w.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.w.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.w.ready?"powered yet":"ready yet"+(b.Sb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.da():d.gb())},
|
|
|
|
|
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){td(d,d.cb<<1,!0)},c.textContent=this.ob.toFixed(2)+"Mhz",!0}return!1};k.oa=function(a){this.C&&this.C.oa(a)};function dc(a,b,c){a.ka+=b;c&&(a.ia=a.b=a.I=0)}function ud(a,b){var c=1;b&&1<a.cb&&a.ta&&(c=a.ta/a.Fb);a.xc=Math.round(1E3/30);a.nb=Math.floor(a.mb/30*c);b||(a.wa=a.nb);a.Gb=0}function sd(a){return a.ka+a.$+a.ia-a.b}function od(a){a.ta=0;a.yc=0;a.ka=a.$=a.ia=a.b=a.I=0;pd(a);td(a,1)}
|
|
|
|
|
function td(a,b,c){var d=!1;if(void 0!==b){.8>a.ta/a.ob?b=1:d=!0;a.cb=b;b=a.Fb*a.cb;if(a.ob!=b){a.ob=b;b=a.ob.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}dc(a,a.$);a.$=0;a.X=Aa();a.ca=0;ud(a);return d}function Gc(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&b<a.L.length&&(d||0>a.L[b][0])&&(c=a.mb*a.cb/1E3*c|0,a.w.W&&(c+=vd(a)),a.L[b][0]=c)}
|
|
|
|
|
function wd(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function vd(a,b){var c=a.ia-=a.b;a.b=a.I=0;b&&(a.ia=0);return c}
|
|
|
|
|
k.be=function(){if(this.w.W){this.Gb>=this.mb&&ud(this,!0);this.Ra=0;this.kb=Aa();if(this.ca){var a=this.kb-this.ca;a>this.xc&&(this.X+=a,this.X>this.kb&&(this.X=this.kb))}try{do{var b=wd(this,this.w.tb?1:this.nb);try{this.hb(b)}catch(e){if("number"!=typeof e)throw e;}b=vd(this,!0);this.Ra+=b;this.$+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.nb;15<=++this.yc&&(this.oa(),this.yc=0);break}}while(this.w.W)}catch(e){this.da();this.C&&this.C.stop(Aa(),sd(this));yb(this,e.stack||e.message);
|
|
|
|
|
return}if(this.w.W){a=setTimeout;b=this.zc;this.ca=Aa();var c=this.xc;this.Ra&&(c=Math.round(c*this.Ra/this.nb));var c=c-(this.ca-this.kb),d=this.ca-this.X;d&&(this.ta=Math.round(this.$/(10*d))/100,864E5<=d&&(this.ka=0,td(this)));if(0>c||this.ta<this.ob)-1E3>c&&(this.X-=c),c=0;this.Gb+=this.Ra;this.ca+=c;a(b,c)}}};
|
|
|
|
|
k.gb=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;td(this);this.w.W=!0;this.w.Wb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.X,sd(this)));setTimeout(this.zc,0);return!0};k.hb=function(){return 0};k.da=function(a){var b=!1;if(this.w.W){vd(this);dc(this,this.$);this.$=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),sd(this));b=!0}this.w.complete=a;return b};
|
|
|
|
|
function xd(a){this.Va=+a.model||1170;this.uc=a.addrReset||0;ld.call(this,a,6666667);this.decode=1120==this.Va?yd.bind(this):zd.bind(this);Ad(this);this.M=0;this.O=null;this.w.complete=!1}z(xd,ld);k=xd.prototype;k.reset=function(){this.status("model "+this.Va);this.w.W&&this.da();Ad(this);od(this);this.w.error=!1;this.parent.reset.call(this)};
|
|
|
|
|
function Ad(a){a.T=65536;a.U=32768;a.aa=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.uc];a.Xa=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.B=0;a.ib=0;a.Xc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ya=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Nb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
|
|
|
0,0,0,0,0,0,0,0,0,0];a.Gc=[0,0,0,0,0,0,0,0];a.Fc=0;a.K=0;a.D=a.H=0;a.g=a.f=a.Eb=0;a.xa=-1;bc(a)}function bc(a){a.Vb=255;a.Ha=0;a.ic=0;a.J=0;a.Ac=0;a.Cc=0;a.pb=0;a.Ua=0;a.jb=0;a.Ja=262143;a.S=0;a.Ib=0;a.O=null;a.v&&Sc(a)}function Sc(a){a.Ua?(a.R=65536,a.ba=a.Vc,a.qa=a.Zd,a.Pb=a.Re,uc(a.v,a.pb&16?22:18)):(a.R=0,a.ba=a.Uc,a.qa=a.Ec,a.Pb=a.Lc,uc(a.v,16))}k.rc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ka,this.cb]);a.set(2,Dc(this.v));return a.data()};
|
|
|
|
|
k.restore=function(a){var b=a[1];this.ka=b[1];td(this,b[3]);a:{b=this.v;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.Y[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Bd(a){return a.T&65536?1:0}function Cd(a){return a.U&32768?2:0}function Dd(a){return a.aa&65535?0:4}function Ed(a){return a.Z&32768?8:0}
|
|
|
|
|
function Fd(a){var b=a.u[7];a.S=0;a.Ib=b;var c=a.qa(b);a.u[7]=b+2&65535;return c}function Gd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Qc(a,b){return{de:a,wb:b,next:null}}function Hd(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}function Hc(a,b){if(b!=a.O){var c=a.O;if(!c||c.wb<=b.wb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.wb<=b.wb){b.next=d;c.next=b;break}c=d}while(c)}}a.K|=1}
|
|
|
|
|
function Id(a){return a.K&64?(a.sa(168,64,-5),!0):a.K&32?(a.sa(4,32,-4),!0):a.K&16?(a.sa(12,16,-6),!0):!1}function Tc(a){return a.N=a.N&63728|Ed(a)|Dd(a)|Cd(a)|Bd(a)}function Uc(a,b){a.Z=b<<12;a.aa=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Xa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Xa[c];a.Xa[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.B]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Jd(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)}
|
|
|
|
|
function Kd(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))}function fe(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)}function ge(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^d)&(d^b))}
|
|
|
|
|
k.sa=function(a,b,c){if(!this.M){0>this.xa?this.xa=Tc(this):this.B||(a=4,this.Ha|=4,this.u[6]=4,c=-3);this.Ib=a;this.B=this.S=0;var d=this.qa(a|this.R),e=this.qa(a+2&65535|this.R);Uc(this,e&-12289|this.xa>>2&12288);he(this,this.xa);he(this,this.u[7]);O(this,d);this.K&=~(b|18);this.K|=9;this.xa=-1;this.jd=a;this.hd=c;if(-3<=c)throw a;}};function ie(a){var b=je(a),c=je(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Uc(a,c);a.K&=-17}
|
|
|
|
|
function Cc(a,b){var c=b>>13&31;31>c&&a.pb&32&&(b=a.Nb[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
|
|
|
|
function ke(a,b,c){var d,e,f;if(!(c&a.Ua))return b;d=b>>13;a.pb&a.Xc[a.B]||(d&=7);e=a.V[a.B][d];f=(a.ya[a.B][d]<<6)+(b&8191)&a.Ja;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ja)||a.B)a.jb=a.B,a.ib=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.J&57344||(a.J=a.J|g|a.jb<<5|a.ib<<
|
|
|
|
|
1),b=!0),a.J&61440||!(f<(4191360&a.Ja)||f>(4194239&a.Ja))||(a.J|=4096,a.J&512&&(a.K|=64)),b&&a.sa(168,0,-1));return f}function le(a,b){return a.v.Hb(b)}function je(a){var b=a.qa(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function he(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.S=a.S<<8|246;me(a,0,c);a.Pb(c,b)}function me(a,b,c){!a.B&&c<=a.Vb&&(b||4<c)&&(1145<=a.Va&&c<=a.Vb-32?(a.Ha|=4,a.u[6]=4,a.sa(4,0,-3)):(a.Ha|=8,a.K|=32))}
|
|
|
|
|
function ne(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.sa(4,0,-2),0;case 1:return 6==c&&d&4&&me(a,b,a.u[6]),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=a.qa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.qa(e)|g;a.b-=8;break;case 6:return e=a.qa(Gd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.qa(Gd(a,2)),e=e+
|
|
|
|
|
a.u[c]&65535,e=a.qa(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.S=a.S<<8|f<<3&248|c;6==c&&0>f&&me(a,b,a.u[6]);return e}k.Tb=function(a){if(!this.Ua)return this.v.Tb(a);this.M++;a=le(this,ke(this,a,3));this.M--;return a};k.bb=function(a){if(!this.Ua)return this.v.bb(a);this.M++;a=this.Ec(ke(this,a,2));this.M--;return a};k.qb=function(a,b){this.Ua?(this.M++,a=ke(this,a,5),a&1&&this.b--,this.v.zb(a,b),this.M--):this.v.qb(a,b)};
|
|
|
|
|
k.Ab=function(a,b){this.Ua?(this.M++,this.Lc(ke(this,a,4),b),this.M--):this.v.Ab(a,b)};k.Uc=function(a,b,c){return ne(this,a,b,c)};k.Vc=function(a,b,c){return ke(this,ne(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(ke(this,a,2))};k.Lc=function(a,b){this.v.fb(a,b&65535)};k.Re=function(a,b){this.v.fb(ke(this,a,4),b)};
|
|
|
|
|
function oe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=ne(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.qa(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ia[a.N>>12&3];return c}function pe(a,b,c,d){a.S=22;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=ne(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=ke(a,e|c&65536,4),a.B=a.N>>14&3,a.v.fb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d}
|
|
|
|
|
function qe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?le(a,a.ba(b,c,3)):-c-1}function re(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.ba(b,d,2)):c=-d-1;return c}function se(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return ne(a,b,c,8)}function te(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?le(a,a.ba(b,c,3)):a.u[c]&255}function ue(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.ba(b,c,2)):a.u[c]}
|
|
|
|
|
function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Eb=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,le(a,e)),e&1&&a.b--,a.v.zb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.ba(b,e,6),a.v.fb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
|
|
|
|
|
function ve(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.zb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function we(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.v.fb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
|
|
|
|
k.hb=function(a){this.w.complete=!0;var b=this.i?xe(this.i)?1:this.w.Wb?-1:0:0,c=a?this.w.Wb?0:1:-1;this.w.Wb=!1;this.ia=this.b=a;do{if(b){if(ye(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.K){if(a=this.K&7)if(a=!1,this.K&2){this.K&=-3;var d=160,e=(this.ic&224)>>5,f=this.O&&this.O.wb>e?this.O:null;f&&(d=f.de,e=f.wb);e>(this.N&224)>>5?(this.K&4&&(Gd(this,2),this.K&=-5),this.sa(d,0,-9),e=!0):e=!1;e&&(f&&Hd(this,f),a=!0)}else this.K&1&&this.K++;if(a){if(b&&ye(this.i,this.u[7],c)){this.da();
|
|
|
|
|
break}if(0>c)break}if(this.K&112&&Id(this)){if(b&&ye(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.K=this.K&7|this.N&16;this.decode(Fd(this))}while(0<this.b);return this.w.complete?this.ia-this.b:void 0===this.w.complete?0:-1};Za(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new xd(d);B(d,c)}});function ze(a,b){var c=b+a;Kd(this,c,a,b);return c&65535}function Ae(a,b){var c=b+a;Kd(this,c<<8,a<<8,b<<8);return c&255}
|
|
|
|
|
function Be(a,b){a=b<<1;fe(this,a);return a&65535}function Ce(a,b){a=b<<1;fe(this,a<<8);return a&255}function De(a,b){a=b&32768|b>>1|b<<16;fe(this,a);return a&65535}function Ee(a,b){a=b&128|b>>1|b<<8;fe(this,a<<8);return a&255}function Fe(a,b){a=b&~a;Q(this,a);return a}function Ge(a,b){a=b&~a;Q(this,a<<8);return a}function He(a,b){a|=b;Q(this,a);return a}function Ie(a,b){a|=b;Q(this,a<<8);return a}function Je(a,b){a=~b|65536;Jd(this,a);return a&65535}
|
|
|
|
|
function Ke(a,b){a=~b|256;Jd(this,a<<8);return a&255}function Le(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function Me(a,b){a=b-a;var c=a<<8;b<<=8;this.K&128||(this.Z=this.aa=c,this.U=b&(b^c));return a&255}function Ne(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Oe(a,b){a=b+a;var c=a<<8;this.K&128||(this.Z=this.aa=c,this.U=c&(b<<8^c));return a&255}function Pe(a,b){a=-b;Jd(this,a,a&b&32768);return a&65535}
|
|
|
|
|
function Qe(a,b){a=-b;Jd(this,a<<8,(a&b&128)<<8);return a&255}function Re(a,b){a=b<<1|this.T>>16&1;fe(this,a);return a&65535}function Se(a,b){a=b<<1|this.T>>16&1;fe(this,a<<8);return a&255}function Te(a,b){a=(this.T&65536|b)>>1|b<<16;fe(this,a);return a&65535}function Ue(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;fe(this,a<<8);return a&255}function Ve(a,b){var c=b-a;ge(this,c,a,b);return c&65535}function We(a,b){var c=b-a;ge(this,c<<8,a<<8,b<<8);return c&255}
|
|
|
|
|
function Xe(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ye(a,b){a^=b;Q(this,a);return a&65535}function Ze(a){S(this,a,re(this,a),ze);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function $e(a){var b=ue(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.aa=c;this.b-=(this.g?6:7)+b}
|
|
|
|
|
function af(a){var b=ue(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.aa=d>>16|d;this.b-=(this.g?6:7)+b}function bf(a){T(this,a,!Bd(this))}function cf(a){T(this,a,Bd(this))}
|
|
|
|
|
function df(a){S(this,a,re(this,a),Fe);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ef(a){R(this,a,qe(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ff(a){S(this,a,re(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function gf(a){R(this,a,qe(this,a),Ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function hf(a){var b=re(this,a);a=ue(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function jf(a){var b=qe(this,a);a=te(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function kf(a){T(this,a,Dd(this))}function lf(a){T(this,a,!Ed(this)==!Cd(this))}function mf(a){T(this,a,!Dd(this)&&!Ed(this)==!Cd(this))}function nf(a){T(this,a,!Bd(this)&&!Dd(this))}
|
|
|
|
|
function of(a){T(this,a,Dd(this)||!Ed(this)!=!Cd(this))}function pf(a){T(this,a,Bd(this)||Dd(this))}function qf(a){T(this,a,!Ed(this)!=!Cd(this))}function rf(a){T(this,a,Ed(this))}function sf(a){T(this,a,!Dd(this))}function tf(a){T(this,a,!Ed(this))}function uf(){this.sa(12,0,-8);this.b-=5}function vf(a){T(this,a,!0)}function wf(a){T(this,a,!Cd(this))}function xf(a){T(this,a,Cd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.aa=1);a&8&&(this.Z=0);this.b-=5}
|
|
|
|
|
function yf(a){var b=re(this,a);a=ue(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;ge(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function zf(a){var b=qe(this,a);a=te(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);ge(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}
|
|
|
|
|
function Af(a){var b=ue(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.aa=d>>16|d,this.Z=d>>16):(this.U=32768,this.aa=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.aa=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function Bf(){this.sa(24,0,-8);this.b-=25}
|
|
|
|
|
function Cf(){this.N&49152?(this.Ha|=128,this.sa(4,0,-7)):(this.A&&1120==this.Va&&this.A.setData(this.u[0],!0),this.i?Df(this.i):this.da());this.b-=7}function Ef(){this.sa(16,0,-8);this.b-=25}var Ff=[0,7,7,10,7,11,9,13];function Gf(a){this.I=this.b;O(this,se(this,a));this.b=this.I-Ff[this.g]}var Hf=[0,14,14,17,14,18,16,20];function If(a){this.I=this.b;var b=se(this,a);a=a>>6&7;he(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Hf[this.g]}
|
|
|
|
|
var Jf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Kf(a){var b=re(this,a);this.I=this.b;Q(this,we(this,a,b));this.b=this.I-Jf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Lf(a){var b=qe(this,a);Q(this,ve(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Mf=[7,13,13,17,14,18,17,21];
|
|
|
|
|
function Nf(a){var b=ue(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.K&128||(this.Z=b>>16,this.aa=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Of(){this.b-=5}function Pf(){this.N&49152||(this.v.reset(),bc(this),this.A&&this.A.setData(this.u[0],!0));this.b-=667}function Qf(a){if(a&8)V.call(this,a);else{var b=je(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}
|
|
|
|
|
function Rf(){ie(this);this.b-=13}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.aa=0);a&8&&(this.Z=32768);this.b-=5}function Sf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Tf(a){S(this,a,re(this,a),Ve);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Uf(a){S(this,a,0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)}function Vf(){this.sa(28,0,-8);this.b-=5}
|
|
|
|
|
function Wf(){this.A&&(this.A.jc(this.u[7],!0),this.A.setData(this.u[0],!0));this.K|=4;Gd(this,-2);this.b-=3}function Xf(a){S(this,a,this.u[a>>6&7],Ye);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Df(b)):b=!1;b||this.sa(8,0,-8)}function yd(a){Yf[a>>12].call(this,a)}function Zf(a){$f[a>>6&3].call(this,a)}function ag(a){bg[a>>6&3].call(this,a)}function cg(a){dg[a>>6&3].call(this,a)}function eg(a){fg[a&15].call(this,a)}
|
|
|
|
|
function gg(a){hg[a&15].call(this,a)}function ig(a){jg[a>>6&3].call(this,a)}function kg(a){lg[a>>6&3].call(this,a)}function mg(a){ng[a>>6&3].call(this,a)}
|
|
|
|
|
var Yf=[function(a){og[a>>8&15].call(this,a)},Kf,yf,hf,df,ff,Ze,V,function(a){pg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,Tf,V],og=[function(a){qg[a>>4&15].call(this,a)},vf,sf,kf,lf,qf,mf,of,If,If,Zf,ag,cg,V,V,V],$f=[function(a){Jd(this,we(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Je);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ne);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Le);this.b-=this.g?9:3+(7==this.f?2:0)}],bg=[function(a){S(this,a,0,
|
|
|
|
|
Pe);this.b-=this.g?11:6},function(a){S(this,a,Bd(this)?1:0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Bd(this)?1:0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ue(this,a);Jd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],dg=[function(a){S(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,De);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
|
|
|
|
qg=[function(a){rg[a&15].call(this,a)},V,V,V,Gf,Gf,Gf,Gf,Qf,V,eg,gg,Uf,Uf,Uf,Uf],rg=[Cf,Wf,Rf,uf,Ef,Pf,V,V,V,V,V,V,V,V,V,V],fg=[Of,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.aa=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],hg=[Of,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.aa=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],pg=[tf,rf,nf,pf,wf,xf,bf,cf,Bf,Vf,ig,kg,mg,V,V,V],jg=[function(a){Jd(this,
|
|
|
|
|
ve(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)}],lg=[function(a){R(this,a,0,Qe);this.b-=this.g?11:6},function(a){R(this,a,Bd(this)?1:0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Bd(this)?1:0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=te(this,a);Jd(this,a<<8);this.b-=this.g?4:3+
|
|
|
|
|
(7==this.f?2:0)}],ng=[function(a){R(this,a,0,Ue);this.b-=this.g?9+(this.Eb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Ee);this.b-=this.g?9+(this.Eb&1):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 zd(a){sg[a>>12].call(this,a)}
|
|
|
|
|
var sg=[function(a){tg[a>>8&15].call(this,a)},Kf,yf,hf,df,ff,Ze,function(a){ug[a>>8&15].call(this,a)},function(a){vg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,Tf,V],tg=[function(a){wg[a>>4&15].call(this,a)},vf,sf,kf,lf,qf,mf,of,If,If,Zf,ag,cg,function(a){xg[a>>6&3].call(this,a)},V,V],xg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.qa(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=oe(this,a,0);he(this,a);Q(this,a);this.b-=11},function(a){var b=je(this);this.I=
|
|
|
|
|
this.b;pe(this,a,0,b);Q(this,b);this.b=this.I-Mf[this.g]},function(a){Q(this,we(this,a,Ed(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],wg=[function(a){yg[a&15].call(this,a)},V,V,V,Gf,Gf,Gf,Gf,Qf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.K|=1),this.b-=5):V.call(this,a)},eg,gg,Uf,Uf,Uf,Uf],yg=[Cf,Wf,function(){ie(this);this.K|=this.N&16;this.b-=13},uf,Ef,Pf,Rf,function(){this.sa(8,0,-8)},V,V,V,V,V,V,V,V],ug=[Nf,Nf,Af,Af,$e,$e,af,af,Xf,Xf,V,V,V,V,Sf,Sf],vg=[tf,rf,nf,pf,
|
|
|
|
|
wf,xf,bf,cf,Bf,Vf,ig,kg,mg,function(a){zg[a>>6&3].call(this,a)},V,V],zg=[V,function(a){a=oe(this,a,65536);he(this,a);Q(this,a);this.b-=11},function(a){var b=je(this);this.I=this.b;pe(this,a,65536,b);Q(this,b);this.b=this.I-Mf[this.g]},V];
|
|
|
|
|
function Ag(a){t.call(this,"ROM",a,Ag,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.A=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);Bg(c)})}}z(Ag);k=Ag.prototype;
|
|
|
|
|
k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Bg(this)};k.Ga=function(){this.ga&&(this.i&&Ug(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0};
|
|
|
|
|
function Bg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[Ag.prototype.Nd,Ag.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,ad)){for(c=0;c<a.g.length;c++)a.v.qb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.A?b.push(a.A):
|
|
|
|
|
null!=a.A&&a.A.length&&(b=a.A);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.B,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Nd=function(a){return this.g[a-this.B]};k.Fe=function(){};Za(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Ag(d);B(d,c)}});
|
|
|
|
|
function Vg(a){t.call(this,"RAM",a,Vg);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.La=a.load;this.Ka=a.exec;this.A=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(qb(c.Qa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.La&&(c.La=a.La),null==c.Ka&&(c.Ka=a.Ka)):c.f=null);Wg(c)})}}
|
|
|
|
|
z(Vg);Vg.prototype.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Wg(this)};Vg.prototype.Ga=function(){this.ga&&(this.i&&Ug(this.i,this.id,this.C,this.B,this.ga),delete this.ga);return!0};Vg.prototype.Fa=function(){return!0};function Wg(a){if(a.v&&(!a.A&&a.B&&xc(a.v,a.C,a.B,Ac)&&(a.A=!0),!wb(a))){if(!a.A)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Xg(a,a.g,a.La,a.Ka,a.C)}H(a)}}
|
|
|
|
|
Vg.prototype.reset=function(){if(this.A){for(var a=this.v,b=this.C,c=this.B,d=b&a.v,b=b>>>a.ja;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.A.length){var f=a.g.indexOf(e);0<=f&&(e=a.A[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(zb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.Yb(d,g,e.F+d)}c-=a.za;b++;d=0}this.g&&Xg(this,this.g,this.La,this.Ka,this.C,!0)}};
|
|
|
|
|
function Xg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.qb(n++,b[v++]&255);else n&1?a.b.da():null==d&&
|
|
|
|
|
(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.b.qb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.uc=d,a.v.reset(),bc(a),O(a,d),Uc(a,0),!f&&a.i&&(a.da()||qd(a.i)));return g}Za(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Vg(d);B(d,c)}});function Yg(a){t.call(this,"Keyboard",a,Yg,65536);H(this)}z(Yg);Yg.prototype.ra=function(){return!1};
|
|
|
|
|
Yg.prototype.Ea=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Za(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Yg(d);B(d,c)}});
|
|
|
|
|
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.$=a.upperCase;this.A=this.D=null;this.S=a.tabSize;this.R=a.charBOL;this.H=0;t.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=Zg;b&&(void 0===c&&(c="Panel"),(c=tb(c,this.id))&&(b=c.G[b])&&this.ra(null,a,b))}this.I=this.L=null;this.exports={connect:this.wc,receiveData:this.hc}}z(X);var Zg="buffer";k=X.prototype;
|
|
|
|
|
k.ra=function(a,b,c){var d=this;switch(b){case Zg:return this.G[b]=this.A=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.hc(b);return!0},c.onkeypress=function(a){a=a||window.event;d.hc(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
|
|
|
|
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ka=Qc(48,4);this.X=Gc(this.b,function(){e.f&128||!e.B.length||(e.J=e.B.shift()&255,e.$&&97<=e.J&&122>e.J&&(e.J-=32),e.f|=128,e.f&64&&Hc(e.b,e.ka))});this.M=Qc(52,4);this.ia=Gc(this.b,function(){e.g|=128;e.g&64&&Hc(e.b,e.M)});Hb(b,this,$g);Jb(b,this.reset.bind(this));H(this)};
|
|
|
|
|
k.wc=function(){if(!this.I){var a=nd(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Qa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ga=function(a,b){if(!b)if(this.wc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
|
|
|
|
k.Fa=function(a){return a?this.save():!0};k.reset=function(){ah(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return ah(this)};function ah(a){a.J=0;a.f=0;a.g=128;a.B=[];return!0}k.hc=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);Pc(this.b,this.X,1E3/Math.round(this.O/10));return!0};k.Hd=function(){return this.f&65534};
|
|
|
|
|
k.ze=function(a){this.f=this.f&-112|a&111};k.Gd=function(){this.f&=-129;0<this.B.length&&Pc(this.b,this.X,1E3/Math.round(this.O/10));return this.J};k.ye=function(){};k.ae=function(){return this.g};k.Te=function(a){this.g&128&&(a&64?Hc(this.b,this.M):Hd(this.b,this.M));this.g=this.g&-70|a&69};k.$d=function(){return 0};
|
|
|
|
|
K.prototype.Ne,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Wd,K.prototype.Oe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Ud,K.prototype.Me,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.zb,K.prototype.Db,"R0SET0"],L[65473]=[null,null,K.prototype.zb,K.prototype.Db,"R1SET0"],L[65474]=[null,null,K.prototype.zb,K.prototype.Db,"R2SET0"],L[65475]=[null,null,K.prototype.zb,K.prototype.Db,"R3SET0"],L[65476]=[null,null,K.prototype.zb,K.prototype.Db,"R4SET0"],L[65477]=[null,null,K.prototype.zb,K.prototype.Db,
|
|
|
|
|
"R5SET0"],L[65478]=[null,null,K.prototype.Cd,K.prototype.ue,"R6KERNEL"],L[65479]=[null,null,K.prototype.Fd,K.prototype.xe,"R7KERNEL"],L[65480]=[null,null,K.prototype.Ab,K.prototype.Eb,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.Ab,K.prototype.Eb,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.Ab,K.prototype.Eb,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.Ab,K.prototype.Eb,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.Ab,K.prototype.Eb,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.Ab,
|
|
|
|
|
K.prototype.Eb,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Dd,K.prototype.ve,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Ed,K.prototype.we,"R6USER",1,1145],L[65504]=[null,null,K.prototype.md,K.prototype.ge,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Dc,K.prototype.Kc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Dc,K.prototype.Kc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Td,K.prototype.Le,"SYSID",1,1170],L[65526]=[null,null,K.prototype.ld,K.prototype.fe,"CPUERR",1,1170],L[65528]=
|
|
|
|
|
[null,null,K.prototype.td,K.prototype.ne,"MB",1,1170],L[65530]=[null,null,K.prototype.yd,K.prototype.qe,"PIR"],L[65532]=[null,null,K.prototype.Sd,K.prototype.Ke,"SL"],L[65534]=[null,null,K.prototype.Bd,K.prototype.te,"PSW"],L);Za(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new Wc(c);B(c,d);break;case "rl11":c=new M(c),B(c,d)}}});var Xc;
|
|
|
|
|
if(zb){var Yc=new ArrayBuffer(2);(new DataView(Yc)).setUint16(0,256,!0);Xc=256===(new Uint16Array(Yc))[0]}else Xc=!1;var Zc=Xc;
|
|
|
|
|
function I(a,b,c,d,e,f){this.v=a;this.id=$c+=2;this.b=null;this.F=b;this.Pb=c;this.size=d||0;this.type=e||ad;this.f=e==bd;this.controller=null;sc(this);this.Ua=this.Sc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],cd(this,f.Nc);else if(zb)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),cd(this,Zc?dd:ed);else{a=this.b=Array(this.size>>
|
|
|
|
|
2);for(f=0;f<a.length;f++)a[f]=0;cd(this,fd)}else cd(this)}var ad=0,Ac=1,bd=2,yc=4,Bc=["NONE","RAM","ROM","VID","H/W"],$c=0;
|
|
|
|
|
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(zb)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.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(zb)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Ua=!0}return!1},nb:function(a,b){b?this.C++||gd(this,hd,!1):this.g++||id(this,hd,!1)},K:function(a,b){this.i&&F(this.i,128)&&E(this.i,
|
|
|
|
|
"attempt to read invalid address "+J(this.i,b),!0);this.v.Fa(b,32,2);return 255},A:function(a,b,c){this.i&&F(this.i,128)&&E(this.i,"attempt to write "+J(this.i,b)+" to invalid addresses "+J(this.i,c),!0);this.v.Fa(c,32,4)},L:function(a,b){return this.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Zb(a++,b&255,c++);this.Zb(a,b>>8,c)},S:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ca:function(a,b){a&1&&this.v.Fa(b,64,2);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+
|
|
|
|
|
1]&255)<<8},ua:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]=this.b[c]&~(255<<a)|b<<a;this.Ua=!0},La:function(a,b,c){a&1&&this.v.Fa(c,64,4);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},O:function(a,b){if(this.i&&null!=this.F){var c=this.i;jd(c,this.F+a,1,c.M)&&c.da(!0)}return this.hc(a,b)},Sa:function(a,b){if(this.i&&null!=this.F){var c=this.i;jd(c,this.F+a,2,c.M)&&c.da(!0)}return this.ic(a,b)},Za:function(a,
|
|
|
|
|
b,c){if(this.i&&null!=this.F){var d=this.i;jd(d,this.F+a,1,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.$b(a,b,c)},xa:function(a,b,c){if(this.i&&null!=this.F){var d=this.i;jd(d,this.F+a,2,d.D)&&d.da(!0)}this.f?this.A(a,b,c):this.mc(a,b,c)},M:function(a){return this.G[a]},R:function(a,b){a=this.G[a];this.i&&F(this.i,128)&&E(this.i,"Memory.readByte("+J(this.i,b)+"): "+J(this.i,a),!0);return a},X:function(a,b){a&1&&this.v.Fa(b,64,2);return this.D.getUint16(a,!0)},ba:function(a,b){a&1&&this.v.Fa(b,64,2);
|
|
|
|
|
a=this.I[a>>1];this.i&&F(this.i,128)&&E(this.i,"Memory.readWord("+J(this.i,b)+"): "+J(this.i,a),!0);return a},ia:function(a,b){this.G[a]=b;this.Ua=!0},ma:function(a,b,c){this.G[a]=b;this.Ua=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0)},wa:function(a,b,c){a&1&&this.v.Fa(c,64,4);this.D.setUint16(a,b,!0);this.Ua=!0},Ca:function(a,b,c){a&1&&this.v.Fa(c,64,4);this.I[a>>1]=b;this.Ua=!0;this.i&&F(this.i,128)&&E(this.i,"Memory.writeWord("+J(this.i,c)+","+J(this.i,
|
|
|
|
|
b)+")",!0)}};function sc(a,b,c){a.i=b;a.g=a.C=0;c&&((a.g=c.g)&&id(a,hd,!1),(a.C=c.C)&&gd(a,hd,!1))}function kd(a,b){b?--a.C||(a.Zb=a.f?a.A:a.$b,a.Qb=a.f?a.H:a.mc):--a.g||(a.Vb=a.hc,a.ra=a.ic)}function gd(a,b,c){c&&a.C||(a.Zb=!a.f&&b[1]||a.A,a.Qb=!a.f&&b[3]||a.H);if(c||void 0===c)a.$b=b[1]||a.A,a.mc=b[3]||a.H}function id(a,b,c){c&&a.g||(a.Vb=b[0]||a.K,a.ra=b[2]||a.L);if(c||void 0===c)a.hc=b[0]||a.K,a.ic=b[2]||a.L}function cd(a,b){b||(b=ld);id(a,b,void 0);gd(a,b,void 0)}
|
|
|
|
|
var ld=[],fd=[I.prototype.S,I.prototype.ua,I.prototype.ca,I.prototype.La],hd=[I.prototype.O,I.prototype.Za,I.prototype.Sa,I.prototype.xa];if(zb)var ed=[I.prototype.M,I.prototype.ia,I.prototype.X,I.prototype.wa],dd=[I.prototype.R,I.prototype.ma,I.prototype.ba,I.prototype.Ca];
|
|
|
|
|
function md(a,b){t.call(this,"CPU",a,md,1);b=a.cycles||b;var c=a.multiplier||1;this.tb=0;this.mb=b;this.eb=c;this.Fb=Math.round(this.mb/1E4)/100;this.pb=this.Fb*this.eb;this.w.W=!1;this.w.Yb=!1;this.w.sb=a.autoStart;this.w.ub=!1;this.Lb=this.ua=0;this.Mb=a.csStart;this.wb=a.csInterval;this.xb=a.csStop;this.K=[];this.Cc=this.be.bind(this);H(this)}z(md);var nd=["power","reset"];k=md.prototype;
|
|
|
|
|
k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.i=d;this.A=a.A;for(b=0;b<nd.length;b++)(c=this.G[nd[b]])&&this.C.sa(null,nd[b],c);a=od(a,"autoStart");null!=a&&(this.w.sb="true"==a?!0:"false"==a?!1:!!a);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
|
|
|
|
k.Ia=function(a,b){if(!b){if(a&&this.restore){pd(this);if(!this.restore(a))return!1;qd(this)}else this.reset();this.i?(a=this.i,b=this.w.sb,a.kb=!0,a.j("Type ? for help with PDPjs Debugger commands"),rd(a),b||a.rb(),a.$a&&(b=a.$a,a.$a=null,sd(a,b))):this.j("No debugger detected")}return!0};k.Ha=function(a){return a?this.save():!0};k.sb=function(){return this.w.sb||!this.i&&void 0===this.G.run?(this.ib(),!0):!1};k.sc=function(){return 0};
|
|
|
|
|
function qd(a){void 0===a.Mb&&(a.Mb=0);void 0===a.wb&&(a.wb=-1);void 0===a.xb&&(a.xb=-1);a.w.ub=0<=a.Mb&&0<a.wb;a.w.ub&&(a.Lb=0,a.ua=a.Mb-a.ia)}function ec(a,b){if(a.w.ub){var c=!1;a.Lb=a.Lb+a.sc()|0;a.ua-=b;0>=a.ua&&(a.ua+=a.wb,c=!0);0<=a.xb&&a.xb<=td(a)&&(a.wb=a.xb=-1,qd(a),a.da(),c=!0);c&&a.j(td(a)+" cycles: checksum="+p(a.Lb))}}
|
|
|
|
|
k.sa=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.G[b]=c,!0;case "run":return this.G[b]=c,c.onclick=function(){var a;if(a=d.C)if(a=d.C,a.w.ha)a=!0;else{var b=null,c,h=rb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.w.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.w.ha);c++);c==h.length&&(b=a);q("The "+b.type+" component ("+b.id+") is not "+(b.w.ready?"powered yet":"ready yet"+(b.Tb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.da():d.ib())},
|
|
|
|
|
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){ud(d,d.eb<<1,!0)},c.textContent=this.pb.toFixed(2)+"Mhz",!0}return!1};k.pa=function(a){this.C&&this.C.pa(a)};function dc(a,b,c){a.ia+=b;c&&(a.ca=a.b=a.I=0)}function vd(a,b){var c=1;b&&1<a.eb&&a.ma&&(c=a.ma/a.Fb);a.zc=Math.round(1E3/30);a.ob=Math.floor(a.mb/30*c);b||(a.wa=a.ob);a.Gb=0}function td(a){return a.ia+a.X+a.ca-a.b}function pd(a){a.ma=0;a.Ac=0;a.ia=a.X=a.ca=a.b=a.I=0;qd(a);ud(a,1)}
|
|
|
|
|
function ud(a,b,c){var d=!1;if(void 0!==b){.8>a.ma/a.pb?b=1:d=!0;a.eb=b;b=a.Fb*a.eb;if(a.pb!=b){a.pb=b;b=a.pb.toFixed(2)+"Mhz";var e=a.G.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.C&&a.C.rb()}dc(a,a.X);a.X=0;a.S=Aa();a.ba=0;vd(a);return d}function Gc(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Pc(a,b,c,d){0<=b&&b<a.K.length&&(d||0>a.K[b][0])&&(c=a.mb*a.eb/1E3*c|0,a.w.W&&(c+=wd(a)),a.K[b][0]=c)}
|
|
|
|
|
function xd(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function cc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function wd(a,b){var c=a.ca-=a.b;a.b=a.I=0;b&&(a.ca=0);return c}
|
|
|
|
|
k.be=function(){if(this.w.W){this.Gb>=this.mb&&vd(this,!0);this.La=0;this.kb=Aa();if(this.ba){var a=this.kb-this.ba;a>this.zc&&(this.S+=a,this.S>this.kb&&(this.S=this.kb))}try{do{var b=xd(this,this.w.ub?1:this.ob);try{this.jb(b)}catch(e){if("number"!=typeof e)throw e;}b=wd(this,!0);this.La+=b;this.X+=b;ec(this,b);cc(this,b);this.wa-=b;if(0>=this.wa){this.wa+=this.ob;15<=++this.Ac&&(this.pa(),this.Ac=0);break}}while(this.w.W)}catch(e){this.da();this.C&&this.C.stop(Aa(),td(this));yb(this,e.stack||e.message);
|
|
|
|
|
return}if(this.w.W){a=setTimeout;b=this.Cc;this.ba=Aa();var c=this.zc;this.La&&(c=Math.round(c*this.La/this.ob));var c=c-(this.ba-this.kb),d=this.ba-this.S;d&&(this.ma=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ia=0,ud(this)));if(0>c||this.ma<this.pb)-1E3>c&&(this.S-=c),c=0;this.Gb+=this.La;this.ba+=c;a(b,c)}}};
|
|
|
|
|
k.ib=function(a){if(xb(this))return!1;if(this.w.W)return this.j(this.toString()+" busy"),!1;ud(this);this.w.W=!0;this.w.Yb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.rb(!0),this.C.start(this.S,td(this)));setTimeout(this.Cc,0);return!0};k.jb=function(){return 0};k.da=function(a){var b=!1;if(this.w.W){wd(this);dc(this,this.X);this.X=0;this.w.W=!1;if(b=this.G.run)b.textContent="Run";this.C&&this.C.stop(Aa(),td(this));b=!0}this.w.complete=a;return b};
|
|
|
|
|
function yd(a){this.Va=+a.model||1170;this.xc=a.addrReset||0;md.call(this,a,6666667);this.decode=1120==this.Va?zd.bind(this):Ad.bind(this);Bd(this);this.M=0;this.O=null;this.w.complete=!1}z(yd,md);k=yd.prototype;k.reset=function(){this.status("model "+this.Va);this.w.W&&this.da();Bd(this);pd(this);this.w.error=!1;this.parent.reset.call(this)};
|
|
|
|
|
function Bd(a){a.T=65536;a.U=32768;a.$=65535;a.Z=32768;a.N=15;a.u=[0,0,0,0,0,0,0,a.xc];a.Xa=[0,0,0,0,0,0];a.Ka=[0,0,0,0];a.B=0;a.lb=0;a.Xc=[4,2,0,1];a.V=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.ya=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];a.Ob=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
|
|
|
0,0,0,0,0,0,0,0,0];a.Gc=[0,0,0,0,0,0,0,0];a.Fc=0;a.J=0;a.D=a.H=0;a.g=a.f=a.vb=0;a.xa=-1;bc(a)}function bc(a){a.Xb=255;a.Ja=0;a.jc=0;a.Ba=0;a.Hb=0;a.Jb=0;a.fb=0;a.L=0;a.$a=0;a.Ca=262143;a.oa=0;a.O=null;a.v&&Tc(a)}function Tc(a){a.L?(a.R=65536,a.vc=a.fb&16?4186112:253952,a.aa=a.Vc,a.ra=a.Zd,a.Qb=a.Re,uc(a.v,a.fb&16?22:18)):(a.R=0,a.vc=57344,a.aa=a.Uc,a.ra=a.Ec,a.Qb=a.Lc,uc(a.v,16))}
|
|
|
|
|
function Sc(a,b){b&=-3073;if(a.Ba!=b){b&57344&&!(a.Ba&57344)&&(a.Hb=a.oa>>16&65535,a.Jb=a.oa&65535);a.Ba=b;a.$a=b>>5&3;a.lb=b>>1&15;var c=0;b&257&&(c=4,b&1&&(c|=2));a.L!=c&&(a.L=c,Tc(a))}}k.sc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ia,this.eb]);a.set(2,Dc(this.v));return a.data()};
|
|
|
|
|
k.restore=function(a){var b=a[1];this.ia=b[1];ud(this,b[3]);a:{b=this.v;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.Y[d];if(!f||!f.restore(e)){q("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function Cd(a){return a.T&65536?1:0}function Dd(a){return a.U&32768?2:0}function Ed(a){return a.$&65535?0:4}function Fd(a){return a.Z&32768?8:0}
|
|
|
|
|
function Gd(a){var b=a.u[7];a.oa=b;var c=a.ra(b);a.u[7]=b+2&65535;return c}function Hd(a,b){var c=a.u[7];a.u[7]=c+b&65535;return c}function O(a,b){a.u[7]=b&65535}function Qc(a,b){return{de:a,yb:b,next:null}}function Id(a,b){var c=a.O;if(c==b)a.O=b.next;else for(;c;){a=c.next;if(a==b){c.next=a.next;break}c=a}}function Hc(a,b){if(b!=a.O){var c=a.O;if(!c||c.yb<=b.yb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.yb<=b.yb){b.next=d;c.next=b;break}c=d}while(c)}}a.J|=1}
|
|
|
|
|
function Jd(a){return a.J&64?(a.ta(168,64,-5),!0):a.J&32?(a.ta(4,32,-4),!0):a.J&16?(a.ta(12,16,-6),!0):!1}function Uc(a){return a.N=a.N&63728|Fd(a)|Ed(a)|Dd(a)|Cd(a)}function Vc(a,b){a.Z=b<<12;a.$=~b&4;a.U=b<<14;a.T=b<<16;if((b^a.N)&2048)for(var c=a.Xa.length;0<=--c;){var d=a.u[c];a.u[c]=a.Xa[c];a.Xa[c]=d}a.B=b>>14&3;c=a.N>>14&3;a.B!=c&&(a.Ka[c]=a.u[6],a.u[6]=a.Ka[a.B]);a.N=b;a.J|=2}function Q(a,b){a.J&128||(a.Z=a.$=b,a.U=0)}function Kd(a,b,c){a.J&128||(a.Z=a.$=a.T=b,a.U=c||0)}
|
|
|
|
|
function fe(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^b)&(d^b))}function ge(a,b){a.J&128||(a.Z=a.$=a.T=b,a.U=a.Z^a.T>>1)}function he(a,b,c,d){a.J&128||(a.Z=a.$=a.T=b,a.U=(c^d)&(d^b))}
|
|
|
|
|
k.ta=function(a,b,c){if(!this.M){0>this.xa?this.xa=Uc(this):this.B||(a=4,this.Ja|=4,this.u[6]=4,c=-3);this.oa=a;this.B=0;var d=this.ra(a|this.R),e=this.ra(a+2&65535|this.R);Vc(this,e&-12289|this.xa>>2&12288);ie(this,this.xa);ie(this,this.u[7]);O(this,d);this.J&=~(b|18);this.J|=9;this.xa=-1;this.jd=a;this.hd=c;if(-3<=c)throw a;}};function je(a){var b=ke(a),c=ke(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);O(a,b);Vc(a,c);a.J&=-17}
|
|
|
|
|
function Cc(a,b){var c=b>>13&31;31>c&&a.fb&32&&(b=a.Ob[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
|
|
|
|
function le(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.vc),f;d=b>>13;a.fb&a.Xc[a.B]||(d&=7);e=a.V[a.B][d];f=(a.ya[a.B][d]<<6)+(b&8191)&a.Ca;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.V[a.B][d]=e;if(f!=(4194170&a.Ca)||a.B)a.$a=a.B,a.lb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.Ba&
|
|
|
|
|
57344||(g|=a.$a<<5|a.lb<<1,Sc(a,a.Ba&-61695|g)),b=!0),a.Ba&61440||!(f<(4191360&a.Ca)||f>(4194239&a.Ca))||(a.Ba|=4096,a.Ba&512&&(a.J|=64)),b&&a.ta(168,0,-1));return f}function me(a,b){return a.v.Ib(b)}function ke(a){var b=a.ra(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function ie(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.oa=a.oa&65535|(a.oa&-65536)<<8|16121856;ne(a,0,c);a.Qb(c,b)}function ne(a,b,c){!a.B&&c<=a.Xb&&(b||4<c)&&(1145<=a.Va&&c<=a.Xb-32?(a.Ja|=4,a.u[6]=4,a.ta(4,0,-3)):(a.Ja|=8,a.J|=32))}
|
|
|
|
|
function oe(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return a.ta(4,0,-2),0;case 1:return 6==c&&d&4&&ne(a,b,a.u[6]),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=a.ra(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.ra(e)|g;a.b-=8;break;case 6:return e=a.ra(Hd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.ra(Hd(a,2)),e=e+
|
|
|
|
|
a.u[c]&65535,e=a.ra(e|a.R)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.oa=a.oa&65535|(a.oa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&ne(a,b,a.u[6]);return e}k.Ub=function(a){if(!this.L)return this.v.Ub(a);this.M++;a=me(this,le(this,a,3));this.M--;return a};k.cb=function(a){if(!this.L)return this.v.cb(a);this.M++;a=this.Ec(le(this,a,2));this.M--;return a};k.qb=function(a,b){this.L?(this.M++,a=le(this,a,5),a&1&&this.b--,this.v.Bb(a,b),this.M--):this.v.qb(a,b)};
|
|
|
|
|
k.Cb=function(a,b){this.L?(this.M++,this.Lc(le(this,a,4),b),this.M--):this.v.Cb(a,b)};k.Uc=function(a,b,c){return oe(this,a,b,c)};k.Vc=function(a,b,c){return le(this,oe(this,a,b,c),c)};k.Ec=function(a){return this.v.na(a)};k.Zd=function(a){return this.v.na(le(this,a,2))};k.Lc=function(a,b){this.v.hb(a,b&65535)};k.Re=function(a,b){this.v.hb(le(this,a,4),b)};
|
|
|
|
|
function pe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=oe(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.B=a.N>>12&3,c=a.ra(d|c&a.R),a.B=a.N>>14&3):c=6!=d||(a.N>>2&12288)===(a.N&12288)?a.u[d]:a.Ka[a.N>>12&3];return c}function qe(a,b,c,d){a.oa=a.oa&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=oe(a,b,e,4),c&65536||(e&=65535),a.B=a.N>>12&3,e=le(a,e|c&65536,4),a.B=a.N>>14&3,a.v.hb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ka[a.N>>12&3]=d}
|
|
|
|
|
function re(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?me(a,a.aa(b,c,3)):-c-1}function se(a,b){var c;b>>=6;var d=a.H=b&7;(b=a.D=(b&56)>>3)?c=a.v.na(a.aa(b,d,2)):c=-d-1;return c}function te(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return oe(a,b,c,8)}function ue(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?me(a,a.aa(b,c,3)):a.u[c]&255}function ve(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.v.na(a.aa(b,c,2)):a.u[c]}
|
|
|
|
|
function R(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.vb=a.aa(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,me(a,e)),e&1&&a.b--,a.v.Bb(e,c)):(b=a.u[e],c=0>c?a.u[-c-1]&255:c,a.u[e]=b&65280|d.call(a,c,b&255))}function S(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.aa(b,e,6),a.v.hb(e,d.call(a,0>c?a.u[-c-1]:c,a.v.na(e)))):a.u[e]=d.call(a,0>c?a.u[-c-1]:c,a.u[e])}
|
|
|
|
|
function we(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,e,5),e=c=0>c?a.u[-c-1]&255:c,d&1&&a.b--,a.v.Bb(d,e)):c?(c=0>c?a.u[-c-1]&255:c,a.u[e]=a.u[e]&~d|c<<24>>24&d):a.u[e]&=~d;return c}function xe(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.aa(b,d,4),a.v.hb(d,c=0>c?a.u[-c-1]:c)):a.u[d]=c=0>c?a.u[-c-1]:c;return c}function T(a,b,c){c&&(O(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3}
|
|
|
|
|
k.jb=function(a){this.w.complete=!0;var b=this.i?ye(this.i)?1:this.w.Yb?-1:0:0,c=a?this.w.Yb?0:1:-1;this.w.Yb=!1;this.ca=this.b=a;do{if(b){if(ze(this.i,this.u[7],c)){this.da();break}c||c++;b++}if(this.J){if(a=this.J&7)if(a=!1,this.J&2){this.J&=-3;var d=160,e=(this.jc&224)>>5,f=this.O&&this.O.yb>e?this.O:null;f&&(d=f.de,e=f.yb);e>(this.N&224)>>5?(this.J&4&&(Hd(this,2),this.J&=-5),this.ta(d,0,-9),e=!0):e=!1;e&&(f&&Id(this,f),a=!0)}else this.J&1&&this.J++;if(a){if(b&&ze(this.i,this.u[7],c)){this.da();
|
|
|
|
|
break}if(0>c)break}if(this.J&112&&Jd(this)){if(b&&ze(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.J=this.J&7|this.N&16;this.decode(Gd(this))}while(0<this.b);return this.w.complete?this.ca-this.b:void 0===this.w.complete?0:-1};Za(function(){for(var a=D(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new yd(d);B(d,c)}});function Ae(a,b){var c=b+a;fe(this,c,a,b);return c&65535}function Be(a,b){var c=b+a;fe(this,c<<8,a<<8,b<<8);return c&255}
|
|
|
|
|
function Ce(a,b){a=b<<1;ge(this,a);return a&65535}function De(a,b){a=b<<1;ge(this,a<<8);return a&255}function Ee(a,b){a=b&32768|b>>1|b<<16;ge(this,a);return a&65535}function Fe(a,b){a=b&128|b>>1|b<<8;ge(this,a<<8);return a&255}function Ge(a,b){a=b&~a;Q(this,a);return a}function He(a,b){a=b&~a;Q(this,a<<8);return a}function Ie(a,b){a|=b;Q(this,a);return a}function Je(a,b){a|=b;Q(this,a<<8);return a}function Ke(a,b){a=~b|65536;Kd(this,a);return a&65535}
|
|
|
|
|
function Le(a,b){a=~b|256;Kd(this,a<<8);return a&255}function Me(a,b){a=b-a;this.J&128||(this.Z=this.$=a,this.U=b&(b^a));return a&65535}function Ne(a,b){a=b-a;var c=a<<8;b<<=8;this.J&128||(this.Z=this.$=c,this.U=b&(b^c));return a&255}function Oe(a,b){a=b+a;this.J&128||(this.Z=this.$=a,this.U=a&(b^a));return a&65535}function Pe(a,b){a=b+a;var c=a<<8;this.J&128||(this.Z=this.$=c,this.U=c&(b<<8^c));return a&255}function Qe(a,b){a=-b;Kd(this,a,a&b&32768);return a&65535}
|
|
|
|
|
function Re(a,b){a=-b;Kd(this,a<<8,(a&b&128)<<8);return a&255}function Se(a,b){a=b<<1|this.T>>16&1;ge(this,a);return a&65535}function Te(a,b){a=b<<1|this.T>>16&1;ge(this,a<<8);return a&255}function Ue(a,b){a=(this.T&65536|b)>>1|b<<16;ge(this,a);return a&65535}function Ve(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;ge(this,a<<8);return a&255}function We(a,b){var c=b-a;he(this,c,a,b);return c&65535}function Xe(a,b){var c=b-a;he(this,c<<8,a<<8,b<<8);return c&255}
|
|
|
|
|
function Ye(a,b){this.J&128||(this.Z=this.$=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Ze(a,b){a^=b;Q(this,a);return a&65535}function $e(a){S(this,a,se(this,a),Ae);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function af(a){var b=ve(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.T=this.U=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.T=c<<17-b,c>>=b;else if(b)if(16<b)this.U=c,c=0;else{this.T=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.U=32768)}this.u[a]=c&65535;this.Z=this.$=c;this.b-=(this.g?6:7)+b}
|
|
|
|
|
function bf(a){var b=ve(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.T=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.T=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.U=32768)):d=c;this.u[a]=d>>16&65535;this.u[a|1]=d&65535;this.Z=d>>16;this.$=d>>16|d;this.b-=(this.g?6:7)+b}function cf(a){T(this,a,!Cd(this))}function df(a){T(this,a,Cd(this))}
|
|
|
|
|
function ef(a){S(this,a,se(this,a),Ge);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function ff(a){R(this,a,re(this,a),He);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function gf(a){S(this,a,se(this,a),Ie);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function hf(a){R(this,a,re(this,a),Je);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
|
|
|
|
function jf(a){var b=se(this,a);a=ve(this,a);Q(this,(0>b?this.u[-b-1]:b)&a);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function kf(a){var b=re(this,a);a=ue(this,a);Q(this,((0>b?this.u[-b-1]&255:b)&a)<<8);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function lf(a){T(this,a,Ed(this))}function mf(a){T(this,a,!Fd(this)==!Dd(this))}function nf(a){T(this,a,!Ed(this)&&!Fd(this)==!Dd(this))}function of(a){T(this,a,!Cd(this)&&!Ed(this))}
|
|
|
|
|
function pf(a){T(this,a,Ed(this)||!Fd(this)!=!Dd(this))}function qf(a){T(this,a,Cd(this)||Ed(this))}function rf(a){T(this,a,!Fd(this)!=!Dd(this))}function sf(a){T(this,a,Fd(this))}function tf(a){T(this,a,!Ed(this))}function uf(a){T(this,a,!Fd(this))}function vf(){this.ta(12,0,-8);this.b-=5}function wf(a){T(this,a,!0)}function xf(a){T(this,a,!Dd(this))}function yf(a){T(this,a,Dd(this))}function U(a){a&1&&(this.T=0);a&2&&(this.U=0);a&4&&(this.$=1);a&8&&(this.Z=0);this.b-=5}
|
|
|
|
|
function zf(a){var b=se(this,a);a=ve(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;he(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}function Af(a){var b=re(this,a);a=ue(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);he(this,c,a,b);this.b-=this.g?4+(this.H&&6<=this.f?1:0):(this.D?4:3)+(7==this.f?2:0)}
|
|
|
|
|
function Bf(a){var b=ve(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.T=this.U=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.$=d>>16|d,this.Z=d>>16):(this.U=32768,this.$=d>>15|d,this.Z=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.$=this.Z=0,this.U=32768,this.T=65536,this.b-=7}function Cf(){this.ta(24,0,-8);this.b-=25}
|
|
|
|
|
function Df(){this.N&49152?(this.Ja|=128,this.ta(4,0,-7)):(this.A&&1120==this.Va&&this.A.setData(this.u[0],!0),this.i?Ef(this.i):this.da());this.b-=7}function Ff(){this.ta(16,0,-8);this.b-=25}var Gf=[0,7,7,10,7,11,9,13];function Hf(a){this.I=this.b;O(this,te(this,a));this.b=this.I-Gf[this.g]}var If=[0,14,14,17,14,18,16,20];function Jf(a){this.I=this.b;var b=te(this,a);a=a>>6&7;ie(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-If[this.g]}
|
|
|
|
|
var Kf=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Lf(a){var b=se(this,a);this.I=this.b;Q(this,xe(this,a,b));this.b=this.I-Kf[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Mf(a){var b=re(this,a);Q(this,we(this,a,b,65535)<<8);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}var Nf=[7,13,13,17,14,18,17,21];
|
|
|
|
|
function Of(a){var b=ve(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.J&128||(this.Z=b>>16,this.$=this.Z|b,this.U=0,this.T=-32768>b||32767<b?65536:0);this.b-=23}function Pf(){this.b-=5}function Qf(){this.N&49152||(this.v.reset(),bc(this),this.A&&this.A.setData(this.u[0],!0));this.b-=667}function Rf(a){if(a&8)V.call(this,a);else{var b=ke(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}
|
|
|
|
|
function Sf(){je(this);this.b-=13}function W(a){a&1&&(this.T=65536);a&2&&(this.U=32768);a&4&&(this.$=0);a&8&&(this.Z=32768);this.b-=5}function Tf(a){var b=(a&448)>>6;if(this.u[b]=this.u[b]-1&65535)O(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function Uf(a){S(this,a,se(this,a),We);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Vf(a){S(this,a,0,Ye);this.b-=this.g?9:3+(7==this.f?2:0)}function Wf(){this.ta(28,0,-8);this.b-=5}
|
|
|
|
|
function Xf(){this.A&&(this.A.kc(this.u[7],!0),this.A.setData(this.u[0],!0));this.J|=4;Hd(this,-2);this.b-=3}function Yf(a){S(this,a,this.u[a>>6&7],Ze);this.b-=this.g?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,F(b,1)?(E(b,"undefined opcode "+J(b,a),!0,!0),b=Ef(b)):b=!1;b||this.ta(8,0,-8)}function zd(a){Zf[a>>12].call(this,a)}function $f(a){ag[a>>6&3].call(this,a)}function bg(a){cg[a>>6&3].call(this,a)}function dg(a){eg[a>>6&3].call(this,a)}function fg(a){gg[a&15].call(this,a)}
|
|
|
|
|
function hg(a){ig[a&15].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}function ng(a){og[a>>6&3].call(this,a)}
|
|
|
|
|
var Zf=[function(a){pg[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,$e,V,function(a){qg[a>>8&15].call(this,a)},Mf,Af,kf,ff,hf,Uf,V],pg=[function(a){rg[a>>4&15].call(this,a)},wf,tf,lf,mf,rf,nf,pf,Jf,Jf,$f,bg,dg,V,V,V],ag=[function(a){Kd(this,xe(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ke);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Oe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)}],cg=[function(a){S(this,a,0,
|
|
|
|
|
Qe);this.b-=this.g?11:6},function(a){S(this,a,Cd(this)?1:0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Cd(this)?1:0,We);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ve(this,a);Kd(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],eg=[function(a){S(this,a,0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ee);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ce);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
|
|
|
|
rg=[function(a){sg[a&15].call(this,a)},V,V,V,Hf,Hf,Hf,Hf,Rf,V,fg,hg,Vf,Vf,Vf,Vf],sg=[Df,Xf,Sf,vf,Ff,Qf,V,V,V,V,V,V,V,V,V,V],gg=[Pf,function(){this.T=0;this.b-=5},function(){this.U=0;this.b-=5},U,function(){this.$=1;this.b-=5},U,U,U,function(){this.Z=0;this.b-=5},U,U,U,U,U,U,U],ig=[Pf,function(){this.T=65536;this.b-=5},function(){this.U=32768;this.b-=5},W,function(){this.$=0;this.b-=5},W,W,W,function(){this.Z=32768;this.b-=5},W,W,W,W,W,W,W],qg=[uf,sf,of,qf,xf,yf,cf,df,Cf,Wf,jg,lg,ng,V,V,V],kg=[function(a){Kd(this,
|
|
|
|
|
we(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Le);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Pe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,1,Ne);this.b-=this.g?9:3+(7==this.f?2:0)}],mg=[function(a){R(this,a,0,Re);this.b-=this.g?11:6},function(a){R(this,a,Cd(this)?1:0,Be);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Cd(this)?1:0,Xe);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=ue(this,a);Kd(this,a<<8);this.b-=this.g?4:3+
|
|
|
|
|
(7==this.f?2:0)}],og=[function(a){R(this,a,0,Ve);this.b-=this.g?9+(this.vb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Te);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Fe);this.b-=this.g?9+(this.vb&1):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 Ad(a){tg[a>>12].call(this,a)}
|
|
|
|
|
var tg=[function(a){ug[a>>8&15].call(this,a)},Lf,zf,jf,ef,gf,$e,function(a){vg[a>>8&15].call(this,a)},function(a){wg[a>>8&15].call(this,a)},Mf,Af,kf,ff,hf,Uf,V],ug=[function(a){xg[a>>4&15].call(this,a)},wf,tf,lf,mf,rf,nf,pf,Jf,Jf,$f,bg,dg,function(a){yg[a>>6&3].call(this,a)},V,V],yg=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.ra(a|this.R);O(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=pe(this,a,0);ie(this,a);Q(this,a);this.b-=11},function(a){var b=ke(this);this.I=
|
|
|
|
|
this.b;qe(this,a,0,b);Q(this,b);this.b=this.I-Nf[this.g]},function(a){Q(this,xe(this,a,Fd(this)?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],xg=[function(a){zg[a&15].call(this,a)},V,V,V,Hf,Hf,Hf,Hf,Rf,function(a){a&8?(this.N&49152||(this.N=this.N&-2017|(a&7)<<5,this.J|=1),this.b-=5):V.call(this,a)},fg,hg,Vf,Vf,Vf,Vf],zg=[Df,Xf,function(){je(this);this.J|=this.N&16;this.b-=13},vf,Ff,Qf,Sf,function(){this.ta(8,0,-8)},V,V,V,V,V,V,V,V],vg=[Of,Of,Bf,Bf,af,af,bf,bf,Yf,Yf,V,V,V,V,Tf,Tf],wg=[uf,sf,of,qf,
|
|
|
|
|
xf,yf,cf,df,Cf,Wf,jg,lg,ng,function(a){Ag[a>>6&3].call(this,a)},V,V],Ag=[V,function(a){a=pe(this,a,65536);ie(this,a);Q(this,a);this.b-=11},function(a){var b=ke(this);this.I=this.b;qe(this,a,65536,b);Q(this,b);this.b=this.I-Nf[this.g]},V];
|
|
|
|
|
function Bg(a){t.call(this,"ROM",a,Bg,256);this.ga=this.g=null;this.B=a.addr;this.f=a.size;this.D=!1;this.A=a.alias;this.C=a.file;this.H=ra(this.C);if(this.C){a=this.C;var b=sa(this.H);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.C+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load ROM resource (error "+f+": "+a+")"),c.C=null):(qb(c.Sa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga):c.C=null);Cg(c)})}}z(Bg);k=Bg.prototype;
|
|
|
|
|
k.Ga=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Cg(this)};k.Ia=function(){this.ga&&(this.i&&Vg(this.i,this.id,this.B,this.f,this.ga),delete this.ga);return!0};k.Ha=function(){return!0};
|
|
|
|
|
function Cg(a){if(!wb(a)){if(a.C){if(!a.g||!a.v)return;a.f||(a.f=a.g.length);if(a.g.length!=a.f)yb(a,"ROM size ("+p(a.g.length,8,!0)+") does not match specified size ("+p(a.f,8,!0)+")");else{var b;a:{b=a.B;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[Bg.prototype.Nd,Bg.prototype.Fe,null,null,null,a.f>>1],c);if(Hb(a.v,a,b)){b=a.D=!0;break a}}else if(xc(a.v,b,a.f,bd)){for(c=0;c<a.g.length;c++)a.v.qb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.A?b.push(a.A):
|
|
|
|
|
null!=a.A&&a.A.length&&(b=a.A);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.B,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Nd=function(a){return this.g[a-this.B]};k.Fe=function(){};Za(function(){for(var a=D(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Bg(d);B(d,c)}});
|
|
|
|
|
function Wg(a){t.call(this,"RAM",a,Wg);this.ga=this.g=null;this.C=a.addr;this.B=a.size;this.Na=a.load;this.Ma=a.exec;this.A=!1;this.f=a.file;this.D=ra(this.f);if(this.f){a=this.f;var b=sa(this.D);"json"!=b&&"hex"!=b&&(a=Fa()+"/api/v1/dump?file="+this.f+"&format=bytes&decimal=true");var c=this;Da(a,null,!0,function(a,b,f){f?(c.P("Unable to load RAM resource (error "+f+": "+a+")"),c.f=null):(qb(c.Sa,a,b),(a=Ea(a,b))?(c.g=a.ea,c.ga=a.ga,null==c.Na&&(c.Na=a.Na),null==c.Ma&&(c.Ma=a.Ma)):c.f=null);Xg(c)})}}
|
|
|
|
|
z(Wg);Wg.prototype.Ga=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Xg(this)};Wg.prototype.Ia=function(){this.ga&&(this.i&&Vg(this.i,this.id,this.C,this.B,this.ga),delete this.ga);return!0};Wg.prototype.Ha=function(){return!0};function Xg(a){if(a.v&&(!a.A&&a.B&&xc(a.v,a.C,a.B,Ac)&&(a.A=!0),!wb(a))){if(!a.A)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Yg(a,a.g,a.Na,a.Ma,a.C)}H(a)}}
|
|
|
|
|
Wg.prototype.reset=function(){if(this.A){for(var a=this.v,b=this.C,c=this.B,d=b&a.v,b=b>>>a.ja;0<c&&b<a.Y.length;){var e=a.Y[b];if(e.controller&&a.g&&a.g.length==a.A.length){var f=a.g.indexOf(e);0<=f&&(e=a.A[f])}if(e){var f=c,g=0,h,d=d||0,g=g&255;void 0===f&&(f=e.size);if(zb&&e.G)for(h=d;f--&&h<e.G.length;h++)e.G[h]=g;else for(h=d;f--&&h<e.size;h++)e.$b(d,g,e.F+d)}c-=a.za;b++;d=0}this.g&&Yg(this,this.g,this.Na,this.Ma,this.C,!0)}};
|
|
|
|
|
function Yg(a,b,c,d,e,f){var g=!1;if(null==c)for(var h=0;h<b.length-1;){var l=b[h]&255|(b[h+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(h+6>=b.length)break;for(var h=h+2,m=b[h++]&255|(b[h++]&255)<<8,n=b[h++]&255|(b[h++]&255)<<8,l=l+((m&255)+(m>>8)+(n&255)+(n>>8)),v=h,r=m-=6;0<m&&h<b.length;)l+=b[h++]&255,m--;if(m||h>=b.length)break;l+=b[h++]&255;if(l&255)break;if(r)for(E(a,"loading "+p(r,4,!0)+" bytes at "+p(n,4,!0)+"-"+p(n+r-1,4,!0),1048576);r--;)a.b.qb(n++,b[v++]&255);else n&1?a.b.da():null==d&&
|
|
|
|
|
(d=n),null!=d&&E(a,"starting address: "+p(d,4,!0),1048576);g=!0}else h++;else h+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.b.qb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.xc=d,a.v.reset(),bc(a),O(a,d),Vc(a,0),!f&&a.i&&(a.da()||rd(a.i)));return g}Za(function(){for(var a=D(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Wg(d);B(d,c)}});function Zg(a){t.call(this,"Keyboard",a,Zg,65536);H(this)}z(Zg);Zg.prototype.sa=function(){return!1};
|
|
|
|
|
Zg.prototype.Ga=function(a,b,c,d){this.C=a;this.b=c;this.i=d};Za(function(){for(var a=D(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Zg(d);B(d,c)}});
|
|
|
|
|
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.ba=a.upperCase;this.A=this.D=null;this.S=a.tabSize;this.R=a.charBOL;this.H=0;t.call(this,"SerialPort",a,X,8388608);var b=a.binding;if("console"==b)this.D="";else{var c;a=$g;b&&(void 0===c&&(c="Panel"),(c=tb(c,this.id))&&(b=c.G[b])&&this.sa(null,a,b))}this.I=this.L=null;this.exports={connect:this.wc,receiveData:this.Wb}}z(X);var $g="buffer";k=X.prototype;
|
|
|
|
|
k.sa=function(a,b,c){var d=this;switch(b){case $g:return this.G[b]=this.A=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.Wb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Wb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Wb(a.getData("Text"))},
|
|
|
|
|
c.removeAttribute("readonly"),!0}return!1};k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;var e=this;this.ma=Qc(48,4);this.X=Gc(this.b,function(){e.f&128||!e.B.length||(e.K=e.B.shift()&255,e.ba&&97<=e.K&&122>e.K&&(e.K-=32),e.f|=128,e.f&64&&Hc(e.b,e.ma))});this.M=Qc(52,4);this.ia=Gc(this.b,function(){e.g|=128;e.g&64&&Hc(e.b,e.M)});Hb(b,this,ah);Jb(b,this.reset.bind(this));H(this)};
|
|
|
|
|
k.wc=function(){if(!this.I){var a=od(this.C,"connection");if(a){var b=a.split("->");if(2==b.length){var c=xa(b[0]);if(c!=this.Za)return;b=xa(b[1]);if(this.I=sb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.Sa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};k.Ia=function(a,b){if(!b)if(this.wc(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
|
|
|
|
k.Ha=function(a){return a?this.save():!0};k.reset=function(){bh(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return bh(this)};function bh(a){a.K=0;a.f=0;a.g=128;a.B=[];return!0}k.Wb=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);Pc(this.b,this.X,1E3/Math.round(this.O/10));return!0};k.Hd=function(){return this.f&65534};
|
|
|
|
|
k.ze=function(a){this.f=this.f&-112|a&111};k.Gd=function(){this.f&=-129;0<this.B.length&&Pc(this.b,this.X,1E3/Math.round(this.O/10));return this.K};k.ye=function(){};k.ae=function(){return this.g};k.Te=function(a){this.g&128&&(a&64?Hc(this.b,this.M):Id(this.b,this.M));this.g=this.g&-70|a&69};k.$d=function(){return 0};
|
|
|
|
|
k.Se=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.A)if(13==a)this.H=0;else if(8==a)this.A.value=this.A.value.slice(0,-1),0<this.H&&this.H--;else{var b;b=(b=ya[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.S||8,c=a-this.H%a,this.S&&(b=wa("",c)));this.R&&!this.H&&c&&(b=String.fromCharCode(this.R)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.D){if(10==a||1024<=this.D.length)this.j(this.D),
|
|
|
|
|
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var bh={},$g=(bh[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],bh[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],bh[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],bh[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],bh);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}});
|
|
|
|
|
function Vc(a){t.call(this,"PC11",a,Vc);this.g=a.autoMount||null;this.D=0;this.$=a.baudReceive||3600;this.J=this.L=this.f=0;this.I=[];this.H=ch;this.A=dh;this.M=this.B="";this.ea=this.La=this.Ka=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Vc);var ch="",dh=0;k=Vc.prototype;
|
|
|
|
|
k.ra=function(a,b,c){var d=this,e=dh;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
|
|
|
|
|
function(){var a=d.G.listTapes;a&&eh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;eh(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
|
|
|
|
|
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=fh(a);var e=this;if((this.g=nd(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Qc(56,4);this.ca=Gc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.J<e.I.length&&(e.L=e.I[e.J++]&255,gh(e,e.J/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Hc(e.b,e.X))});Hb(b,this,hh);Jb(b,this.reset.bind(this));ih(this,"None",ch,!0);this.O&&
|
|
|
|
|
ih(this,"Local Tape","?");ih(this,"Remote Tape","??");jh(this)||H(this)};k.Ga=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function jh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?kh(a,c,b,1,!0):lh(a)}return!!a.D}
|
|
|
|
|
function eh(a,b,c,d,e){if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;kh(a,b,c,d,!1,e)}else mh(a,!1)}
|
|
|
|
|
function kh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.A!=d)g++,mh(a,!0),a.w.ab?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),nh(a,b,c,d,f)?g++:a.w.ab=!0);g&&oh(a,a.M,a.B,a.A,a.ea,a.La,a.Ka)}
|
|
|
|
|
function nh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),oh(a,b,c,d,e),a.H="?");lh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Qa,e,f),(e=Ea(e,f))&&oh(a,b,c,d,e.ea,e.La,
|
|
|
|
|
e.Ka));a.w.ab=!1;a.D&&(a.D--,a.D||H(a));lh(a)})}function ih(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function lh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.B;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function gh(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
|
|
|
|
|
function oh(a,b,c,d,e,f,g){a.M=b;a.B=c;a.A=d;a.ea=e;a.La=f;a.Ka=g;2==d?a.S&&Xg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=ch,a.A=dh,a.P("No load address available for tape: "+b)):(a.J=0,a.I=e,a.status("tape attached: "+b),gh(a,0))}function mh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.A&&a.status(1==a.A?"tape detached":"tape unloaded"),a.H=ch,a.A=dh,lh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Ad=function(){return this.f&65534};
|
|
|
|
|
k.se=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Hc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Pc(this.b,this.ca,1E3/Math.round(this.$/10))));this.f=this.f&-66|a&65};k.zd=function(){this.f&=-129;this.f|=2048;return this.L};k.re=function(){};var ph={},hh=(ph[65384]=[null,null,Vc.prototype.Ad,Vc.prototype.se,"PRS"],ph[65386]=[null,null,Vc.prototype.zd,Vc.prototype.re,"PRB"],ph);
|
|
|
|
|
function qh(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++rh,4)},qh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.A=b;this.Ya=b.name;this.dc=b.dc;sh(this,c,b.ua,b.Aa,b.pa,b.Ma);H(this)}var rh=0;z(qh);k=qh.prototype;k.Ea=function(a,b,c,d){this.i=d};
|
|
|
|
|
function sh(a,b,c,d,e,f){a.mode=b;a.ua=c;a.Aa=d;a.pa=e;a.Ma=f;a.b=[];if("preload"!=a.mode){b=Array(a.ua);for(c=0;c<b.length;c++){d=Array(a.Aa);for(e=0;e<d.length;e++){f=Array(a.pa);for(var g=1;g<=f.length;g++)f[g-1]=th(null,c,e,g,a.Ma,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
|
|
|
|
function uh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Ya=b;a.eb=c;a.Ic=ra(c);a.v=e;a.B=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.ua=e[0];a.Aa=e[1];a.pa=e[2];a.Ma=e[3]||512;c=a.Ma>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.ua);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Aa),w=0;w<r.length;w++)for(var y=r[w]=Array(a.pa),x=0;x<y.length;x++){for(var C=th(null,d,w,x+1,a.Ma,0),ja=C.data,Ka=0;Ka<c;Ka++,f+=4)var P=ja[Ka]=b.getInt32(f,
|
|
|
|
|
!0),e=e+P&-1;C.Ba=c;y[x]=C}a.f=e;c=a}else a.P("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.A,c,a.Ya,a.eb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.dc?"":e)+"&format=json"));return!!Da(f,
|
|
|
|
|
null,!0,function(b,c,d){vh(a,b,c,d)})}
|
|
|
|
|
function vh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{qb(a.controller.Qa,b,c);try{if(0<ra(a.Ic,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Ya]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
|
|
|
|
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.ua=h.length;a.Aa=h[0].length;a.pa=h[0][0].length;var l=h[0][0][0];a.Ma=l&&l.length||512;for(d=c=0;d<a.ua;d++)for(f=0;f<a.Aa;f++)for(g=0;g<a.pa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;wh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}th(l,d,f);for(w=
|
|
|
|
|
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Ya)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.A,e,a.Ya,a.eb),a.v=null)}function th(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.We=b;a.Xe=c;a.Pa=a.Ba=0;a.Ta=!1;return a}
|
|
|
|
|
k.seek=function(a,b,c,d,e){d=null;var f=this.A,g=this.b[a];if(g){var h=g[b];if(!h&&f.Oc&&b<f.Aa)for(h=g[b]=Array(f.Pc),g=0;g<h.length;g++)h[g]=th(null,a,b,g+1,f.Bc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Oc&&9==f.nc&&(d=h[g]=th(null,a,b,f.nc,f.Bc,0))}}e&&e(d,!1);return d};function wh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
|
|
|
|
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Ba?f<a.Pa?(a.Ba+=a.Pa-f,a.Pa=f):f>=a.Pa+a.Ba&&(a.Ba+=f-(a.Pa+a.Ba)+1):(a.Pa=f,a.Ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
|
|
|
|
function xh(a,b){var c=a.Aa*a.pa,d=b/c|0;return d<a.ua?(b%=c,a.seek(d,b/a.pa|0,b%a.pa+1)):null}function yh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
|
|
|
|
|
k.save=function(){var a=0,b=[];b[a++]=[this.eb,this.f,this.ua,this.Aa,this.pa,this.Ma];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Ba){for(var h=[],l=0,m=g.Pa,n=g.Pa+g.Ba;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Pa,h]}}return b};
|
|
|
|
|
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?sh(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
|
|
|
|
|
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.Pa=e;for(h.Ba=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ya+": "+c);return b};
|
|
|
|
|
k.toJSON=function(){var a;a=0;for(var b;b=xh(this,a++);)zh(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
|
|
|
|
function zh(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.A=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype;
|
|
|
|
|
k.ra=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Ah(d,a)},!0;case "loadDrive":return this.G[b]=
|
|
|
|
|
c,c.onclick=function(){var a=d.G.listDisks;a&&Bh(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[la(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=xh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(yh(a,h,l));b=btoa(b);a=a.Ic.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
|
|
|
|
|
this.D="";10!=a&&(this.D+=String.fromCharCode(a))}this.g&=-129;Pc(this.b,this.ia,1E3/Math.round(this.ca/10))}};var ch={},ah=(ch[65392]=[null,null,X.prototype.Hd,X.prototype.ze,"RCSR"],ch[65394]=[null,null,X.prototype.Gd,X.prototype.ye,"RBUF"],ch[65396]=[null,null,X.prototype.ae,X.prototype.Te,"XCSR"],ch[65398]=[null,null,X.prototype.$d,X.prototype.Se,"XBUF"],ch);Za(function(){for(var a=D(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new X(d);B(d,c)}});
|
|
|
|
|
function Wc(a){t.call(this,"PC11",a,Wc);this.g=a.autoMount||null;this.D=0;this.ba=a.baudReceive||3600;this.K=this.L=this.f=0;this.I=[];this.H=dh;this.A=eh;this.M=this.B="";this.ea=this.Na=this.Ma=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Wc);var dh="",eh=0;k=Wc.prototype;
|
|
|
|
|
k.sa=function(a,b,c){var d=this,e=eh;switch(b){case "listTapes":return this.G[b]=c,c.onchange=function(){var a=d.G.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){q("PC11 option error: "+l.message)}b=e.desc;void 0===b&&(b="");e=e.href;void 0!==e&&(b='<a href="'+e+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descTape":return this.G[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.G[b]=c,c.onclick=
|
|
|
|
|
function(){var a=d.G.listTapes;a&&fh(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.O){c.parentNode.removeChild(c);break}this.G[b]=c;c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length});c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;fh(d,ra(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.G[b]=c,!0}return!1};
|
|
|
|
|
k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;this.S=gh(a);var e=this;if((this.g=od(this.C,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(f){q("PC11 auto-mount error: "+f.message+" ("+this.g+")"),this.g=null}this.X=Qc(56,4);this.ca=Gc(this.b,function(){1==(e.f&32769)&&!(e.f&128)&&e.K<e.I.length&&(e.L=e.I[e.K++]&255,hh(e,e.K/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Hc(e.b,e.X))});Hb(b,this,ih);Jb(b,this.reset.bind(this));jh(this,"None",dh,!0);this.O&&
|
|
|
|
|
jh(this,"Local Tape","?");jh(this,"Remote Tape","??");kh(this)||H(this)};k.Ia=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){this.f&=-2241;this.L=0};function kh(a){a.D=0;if(a.g){var b=a.g.path||"",c;if(!(c=a.g.name))a:{if((c=a.G.listTapes)&&c.options)for(var d=0;d<c.options.length;d++){var e=c.options[d];if(e.value==b){c=e.text;break a}}c=ra(b,!0)}b&&c?lh(a,c,b,1,!0):mh(a)}return!!a.D}
|
|
|
|
|
function fh(a,b,c,d,e){if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local tape.');else{if("??"==c){c=window.prompt("Enter the URL of a remote tape image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"');a.H="??"}else a.H=c;lh(a,b,c,d,!1,e)}else nh(a,!1)}
|
|
|
|
|
function lh(a,b,c,d,e,f){var g=-1;if(a.B.toLowerCase()!=c.toLowerCase()||a.A!=d)g++,nh(a,!0),a.w.bb?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),oh(a,b,c,d,f)?g++:a.w.bb=!0);g&&ph(a,a.M,a.B,a.A,a.ea,a.Na,a.Ma)}
|
|
|
|
|
function oh(a,b,c,d,e){var f=c;if(e){var g=new FileReader;g.onload=function(){var e=g.result;e&&(e=new Uint8Array(e,0,e.byteLength),ph(a,b,c,d,e),a.H="?");mh(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=sa(c),f="json"==e||"gz"==e?encodeURI(c):Fa()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!Da(f,null,!0,function(e,f,g){var h=0>g&&a.C&&!a.C.w.ha;g?a.P('Unable to load tape "'+b+'" (error '+g+": "+e+")",h):(qb(a.Sa,e,f),(e=Ea(e,f))&&ph(a,b,c,d,e.ea,e.Na,
|
|
|
|
|
e.Ma));a.w.bb=!1;a.D&&(a.D--,a.D||H(a));mh(a)})}function jh(a,b,c,d){if((a=a.G.listTapes)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function mh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.B;for(var c=0;c<b.options.length;c++)if(b.options[c].value==a){b.selectedIndex!=c&&(b.selectedIndex=c);break}c==b.options.length&&(b.selectedIndex=0)}}function hh(a,b){b|=0;if(b!==a.R){var c=a.G.readProgress;c&&(c=(c=D(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.R=b}}
|
|
|
|
|
function ph(a,b,c,d,e,f,g){a.M=b;a.B=c;a.A=d;a.ea=e;a.Na=f;a.Ma=g;2==d?a.S&&Yg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.B="",a.H=dh,a.A=eh,a.P("No load address available for tape: "+b)):(a.K=0,a.I=e,a.status("tape attached: "+b),hh(a,0))}function nh(a,b){if(a.B||!1===b)a.M="",a.B="",b||(a.A&&a.status(1==a.A?"tape detached":"tape unloaded"),a.H=dh,a.A=eh,mh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Ad=function(){return this.f&65534};
|
|
|
|
|
k.se=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Hc(this.b,this.X)):(this.f&=-129,this.f|=2048,this.L=0,Pc(this.b,this.ca,1E3/Math.round(this.ba/10))));this.f=this.f&-66|a&65};k.zd=function(){this.f&=-129;this.f|=2048;return this.L};k.re=function(){};var qh={},ih=(qh[65384]=[null,null,Wc.prototype.Ad,Wc.prototype.se,"PRS"],qh[65386]=[null,null,Wc.prototype.zd,Wc.prototype.re,"PRB"],qh);
|
|
|
|
|
function rh(a,b,c){t.call(this,"Disk",{id:a.Sa+".disk"+p(++sh,4)},rh,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.A=b;this.Ya=b.name;this.fc=b.fc;th(this,c,b.va,b.Aa,b.qa,b.Oa);H(this)}var sh=0;z(rh);k=rh.prototype;k.Ga=function(a,b,c,d){this.i=d};
|
|
|
|
|
function th(a,b,c,d,e,f){a.mode=b;a.va=c;a.Aa=d;a.qa=e;a.Oa=f;a.b=[];if("preload"!=a.mode){b=Array(a.va);for(c=0;c<b.length;c++){d=Array(a.Aa);for(e=0;e<d.length;e++){f=Array(a.qa);for(var g=1;g<=f.length;g++)f[g-1]=uh(null,c,e,g,a.Oa,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
|
|
|
|
function vh(a,b,c,d,e){var f=c;if(a.v)return!0;a.Ya=b;a.gb=c;a.Ic=ra(c);a.v=e;a.B=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ka[d];if(e){a.va=e[0];a.Aa=e[1];a.qa=e[2];a.Oa=e[3]||512;c=a.Oa>>2;var f=e=0,b=new DataView(b,0,d);a.b=Array(a.va);for(d=0;d<a.b.length;d++)for(var r=a.b[d]=Array(a.Aa),w=0;w<r.length;w++)for(var y=r[w]=Array(a.qa),x=0;x<y.length;x++){for(var C=uh(null,d,w,x+1,a.Oa,0),ja=C.data,Ka=0;Ka<c;Ka++,f+=4)var P=ja[Ka]=b.getInt32(f,
|
|
|
|
|
!0),e=e+P&-1;C.Da=c;y[x]=C}a.f=e;c=a}else a.P("Unrecognized disk format ("+d+" bytes)");a.v&&(a.v.call(a.controller,a.A,c,a.Ya,a.gb),a.v=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=sa(c),"json"==b||"gz"==b?f=encodeURI(c):(d="path",e="&mbhd=10",!c.indexOf("http:")||!c.indexOf("ftp:")||0<="dsk ima img 360 720 12 144".split(" ").indexOf(b)?(d="disk",e="&mbhd=0"):ta(c,"/")&&(d="dir"),f=Fa()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.fc?"":e)+"&format=json"));return!!Da(f,
|
|
|
|
|
null,!0,function(b,c,d){wh(a,b,c,d)})}
|
|
|
|
|
function wh(a,b,c,d){var e=null;a.g=!1;var f=0>d&&a.C&&!a.C.w.ha;if(d)a.controller.P('Unable to load disk "'+a.Ya+'" (error '+d+": "+b+")",f);else{qb(a.controller.Sa,b,c);try{if(0<ra(a.Ic,!0).toLowerCase().indexOf("-readonly"))a.g=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.g=!0)}var h;"<"==c.substr(0,1)?h=["Missing disk image: "+a.Ya]:h=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
|
|
|
|
c+")");if(h.length)if(1==h.length)q(h[0]);else{a.va=h.length;a.Aa=h[0].length;a.qa=h[0][0].length;var l=h[0][0][0];a.Oa=l&&l.length||512;for(d=c=0;d<a.va;d++)for(f=0;f<a.Aa;f++)for(g=0;g<a.qa;g++)if(l=h[d][f][g]){var m=l.length;void 0===m&&(m=l.length=512);var m=m>>2,n=l.pattern;void 0===n&&(n=l.pattern=0);var v=l.data;if(void 0===v){var r=l.bytes;if(void 0!==r&&r.length){for(var w=m<<2,y=r.length;y<w;y++)r[y]=n;xh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}uh(l,d,f);for(w=
|
|
|
|
|
0;w<v.length;w++)c=c+v[w]&-1}a.b=h;a.f=c;e=a}else q("Empty disk image: "+a.Ya)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.B,a.A,e,a.Ya,a.gb),a.v=null)}function uh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.We=b;a.Xe=c;a.Ra=a.Da=0;a.Ua=!1;return a}
|
|
|
|
|
k.seek=function(a,b,c,d,e){d=null;var f=this.A,g=this.b[a];if(g){var h=g[b];if(!h&&f.Oc&&b<f.Aa)for(h=g[b]=Array(f.Pc),g=0;g<h.length;g++)h[g]=uh(null,a,b,g+1,f.Bc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Oc&&9==f.oc&&(d=h[g]=uh(null,a,b,f.oc,f.Bc,0))}}e&&e(d,!1);return d};function xh(a,b){for(var c=0,d=a.length>>2,e=Array(d),f=0;f<d;f++)e[f]=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24,c+=4;a.data=e}
|
|
|
|
|
k.read=function(a,b){var c=-1;if(a&&b<a.length)var c=a.data,d=b>>2,c=(d<c.length?c[d]:a.pattern)>>((b&3)<<3)&255;return c};k.write=function(a,b,c){if(this.g)return!1;if(b<a.length){if(c!=this.read(a,b,!0)){var d=a.data,e=a.pattern,f=b>>2;b=(b&3)<<3;for(var g=d.length;g<=f;g++)d[g]=e;a.Da?f<a.Ra?(a.Da+=a.Ra-f,a.Ra=f):f>=a.Ra+a.Da&&(a.Da+=f-(a.Ra+a.Da)+1):(a.Ra=f,a.Da=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
|
|
|
|
function yh(a,b){var c=a.Aa*a.qa,d=b/c|0;return d<a.va?(b%=c,a.seek(d,b/a.qa|0,b%a.qa+1)):null}function zh(a,b,c){for(var d=1,e=0,f=0;d--;){var g=a.read(b,c++);if(0>g)break;e|=g<<f;f+=8}return e}
|
|
|
|
|
k.save=function(){var a=0,b=[];b[a++]=[this.gb,this.f,this.va,this.Aa,this.qa,this.Oa];if(!this.g)for(var c=this.b,d=0;d<c.length;d++)for(var e=0;e<c[d].length;e++)for(var f=0;f<c[d][e].length;f++){var g=c[d][e][f];if(g&&g.Da){for(var h=[],l=0,m=g.Ra,n=g.Ra+g.Da;m<n;)h[l++]=g.data[m++];b[a++]=[d,e,f,g.Ra,h]}}return b};
|
|
|
|
|
k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0<a.length){var d=0,e=a[d++];e&&2<=e.length&&(!this.b.length&&6<=e.length?th(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.f&&e[1]!=this.f&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.f+")",b=-2));for(this.b.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],h=g[f++],l=g[f++],m=g[f++];if(h>=this.b.length||l>=this.b[h].length||m>=this.b[h][l].length){c="sector (CHS="+h+":"+l+":"+m+") out of range ("+
|
|
|
|
|
b+" changes applied)";b=-1;break}if(this.g){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(h=this.b[h][l][m]){for(l=h.data.length;l<e;)h.data[l++]=h.pattern;l=0;h.Ra=e;for(h.Da=f.length;e<g;)h.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.P("Unable to restore disk '"+this.Ya+": "+c);return b};
|
|
|
|
|
k.toJSON=function(){var a;a=0;for(var b;b=yh(this,a++);)Ah(b);a=JSON.stringify(this.b,function(a,b){if("file"!=a)return b});a=a.replace(/,"length":512/gm,"").replace(/,"pattern":0/gm,"");a=a.replace(/"(sector|length|data|pattern)":/gm,"$1:");a=a.replace(/,"[^"]*":([0-9]+|true|false)/gm,"");a=a.replace(/(sector|length|data|pattern):/gm,'"$1":');return a=a.replace(/([\]}]),/gm,"$1,\n")};
|
|
|
|
|
function Ah(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function M(a){t.call(this,"RL11",a,M,4194304);this.A=a.autoMount||null;this.H=0;this.f=Array(4);this.L=!Ra("Mobi")&&window&&"FileReader"in window}z(M);k=M.prototype;
|
|
|
|
|
k.sa=function(a,b,c){var d=this;switch(b){case "listDisks":return this.G[b]=c,c.onchange=function(){var a=d.G.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(h){q("RL11 option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b='<a href="'+g+'" target="_blank">'+b+"</a>");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.G[b]=c,c.onchange=function(){var a=la(c.value,10);null!=a&&Bh(d,a)},!0;case "loadDrive":return this.G[b]=
|
|
|
|
|
c,c.onclick=function(){var a=d.G.listDisks;a&&Ch(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.L){c.parentNode.removeChild(c);break}this.G[b]=c;c.onclick=function(){var a=d.G.listDrives;if(a&&a.options&&d.f)if(a=d.f[la(a.value,10)||0])if(a=a.Ea){var b;b="";for(var c=0,h;h=yh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(zh(a,h,l));b=btoa(b);a=a.Ic.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
|
|
|
|
|
"string"!=typeof c.download&&(c=null));c?(c.href=b,c.download=a,document.body.appendChild(c),c.click(),document.body.removeChild(c),a="Check your Downloads folder for "+a+"."):(window.open(b),a="Check your browser for a new window/tab containing the requested data"+(a?" ("+a+")":"")+".");q(a)}else d.P("No disk loaded in drive.");else d.P("No disk drive selected.")};return!0;case "mountDrive":if(this.L)return this.G[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=
|
|
|
|
|
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Bh(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
|
|
|
k.Ea=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.A=nd(this.C,"autoMount")||this.A)&&"string"==typeof this.A)try{this.A=eval("("+this.A+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.A+")"),this.A=null}Ch(this);this.O=Qc(112,5);Hb(b,this,Dh);Jb(b,this.reset.bind(this));Eh(this,"None","",!0);this.L&&Eh(this,"Local Disk","?");Eh(this,"Remote Disk","??");Fh(this)||H(this)};
|
|
|
|
|
k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.qc){for(a=0;a<this.f.length;a++)Gh(this,a,!0);Fh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Ah(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){Ch(this)};k.save=function(){return(new N(this)).data()};
|
|
|
|
|
k.restore=function(a){return Ch(this,a[0])};function Fh(a,b){b||(a.H=0);if(a.A)for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Hh(a,g,f,e,!0)&&b&&H(a,!1);continue}a.P("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
|
|
|
|
|
function Bh(a,b,c,d){var e=a.G.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Hh(a,e,b,c,!1,d)}else Gh(a,e)}
|
|
|
|
|
function Hh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.eb.toLowerCase()!=d.toLowerCase()&&(g++,Gh(a,b,!0),h.cc?a.P("RL11 busy"):(h.cc=!0,e&&(h.bc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Qb=!!f,uh(new qh(a,h,"preload"),c,d,f,a.Tc)&&g++));return g}
|
|
|
|
|
k.Tc=function(a,b,c,d,e){var f;a.cc=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.ua||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.ec)),b=null);b?(a.Ca=b,a.Ya=c,a.eb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.ec),a.bc||e),this.C&&this.C.rb()):a.Qb=!1;a.bc&&(a.bc=!1,--this.H||H(this));Ah(this,a.ec)};
|
|
|
|
|
function Eh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function Ah(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Qb?"?":c.eb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Gh(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Ya="",d.eb="",d.Ca=null,d.Qb=!1,c||(a.P("Drive RL"+b+" unloaded",c),Ah(a,b))}
|
|
|
|
|
function Ch(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.B=b[c++]||0;a.D=b[c++]||0;a.J=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.ec=b;d.cc=d.Qb=!1;d.name=c.Za;d.ua=512;d.Aa=2;d.pa=40;d.Ma=256;d.dc=!0;d.Ve=0;d.Ue=0;d.nc=1;d.Pc=d.pa;d.Bc=d.Ma;d.Ye=0;d.$e=null;d.Ca||(d.eb="");d.status=29|(512==d.ua?128:0)}return!0}
|
|
|
|
|
k.Rc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.J=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0};
|
|
|
|
|
k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ca.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ca.read(m,n++))||0>(r=a.Ca.read(m,n++))){h=5120;break}this.v.fb(f,v|r<<8);if(Fc(this.v)){h=8192;break}f+=2;if(n>=l.Ma&&(m=null,++d>=l.pa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};
|
|
|
|
|
k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ca,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Fc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ca.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ca.write(m,n++,v&255)||!a.Ca.write(m,n++,v>>8)){h=5120;break}if(n>=l.Ma&&(m=null,++d>=l.pa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.ua)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.fa&65535};
|
|
|
|
|
k.Ce=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.ua||f>=c.pa?this.fa|=37888:
|
|
|
|
|
(g=(this.J&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Rc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Hc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.J};k.Be=function(a){this.J=a&63};
|
|
|
|
|
var Ih={},Dh=(Ih[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Ih[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Ih[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Ih[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Ih[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Ih);function Jh(a){t.call(this,"Debugger",a,Jh);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Jh);
|
|
|
|
|
var Kh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Jh.prototype.sc=function(){return-1};Jh.prototype.tc=function(){};
|
|
|
|
|
function Lh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.R?b="end":b=a.g[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(xa(b.substring(c,f))),c=f+1}}return a}
|
|
|
|
|
function Mh(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;
|
|
|
|
|
!a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Ch(d,ra(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
|
|
|
|
k.Ga=function(a,b,c,d){this.C=a;this.v=b;this.b=c;this.i=d;if((this.A=od(this.C,"autoMount")||this.A)&&"string"==typeof this.A)try{this.A=eval("("+this.A+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.A+")"),this.A=null}Dh(this);this.O=Qc(112,5);Hb(b,this,Eh);Jb(b,this.reset.bind(this));Fh(this,"None","",!0);this.L&&Fh(this,"Local Disk","?");Fh(this,"Remote Disk","??");Gh(this)||H(this)};
|
|
|
|
|
k.Ia=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.rc){for(a=0;a<this.f.length;a++)Hh(this,a,!0);Gh(this,!0)}}else if(!this.restore(a))return!1;if(a=this.G.listDrives){for(;a.firstChild;)a.removeChild(a.firstChild);a.value="";for(b=0;4>b;b++){var c=document.createElement("option");c.value=b;c.text="RL"+b;a.appendChild(c)}a.value="0";Bh(this,0)}}return!0};k.Ha=function(a){return a?this.save():!0};k.reset=function(){Dh(this)};k.save=function(){return(new N(this)).data()};
|
|
|
|
|
k.restore=function(a){return Dh(this,a[0])};function Gh(a,b){b||(a.H=0);if(a.A)for(var c in a.A){var d=a.A[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.G.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var h=f.options[g];if(h.value==e){f=h.text;break a}}f=ra(e,!0)}if(e&&f&&(g=-1,c&&(g=c.charCodeAt(c.length-1)-48,0>g||9<g)&&(g=-1),0<=g&&g<a.f.length)){!Ih(a,g,f,e,!0)&&b&&H(a,!1);continue}a.P("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.H}
|
|
|
|
|
function Ch(a,b,c,d){var e=a.G.listDrives,e=e&&la(e.value,10);if(void 0===e||0>e||e>=a.f.length)a.P("Unable to load the selected drive");else if(c)if("?"==c)a.P('Use "Choose File" and "Mount" to select and load a local disk.');else{if("??"==c){c=window.prompt("Enter the URL of a remote disk image.","")||"";if(!c)return;b=ra(c);a.status("Attempting to load "+c+' as "'+b+'"')}Ih(a,e,b,c,!1,d)}else Hh(a,e)}
|
|
|
|
|
function Ih(a,b,c,d,e,f){var g=-1,h=a.f[b];h.gb.toLowerCase()!=d.toLowerCase()&&(g++,Hh(a,b,!0),h.ec?a.P("RL11 busy"):(h.ec=!0,e&&(h.dc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Rb=!!f,vh(new rh(a,h,"preload"),c,d,f,a.Tc)&&g++));return g}
|
|
|
|
|
k.Tc=function(a,b,c,d,e){var f;a.ec=!1;b&&(f=b.b.length?[b.b.length,b.b[0].length,b.b[0][0].length,b.b[0][0][0].length]:[0,0,0,0],b&&f[0]>a.va||f[1]>a.Aa)&&(this.P('Disk "'+c+'" too large for drive '+("RL"+a.gc)),b=null);b?(a.Ea=b,a.Ya=c,a.gb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.gc),a.dc||e),this.C&&this.C.rb()):a.Rb=!1;a.dc&&(a.dc=!1,--this.H||H(this));Bh(this,a.gc)};
|
|
|
|
|
function Fh(a,b,c,d){if((a=a.G.listDisks)&&a.options){for(var e=0;e<a.options.length;e++)if(a.options[e].value==c)return;e=document.createElement("option");e.text=b;e.value=c;d&&a.childNodes[0]?a.insertBefore(e,a.childNodes[0]):a.appendChild(e)}}
|
|
|
|
|
function Bh(a,b){if(0<=b&&b<a.f.length){var c=a.f[b],d=a.G.listDisks;a=a.G.listDrives;if(d&&a&&d.options&&a.options&&(a=la(a.value,10),c=c.Rb?"?":c.gb,!isNaN(a)&&a==b)){for(b=0;b<d.options.length;b++)if(d.options[b].value==c){d.selectedIndex!=b&&(d.selectedIndex=b);break}b==d.options.length&&(d.selectedIndex=0)}}}function Hh(a,b,c){var d=a.f[b];if(d.Ea||!1===c)d.Ya="",d.gb="",d.Ea=null,d.Rb=!1,c||(a.P("Drive RL"+b+" unloaded",c),Bh(a,b))}
|
|
|
|
|
function Dh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.B=b[c++]||0;a.D=b[c++]||0;a.K=b[c]||0;for(b=0;b<a.f.length;b++){var d=a.f[b];void 0===d&&(d=a.f[b]={});c=a;d.gc=b;d.ec=d.Rb=!1;d.name=c.Za;d.va=512;d.Aa=2;d.qa=40;d.Oa=256;d.fc=!0;d.Ve=0;d.Ue=0;d.oc=1;d.Pc=d.qa;d.Bc=d.Oa;d.Ye=0;d.$e=null;d.Ea||(d.gb="");d.status=29|(512==d.va?128:0)}return!0}
|
|
|
|
|
k.Rc=function(a,b,c,d,e,f){this.I=f&65535;this.fa=this.fa&-49|f>>12&48;this.K=f>>16&63;this.B=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0};
|
|
|
|
|
k.nd=function(a,b,c,d,e,f,g){var h=0,l=a.Ea,m=null,n;l||(h=5120,e=0);for(;e--;){if(!m){m=a.Ea.seek(b,c,d+1);if(!m){h=5120;break}n=0}var v,r;if(0>(v=a.Ea.read(m,n++))||0>(r=a.Ea.read(m,n++))){h=5120;break}this.v.hb(f,v|r<<8);if(Fc(this.v)){h=8192;break}f+=2;if(n>=l.Oa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};
|
|
|
|
|
k.he=function(a,b,c,d,e,f,g){var h=0,l=a.Ea,m=null,n;l||(h=5120,e=0);for(;e--;){var v=this.v.na(f);if(Fc(this.v)){h=8192;break}f+=2;if(!m){m=a.Ea.seek(b,c,d+1,!0);if(!m){h=5120;break}n=0}if(!a.Ea.write(m,n++,v&255)||!a.Ea.write(m,n++,v>>8)){h=5120;break}if(n>=l.Oa&&(m=null,++d>=l.qa&&(d=0,++c>=l.Aa&&(c=0,++b>=l.va)))){h=5120;break}}return g(h,b,c,d,e,f)};k.Kd=function(){return this.fa&65535};
|
|
|
|
|
k.Ce=function(a){this.fa=this.fa&-1023|a&1022;this.M=this.M&-4|(a&48)>>4;if(!(this.fa&128)){var b;a=!0;var c=this.f[(this.fa&768)>>8],d,e,f,g;this.fa&=-2;switch(this.fa&14){case 4:this.g&8&&(this.fa&=63);this.D=c.status|this.B&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.B=this.g&4?this.B+b:this.B-b,this.g=this.B=this.B&65408|c);break;case 8:this.D=this.B;break;case 12:b=this.nd;case 10:b||(b=this.he),d=this.g>>7,e=this.g&64?1:0,f=this.g&63,d>=c.va||f>=c.qa?this.fa|=37888:
|
|
|
|
|
(g=(this.K&63)<<16|this.I,a=65536-this.D&65535,a=b.call(this,c,d,e,f,a,g,this.Rc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Hc(this.b,this.O))}};k.Id=function(){return this.I};k.Ae=function(a){this.I=a&65534};k.Ld=function(){return this.g};k.De=function(a){this.g=a};k.Md=function(){return this.D};k.Ee=function(a){this.D=a};k.Jd=function(){return this.K};k.Be=function(a){this.K=a&63};
|
|
|
|
|
var Jh={},Eh=(Jh[63744]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLCS"],Jh[63746]=[null,null,M.prototype.Id,M.prototype.Ae,"RLBA"],Jh[63748]=[null,null,M.prototype.Ld,M.prototype.De,"RLDA"],Jh[63750]=[null,null,M.prototype.Md,M.prototype.Ee,"RLMP"],Jh[63752]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBE"],Jh);function Kh(a){t.call(this,"Debugger",a,Kh);this.ca=a.base||16;this.Ca=!1;this.K=0;this.R=!1;this.B=-1;this.g=[];this.X={}}z(Kh);
|
|
|
|
|
var Lh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Kh.prototype.tc=function(){return-1};Kh.prototype.uc=function(){};
|
|
|
|
|
function Mh(a,b,c,d){if(c)if(b){0>a.B&&a.g.length&&(a.B=0);if(0>a.B||b!=a.g[a.B])a.g.splice(0,0,b),a.B=0;a.B--}else a.R?b="end":b=a.g[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(xa(b.substring(c,f))),c=f+1}}return a}
|
|
|
|
|
function Nh(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 Nh(a,b,c){var d;if(b){b=Oh(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Ph(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++],r=n.length;l.length&&Kh[n]<Kh[l[l.length-1]]&&Mh(h,l,1);l.push(n);b=b.substr(v+r)}Mh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Qh(a,null,
|
|
|
|
|
d))}return d}function Oh(a,b){for(var c,d=a.xa?"(":"{",e=a.xa?")":"}",f=new RegExp(a.xa?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Nh(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(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
|
|
|
|
function Ph(a,b,c,d){var e;null!=b?(e=a.sc(b),0<=e?e=a.tc(e):(e=a.X[b],null==e&&(e=la(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
|
|
|
|
|
function Qh(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+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Rh(a,b){if(b)return Qh(a,b,a.X[b]);var c=0;for(b in a.X)Qh(a,b,a.X[b]),c++;return 0<c}
|
|
|
|
|
function Oh(a,b,c){var d;if(b){b=Ph(a,b);for(var e=0,f=!1,g=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],v=n.length,n=xa(n);if(!n){f=!0;break}n=Qh(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++],r=n.length;l.length&&Lh[n]<Lh[l[l.length-1]]&&Nh(h,l,1);l.push(n);b=b.substr(v+r)}Nh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Rh(a,null,
|
|
|
|
|
d))}return d}function Ph(a,b){for(var c,d=a.Ca?"(":"{",e=a.Ca?")":"}",f=new RegExp(a.Ca?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(f))&&!(0<=c[1].indexOf(d));){var g=Oh(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(a=b;b=a.match(/\$([a-z]+)/i);){c=null;switch(b[1].toLowerCase()){case "ops":c=0}if(null==c)break;a=a.replace(b[0],c.toString())}return a}
|
|
|
|
|
function Qh(a,b,c,d){var e;null!=b?(e=a.tc(b),0<=e?e=a.uc(e):(e=a.X[b],null==e&&(e=la(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
|
|
|
|
|
function Rh(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+". "+qa(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e}function Sh(a,b){if(b)return Rh(a,b,a.X[b]);var c=0;for(b in a.X)Rh(a,b,a.X[b]),c++;return 0<c}
|
|
|
|
|
function J(a,b,c,d){switch(a.ca){case 8:a=qa(b,3*c-(2<c?1:0));break;case 10:a=b.toString();break;default:a=p(b,2*c)}d?d=a.replace(/^0+([0-9A-F]+)$/i,"$1"):d=a;return d}
|
|
|
|
|
function Sh(a){Jh.call(this,a);this.ib=!1;this.xa=!0;this.L=Y(0);this.jb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Th(this);this.ta=0;Uh(this);this.Ja={};Vh(this,a.messages);this.Ra=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return rd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return rd(b,a)})}z(Sh,Jh);
|
|
|
|
|
var Wh={"?":"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"},Xh=".WORD 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(" "),
|
|
|
|
|
Yh={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 Th(a){Kh.call(this,a);this.kb=!1;this.Ca=!0;this.L=Y(0);this.lb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Uh(this);this.ua=0;Vh(this);this.La={};Wh(this,a.messages);this.$a=a.commands;var b=this;window?void 0===window.pdp11&&(window.pdp11=function(a){return sd(b,a)}):void 0===global.pdp11&&(global.pdp11=function(a){return sd(b,a)})}z(Th,Kh);
|
|
|
|
|
var Xh={"?":"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"},Yh=".WORD 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(" "),
|
|
|
|
|
Zh={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,32768],35072:[107,32768]},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]}},Zh=[0],$h=
|
|
|
|
|
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Sh.prototype;
|
|
|
|
|
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.A=a.A;(a=nd(a,"messages"))&&Vh(this,a);this.nb=Yh;this.Db=1145>this.b.Va?$h:[];ai(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(bi(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(p(n.id,8)+" %"+
|
|
|
|
|
p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Ob,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=$c&&(c=-1),m=0);a+=d.v.za;e++}}});H(this)};
|
|
|
|
|
k.ra=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ka=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",rd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.g.length-1&&(b=d.g[++d.B])):40==a.keyCode&&(0<d.B?b=d.g[--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.G[b]=c,Ta(c,function(){if(d.ka){var a=d.ka.value;
|
|
|
|
|
d.ka.value="";rd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ta(c,function(a){var b=!1;vb(d,!0)||(ub(d,!0),b=d.hb(a?1:0),ub(d,!1));return b}),!0}return!1};k.rb=function(a){if(this.ka){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ka.focus();!a&&window&&window.scrollTo(b,c)}};k.ba=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Hb=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Rb?this.v.Tb(d):this.b.Tb(d),b&&ci(a,b));return c};
|
|
|
|
|
k.na=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Rb?this.v.bb(d):this.b.bb(d),b&&ci(a,b));return c};k.zb=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Rb?this.v.qb(d,b):this.b.qb(d,b),c&&ci(a,c),this.C.oa(-1))};k.fb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Rb?this.v.Ab(d,b):this.b.Ab(d,b),c&&ci(a,c),this.C.oa(-1))};function Y(a,b){return{F:a,Rb:b,Oa:!1}}k.jc=function(a,b){a.F=b;a.Oa=!1;return a};function di(a){return[a.F,a.Oa]}function ei(a){return{F:a[0],Oa:a[1]}}
|
|
|
|
|
function bi(a,b,c){var d,e=(c?a.L:a.jb).F;c=!1;if(void 0!==b){b=Oh(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.I.length;e++){var g=a.I[e].ga[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Y(d));break}}if(d=f)return d;e=Nh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function fi(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Mc=Lh(a,b.Hc=c[2]))}function ci(a,b){null!=a.F&&(a.F+=b||1)}
|
|
|
|
|
function Vh(a,b){a.i=a;a.la=a.Qc=536870912;a.ia=null;a.va=[];b=Lh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Bb){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.la|=Bb[c],a.j(c+" messages enabled"))}}function ai(a,b){for(var c in Bb)if(64==Bb[c]){a.Ja[c]=b;break}}
|
|
|
|
|
k.sc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SR":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function gi(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.tc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Xa[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Tc(this.b):21==a&&this.A&&kc(this.A)&&(b=this.A.Wa));return b};
|
|
|
|
|
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Ib).F));if(this.la&1073741824)this.va.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.la&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,vd(a),a.wa=0,a.oa())}};
|
|
|
|
|
function Uh(a){var b;if(!xe(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.$=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.$=0;a.j("instruction history buffer allocated")}}k.gb=function(a,b){if(!hi(this,b))return!1;this.b.gb(a);return!0};
|
|
|
|
|
k.hb=function(a,b,c){if(!hi(this))return!1;this.J=0;a||xe(this)&&ye(this,this.b.u[7],0);try{a=wd(this.b,a);var d=this.b.hb(a);0<d&&(cc(this.b,d),this.J+=d,dc(this.b,d,!0),ec(this.b,d),this.wa++)}catch(e){"number"!=typeof e&&(this.J=0,yb(this.b,e.stack||e.message))}!1!==c&&this.C.oa(-1);qd(this,b||!1);return 0<this.J};k.da=function(a){this.b&&this.b.da(a)};
|
|
|
|
|
function qd(a,b){if(a.ib){void 0===b&&(b=!0);var c;c=a.b;if(c=c.K&8?c.jd|c.hd<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Ab[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?ii(a):ji(a)}}function hi(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(a.b)}k.Ga=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
|
|
|
|
k.Fa=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Uh(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;ki(this);a||qd(this)};k.save=function(){var a=new N(this);a.set(0,di(this.L));a.set(1,di(this.O));a.set(2,[this.g,this.R,this.la]);a.set(3,this.I);return a.data()};
|
|
|
|
|
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=ei(a[b++]),this.O=ei(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.la|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Eb=a;this.Fb=b};
|
|
|
|
|
k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Fb;if(!this.S){b="stopped";if(this.J){a-=this.Eb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";xe(this)&&(b+=this.wa+" instructions, ",this.wa=0);b+=this.J+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}qd(this,!0);this.rb();ki(this,this.b.u[7]);this.ia=null}};function xe(a){return 1<a.f.length||!!a.ta}
|
|
|
|
|
function ye(a,b,c){var d=-1;c||(d=a.b.bb(b),0==d&&(b=Gd(a.b,2)));if(0<c&&(a.ta&&!--a.ta||id(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.wa++,0>d&&(d=a.b.bb(b)),65535!=(d&65535)&&(a.jc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function Df(a){var b=a.b;if(b.w.W)throw O(b,a.b.Ib),a.da(),-1;return!1}
|
|
|
|
|
function Th(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.v;c=a.ba(c);jd(d.Y[c>>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.ba(c),jd(d.Y[c>>>d.ja],!0);a.D=["bw"];a.kb=0}k.lb=function(a,b,c){var d=!0;c||li(this,a,b,!1,!0);if(a!=this.f){var e=this.ba(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].lb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(mi(this,a,a.length-1,"set"),Uh(this)));return d};
|
|
|
|
|
function li(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.Oa)){f=!0;h.Oa||e||mi(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,jd(d.Y[c>>>d.ja],b==a.D));h.Oa||Uh(a);break}}return f}function ni(a,b){for(var c=1;c<b.length;c++)mi(a,b,c);return b.length-1}function mi(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Hc?' "'+c.Hc+'"':""))}
|
|
|
|
|
function ki(a,b){if(void 0!==b)id(a,b,1,a.f,!0),a.S=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Oa){if(!li(a,a.f,c,!0))break;b=0}}}
|
|
|
|
|
function id(a,b,c,d,e){var f=!1;if(!a.kb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Oa)for(var l=a.ba(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Oa&&(li(a,d,h,!0),e=!0);if(n=h.Mc){for(var f=!1,v=0;v<n.length;v++)if(!oi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.w.W||(f=!0)}if(f){e||mi(a,d,g,"hit");break}}}a.kb--;return f}
|
|
|
|
|
function pi(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.nb)if(g=a.nb[h][f&h])break;g||(g=Zh);var l=g[0];0<=a.Db.indexOf(l)&&(g=Zh,l=g[0]);var m=h="",n=Xh[l],v=g.length-1;l||v||(h=J(a,f));for(l=1;l<=v;l++){var r=g[l];if(void 0!==r){var w;w=a;var y=r,r=b,x="",C=y&61440;if(4096==C)r=r.F+((f&255)<<24>>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6),
|
|
|
|
|
y&63)switch(y=C&7,C&56){case 0:x=gi(y);break;case 8:x="@"+gi(y);break;case 16:7>y?x="("+gi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+gi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+gi(y)+")";break;case 40:x="@-("+gi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+gi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+gi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
|
|
|
|
|
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.na(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.w.tb?g+("cycles="+sd(a.b).toString()+" cs="+p(a.b.Kb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function qi(a,b){switch(b){case "N":a=Ed(a.b);break;case "Z":a=Dd(a.b);break;case "V":a=Cd(a.b);break;case "C":a=Bd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
|
|
|
|
function ri(a,b){var c="",d=a.b;8>b?(c=gi(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Xa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ia[b-16]):20==b?c="PS="+J(a,Tc(d)):21==b&&a.A&&kc(a.A)&&(c="SR="+J(a,a.A.Wa,3));c&&(c+=" ");return c}function si(a){var b,c="";for(b=0;6>b;b++)c+=ri(a,b);c=c+"\n"+(ri(a,6)+ri(a,7));c+=ri(a,20)+ri(a,21);return c+=qi(a,"T")+qi(a,"N")+qi(a,"Z")+qi(a,"V")+qi(a,"C")}k.oc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
|
|
|
|
function Ug(a,b,c,d,e){var 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],v=za(n,l,a.oc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Ze:b,F:c,Wc:d,ga:e,mc:f})}function ti(a,b,c){var d=[],e=a.ba(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Wc;if(e>=g&&e<g+h){e=za(f.mc,[e-g],a.oc);0<=e?ui(a,b,e,d):c&&(e=~e,ui(a,b,e-1,d),ui(a,b,e,d));break}}return d}
|
|
|
|
|
function ui(a,b,c,d){var e={},f=a.I[b].mc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ga[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function vi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Rh(a)||a.j("no variables"),!0;if(!c[2])return Rh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Nh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
|
|
|
|
function wi(a,b,c){var d=null;if(b=bi(a,b,!0)){a.ba(b);var e=ti(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
|
|
|
|
function ii(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\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.j("missing value for "+b[1]);return}f=Nh(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":O(d,f);a.L=Y(d.u[7]);break;case "N":d.Z=f?32768:0;break;case "Z":d.aa=
|
|
|
|
|
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SR":if(a.A&&kc(a.A)){ic(a.A,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.oa();a.j("updated registers:")}a.j(si(a));c&&(a.L=Y(d.u[7]),ji(a,J(a,a.L.F)))}}function xi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Qh(a,null,c[2].charCodeAt(0)):Nh(a,b,!0)}
|
|
|
|
|
function yi(a,b,c){var d="t"!=b;c=Ph(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Sa(c,function(){return ub(a,!0)&&a.hb(e,d,!1)},function(){a.A&&a.A.stop&&a.A.stop();a.C.oa();ub(a,!1)})}
|
|
|
|
|
function ji(a,b,c,d){if(b=bi(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ph(a,c.substr(1)),null!=c&&(d=c);else{d=bi(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=vb(a,!1)||a.S?a.J:null;var g=null!=f?"cycles":null,h=ti(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=pi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
|
|
|
|
|
function oi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&0<b.length){a.R&&(b="a "+J(a,a.O.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();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}}switch(g[0].charAt(0)){case "a":var v=
|
|
|
|
|
bi(a,g[1],!0);if(v)if(a.O=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.C.oa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.zb(v,r[w],1);a.j(pi(a,a.O))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [a]\tset exec breakpoint at addr [a]"),a.j("\tbr [a]\tset read breakpoint at addr [a]"),a.j("\tbw [a]\tset write breakpoint at addr [a]"),a.j("\tbc [a]\tclear breakpoint at addr [a]"),a.j("\tbl\tlist all breakpoints"),
|
|
|
|
|
a.j("\tbn [n]\tbreak after [n] instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ka;Ka=0+ni(a,a.f);Ka+=ni(a,a.M);(Ka+=ni(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ta=Ph(a,x),a.j("break after "+a.ta+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=bi(a,x,!0),!P))break a;"c"==ja?null==P.F?(Th(a),a.j("all breakpoints cleared")):li(a,a.f,P)||li(a,a.M,P)||li(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(fi(a,P,C),"p"==ja?a.lb(a.f,
|
|
|
|
|
P):"r"==ja?a.lb(a.M,P):"w"==ja?a.lb(a.D,P):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Sa&&(a.Sa.value="");break;case "d":a:{var ib,Ma=g[0],ma=g[1],Na=g[2],Ri=g[3];if("?"==ma){var jb="";for(ib in Bb)a.Ja[ib]&&(jb&&(jb+=","),jb+=ib);jb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
|
|
|
|
|
jb.length&&a.j("dump extension commands:\n\t"+jb)}else if("state"==ma){var Cg=zi(a.C,!0);"console"==Na?console.log(Cg):(a.Sa&&(a.Sa.value=""),a.j(Cg))}else if("symbols"==ma)for(var Ld=0;Ld<a.I.length;Ld++){var Md=a.I[Ld],kb;for(kb in Md.ga)if("."!=kb.charAt(0)){var Dg=Md.ga[kb].o;if(void 0!==Dg){var Eg=Md.ga[kb].l;Eg&&(kb=Eg);a.j(J(a,Dg)+" "+kb)}}}else{if("d"==Ma){for(ib in Bb)if(g[1]==ib){var Fg=a.Ja[ib];Fg?(g.shift(),g.shift(),Fg(g)):a.j("no dump registered for "+ma);break a}ma||(Ma=a.Gb||"dw")}else a.Gb=
|
|
|
|
|
Ma;if("dh"==Ma){var Gg=ma,Hg=Na,Ig="",Jg=0,fa=a.$,na=a.H;if(na.length){var Z=+Gg||a.mb,Qb=+Hg||10;isNaN(Z)?Z=Qb:Ig="more ";Z>na.length&&(a.j("note: only "+na.length+" available"),Z=na.length);fa-=Z;0>fa&&(null==na[na.length-1].F?(Z=fa+Z,fa=0):fa+=na.length);var Nd=[];"call"==Hg&&(Qb=1E5,Nd=["CALL"]);for(void 0!==Gg&&a.j(Z+" instructions earlier:");0<Qb&&fa!=a.$;){var Kg=na[fa++];if(null==Kg.F)break;var Rb=Y(Kg.F),Si=Z--,Lg=pi(a,Rb,"history",Si);(!Nd.length||0<=Lg.indexOf(Nd[0]))&&a.j(Lg);Rb.$b&&(fa+=
|
|
|
|
|
Rb.$b,Qb-=Rb.$b,Z-=Rb.$b);fa>=na.length&&(fa=0);a.mb=Z;Jg++;Qb--}}Jg||(a.j("no "+Ig+"history available"),a.mb=void 0)}else{var lb=bi(a,ma);if(lb){var Sb=0,Od=!1,Pd="ds"==Ma;Na&&(Od=!0,"l"==Na.charAt(0)&&(Od=!1,Na=Na.substr(1)||Ri),Sb=Ph(a,Na)>>>0,65536<Sb&&(Sb=65536));for(var mb="dd"==Ma?4:"db"==Ma?1:2,Ic=(Od?Sb-lb.F:mb*Sb)||128,Qd=Pd?16:a.ca,Ti=(Ic+Qd-1)/Qd|0||1,Oa="";Ti--&&0<Ic;){for(var Pa="",Rd="",ma=J(a,lb.F),Jc=Qd,Tb=0,Ub=0;0<Jc&&0<Ic;){var nb=1,Kc=1==mb?a.Hb(lb,nb):a.na(lb,nb=2),Tb=Tb|Kc<<
|
|
|
|
|
(Ub<<3),Ub=Ub+nb;Ub==mb&&(Pd?(Pa&&(Pa+=","),Pa+="0x"+p(Tb,2*mb)):(Pa+=J(a,Tb,mb),Pa+=1==mb?9==Jc?"-":" ":" "),Tb=Ub=0);Jc-=nb;for(Ic-=nb;nb--;)var Sd=Kc&255,Rd=Rd+(32<=Sd&&128>Sd?String.fromCharCode(Sd):"."),Kc=Kc>>8}Oa&&(Oa+="\n");Oa=Pd?Oa+(Pa+","):Oa+(ma+" "+Pa+(0==Jc?" "+Rd:""))}Oa&&a.j(Oa);a.jb=lb}}}}break;case "e":if("else"==g[0])break;var ob,Td,Ud,Vd,Wd=g[0],Xd=g[1];"eb"==Wd?(ob=1,Td=255,Ud=a.Hb,Vd=a.zb):"e"==Wd||"ew"==Wd?(ob=2,Td=65535,Ud=a.na,Vd=a.fb):Xd=null;if(null==Xd)a.j("edit memory commands:"),
|
|
|
|
|
a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Lc=bi(a,Xd);if(Lc)for(var Mc=2;Mc<g.length;Mc++){var Vb=Nh(a,g[Mc]);if(void 0===Vb){a.j("unrecognized value: "+g[Mc]);break}Vb&~Td&&a.j("warning: "+p(Vb)+" exceeds "+ob+"-byte value");a.j("changing "+J(a,Lc.F)+(F(a,64)?"":" from "+J(a,Ud.call(a,Lc),ob))+" to "+J(a,Vb,ob));Vd.call(a,Lc,Vb,ob)}}break;case "g":a:{var Mg=g[1],Ui=b;if(void 0!==Mg){var Yd=bi(a,Mg,!0);if(!Yd)break a;fi(a,Yd,Ui);a.lb(a.f,
|
|
|
|
|
Yd,!0)}a.gb(!0,c)}break;case "h":a.w.W?(c||a.j("halting"),a.da()):vb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Zd;var Wb=b.substr(2),Wb=xa(Wb);Nh(a,Wb)?(c||a.j("true: "+Wb),Zd=!0):(c||a.j("false: "+Wb),Zd=!1);Zd||(d=!1);break}f=!0;break;case "k":var Vi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var $d=0,ae=Y(),Xb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Xb.F));10>$d;){for(var Qa=null,Wi=256;65536>
|
|
|
|
|
Xb.F>>>0;){ae.F=a.na(Xb,2);if(null==Xb.F||!Wi--)break;if(!(ae.F&1)){for(var Xi=a,Nc=ae,Ng=null,Yb=Nc.F,Og=Yb,be=1;6>=be&&Yb;be++){if(2<be){Nc.F=Yb;var Oc=pi(Xi,Nc);if(0<=Oc.indexOf("JSR")){var Pg=Oc.indexOf(" ");if(Yb+(Oc.indexOf(" ",Pg+1)-Pg-1)/2==Og){Ng=Oc;break}}}Yb-=2}Nc.F=Og;if(Qa=Ng)break}}if(!Qa||null==Qa)break;var Qg=null;if("ks"==Vi){var Rg=Qa.match(/[0-9A-F]+$/);Rg&&(Qg=wi(a,Rg[0]))}Qa=wa(Qa,50)+" ;"+(Qg||"stack="+J(a,Xb.F));a.j(Qa);$d++}$d||a.j("no return addresses found")}break;case "l":if("ln"==
|
|
|
|
|
g[0]){wi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in Bb)if(G==oa){Ca=Bb[oa];pa=!!(a.la&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.la|=Ca,pa=!0;else if("off"==g[2]&&(a.la&=~Ca,pa=!1,1073741824==Ca)){for(var ce=0;ce<a.va.length;ce++)a.j(a.va[ce]);
|
|
|
|
|
a.va=[]}}var Yi=0,Zb="";for(oa in Bb)if(!G||G==oa){var Zi=!!(a.la&Bb[oa]);if(null===pa||pa==Zi)Zb&&(Zb+=","),++Yi%10||(Zb+="\n\t"),"key"==oa&&(oa="keys"),Zb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Zb||"none"));Uh(a)}break;case "p":if("print"==g[0]){xi(a,b.substr(5));break}var $i="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Sg=Y(a.b.u[7]);a.Hb(Sg);a.S?(a.lb(a.f,
|
|
|
|
|
Sg,!0),a.gb()||(a.C&&a.C.rb(),a.S=0)):yi(a,$i?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ii(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var $b=+g[2];if(8==$b||10==$b||16==$b)a.ca=$b;else{a.j("invalid base: "+$b);break}}a.j("default base: "+a.ca);break;case "cs":var ac;void 0!==g[3]&&(ac=+g[3]);switch(g[2]){case "int":a.b.ub=ac;break;case "start":a.b.Lb=ac;break;case "stop":a.b.vb=ac;break;default:a.j("unknown cs option");break a}void 0!==ac&&pd(a.b);a.j("checksums "+
|
|
|
|
|
(a.b.w.tb?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(td(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.ob.toFixed(2)+"Mhz")+" ("+a.b.cb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),
|
|
|
|
|
a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":yi(a,g[0],g[1]);break;case "u":ji(a,g[1],g[2],8);break;case "v":if("var"==g[0]){vi(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Va+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){xi(a,b.substr(1));break}var de="commands:",ee;for(ee in Wh)de+="\n"+wa(ee,9)+Wh[ee];xe(a)||(de+="\nnote: history disabled if no exec breakpoints");a.j(de);
|
|
|
|
|
break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Tg){a.j("debugger error: "+(Tg.stack||Tg.message)),d=!1}return d}function rd(a,b,c){b=Lh(a,b,c);for(var d in b)if(!oi(a,b[+d]))return!1;return!0}Za(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Sh(d);B(d,c)}});
|
|
|
|
|
function Ai(a,b,c){t.call(this,"Computer",a,Ai,67108864);this.w.ha=!1;Bi(this,b);this.L=nd(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Ci;this.I=null;this.D=this.R=!1;this.$=nd(this,"url")||"";(Math.random()+.1).toString(36);this.g=Di(this);if(this.b=tb("CPU",this.id)){this.i=tb("Debugger",this.id);this.v=new mc({id:this.Qa+".bus",busWidth:this.X},this.b,this.i);var d,e=rb(this.id);if((this.A=tb("Panel",this.id))&&this.A.Sa)for(b=0;b<e.length;b++)d=e[b],d.P=this.A.P,d.j=this.A.j,
|
|
|
|
|
d.Sa=this.A.Sa;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ea&&d.Ea(this,this.v,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=nd(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Ci),this.f&&(this.J=
|
|
|
|
|
new N(this,"1.30.3"),Ei(this.J)?b=null:delete this.J);!b&&this.f&&(b=Fi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Gi(this,this.Mb)}else q("Unable to find CPU component")}z(Ai);var Ci=0;
|
|
|
|
|
function Bi(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function nd(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Gi(a,b,c){for(var d=rb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!wb(f)){wb(f,function(){Gi(a,b,c)});return}}b.call(a,c)}
|
|
|
|
|
function Hi(a,b){var c=new N(a,"1.30.3","validate");if(Ei(c)&&Ii(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.P("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Ai.prototype;
|
|
|
|
|
k.Mb=function(a){void 0===a&&(a=this.f||(this.I?1:Ci));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.J||new N(this,"1.30.3");if(-1==a)b=!0;else if(a>Ci){if(Ei(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Ei(this.B)&&(Ji(this,d),a=2,Ki(this.B));this.B.set("timestamp",Ba());Li(this.B);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ii(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Ei(d,g):("error"==
|
|
|
|
|
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Ki(d),Ei(d)?(c=Ii(d),e=!0):c=!1))}e&&Hi(this,c?d:null)}else 2==a&&d.clear()}else Hi(this);delete this.I;delete this.J}e=rb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Mi(this,g,d,b,c));b=[d,a,c];-1!=a?Gi(this,this.pc,b):this.pc(b)}};
|
|
|
|
|
function Mi(a,b,c,d,e){if(!b.w.ha){b.w.ha=!0;if(b.Ga){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.Ga(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=Ci,window&&window.location.reload()):a.O=!0,b.Ga(null),e=!1)}if(!d&&b.vc)for(a=b.vc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
|
|
|
k.pc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Mi(this,this.b,b,c,a),this.oa(),this.b.sb());this.O&&(Ji(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
|
|
|
|
|
function Ji(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.$;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
|
|
|
function zi(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Fa&&(c&&a.b.da(),d=a.b.Fa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l<h.length;l++){var m=h[l];m.w.ha&&(m.Fa&&(d=m.Fa(b,c),"object"===typeof d&&f.set(m.id,
|
|
|
|
|
d)),c&&(m.w.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Ni(a,a.g,f.toString()),Li(g)&&Li(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.w.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e}
|
|
|
|
|
k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=rb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.oa(-1)};k.start=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.oa(-1)};
|
|
|
|
|
k.stop=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.oa(-1)};
|
|
|
|
|
k.oa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.Db+=c))&&(d.textContent=b.w.W?b.ta.toFixed(2)+"Mhz":"Stopped",b.Db=0)}if(this.A&&(b=this.A,a=a||0,b.I)){c=b.b.w.W;d=!!(b.b.K&4);if(0>=a||60<=(b.H+=a)){for(var e=0;e<b.b.u.length;e++)Pb(b,"R"+e,b.b.u[e]);e=Tc(b.b);Pb(b,"PS",e);Pb(b,"NF",e&8?1:0,1);Pb(b,"ZF",e&4?1:0,1);Pb(b,"VF",e&2?1:0,1);Pb(b,"CF",e&1?1:0,1);b.H=0}hc(b,0<a&&c&&!d?b.b.u[7]:b.f);gc(b,b.D);a=b.b.Ua?b.b.pb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16",
|
|
|
|
|
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]}},$h=[0],ai=
|
|
|
|
|
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Th.prototype;
|
|
|
|
|
k.Ga=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.A=a.A;(a=od(a,"messages"))&&Wh(this,a);this.tb=Zh;this.Fb=1145>this.b.Va?ai:[];bi(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.aa(ci(d,c));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.v.ja;l=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Bc[c],n&&d.j(p(n.id,8)+" %"+
|
|
|
|
|
p(e<<d.v.ja,8)+" %%"+p(n.F,8)+" "+p(n.Pb,4,!0)+" "+p(n.size,4,!0)+" "+m),c!=ad&&(c=-1),m=0);a+=d.v.za;e++}}});H(this)};
|
|
|
|
|
k.sa=function(a,b,c){var d=this;switch(b){case "debugInput":return this.ma=this.G[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",sd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.B<d.g.length-1&&(b=d.g[++d.B])):40==a.keyCode&&(0<d.B?b=d.g[--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.G[b]=c,Ta(c,function(){if(d.ma){var a=d.ma.value;
|
|
|
|
|
d.ma.value="";sd(d,a,!0);return!0}return!1}),!0;case "step":return this.G[b]=c,Ta(c,function(a){var b=!1;vb(d,!0)||(ub(d,!0),b=d.jb(a?1:0,null),ub(d,!1));return b}),!0}return!1};k.rb=function(a){if(this.ma){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.ma.focus();!a&&window&&window.scrollTo(b,c)}};k.aa=function(a){a=a&&a.F;null==a&&(a=-1);return a};k.Ib=function(a,b){var c=255,d=this.aa(a,!1,1);-1!==d&&(c=a.Sb?this.v.Ub(d):this.b.Ub(d),b&&di(a,b));return c};
|
|
|
|
|
k.na=function(a,b){var c=65535,d=this.aa(a,!1,2);-1!==d&&(c=a.Sb?this.v.cb(d):this.b.cb(d),b&&di(a,b));return c};k.Bb=function(a,b,c){var d=this.aa(a,!0,1);-1!==d&&(a.Sb?this.v.qb(d,b):this.b.qb(d,b),c&&di(a,c),this.C.pa(-1))};k.hb=function(a,b,c){var d=this.aa(a,!0,2);-1!==d&&(a.Sb?this.v.Cb(d,b):this.b.Cb(d,b),c&&di(a,c),this.C.pa(-1))};function Y(a,b){return{F:a,Sb:b,Qa:!1}}k.kc=function(a,b){a.F=b;a.Qa=!1;return a};function ei(a){return[a.F,a.Qa]}function fi(a){return{F:a[0],Qa:a[1]}}
|
|
|
|
|
function ci(a,b,c){var d,e=(c?a.L:a.lb).F;c=!1;if(void 0!==b){b=Ph(a,b);"%"==b.charAt(0)&&(c=!0,b=b.substr(1));d=b;var f;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),e=0;e<a.I.length;e++){var g=a.I[e].ga[d];if(void 0!==g){d=g.o;void 0!==d&&(f=Y(d));break}}if(d=f)return d;e=Oh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function gi(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Mc=Mh(a,b.Hc=c[2]))}function di(a,b){null!=a.F&&(a.F+=b||1)}
|
|
|
|
|
function Wh(a,b){a.i=a;a.ka=a.Qc=536870912;a.ia=null;a.wa=[];b=Mh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Bb){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|=Bb[c],a.j(c+" messages enabled"))}}function bi(a,b){for(var c in Bb)if(64==Bb[c]){a.La[c]=b;break}}
|
|
|
|
|
k.tc=function(a){var b=-1;a=a.toUpperCase();switch(a){case "SP":b=6;break;case "PC":b=7;break;case "SR":b=21;break;default:"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b)&&(b=-1)}return b};function hi(a){return 6>a?"R"+a:6==a?"SP":"PC"}k.uc=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Xa[a-8]:20>a?b=this.b.Ka[a-16]:20==a?b=Uc(this.b):21==a&&this.A&&kc(this.A)&&(b=this.A.Wa));return b};
|
|
|
|
|
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.oa&65535).F));if(this.ka&1073741824)this.wa.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ka&-2147483648&&this.b&&this.b.w.W||vb(this,!0))this.da(),a+=" (cpu halted)";this.j(a);this.b&&(a=this.b,wd(a),a.wa=0,a.pa())}};
|
|
|
|
|
function Vh(a){var b;if(!ye(a))a.H&&a.H.length&&a.j("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.ba=0;a.j("instruction history buffer allocated")}}k.ib=function(a,b){if(!ii(this,b))return!1;this.b.ib(a);return!0};
|
|
|
|
|
k.jb=function(a,b,c){if(!ii(this))return!1;null===b&&(b=!this.vb||"tr"==this.vb);this.K=0;a||ye(this)&&ze(this,this.b.u[7],0);try{a=xd(this.b,a);var d=this.b.jb(a);0<d&&(cc(this.b,d),this.K+=d,dc(this.b,d,!0),ec(this.b,d),this.xa++)}catch(e){"number"!=typeof e&&(this.K=0,yb(this.b,e.stack||e.message))}!1!==c&&this.C.pa(-1);rd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)};
|
|
|
|
|
function rd(a,b){if(a.kb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.jd|c.hd<<8:0){var d=c>>8;a.j("trapped to "+J(a,c&255,1)+" ("+(0>d?Ab[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.S?ji(a):ki(a)}}function ii(a,b){var c;(c=!a.b||!wb(a.b))||(c=a.b,c.w.ha?c=!0:(c.j(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.w.W?(b||a.j("cpu busy or unavailable, command ignored"),!1):!xb(a.b)}k.Ia=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};
|
|
|
|
|
k.Ha=function(a,b){b&&this.j(a?"suspending":"shutting down");return a?this.save():!0};k.reset=function(a){Vh(this);this.xa=0;this.ia=null;this.K=0;this.L=Y(this.b.u[7]);this.w.W=!1;li(this);a||rd(this)};k.save=function(){var a=new N(this);a.set(0,ei(this.L));a.set(1,ei(this.O));a.set(2,[this.g,this.R,this.ka]);a.set(3,this.I);return a.data()};
|
|
|
|
|
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=fi(a[b++]),this.O=fi(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ka|=a[b][2]);a[3]&&(this.I=a[3]);return!0};k.start=function(a,b){this.S||this.j("running");this.w.W=!0;this.Gb=a;this.Hb=b};
|
|
|
|
|
k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.K=b-this.Hb;if(!this.S){b="stopped";if(this.K){a-=this.Gb;var c=0<a?Math.round(1E3*this.K/a):0;b+=" (";ye(this)&&(b+=this.xa+" instructions, ",this.xa=0);b+=this.K+" cycles, "+a+" ms, "+c+" hz)"}else F(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.j(b)}rd(this,!0);this.rb();li(this,this.b.u[7]);this.ia=null}};function ye(a){return 1<a.f.length||!!a.ua}
|
|
|
|
|
function ze(a,b,c){var d=-1;c||(d=a.b.cb(b),0==d&&(b=Hd(a.b,2)));if(0<c&&(a.ua&&!--a.ua||jd(a,b,1,a.f)))return!0;0<=c&&a.H.length&&(a.xa++,0>d&&(d=a.b.cb(b)),65535!=(d&65535)&&(a.kc(a.H[a.ba],b),++a.ba==a.H.length&&(a.ba=0)));return!1}function Ef(a){var b=a.b;if(b.w.W)throw O(b,a.b.oa&65535),a.da(),-1;return!1}
|
|
|
|
|
function Uh(a){var b,c;a.f=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];var d=a.v;c=a.aa(c);kd(d.Y[c>>>d.ja],!1)}a.M=["br"];if(a.D)for(b=1;b<a.D.length;b++)c=a.D[b],d=a.v,c=a.aa(c),kd(d.Y[c>>>d.ja],!0);a.D=["bw"];a.mb=0}k.nb=function(a,b,c){var d=!0;c||mi(this,a,b,!1,!0);if(a!=this.f){var e=this.aa(b);if(-1===e)this.j("invalid address: "+J(this,b.F)),d=!1;else{var f=this.v;f.Y[e>>>f.ja].nb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Qa=!0:(ni(this,a,a.length-1,"set"),Vh(this)));return d};
|
|
|
|
|
function mi(a,b,c,d,e){var f=!1;c=a.aa(c);for(var g=1;g<b.length;g++){var h=b[g];if(c==a.aa(h)&&(!d||h.Qa)){f=!0;h.Qa||e||ni(a,b,g,"cleared");b.splice(g,1);b!=a.f&&(d=a.v,kd(d.Y[c>>>d.ja],b==a.D));h.Qa||Vh(a);break}}return f}function oi(a,b){for(var c=1;c<b.length;c++)ni(a,b,c);return b.length-1}function ni(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Hc?' "'+c.Hc+'"':""))}
|
|
|
|
|
function li(a,b){if(void 0!==b)jd(a,b,1,a.f,!0),a.S=0;else for(b=1;b<a.f.length;b++){var c=a.f[b];if(c.Qa){if(!mi(a,a.f,c,!0))break;b=0}}}
|
|
|
|
|
function jd(a,b,c,d,e){var f=!1;if(!a.mb++)for(var g=1;!f&&g<d.length;g++){var h=d[g];if(!e||h.Qa)for(var l=a.aa(h)&65535,m=0;m<c;m++)if(b+m==l){var n,f=!0;h.Qa&&(mi(a,d,h,!0),e=!0);if(n=h.Mc){for(var f=!1,v=0;v<n.length;v++)if(!pi(a,n[v],!0)){if(n[v].indexOf("if")){f=!0;break}for(var r=v+1;r<n.length&&n[r].indexOf("else");r++)v++;if(r==n.length){f=!0;break}}a.b.w.W||(f=!0)}if(f){e||ni(a,d,g,"hit");break}}}a.mb--;return f}
|
|
|
|
|
function qi(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.tb)if(g=a.tb[h][f&h])break;g||(g=$h);var l=g[0];0<=a.Fb.indexOf(l)&&(g=$h,l=g[0]);var m=h="",n=Yh[l],v=g.length-1;l||v||(h=J(a,f));for(l=1;l<=v;l++){var r=g[l];if(void 0!==r){var w;w=a;var y=r,r=b,x="",C=y&61440;if(4096==C)r=r.F+((f&255)<<24>>23)&65535,x=J(w,r);else if(8192==C)r=r.F-((f&63)<<1)&65535,x=J(w,r);else if(12288==C)x=J(w,f&7,1);else if(24576==C)x=J(w,f&63,1);else if(32768==C)x=J(w,f&255,1);else if(C=f&y,y&4032&&(C>>=6,y>>=6),
|
|
|
|
|
y&63)switch(y=C&7,C&56){case 0:x=hi(y);break;case 8:x="@"+hi(y);break;case 16:7>y?x="("+hi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+hi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+hi(y)+")";break;case 40:x="@-("+hi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+hi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+hi(y)+")",7==y&&(x="@"+J(w,C+r.F&65535))}w=x;if(!w||!w.length){h="INVALID";break}"string"!=typeof w&&(m=w[1],w=w[0]);
|
|
|
|
|
0<h.length&&(h+=",");h+=w||"???"}}f="";g=J(a,e.F)+":";if(-1!==e.F&&-1!==b.F){do if(f+=" "+J(a,a.na(e,2)),null==e.F)break;while(e.F!=b.F)}g+=wa(f,24);g+=wa(n,5);h&&(g+=" "+h);if(c||m)g=wa(g,60)+";"+(c||""),g=a.b.w.ub?g+("cycles="+td(a.b).toString()+" cs="+p(a.b.Lb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function ri(a,b){switch(b){case "N":a=Fd(a.b);break;case "Z":a=Ed(a.b);break;case "V":a=Dd(a.b);break;case "C":a=Cd(a.b);break;default:a=0}return b.charAt(0)+(a?"1":"0")+" "}
|
|
|
|
|
function si(a,b){var c="",d=a.b;8>b?(c=hi(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Xa[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+J(a,d.Ka[b-16]):20==b?c="PS="+J(a,Uc(d)):21==b&&a.A&&kc(a.A)&&(c="SR="+J(a,a.A.Wa,3));c&&(c+=" ");return c}function ti(a){var b,c="";for(b=0;6>b;b++)c+=si(a,b);c=c+"\n"+(si(a,6)+si(a,7));c+=si(a,20)+si(a,21);return c+=ri(a,"T")+ri(a,"N")+ri(a,"Z")+ri(a,"V")+ri(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
|
|
|
|
function Vg(a,b,c,d,e){var 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],v=za(n,l,a.pc);0>v&&n.splice(-(v+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.I.push({Ze:b,F:c,Wc:d,ga:e,nc:f})}function ui(a,b,c){var d=[],e=a.aa(b)>>>0;for(b=0;b<a.I.length;b++){var f=a.I[b],g=f.F>>>0,h=f.Wc;if(e>=g&&e<g+h){e=za(f.nc,[e-g],a.pc);0<=e?vi(a,b,e,d):c&&(e=~e,vi(a,b,e-1,d),vi(a,b,e,d));break}}return d}
|
|
|
|
|
function vi(a,b,c,d){var e={},f=a.I[b].nc,g=0,h=null;0<=c&&c<f.length&&(g=f[c][0],h=f[c][1]);h&&(e=a.I[b].ga[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(g);d.push(e.a);d.push(e.c)}function wi(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Sh(a)||a.j("no variables"),!0;if(!c[2])return Sh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Oh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
|
|
|
|
function xi(a,b,c){var d=null;if(b=ci(a,b,!0)){a.aa(b);var e=ui(a,b,!0);if(e.length){var f,g;e[0]&&(g="",(f=b.F-e[1])&&(g=" + "+p(f,4,!0)),f=e[0]+" ("+J(a,e[1])+")"+g,c&&a.j(f),d=f);4<e.length&&e[4]&&(g="",(f=e[5]-b.F)&&(g=" - "+p(f,4,!0)),f=e[4]+" ("+J(a,e[5])+")"+g,c&&a.j(f),d||(d=f))}else c&&a.j("no symbols")}return d}
|
|
|
|
|
function ji(a,b){var c;if(b&&"?"==b[1])a.j("register commands:"),a.j("\tr\tdump registers"),a.j("\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.j("missing value for "+b[1]);return}f=Oh(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":O(d,f);a.L=Y(d.u[7]);break;case "N":d.Z=f?32768:0;break;case "Z":d.$=
|
|
|
|
|
f?0:1;break;case "V":d.U=f?32768:0;break;case "C":d.T=f?65536:0;break;case "SR":if(a.A&&kc(a.A)){ic(a.A,f);break}default:if("R"==b.charAt(0)&&(b=+b.charAt(1),0<=b&&6>b)){d.u[b]=f&65535;break}a.j("unknown register: "+e);return}a.C.pa();a.j("updated registers:")}a.j(ti(a));c&&(a.L=Y(d.u[7]),ki(a,J(a,a.L.F)))}}function yi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Rh(a,null,c[2].charCodeAt(0)):Oh(a,b,!0)}
|
|
|
|
|
function zi(a,b,c){if("?"==c)a.j("trace commands:"),a.j("\tt [#]\ttrace # instructions"),a.j("\ttr [#]\ttrace # instructions with register updates"),a.j("\ttc [#]\ttrace # cycles"),a.j("note: bn [#] to break after # instructions is much faster");else{var d="t"!=b;c=Qh(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);a.vb=b;Sa(c,function(){return ub(a,!0)&&a.jb(e,d,!1)},function(){a.A&&a.A.stop&&a.A.stop();a.C.pa();ub(a,!1)})}}
|
|
|
|
|
function ki(a,b,c,d){if(b=ci(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Qh(a,c.substr(1)),null!=c&&(d=c);else{d=ci(a,c,!0);if(!d||d.F<b.F)return;e=d.F-b.F;if(256<e){a.j("range too large");return}d=-1}c=0;for(var f;0<e&&d--;){f=vb(a,!1)||a.S?a.K:null;var g=null!=f?"cycles":null,h=ui(a,b),l=b.F;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(g=h[3],f=null);f=qi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
|
|
|
|
|
function pi(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(">> "+b):(a.R&&(a.j("ended assemble at "+J(a,a.O.F)),a.L=a.O,a.R=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ia=null;if(wb(a)&&0<b.length){a.R&&(b="a "+J(a,a.O.F)+" "+b);var f=!1,g=b.replace(/ +/g," ").split(" ");g[0]=g[0].toLowerCase();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}}switch(g[0].charAt(0)){case "a":var v=
|
|
|
|
|
ci(a,g[1],!0);if(v)if(a.O=v,void 0===g[2])a.j("begin assemble at "+J(a,v.F)),a.R=!0,a.C.pa();else{var r;a.j("not supported yet");r=[];if(r.length){for(var w=0;w<r.length;w++)a.Bb(v,r[w],1);a.j(qi(a,a.O))}}break;case "b":a:{var y=g[0],x=g[1],C=b;if("?"==x)a.j("breakpoint commands:"),a.j("\tbp [#]\tset exec breakpoint at addr #"),a.j("\tbr [#]\tset read breakpoint at addr #"),a.j("\tbw [#]\tset write breakpoint at addr #"),a.j("\tbc [#]\tclear breakpoint at addr #"),a.j("\tbl\tlist all breakpoints"),
|
|
|
|
|
a.j("\tbn [#]\tbreak after # instruction(s)");else{var ja=y.charAt(1);if("l"==ja){var Ka;Ka=0+oi(a,a.f);Ka+=oi(a,a.M);(Ka+=oi(a,a.D))||a.j("no breakpoints")}else if("n"==ja)a.ua=Qh(a,x),a.j("break after "+a.ua+" instruction(s)");else if(void 0===x)a.j("missing breakpoint address");else{var P=Y();if("*"!=x&&(P=ci(a,x,!0),!P))break a;"c"==ja?null==P.F?(Uh(a),a.j("all breakpoints cleared")):mi(a,a.f,P)||mi(a,a.M,P)||mi(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(gi(a,P,C),"p"==ja?a.nb(a.f,
|
|
|
|
|
P):"r"==ja?a.nb(a.M,P):"w"==ja?a.nb(a.D,P):a.j("unknown breakpoint command: "+ja))}}}break;case "c":a.Ta&&(a.Ta.value="");break;case "d":a:{var ib,Ma=g[0],ma=g[1],Na=g[2],Si=g[3];if("?"==ma){var jb="";for(ib in Bb)a.La[ib]&&(jb&&(jb+=","),jb+=ib);jb+=",state,symbols";a.j("dump memory commands:");a.j("\tdb [a] [#] dump # bytes at address a");a.j("\tdw [a] [#] dump # words at address a");a.j("\tdd [a] [#] dump # dwords at address a");a.j("\tdh [#] [#] dump # instructions from history");
|
|
|
|
|
jb.length&&a.j("dump extension commands:\n\t"+jb)}else if("state"==ma){var Dg=Ai(a.C,!0);"console"==Na?console.log(Dg):(a.Ta&&(a.Ta.value=""),a.j(Dg))}else if("symbols"==ma)for(var Ld=0;Ld<a.I.length;Ld++){var Md=a.I[Ld],kb;for(kb in Md.ga)if("."!=kb.charAt(0)){var Eg=Md.ga[kb].o;if(void 0!==Eg){var Fg=Md.ga[kb].l;Fg&&(kb=Fg);a.j(J(a,Eg)+" "+kb)}}}else{if("d"==Ma){for(ib in Bb)if(g[1]==ib){var Gg=a.La[ib];Gg?(g.shift(),g.shift(),Gg(g)):a.j("no dump registered for "+ma);break a}ma||(Ma=a.Jb||"dw")}else a.Jb=
|
|
|
|
|
Ma;if("dh"==Ma){var Hg=ma,Ig=Na,Jg="",Kg=0,fa=a.ba,na=a.H;if(na.length){var Z=+Hg||a.ob,Qb=+Ig||10;isNaN(Z)?Z=Qb:Jg="more ";Z>na.length&&(a.j("note: only "+na.length+" available"),Z=na.length);fa-=Z;0>fa&&(null==na[na.length-1].F?(Z=fa+Z,fa=0):fa+=na.length);var Nd=[];"call"==Ig&&(Qb=1E5,Nd=["CALL"]);for(void 0!==Hg&&a.j(Z+" instructions earlier:");0<Qb&&fa!=a.ba;){var Lg=na[fa++];if(null==Lg.F)break;var Rb=Y(Lg.F),Ti=Z--,Mg=qi(a,Rb,"history",Ti);(!Nd.length||0<=Mg.indexOf(Nd[0]))&&a.j(Mg);Rb.bc&&
|
|
|
|
|
(fa+=Rb.bc,Qb-=Rb.bc,Z-=Rb.bc);fa>=na.length&&(fa=0);a.ob=Z;Kg++;Qb--}}Kg||(a.j("no "+Jg+"history available"),a.ob=void 0)}else{var lb=ci(a,ma);if(lb){var Sb=0,Od=!1,Pd="ds"==Ma;Na&&(Od=!0,"l"==Na.charAt(0)&&(Od=!1,Na=Na.substr(1)||Si),Sb=Qh(a,Na)>>>0,65536<Sb&&(Sb=65536));for(var mb="dd"==Ma?4:"db"==Ma?1:2,Ic=(Od?Sb-lb.F:mb*Sb)||128,Qd=Pd?16:a.ca,Ui=(Ic+Qd-1)/Qd|0||1,Oa="";Ui--&&0<Ic;){for(var Pa="",Rd="",ma=J(a,lb.F),Jc=Qd,Tb=0,Ub=0;0<Jc&&0<Ic;){var nb=1,Kc=1==mb?a.Ib(lb,nb):a.na(lb,nb=2),Tb=Tb|
|
|
|
|
|
Kc<<(Ub<<3),Ub=Ub+nb;Ub==mb&&(Pd?(Pa&&(Pa+=","),Pa+="0x"+p(Tb,2*mb)):(Pa+=J(a,Tb,mb),Pa+=1==mb?9==Jc?"-":" ":" "),Tb=Ub=0);Jc-=nb;for(Ic-=nb;nb--;)var Sd=Kc&255,Rd=Rd+(32<=Sd&&128>Sd?String.fromCharCode(Sd):"."),Kc=Kc>>8}Oa&&(Oa+="\n");Oa=Pd?Oa+(Pa+","):Oa+(ma+" "+Pa+(0==Jc?" "+Rd:""))}Oa&&a.j(Oa);a.lb=lb}}}}break;case "e":if("else"==g[0])break;var ob,Td,Ud,Vd,Wd=g[0],Xd=g[1];"eb"==Wd?(ob=1,Td=255,Ud=a.Ib,Vd=a.Bb):"e"==Wd||"ew"==Wd?(ob=2,Td=65535,Ud=a.na,Vd=a.hb):Xd=null;if(null==Xd)a.j("edit memory commands:"),
|
|
|
|
|
a.j("\teb [a] [...] edit bytes at address a"),a.j("\tew [a] [...] edit words at address a");else{var Lc=ci(a,Xd);if(Lc)for(var Mc=2;Mc<g.length;Mc++){var Vb=Oh(a,g[Mc]);if(void 0===Vb){a.j("unrecognized value: "+g[Mc]);break}Vb&~Td&&a.j("warning: "+p(Vb)+" exceeds "+ob+"-byte value");a.j("changing "+J(a,Lc.F)+(F(a,64)?"":" from "+J(a,Ud.call(a,Lc),ob))+" to "+J(a,Vb,ob));Vd.call(a,Lc,Vb,ob)}}break;case "g":a:{var Ng=g[1],Vi=b;if(void 0!==Ng){var Yd=ci(a,Ng,!0);if(!Yd)break a;gi(a,Yd,Vi);a.nb(a.f,
|
|
|
|
|
Yd,!0)}a.ib(!0,c)}break;case "h":a.w.W?(c||a.j("halting"),a.da()):vb(a,!0)||c||a.j("already halted");break;case "i":if("if"==g[0]){var Zd;var Wb=b.substr(2),Wb=xa(Wb);Oh(a,Wb)?(c||a.j("true: "+Wb),Zd=!0):(c||a.j("false: "+Wb),Zd=!1);Zd||(d=!1);break}f=!0;break;case "k":var Wi=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var $d=0,ae=Y(),Xb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Xb.F));10>$d;){for(var Qa=null,Xi=256;65536>
|
|
|
|
|
Xb.F>>>0;){ae.F=a.na(Xb,2);if(null==Xb.F||!Xi--)break;if(!(ae.F&1)){for(var Yi=a,Nc=ae,Og=null,Yb=Nc.F,Pg=Yb,be=1;6>=be&&Yb;be++){if(2<be){Nc.F=Yb;var Oc=qi(Yi,Nc);if(0<=Oc.indexOf("JSR")){var Qg=Oc.indexOf(" ");if(Yb+(Oc.indexOf(" ",Qg+1)-Qg-1)/2==Pg){Og=Oc;break}}}Yb-=2}Nc.F=Pg;if(Qa=Og)break}}if(!Qa||null==Qa)break;var Rg=null;if("ks"==Wi){var Sg=Qa.match(/[0-9A-F]+$/);Sg&&(Rg=xi(a,Sg[0]))}Qa=wa(Qa,50)+" ;"+(Rg||"stack="+J(a,Xb.F));a.j(Qa);$d++}$d||a.j("no return addresses found")}break;case "l":if("ln"==
|
|
|
|
|
g[0]){xi(a,g[1],!0);break}f=!0;break;case "m":a:{var oa,pa=null,G=g[1];"?"==G&&(G=void 0);if(void 0!==G){var Ca=0;if("all"==G)Ca=1878917119,G=null;else if("on"==G)pa=!0,G=null;else if("off"==G)pa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(oa in Bb)if(G==oa){Ca=Bb[oa];pa=!!(a.ka&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ka|=Ca,pa=!0;else if("off"==g[2]&&(a.ka&=~Ca,pa=!1,1073741824==Ca)){for(var ce=0;ce<a.wa.length;ce++)a.j(a.wa[ce]);
|
|
|
|
|
a.wa=[]}}var Zi=0,Zb="";for(oa in Bb)if(!G||G==oa){var $i=!!(a.ka&Bb[oa]);if(null===pa||pa==$i)Zb&&(Zb+=","),++Zi%10||(Zb+="\n\t"),"key"==oa&&(oa="keys"),Zb+=oa}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==pa?pa?"messages on: ":"messages off: ":"message categories:\n\t")+(Zb||"none"));Vh(a)}break;case "p":if("print"==g[0]){yi(a,b.substr(5));break}var aj="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Tg=Y(a.b.u[7]);a.Ib(Tg);a.S?(a.nb(a.f,
|
|
|
|
|
Tg,!0),a.ib()||(a.C&&a.C.rb(),a.S=0)):zi(a,aj?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}ji(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var $b=+g[2];if(8==$b||10==$b||16==$b)a.ca=$b;else{a.j("invalid base: "+$b);break}}a.j("default base: "+a.ca);break;case "cs":var ac;void 0!==g[3]&&(ac=+g[3]);switch(g[2]){case "int":a.b.wb=ac;break;case "start":a.b.Mb=ac;break;case "stop":a.b.xb=ac;break;default:a.j("unknown cs option");break a}void 0!==ac&&qd(a.b);a.j("checksums "+
|
|
|
|
|
(a.b.w.ub?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(ud(a.b,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.b.pb.toFixed(2)+"Mhz")+" ("+a.b.eb+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"),
|
|
|
|
|
a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":zi(a,g[0],g[1]);break;case "u":ki(a,g[1],g[2],8);break;case "v":if("var"==g[0]){wi(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Va+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){yi(a,b.substr(1));break}var de="commands:",ee;for(ee in Xh)de+="\n"+wa(ee,9)+Xh[ee];ye(a)||(de+="\nnote: history disabled if no exec breakpoints");a.j(de);
|
|
|
|
|
break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Ug){a.j("debugger error: "+(Ug.stack||Ug.message)),d=!1}return d}function sd(a,b,c){b=Mh(a,b,c);for(var d in b)if(!pi(a,b[+d]))return!1;return!0}Za(function(){for(var a=D(document,"pdp11","debugger"),b=0;b<a.length;b++){var c=a[b],d=A(c),d=new Th(d);B(d,c)}});
|
|
|
|
|
function Bi(a,b,c){t.call(this,"Computer",a,Bi,67108864);this.w.ha=!1;Ci(this,b);this.L=od(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Di;this.I=null;this.D=this.R=!1;this.ba=od(this,"url")||"";(Math.random()+.1).toString(36);this.g=Ei(this);if(this.b=tb("CPU",this.id)){this.i=tb("Debugger",this.id);this.v=new mc({id:this.Sa+".bus",busWidth:this.X},this.b,this.i);var d,e=rb(this.id);if((this.A=tb("Panel",this.id))&&this.A.Ta)for(b=0;b<e.length;b++)d=e[b],d.P=this.A.P,d.j=this.A.j,
|
|
|
|
|
d.Ta=this.A.Ta;this.j("PDPjs v1.30.3\nCopyright \u00a9 2012-2016 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");this.j("Portions adapted from the PDP-11/70 Emulator v1.4 by Paul Nankervis <paulnank@hotmail.com>");for(b=0;b<e.length;b++)d=e[b],d.Ga&&d.Ga(this,this.v,this.b,this.i);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.H=d:this.f=parseInt(d,10));var f;if(a=od(this,"state")||(f=!0,a.state))b=this.M=a,f||(this.D=!0,this.f=Di),this.f&&(this.K=
|
|
|
|
|
new N(this,"1.30.3"),Fi(this.K)?b=null:delete this.K);!b&&this.f&&(b=Gi(this))&&(this.D=!0);if(b){var g=this;Da(b,null,!0,function(a,b,c){c?(g.H=null,g.D=!1,g.P("Unable to load machine state from server (error "+c+(b?": "+xa(b):"")+")")):(g.I=b,g.R=!0);H(g)})}else H(this);this.G.power||(this.L=!0);!c&&this.L&&Hi(this,this.Nb)}else q("Unable to find CPU component")}z(Bi);var Di=0;
|
|
|
|
|
function Ci(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){q(d.message+" ("+c+")")}}a.S=b}function od(a,b,c){var d=b.toLowerCase(),d=db[b]||db[d];void 0===d&&a.S&&(d=a.S[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Hi(a,b,c){for(var d=rb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!wb(f)){wb(f,function(){Hi(a,b,c)});return}}b.call(a,c)}
|
|
|
|
|
function Ii(a,b){var c=new N(a,"1.30.3","validate");if(Fi(c)&&Ji(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.P("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Bi.prototype;
|
|
|
|
|
k.Nb=function(a){void 0===a&&(a=this.f||(this.I?1:Di));if(!this.C){this.C++;var b=!1,c=!1;this.O=!1;var d=this.K||new N(this,"1.30.3");if(-1==a)b=!0;else if(a>Di){if(Fi(d,this.I)){this.B=new N(this,"1.30.3","failsafe");Fi(this.B)&&(Ki(this,d),a=2,Li(this.B));this.B.set("timestamp",Ba());Mi(this.B);var e=this.f&&!this.D;if(1==a||Ga("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=Ji(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Fi(d,g):("error"==
|
|
|
|
|
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(La("user",""),this.g=null)):this.j(f+": "+g),Li(d),Fi(d)?(c=Ji(d),e=!0):c=!1))}e&&Ii(this,c?d:null)}else 2==a&&d.clear()}else Ii(this);delete this.I;delete this.K}e=rb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.b&&(c=Ni(this,g,d,b,c));b=[d,a,c];-1!=a?Hi(this,this.qc,b):this.qc(b)}};
|
|
|
|
|
function Ni(a,b,c,d,e){if(!b.w.ha){b.w.ha=!0;if(b.Ia){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.Ia(f,d)&&f&&(q("Unable to restore state for "+b.type),a.M&&!a.R?(c.clear(),a.f=Di,window&&window.location.reload()):a.O=!0,b.Ia(null),e=!1)}if(!d&&b.yc)for(a=b.yc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
|
|
|
|
k.qc=function(a){var b=a[0],c=0>a[1];a=a[2];this.ca=!0;this.w.ha=!0;var d=this.G.power;d&&(d.textContent="Shutdown");this.b&&(Ni(this,this.b,b,c,a),this.pa(),this.b.sb());this.O&&(Ki(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.C=0};
|
|
|
|
|
function Ki(a,b){if(Ga("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.ba;d.user=c;d.type="bug";d.data=b;Da("http://www.pcjs.org/api/v1/report",d,!0)}}
|
|
|
|
|
function Ai(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new N(a,"1.30.3"),g=new N(a,"1.30.3","validate"),h=Ba();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ha&&(c&&a.b.da(),d=a.b.Ha(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.w.ha=!1,!1===d&&(e=null)));for(var h=rb(a.id),l=0;l<h.length;l++){var m=h[l];m.w.ha&&(m.Ha&&(d=m.Ha(b,c),"object"===typeof d&&f.set(m.id,
|
|
|
|
|
d)),c&&(m.w.ha=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Oi(a,a.g,f.toString()),Mi(g)&&Mi(f)||(e=null,d=h=!0)):a.f&&(d=!0,h=3==a.f),d&&f.clear(h)):e=f.toString());c&&(a.w.ha=!1,b=a.G.power)&&(b.textContent="Power");a.C=0;return e}
|
|
|
|
|
k.reset=function(){this.v&&this.v.reset&&(E(this,"Resetting "+this.v.type),this.v.reset());this.b&&this.b.reset&&(E(this,"Resetting "+this.b.type),this.b.reset());for(var a=rb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.v&&c!==this.b&&c.reset&&(E(this,"Resetting "+c.type),c.reset())}this.pa(-1)};k.start=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.pa(-1)};
|
|
|
|
|
k.stop=function(a,b){for(var c=rb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.pa(-1)};
|
|
|
|
|
k.pa=function(a){if(this.b){var b=this.b,c=a||0,d=b.G.speed;d&&(0>=c||30<=(b.tb+=c))&&(d.textContent=b.w.W?b.ma.toFixed(2)+"Mhz":"Stopped",b.tb=0)}if(this.A&&(b=this.A,a=a||0,b.I)){c=b.b.w.W;d=!!(b.b.J&4);if(0>=a||60<=(b.H+=a)){for(var e=0;e<b.b.u.length;e++)Pb(b,"R"+e,b.b.u[e]);e=Uc(b.b);Pb(b,"PS",e);Pb(b,"NF",e&8?1:0,1);Pb(b,"ZF",e&4?1:0,1);Pb(b,"VF",e&2?1:0,1);Pb(b,"CF",e&1?1:0,1);b.H=0}hc(b,0<a&&c&&!d?b.b.u[7]:b.f);gc(b,b.D);a=b.b;a=a.L?a.fb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16",
|
|
|
|
|
a&4)}};
|
|
|
|
|
k.ra=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.w.ha?zi(d,!1,!0):Gi(d,d.Mb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.w.ha&&!d.C)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");zi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.qc=!0),d.Mb(Ci),d.qc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
|
|
|
|
|
c,c.onclick=function(){var a=Di(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=zi(d,b);b?Ni(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1};
|
|
|
|
|
function Di(a,b){var c=a.g;c||((c=Ja("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=Oi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c}
|
|
|
|
|
function Oi(a,b){a.g=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Fi(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Pi(a,"1.30.3"));return b}
|
|
|
|
|
function Ni(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Pi(a,"1.30.3");d.data=c;b=Da(Fa()+"/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.P("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.P(c),La("user",""),a.g=null)}}
|
|
|
|
|
function fh(a){var b;a=rb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.rb=function(a){if(this.Sa){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Sa.focus();!a&&window&&window.scrollTo(b,c)}};Za(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Ai(g,d,!0);B(g,f);g.L&&Gi(g,g.Mb)}});
|
|
|
|
|
Ua.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.ca&&!c.w.ha&&c.Mb(-1)}});Ua.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.w.ha&&zi(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Pi(a,b,c);this.i=a.i;Ki(this,a.Yc)}function Pi(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}
|
|
|
|
|
N.prototype={constructor:N,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){Ki(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 Ki(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Li(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);La(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ii(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Ei(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Qi=0;
|
|
|
|
|
function aj(a,b,c,d,e,f){e("Loading "+a+"...");Da(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):bj(h,a,b,c,d,e,f)})}
|
|
|
|
|
function bj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(qb(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?cj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
|
|
|
function cj(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
|
|
|
|
"");a=a.replace(d[0],g);cj(a,b,c)}})}else c(a,null)}
|
|
|
|
|
function dj(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Qi||ab(!0));l=!1}var g,h,l=!0;Qi++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
|
|
|
|
|
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?aj(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Qi||ab(!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),--Qi||ab(!0)):f("invalid machine element: "+
|
|
|
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?aj(b,a,d,!0,e,m):bj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return dj(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
|
|
|
|
k.sa=function(a,b,c){var d=this;switch(b){case "power":return this.G[b]=c,c.onclick=function(){d.C||(d.w.ha?Ai(d,!1,!0):Hi(d,d.Nb))},!0;case "reset":return this.G[b]=c,c.onclick=function(){if(d.w.ha&&!d.C)if(d.f&&!d.H){var a=Ga("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Ai(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.rc=!0),d.Nb(Di),d.rc=!1)}else d.reset(),d.b&&d.b.sb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
|
|
|
|
|
c,c.onclick=function(){var a=Ei(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=Ai(d,b);b?Oi(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1};
|
|
|
|
|
function Ei(a,b){var c=a.g;c||((c=Ja("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=Pi(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c}
|
|
|
|
|
function Pi(a,b){a.g=null;b=Da(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(La("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Gi(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Qi(a,"1.30.3"));return b}
|
|
|
|
|
function Oi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Qi(a,"1.30.3");d.data=c;b=Da(Fa()+"/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.P("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.P(c),La("user",""),a.g=null)}}
|
|
|
|
|
function gh(a){var b;a=rb(a.id);for(var c=0;c<a.length;c++){var d=a[c];if(b)b==d&&(b=null);else if("RAM"==d.type)return d}return null}k.rb=function(a){if(this.Ta){var b=0,c=0;!a&&window&&(b=window.scrollX,c=window.scrollY);this.Ta.focus();!a&&window&&window.scrollTo(b,c)}};Za(function(){for(var a=D(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=A(c),c=D(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=A(f),g=new Bi(g,d,!0);B(g,f);g.L&&Hi(g,g.Nb)}});
|
|
|
|
|
Ua.show.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.ca&&!c.w.ha&&c.Nb(-1)}});Ua.exit.push(function(){for(var a=D(document,"pdp11","computer"),b=0;b<a.length;b++){var c=A(a[b]);(c=tb("Computer",c.id))&&c.w.ha&&Ai(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Qi(a,b,c);this.i=a.i;Li(this,a.Yc)}function Qi(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}
|
|
|
|
|
N.prototype={constructor:N,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){Li(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 Li(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Mi(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);La(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Ji(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Fi(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ja(a.key))?(a[a.id]=b,a.b=!0):!1}var Ri=0;
|
|
|
|
|
function bj(a,b,c,d,e,f){e("Loading "+a+"...");Da(a,null,!0,function(g,h,l){l?(h||(h="unable to load "+a+" ("+l+")"),f(h,null)):cj(h,a,b,c,d,e,f)})}
|
|
|
|
|
function cj(a,b,c,d,e,f,g){function h(a,f){if(f)g(f,null);else{c&&(qb(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?dj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
|
|
|
|
function dj(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");Da(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(g=g.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
|
|
|
|
"");a=a.replace(d[0],g);dj(a,b,c)}})}else c(a,null)}
|
|
|
|
|
function ej(a,b,c,d){function e(a){if(void 0===h){var b=g&&D(g,"machine-warning");h=b&&b[0]||g}h&&(h.innerHTML=va(a))}function f(a){e("Error: "+a);l&&(--Ri||ab(!0));l=!1}var g,h,l=!0;Ri++;pb[a]={};try{if(g=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var n=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=m:v.appendChild(document.createTextNode(m));n.appendChild(v)}c||
|
|
|
|
|
(c="/versions/pdpjs/1.30.3/components.xsl");m=function(d,h){h?bj(c,null,null,!1,e,function(d,l){l?(qb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=h.transformNode(l))?(g.outerHTML=l,--Ri||ab(!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),--Ri||ab(!0)):f("invalid machine element: "+
|
|
|
|
|
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?bj(b,a,d,!0,e,m):cj(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(r){f(r.message)}return l}window.embedPDP11=function(a,b,c,d){ab(!1);return ej(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
|
|
|
|
|