Fixed the SXT and XOR opcodes (a couple of small oops)
This commit is contained in:
parent
77897275eb
commit
365b24c684
4 changed files with 436 additions and 435 deletions
|
|
@ -1739,7 +1739,7 @@ PDP11.opSWAB = function(opCode)
|
|||
*/
|
||||
PDP11.opSXT = function(opCode)
|
||||
{
|
||||
this.updateNZVFlags(this.writeDstWord(opCode, this.getNF? 0xffff : 0));
|
||||
this.updateNZVFlags(this.writeDstWord(opCode, this.getNF()? 0xffff : 0));
|
||||
this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0));
|
||||
};
|
||||
|
||||
|
|
@ -1846,7 +1846,8 @@ PDP11.opWAIT = function(opCode)
|
|||
*/
|
||||
PDP11.opXOR = function(opCode)
|
||||
{
|
||||
this.updateDstWord(opCode, this.readSrcWord(opCode), PDP11.fnXOR);
|
||||
var reg = (opCode >> PDP11.SRCMODE.SHIFT) & PDP11.OPREG.MASK;
|
||||
this.updateDstWord(opCode, this.regsGen[reg], PDP11.fnXOR);
|
||||
this.nStepCycles -= (this.dstMode? (8 + 1) : (2 + 1) + (this.dstReg == 7? 2 : 0));
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ if (DEBUGGER) {
|
|||
0x7200: [DebuggerPDP11.OPS.DIV, DebuggerPDP11.OP_DST, DebuggerPDP11.OP_SRCREG], // 071RSS
|
||||
0x7400: [DebuggerPDP11.OPS.ASH, DebuggerPDP11.OP_DST, DebuggerPDP11.OP_SRCREG], // 072RSS
|
||||
0x7600: [DebuggerPDP11.OPS.ASHC, DebuggerPDP11.OP_DST, DebuggerPDP11.OP_SRCREG], // 073RSS
|
||||
0x7800: [DebuggerPDP11.OPS.XOR, DebuggerPDP11.OP_SRCREG, DebuggerPDP11.OP_DST], // 074RSS
|
||||
0x7800: [DebuggerPDP11.OPS.XOR, DebuggerPDP11.OP_SRCREG, DebuggerPDP11.OP_DST], // 074RDD
|
||||
0x7E00: [DebuggerPDP11.OPS.SOB, DebuggerPDP11.OP_SRCREG, DebuggerPDP11.OP_DSTOFF] // 077Rnn
|
||||
},
|
||||
0xFF00: {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
for(var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ca=["Math","log2"],da=0;da<ca.length-1;da++){var ea=ca[da];ea in ba||(ba[ea]={});ba=ba[ea]}var ga=ca[ca.length-1],ha=ba[ga],ja=ha?ha:function(a){return Math.log(a)/Math.LN2};
|
||||
ja!=ha&&null!=ja&&aa(ba,ga,{configurable:!0,writable:!0,value:ja});var ka={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[40,2,9,,253],737280:[80,2,9,,249],1228800:[80,2,15,,249],1474560:[80,2,18,,240],2949120:[80,2,36,,240],21368320:[615,4,17],5242880:[256,2,40,256],10485760:[512,2,40,256]};
|
||||
function pa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
function la(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0<a.indexOf(",");e&&(a=a.replace(/,/g,""));"#"==d?(b=8,d=null):"$"==d&&(b=16,d=null);null==d?a=a.substr(1):("0"==d&&(d=a.charAt(1),"b"==d&&e&&(b=2,d=null),"o"==d?(b=8,d=null):"x"==d&&(b=16,d=null)),null==d?a=a.substr(2):(d=a.charAt(a.length-1).toLowerCase(),"y"==d?(b=2,d=null):"."==d?(b=10,d=null):"h"==d&&(b=16,d=null),null==d&&(a=a.substr(0,a.length-1))));var f,d=a;((e=b)&&10!=e?16==e?d.match(/^[0-9a-f]+$/i):8==e?d.match(/^[0-7]+$/):2==e&&
|
||||
d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function qa(a,b,c){var d="";b?11<b&&(b=11):b=a&-65536?11:6;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;)d=String.fromCharCode((a&7)+48)+d,a>>=3;return(c?"0o":"")+d}function p(a,b,c){var d="";b?8<b&&(b=8):b=a&-65536?8:4;if(null==a||isNaN(a))for(;0<b--;)d="?"+d;else for(;0<b--;){var e=a&15,e=e+(0<=e&&9>=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}
|
||||
function ra(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0<d&&(c=c.substr(0,d));b&&(d=c.lastIndexOf("."),0<d&&(c=c.substring(0,d)));return c}function sa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ta(a,b){return-1!==a.indexOf(b,a.length-b.length)}var ua={"&":"&","<":"<",">":">",'"':""","'":"'"};function va(a){return a.replace(/[&<>"']/g,function(a){return ua[a]})}
|
||||
function wa(a,b){return(a+" ").slice(0,b)}function xa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ya={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",11:"VT",12:"FF",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};
|
||||
|
|
@ -43,282 +43,282 @@ typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encod
|
|||
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++]=
|
||||
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 Ka(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function Qa(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 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.wc=b.comment;this.Zc=b;b=this.id.indexOf(".");0>b?this.$a=this.id:(this.Qa=this.id.substr(0,b),this.$a=this.id.substr(b+1));this[a]=c;this.w={ready:!1,bb:!1,$b:!1,ha:!1,error:!1};this.Tb=null;this.w.error=!1;this.G={};this.i=null;this.ma=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 ob(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=ob(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 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.ma=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 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.$a)}),!0;default:return!1}},log:function(){},j:function(){},status:function(a){this.j(this.$a+": "+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.ma;var c=a.i.ma&b;return!!b&&c===b||!!(c&a.i.Rc)}return!1}
|
||||
function ub(a,b){if(a.w.$b)return a.w.bb=!1,a.w.$b=!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.$b=!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)}
|
||||
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.ma;var c=a.i.ma&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)}
|
||||
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,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);this.f=this.A=this.Xa=this.D=this.H=this.I=0;this.L=this.M=this.J=!1;this.O=Db;this.B={};this.g={START:[1,1,!0,!1,this.fd],STEP:[1,1,!1,!1,this.gd],ENABLE:[1,1,!1,!1,this.bd],CONT:[1,1,!0,!1,this.$c],DEP:[0,0,!0,!1,this.ad],EXAM:[1,1,!0,!1,this.cd],LOAD:[1,1,!0,!1,this.ed],TEST:[0,0,!0,!1,this.dd]};for(a=0;22>a;a++)this.g["S"+a]=[0,0,!1,!1,this.hd,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()};
|
||||
function Cb(a){t.call(this,"Panel",a,Cb);this.f=this.A=this.Wa=this.D=this.H=this.I=0;this.L=this.M=this.J=!1;this.O=Db;this.B={};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.B[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 Nb(a,b,c){if(a=a.G[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function Kb(a,b){for(var c in a.B)Nb(a,c,null!=b?b:a.B[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 ac(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.fd=function(a){a||this.b.w.W||(this.v.reset(),bc(this.b),Eb(this,"ENABLE")&&this.b.hb())};k.gd=function(){};k.bd=function(a){a||this.b.da()};
|
||||
k.$c=function(a){if(!a&&!this.b.w.W)if(Eb(this,"ENABLE"))this.b.hb();else{if((a=this.i)&&!vb(a,!0))ub(a,!0),a.ib(0),ub(a,!1);else try{var b=this.b.ib(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.ad=function(a){a&&!this.b.w.W&&(this.L&&fc(this),a=gc(this,this.Xa),this.O==Db?this.v.Bb(this.f,a):this.b.Bb(this.f,a))};
|
||||
k.cd=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.ed=function(a){a||this.b.w.W||hc(this,this.Xa)};k.dd=function(a){a?(this.J=!0,Kb(this,!0)):(this.J=!1,Kb(this),ic(this,0))};k.hd=function(a,b){this.Xa=a?this.Xa|1<<b:this.Xa&~(1<<b)};function fc(a){var b=1145>a.b.Wa?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.A=b&65535;b=a.A;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.A}function jc(a,b,c){a.B[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.Xa=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.A=a};k.ld=function(a){return(a?this.Xa:this.D)&65535};
|
||||
k.fe=function(a){this.D=a};var lc={},Ib=(lc[65400]=[null,null,Cb.prototype.ld,Cb.prototype.fe,"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.B=[];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.ab=[];this.la=0;this.f=!1;this.bc=0;this.A=[];this.Oc=[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.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.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.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.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.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.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.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.la))}
|
||||
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.B)Nb(a,c,null!=b?b:a.B[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||(this.v.reset(),bc(this.b),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.A=b&65535;b=a.A;for(var c=0;16>c;c++)jc(a,"D"+c,b&1<<c);return a.A}function jc(a,b,c){a.B[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.A=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.B=[];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.la=0;this.f=!1;this.ac=0;this.A=[];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.la),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.la);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.la):(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.la))}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.la),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.la);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.la):(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.la))}
|
||||
function uc(a,b){if(b!=a.C){var c;a.C&&(c=(1<<a.C)-nc,vc(a,c,nc,a.B),a.C=0);b&&(a.C=b,c=1<<b,a.Na=c-1,c-=nc,a.B=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.A.length;a++)this.A[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.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.bc+=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.Na)>>>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.Na)>>>this.ja].gc(a&this.v,a);this.la--;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.cb=function(a){3932160<=a&&(a=Cc(this.b,a));var b=a&this.v,c=(a&this.Na)>>>this.ja;this.f=!1;this.la++;a=this.Y[c].hc(b,a);this.la--;return a};k.Ab=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a)};k.rb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.f=!1;this.la++;this.Y[(a&this.Na)>>>this.ja].Zb(a&this.v,b&255,a);this.la--};
|
||||
k.gb=function(a,b){3932160<=a&&(a=Cc(this.b,a));this.Y[(a&this.Na)>>>this.ja].Qb(a&this.v,b&65535,a)};k.Bb=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.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.Ta||e.Tc){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,d,e){for(var f in c){var g=+f,h=c[f];if(!(h[6]&&h[6]>a.b.Wa)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y<r;y++,g+=2)if(w&&1<r&&(w=h[4]+y),!Ec(a,g,g,l,m,n,v,d||64,w||e))return!1}}return!0}function Jb(a,b){a.A.push(b)}
|
||||
k.Da=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.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,lc:-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.lc=Gc(c,function(){e.f.Kb|=128;e.f.Kb&64&&Oc(e.b,e.f.de);e.C&&e.C.oa(1);Pc(e.b,e.f.lc,1E3/60)});this.f.de=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.td=function(){return this.f.Kb};k.ne=function(a){this.f.Kb=a&192};k.vd=function(){var a=this.b;return a.J&62337|a.kb<<5|a.jb<<1};
|
||||
k.pe=function(a){var b=this.b;a&=62337;if(b.J!=a){b.J=a;b.kb=a>>5&3;b.jb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Va!=c&&(b.Va=c,Sc(b))}};k.wd=function(){var a=this.b;a.J&57344||(a.Bc=a.S&65535);a=a.Bc;a&65280&&(a=(a<<8|a>>8)&65535);return a};k.xd=function(){var a=this.b;a.J&57344||(a.Dc=a.Jb);return a.Dc};k.yd=function(){return this.b.qb};k.qe=function(a){var b=this.b;1170>b.Wa&&(a&=-49);b.qb!=a&&(b.qb=a,b.Ja=a&16?4194303:262143,Sc(b))};
|
||||
k.Zd=function(a){a=a>>1&63;var b=this.b.Ob[a>>1];return a&1?b>>16:b&65535};k.Re=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.Sd=function(a){return this.b.V[1][a>>1&7]};k.Ke=function(a,b){this.b.V[1][b>>1&7]=a&65295};k.Qd=function(a){return this.b.V[1][(a>>1&7)+8]};k.Ie=function(a,b){this.b.V[1][(b>>1&7)+8]=a&65295};k.Rd=function(a){return this.b.ya[1][a>>1&7]};k.Je=function(a,b){b=b>>1&7;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};
|
||||
k.Pd=function(a){return this.b.ya[1][(a>>1&7)+8]};k.He=function(a,b){b=(b>>1&7)+8;this.b.ya[1][b]=a;this.b.V[1][b]&=65295};k.sd=function(a){return this.b.V[0][a>>1&7]};k.me=function(a,b){this.b.V[0][b>>1&7]=a&65295};k.qd=function(a){return this.b.V[0][(a>>1&7)+8]};k.ke=function(a,b){this.b.V[0][(b>>1&7)+8]=a&65295};k.rd=function(a){return this.b.ya[0][a>>1&7]};k.le=function(a,b){b=b>>1&7;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.pd=function(a){return this.b.ya[0][(a>>1&7)+8]};
|
||||
k.je=function(a,b){b=(b>>1&7)+8;this.b.ya[0][b]=a;this.b.V[0][b]&=65295};k.Yd=function(a){return this.b.V[3][a>>1&7]};k.Qe=function(a,b){this.b.V[3][b>>1&7]=a&65295};k.Wd=function(a){return this.b.V[3][(a>>1&7)+8]};k.Oe=function(a,b){this.b.V[3][(b>>1&7)+8]=a&65295};k.Xd=function(a){return this.b.ya[3][a>>1&7]};k.Pe=function(a,b){b=b>>1&7;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};k.Vd=function(a){return this.b.ya[3][(a>>1&7)+8]};k.Ne=function(a,b){b=(b>>1&7)+8;this.b.ya[3][b]=a;this.b.V[3][b]&=65295};
|
||||
k.yb=function(a){a&=7;return this.b.N&2048?this.b.Ya[a]:this.b.u[a]};k.Cb=function(a,b){b&=7;this.b.N&2048?this.b.Ya[b]=a:this.b.u[b]=a};k.Dd=function(){return this.b.N&49152?this.b.Ia[0]:this.b.u[6]};k.ve=function(a){this.b.N&49152?this.b.Ia[0]=a:this.b.u[6]=a};k.Gd=function(){return this.b.u[7]};k.ye=function(a){this.b.u[7]=a};k.zb=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Ya[a]};k.Db=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Ya[b]=a};
|
||||
k.Ed=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[1]};k.we=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[1]=a};k.Fd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.Ia[3]};k.xe=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.Ia[3]=a};k.nd=function(a){return this.b.Hc[a-65504>>1]};k.he=function(a,b){this.b.Hc[b-65504>>1]=a};k.Ec=function(a){if(65520==a){a=0;switch(Ac){case Ac:a=this.v.bc}a=(a>>6)-1}else a=0;return a};k.Lc=function(){};k.Ud=function(){return 1};
|
||||
k.Me=function(){};k.md=function(){return this.b.Ha};k.ge=function(){this.b.Ha=0};k.ud=function(){return this.b.Gc};k.oe=function(a,b){b&1||(a&=255);this.b.Gc=a};k.zd=function(a){return a?this.b.jc:0};k.re=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.jc=a;b.K|=2};k.Td=function(a){return a?this.b.Wb&65280:0};k.Le=function(a){this.b.Wb=a|255};k.Cd=function(){return Tc(this.b)};k.ue=function(a){Uc(this.b,a&-1793|Tc(this.b)&1792);this.b.K|=128};
|
||||
k.Kc=function(a,b){F(this)&&E(this,"writeIgnored("+qa(b)+"): "+qa(a),!0,!0)};
|
||||
var L={},Rc=(L[61568]=[null,null,K.prototype.Zd,K.prototype.Re,"UNIMAP",64,1170],L[62592]=[null,null,K.prototype.Sd,K.prototype.Ke,"SIPDR",8,1145],L[62608]=[null,null,K.prototype.Qd,K.prototype.Ie,"SDPDR",8,1145],L[62624]=[null,null,K.prototype.Rd,K.prototype.Je,"SIPAR",8,1145],L[62640]=[null,null,K.prototype.Pd,K.prototype.He,"SDPAR",8,1145],L[62656]=[null,null,K.prototype.sd,K.prototype.me,"KIPDR",8,1145],L[62672]=[null,null,K.prototype.qd,K.prototype.ke,"KDPDR",8,1145],L[62688]=[null,null,K.prototype.rd,
|
||||
K.prototype.le,"KIPAR",8,1145],L[62704]=[null,null,K.prototype.pd,K.prototype.je,"KDPAR",8,1145],L[62798]=[null,null,K.prototype.yd,K.prototype.qe,"MMR3",1,1145],L[65382]=[null,null,K.prototype.td,K.prototype.ne,"LKS"],L[65402]=[null,null,K.prototype.vd,K.prototype.pe,"MMR0",1,1145],L[65404]=[null,null,K.prototype.wd,K.prototype.Kc,"MMR1",1,1145],L[65406]=[null,null,K.prototype.xd,K.prototype.Kc,"MMR2",1,1145],L[65408]=[null,null,K.prototype.Yd,K.prototype.Qe,"UIPDR",8,1145],L[65424]=[null,null,K.prototype.Wd,
|
||||
K.prototype.Oe,"UDPDR",8,1145],L[65440]=[null,null,K.prototype.Xd,K.prototype.Pe,"UIPAR",8,1145],L[65456]=[null,null,K.prototype.Vd,K.prototype.Ne,"UDPAR",8,1145],L[65472]=[null,null,K.prototype.yb,K.prototype.Cb,"R0SET0"],L[65473]=[null,null,K.prototype.yb,K.prototype.Cb,"R1SET0"],L[65474]=[null,null,K.prototype.yb,K.prototype.Cb,"R2SET0"],L[65475]=[null,null,K.prototype.yb,K.prototype.Cb,"R3SET0"],L[65476]=[null,null,K.prototype.yb,K.prototype.Cb,"R4SET0"],L[65477]=[null,null,K.prototype.yb,K.prototype.Cb,
|
||||
"R5SET0"],L[65478]=[null,null,K.prototype.Dd,K.prototype.ve,"R6KERNEL"],L[65479]=[null,null,K.prototype.Gd,K.prototype.ye,"R7KERNEL"],L[65480]=[null,null,K.prototype.zb,K.prototype.Db,"R0SET1",1,1145],L[65481]=[null,null,K.prototype.zb,K.prototype.Db,"R1SET1",1,1145],L[65482]=[null,null,K.prototype.zb,K.prototype.Db,"R2SET1",1,1145],L[65483]=[null,null,K.prototype.zb,K.prototype.Db,"R3SET1",1,1145],L[65484]=[null,null,K.prototype.zb,K.prototype.Db,"R4SET1",1,1145],L[65485]=[null,null,K.prototype.zb,
|
||||
K.prototype.Db,"R5SET1",1,1145],L[65486]=[null,null,K.prototype.Ed,K.prototype.we,"R6SUPER",1,1145],L[65487]=[null,null,K.prototype.Fd,K.prototype.xe,"R6USER",1,1145],L[65504]=[null,null,K.prototype.nd,K.prototype.he,"CTRL",8,1170],L[65520]=[null,null,K.prototype.Ec,K.prototype.Lc,"LSIZE",1,1170],L[65522]=[null,null,K.prototype.Ec,K.prototype.Lc,"HSIZE",1,1170],L[65524]=[null,null,K.prototype.Ud,K.prototype.Me,"SYSID",1,1170],L[65526]=[null,null,K.prototype.md,K.prototype.ge,"CPUERR",1,1170],L[65528]=
|
||||
[null,null,K.prototype.ud,K.prototype.oe,"MB",1,1170],L[65530]=[null,null,K.prototype.zd,K.prototype.re,"PIR"],L[65532]=[null,null,K.prototype.Td,K.prototype.Le,"SL"],L[65534]=[null,null,K.prototype.Cd,K.prototype.ue,"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;
|
||||
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.la++;a=this.Y[(a&this.Na)>>>this.ja].fc(a&this.v,a);this.la--;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.la++;a=this.Y[c].gc(b,a);this.la--;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.la++;this.Y[(a&this.Na)>>>this.ja].Yb(a&this.v,b&255,a);this.la--};
|
||||
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.la++;this.Y[d].lc(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.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,d,e){for(var f in c){var g=+f,h=c[f];if(!(h[6]&&h[6]>a.b.Va)){var l=h[0]?h[0].bind(b):null,m=h[1]?h[1].bind(b):null,n=h[2]?h[2].bind(b):null,v=h[3]?h[3].bind(b):null,r=h[5]||1;65472<=g&&65487>=g&&(!l&&n&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!m&&v&&(m=function(a){return function(b,c){return a(b,c)}.bind(b)}(v)));for(var w=h[4],y=0;y<r;y++,g+=2)if(w&&1<r&&(w=h[4]+y),!Ec(a,g,g,l,m,n,v,d||64,w||e))return!1}}return!0}function Jb(a,b){a.A.push(b)}
|
||||
k.Da=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.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)};
|
||||
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.Pb=c;this.size=d||0;this.type=e||$c;this.f=e==ad;this.controller=null;sc(this);this.Ta=this.Tc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],bd(this,f.Oc);else if(zb)this.A=new ArrayBuffer(this.size),this.D=new DataView(this.A,0,this.size),this.G=new Uint8Array(this.A,0,this.size),this.I=new Uint16Array(this.A,0,this.size>>1),this.b=new Int32Array(this.A,0,this.size>>2),bd(this,Yc?cd:dd);else{a=this.b=Array(this.size>>
|
||||
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.A=new ArrayBuffer(this.size),this.D=new DataView(this.A,0,this.size),this.G=new Uint8Array(this.A,0,this.size),this.I=new Uint16Array(this.A,0,this.size>>1),this.b=new Int32Array(this.A,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},mb: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},B: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.Vb(a++,b++)|this.Vb(a,b)<<8},H:function(a,b,c){this.Yb(a++,b&255,c++);this.Yb(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.gc(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.hc(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.B(a,b,c):this.Zb(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.B(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.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},$a: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.Yb=a.f?a.B:a.Zb,a.Qb=a.f?a.H:a.mc):--a.g||(a.Vb=a.gc,a.qa=a.hc)}function fd(a,b,c){c&&a.C||(a.Yb=!a.f&&b[1]||a.B,a.Qb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Zb=b[1]||a.B,a.mc=b[3]||a.H}function hd(a,b,c){c&&a.g||(a.Vb=b[0]||a.J,a.qa=b[2]||a.L);if(c||void 0===c)a.gc=b[0]||a.J,a.hc=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.$a,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.Eb=0;this.nb=b;this.eb=c;this.Gb=Math.round(this.nb/1E4)/100;this.pb=this.Gb*this.eb;this.w.W=!1;this.w.Xb=!1;this.w.tb=a.autoStart;this.w.ub=!1;this.Lb=this.va=0;this.Mb=a.csStart;this.vb=a.csInterval;this.wb=a.csStop;this.L=[];this.Ac=this.ce.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.B=a.B;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.tb="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.tb,a.jb=!0,a.j("Type ? for help with PDPjs Debugger commands"),qd(a),b||a.sb(),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.tb=function(){return this.w.tb||!this.i&&void 0===this.G.run?(this.hb(),!0):!1};k.sc=function(){return 0};
|
||||
function pd(a){void 0===a.Mb&&(a.Mb=0);void 0===a.vb&&(a.vb=-1);void 0===a.wb&&(a.wb=-1);a.w.ub=0<=a.Mb&&0<a.vb;a.w.ub&&(a.Lb=0,a.va=a.Mb-a.ka)}function ec(a,b){if(a.w.ub){var c=!1;a.Lb=a.Lb+a.sc()|0;a.va-=b;0>=a.va&&(a.va+=a.vb,c=!0);0<=a.wb&&a.wb<=sd(a)&&(a.vb=a.wb=-1,pd(a),a.da(),c=!0);c&&a.j(sd(a)+" cycles: checksum="+p(a.Lb))}}
|
||||
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.Tb?" (waiting for notification)":""))+".");a=!1}a&&(d.w.W?d.da():d.hb())},
|
||||
!0;case "speed":return this.G[b]=c,!0;case "setSpeed":return this.G[b]=c,c.onclick=function(){td(d,d.eb<<1,!0)},c.textContent=this.pb.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.eb&&a.ta&&(c=a.ta/a.Gb);a.yc=Math.round(1E3/30);a.ob=Math.floor(a.nb/30*c);b||(a.wa=a.ob);a.Hb=0}function sd(a){return a.ka+a.$+a.ia-a.b}function od(a){a.ta=0;a.zc=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.pb?b=1:d=!0;a.eb=b;b=a.Gb*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.sb()}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.nb*a.eb/1E3*c|0,a.w.W&&(c+=vd(a)),a.L[b][0]=c)}
|
||||
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},B: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.B(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.B(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.B: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.B,a.Pb=!a.f&&b[3]||a.H);if(c||void 0===c)a.Yb=b[1]||a.B,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.B=a.B;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.ce=function(){if(this.w.W){this.Hb>=this.nb&&ud(this,!0);this.Ra=0;this.lb=Aa();if(this.ca){var a=this.lb-this.ca;a>this.yc&&(this.X+=a,this.X>this.lb&&(this.X=this.lb))}try{do{var b=wd(this,this.w.ub?1:this.ob);try{this.ib(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.ob;15<=++this.zc&&(this.oa(),this.zc=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.Ac;this.ca=Aa();var c=this.yc;this.Ra&&(c=Math.round(c*this.Ra/this.ob));var c=c-(this.ca-this.lb),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.pb)-1E3>c&&(this.X-=c),c=0;this.Hb+=this.Ra;this.ca+=c;a(b,c)}}};
|
||||
k.hb=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.Xb=!0;var b=this.G.run;b&&(b.textContent="Halt");this.C&&(a&&this.C.sb(!0),this.C.start(this.X,sd(this)));setTimeout(this.Ac,0);return!0};k.ib=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.Wa=+a.model||1170;this.vc=a.addrReset||0;ld.call(this,a,6666667);this.decode=1120==this.Wa?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.Wa);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.vc];a.Ya=[0,0,0,0,0,0];a.Ia=[0,0,0,0];a.A=0;a.jb=0;a.Yc=[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.Hc=[0,0,0,0,0,0,0,0];a.Gc=0;a.K=0;a.D=a.H=0;a.g=a.f=a.Fb=0;a.xa=-1;bc(a)}function bc(a){a.Wb=255;a.Ha=0;a.jc=0;a.J=0;a.Bc=0;a.Dc=0;a.qb=0;a.Va=0;a.kb=0;a.Ja=262143;a.S=0;a.Jb=0;a.O=null;a.v&&Sc(a)}function Sc(a){a.Va?(a.R=65536,a.ba=a.Wc,a.qa=a.$d,a.Qb=a.Se,uc(a.v,a.qb&16?22:18)):(a.R=0,a.ba=a.Vc,a.qa=a.Fc,a.Qb=a.Mc,uc(a.v,16))}k.sc=function(){return 0};k.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ka,this.eb]);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}k.Ua=function(){return this.Z&32768?8:0};
|
||||
function Ed(a){var b=a.u[7];a.S=0;a.Jb=b;var c=a.qa(b);a.u[7]=b+2&65535;return c}function Fd(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{ee:a,xb:b,next:null}}function Gd(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 Oc(a,b){if(b!=a.O){var c=a.O;if(!c||c.xb<=b.xb)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.xb<=b.xb){b.next=d;c.next=b;break}c=d}while(c)}}a.K|=1}
|
||||
function Hd(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|a.Ua()|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.Ya.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ya[c];a.Ya[c]=d}a.A=b>>14&3;c=a.N>>14&3;a.A!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.A]);a.N=b;a.K|=2}function Q(a,b){a.K&128||(a.Z=a.aa=b,a.U=0)}function Id(a,b,c){a.K&128||(a.Z=a.aa=a.T=b,a.U=c||0)}
|
||||
function Jd(a,b,c,d){a.K&128||(a.Z=a.aa=a.T=b,a.U=(c^b)&(d^b))}function ee(a,b){a.K&128||(a.Z=a.aa=a.T=b,a.U=a.Z^a.T>>1)}function fe(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.A||(a=4,this.Ha|=4,this.u[6]=4,c=-3);this.Jb=a;this.A=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);ge(this,this.xa);ge(this,this.u[7]);O(this,d);this.K&=~(b|18);this.K|=9;this.xa=-1;this.kd=a;this.jd=c;if(-3<=c)throw a;}};function he(a){var b=ie(a),c=ie(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.qb&32&&(b=a.Ob[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function je(a,b,c){var d,e,f;if(!(c&a.Va))return b;d=b>>13;a.qb&a.Yc[a.A]||(d&=7);e=a.V[a.A][d];f=(a.ya[a.A][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.A][d]=e;if(f!=(4194170&a.Ja)||a.A)a.kb=a.A,a.jb=d;b=!1;g&&(g&57344&&(0<=a.xa&&(g|=128),a.J&57344||(a.J=a.J|g|a.kb<<5|a.jb<<
|
||||
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 ke(a,b){return a.v.Ib(b)}function ie(a){var b=a.qa(a.u[6]|a.R);a.u[6]=a.u[6]+2&65535;return b}function ge(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.S=a.S<<8|246;le(a,0,c);a.Qb(c,b)}function le(a,b,c){!a.A&&c<=a.Wb&&(b||4<c)&&(1145<=a.Wa&&c<=a.Wb-32?(a.Ha|=4,a.u[6]=4,a.sa(4,0,-3)):(a.Ha|=8,a.K|=32))}
|
||||
function me(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&&le(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(Fd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.qa(Fd(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&&le(a,b,a.u[6]);return e}k.Ub=function(a){if(!this.Va)return this.v.Ub(a);this.M++;a=ke(this,je(this,a,3));this.M--;return a};k.cb=function(a){if(!this.Va)return this.v.cb(a);this.M++;a=this.Fc(je(this,a,2));this.M--;return a};k.rb=function(a,b){this.Va?(this.M++,a=je(this,a,5),a&1&&this.b--,this.v.Ab(a,b),this.M--):this.v.rb(a,b)};
|
||||
k.Bb=function(a,b){this.Va?(this.M++,this.Mc(je(this,a,4),b),this.M--):this.v.Bb(a,b)};k.Vc=function(a,b,c){return me(this,a,b,c)};k.Wc=function(a,b,c){return je(this,me(this,a,b,c),c)};k.Fc=function(a){return this.v.na(a)};k.$d=function(a){return this.v.na(je(this,a,2))};k.Mc=function(a,b){this.v.gb(a,b&65535)};k.Se=function(a,b){this.v.gb(je(this,a,4),b)};
|
||||
function ne(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=me(a,b,d,2),c&65536||61440!==(a.N&61440)&&(d&=65535),a.A=a.N>>12&3,c=a.qa(d|c&a.R),a.A=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 oe(a,b,c,d){a.S=22;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=me(a,b,e,4),c&65536||(e&=65535),a.A=a.N>>12&3,e=je(a,e|c&65536,4),a.A=a.N>>14&3,a.v.gb(e,d)):6!=e||(a.N>>2&12288)===(a.N&12288)?a.u[e]=d:a.Ia[a.N>>12&3]=d}
|
||||
function pe(a,b){b>>=6;var c=a.H=b&7;return(b=a.D=(b&56)>>3)?ke(a,a.ba(b,c,3)):-c-1}function qe(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 re(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return me(a,b,c,8)}function se(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?ke(a,a.ba(b,c,3)):a.u[c]&255}function te(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.Fb=a.ba(b,e,7),c=0>c?a.u[-c-1]&255:c,c=d.call(a,c,ke(a,e)),e&1&&a.b--,a.v.Ab(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.gb(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 ue(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.Ab(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 ve(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.ba(b,d,4),a.v.gb(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.ib=function(a){this.w.complete=!0;var b=this.i?we(this.i)?1:this.w.Xb?-1:0:0,c=a?this.w.Xb?0:1:-1;this.w.Xb=!1;this.ia=this.b=a;do{if(b){if(xe(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.jc&224)>>5,f=this.O&&this.O.xb>e?this.O:null;f&&(d=f.ee,e=f.xb);e>(this.N&224)>>5?(this.K&4&&(Fd(this,2),this.K&=-5),this.sa(d,0,-9),e=!0):e=!1;e&&(f&&Gd(this,f),a=!0)}else this.K&1&&this.K++;if(a){if(b&&xe(this.i,this.u[7],c)){this.da();
|
||||
break}if(0>c)break}if(this.K&112&&Hd(this)){if(b&&xe(this.i,this.u[7],c)){this.da();break}if(0>c)break}}this.K=this.K&7|this.N&16;this.decode(Ed(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 ye(a,b){var c=b+a;Jd(this,c,a,b);return c&65535}function ze(a,b){var c=b+a;Jd(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function Ae(a,b){a=b<<1;ee(this,a);return a&65535}function Be(a,b){a=b<<1;ee(this,a<<8);return a&255}function Ce(a,b){a=b&32768|b>>1|b<<16;ee(this,a);return a&65535}function De(a,b){a=b&128|b>>1|b<<8;ee(this,a<<8);return a&255}function Ee(a,b){a=b&~a;Q(this,a);return a}function Fe(a,b){a=b&~a;Q(this,a<<8);return a}function Ge(a,b){a|=b;Q(this,a);return a}function He(a,b){a|=b;Q(this,a<<8);return a}function Ie(a,b){a=~b|65536;Id(this,a);return a&65535}
|
||||
function Je(a,b){a=~b|256;Id(this,a<<8);return a&255}function Ke(a,b){a=b-a;this.K&128||(this.Z=this.aa=a,this.U=b&(b^a));return a&65535}function Le(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 Me(a,b){a=b+a;this.K&128||(this.Z=this.aa=a,this.U=a&(b^a));return a&65535}function Ne(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 Oe(a,b){a=-b;Id(this,a,a&b&32768);return a&65535}
|
||||
function Pe(a,b){a=-b;Id(this,a<<8,(a&b&128)<<8);return a&255}function Qe(a,b){a=b<<1|this.T>>16&1;ee(this,a);return a&65535}function Re(a,b){a=b<<1|this.T>>16&1;ee(this,a<<8);return a&255}function Se(a,b){a=(this.T&65536|b)>>1|b<<16;ee(this,a);return a&65535}function Te(a,b){a=((this.T&65536)>>8|b)>>1|b<<8;ee(this,a<<8);return a&255}function Ue(a,b){var c=b-a;fe(this,c,a,b);return c&65535}function Ve(a,b){var c=b-a;fe(this,c<<8,a<<8,b<<8);return c&255}
|
||||
function We(a,b){this.K&128||(this.Z=this.aa=b&65280,this.U=this.T=0);return(b<<8|b>>8)&65535}function Xe(a,b){a^=b;Q(this,a);return a&65535}function Ye(a){S(this,a,qe(this,a),ye);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}
|
||||
function Ze(a){var b=te(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 $e(a){var b=te(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 af(a){T(this,a,!Bd(this))}function bf(a){T(this,a,Bd(this))}
|
||||
function cf(a){S(this,a,qe(this,a),Ee);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function df(a){R(this,a,pe(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){S(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){R(this,a,pe(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){var b=qe(this,a);a=te(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 hf(a){var b=pe(this,a);a=se(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 jf(a){T(this,a,Dd(this))}function kf(a){T(this,a,!this.Ua()==!Cd(this))}function lf(a){T(this,a,!Dd(this)&&!this.Ua()==!Cd(this))}function mf(a){T(this,a,!Bd(this)&&!Dd(this))}
|
||||
function nf(a){T(this,a,Dd(this)||!this.Ua()!=!Cd(this))}function of(a){T(this,a,Bd(this)||Dd(this))}function pf(a){T(this,a,!this.Ua()!=!Cd(this))}function qf(a){T(this,a,this.Ua())}function rf(a){T(this,a,!Dd(this))}function sf(a){T(this,a,!this.Ua())}function tf(){this.sa(12,0,-8);this.b-=5}function uf(a){T(this,a,!0)}function vf(a){T(this,a,!Cd(this))}function wf(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 xf(a){var b=qe(this,a);a=te(this,a);var c=(b=0>b?this.u[-b-1]:b)-a;fe(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 yf(a){var b=pe(this,a);a=se(this,a);var c=(b=(0>b?this.u[-b-1]&255:b)<<8)-(a<<=8);fe(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=te(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 Af(){this.sa(24,0,-8);this.b-=25}
|
||||
function Bf(){this.N&49152?(this.Ha|=128,this.sa(4,0,-7)):(this.B&&1120==this.Wa&&this.B.setData(this.u[0],!0),this.i?Cf(this.i):this.da());this.b-=7}function Df(){this.sa(16,0,-8);this.b-=25}var Ef=[0,7,7,10,7,11,9,13];function Ff(a){this.I=this.b;O(this,re(this,a));this.b=this.I-Ef[this.g]}var Gf=[0,14,14,17,14,18,16,20];function Hf(a){this.I=this.b;var b=re(this,a);a=a>>6&7;ge(this,this.u[a]);this.u[a]=this.u[7];O(this,b);this.b=this.I-Gf[this.g]}
|
||||
var If=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function Jf(a){var b=qe(this,a);this.I=this.b;Q(this,ve(this,a,b));this.b=this.I-If[(this.D?8:0)+this.g]+(7!=this.f||this.g?0:2)}function Kf(a){var b=pe(this,a);Q(this,ue(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 Lf=[7,13,13,17,14,18,17,21];
|
||||
function Mf(a){var b=te(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 Nf(){this.b-=5}function Of(){this.N&49152||(this.v.reset(),bc(this));this.b-=667}function Pf(a){if(a&8)V.call(this,a);else{var b=ie(this);a&=7;7==a?O(this,b):(O(this,this.u[a]),this.u[a]=b);this.b-=9}}function Qf(){he(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 Rf(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 Sf(a){S(this,a,qe(this,a),Ue);this.b-=this.g?9+(this.H&&6<=this.f?1:0):(this.D?5:3)+(7==this.f?2:0)}function Tf(a){S(this,a,0,We);this.b-=this.g?9:3+(7==this.f?2:0)}function Uf(){this.sa(28,0,-8);this.b-=5}
|
||||
function Vf(){this.B&&(this.B.kc(this.u[7],!0),this.B.setData(this.u[0],!0));this.K|=4;Fd(this,-2);this.b-=3}function Wf(a){S(this,a,qe(this,a),Xe);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=Cf(b)):b=!1;b||this.sa(8,0,-8)}function yd(a){Xf[a>>12].call(this,a)}function Yf(a){Zf[a>>6&3].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&15].call(this,a)}
|
||||
function fg(a){gg[a&15].call(this,a)}function hg(a){ig[a>>6&3].call(this,a)}function jg(a){kg[a>>6&3].call(this,a)}function lg(a){mg[a>>6&3].call(this,a)}
|
||||
var Xf=[function(a){ng[a>>8&15].call(this,a)},Jf,xf,gf,cf,ef,Ye,V,function(a){og[a>>8&15].call(this,a)},Kf,yf,hf,df,ff,Sf,V],ng=[function(a){pg[a>>4&15].call(this,a)},uf,rf,jf,kf,pf,lf,nf,Hf,Hf,Yf,$f,bg,V,V,V],Zf=[function(a){Id(this,ve(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Ie);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Me);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,1,Ke);this.b-=this.g?9:3+(7==this.f?2:0)}],ag=[function(a){S(this,a,0,
|
||||
Oe);this.b-=this.g?11:6},function(a){S(this,a,Bd(this)?1:0,ye);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,Bd(this)?1:0,Ue);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=te(this,a);Id(this,a);this.b-=this.g?4:3+(7==this.f?2:0)}],cg=[function(a){S(this,a,0,Se);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){S(this,a,0,Qe);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)},function(a){S(this,a,0,Ae);this.b-=this.g?9:3+(7==this.f?2:0)}],
|
||||
pg=[function(a){qg[a&15].call(this,a)},V,V,V,Ff,Ff,Ff,Ff,Pf,V,dg,fg,Tf,Tf,Tf,Tf],qg=[Bf,Vf,Qf,tf,Df,Of,V,V,V,V,V,V,V,V,V,V],eg=[Nf,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],gg=[Nf,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],og=[sf,qf,mf,of,vf,wf,af,bf,Af,Uf,hg,jg,lg,V,V,V],ig=[function(a){Id(this,
|
||||
ue(this,a,0,255));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Je);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)},function(a){R(this,a,1,Le);this.b-=this.g?9:3+(7==this.f?2:0)}],kg=[function(a){R(this,a,0,Pe);this.b-=this.g?11:6},function(a){R(this,a,Bd(this)?1:0,ze);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,Bd(this)?1:0,Ve);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=se(this,a);Id(this,a<<8);this.b-=this.g?4:3+
|
||||
(7==this.f?2:0)}],mg=[function(a){R(this,a,0,Te);this.b-=this.g?9+(this.Fb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Re);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){R(this,a,0,De);this.b-=this.g?9+(this.Fb&1):3+(7==this.f?2:0)},function(a){R(this,a,0,Be);this.b-=this.g?9:3+(7==this.f?2:0)}];function zd(a){rg[a>>12].call(this,a)}
|
||||
var rg=[function(a){sg[a>>8&15].call(this,a)},Jf,xf,gf,cf,ef,Ye,function(a){tg[a>>8&15].call(this,a)},function(a){ug[a>>8&15].call(this,a)},Kf,yf,hf,df,ff,Sf,V],sg=[function(a){vg[a>>4&15].call(this,a)},uf,rf,jf,kf,pf,lf,nf,Hf,Hf,Yf,$f,bg,function(a){wg[a>>6&3].call(this,a)},V,V],wg=[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=ne(this,a,0);ge(this,a);Q(this,a);this.b-=11},function(a){var b=ie(this);this.I=
|
||||
this.b;oe(this,a,0,b);Q(this,b);this.b=this.I-Lf[this.g]},function(a){Q(this,ve(this,a,this.Ua?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],vg=[function(a){xg[a&15].call(this,a)},V,V,V,Ff,Ff,Ff,Ff,Pf,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)},dg,fg,Tf,Tf,Tf,Tf],xg=[Bf,Vf,function(){he(this);this.K|=this.N&16;this.b-=13},tf,Df,Of,Qf,function(){this.sa(8,0,-8)},V,V,V,V,V,V,V,V],tg=[Mf,Mf,zf,zf,Ze,Ze,$e,$e,Wf,Wf,V,V,V,V,Rf,Rf],ug=[sf,qf,mf,of,
|
||||
vf,wf,af,bf,Af,Uf,hg,jg,lg,function(a){yg[a>>6&3].call(this,a)},V,V],yg=[V,function(a){a=ne(this,a,65536);ge(this,a);Q(this,a);this.b-=11},function(a){var b=ie(this);this.I=this.b;oe(this,a,65536,b);Q(this,b);this.b=this.I-Lf[this.g]},V];
|
||||
function zg(a){t.call(this,"ROM",a,zg);this.ga=this.g=null;this.A=a.addr;this.f=a.size;this.D=!1;this.B=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);Ag(c)})}}z(zg);k=zg.prototype;
|
||||
k.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Ag(this)};k.Ga=function(){this.ga&&(this.i&&Tg(this.i,this.id,this.A,this.f,this.ga),delete this.ga);return!0};k.Fa=function(){return!0};
|
||||
function Ag(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.A;a.status(a.f+"-byte ROM at "+qa(b));if(57344<=b&&b<57344+nc){var c={};b=(c[b]=[zg.prototype.Od,zg.prototype.Ge,null,null,null,a.f>>1],c);if(Hb(a.v,a,b,256,a.$a)){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.rb(b+c,a.g[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.B?
|
||||
b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.A,d.f);vc(d.v,e,d.f,f)}a.D||delete a.g}}}H(a)}}k.Od=function(a){return this.g[a-this.A]};k.Ge=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 zg(d);B(d,c)}});
|
||||
function Ug(a){t.call(this,"RAM",a,Ug);this.ga=this.g=null;this.C=a.addr;this.A=a.size;this.La=a.load;this.Ka=a.exec;this.B=!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);Vg(c)})}}
|
||||
z(Ug);Ug.prototype.Ea=function(a,b,c,d){this.v=b;this.b=c;this.i=d;Vg(this)};Ug.prototype.Ga=function(){this.ga&&(this.i&&Tg(this.i,this.id,this.C,this.A,this.ga),delete this.ga);return!0};Ug.prototype.Fa=function(){return!0};function Vg(a){if(a.v&&(!a.B&&a.A&&xc(a.v,a.C,a.A,Ac)&&(a.B=!0),!wb(a))){if(!a.B)q("No RAM allocated");else if(a.f){if(!a.g||!a.v)return;Wg(a,a.g,a.La,a.Ka,a.C)}H(a)}}
|
||||
Ug.prototype.reset=function(){if(this.B){for(var a=this.v,b=this.C,c=this.A,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.B.length){var f=a.g.indexOf(e);0<=f&&(e=a.B[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.Zb(d,g,e.F+d)}c-=a.za;b++;d=0}this.g&&Wg(this,this.g,this.La,this.Ka,this.C,!0)}};
|
||||
function Wg(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.rb(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.rb(c+g,b[g]);g=!0}g&&null!=d&&(a=a.b,a.vc=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 Ug(d);B(d,c)}});function Xg(a){t.call(this,"Keyboard",a,Xg,65536);H(this)}z(Xg);Xg.prototype.ra=function(){return!1};
|
||||
Xg.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 Xg(d);B(d,c)}});
|
||||
function X(a){this.O=a.baudReceive||9600;this.ca=a.baudTransmit||9600;this.$=a.upperCase;this.B=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=Yg;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.xc,receiveData:this.ic}}z(X);var Yg="buffer";k=X.prototype;
|
||||
k.ra=function(a,b,c){var d=this;switch(b){case Yg:return this.G[b]=this.B=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.ic(b);return!0},c.onkeypress=function(a){a=a||window.event;d.ic(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.A.length||(e.J=e.A.shift()&255,e.$&&97<=e.J&&122>e.J&&(e.J-=32),e.f|=128,e.f&64&&Oc(e.b,e.ka))});this.M=Qc(52,4);this.ia=Gc(this.b,function(){e.g|=128;e.g&64&&Oc(e.b,e.M)});Hb(b,this,Zg);Jb(b,this.reset.bind(this));H(this)};
|
||||
k.xc=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.$a)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.xc(),!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(){$g(this)};k.save=function(){var a=new N(this);a.set(0,[]);return a.data()};k.restore=function(){return $g(this)};function $g(a){a.J=0;a.f=0;a.g=128;a.A=[];return!0}k.ic=function(a){if("number"==typeof a)this.A.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.A.push(a.charCodeAt(b));else this.A=this.A.concat(a);Pc(this.b,this.X,1E3/Math.round(this.O/10));return!0};k.Id=function(){return this.f&65534};
|
||||
k.Ae=function(a){this.f=this.f&-112|a&111};k.Hd=function(){this.f&=-129;0<this.A.length&&Pc(this.b,this.X,1E3/Math.round(this.O/10));return this.J};k.ze=function(){};k.be=function(){return this.g};k.Ue=function(a){this.g&128&&(a&64?Oc(this.b,this.M):Gd(this.b,this.M));this.g=this.g&-70|a&69};k.ae=function(){return 0};
|
||||
k.Te=function(a){if(a&=255){E(this,"transmitByte("+p(a,2,!0)+")");this.L&&this.L.call(this.I,a);a&=127;if(this.B)if(13==a)this.H=0;else if(8==a)this.B.value=this.B.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.B.value+=b;this.B.scrollTop=this.B.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 ah={},Zg=(ah[65392]=[null,null,X.prototype.Id,X.prototype.Ae,"RCSR"],ah[65394]=[null,null,X.prototype.Hd,X.prototype.ze,"RBUF"],ah[65396]=[null,null,X.prototype.be,X.prototype.Ue,"XCSR"],ah[65398]=[null,null,X.prototype.ae,X.prototype.Te,"XBUF"],ah);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=bh;this.B=ch;this.M=this.A="";this.ea=this.La=this.Ka=null;this.R=-1;this.O=!Ra("Mobi")&&window&&"FileReader"in window}z(Vc);var bh="",ch=0;k=Vc.prototype;
|
||||
k.ra=function(a,b,c){var d=this,e=ch;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&&dh(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;dh(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=eh(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,fh(e,e.J/e.I.length*100),e.f|=128,e.f&=-2049,e.f&64&&Oc(e.b,e.X))});Hb(b,this,gh);Jb(b,this.reset.bind(this));hh(this,"None",bh,!0);this.O&&
|
||||
hh(this,"Local Tape","?");hh(this,"Remote Tape","??");ih(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 ih(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?jh(a,c,b,1,!0):kh(a)}return!!a.D}
|
||||
function dh(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;jh(a,b,c,d,!1,e)}else lh(a,!1)}
|
||||
function jh(a,b,c,d,e,f){var g=-1;if(a.A.toLowerCase()!=c.toLowerCase()||a.B!=d)g++,lh(a,!0),a.w.bb?a.P("PC11 busy"):(e&&(a.D++,F(a)&&E(a,"auto-loading tape: "+b)),mh(a,b,c,d,f)?g++:a.w.bb=!0);g&&nh(a,a.M,a.A,a.B,a.ea,a.La,a.Ka)}
|
||||
function mh(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),nh(a,b,c,d,e),a.H="?");kh(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))&&nh(a,b,c,d,e.ea,e.La,
|
||||
e.Ka));a.w.bb=!1;a.D&&(a.D--,a.D||H(a));kh(a)})}function hh(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 kh(a){var b=a.G.listTapes;if(b&&b.options){a=a.H||a.A;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 fh(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 nh(a,b,c,d,e,f,g){a.M=b;a.A=c;a.B=d;a.ea=e;a.La=f;a.Ka=g;2==d?a.S&&Wg(a.S,e,f,g)?a.status("tape loaded: "+b):(a.M="",a.A="",a.H=bh,a.B=ch,a.P("No load address available for tape: "+b)):(a.J=0,a.I=e,a.status("tape attached: "+b),fh(a,0))}function lh(a,b){if(a.A||!1===b)a.M="",a.A="",b||(a.B&&a.status(1==a.B?"tape detached":"tape unloaded"),a.H=bh,a.B=ch,kh(a))}k.save=function(){return(new N(this)).data()};k.restore=function(){return!0};k.Bd=function(){return this.f&65534};
|
||||
k.te=function(a){a&1&&(this.f&32768?(a&=-2,this.f&64&&Oc(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.Ad=function(){this.f&=-129;this.f|=2048;return this.L};k.se=function(){};var oh={},gh=(oh[65384]=[null,null,Vc.prototype.Bd,Vc.prototype.te,"PRS"],oh[65386]=[null,null,Vc.prototype.Ad,Vc.prototype.se,"PRB"],oh);
|
||||
function ph(a,b,c){t.call(this,"Disk",{id:a.Qa+".disk"+p(++qh,4)},ph,4194304);this.controller=a;this.C=a.C;this.i=a.i;this.B=b;this.Za=b.name;this.ec=b.ec;rh(this,c,b.ua,b.Aa,b.pa,b.Ma);H(this)}var qh=0;z(ph);k=ph.prototype;k.Ea=function(a,b,c,d){this.i=d};
|
||||
function rh(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]=sh(null,c,e,g,a.Ma,0);d[e]=f}b[c]=d}a.b=b}a.f=null}
|
||||
function th(a,b,c,d,e){var f=c;if(a.v)return!0;a.Za=b;a.fb=c;a.Jc=ra(c);a.v=e;a.A=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=sh(null,d,w,x+1,a.Ma,0),ia=C.data,Ja=0;Ja<c;Ja++,f+=4)var P=ia[Ja]=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.B,c,a.Za,a.fb),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.ec?"":e)+"&format=json"));return!!Da(f,
|
||||
null,!0,function(b,c,d){uh(a,b,c,d)})}
|
||||
function uh(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.Za+'" (error '+d+": "+b+")",f);else{qb(a.controller.Qa,b,c);try{if(0<ra(a.Jc,!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.Za]: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;vh(l,r)}else v=[],n=l.pattern=n|n<<8|n<<16|n<<24,l.data=v;delete l.bytes}sh(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.Za)}catch(x){q("Disk image error ("+b+"): "+x.message)}}a.v&&(a.v.call(a.A,a.B,e,a.Za,a.fb),a.v=null)}function sh(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.Xe=b;a.Ye=c;a.Pa=a.Ba=0;a.Ta=!1;return a}
|
||||
k.seek=function(a,b,c,d,e){d=null;var f=this.B,g=this.b[a];if(g){var h=g[b];if(!h&&f.Pc&&b<f.Aa)for(h=g[b]=Array(f.Qc),g=0;g<h.length;g++)h[g]=sh(null,a,b,g+1,f.Cc,0);if(h){for(g=0;g<h.length;g++)if(h[g]&&h[g].sector==c){d=h[g];break}!d&&f.Pc&&9==f.oc&&(d=h[g]=sh(null,a,b,f.oc,f.Cc,0))}}e&&e(d,!1);return d};function vh(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.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.A=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.A=b>>14&3;c=a.N>>14&3;a.A!=c&&(a.Ia[c]=a.u[6],a.u[6]=a.Ia[a.A]);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.A||(a=4,this.Ha|=4,this.u[6]=4,c=-3);this.Ib=a;this.A=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.A]||(d&=7);e=a.V[a.A][d];f=(a.ya[a.A][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.A][d]=e;if(f!=(4194170&a.Ja)||a.A)a.jb=a.A,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.A&&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.A=a.N>>12&3,c=a.qa(d|c&a.R),a.A=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.A=a.N>>12&3,e=ke(a,e|c&65536,4),a.A=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.B&&1120==this.Va&&this.B.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.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.B&&(this.B.jc(this.u[7],!0),this.B.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);this.ga=this.g=null;this.A=a.addr;this.f=a.size;this.D=!1;this.B=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.A,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.A;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,256,a.Za)){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.B?
|
||||
b.push(a.B):null!=a.B&&a.B.length&&(b=a.B);for(c=0;c<b.length;c++){var d=a,e=b[c],f=wc(d.v,d.A,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.A]};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.A=a.size;this.La=a.load;this.Ka=a.exec;this.B=!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.A,this.ga),delete this.ga);return!0};Vg.prototype.Fa=function(){return!0};function Wg(a){if(a.v&&(!a.B&&a.A&&xc(a.v,a.C,a.A,Ac)&&(a.B=!0),!wb(a))){if(!a.B)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.B){for(var a=this.v,b=this.C,c=this.A,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.B.length){var f=a.g.indexOf(e);0<=f&&(e=a.B[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.B=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.B=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.A.length||(e.J=e.A.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.A=[];return!0}k.hc=function(a){if("number"==typeof a)this.A.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.A.push(a.charCodeAt(b));else this.A=this.A.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.A.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.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.B)if(13==a)this.H=0;else if(8==a)this.B.value=this.B.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.B.value+=b;this.B.scrollTop=this.B.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.B=dh;this.M=this.A="";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.A.toLowerCase()!=c.toLowerCase()||a.B!=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.A,a.B,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.A;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.A=c;a.B=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.A="",a.H=ch,a.B=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.A||!1===b)a.M="",a.A="",b||(a.B&&a.status(1==a.B?"tape detached":"tape unloaded"),a.H=ch,a.B=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.B=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.A=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),ia=C.data,Ka=0;Ka<c;Ka++,f+=4)var P=ia[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.B,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.A,a.B,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.B,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 wh(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 xh(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.fb,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?rh(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.Za+": "+c);return b};
|
||||
k.toJSON=function(){var a;a=0;for(var b;b=wh(this,a++);)yh(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 yh(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.B=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=pa(c.value,10);null!=a&&zh(d,a)},!0;case "loadDrive":return this.G[b]=
|
||||
c,c.onclick=function(){var a=d.G.listDisks;a&&Ah(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[pa(a.value,10)||0])if(a=a.Ca){var b;b="";for(var c=0,h;h=wh(a,c++);)for(var l=0,m=h.length;l<m;l++)b+=String.fromCharCode(xh(a,h,l));b=btoa(b);a=a.Jc.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),
|
||||
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.B=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"),
|
||||
"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;Ah(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.B=nd(this.C,"autoMount")||this.B)&&"string"==typeof this.B)try{this.B=eval("("+this.B+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.B+")"),this.B=null}Bh(this);this.O=Qc(112,5);Hb(b,this,Ch,4194304);Jb(b,this.reset.bind(this));Dh(this,"None","",!0);this.L&&Dh(this,"Local Disk","?");Dh(this,"Remote Disk","??");Eh(this)||H(this)};
|
||||
k.Ga=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.C.rc){for(a=0;a<this.f.length;a++)Fh(this,a,!0);Eh(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";zh(this,0)}}return!0};k.Fa=function(a){return a?this.save():!0};k.reset=function(){Bh(this)};k.save=function(){return(new N(this)).data()};
|
||||
k.restore=function(a){return Bh(this,a[0])};function Eh(a,b){b||(a.H=0);if(a.B)for(var c in a.B){var d=a.B[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)){!Gh(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 Ah(a,b,c,d){var e=a.G.listDrives,e=e&&pa(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+'"')}Gh(a,e,b,c,!1,d)}else Fh(a,e)}
|
||||
function Gh(a,b,c,d,e,f){var g=-1,h=a.f[b];h.fb.toLowerCase()!=d.toLowerCase()&&(g++,Fh(a,b,!0),h.dc?a.P("RL11 busy"):(h.dc=!0,e&&(h.cc=!0,a.H++,F(a)&&E(a,"auto-loading disk: "+c)),h.Rb=!!f,th(new ph(a,h,"preload"),c,d,f,a.Uc)&&g++));return g}
|
||||
k.Uc=function(a,b,c,d,e){var f;a.dc=!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.fc)),b=null);b?(a.Ca=b,a.Za=c,a.fb=d,this.P('Mounted disk "'+c+'" in drive '+("RL"+a.fc),a.cc||e),this.C&&this.C.sb()):a.Rb=!1;a.cc&&(a.cc=!1,--this.H||H(this));zh(this,a.fc)};
|
||||
function Dh(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 zh(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=pa(a.value,10),c=c.Rb?"?":c.fb,!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 Fh(a,b,c){var d=a.f[b];if(d.Ca||!1===c)d.Za="",d.fb="",d.Ca=null,d.Rb=!1,c||(a.P("Drive RL"+b+" unloaded",c),zh(a,b))}
|
||||
function Bh(a,b){var c=0;b||(b=[]);a.fa=b[c++]||0;a.I=b[c++]||0;a.g=b[c++]||0;a.A=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.fc=b;d.dc=d.Rb=!1;d.name=c.$a;d.ua=512;d.Aa=2;d.pa=40;d.Ma=256;d.ec=!0;d.We=0;d.Ve=0;d.oc=1;d.Qc=d.pa;d.Cc=d.Ma;d.Ze=0;d.af=null;d.Ca||(d.fb="");d.status=29|(512==d.ua?128:0)}return!0}
|
||||
k.Sc=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.A=this.g=b<<7|(c?64:0)|d&63;this.D=65536-e&65535;a&&(this.fa=this.fa|a|32768);return!0};
|
||||
k.od=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.gb(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.ie=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.Ld=function(){return this.fa&65535};
|
||||
k.De=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.A&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.A=this.g&4?this.A+b:this.A-b,this.g=this.A=this.A&65408|c);break;case 8:this.D=this.A;break;case 12:b=this.od;case 10:b||(b=this.ie),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.Sc.bind(this)))}a&&(this.fa|=129,this.fa&64&&Oc(this.b,this.O))}};k.Jd=function(){return this.I};k.Be=function(a){this.I=a&65534};k.Md=function(){return this.g};k.Ee=function(a){this.g=a};k.Nd=function(){return this.D};k.Fe=function(a){this.D=a};k.Kd=function(){return this.J};k.Ce=function(a){this.J=a&63};
|
||||
var Hh={},Ch=(Hh[63744]=[null,null,M.prototype.Ld,M.prototype.De,"RLCS"],Hh[63746]=[null,null,M.prototype.Jd,M.prototype.Be,"RLBA"],Hh[63748]=[null,null,M.prototype.Md,M.prototype.Ee,"RLDA"],Hh[63750]=[null,null,M.prototype.Nd,M.prototype.Fe,"RLMP"],Hh[63752]=[null,null,M.prototype.Kd,M.prototype.Ce,"RLBE"],Hh);function Ih(a){t.call(this,"Debugger",a,Ih);this.ca=a.base||16;this.xa=!1;this.J=0;this.R=!1;this.A=-1;this.g=[];this.X={}}z(Ih);
|
||||
var Jh={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};Ih.prototype.tc=function(){return-1};Ih.prototype.uc=function(){};
|
||||
function Kh(a,b,c,d){if(c)if(b){0>a.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a}
|
||||
function Lh(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;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.B=nd(this.C,"autoMount")||this.B)&&"string"==typeof this.B)try{this.B=eval("("+this.B+")")}catch(e){q("RL11 auto-mount error: "+e.message+" ("+this.B+")"),this.B=null}Ch(this);this.O=Qc(112,5);Hb(b,this,Dh,4194304);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.B)for(var c in a.B){var d=a.B[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.A=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.A=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.A&64;break;case 6:1==(this.g&3)&&(b=this.g&65408,c=(this.g&16)<<2,this.A=this.g&4?this.A+b:this.A-b,this.g=this.A=this.A&65408|c);break;case 8:this.D=this.A;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.A=-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.A&&a.g.length&&(a.A=0);if(0>a.A||b!=a.g[a.A])a.g.splice(0,0,b),a.A=0;a.A--}else a.R?b="end":b=a.g[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(xa(b.substring(c,f))),c=f+1}}return a}
|
||||
function 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;
|
||||
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 Mh(a,b,c){var d;if(b){b=Nh(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=Oh(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&&Jh[n]<Jh[l[l.length-1]]&&Lh(h,l,1);l.push(n);b=b.substr(v+r)}Lh(h,l)&&1==h.length||(f=!0);f?c&&a.j("error parsing '"+g+"' at character "+(g.length-b.length)):(d=h.pop(),c&&Ph(a,null,
|
||||
d))}return d}function Nh(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=Mh(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 Oh(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=pa(b,a.ca))),null!=e||d||a.j("invalid "+(c?c:"value")+": "+b)):d||a.j("missing "+(c||"value"));return e}
|
||||
function Ph(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 Qh(a,b){if(b)return Ph(a,b,a.X[b]);var c=0;for(b in a.X)Ph(a,b,a.X[b]),c++;return 0<c}
|
||||
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 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 Rh(a){Ih.call(this,a);this.jb=!1;this.xa=!0;this.L=Y(0);this.kb=Y(0);this.O=Y(0);this.I=[];this.f=this.M=this.D=[];Sh(this);this.ta=0;Th(this);this.Ja={};Uh(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(Rh,Ih);
|
||||
var Vh={"?":"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"},Wh=".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(" "),
|
||||
Xh={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 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],
|
||||
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]}},Yh=[0],Zh=
|
||||
[58,60,65,96,108,110,100,101,102,103,104,105,59,64];k=Rh.prototype;
|
||||
k.Ea=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.B=a.B;(a=nd(a,"messages"))&&Uh(this,a);this.ob=Xh;this.Eb=1145>this.b.Wa?Zh:[];$h(this,function(a){a:{var b=d.v.Y,c=a[0],e=a=0,l=b.length;if(c){a=d.ba(ai(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!=$c&&(c=-1),m=0);a+=d.v.za;e++}}});H(this)};
|
||||
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.B=a.B;(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.A<d.g.length-1&&(b=d.g[++d.A])):40==a.keyCode&&(0<d.A?b=d.g[--d.A]:(b="",d.A=-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.ib(a?1:0),ub(d,!1));return b}),!0}return!1};k.sb=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.Ib=function(a,b){var c=255,d=this.ba(a,!1,1);-1!==d&&(c=a.Sb?this.v.Ub(d):this.b.Ub(d),b&&bi(a,b));return c};
|
||||
k.na=function(a,b){var c=65535,d=this.ba(a,!1,2);-1!==d&&(c=a.Sb?this.v.cb(d):this.b.cb(d),b&&bi(a,b));return c};k.Ab=function(a,b,c){var d=this.ba(a,!0,1);-1!==d&&(a.Sb?this.v.rb(d,b):this.b.rb(d,b),c&&bi(a,c),this.C.oa(-1))};k.gb=function(a,b,c){var d=this.ba(a,!0,2);-1!==d&&(a.Sb?this.v.Bb(d,b):this.b.Bb(d,b),c&&bi(a,c),this.C.oa(-1))};function Y(a,b){return{F:a,Sb:b,Oa:!1}}k.kc=function(a,b){a.F=b;a.Oa=!1;return a};function ci(a){return[a.F,a.Oa]}function di(a){return{F:a[0],Oa:a[1]}}
|
||||
function ai(a,b,c){var d,e=(c?a.L:a.kb).F;c=!1;if(void 0!==b){b=Nh(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=Mh(a,b,void 0)}null!=e&&(d=Y(e,c));return d}function ei(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.Nc=Kh(a,b.Ic=c[2]))}function bi(a,b){null!=a.F&&(a.F+=b||1)}
|
||||
function Uh(a,b){a.i=a;a.ma=a.Rc=536870912;a.ia=null;a.va=[];b=Kh(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.ma|=Bb[c],a.j(c+" messages enabled"))}}function $h(a,b){for(var c in Bb)if(64==Bb[c]){a.Ja[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 fi(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.Ya[a-8]:20>a?b=this.b.Ia[a-16]:20==a?b=Tc(this.b):21==a&&this.B&&kc(this.B)&&(b=this.B.Xa));return b};
|
||||
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Jb).F));if(this.ma&1073741824)this.va.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ma&-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 Th(a){var b;if(!we(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.hb=function(a,b){if(!gi(this,b))return!1;this.b.hb(a);return!0};
|
||||
k.ib=function(a,b,c){if(!gi(this))return!1;this.J=0;a||we(this)&&xe(this,this.b.u[7],0);try{a=wd(this.b,a);var d=this.b.ib(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.jb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.K&8?c.kd|c.jd<<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?hi(a):ii(a)}}function gi(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){Th(this);this.wa=0;this.ia=null;this.J=0;this.L=Y(this.b.u[7]);this.w.W=!1;ji(this);a||qd(this)};k.save=function(){var a=new N(this);a.set(0,ci(this.L));a.set(1,ci(this.O));a.set(2,[this.g,this.R,this.ma]);a.set(3,this.I);return a.data()};
|
||||
k.restore=function(a){var b=0;void 0!==a[2]&&(this.L=di(a[b++]),this.O=di(a[b++]),this.g=a[b][0],"string"==typeof this.g&&(this.g=[this.g]),this.R=a[b][1],this.ma|=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.Fb=a;this.Gb=b};
|
||||
k.stop=function(a,b){if(this.w.W){this.w.W=!1;this.J=b-this.Gb;if(!this.S){b="stopped";if(this.J){a-=this.Fb;var c=0<a?Math.round(1E3*this.J/a):0;b+=" (";we(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.sb();ji(this,this.b.u[7]);this.ia=null}};function we(a){return 1<a.f.length||!!a.ta}
|
||||
function xe(a,b,c){var d=-1;c||(d=a.b.cb(b),0==d&&(b=Fd(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.cb(b)),65535!=(d&65535)&&(a.kc(a.H[a.$],b),++a.$==a.H.length&&(a.$=0)));return!1}function Cf(a){var b=a.b;if(b.w.W)throw O(b,a.b.Jb),a.da(),-1;return!1}
|
||||
function Sh(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.lb=0}k.mb=function(a,b,c){var d=!0;c||ki(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].mb(e&f.v,a==this.D)}}d&&(a.push(b),c?b.Oa=!0:(li(this,a,a.length-1,"set"),Th(this)));return d};
|
||||
function ki(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||li(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||Th(a);break}}return f}function mi(a,b){for(var c=1;c<b.length;c++)li(a,b,c);return b.length-1}function li(a,b,c,d){c=b[c];a.j(b[0]+" "+J(a,c.F)+(d?" "+d:c.Ic?' "'+c.Ic+'"':""))}
|
||||
function ji(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(!ki(a,a.f,c,!0))break;b=0}}}
|
||||
function id(a,b,c,d,e){var f=!1;if(!a.lb++)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&&(ki(a,d,h,!0),e=!0);if(n=h.Nc){for(var f=!1,v=0;v<n.length;v++)if(!ni(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||li(a,d,g,"hit");break}}}a.lb--;return f}
|
||||
function oi(a,b,c,d){var e=Y(b.F),f=a.na(b,2),g,h;for(h in a.ob)if(g=a.ob[h][f&h])break;g||(g=Yh);var l=g[0];0<=a.Eb.indexOf(l)&&(g=Yh,l=g[0]);var m=h="",n=Wh[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=fi(y);break;case 8:x="@"+fi(y);break;case 16:7>y?x="("+fi(y)+")+":(C=w.na(r,2),x="#"+J(w,C,0,!0));break;case 24:7>y?x="@("+fi(y)+")+":(C=w.na(r,2),x="@#"+J(w,C,0,!0));break;case 32:x="-("+fi(y)+")";break;case 40:x="@-("+fi(y)+")";break;case 48:C=w.na(r,2);x=J(w,C,0,!0)+"("+fi(y)+")";7==y&&(x=J(w,C+r.F&65535));break;case 56:C=w.na(r,2),x="@"+J(w,C)+"("+fi(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="+sd(a.b).toString()+" cs="+p(a.b.Lb)):g+(null!=d?"="+d.toString():""),m&&(g+=" @"+m);return g}function pi(a,b){switch(b){case "N":a=a.b.Ua();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 qi(a,b){var c="",d=a.b;8>b?(c=fi(b),c+="="+J(a,d.u[b])):13>b?c="A"+(b-8)+"="+J(a,d.Ya[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.B&&kc(a.B)&&(c="SR="+J(a,a.B.Xa,3));c&&(c+=" ");return c}function ri(a){var b,c="";for(b=0;6>b;b++)c+=qi(a,b);c=c+"\n"+(qi(a,6)+qi(a,7));c+=qi(a,20)+qi(a,21);return c+=pi(a,"T")+pi(a,"N")+pi(a,"Z")+pi(a,"V")+pi(a,"C")}k.pc=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function Tg(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({$e:b,F:c,Xc:d,ga:e,nc:f})}function si(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.Xc;if(e>=g&&e<g+h){e=za(f.nc,[e-g],a.pc);0<=e?ti(a,b,e,d):c&&(e=~e,ti(a,b,e-1,d),ti(a,b,e,d));break}}return d}
|
||||
function ti(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 ui(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Qh(a)||a.j("no variables"),!0;if(!c[2])return Qh(a,c[1]);if(!c[3])return delete a.X[c[1]],!0;b=Mh(a,c[3]);return void 0!==b?(a.X[c[1]]=b,!0):!1}a.j("invalid assignment:"+b);return!1}
|
||||
function vi(a,b,c){var d=null;if(b=ai(a,b,!0)){a.ba(b);var e=si(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 hi(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=Mh(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.B&&kc(a.B)){ic(a.B,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(ri(a));c&&(a.L=Y(d.u[7]),ii(a,J(a,a.L.F)))}}function wi(a,b){b=xa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.j(c[2]):Ph(a,null,c[2].charCodeAt(0)):Mh(a,b,!0)}
|
||||
function xi(a,b,c){var d="t"!=b;c=Oh(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.ib(e,d,!1)},function(){a.B&&a.B.stop&&a.B.stop();a.C.oa();ub(a,!1)})}
|
||||
function ii(a,b,c,d){if(b=ai(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Oh(a,c.substr(1)),null!=c&&(d=c);else{d=ai(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=si(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=oi(a,b,g,f);a.j(f);a.L=b;e-=b.F-l;c++}}}
|
||||
function ni(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=
|
||||
ai(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.Ab(v,r[w],1);a.j(oi(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 ia=y.charAt(1);if("l"==ia){var Ja;Ja=0+mi(a,a.f);Ja+=mi(a,a.M);(Ja+=mi(a,a.D))||a.j("no breakpoints")}else if("n"==ia)a.ta=Oh(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=ai(a,x,!0),!P))break a;"c"==ia?null==P.F?(Sh(a),a.j("all breakpoints cleared")):ki(a,a.f,P)||ki(a,a.M,P)||ki(a,a.D,P)||a.j("breakpoint missing: "+J(a,P.F)):null!=P.F&&(ei(a,P,C),"p"==ia?a.mb(a.f,
|
||||
P):"r"==ia?a.mb(a.M,P):"w"==ia?a.mb(a.D,P):a.j("unknown breakpoint command: "+ia))}}}break;case "c":a.Sa&&(a.Sa.value="");break;case "d":a:{var hb,La=g[0],la=g[1],Ma=g[2],Qi=g[3];if("?"==la){var ib="";for(hb in Bb)a.Ja[hb]&&(ib&&(ib+=","),ib+=hb);ib+=",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");
|
||||
ib.length&&a.j("dump extension commands:\n\t"+ib)}else if("state"==la){var Bg=yi(a.C,!0);"console"==Ma?console.log(Bg):(a.Sa&&(a.Sa.value=""),a.j(Bg))}else if("symbols"==la)for(var Kd=0;Kd<a.I.length;Kd++){var Ld=a.I[Kd],jb;for(jb in Ld.ga)if("."!=jb.charAt(0)){var Cg=Ld.ga[jb].o;if(void 0!==Cg){var Dg=Ld.ga[jb].l;Dg&&(jb=Dg);a.j(J(a,Cg)+" "+jb)}}}else{if("d"==La){for(hb in Bb)if(g[1]==hb){var Eg=a.Ja[hb];Eg?(g.shift(),g.shift(),Eg(g)):a.j("no dump registered for "+la);break a}la||(La=a.Hb||"dw")}else a.Hb=
|
||||
La;if("dh"==La){var Fg=la,Gg=Ma,Hg="",Ig=0,fa=a.$,ma=a.H;if(ma.length){var Z=+Fg||a.nb,Pb=+Gg||10;isNaN(Z)?Z=Pb:Hg="more ";Z>ma.length&&(a.j("note: only "+ma.length+" available"),Z=ma.length);fa-=Z;0>fa&&(null==ma[ma.length-1].F?(Z=fa+Z,fa=0):fa+=ma.length);var Md=[];"call"==Gg&&(Pb=1E5,Md=["CALL"]);for(void 0!==Fg&&a.j(Z+" instructions earlier:");0<Pb&&fa!=a.$;){var Jg=ma[fa++];if(null==Jg.F)break;var Qb=Y(Jg.F),Ri=Z--,Kg=oi(a,Qb,"history",Ri);(!Md.length||0<=Kg.indexOf(Md[0]))&&a.j(Kg);Qb.ac&&(fa+=
|
||||
Qb.ac,Pb-=Qb.ac,Z-=Qb.ac);fa>=ma.length&&(fa=0);a.nb=Z;Ig++;Pb--}}Ig||(a.j("no "+Hg+"history available"),a.nb=void 0)}else{var kb=ai(a,la);if(kb){var Rb=0,Nd=!1,Od="ds"==La;Ma&&(Nd=!0,"l"==Ma.charAt(0)&&(Nd=!1,Ma=Ma.substr(1)||Qi),Rb=Oh(a,Ma)>>>0,65536<Rb&&(Rb=65536));for(var lb="dd"==La?4:"db"==La?1:2,Hc=(Nd?Rb-kb.F:lb*Rb)||128,Pd=Od?16:a.ca,Si=(Hc+Pd-1)/Pd|0||1,Na="";Si--&&0<Hc;){for(var Oa="",Qd="",la=J(a,kb.F),Ic=Pd,Sb=0,Tb=0;0<Ic&&0<Hc;){var mb=1,Jc=1==lb?a.Ib(kb,mb):a.na(kb,mb=2),Sb=Sb|Jc<<
|
||||
(Tb<<3),Tb=Tb+mb;Tb==lb&&(Od?(Oa&&(Oa+=","),Oa+="0x"+p(Sb,2*lb)):(Oa+=J(a,Sb,lb),Oa+=1==lb?9==Ic?"-":" ":" "),Sb=Tb=0);Ic-=mb;for(Hc-=mb;mb--;)var Rd=Jc&255,Qd=Qd+(32<=Rd&&128>Rd?String.fromCharCode(Rd):"."),Jc=Jc>>8}Na&&(Na+="\n");Na=Od?Na+(Oa+","):Na+(la+" "+Oa+(0==Ic?" "+Qd:""))}Na&&a.j(Na);a.kb=kb}}}}break;case "e":if("else"==g[0])break;var nb,Sd,Td,Ud,Vd=g[0],Wd=g[1];"eb"==Vd?(nb=1,Sd=255,Td=a.Ib,Ud=a.Ab):"e"==Vd||"ew"==Vd?(nb=2,Sd=65535,Td=a.na,Ud=a.gb):Wd=null;if(null==Wd)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 Kc=ai(a,Wd);if(Kc)for(var Lc=2;Lc<g.length;Lc++){var Ub=Mh(a,g[Lc]);if(void 0===Ub){a.j("unrecognized value: "+g[Lc]);break}Ub&~Sd&&a.j("warning: "+p(Ub)+" exceeds "+nb+"-byte value");a.j("changing "+J(a,Kc.F)+(F(a,64)?"":" from "+J(a,Td.call(a,Kc),nb))+" to "+J(a,Ub,nb));Ud.call(a,Kc,Ub,nb)}}break;case "g":a:{var Lg=g[1],Ti=b;if(void 0!==Lg){var Xd=ai(a,Lg,!0);if(!Xd)break a;ei(a,Xd,Ti);a.mb(a.f,
|
||||
Xd,!0)}a.hb(!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 Yd;var Vb=b.substr(2),Vb=xa(Vb);Mh(a,Vb)?(c||a.j("true: "+Vb),Yd=!0):(c||a.j("false: "+Vb),Yd=!1);Yd||(d=!1);break}f=!0;break;case "k":var Ui=g[0];if("?"==g[1])a.j("stack trace commands:"),a.j("\tk\tshow frame addresses"),a.j("\tks\tshow symbol information");else{var Zd=0,$d=Y(),Wb=Y(a.b.u[6]);for(a.j("stack trace for "+J(a,Wb.F));10>Zd;){for(var Pa=null,Vi=256;65536>
|
||||
Wb.F>>>0;){$d.F=a.na(Wb,2);if(null==Wb.F||!Vi--)break;if(!($d.F&1)){for(var Wi=a,Mc=$d,Mg=null,Xb=Mc.F,Ng=Xb,ae=1;6>=ae&&Xb;ae++){if(2<ae){Mc.F=Xb;var Nc=oi(Wi,Mc);if(0<=Nc.indexOf("JSR")){var Og=Nc.indexOf(" ");if(Xb+(Nc.indexOf(" ",Og+1)-Og-1)/2==Ng){Mg=Nc;break}}}Xb-=2}Mc.F=Ng;if(Pa=Mg)break}}if(!Pa||null==Pa)break;var Pg=null;if("ks"==Ui){var Qg=Pa.match(/[0-9A-F]+$/);Qg&&(Pg=vi(a,Qg[0]))}Pa=wa(Pa,50)+" ;"+(Pg||"stack="+J(a,Wb.F));a.j(Pa);Zd++}Zd||a.j("no return addresses found")}break;case "l":if("ln"==
|
||||
g[0]){vi(a,g[1],!0);break}f=!0;break;case "m":a:{var na,oa=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)oa=!0,G=null;else if("off"==G)oa=!1,G=null;else{"keys"==G&&(G="key");"kbd"==G&&(G="keyboard");for(na in Bb)if(G==na){Ca=Bb[na];oa=!!(a.ma&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ma|=Ca,oa=!0;else if("off"==g[2]&&(a.ma&=~Ca,oa=!1,1073741824==Ca)){for(var be=0;be<a.va.length;be++)a.j(a.va[be]);
|
||||
a.va=[]}}var Xi=0,Yb="";for(na in Bb)if(!G||G==na){var Yi=!!(a.ma&Bb[na]);if(null===oa||oa==Yi)Yb&&(Yb+=","),++Xi%10||(Yb+="\n\t"),"key"==na&&(na="keys"),Yb+=na}void 0===G&&a.j("message commands:\n\tm [category] [on|off]\tturn categories on/off");a.j((null!==oa?oa?"messages on: ":"messages off: ":"message categories:\n\t")+(Yb||"none"));Th(a)}break;case "p":if("print"==g[0]){wi(a,b.substr(5));break}var Zi="pr"==g[0]?1:0;if(a.S)a.j("step in progress");else{var Rg=Y(a.b.u[7]);a.Ib(Rg);a.S?(a.mb(a.f,
|
||||
Rg,!0),a.hb()||(a.C&&a.C.sb(),a.S=0)):xi(a,Zi?"tr":"t")}break;case "r":if("reset"==b){a.C&&a.C.reset();break}hi(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Zb=+g[2];if(8==Zb||10==Zb||16==Zb)a.ca=Zb;else{a.j("invalid base: "+Zb);break}}a.j("default base: "+a.ca);break;case "cs":var $b;void 0!==g[3]&&($b=+g[3]);switch(g[2]){case "int":a.b.vb=$b;break;case "start":a.b.Mb=$b;break;case "stop":a.b.wb=$b;break;default:a.j("unknown cs option");break a}void 0!==$b&&pd(a.b);a.j("checksums "+
|
||||
(a.b.w.ub?"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.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":xi(a,g[0],g[1]);break;case "u":ii(a,g[1],g[2],8);break;case "v":if("var"==g[0]){ui(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j("PDPjs version 1.30.3 ("+a.b.Wa+",RELEASE"+(zb?",TYPEDARRAYS":",LONGARRAYS")+")");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){wi(a,b.substr(1));break}var ce="commands:",de;for(de in Vh)ce+="\n"+wa(de,9)+Vh[de];we(a)||(ce+="\nnote: history disabled if no exec breakpoints");a.j(ce);
|
||||
break;default:f=!0}f&&(a.j("unknown command: "+b),d=!1)}}catch(Sg){a.j("debugger error: "+(Sg.stack||Sg.message)),d=!1}return d}function rd(a,b,c){b=Kh(a,b,c);for(var d in b)if(!ni(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 Rh(d);B(d,c)}});
|
||||
function zi(a,b,c){t.call(this,"Computer",a,zi,67108864);this.w.ha=!1;Ai(this,b);this.L=nd(this,"autoPower",a);this.C=0;this.X=a.busWidth||a.buswidth;this.f=Bi;this.I=null;this.D=this.R=!1;this.$=nd(this,"url")||"";(Math.random()+.1).toString(36);this.g=Ci(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.B=tb("Panel",this.id))&&this.B.Sa)for(b=0;b<e.length;b++)d=e[b],d.P=this.B.P,d.j=this.B.j,
|
||||
d.Sa=this.B.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=Bi),this.f&&(this.J=
|
||||
new N(this,"1.30.3"),Di(this.J)?b=null:delete this.J);!b&&this.f&&(b=Ei(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&&Fi(this,this.Nb)}else q("Unable to find CPU component")}z(zi);var Bi=0;
|
||||
function Ai(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 Fi(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(){Fi(a,b,c)});return}}b.call(a,c)}
|
||||
function Gi(a,b){var c=new N(a,"1.30.3","validate");if(Di(c)&&Hi(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=zi.prototype;
|
||||
k.Nb=function(a){void 0===a&&(a=this.f||(this.I?1:Bi));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>Bi){if(Di(d,this.I)){this.A=new N(this,"1.30.3","failsafe");Di(this.A)&&(Ii(this,d),a=2,Ji(this.A));this.A.set("timestamp",Ba());Ki(this.A);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=Hi(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Di(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.P("Error: "+g),"unable to verify user"==g&&(Qa("user",""),this.g=null)):this.j(f+": "+g),Ji(d),Di(d)?(c=Hi(d),e=!0):c=!1))}e&&Gi(this,c?d:null)}else 2==a&&d.clear()}else Gi(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=Li(this,g,d,b,c));b=[d,a,c];-1!=a?Fi(this,this.qc,b):this.qc(b)}};
|
||||
function Li(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=Bi,window&&window.location.reload()):a.O=!0,b.Ga(null),e=!1)}if(!d&&b.wc)for(a=b.wc.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&&(Li(this,this.b,b,c,a),this.oa(),this.b.tb());this.O&&(Ii(this,b),b.clear());!c&&this.A&&(this.A.clear(),delete this.A);this.C=0};
|
||||
function Ii(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 yi(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&&Mi(a,a.g,f.toString()),Ki(g)&&Ki(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}
|
||||
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.ma=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.ma|=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.B&&kc(this.B)&&(b=this.B.Wa));return b};
|
||||
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.Ib).F));if(this.ma&1073741824)this.va.push(a);else if(!this.ia||a!=this.ia){this.ia=a;if(this.ma&-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.ma]);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.ma|=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.B&&kc(a.B)&&(c="SR="+J(a,a.B.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.B&&kc(a.B)){ic(a.B,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.B&&a.B.stop&&a.B.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 ia=y.charAt(1);if("l"==ia){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"==ia)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"==ia?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"==ia?a.lb(a.f,
|
||||
P):"r"==ia?a.lb(a.M,P):"w"==ia?a.lb(a.D,P):a.j("unknown breakpoint command: "+ia))}}}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.ma&Ca);break}if(!Ca){a.j("unknown message category: "+G);break a}}if(Ca)if("on"==g[2])a.ma|=Ca,pa=!0;else if("off"==g[2]&&(a.ma&=~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.ma&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.B=tb("Panel",this.id))&&this.B.Sa)for(b=0;b<e.length;b++)d=e[b],d.P=this.B.P,d.j=this.B.j,
|
||||
d.Sa=this.B.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.A=new N(this,"1.30.3","failsafe");Ei(this.A)&&(Ji(this,d),a=2,Ki(this.A));this.A.set("timestamp",Ba());Li(this.A);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.A&&(this.A.clear(),delete this.A);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.Eb+=c))&&(d.textContent=b.w.W?b.ta.toFixed(2)+"Mhz":"Stopped",b.Eb=0)}if(this.B&&(b=this.B,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++)ac(b,"R"+e,b.b.u[e]);e=Tc(b.b);ac(b,"PS",e);ac(b,"NF",e&8?1:0,1);ac(b,"ZF",e&4?1:0,1);ac(b,"VF",e&2?1:0,1);ac(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.Va?b.b.qb&16?1:2:4;jc(b,"B22",a&1);jc(b,"B18",a&2);jc(b,"B16",
|
||||
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.B&&(b=this.B,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",
|
||||
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?yi(d,!1,!0):Fi(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.");yi(d,a,!0);!a&&d.M?window&&window.location.reload():(a||(d.rc=!0),d.Nb(Bi),d.rc=!1)}else d.reset(),d.b&&d.b.tb()},!0;case "save":if(ta(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.G[b]=
|
||||
c,c.onclick=function(){var a=Ci(d,!0);if(a){var b=!!(d.f&&!d.H||d.M),c=yi(d,b);b?Mi(d,a,c):d.P("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Ci(a,b){var c=a.g;c||((c=Ka("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=Ni(a,c))||a.P("The user ID is invalid.")):b&&a.P("Browser local storage is not available"));return c}
|
||||
function Ni(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&&(Qa("user",b.data),a.g=b.data)}catch(d){q(d.message+" ("+c+")")}return a.g}function Ei(a){var b=null;a.g&&(b=Fa()+"/api/v1/user?req=load&user="+a.g+"&state="+Oi(a,"1.30.3"));return b}
|
||||
function Mi(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Oi(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),Qa("user",""),a.g=null)}}
|
||||
function eh(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.sb=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 zi(g,d,!0);B(g,f);g.L&&Fi(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&&yi(c,!(!c.f||c.H),!0)}});function N(a,b,c){this.id=a.id;this.key=Oi(a,b,c);this.i=a.i;Ji(this,a.Zc)}function Oi(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){Ji(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 Ji(a,b){a[a.id]={};b&&a.set("parms",b);a.b=!1}function Ki(a){var b=!0;if(Ia()){var c=JSON.stringify(a[a.id]);Qa(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function Hi(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){q(c.message||c),b=!1}return b}function Di(a,b){return b?(a[a.id]=b,a.b=!0):a.b?!0:Ia()&&(b=Ka(a.key))?(a[a.id]=b,a.b=!0):!1}var Pi=0;
|
||||
function $i(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)):aj(h,a,b,c,d,e,f)})}
|
||||
function aj(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?bj(a,f,h):h(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function bj(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);bj(a,b,c)}})}else c(a,null)}
|
||||
function cj(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&&(--Pi||ab(!0));l=!1}var g,h,l=!0;Pi++;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?$i(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,--Pi||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),--Pi||ab(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?$i(b,a,d,!0,e,m):aj(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 cj(a,b,c,d)};window.enableEvents=ab;window.sendEvent=bb;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11-dbg.map
|
||||
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
|
||||
|
|
|
|||
|
|
@ -43,202 +43,202 @@ typeof b){var l="",n;for(n in b)b.hasOwnProperty(n)&&(l&&(l+="&"),l+=n+"="+encod
|
|||
function ta(a,b){var c,d={K:null,W:null,ga:null,fa: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.ga=g.load;d.fa=g.exec;if(e=g.bytes)d.K=e;else if(e=g.words)for(d.K=Array(2*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,d.K[f++]=e[c]>>8&255;else if(e=g.data)for(d.K=Array(4*e.length),f=c=0;c<e.length;c++)d.K[f++]=e[c]&255,
|
||||
d.K[f++]=e[c]>>8&255,d.K[f++]=e[c]>>16&255,d.K[f++]=e[c]>>24&255;else d.K=g;d.W=g.symbols;d.K.length?1==d.K.length&&(t(d.K[0]),d=null):(t("Empty resource: "+a),d=null)}catch(k){t("Resource data error ("+a+"): "+k.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)){t("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.K=e)}return d}
|
||||
function v(){return"http://"+(window?window.location.host:"www.pcjs.org")}function t(a){window&&window.alert(a)}function ua(a){var b=!1;window&&(b=window.confirm(a));return b}var va=null;function wa(){if(null==va){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}va=a}return va}
|
||||
function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(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}var Ba={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0;
|
||||
function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}function za(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Aa(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}var Ba={init:[],show:[],exit:[]},Ca=!1,Da=!1,Ea=!0;
|
||||
function Fa(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ga(a){Ba.init.push(a)}function Ha(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){t(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ia(a){!Ea&&a?(Ea=!0,Ca&&Ja("init"),Da&&Ja("show")):Ea=a}function Ja(a){Ba[a]&&Ha(Ba[a])}Fa("onload",function(){Ca=!0;Ha(Ba.init)});Fa("onpageshow",function(){Da=!0;Ha(Ba.show)});
|
||||
Fa(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ha(Ba.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Rb=b.comment;this.sd=b;b=this.id.indexOf(".");0>b?this.ya=this.id:(this.pa=this.id.substr(0,b),this.ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Da:!1,sb:!1,N:!1,error:!1};this.kb=null;this.j.error=!1;this.o={};this.D=null;y.push(this)}var Ka=void 0,La={};
|
||||
Fa(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ha(Ba.exit)});function x(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Qb=b.comment;this.rd=b;b=this.id.indexOf(".");0>b?this.ya=this.id:(this.pa=this.id.substr(0,b),this.ya=this.id.substr(b+1));this[a]=c;this.j={ready:!1,Ca:!1,rb:!1,N:!1,error:!1};this.jb=null;this.j.error=!1;this.o={};this.D=null;y.push(this)}var Ka=void 0,La={};
|
||||
if(window){Ka||(Ka=window.location.search.substr(1));for(var Ma,Na=/\+/g,Oa=/([^&=]+)=?([^&]*)/g;Ma=Oa.exec(Ka);)La[decodeURIComponent(Ma[1].replace(Na," "))]=decodeURIComponent(Ma[2].replace(Na," "))}function Pa(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=x);a.prototype=Pa(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Qa=window.PCjs.Machines||(window.PCjs.Machines={}),y=window.PCjs.Components||(window.PCjs.Components=[])}else Qa={},y=[];function Ra(a,b,c){Qa[a]&&b&&(Qa[a][b]=c)}function A(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<y.length;b++){var d=y[b];a&&d.id.indexOf(a)||c.push(d)}return c}
|
||||
function Sa(a){if(void 0!==a){var b;for(b=0;b<y.length;b++)if(y[b].id===a)return y[b]}return null}function Ta(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<y.length;d++)if(c)c==y[d]&&(c=null);else if(!(a!=y[d].type||b&&y[d].id.indexOf(b)))return y[d]}return null}function B(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){t(c.message+" ("+a+")")}return b}
|
||||
function C(a,b){b=E(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 k=g.split(" "),l=0;l<k.length;l++)switch(g=k[l],g){case "pdp11-binding":(g=B(f))&&g.binding&&a.Z(g.type,g.binding,f,g.value),l=k.length}}}}
|
||||
function E(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}
|
||||
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Xa=this.o[b]=c,c.value="",this.T=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.G=function(a){this.T(a,this.ya)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.ya+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.j.N=!0},ja:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.sb?(a.j.Da=!1,a.j.sb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Da=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.kb,a.kb=null,b&&b()))}
|
||||
function Va(a,b){b&&(a.j.ready?b():a.kb=b);return a.j.ready}function Wa(a,b){a.j.error=!0;a.G(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)});
|
||||
x.prototype={constructor:x,parent:null,toString:function(){return this.name?this.name:this.id||this.type},Z:function(a,b,c){switch(b){case "clear":return this.o[b]||(this.o[b]=c,c.onclick=function(a){return function(){a.o.print&&(a.o.print.value="")}}(this)),!0;case "print":return this.o[b]||(this.Wa=this.o[b]=c,c.value="",this.T=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.G=function(a){this.T(a,this.ya)}),!0;default:return!1}},log:function(){},T:function(){},status:function(a){this.T(this.ya+": "+a)},G:function(a,b,c){c=c||this.type;b||t((c?c+": ":"")+a)},ka:function(){return this.j.N=!0},ja:function(a,b){b&&(this.j.N=!1);return!0}};function Ua(a,b){a.j.rb?(a.j.Ca=!1,a.j.rb=!1):a.j.error?a.T(a.toString()+" error"):a.j.Ca=b}function F(a,b){a.j.error||(a.j.ready=!1!==b,a.j.ready&&(b=a.jb,a.jb=null,b&&b()))}
|
||||
function Va(a,b){b&&(a.j.ready?b():a.jb=b);return a.j.ready}function Wa(a,b){a.j.error=!0;a.G(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 Xa="undefined"!==typeof ArrayBuffer;
|
||||
function Ya(a){x.call(this,"Panel",a,Ya);this.da=this.i=this.c=this.m=this.s=this.v=0;this.A=this.C=this.w=!1;this.F=Za;this.g={};this.b={START:[1,1,!0,!1,this.uc],STEP:[1,1,!1,!1,this.vc],ENABLE:[1,1,!1,!1,this.qc],CONT:[1,1,!0,!1,this.oc],DEP:[0,0,!0,!1,this.pc],EXAM:[1,1,!0,!1,this.rc],LOAD:[1,1,!0,!1,this.tc],TEST:[0,0,!0,!1,this.sc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.wc,a]}z(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()};
|
||||
function Ya(a){x.call(this,"Panel",a,Ya);this.da=this.i=this.c=this.m=this.s=this.v=0;this.A=this.C=this.w=!1;this.F=Za;this.g={};this.b={START:[1,1,!0,!1,this.tc],STEP:[1,1,!1,!1,this.uc],ENABLE:[1,1,!1,!1,this.pc],CONT:[1,1,!0,!1,this.nc],DEP:[0,0,!0,!1,this.oc],EXAM:[1,1,!0,!1,this.qc],LOAD:[1,1,!0,!1,this.sc],TEST:[0,0,!0,!1,this.rc]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.vc,a]}z(Ya);var Za=7;function $a(a,b){return a.b[b]&&a.b[b][1]}h=Ya.prototype;h.reset=function(){this.stop()};
|
||||
h.Z=function(a,b,c,d){if(this.l&&this.l.Z(a,b,c,d)||this.a&&this.a.Z(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.o[b]=c,this.v++,!0;default:return"led"==a||"rled"==a?(this.o[b]=c,this.g[b]=d?1:0,this.v++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.o[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ab(a,b)}}(this,
|
||||
b),a.onmouseup=a.onmouseout=function(a,b){return function(){bb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ab(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){bb(a,b)}}(this,b),!0):this.parent.Z.call(this,a,b,c,d)}};h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;cb(b,this,db);eb(b,this.reset.bind(this));fb(this);gb(this)};h.ka=function(a,b){b||(hb(),this.reset());return!0};h.ja=function(){return!0};
|
||||
function ib(a,b,c){if(a=a.o[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function fb(a,b){for(var c in a.g)ib(a,c,null!=b?b:a.g[c])}function jb(a,b,c){if(a=a.o[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function gb(a){for(var b in a.b)jb(a,b,a.b[b][1])}function kb(a,b,c,d){a.o[b]&&(void 0===c&&(Wa(a,"Value for "+b+" is invalid"),G(a.a)),c=8==(a.D&&a.D.h||8)?ka(c,d):m(c,d),a.o[b].textContent!=c&&(a.o[b].textContent=c))}
|
||||
function ab(a,b){var c=a.b[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.uc=function(a){a||this.a.j.P||(this.h.reset(),lb(this.a),$a(this,"ENABLE")&&mb(this.a))};h.vc=function(){};h.qc=function(a){a||G(this.a)};
|
||||
h.oc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.D;var b;if(b=a)a.j.Da&&(a.j.sb=!0),b=!a.j.Da;if(b)Ua(a,!0),a.pb(0),Ua(a,!1);else try{var c=this.a.pb(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.xa()}};h.pc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.F==Za?this.h.ob(this.da,a):this.a.ob(this.da,a))};
|
||||
h.rc=function(a){a||this.a.j.P||(this.C&&qb(this),a=this.F==Za?this.h.mb(this.da):this.a.mb(this.da),rb(this,a))};h.tc=function(a){a||this.a.j.P||sb(this,this.c)};h.sc=function(a){if(a)this.w=!0,fb(this,!0);else if(this.w=!1,fb(this),void 0!==this.o.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;gb(this)}};h.wc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
|
||||
function qb(a){var b=1145>a.a.Ea?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.h.na;$a(a,"STEP")||(b=-b);sb(a,a.da&~c|a.da+b&c)}function sb(a,b){a.da=b&a.h.na;b=a.da;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<<c)}function rb(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)tb(a,"D"+c,b&1<<c);return a.i}function tb(a,b,c){a.g[b]=c;a.w||ib(a,b,c)}h.stop=function(){sb(this,this.a.f[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.xc=function(a){return(a?this.c:this.m)&65535};h.ud=function(a){this.m=a};
|
||||
var ub={},db=(ub[65400]=[null,null,Ya.prototype.xc,Ya.prototype.ud,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));C(f,d);a&&F(f)}}Ga(hb);
|
||||
function vb(a,b,c){x.call(this,"Bus",a,vb);this.a=b;this.D=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.na=this.C-1;this.b=H;this.c=Math.log2(this.b);this.F=this.b>>2;this.l=this.b-1;this.A=this.C/this.b|0;this.za=[];this.g=0;this.m=!1;this.tb=0;this.w=[];this.gc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}z(vb);var H=8192,Bb=H-1;
|
||||
function ab(a,b){var c=a.b[b];jb(a,b,c[1]=1-c[1]);c[3]=!0;c[4]&&c[4].call(a,c[1],c[5]);"STEP"!=b&&(a.A="DEP"==b,a.C="EXAM"==b)}function bb(a,b){var c=a.b[b];c[2]&&c[3]&&(jb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5]));c[3]=!1}h.tc=function(a){a||this.a.j.P||(this.h.reset(),lb(this.a),$a(this,"ENABLE")&&mb(this.a))};h.uc=function(){};h.pc=function(a){a||G(this.a)};
|
||||
h.nc=function(a){if(!a&&!this.a.j.P)if($a(this,"ENABLE"))mb(this.a);else{a=this.D;var b;if(b=a)a.j.Ca&&(a.j.rb=!0),b=!a.j.Ca;if(b)Ua(a,!0),a.ob(0),Ua(a,!1);else try{var c=this.a.ob(1);0<c&&(nb(this.a,c),ob(this.a,c,!0),pb(this.a,c))}catch(d){"number"!=typeof d&&Wa(this.a,d.stack||d.message)}this.stop();this.l&&this.l.xa()}};h.oc=function(a){a&&!this.a.j.P&&(this.A&&qb(this),a=rb(this,this.c),this.F==Za?this.h.nb(this.da,a):this.a.nb(this.da,a))};
|
||||
h.qc=function(a){a||this.a.j.P||(this.C&&qb(this),a=this.F==Za?this.h.lb(this.da):this.a.lb(this.da),rb(this,a))};h.sc=function(a){a||this.a.j.P||sb(this,this.c)};h.rc=function(a){if(a)this.w=!0,fb(this,!0);else if(this.w=!1,fb(this),void 0!==this.o.S0){for(a=this.c=0;22>a;a++)this.b["S"+a][1]=0&1<<a?1:0;gb(this)}};h.vc=function(a,b){this.c=a?this.c|1<<b:this.c&~(1<<b)};
|
||||
function qb(a){var b=1145>a.a.Da?8:16,c=65472<=a.da&&a.da<65472+b,b=c?1:2,c=c?15:a.h.na;$a(a,"STEP")||(b=-b);sb(a,a.da&~c|a.da+b&c)}function sb(a,b){a.da=b&a.h.na;b=a.da;for(var c=0;22>c;c++)tb(a,"A"+c,b&1<<c)}function rb(a,b){a.i=b&65535;b=a.i;for(var c=0;16>c;c++)tb(a,"D"+c,b&1<<c);return a.i}function tb(a,b,c){a.g[b]=c;a.w||ib(a,b,c)}h.stop=function(){sb(this,this.a.f[7])};h.setData=function(a,b){b?this.m=a:this.i=a};h.wc=function(a){return(a?this.c:this.m)&65535};h.td=function(a){this.m=a};
|
||||
var ub={},db=(ub[65400]=[null,null,Ya.prototype.wc,Ya.prototype.td,"CNSW"],ub);function hb(){for(var a=!1,b=E(document,"pdp11","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=Sa(e.id);f||(a=!0,f=new Ya(e));C(f,d);a&&F(f)}}Ga(hb);
|
||||
function vb(a,b,c){x.call(this,"Bus",a,vb);this.a=b;this.D=c;this.I=a.busWidth||16;this.s=0;this.v=[];this.i=null;this.C=1<<this.I;this.na=this.C-1;this.b=H;this.c=Math.log2(this.b);this.F=this.b>>2;this.l=this.b-1;this.A=this.C/this.b|0;this.za=[];this.g=0;this.m=!1;this.sb=0;this.w=[];this.fc=[wb,xb,yb,zb];a=new I(this);Ab(a,this.D);this.h=Array(this.A);for(b=0;b<this.A;b++)this.h[b]=a;F(this)}z(vb);var H=8192,Bb=H-1;
|
||||
function wb(a,b){var c=-1,d=this.controller,e=d.za[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.za[a&-2])&&(e[2]?c=e[2](f&-2)>>8:e[0]&&(c=e[0](f)));if(0<=c)return c;J(d,b,16);return 255}
|
||||
function xb(a,b,c){var d=!1,e=this.controller,f=e.za[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.za[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||J(e,c,16)}function yb(a,b){var c=-1,d=this.controller;a=d.za[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 c;J(d,b,16);return 65535}
|
||||
function zb(a,b,c){var d=!1,e=this.controller;a=e.za[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||J(e,c,16)}function Cb(a,b){if(b!=a.s){var c;a.s&&(c=(1<<a.s)-H,Db(a,c,H,a.v),a.s=0);b&&(a.s=b,c=1<<b,a.na=c-1,c-=H,a.v=Eb(a,c,H),a.i?Db(a,c,H,a.i):(Fb(a,c,H,Gb,a),a.i=Eb(a,c,H)))}}h=vb.prototype;h.reset=function(){for(var a=0;a<this.w.length;a++)this.w[a]();Cb(this,16)};h.ka=function(a,b){b||this.reset();return!0};
|
||||
function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.La)return l.qb+=l.La-f,l.La=f,!0;if(f>=l.La+l.qb){p=l.size-(f-n);p>g&&(p=g);l.qb=f-l.La+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.tb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
|
||||
function Eb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function Db(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function Kb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].Db(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.na)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a};
|
||||
function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].Ib(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.na)>>>this.c].Jb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].rb(b&a.l,c&65535,b)}h.ob=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.na)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--};
|
||||
function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.va||e.kc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Qb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.za[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.za[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
|
||||
function cb(a,b,c,d,e){for(var f in c){var g=+f,k=c[f];if(!(k[6]&&k[6]>a.a.Ea)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U<w;U++,g+=2)if(D&&1<w&&(D=k[4]+U),!Qb(a,g,g,l,n,p,u,d||64,D||e))return!1}}return!0}function eb(a,b){a.w.push(b)}
|
||||
function J(a,b,c){a.m=!0;a.g||(c&&(a.a.ea|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Hb:-1}}z(L);h=L.prototype;h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.D=d;var e=this;this.b.Hb=Sb(c,function(){e.b.Ya|=128;e.b.Ya&64&&Tb(e.a,e.b.rd);e.l&&e.l.xa(1);Ub(e.a,e.b.Hb,1E3/60)});this.b.rd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
|
||||
h.reset=function(){this.b.Ya=128;Ub(this.a,this.b.Hb,1E3/60,!0)};h.Fc=function(){return this.b.Ya};h.Cd=function(a){this.b.Ya=a&192};h.Hc=function(){var a=this.a;return a.I&62337|a.bb<<5|a.cb<<1};h.Ed=function(a){var b=this.a;a&=62337;if(b.I!=a){b.I=a;b.bb=a>>5&3;b.cb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Ba!=c&&(b.Ba=c,Xb(b))}};h.Ic=function(){var a=this.a;a.I&57344||(a.Vb=a.$&65535);a=a.Vb;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.I&57344||(a.bc=a.Ab);return a.bc};
|
||||
h.Kc=function(){return this.a.Fa};h.Fd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Fa!=a&&(b.Fa=a,b.Sa=a&16?4194303:262143,Xb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.fe=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.Zd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};
|
||||
h.Xd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.cd=function(a){return this.a.X[1][a>>1&7]};h.Yd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.ad=function(a){return this.a.X[1][(a>>1&7)+8]};h.Wd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Ec=function(a){return this.a.H[0][a>>1&7]};h.Bd=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Cc=function(a){return this.a.H[0][(a>>1&7)+8]};h.zd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};
|
||||
h.Dc=function(a){return this.a.X[0][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Bc=function(a){return this.a.X[0][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.kd=function(a){return this.a.H[3][a>>1&7]};h.ee=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.hd=function(a){return this.a.H[3][(a>>1&7)+8]};h.ce=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.jd=function(a){return this.a.X[3][a>>1&7]};
|
||||
h.de=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.gd=function(a){return this.a.X[3][(a>>1&7)+8]};h.be=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Na=function(a){a&=7;return this.a.B&2048?this.a.Ga[a]:this.a.f[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.Ga[b]=a:this.a.f[b]=a};h.Pc=function(){return this.a.B&49152?this.a.oa[0]:this.a.f[6]};h.Kd=function(a){this.a.B&49152?this.a.oa[0]=a:this.a.f[6]=a};h.Sc=function(){return this.a.f[7]};
|
||||
h.Nd=function(a){this.a.f[7]=a};h.Oa=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Ga[a]};h.Qa=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Ga[b]=a};h.Qc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[1]};h.Ld=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[1]=a};h.Rc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[3]};h.Md=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]};
|
||||
h.wd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.tb}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.ae=function(){};h.yc=function(){return this.a.ea};h.vd=function(){this.a.ea=0};h.Gc=function(){return this.a.Zb};h.Dd=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a){return a?this.a.Fb:0};h.Gd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Fb=a;b.u|=2};
|
||||
h.ed=function(a){return a?this.a.nb&65280:0};h.$d=function(a){this.a.nb=a|255};h.Oc=function(){return Zb(this.a)};h.Jd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){};
|
||||
var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.fe,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.Zd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.bd,L.prototype.Xd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.cd,L.prototype.Yd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.ad,L.prototype.Wd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Ec,L.prototype.Bd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Cc,L.prototype.zd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Dc,
|
||||
L.prototype.Ad,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Bc,L.prototype.yd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Kc,L.prototype.Fd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Fc,L.prototype.Cd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Ed,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.kd,L.prototype.ee,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.hd,
|
||||
L.prototype.ce,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.jd,L.prototype.de,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.gd,L.prototype.be,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET0"],M[65473]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET0"],M[65474]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET0"],M[65475]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET0"],M[65476]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET0"],M[65477]=[null,null,L.prototype.Na,L.prototype.Pa,
|
||||
"R5SET0"],M[65478]=[null,null,L.prototype.Pc,L.prototype.Kd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Sc,L.prototype.Nd,"R7KERNEL"],M[65480]=[null,null,L.prototype.Oa,L.prototype.Qa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Oa,L.prototype.Qa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Oa,L.prototype.Qa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Oa,L.prototype.Qa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Oa,L.prototype.Qa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Oa,
|
||||
L.prototype.Qa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Qc,L.prototype.Ld,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Rc,L.prototype.Md,"R6USER",1,1145],M[65504]=[null,null,L.prototype.zc,L.prototype.wd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.dc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.dc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.fd,L.prototype.ae,"SYSID",1,1170],M[65526]=[null,null,L.prototype.yc,L.prototype.vd,"CPUERR",1,1170],M[65528]=
|
||||
[null,null,L.prototype.Gc,L.prototype.Dd,"MB",1,1170],M[65530]=[null,null,L.prototype.Lc,L.prototype.Gd,"PIR"],M[65532]=[null,null,L.prototype.ed,L.prototype.$d,"SL"],M[65534]=[null,null,L.prototype.Oc,L.prototype.Jd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new ac(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var bc;
|
||||
function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0<g&&k<a.h.length;){var l=a.h[k],n=k*a.b,p=a.b-(f-n);p>g&&(p=g);if(!e&&l&&l.size){if(l.type==d){if(f+g<=l.Ka)return l.pb+=l.Ka-f,l.Ka=f,!0;if(f>=l.Ka+l.pb){p=l.size-(f-n);p>g&&(p=g);l.pb=f-l.Ka+p;f=n+a.b;g-=p;k++;continue}}return Hb(1,f,g)}f=new I(a,f,p,a.b,d,e);Ab(f,a.D,l);a.h[k++]=f;f=n+a.b;g-=p}return 0>=g?(d==Ib&&(a.sb+=c),a.status((c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(2,b,c)}
|
||||
function Eb(a,b,c){var d=[];for(b>>>=a.c;0<c&&b<a.h.length;)d.push(a.h[b++]),c-=a.b;return d}function Db(a,b,c,d){var e=0;for(b>>>=a.c;0<c&&b<a.h.length;){var f=d[e++];if(!f)break;a.h[b++]=f;c-=a.b}}function Kb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].Cb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.na)>>>a.c].V(b&a.l,b)}h.lb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.na)>>>this.c;this.m=!1;this.g++;a=this.h[c].Wb(b,a);this.g--;return a};
|
||||
function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].Hb(b&a.l,c&255,b)}h.Za=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.na)>>>this.c].Ib(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.na)>>>a.c].qb(b&a.l,c&65535,b)}h.nb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.na)>>>this.c;this.m=!1;this.g++;this.h[d].dc(c,b&65535,a);this.g--};
|
||||
function Pb(a){for(var b=0,c=[],d=0;d<a.A;d++){var e=a.h[d];if(e.va||e.jc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,k=0,l=[];g<e.length;){for(var n=e[g],p=g+1;p<e.length&&e[p]===n;)p++;l[k++]=p-g;l[k++]=n;g=p}l.length<e.length&&(e=l)}c[f]=e}}return c}function Qb(a,b,c,d,e,f,g,k,l){for(;b<=c;b+=2){var n=b&Bb;if(void 0!==a.za[n])return t("I/O address already registered: "+m(b,8,!0)),!1;a.za[n]=[d,e,f,g,l||"unknown",k,!1]}return!0}
|
||||
function cb(a,b,c,d,e){for(var f in c){var g=+f,k=c[f];if(!(k[6]&&k[6]>a.a.Da)){var l=k[0]?k[0].bind(b):null,n=k[1]?k[1].bind(b):null,p=k[2]?k[2].bind(b):null,u=k[3]?k[3].bind(b):null,w=k[5]||1;65472<=g&&65487>=g&&(!l&&p&&(l=function(a){return function(b){return a(b)&255}.bind(b)}(p)),!n&&u&&(n=function(a){return function(b,c){return a(b,c)}.bind(b)}(u)));for(var D=k[4],U=0;U<w;U++,g+=2)if(D&&1<w&&(D=k[4]+U),!Qb(a,g,g,l,n,p,u,d||64,D||e))return!1}}return!0}function eb(a,b){a.w.push(b)}
|
||||
function J(a,b,c){a.m=!0;a.g||(c&&(a.a.ea|=c),K(a.a,4,0,b))}function Rb(a){var b=a.m;a.m=!1;return b}function Hb(a,b,c){t("Memory block error ("+a+": "+m(b)+","+m(c)+")");return!1}function L(a){x.call(this,"Device",a,L);this.b={L:0,Gb:-1}}z(L);h=L.prototype;h.ia=function(a,b,c,d){this.h=b;this.l=a;this.a=c;this.D=d;var e=this;this.b.Gb=Sb(c,function(){e.b.Xa|=128;e.b.Xa&64&&Tb(e.a,e.b.qd);e.l&&e.l.xa(1);Ub(e.a,e.b.Gb,1E3/60)});this.b.qd=Vb(64,6);cb(b,this,Wb);eb(b,this.reset.bind(this));F(this)};
|
||||
h.reset=function(){this.b.Xa=128;Ub(this.a,this.b.Gb,1E3/60,!0)};h.Ec=function(){return this.b.Xa};h.Bd=function(a){this.b.Xa=a&192};h.Gc=function(){var a=this.a;return a.I&62337|a.ab<<5|a.bb<<1};h.Dd=function(a){var b=this.a;a&=62337;if(b.I!=a){b.I=a;b.ab=a>>5&3;b.bb=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Aa!=c&&(b.Aa=c,Xb(b))}};h.Hc=function(){var a=this.a;a.I&57344||(a.Ub=a.$&65535);a=a.Ub;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Ic=function(){var a=this.a;a.I&57344||(a.ac=a.zb);return a.ac};
|
||||
h.Jc=function(){return this.a.Ea};h.Ed=function(a){var b=this.a;1170>b.Da&&(a&=-49);b.Ea!=a&&(b.Ea=a,b.Ra=a&16?4194303:262143,Xb(b))};h.kd=function(a){a=a>>1&63;var b=this.a.$a[a>>1];return a&1?b>>16:b&65535};h.ee=function(a,b){b=b>>1&63;var c=b>>1;this.a.$a[c]=b&1?this.a.$a[c]&65535|(a&63)<<16:this.a.$a[c]&-65536|a&65534};h.cd=function(a){return this.a.H[1][a>>1&7]};h.Yd=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.ad=function(a){return this.a.H[1][(a>>1&7)+8]};
|
||||
h.Wd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295};h.bd=function(a){return this.a.X[1][a>>1&7]};h.Xd=function(a,b){b=b>>1&7;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.$c=function(a){return this.a.X[1][(a>>1&7)+8]};h.Vd=function(a,b){b=(b>>1&7)+8;this.a.X[1][b]=a;this.a.H[1][b]&=65295};h.Dc=function(a){return this.a.H[0][a>>1&7]};h.Ad=function(a,b){this.a.H[0][b>>1&7]=a&65295};h.Bc=function(a){return this.a.H[0][(a>>1&7)+8]};h.yd=function(a,b){this.a.H[0][(b>>1&7)+8]=a&65295};
|
||||
h.Cc=function(a){return this.a.X[0][a>>1&7]};h.zd=function(a,b){b=b>>1&7;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.Ac=function(a){return this.a.X[0][(a>>1&7)+8]};h.xd=function(a,b){b=(b>>1&7)+8;this.a.X[0][b]=a;this.a.H[0][b]&=65295};h.jd=function(a){return this.a.H[3][a>>1&7]};h.de=function(a,b){this.a.H[3][b>>1&7]=a&65295};h.gd=function(a){return this.a.H[3][(a>>1&7)+8]};h.be=function(a,b){this.a.H[3][(b>>1&7)+8]=a&65295};h.hd=function(a){return this.a.X[3][a>>1&7]};
|
||||
h.ce=function(a,b){b=b>>1&7;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.fd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ae=function(a,b){b=(b>>1&7)+8;this.a.X[3][b]=a;this.a.H[3][b]&=65295};h.Ma=function(a){a&=7;return this.a.B&2048?this.a.Fa[a]:this.a.f[a]};h.Oa=function(a,b){b&=7;this.a.B&2048?this.a.Fa[b]=a:this.a.f[b]=a};h.Oc=function(){return this.a.B&49152?this.a.oa[0]:this.a.f[6]};h.Jd=function(a){this.a.B&49152?this.a.oa[0]=a:this.a.f[6]=a};h.Rc=function(){return this.a.f[7]};
|
||||
h.Md=function(a){this.a.f[7]=a};h.Na=function(a){a&=7;return this.a.B&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.B&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Pc=function(){return 1==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[1]};h.Kd=function(a){1==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[1]=a};h.Qc=function(){return 3==(this.a.B&49152)>>14?this.a.f[6]:this.a.oa[3]};h.Ld=function(a){3==(this.a.B&49152)>>14?this.a.f[6]=a:this.a.oa[3]=a};h.yc=function(a){return this.a.Zb[a-65504>>1]};
|
||||
h.vd=function(a,b){this.a.Zb[b-65504>>1]=a};h.Vb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.sb}a=(a>>6)-1}else a=0;return a};h.cc=function(){};h.ed=function(){return 1};h.$d=function(){};h.xc=function(){return this.a.ea};h.ud=function(){this.a.ea=0};h.Fc=function(){return this.a.Yb};h.Cd=function(a,b){b&1||(a&=255);this.a.Yb=a};h.Kc=function(a){return a?this.a.Eb:0};h.Fd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Eb=a;b.u|=2};
|
||||
h.dd=function(a){return a?this.a.mb&65280:0};h.Zd=function(a){this.a.mb=a|255};h.Nc=function(){return Yb(this.a)};h.Id=function(a){$b(this.a,a&-1793|Yb(this.a)&1792);this.a.u|=128};h.bc=function(){};
|
||||
var M={},Wb=(M[61568]=[null,null,L.prototype.kd,L.prototype.ee,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.cd,L.prototype.Yd,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.ad,L.prototype.Wd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.bd,L.prototype.Xd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.$c,L.prototype.Vd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Dc,L.prototype.Ad,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Bc,L.prototype.yd,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Cc,
|
||||
L.prototype.zd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Ac,L.prototype.xd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Jc,L.prototype.Ed,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Ec,L.prototype.Bd,"LKS"],M[65402]=[null,null,L.prototype.Gc,L.prototype.Dd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Hc,L.prototype.bc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Ic,L.prototype.bc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.jd,L.prototype.de,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.gd,
|
||||
L.prototype.be,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.hd,L.prototype.ce,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.fd,L.prototype.ae,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa,
|
||||
"R5SET0"],M[65478]=[null,null,L.prototype.Oc,L.prototype.Jd,"R6KERNEL"],M[65479]=[null,null,L.prototype.Rc,L.prototype.Md,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na,
|
||||
L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Pc,L.prototype.Kd,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Qc,L.prototype.Ld,"R6USER",1,1145],M[65504]=[null,null,L.prototype.yc,L.prototype.vd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Vb,L.prototype.cc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Vb,L.prototype.cc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.ed,L.prototype.$d,"SYSID",1,1170],M[65526]=[null,null,L.prototype.xc,L.prototype.ud,"CPUERR",1,1170],M[65528]=
|
||||
[null,null,L.prototype.Fc,L.prototype.Cd,"MB",1,1170],M[65530]=[null,null,L.prototype.Kc,L.prototype.Fd,"PIR"],M[65532]=[null,null,L.prototype.dd,L.prototype.Zd,"SL"],M[65534]=[null,null,L.prototype.Nc,L.prototype.Id,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=B(d);switch(c.type){case "default":c=new L(c);C(c,d);break;case "pc11":c=new ac(c);C(c,d);break;case "rl11":c=new N(c),C(c,d)}}});var bc;
|
||||
if(Xa){var cc=new ArrayBuffer(2);(new DataView(cc)).setUint16(0,256,!0);bc=256===(new Uint16Array(cc))[0]}else bc=!1;var dc=bc;
|
||||
function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.La=b;this.qb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.va=this.kc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.gc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>>
|
||||
function I(a,b,c,d,e,f){this.h=a;this.id=ec+=2;this.a=null;this.Ka=b;this.pb=c;this.size=d||0;this.type=e||fc;this.l=e==gc;this.controller=null;Ab(this);this.va=this.jc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.a=a[0],hc(this,f.fc);else if(Xa)this.b=new ArrayBuffer(this.size),this.c=new DataView(this.b,0,this.size),this.o=new Uint8Array(this.b,0,this.size),this.s=new Uint16Array(this.b,0,this.size>>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>>
|
||||
2);for(f=0;f<a.length;f++)a[f]=0;hc(this,kc)}else hc(this)}var fc=0,Ib=1,gc=2,Gb=4,Jb=["NONE","RAM","ROM","VID","H/W"],ec=0;
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.va=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},g:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.Db(a++,b++)|
|
||||
this.Db(a,b)<<8},A:function(a,b,c){this.Ib(a++,b&255,c++);this.Ib(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.va=!0},ya:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
|
||||
b>>8);this.va=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Xb(a,b)},pa:function(a,b,c){this.l?this.g(a,b,c):this.Jb(a,b,c)},ta:function(a,b,c){this.l?this.g(a,b,c):this.ec(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},$:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.va=!0},qa:function(a,b){this.o[a]=b;this.va=!0},sa:function(a,b,c){a&1&&J(this.h,
|
||||
c,64);this.c.setUint16(a,b,!0);this.va=!0},ua:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.va=!0}};function Ab(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&mc(a,nc,!1),(a.m=c.m)&&oc(a,nc,!1))}function oc(a,b,c){c&&a.m||(a.Ib=!a.l&&b[1]||a.g,a.rb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Jb=b[1]||a.g,a.ec=b[3]||a.A}function mc(a,b,c){c&&a.i||(a.Db=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Xb=b[2]||a.w}function hc(a,b){b||(b=pc);mc(a,b,void 0);oc(a,b,void 0)}
|
||||
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Xa)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.c.getInt32(b<<2,!0);else a=this.a;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Xa)for(b=0;b<a.length;b++)this.c.setInt32(b<<2,a[b],!0);else this.a=a;return this.va=!0}return!1},v:function(a,b){J(this.h,b,32);return 255},g:function(a,b,c){J(this.h,c,32)},w:function(a,b){return this.Cb(a++,b++)|
|
||||
this.Cb(a,b)<<8},A:function(a,b,c){this.Hb(a++,b&255,c++);this.Hb(a,b>>8,c)},M:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a,b){a&1&&J(this.h,b,64);b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ra:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<<a)|b<<a;this.va=!0},ya:function(a,b,c){a&1&&J(this.h,c,64);c=a>>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<<a)|b<<a:(this.a[c]=this.a[c]&16777215|b<<24,c++,this.a[c]=this.a[c]&-256|
|
||||
b>>8);this.va=!0},F:function(a,b){return this.I(a,b)},R:function(a,b){return this.Wb(a,b)},pa:function(a,b,c){this.l?this.g(a,b,c):this.Ib(a,b,c)},ta:function(a,b,c){this.l?this.g(a,b,c):this.dc(a,b,c)},C:function(a){return this.o[a]},J:function(a){return this.o[a]},O:function(a,b){a&1&&J(this.h,b,64);return this.c.getUint16(a,!0)},$:function(a,b){a&1&&J(this.h,b,64);return this.s[a>>1]},la:function(a,b){this.o[a]=b;this.va=!0},qa:function(a,b){this.o[a]=b;this.va=!0},sa:function(a,b,c){a&1&&J(this.h,
|
||||
c,64);this.c.setUint16(a,b,!0);this.va=!0},ua:function(a,b,c){a&1&&J(this.h,c,64);this.s[a>>1]=b;this.va=!0}};function Ab(a,b,c){a.D=b;a.i=a.m=0;c&&((a.i=c.i)&&lc(a,nc,!1),(a.m=c.m)&&oc(a,nc,!1))}function oc(a,b,c){c&&a.m||(a.Hb=!a.l&&b[1]||a.g,a.qb=!a.l&&b[3]||a.A);if(c||void 0===c)a.Ib=b[1]||a.g,a.dc=b[3]||a.A}function lc(a,b,c){c&&a.i||(a.Cb=b[0]||a.v,a.V=b[2]||a.w);if(c||void 0===c)a.I=b[0]||a.v,a.Wb=b[2]||a.w}function hc(a,b){b||(b=pc);lc(a,b,void 0);oc(a,b,void 0)}
|
||||
var pc=[],kc=[I.prototype.M,I.prototype.ra,I.prototype.aa,I.prototype.ya],nc=[I.prototype.F,I.prototype.pa,I.prototype.R,I.prototype.ta];if(Xa)var jc=[I.prototype.C,I.prototype.la,I.prototype.O,I.prototype.sa],ic=[I.prototype.J,I.prototype.qa,I.prototype.$,I.prototype.ua];
|
||||
function qc(a,b){x.call(this,"CPU",a,qc);b=a.cycles||b;var c=a.multiplier||1;this.xb=0;this.jb=b;this.sa=c;this.Bb=Math.round(this.jb/1E4)/100;this.Ia=this.Bb*this.sa;this.j.P=!1;this.j.Gb=!1;this.j.Wa=a.autoStart;this.j.fb=!1;this.gb=this.Ja=0;this.hb=a.csStart;this.Ta=a.csInterval;this.Ua=a.csStop;this.J=[];this.Ub=this.pd.bind(this);F(this)}z(qc);var rc=["power","reset"];h=qc.prototype;
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;this.w=a.w;for(b=0;b<rc.length;b++)(c=this.o[rc[b]])&&this.l.Z(null,rc[b],c);a=sc(a,"autoStart");null!=a&&(this.j.Wa="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){tc(this);if(!this.restore(a))return!1;uc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0};
|
||||
h.Wa=function(){return this.j.Wa||void 0===this.o.run?(mb(this),!0):!1};h.Nb=function(){return 0};function uc(a){void 0===a.hb&&(a.hb=0);void 0===a.Ta&&(a.Ta=-1);void 0===a.Ua&&(a.Ua=-1);a.j.fb=0<=a.hb&&0<a.Ta;a.j.fb&&(a.gb=0,a.Ja=a.hb-a.ua)}function pb(a,b){if(a.j.fb){var c=!1;a.gb=a.gb+a.Nb()|0;a.Ja-=b;0>=a.Ja&&(a.Ja+=a.Ta,c=!0);0<=a.Ua&&a.Ua<=vc(a)&&(a.Ta=a.Ua=-1,uc(a),G(a),c=!0);c&&a.T(vc(a)+" cycles: checksum="+m(a.gb))}}
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=A(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.N);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.kb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.P?G(d):mb(d))},!0;case "speed":return this.o[b]=
|
||||
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){wc(d,d.sa<<1,!0)},c.textContent=this.Ia.toFixed(2)+"Mhz",!0}return!1};h.xa=function(a){this.l&&this.l.xa(a)};function ob(a,b,c){a.ua+=b;c&&(a.ra=a.a=a.F=0)}function xc(a,b){var c=1;b&&1<a.sa&&a.Ha&&(c=a.Ha/a.Bb);a.Sb=Math.round(1E3/30);a.lb=Math.floor(a.jb/30*c);b||(a.Va=a.lb);a.Cb=0}function vc(a){return a.ua+a.la+a.ra-a.a}function tc(a){a.Ha=0;a.Tb=0;a.ua=a.la=a.ra=a.a=a.F=0;uc(a);wc(a,1)}
|
||||
function wc(a,b,c){if(void 0!==b){.8>a.Ha/a.Ia&&(b=1);a.sa=b;b=a.Bb*a.sa;if(a.Ia!=b){a.Ia=b;b=a.Ia.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&yc(a.l)}ob(a,a.la);a.la=0;a.aa=ra();a.qa=0;xc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&b<a.J.length&&(d||0>a.J[b][0])&&(c=a.jb*a.sa/1E3*c|0,a.j.P&&(c+=zc(a)),a.J[b][0]=c)}
|
||||
function qc(a,b){x.call(this,"CPU",a,qc);b=a.cycles||b;var c=a.multiplier||1;this.wb=0;this.ib=b;this.sa=c;this.Ab=Math.round(this.ib/1E4)/100;this.Ha=this.Ab*this.sa;this.j.P=!1;this.j.Fb=!1;this.j.Va=a.autoStart;this.j.eb=!1;this.fb=this.Ia=0;this.gb=a.csStart;this.Sa=a.csInterval;this.Ta=a.csStop;this.J=[];this.Tb=this.od.bind(this);F(this)}z(qc);var rc=["power","reset"];h=qc.prototype;
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.D=d;this.w=a.w;for(b=0;b<rc.length;b++)(c=this.o[rc[b]])&&this.l.Z(null,rc[b],c);a=sc(a,"autoStart");null!=a&&(this.j.Va="true"==a?!0:"false"==a?!1:!!a);F(this)};h.reset=function(){};h.save=function(){return null};h.restore=function(){return!1};h.ka=function(a,b){if(!b){if(a&&this.restore){tc(this);if(!this.restore(a))return!1;uc(this)}else this.reset();this.T("No debugger detected")}return!0};h.ja=function(a){return a?this.save():!0};
|
||||
h.Va=function(){return this.j.Va||void 0===this.o.run?(mb(this),!0):!1};h.Mb=function(){return 0};function uc(a){void 0===a.gb&&(a.gb=0);void 0===a.Sa&&(a.Sa=-1);void 0===a.Ta&&(a.Ta=-1);a.j.eb=0<=a.gb&&0<a.Sa;a.j.eb&&(a.fb=0,a.Ia=a.gb-a.ua)}function pb(a,b){if(a.j.eb){var c=!1;a.fb=a.fb+a.Mb()|0;a.Ia-=b;0>=a.Ia&&(a.Ia+=a.Sa,c=!0);0<=a.Ta&&a.Ta<=vc(a)&&(a.Sa=a.Ta=-1,uc(a),G(a),c=!0);c&&a.T(vc(a)+" cycles: checksum="+m(a.fb))}}
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.o[b]=c,!0;case "run":return this.o[b]=c,c.onclick=function(){var a;if(a=d.l)if(a=d.l,a.j.N)a=!0;else{var b=null,c,k=A(a.id);for(c=0;c<k.length&&(b=k[c],b===a||b.j.ready);c++);if(c==k.length)for(c=0;c<k.length&&(b=k[c],b===a||b.j.N);c++);c==k.length&&(b=a);t("The "+b.type+" component ("+b.id+") is not "+(b.j.ready?"powered yet":"ready yet"+(b.jb?" (waiting for notification)":""))+".");a=!1}a&&(d.j.P?G(d):mb(d))},!0;case "speed":return this.o[b]=
|
||||
c,!0;case "setSpeed":return this.o[b]=c,c.onclick=function(){wc(d,d.sa<<1,!0)},c.textContent=this.Ha.toFixed(2)+"Mhz",!0}return!1};h.xa=function(a){this.l&&this.l.xa(a)};function ob(a,b,c){a.ua+=b;c&&(a.ra=a.a=a.F=0)}function xc(a,b){var c=1;b&&1<a.sa&&a.Ga&&(c=a.Ga/a.Ab);a.Rb=Math.round(1E3/30);a.kb=Math.floor(a.ib/30*c);b||(a.Ua=a.kb);a.Bb=0}function vc(a){return a.ua+a.la+a.ra-a.a}function tc(a){a.Ga=0;a.Sb=0;a.ua=a.la=a.ra=a.a=a.F=0;uc(a);wc(a,1)}
|
||||
function wc(a,b,c){if(void 0!==b){.8>a.Ga/a.Ha&&(b=1);a.sa=b;b=a.Ab*a.sa;if(a.Ha!=b){a.Ha=b;b=a.Ha.toFixed(2)+"Mhz";var d=a.o.setSpeed;d&&(d.textContent=b);a.T("target speed: "+b)}c&&a.l&&yc(a.l)}ob(a,a.la);a.la=0;a.aa=ra();a.qa=0;xc(a)}function Sb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function Ub(a,b,c,d){0<=b&&b<a.J.length&&(d||0>a.J[b][0])&&(c=a.ib*a.sa/1E3*c|0,a.j.P&&(c+=zc(a)),a.J[b][0]=c)}
|
||||
function nb(a,b){for(var c=a.J.length-1;0<=c;c--){var d=a.J[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function zc(a,b){var c=a.ra-=a.a;a.a=a.F=0;b&&(a.ra=0);return c}
|
||||
h.pd=function(){if(this.j.P){this.Cb>=this.jb&&xc(this,!0);this.Ra=0;this.eb=ra();if(this.qa){var a=this.eb-this.qa;a>this.Sb&&(this.aa+=a,this.aa>this.eb&&(this.aa=this.eb))}try{do{for(var b,c=this.j.fb?1:this.lb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.pb(b)}catch(f){if("number"!=typeof f)throw f;}b=zc(this,!0);this.Ra+=b;this.la+=b;pb(this,b);nb(this,b);this.Va-=b;if(0>=this.Va){this.Va+=this.lb;15<=++this.Tb&&(this.xa(),this.Tb=0);break}}while(this.j.P)}catch(f){G(this);
|
||||
this.l&&this.l.stop(ra(),vc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Ub;this.qa=ra();c=this.Sb;this.Ra&&(c=Math.round(c*this.Ra/this.lb));c-=this.qa-this.eb;if(d=this.qa-this.aa)this.Ha=Math.round(this.la/(10*d))/100,864E5<=d&&(this.ua=0,wc(this));if(0>c||this.Ha<this.Ia)-1E3>c&&(this.aa-=c),c=0;this.Cb+=this.Ra;this.qa+=c;a(b,c)}}};
|
||||
function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{wc(a);a.j.P=!0;a.j.Gb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.aa,vc(a));setTimeout(a.Ub,0)}}h.pb=function(){return 0};function G(a){var b=!1;if(a.j.P){zc(a);ob(a,a.la);a.la=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),vc(a));b=!0}a.j.complete=void 0;return b}
|
||||
function Ac(a){this.Ea=+a.model||1170;this.Pb=a.addrReset||0;qc.call(this,a,6666667);this.decode=1120==this.Ea?Bc.bind(this):Cc.bind(this);Dc(this);this.ta=0;this.O=null;this.j.complete=!1}z(Ac,qc);h=Ac.prototype;h.reset=function(){this.status("model "+this.Ea);this.j.P&&G(this);Dc(this);tc(this);this.j.error=!1;this.parent.reset.call(this)};
|
||||
function Dc(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Pb];a.Ga=[0,0,0,0,0,0];a.oa=[0,0,0,0];a.v=0;a.cb=0;a.qd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,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.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.ab=[0,0,0,0,0,0,0,0,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.$b=[0,0,0,0,0,0,0,0];a.Zb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.zb=0;a.Ka=-1;lb(a)}function lb(a){a.nb=255;a.ea=0;a.Fb=0;a.I=0;a.Vb=0;a.bc=0;a.Fa=0;a.Ba=0;a.bb=0;a.Sa=262143;a.$=0;a.Ab=0;a.O=null;a.h&&Xb(a)}function Xb(a){a.Ba?(a.R=65536,a.M=a.nc,a.V=a.md,a.rb=a.ge,Cb(a.h,a.Fa&16?22:18)):(a.R=0,a.M=a.mc,a.V=a.Yb,a.rb=a.fc,Cb(a.h,16))}h.Nb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ua,this.sa]);a.set(2,Pb(this.h));return a.data()};
|
||||
h.restore=function(a){var b=a[1];this.ua=b[1];wc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,g=Array(b.F),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function P(a){return a.m&65536?1:0}h.Aa=function(){return this.s&32768?8:0};function Ec(a){var b=a.f[7];a.$=0;a.Ab=b;var c=a.V(b);a.f[7]=b+2&65535;return c}
|
||||
function Fc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function Q(a,b){a.f[7]=b&65535}function Vb(a,b){return{td:a,Ma:b,next:null}}function Gc(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 Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.Ma<=b.Ma)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.Ma<=b.Ma){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Hc(a){return a.u&64?(K(a,168,64,-5),!0):a.u&32?(K(a,4,32,-4),!0):a.u&16?(K(a,12,16,-6),!0):!1}
|
||||
function Zb(a){return a.B=a.B&63728|a.Aa()|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Ga.length;0<=--c;){var d=a.f[c];a.f[c]=a.Ga[c];a.Ga[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.oa[c]=a.f[6],a.f[6]=a.oa[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Ic(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Jc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))}
|
||||
function Kc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Lc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ta){0>a.Ka?a.Ka=Zb(a):a.v||(b=4,a.ea|=4,a.f[6]=4,d=-3);a.Ab=b;a.$=0;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ka>>2&12288);Mc(a,a.Ka);Mc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ka=-1;if(-3<=d)throw b;}}function Nc(a){var b=Oc(a),c=Oc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);$b(a,c);a.u&=-17}
|
||||
function Lb(a,b){var c=b>>13&31;31>c&&a.Fa&32&&(b=a.ab[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function Pc(a,b,c){var d,e,f;if(!(c&a.Ba))return b;d=b>>13;a.Fa&a.qd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Sa;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.H[a.v][d]=e;if(f!=(4194170&a.Sa)||a.v)a.bb=a.v,a.cb=d;b=!1;g&&(g&57344&&(0<=a.Ka&&(g|=128),a.I&57344||(a.I=a.I|g|a.bb<<5|a.cb<<
|
||||
1),b=!0),a.I&61440||!(f<(4191360&a.Sa)||f>(4194239&a.Sa))||(a.I|=4096,a.I&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Oc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Mc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.$=a.$<<8|246;Qc(a,0,c);a.rb(c,b)}function Qc(a,b,c){!a.v&&c<=a.nb&&(b||4<c)&&(1145<=a.Ea&&c<=a.nb-32?(a.ea|=4,a.f[6]=4,K(a,4,0,-3)):(a.ea|=8,a.u|=32))}
|
||||
function Rc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return K(a,4,0,-2),0;case 1:return 6==c&&d&4&&Qc(a,b,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Fc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Fc(a,2)),e=e+a.f[c]&
|
||||
65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.$=a.$<<8|f<<3&248|c;6==c&&0>f&&Qc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.Ba)return this.h.mb(a);this.ta++;a=this.Yb(Pc(this,a,2));this.ta--;return a};h.$a=function(a,b){this.Ba?(this.ta++,a=Pc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ta--):this.h.$a(a,b)};h.ob=function(a,b){this.Ba?(this.ta++,this.fc(Pc(this,a,4),b),this.ta--):this.h.ob(a,b)};h.mc=function(a,b,c){return Rc(this,a,b,c)};
|
||||
h.nc=function(a,b,c){return Pc(this,Rc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,a)};h.md=function(a){return Mb(this.h,Pc(this,a,2))};h.fc=function(a,b){Ob(this.h,a,b&65535)};h.ge=function(a,b){Ob(this.h,Pc(this,a,4),b)};function Sc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Rc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.oa[a.B>>12&3];return c}
|
||||
function Tc(a,b,c,d){a.$=22;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Rc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Pc(a,e|c&65536,4),a.v=a.B>>14&3,Ob(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.oa[a.B>>12&3]=d}function Uc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Vc(a,b){var c;b>>=6;var d=a.C=b&7;(b=a.A=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Wc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Rc(a,b,c,8)}
|
||||
function Xc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function Yc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.zb=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))}
|
||||
function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.M(b,e,6),Ob(a.h,e,d.call(a,0>c?a.f[-c-1]:c,Mb(a.h,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function Zc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Nb(a.h,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function $c(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,d,4),Ob(a.h,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c}
|
||||
h.od=function(){if(this.j.P){this.Bb>=this.ib&&xc(this,!0);this.Qa=0;this.cb=ra();if(this.qa){var a=this.cb-this.qa;a>this.Rb&&(this.aa+=a,this.aa>this.cb&&(this.aa=this.cb))}try{do{for(var b,c=this.j.eb?1:this.kb,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ob(b)}catch(f){if("number"!=typeof f)throw f;}b=zc(this,!0);this.Qa+=b;this.la+=b;pb(this,b);nb(this,b);this.Ua-=b;if(0>=this.Ua){this.Ua+=this.kb;15<=++this.Sb&&(this.xa(),this.Sb=0);break}}while(this.j.P)}catch(f){G(this);
|
||||
this.l&&this.l.stop(ra(),vc(this));Wa(this,f.stack||f.message);return}if(this.j.P){a=setTimeout;b=this.Tb;this.qa=ra();c=this.Rb;this.Qa&&(c=Math.round(c*this.Qa/this.kb));c-=this.qa-this.cb;if(d=this.qa-this.aa)this.Ga=Math.round(this.la/(10*d))/100,864E5<=d&&(this.ua=0,wc(this));if(0>c||this.Ga<this.Ha)-1E3>c&&(this.aa-=c),c=0;this.Bb+=this.Qa;this.qa+=c;a(b,c)}}};
|
||||
function mb(a){var b;a.j.error?(a.T(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.j.P)a.T(a.toString()+" busy");else{wc(a);a.j.P=!0;a.j.Fb=!0;if(b=a.o.run)b.textContent="Halt";a.l&&a.l.start(a.aa,vc(a));setTimeout(a.Tb,0)}}h.ob=function(){return 0};function G(a){var b=!1;if(a.j.P){zc(a);ob(a,a.la);a.la=0;a.j.P=!1;if(b=a.o.run)b.textContent="Run";a.l&&a.l.stop(ra(),vc(a));b=!0}a.j.complete=void 0;return b}
|
||||
function Ac(a){this.Da=+a.model||1170;this.Ob=a.addrReset||0;qc.call(this,a,6666667);this.decode=1120==this.Da?Bc.bind(this):Cc.bind(this);Dc(this);this.ta=0;this.O=null;this.j.complete=!1}z(Ac,qc);h=Ac.prototype;h.reset=function(){this.status("model "+this.Da);this.j.P&&G(this);Dc(this);tc(this);this.j.error=!1;this.parent.reset.call(this)};
|
||||
function Dc(a){a.m=65536;a.g=32768;a.i=65535;a.s=32768;a.B=15;a.f=[0,0,0,0,0,0,0,a.Ob];a.Fa=[0,0,0,0,0,0];a.oa=[0,0,0,0];a.v=0;a.bb=0;a.pd=[4,2,0,1];a.H=[[0,0,0,0,0,0,0,0,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.X=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,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.$a=[0,0,0,0,0,0,0,0,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.Zb=[0,0,0,0,0,0,0,0];a.Yb=0;a.u=0;a.A=a.C=0;a.c=a.b=a.yb=0;a.Ja=-1;lb(a)}function lb(a){a.mb=255;a.ea=0;a.Eb=0;a.I=0;a.Ub=0;a.ac=0;a.Ea=0;a.Aa=0;a.ab=0;a.Ra=262143;a.$=0;a.zb=0;a.O=null;a.h&&Xb(a)}function Xb(a){a.Aa?(a.R=65536,a.M=a.mc,a.V=a.ld,a.qb=a.fe,Cb(a.h,a.Ea&16?22:18)):(a.R=0,a.M=a.lc,a.V=a.Xb,a.qb=a.ec,Cb(a.h,16))}h.Mb=function(){return 0};h.save=function(){var a=new O(this);a.set(0,[]);a.set(1,[this.ua,this.sa]);a.set(2,Pb(this.h));return a.data()};
|
||||
h.restore=function(a){var b=a[1];this.ua=b[1];wc(this,b[3]);a:{b=this.h;a=a[2];var c;for(c=0;c<a.length-1;c+=2){var d=a[c],e=a[c+1];if(e&&e.length<b.F){for(var f=0,g=Array(b.F),k=0;k<e.length-1;)for(var l=e[k++],n=e[k++];l--;)g[f++]=n;e=g}f=b.h[d];if(!f||!f.restore(e)){t("Unable to restore memory block "+d);b=!1;break a}}b=!0}return b};function P(a){return a.m&65536?1:0}function Ec(a){return a.s&32768?8:0}function Fc(a){var b=a.f[7];a.$=0;a.zb=b;var c=a.V(b);a.f[7]=b+2&65535;return c}
|
||||
function Gc(a,b){var c=a.f[7];a.f[7]=c+b&65535;return c}function Q(a,b){a.f[7]=b&65535}function Vb(a,b){return{sd:a,La:b,next:null}}function Hc(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 Tb(a,b){if(b!=a.O){var c=a.O;if(!c||c.La<=b.La)b.next=c,a.O=b;else{do{var d=c.next;if(!d||d.La<=b.La){b.next=d;c.next=b;break}c=d}while(c)}}a.u|=1}function Ic(a){return a.u&64?(K(a,168,64,-5),!0):a.u&32?(K(a,4,32,-4),!0):a.u&16?(K(a,12,16,-6),!0):!1}
|
||||
function Yb(a){return a.B=a.B&63728|Ec(a)|(a.i&65535?0:4)|(a.g&32768?2:0)|P(a)}function $b(a,b){a.s=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.B)&2048)for(var c=a.Fa.length;0<=--c;){var d=a.f[c];a.f[c]=a.Fa[c];a.Fa[c]=d}a.v=b>>14&3;c=a.B>>14&3;a.v!=c&&(a.oa[c]=a.f[6],a.f[6]=a.oa[a.v]);a.B=b;a.u|=2}function R(a,b){a.u&128||(a.s=a.i=b,a.g=0)}function Jc(a,b,c){a.u&128||(a.s=a.i=a.m=b,a.g=c||0)}function Kc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^b)&(d^b))}
|
||||
function Lc(a,b){a.u&128||(a.s=a.i=a.m=b,a.g=a.s^a.m>>1)}function Mc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ta){0>a.Ja?a.Ja=Yb(a):a.v||(b=4,a.ea|=4,a.f[6]=4,d=-3);a.zb=b;a.$=0;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Nc(a,a.Ja);Nc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Oc(a){var b=Pc(a),c=Pc(a)&-1793;a.B&49152&&(c=c&-225|a.B&63712);Q(a,b);$b(a,c);a.u&=-17}
|
||||
function Lb(a,b){var c=b>>13&31;31>c&&a.Ea&32&&(b=a.$a[c]+(b&8190)&4194302,3932160<=b&&4186112>b&&console.log("panic(898)"));return b}
|
||||
function Qc(a,b,c){var d,e,f;if(!(c&a.Aa))return b;d=b>>13;a.Ea&a.pd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;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.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.ab=a.v,a.bb=d;b=!1;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.I&57344||(a.I=a.I|g|a.ab<<5|a.bb<<
|
||||
1),b=!0),a.I&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.I|=4096,a.I&512&&(a.u|=64)),b&&K(a,168,0,-1));return f}function Pc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Nc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.$=a.$<<8|246;Rc(a,0,c);a.qb(c,b)}function Rc(a,b,c){!a.v&&c<=a.mb&&(b||4<c)&&(1145<=a.Da&&c<=a.mb-32?(a.ea|=4,a.f[6]=4,K(a,4,0,-3)):(a.ea|=8,a.u|=32))}
|
||||
function Sc(a,b,c,d){var e,f,g=d&8?0:a.R;switch(b){case 0:return K(a,4,0,-2),0;case 1:return 6==c&&d&4&&Rc(a,b,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Gc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Gc(a,2)),e=e+a.f[c]&
|
||||
65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.$=a.$<<8|f<<3&248|c;6==c&&0>f&&Rc(a,b,a.f[6]);return e}h.lb=function(a){if(!this.Aa)return this.h.lb(a);this.ta++;a=this.Xb(Qc(this,a,2));this.ta--;return a};h.Za=function(a,b){this.Aa?(this.ta++,a=Qc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ta--):this.h.Za(a,b)};h.nb=function(a,b){this.Aa?(this.ta++,this.ec(Qc(this,a,4),b),this.ta--):this.h.nb(a,b)};h.lc=function(a,b,c){return Sc(this,a,b,c)};
|
||||
h.mc=function(a,b,c){return Qc(this,Sc(this,a,b,c),c)};h.Xb=function(a){return Mb(this.h,a)};h.ld=function(a){return Mb(this.h,Qc(this,a,2))};h.ec=function(a,b){Ob(this.h,a,b&65535)};h.fe=function(a,b){Ob(this.h,Qc(this,a,4),b)};function Tc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Sc(a,b,d,2),c&65536||61440!==(a.B&61440)&&(d&=65535),a.v=a.B>>12&3,c=a.V(d|c&a.R),a.v=a.B>>14&3):c=6!=d||(a.B>>2&12288)===(a.B&12288)?a.f[d]:a.oa[a.B>>12&3];return c}
|
||||
function Uc(a,b,c,d){a.$=22;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Sc(a,b,e,4),c&65536||(e&=65535),a.v=a.B>>12&3,e=Qc(a,e|c&65536,4),a.v=a.B>>14&3,Ob(a.h,e,d)):6!=e||(a.B>>2&12288)===(a.B&12288)?a.f[e]=d:a.oa[a.B>>12&3]=d}function Vc(a,b){b>>=6;var c=a.C=b&7;(b=a.A=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=-c-1;return a}function Wc(a,b){var c;b>>=6;var d=a.C=b&7;(b=a.A=(b&56)>>3)?c=Mb(a.h,a.M(b,d,2)):c=-d-1;return c}function Xc(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Sc(a,b,c,8)}
|
||||
function Yc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.M(b,c,3),a=Kb(a.h,c)):a=a.f[c]&255;return a}function Zc(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Mb(a.h,a.M(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.yb=a.M(b,e,7),c=0>c?a.f[-c-1]&255:c,c=d.call(a,c,Kb(a.h,e)),e&1&&a.a--,Nb(a.h,e,c)):(b=a.f[e],c=0>c?a.f[-c-1]&255:c,a.f[e]=b&65280|d.call(a,c,b&255))}
|
||||
function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.M(b,e,6),Ob(a.h,e,d.call(a,0>c?a.f[-c-1]:c,Mb(a.h,e)))):a.f[e]=d.call(a,0>c?a.f[-c-1]:c,a.f[e])}function $c(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,e,5),e=c=0>c?a.f[-c-1]&255:c,d&1&&a.a--,Nb(a.h,d,e)):c?(c=0>c?a.f[-c-1]&255:c,a.f[e]=a.f[e]&~d|c<<24>>24&d):a.f[e]&=~d;return c}function ad(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.M(b,d,4),Ob(a.h,d,c=0>c?a.f[-c-1]:c)):a.f[d]=c=0>c?a.f[-c-1]:c;return c}
|
||||
function V(a,b,c){c&&(Q(a,a.f[7]+(b<<24>>23)),a.a-=2);a.a-=3}
|
||||
h.pb=function(a){this.j.complete=!0;var b=a?this.j.Gb?0:1:-1;this.j.Gb=!1;this.ra=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Fb&224)>>5,e=this.O&&this.O.Ma>d?this.O:null;e&&(c=e.td,d=e.Ma);d>(this.B&224)>>5?(this.u&4&&(Fc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;d&&(e&&Gc(this,e),a=!0)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Hc(this)&&0>b)break}this.u=this.u&7|this.B&16;this.decode(Ec(this))}while(0<this.a);return this.j.complete?this.ra-
|
||||
this.a:void 0===this.j.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ac(d);C(d,c)}});function ad(a,b){var c=b+a;Jc(this,c,a,b);return c&65535}function bd(a,b){var c=b+a;Jc(this,c<<8,a<<8,b<<8);return c&255}function cd(a,b){a=b<<1;Kc(this,a);return a&65535}function dd(a,b){a=b<<1;Kc(this,a<<8);return a&255}function ed(a,b){a=b&32768|b>>1|b<<16;Kc(this,a);return a&65535}function fd(a,b){a=b&128|b>>1|b<<8;Kc(this,a<<8);return a&255}
|
||||
function gd(a,b){a=b&~a;R(this,a);return a}function hd(a,b){a=b&~a;R(this,a<<8);return a}function id(a,b){a|=b;R(this,a);return a}function jd(a,b){a|=b;R(this,a<<8);return a}function kd(a,b){a=~b|65536;Ic(this,a);return a&65535}function ld(a,b){a=~b|256;Ic(this,a<<8);return a&255}function md(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535}function nd(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.g=b&(b^c));return a&255}
|
||||
function od(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function pd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.g=c&(b<<8^c));return a&255}function qd(a,b){a=-b;Ic(this,a,a&b&32768);return a&65535}function rd(a,b){a=-b;Ic(this,a<<8,(a&b&128)<<8);return a&255}function sd(a,b){a=b<<1|this.m>>16&1;Kc(this,a);return a&65535}function td(a,b){a=b<<1|this.m>>16&1;Kc(this,a<<8);return a&255}function ud(a,b){a=(this.m&65536|b)>>1|b<<16;Kc(this,a);return a&65535}
|
||||
function vd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Kc(this,a<<8);return a&255}function wd(a,b){var c=b-a;Lc(this,c,a,b);return c&65535}function xd(a,b){var c=b-a;Lc(this,c<<8,a<<8,b<<8);return c&255}function yd(a,b){this.u&128||(this.s=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function zd(a,b){a^=b;R(this,a);return a&65535}function Ad(a){T(this,a,Vc(this,a),ad);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function Bd(a){var b=Yc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function Cd(a){var b=Yc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Dd(a){V(this,a,!P(this))}function Ed(a){V(this,a,P(this))}
|
||||
function Fd(a){T(this,a,Vc(this,a),gd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Gd(a){S(this,a,Uc(this,a),hd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Hd(a){T(this,a,Vc(this,a),id);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Id(a){S(this,a,Uc(this,a),jd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function Jd(a){var b=Vc(this,a);a=Yc(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Kd(a){var b=Uc(this,a);a=Xc(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Ld(a){V(this,a,this.i&65535?0:4)}function Md(a){V(this,a,!this.Aa()==!(this.g&32768))}function Nd(a){V(this,a,!!(this.i&65535)&&!this.Aa()==!(this.g&32768))}
|
||||
function Od(a){V(this,a,!P(this)&&!!(this.i&65535))}function Pd(a){V(this,a,(this.i&65535?0:4)||!this.Aa()!=!(this.g&32768))}function Qd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Rd(a){V(this,a,!this.Aa()!=!(this.g&32768))}function Sd(a){V(this,a,this.Aa())}function Td(a){V(this,a,!!(this.i&65535))}function Ud(a){V(this,a,!this.Aa())}function Vd(){K(this,12,0,-8);this.a-=5}function Wd(a){V(this,a,!0)}function Xd(a){V(this,a,!(this.g&32768))}function Yd(a){V(this,a,this.g&32768?2:0)}
|
||||
function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function Zd(a){var b=Vc(this,a);a=Yc(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Lc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function $d(a){var b=Uc(this,a);a=Xc(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Lc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}
|
||||
function ae(a){var b=Yc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function be(){K(this,24,0,-8);this.a-=25}
|
||||
function ce(){this.B&49152?(this.ea|=128,K(this,4,0,-7)):(this.w&&1120==this.Ea&&this.w.setData(this.f[0],!0),this.D?this.D.b():G(this));this.a-=7}function de(){K(this,16,0,-8);this.a-=25}var ee=[0,7,7,10,7,11,9,13];function fe(a){this.F=this.a;Q(this,Wc(this,a));this.a=this.F-ee[this.c]}var ge=[0,14,14,17,14,18,16,20];function he(a){this.F=this.a;var b=Wc(this,a);a=a>>6&7;Mc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.F-ge[this.c]}var ie=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function je(a){var b=Vc(this,a);this.F=this.a;R(this,$c(this,a,b));this.a=this.F-ie[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function ke(a){var b=Uc(this,a);R(this,Zc(this,a,b,65535)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var le=[7,13,13,17,14,18,17,21];
|
||||
function me(a){var b=Yc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function ne(){this.a-=5}function oe(){this.B&49152||(this.h.reset(),lb(this));this.a-=667}function pe(a){if(a&8)K(this,8,0,-8);else{var b=Oc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}}function qe(){Nc(this);this.a-=13}
|
||||
function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function re(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function se(a){T(this,a,Vc(this,a),wd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function te(a){T(this,a,0,yd);this.a-=this.c?9:3+(7==this.b?2:0)}function ue(){K(this,28,0,-8);this.a-=5}
|
||||
function ve(){this.w&&(this.w.da=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Fc(this,-2);this.a-=3}function we(a){T(this,a,Vc(this,a),zd);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-8)}function Bc(a){xe[a>>12].call(this,a)}function ye(a){ze[a>>6&3].call(this,a)}function Ae(a){Be[a>>6&3].call(this,a)}function Ce(a){De[a>>6&3].call(this,a)}function Ee(a){Fe[a&15].call(this,a)}function Ge(a){He[a&15].call(this,a)}function Ie(a){Je[a>>6&3].call(this,a)}
|
||||
function Ke(a){Le[a>>6&3].call(this,a)}function Me(a){Ne[a>>6&3].call(this,a)}
|
||||
var xe=[function(a){Oe[a>>8&15].call(this,a)},je,Zd,Jd,Fd,Hd,Ad,Y,function(a){Qe[a>>8&15].call(this,a)},ke,$d,Kd,Gd,Id,se,Y],Oe=[function(a){Re[a>>4&15].call(this,a)},Wd,Td,Ld,Md,Rd,Nd,Pd,he,he,ye,Ae,Ce,Y,Y,Y],ze=[function(a){Ic(this,$c(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,kd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,od);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,md);this.a-=this.c?9:3+(7==this.b?2:0)}],Be=[function(a){T(this,a,0,
|
||||
qd);this.a-=this.c?11:6},function(a){T(this,a,P(this)?1:0,ad);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,P(this)?1:0,wd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Yc(this,a);Ic(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],De=[function(a){T(this,a,0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,sd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,cd);this.a-=this.c?9:3+(7==this.b?2:0)}],
|
||||
Re=[function(a){Se[a&15].call(this,a)},Y,Y,Y,fe,fe,fe,fe,pe,Y,Ee,Ge,te,te,te,te],Se=[ce,ve,qe,Vd,de,oe,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Fe=[ne,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],He=[ne,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Qe=[Ud,Sd,Od,Qd,Xd,Yd,Dd,Ed,be,ue,Ie,Ke,Me,Y,Y,Y],Je=[function(a){Ic(this,
|
||||
Zc(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,ld);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)}],Le=[function(a){S(this,a,0,rd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Xc(this,a);Ic(this,a<<8);this.a-=this.c?4:3+(7==
|
||||
this.b?2:0)}],Ne=[function(a){S(this,a,0,vd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,fd);this.a-=this.c?9+(this.zb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,dd);this.a-=this.c?9:3+(7==this.b?2:0)}];function Cc(a){Te[a>>12].call(this,a)}
|
||||
var Te=[function(a){Ue[a>>8&15].call(this,a)},je,Zd,Jd,Fd,Hd,Ad,function(a){Ve[a>>8&15].call(this,a)},function(a){We[a>>8&15].call(this,a)},ke,$d,Kd,Gd,Id,se,Y],Ue=[function(a){Xe[a>>4&15].call(this,a)},Wd,Td,Ld,Md,Rd,Nd,Pd,he,he,ye,Ae,Ce,function(a){Ye[a>>6&3].call(this,a)},Y,Y],Ye=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Sc(this,a,0);Mc(this,a);R(this,a);this.a-=11},function(a){var b=Oc(this);this.F=
|
||||
this.a;Tc(this,a,0,b);R(this,b);this.a=this.F-le[this.c]},function(a){R(this,$c(this,a,this.Aa?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Xe=[function(a){Ze[a&15].call(this,a)},Y,Y,Y,fe,fe,fe,fe,pe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Ee,Ge,te,te,te,te],Ze=[ce,ve,function(){Nc(this);this.u|=this.B&16;this.a-=13},Vd,de,oe,qe,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],Ve=[me,me,ae,ae,Bd,Bd,Cd,Cd,we,we,Y,Y,Y,Y,re,re],We=[Ud,Sd,Od,Qd,
|
||||
Xd,Yd,Dd,Ed,be,ue,Ie,Ke,Me,function(a){$e[a>>6&3].call(this,a)},Y,Y],$e=[Y,function(a){a=Sc(this,a,65536);Mc(this,a);R(this,a);this.a-=11},function(a){var b=Oc(this);this.F=this.a;Tc(this,a,65536,b);R(this,b);this.a=this.F-le[this.c]},Y];
|
||||
function af(a){x.call(this,"ROM",a,af);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);bf(c)})}}z(af);h=af.prototype;
|
||||
h.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;bf(this)};h.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ja=function(){return!0};
|
||||
function bf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[af.prototype.$c,af.prototype.Vd,null,null,null,a.b>>1],c);if(cb(a.h,a,b,256,a.ya)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<a.c.length;c++)a.h.$a(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?
|
||||
b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Eb(d.h,d.i,d.b);Db(d.h,e,d.b,f)}a.m||delete a.c}}}F(a)}}h.$c=function(a){return this.c[a-this.i]};h.Vd=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new af(d);C(d,c)}});
|
||||
function cf(a){x.call(this,"RAM",a,cf);this.W=this.c=null;this.l=a.addr;this.i=a.size;this.ga=a.load;this.fa=a.exec;this.g=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.ga&&(c.ga=a.ga),null==c.fa&&(c.fa=a.fa)):c.b=null);df(c)})}}z(cf);
|
||||
cf.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;df(this)};cf.prototype.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.l,this.i,this.W),delete this.W);return!0};cf.prototype.ja=function(){return!0};function df(a){if(a.h&&(!a.g&&a.i&&Fb(a.h,a.l,a.i,Ib)&&(a.g=!0),!Va(a))){if(!a.g)t("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;ef(a,a.c,a.ga,a.fa,a.l)}F(a)}}
|
||||
cf.prototype.reset=function(){if(this.g){for(var a=this.h,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Jb(d,g,e.La+d)}c-=a.b;b++;d=0}this.c&&ef(this,this.c,this.ga,this.fa,this.l,!0)}};
|
||||
function ef(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.$a(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.a.$a(c+
|
||||
g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Pb=d,a.h.reset(),lb(a),Q(a,d),$b(a,0),!f&&a.D&&(G(a)||a.D.c()));return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new cf(d);C(d,c)}});function ff(a){x.call(this,"Keyboard",a,ff);F(this)}z(ff);ff.prototype.Z=function(){return!1};ff.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.D=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new ff(d);C(d,c)}});
|
||||
function Z(a){this.F=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.O=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.I=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=gf;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Ob,receiveData:this.Eb}}z(Z);var gf="buffer";h=Z.prototype;
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case gf:return this.o[b]=this.g=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.Eb(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Eb(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;var e=this;this.aa=Vb(48,4);this.M=Sb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.O&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.aa))});this.C=Vb(52,4);this.$=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.C)});cb(b,this,hf);eb(b,this.reset.bind(this));F(this)};
|
||||
h.Ob=function(){if(!this.v){var a=sc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.ya)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Ob(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.ja=function(a){return a?this.save():!0};h.reset=function(){jf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return jf(this)};function jf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.Eb=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Ub(this.a,this.M,1E3/Math.round(this.F/10));return!0};h.Uc=function(){return this.b&65534};
|
||||
h.Pd=function(a){this.b=this.b&-112|a&111};h.Tc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.M,1E3/Math.round(this.F/10));return this.w};h.Od=function(){};h.od=function(){return this.c};h.ie=function(a){this.c&128&&(a&64?Tb(this.a,this.C):Gc(this.a,this.C));this.c=this.c&-70|a&69};h.nd=function(){return 0};
|
||||
h.he=function(a){if(a&=255){this.A&&this.A.call(this.v,a);a&=127;if(this.g)if(13==a)this.s=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.s&&c&&(b=String.fromCharCode(this.I)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=
|
||||
this.m.length)this.T(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.$,1E3/Math.round(this.R/10))}};var kf={},hf=(kf[65392]=[null,null,Z.prototype.Uc,Z.prototype.Pd,"RCSR"],kf[65394]=[null,null,Z.prototype.Tc,Z.prototype.Od,"RBUF"],kf[65396]=[null,null,Z.prototype.od,Z.prototype.ie,"XCSR"],kf[65398]=[null,null,Z.prototype.nd,Z.prototype.he,"XBUF"],kf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}});
|
||||
function ac(a){x.call(this,"PC11",a,ac);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=lf;this.g=mf;this.C=this.i="";this.K=this.ga=this.fa=null;this.I=-1;this.F=!Aa("Mobi")&&window&&"FileReader"in window}z(ac);var lf="",mf=0;h=ac.prototype;
|
||||
h.Z=function(a,b,c){var d=this,e=mf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("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.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
|
||||
d.o.listTapes;a&&nf(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[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;nf(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;this.J=of(a);var e=this;if((this.c=sc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.M=Vb(56,4);this.R=Sb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,pf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Tb(e.a,e.M))});cb(b,this,qf);eb(b,this.reset.bind(this));rf(this,"None",lf,!0);this.F&&
|
||||
rf(this,"Local Tape","?");rf(this,"Remote Tape","??");sf(this)||F(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function sf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.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=q(b,!0)}b&&c?tf(a,c,b,1,!0):uf(a)}return!!a.m}
|
||||
function nf(a,b,c,d,e){if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;tf(a,b,c,d,!1,e)}else vf(a,!1)}function tf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.g!=d)g++,vf(a,!0),a.j.Da?a.G("PC11 busy"):(e&&a.m++,wf(a,b,c,d,f)?g++:a.j.Da=!0);g&&xf(a,a.C,a.i,a.g,a.K,a.ga,a.fa)}
|
||||
function wf(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),xf(a,b,c,d,e),a.s="?");uf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.N;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.pa,e,f),(e=ta(e,f))&&xf(a,b,c,d,e.K,e.ga,e.fa));
|
||||
a.j.Da=!1;a.m&&(a.m--,a.m||F(a));uf(a)})}function rf(a,b,c,d){if((a=a.o.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 uf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;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 pf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function xf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.g=d;a.K=e;a.ga=f;a.fa=g;2==d?a.J&&ef(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=lf,a.g=mf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),pf(a,0))}
|
||||
function vf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=lf,a.g=mf,uf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Nc=function(){return this.b&65534};h.Id=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Tb(this.a,this.M)):(this.b&=-129,this.b|=2048,this.A=0,Ub(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};h.Mc=function(){this.b&=-129;this.b|=2048;return this.A};h.Hd=function(){};
|
||||
var yf={},qf=(yf[65384]=[null,null,ac.prototype.Nc,ac.prototype.Id,"PRS"],yf[65386]=[null,null,ac.prototype.Mc,ac.prototype.Hd,"PRB"],yf);function zf(a,b,c){x.call(this,"Disk",{id:a.pa+".disk"+m(++Af,4)},zf);this.controller=a;this.l=a.l;this.D=a.D;this.g=b;this.wa=b.name;this.wb=b.wb;Bf(this,c,b.U,b.Y,b.S,b.ha);F(this)}var Af=0;z(zf);h=zf.prototype;h.ia=function(a,b,c,d){this.D=d};
|
||||
function Bf(a,b,c,d,e,f){a.mode=b;a.U=c;a.Y=d;a.S=e;a.ha=f;a.a=[];if("preload"!=a.mode){b=Array(a.U);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Cf(null,c,e,g,a.ha,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
|
||||
function Df(a,b,c,d,e){var f=c;if(a.h)return!0;a.wa=b;a.Ca=c;a.ac=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ha=e[3]||512;c=a.ha>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),D=0;D<w.length;D++)for(var U=w[D]=Array(a.S),xa=0;xa<U.length;xa++){for(var Yb=Cf(null,d,D,xa+1,a.ha,0),Pe=Yb.data,lc=0;lc<c;lc++,f+=4)var eg=Pe[lc]=b.getInt32(f,
|
||||
!0),e=e+eg&-1;Yb.ba=c;U[xa]=Yb}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.g,c,a.wa,a.Ca),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(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"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.wb?"":e)+"&format=json"));return!!r(f,
|
||||
null,!0,function(b,c,d){Ef(a,b,c,d)})}
|
||||
function Ef(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.wa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.pa,b,c);try{if(0<q(a.ac,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.wa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d<a.U;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var D=n<<2,U=w.length;U<D;U++)w[U]=p;Ff(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Cf(l,d,f);for(D=0;D<
|
||||
u.length;D++)c=c+u[D]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.wa)}catch(xa){t("Disk image error ("+b+"): "+xa.message)}}a.h&&(a.h.call(a.i,a.g,e,a.wa,a.Ca),a.h=null)}function Cf(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.le=b;a.me=c;a.ma=a.ba=0;a.va=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.g,g=this.a[a];if(g){var k=g[b];if(!k&&f.hc&&b<f.Y)for(k=g[b]=Array(f.ic),g=0;g<k.length;g++)k[g]=Cf(null,a,b,g+1,f.Qb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.hc&&9==f.Kb&&(d=k[g]=Cf(null,a,b,f.Kb,f.Qb,0))}}e&&e(d,!1);return d};function Ff(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}
|
||||
h.ob=function(a){this.j.complete=!0;var b=a?this.j.Fb?0:1:-1;this.j.Fb=!1;this.ra=this.a=a;do{if(this.u){if(a=this.u&7){a=!1;if(this.u&2){this.u&=-3;var c=160,d=(this.Eb&224)>>5,e=this.O&&this.O.La>d?this.O:null;e&&(c=e.sd,d=e.La);d>(this.B&224)>>5?(this.u&4&&(Gc(this,2),this.u&=-5),K(this,c,0,-9),d=!0):d=!1;d&&(e&&Hc(this,e),a=!0)}else this.u&1&&this.u++;a=a&&0>b}if(a)break;if(this.u&112&&Ic(this)&&0>b)break}this.u=this.u&7|this.B&16;this.decode(Fc(this))}while(0<this.a);return this.j.complete?this.ra-
|
||||
this.a:void 0===this.j.complete?0:-1};Ga(function(){for(var a=E(document,"pdp11","cpu"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Ac(d);C(d,c)}});function bd(a,b){var c=b+a;Kc(this,c,a,b);return c&65535}function cd(a,b){var c=b+a;Kc(this,c<<8,a<<8,b<<8);return c&255}function dd(a,b){a=b<<1;Lc(this,a);return a&65535}function ed(a,b){a=b<<1;Lc(this,a<<8);return a&255}function fd(a,b){a=b&32768|b>>1|b<<16;Lc(this,a);return a&65535}function gd(a,b){a=b&128|b>>1|b<<8;Lc(this,a<<8);return a&255}
|
||||
function hd(a,b){a=b&~a;R(this,a);return a}function id(a,b){a=b&~a;R(this,a<<8);return a}function jd(a,b){a|=b;R(this,a);return a}function kd(a,b){a|=b;R(this,a<<8);return a}function ld(a,b){a=~b|65536;Jc(this,a);return a&65535}function md(a,b){a=~b|256;Jc(this,a<<8);return a&255}function nd(a,b){a=b-a;this.u&128||(this.s=this.i=a,this.g=b&(b^a));return a&65535}function od(a,b){a=b-a;var c=a<<8;b<<=8;this.u&128||(this.s=this.i=c,this.g=b&(b^c));return a&255}
|
||||
function pd(a,b){a=b+a;this.u&128||(this.s=this.i=a,this.g=a&(b^a));return a&65535}function qd(a,b){a=b+a;var c=a<<8;this.u&128||(this.s=this.i=c,this.g=c&(b<<8^c));return a&255}function rd(a,b){a=-b;Jc(this,a,a&b&32768);return a&65535}function sd(a,b){a=-b;Jc(this,a<<8,(a&b&128)<<8);return a&255}function td(a,b){a=b<<1|this.m>>16&1;Lc(this,a);return a&65535}function ud(a,b){a=b<<1|this.m>>16&1;Lc(this,a<<8);return a&255}function vd(a,b){a=(this.m&65536|b)>>1|b<<16;Lc(this,a);return a&65535}
|
||||
function wd(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;Lc(this,a<<8);return a&255}function xd(a,b){var c=b-a;Mc(this,c,a,b);return c&65535}function yd(a,b){var c=b-a;Mc(this,c<<8,a<<8,b<<8);return c&255}function zd(a,b){this.u&128||(this.s=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Ad(a,b){a^=b;R(this,a);return a&65535}function Bd(a){T(this,a,Wc(this,a),bd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function Cd(a){var b=Zc(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16<b&&(b=16),this.m=c<<17-b,c>>=b;else if(b)if(16<b)this.g=c,c=0;else{this.m=c<<=b;var d=c>>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.s=this.i=c;this.a-=(this.c?6:7)+b}
|
||||
function Dd(a){var b=Zc(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32<b&&(b=32);var d=c>>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<<b-1,this.m=d>>15,d<<=1,32<b&&(b=32),(c>>=32-b)&&4294967295!==(c|4294967295<<b&4294967295)&&(this.g=32768)):d=c;this.f[a]=d>>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function Ed(a){V(this,a,!P(this))}function Fd(a){V(this,a,P(this))}
|
||||
function Gd(a){T(this,a,Wc(this,a),hd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Hd(a){S(this,a,Vc(this,a),id);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Id(a){T(this,a,Wc(this,a),jd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function Jd(a){S(this,a,Vc(this,a),kd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}
|
||||
function Kd(a){var b=Wc(this,a);a=Zc(this,a);R(this,(0>b?this.f[-b-1]:b)&a);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Ld(a){var b=Vc(this,a);a=Yc(this,a);R(this,((0>b?this.f[-b-1]&255:b)&a)<<8);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function Md(a){V(this,a,this.i&65535?0:4)}function Nd(a){V(this,a,!Ec(this)==!(this.g&32768))}function Od(a){V(this,a,!!(this.i&65535)&&!Ec(this)==!(this.g&32768))}
|
||||
function Pd(a){V(this,a,!P(this)&&!!(this.i&65535))}function Qd(a){V(this,a,(this.i&65535?0:4)||!Ec(this)!=!(this.g&32768))}function Rd(a){V(this,a,P(this)||(this.i&65535?0:4))}function Sd(a){V(this,a,!Ec(this)!=!(this.g&32768))}function Td(a){V(this,a,Ec(this))}function Ud(a){V(this,a,!!(this.i&65535))}function Vd(a){V(this,a,!Ec(this))}function Wd(){K(this,12,0,-8);this.a-=5}function Xd(a){V(this,a,!0)}function Yd(a){V(this,a,!(this.g&32768))}function Zd(a){V(this,a,this.g&32768?2:0)}
|
||||
function W(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.s=0);this.a-=5}function $d(a){var b=Wc(this,a);a=Zc(this,a);var c=(b=0>b?this.f[-b-1]:b)-a;Mc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}function ae(a){var b=Vc(this,a);a=Yc(this,a);var c=(b=(0>b?this.f[-b-1]&255:b)<<8)-(a<<=8);Mc(this,c,a,b);this.a-=this.c?4+(this.C&&6<=this.b?1:0):(this.A?4:3)+(7==this.b?2:0)}
|
||||
function be(a){var b=Zc(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.s=d>>16):(this.g=32768,this.i=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.s=0,this.g=32768,this.m=65536,this.a-=7}function ce(){K(this,24,0,-8);this.a-=25}
|
||||
function de(){this.B&49152?(this.ea|=128,K(this,4,0,-7)):(this.w&&1120==this.Da&&this.w.setData(this.f[0],!0),this.D?this.D.b():G(this));this.a-=7}function ee(){K(this,16,0,-8);this.a-=25}var fe=[0,7,7,10,7,11,9,13];function ge(a){this.F=this.a;Q(this,Xc(this,a));this.a=this.F-fe[this.c]}var he=[0,14,14,17,14,18,16,20];function ie(a){this.F=this.a;var b=Xc(this,a);a=a>>6&7;Nc(this,this.f[a]);this.f[a]=this.f[7];Q(this,b);this.a=this.F-he[this.c]}var je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];
|
||||
function ke(a){var b=Wc(this,a);this.F=this.a;R(this,ad(this,a,b));this.a=this.F-je[(this.A?8:0)+this.c]+(7!=this.b||this.c?0:2)}function le(a){var b=Vc(this,a);R(this,$c(this,a,b,65535)<<8);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}var me=[7,13,13,17,14,18,17,21];
|
||||
function ne(a){var b=Zc(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.u&128||(this.s=b>>16,this.i=this.s|b,this.g=0,this.m=-32768>b||32767<b?65536:0);this.a-=23}function oe(){this.a-=5}function pe(){this.B&49152||(this.h.reset(),lb(this));this.a-=667}function qe(a){if(a&8)K(this,8,0,-8);else{var b=Pc(this);a&=7;7==a?Q(this,b):(Q(this,this.f[a]),this.f[a]=b);this.a-=9}}function re(){Oc(this);this.a-=13}
|
||||
function X(a){a&1&&(this.m=65536);a&2&&(this.g=32768);a&4&&(this.i=0);a&8&&(this.s=32768);this.a-=5}function se(a){var b=(a&448)>>6;if(this.f[b]=this.f[b]-1&65535)Q(this,this.f[7]-((a&63)<<1)),this.a+=1;this.a-=6}function te(a){T(this,a,Wc(this,a),xd);this.a-=this.c?9+(this.C&&6<=this.b?1:0):(this.A?5:3)+(7==this.b?2:0)}function ue(a){T(this,a,0,zd);this.a-=this.c?9:3+(7==this.b?2:0)}function ve(){K(this,28,0,-8);this.a-=5}
|
||||
function we(){this.w&&(this.w.da=this.f[7],this.w.setData(this.f[0],!0));this.u|=4;Gc(this,-2);this.a-=3}function xe(a){T(this,a,this.f[a>>6&7],Ad);this.a-=this.c?9:3+(7==this.b?2:0)}function Y(){K(this,8,0,-8)}function Bc(a){ye[a>>12].call(this,a)}function ze(a){Ae[a>>6&3].call(this,a)}function Be(a){Ce[a>>6&3].call(this,a)}function De(a){Ee[a>>6&3].call(this,a)}function Fe(a){Ge[a&15].call(this,a)}function He(a){Ie[a&15].call(this,a)}function Je(a){Ke[a>>6&3].call(this,a)}
|
||||
function Le(a){Me[a>>6&3].call(this,a)}function Ne(a){Oe[a>>6&3].call(this,a)}
|
||||
var ye=[function(a){Pe[a>>8&15].call(this,a)},ke,$d,Kd,Gd,Id,Bd,Y,function(a){Re[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,te,Y],Pe=[function(a){Se[a>>4&15].call(this,a)},Xd,Ud,Md,Nd,Sd,Od,Qd,ie,ie,ze,Be,De,Y,Y,Y],Ae=[function(a){Jc(this,ad(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ld);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,pd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,nd);this.a-=this.c?9:3+(7==this.b?2:0)}],Ce=[function(a){T(this,a,0,
|
||||
rd);this.a-=this.c?11:6},function(a){T(this,a,P(this)?1:0,bd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,P(this)?1:0,xd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Zc(this,a);Jc(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],Ee=[function(a){T(this,a,0,vd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,td);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,fd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,dd);this.a-=this.c?9:3+(7==this.b?2:0)}],
|
||||
Se=[function(a){Te[a&15].call(this,a)},Y,Y,Y,ge,ge,ge,ge,qe,Y,Fe,He,ue,ue,ue,ue],Te=[de,we,re,Wd,ee,pe,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y],Ge=[oe,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},W,function(){this.i=1;this.a-=5},W,W,W,function(){this.s=0;this.a-=5},W,W,W,W,W,W,W],Ie=[oe,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},X,function(){this.i=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Re=[Vd,Td,Pd,Rd,Yd,Zd,Ed,Fd,ce,ve,Je,Le,Ne,Y,Y,Y],Ke=[function(a){Jc(this,
|
||||
$c(this,a,0,255));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,md);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,qd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,od);this.a-=this.c?9:3+(7==this.b?2:0)}],Me=[function(a){S(this,a,0,sd);this.a-=this.c?11:6},function(a){S(this,a,P(this)?1:0,cd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,P(this)?1:0,yd);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=Yc(this,a);Jc(this,a<<8);this.a-=this.c?4:3+(7==
|
||||
this.b?2:0)}],Oe=[function(a){S(this,a,0,wd);this.a-=this.c?9+(this.yb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,ud);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,gd);this.a-=this.c?9+(this.yb&1):3+(7==this.b?2:0)},function(a){S(this,a,0,ed);this.a-=this.c?9:3+(7==this.b?2:0)}];function Cc(a){Ue[a>>12].call(this,a)}
|
||||
var Ue=[function(a){Ve[a>>8&15].call(this,a)},ke,$d,Kd,Gd,Id,Bd,function(a){We[a>>8&15].call(this,a)},function(a){Xe[a>>8&15].call(this,a)},le,ae,Ld,Hd,Jd,te,Y],Ve=[function(a){Ye[a>>4&15].call(this,a)},Xd,Ud,Md,Nd,Sd,Od,Qd,ie,ie,ze,Be,De,function(a){Ze[a>>6&3].call(this,a)},Y,Y],Ze=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.V(a|this.R);Q(this,this.f[5]);this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Tc(this,a,0);Nc(this,a);R(this,a);this.a-=11},function(a){var b=Pc(this);this.F=
|
||||
this.a;Uc(this,a,0,b);R(this,b);this.a=this.F-me[this.c]},function(a){R(this,ad(this,a,Ec(this)?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Ye=[function(a){$e[a&15].call(this,a)},Y,Y,Y,ge,ge,ge,ge,qe,function(a){a&8?(this.B&49152||(this.B=this.B&-2017|(a&7)<<5,this.u|=1),this.a-=5):K(this,8,0,-8)},Fe,He,ue,ue,ue,ue],$e=[de,we,function(){Oc(this);this.u|=this.B&16;this.a-=13},Wd,ee,pe,re,function(){K(this,8,0,-8)},Y,Y,Y,Y,Y,Y,Y,Y],We=[ne,ne,be,be,Cd,Cd,Dd,Dd,xe,xe,Y,Y,Y,Y,se,se],Xe=[Vd,Td,Pd,Rd,
|
||||
Yd,Zd,Ed,Fd,ce,ve,Je,Le,Ne,function(a){af[a>>6&3].call(this,a)},Y,Y],af=[Y,function(a){a=Tc(this,a,65536);Nc(this,a);R(this,a);this.a-=11},function(a){var b=Pc(this);this.F=this.a;Uc(this,a,65536,b);R(this,b);this.a=this.F-me[this.c]},Y];
|
||||
function bf(a){x.call(this,"ROM",a,bf);this.W=this.c=null;this.i=a.addr;this.b=a.size;this.m=!1;this.g=a.alias;this.l=a.file;this.s=q(this.l);if(this.l){a=this.l;var b=la(this.s);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.l+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load ROM resource (error "+f+": "+a+")"),c.l=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W):c.l=null);cf(c)})}}z(bf);h=bf.prototype;
|
||||
h.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;cf(this)};h.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.i,this.b,this.W),delete this.W);return!0};h.ja=function(){return!0};
|
||||
function cf(a){if(!Va(a)){if(a.l){if(!a.c||!a.h)return;a.b||(a.b=a.c.length);if(a.c.length!=a.b)Wa(a,"ROM size ("+m(a.c.length,8,!0)+") does not match specified size ("+m(a.b,8,!0)+")");else{var b;a:{b=a.i;a.status(a.b+"-byte ROM at "+ka(b));if(57344<=b&&b<57344+H){var c={};b=(c[b]=[bf.prototype.Zc,bf.prototype.Ud,null,null,null,a.b>>1],c);if(cb(a.h,a,b,256,a.ya)){b=a.m=!0;break a}}else if(Fb(a.h,b,a.b,gc)){for(c=0;c<a.c.length;c++)a.h.Za(b+c,a.c[c]);b=!0;break a}b=!1}if(b){b=[];"number"==typeof a.g?
|
||||
b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c<b.length;c++){var d=a,e=b[c],f=Eb(d.h,d.i,d.b);Db(d.h,e,d.b,f)}a.m||delete a.c}}}F(a)}}h.Zc=function(a){return this.c[a-this.i]};h.Ud=function(){};Ga(function(){for(var a=E(document,"pdp11","rom"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new bf(d);C(d,c)}});
|
||||
function df(a){x.call(this,"RAM",a,df);this.W=this.c=null;this.l=a.addr;this.i=a.size;this.ga=a.load;this.fa=a.exec;this.g=!1;this.b=a.file;this.m=q(this.b);if(this.b){a=this.b;var b=la(this.m);"json"!=b&&"hex"!=b&&(a=v()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.G("Unable to load RAM resource (error "+f+": "+a+")"),c.b=null):(Ra(c.pa,a,b),(a=ta(a,b))?(c.c=a.K,c.W=a.W,null==c.ga&&(c.ga=a.ga),null==c.fa&&(c.fa=a.fa)):c.b=null);ef(c)})}}z(df);
|
||||
df.prototype.ia=function(a,b,c,d){this.h=b;this.a=c;this.D=d;ef(this)};df.prototype.ka=function(){this.W&&(this.D&&this.D.a(this.id,this.l,this.i,this.W),delete this.W);return!0};df.prototype.ja=function(){return!0};function ef(a){if(a.h&&(!a.g&&a.i&&Fb(a.h,a.l,a.i,Ib)&&(a.g=!0),!Va(a))){if(!a.g)t("No RAM allocated");else if(a.b){if(!a.c||!a.h)return;ff(a,a.c,a.ga,a.fa,a.l)}F(a)}}
|
||||
df.prototype.reset=function(){if(this.g){for(var a=this.h,b=this.l,c=this.i,d=b&a.l,b=b>>>a.c;0<c&&b<a.h.length;){var e=a.h[b];if(e.controller&&a.i&&a.i.length==a.v.length){var f=a.i.indexOf(e);0<=f&&(e=a.v[f])}if(e){var f=c,g=0,k,d=d||0,g=g&255;void 0===f&&(f=e.size);if(Xa&&e.o)for(k=d;f--&&k<e.o.length;k++)e.o[k]=g;else for(k=d;f--&&k<e.size;k++)e.Ib(d,g,e.Ka+d)}c-=a.b;b++;d=0}this.c&&ff(this,this.c,this.ga,this.fa,this.l,!0)}};
|
||||
function ff(a,b,c,d,e,f){var g=!1;if(null==c)for(var k=0;k<b.length-1;){var l=b[k]&255|(b[k+1]&255)<<8;if(l)if(l&255){if(1!=l)break;if(k+6>=b.length)break;for(var k=k+2,n=b[k++]&255|(b[k++]&255)<<8,p=b[k++]&255|(b[k++]&255)<<8,l=l+((n&255)+(n>>8)+(p&255)+(p>>8)),u=k,w=n-=6;0<n&&k<b.length;)l+=b[k++]&255,n--;if(n||k>=b.length)break;l+=b[k++]&255;if(l&255)break;if(w)for(;w--;)a.a.Za(p++,b[u++]&255);else p&1?G(a.a):null==d&&(d=p);g=!0}else k++;else k+=2}if(!g&&(null==c&&(c=e),null!=c)){for(g=0;g<b.length;g++)a.a.Za(c+
|
||||
g,b[g]);g=!0}g&&null!=d&&(a=a.a,a.Ob=d,a.h.reset(),lb(a),Q(a,d),$b(a,0),!f&&a.D&&(G(a)||a.D.c()));return g}Ga(function(){for(var a=E(document,"pdp11","ram"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new df(d);C(d,c)}});function gf(a){x.call(this,"Keyboard",a,gf);F(this)}z(gf);gf.prototype.Z=function(){return!1};gf.prototype.ia=function(a,b,c,d){this.l=a;this.a=c;this.D=d};Ga(function(){for(var a=E(document,"pdp11","keyboard"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new gf(d);C(d,c)}});
|
||||
function Z(a){this.F=a.baudReceive||9600;this.R=a.baudTransmit||9600;this.O=a.upperCase;this.g=this.m=null;this.J=a.tabSize;this.I=a.charBOL;this.s=0;x.call(this,"SerialPort",a,Z);var b=a.binding;if("console"==b)this.m="";else{var c;a=hf;b&&(void 0===c&&(c="Panel"),(c=Ta(c,this.id))&&(b=c.o[b])&&this.Z(null,a,b))}this.v=this.A=null;this.exports={connect:this.Nb,receiveData:this.Db}}z(Z);var hf="buffer";h=Z.prototype;
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case hf:return this.o[b]=this.g=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.Db(b);return!0},c.onkeypress=function(a){a=a||window.event;d.Db(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;var e=this;this.aa=Vb(48,4);this.M=Sb(this.a,function(){e.b&128||!e.i.length||(e.w=e.i.shift()&255,e.O&&97<=e.w&&122>e.w&&(e.w-=32),e.b|=128,e.b&64&&Tb(e.a,e.aa))});this.C=Vb(52,4);this.$=Sb(this.a,function(){e.c|=128;e.c&64&&Tb(e.a,e.C)});cb(b,this,jf);eb(b,this.reset.bind(this));F(this)};
|
||||
h.Nb=function(){if(!this.v){var a=sc(this.l,"connection");if(a){var b=a.split("->");if(2==b.length){var c=pa(b[0]);if(c!=this.ya)return;b=pa(b[1]);if(this.v=Sa(b)){var d=this.v.exports;if(d){var e=d.connect;e&&e.call(this.v);if(this.A=d.receiveData){this.status(this.pa+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ka=function(a,b){if(!b)if(this.Nb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
h.ja=function(a){return a?this.save():!0};h.reset=function(){kf(this)};h.save=function(){var a=new O(this);a.set(0,[]);return a.data()};h.restore=function(){return kf(this)};function kf(a){a.w=0;a.b=0;a.c=128;a.i=[];return!0}h.Db=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.i.push(a.charCodeAt(b));else this.i=this.i.concat(a);Ub(this.a,this.M,1E3/Math.round(this.F/10));return!0};h.Tc=function(){return this.b&65534};
|
||||
h.Od=function(a){this.b=this.b&-112|a&111};h.Sc=function(){this.b&=-129;0<this.i.length&&Ub(this.a,this.M,1E3/Math.round(this.F/10));return this.w};h.Nd=function(){};h.nd=function(){return this.c};h.he=function(a){this.c&128&&(a&64?Tb(this.a,this.C):Hc(this.a,this.C));this.c=this.c&-70|a&69};h.md=function(){return 0};
|
||||
h.ge=function(a){if(a&=255){this.A&&this.A.call(this.v,a);a&=127;if(this.g)if(13==a)this.s=0;else if(8==a)this.g.value=this.g.value.slice(0,-1),0<this.s&&this.s--;else{var b;b=(b=qa[a])?"<"+b+">":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.J||8,c=a-this.s%a,this.J&&(b=" ".slice(0,c)));this.I&&!this.s&&c&&(b=String.fromCharCode(this.I)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.s+=c}else if(null!=this.m){if(10==a||1024<=
|
||||
this.m.length)this.T(this.m),this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;Ub(this.a,this.$,1E3/Math.round(this.R/10))}};var lf={},jf=(lf[65392]=[null,null,Z.prototype.Tc,Z.prototype.Od,"RCSR"],lf[65394]=[null,null,Z.prototype.Sc,Z.prototype.Nd,"RBUF"],lf[65396]=[null,null,Z.prototype.nd,Z.prototype.he,"XCSR"],lf[65398]=[null,null,Z.prototype.md,Z.prototype.ge,"XBUF"],lf);Ga(function(){for(var a=E(document,"pdp11","serial"),b=0;b<a.length;b++){var c=a[b],d=B(c),d=new Z(d);C(d,c)}});
|
||||
function ac(a){x.call(this,"PC11",a,ac);this.c=a.autoMount||null;this.m=0;this.O=a.baudReceive||3600;this.w=this.A=this.b=0;this.v=[];this.s=mf;this.g=nf;this.C=this.i="";this.K=this.ga=this.fa=null;this.I=-1;this.F=!Aa("Mobi")&&window&&"FileReader"in window}z(ac);var mf="",nf=0;h=ac.prototype;
|
||||
h.Z=function(a,b,c){var d=this,e=nf;switch(b){case "listTapes":return this.o[b]=c,c.onchange=function(){var a=d.o.descTape,b=c.options[c.selectedIndex];if(a&&b){var e={};if(b=b.getAttribute("data-value"))try{e=eval("("+b+")")}catch(l){t("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.o[b]=c,!0;case "loadTape":e=2;case "attachTape":return e||(e=1),this.o[b]=c,c.onclick=function(){var a=
|
||||
d.o.listTapes;a&&of(d,a.options[a.selectedIndex].text,a.value,e)},!0;case "mountTape":if(!this.F){c.parentNode.removeChild(c);break}this.o[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;of(d,q(b,!0),b,1,a)}return!1};return!0;case "readProgress":return this.o[b]=c,!0}return!1};
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;this.J=pf(a);var e=this;if((this.c=sc(this.l,"autoMount")||this.c)&&"string"==typeof this.c)try{this.c=eval("("+this.c+")")}catch(f){t("PC11 auto-mount error: "+f.message+" ("+this.c+")"),this.c=null}this.M=Vb(56,4);this.R=Sb(this.a,function(){1==(e.b&32769)&&!(e.b&128)&&e.w<e.v.length&&(e.A=e.v[e.w++]&255,qf(e,e.w/e.v.length*100),e.b|=128,e.b&=-2049,e.b&64&&Tb(e.a,e.M))});cb(b,this,rf);eb(b,this.reset.bind(this));sf(this,"None",mf,!0);this.F&&
|
||||
sf(this,"Local Tape","?");sf(this,"Remote Tape","??");tf(this)||F(this)};h.ka=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){this.b&=-2241;this.A=0};function tf(a){a.m=0;if(a.c){var b=a.c.path||"",c;if(!(c=a.c.name))a:{if((c=a.o.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=q(b,!0)}b&&c?uf(a,c,b,1,!0):vf(a)}return!!a.m}
|
||||
function of(a,b,c,d,e){if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"');a.s="??"}else a.s=c;uf(a,b,c,d,!1,e)}else wf(a,!1)}function uf(a,b,c,d,e,f){var g=-1;if(a.i.toLowerCase()!=c.toLowerCase()||a.g!=d)g++,wf(a,!0),a.j.Ca?a.G("PC11 busy"):(e&&a.m++,xf(a,b,c,d,f)?g++:a.j.Ca=!0);g&&yf(a,a.C,a.i,a.g,a.K,a.ga,a.fa)}
|
||||
function xf(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),yf(a,b,c,d,e),a.s="?");vf(a)};g.readAsArrayBuffer(e);return!0}0>c.indexOf("/api/v1/dump")&&(e=la(c),f="json"==e||"gz"==e?encodeURI(c):v()+"/api/v1/dump?path="+encodeURIComponent(c)+"&format=json");return!!r(f,null,!0,function(e,f,g){var k=0>g&&a.l&&!a.l.j.N;g?a.G('Unable to load tape "'+b+'" (error '+g+": "+e+")",k):(Ra(a.pa,e,f),(e=ta(e,f))&&yf(a,b,c,d,e.K,e.ga,e.fa));
|
||||
a.j.Ca=!1;a.m&&(a.m--,a.m||F(a));vf(a)})}function sf(a,b,c,d){if((a=a.o.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 vf(a){var b=a.o.listTapes;if(b&&b.options){a=a.s||a.i;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 qf(a,b){b|=0;if(b!==a.I){var c=a.o.readProgress;c&&(c=(c=E(c,"pcjs-progress-bar"))&&c[0])&&c.style&&(c.style.width=b+"%");a.I=b}}function yf(a,b,c,d,e,f,g){a.C=b;a.i=c;a.g=d;a.K=e;a.ga=f;a.fa=g;2==d?a.J&&ff(a.J,e,f,g)?a.status("tape loaded: "+b):(a.C="",a.i="",a.s=mf,a.g=nf,a.G("No load address available for tape: "+b)):(a.w=0,a.v=e,a.status("tape attached: "+b),qf(a,0))}
|
||||
function wf(a,b){if(a.i||!1===b)a.C="",a.i="",b||(a.g&&a.status(1==a.g?"tape detached":"tape unloaded"),a.s=mf,a.g=nf,vf(a))}h.save=function(){return(new O(this)).data()};h.restore=function(){return!0};h.Mc=function(){return this.b&65534};h.Hd=function(a){a&1&&(this.b&32768?(a&=-2,this.b&64&&Tb(this.a,this.M)):(this.b&=-129,this.b|=2048,this.A=0,Ub(this.a,this.R,1E3/Math.round(this.O/10))));this.b=this.b&-66|a&65};h.Lc=function(){this.b&=-129;this.b|=2048;return this.A};h.Gd=function(){};
|
||||
var zf={},rf=(zf[65384]=[null,null,ac.prototype.Mc,ac.prototype.Hd,"PRS"],zf[65386]=[null,null,ac.prototype.Lc,ac.prototype.Gd,"PRB"],zf);function Af(a,b,c){x.call(this,"Disk",{id:a.pa+".disk"+m(++Bf,4)},Af);this.controller=a;this.l=a.l;this.D=a.D;this.g=b;this.wa=b.name;this.vb=b.vb;Cf(this,c,b.U,b.Y,b.S,b.ha);F(this)}var Bf=0;z(Af);h=Af.prototype;h.ia=function(a,b,c,d){this.D=d};
|
||||
function Cf(a,b,c,d,e,f){a.mode=b;a.U=c;a.Y=d;a.S=e;a.ha=f;a.a=[];if("preload"!=a.mode){b=Array(a.U);for(c=0;c<b.length;c++){d=Array(a.Y);for(e=0;e<d.length;e++){f=Array(a.S);for(var g=1;g<=f.length;g++)f[g-1]=Df(null,c,e,g,a.ha,0);d[e]=f}b[c]=d}a.a=b}a.b=null}
|
||||
function Ef(a,b,c,d,e){var f=c;if(a.h)return!0;a.wa=b;a.Ba=c;a.$b=q(c);a.h=e;a.i=a.controller;if(d){var g=new FileReader;g.onload=function(){var b=g.result,c,d=b?b.byteLength:0,e=ia[d];if(e){a.U=e[0];a.Y=e[1];a.S=e[2];a.ha=e[3]||512;c=a.ha>>2;var f=e=0,b=new DataView(b,0,d);a.a=Array(a.U);for(d=0;d<a.a.length;d++)for(var w=a.a[d]=Array(a.Y),D=0;D<w.length;D++)for(var U=w[D]=Array(a.S),ya=0;ya<U.length;ya++){for(var Zb=Df(null,d,D,ya+1,a.ha,0),Qe=Zb.data,mc=0;mc<c;mc++,f+=4)var fg=Qe[mc]=b.getInt32(f,
|
||||
!0),e=e+fg&-1;Zb.ba=c;U[ya]=Zb}a.b=e;c=a}else a.G("Unrecognized disk format ("+d+" bytes)");a.h&&(a.h.call(a.controller,a.g,c,a.wa,a.Ba),a.h=null)};g.readAsArrayBuffer(d);return!0}0>c.indexOf("/api/v1/dump")&&(b=la(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"):ma(c,"/")&&(d="dir"),f=v()+"/api/v1/dump?"+d+"="+encodeURIComponent(c)+(a.vb?"":e)+"&format=json"));return!!r(f,
|
||||
null,!0,function(b,c,d){Ff(a,b,c,d)})}
|
||||
function Ff(a,b,c,d){var e=null;a.c=!1;var f=0>d&&a.l&&!a.l.j.N;if(d)a.controller.G('Unable to load disk "'+a.wa+'" (error '+d+": "+b+")",f);else{Ra(a.controller.pa,b,c);try{if(0<q(a.$b,!0).toLowerCase().indexOf("-readonly"))a.c=!0;else{var g=c.indexOf("\n");0<g&&1024>g&&0<c.substring(0,g).indexOf("write-protected")&&(a.c=!0)}var k;"<"==c.substr(0,1)?k=["Missing disk image: "+a.wa]:k=0>c.indexOf("0x")&&'["'!=c.substr(0,2)?JSON.parse(c.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+
|
||||
c+")");if(k.length)if(1==k.length)t(k[0]);else{a.U=k.length;a.Y=k[0].length;a.S=k[0][0].length;var l=k[0][0][0];a.ha=l&&l.length||512;for(d=c=0;d<a.U;d++)for(f=0;f<a.Y;f++)for(g=0;g<a.S;g++)if(l=k[d][f][g]){var n=l.length;void 0===n&&(n=l.length=512);var n=n>>2,p=l.pattern;void 0===p&&(p=l.pattern=0);var u=l.data;if(void 0===u){var w=l.bytes;if(void 0!==w&&w.length){for(var D=n<<2,U=w.length;U<D;U++)w[U]=p;Gf(l,w)}else u=[],p=l.pattern=p|p<<8|p<<16|p<<24,l.data=u;delete l.bytes}Df(l,d,f);for(D=0;D<
|
||||
u.length;D++)c=c+u[D]&-1}a.a=k;a.b=c;e=a}else t("Empty disk image: "+a.wa)}catch(ya){t("Disk image error ("+b+"): "+ya.message)}}a.h&&(a.h.call(a.i,a.g,e,a.wa,a.Ba),a.h=null)}function Df(a,b,c,d,e,f){a||(a={sector:d,length:e,data:[],pattern:f});a.ke=b;a.le=c;a.ma=a.ba=0;a.va=!1;return a}
|
||||
h.seek=function(a,b,c,d,e){d=null;var f=this.g,g=this.a[a];if(g){var k=g[b];if(!k&&f.gc&&b<f.Y)for(k=g[b]=Array(f.hc),g=0;g<k.length;g++)k[g]=Df(null,a,b,g+1,f.Pb,0);if(k){for(g=0;g<k.length;g++)if(k[g]&&k[g].sector==c){d=k[g];break}!d&&f.gc&&9==f.Jb&&(d=k[g]=Df(null,a,b,f.Jb,f.Pb,0))}}e&&e(d,!1);return d};function Gf(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}
|
||||
h.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};h.write=function(a,b,c){if(this.c)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.ma?(a.ba+=a.ma-f,a.ma=f):f>=a.ma+a.ba&&(a.ba+=f-(a.ma+a.ba)+1):(a.ma=f,a.ba=1);d[f]=d[f]&~(255<<b)|c<<b}return!0}return null};
|
||||
function Gf(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.U?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function Hf(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}h.save=function(){var a=0,b=[];b[a++]=[this.Ca,this.b,this.U,this.Y,this.S,this.ha];if(!this.c)for(var c=this.a,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 k=[],l=0,n=g.ma,p=g.ma+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.ma,k]}}return b};
|
||||
h.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.a.length&&6<=e.length?Bf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+
|
||||
function Hf(a,b){var c=a.Y*a.S,d=b/c|0;return d<a.U?(b%=c,a.seek(d,b/a.S|0,b%a.S+1)):null}function If(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}h.save=function(){var a=0,b=[];b[a++]=[this.Ba,this.b,this.U,this.Y,this.S,this.ha];if(!this.c)for(var c=this.a,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 k=[],l=0,n=g.ma,p=g.ma+g.ba;n<p;)k[l++]=g.data[n++];b[a++]=[d,e,f,g.ma,k]}}return b};
|
||||
h.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.a.length&&6<=e.length?Cf(this,"local",e[2],e[3],e[4],e[5]):null!=e[1]&&null!=this.b&&e[1]!=this.b&&(c="original checksum ("+e[1]+") differs from current checksum ("+this.b+")",b=-2));for(this.a.length||(b=-1);d<a.length&&0<=b;){var f=0,g=a[d++],k=g[f++],l=g[f++],n=g[f++];if(k>=this.a.length||l>=this.a[k].length||n>=this.a[k][l].length){c="sector (CHS="+k+":"+l+":"+n+") out of range ("+
|
||||
b+" changes applied)";b=-1;break}if(this.c){c="unable to modify write-protected disk";b=-1;break}e=g[f++];f=g[f++];g=e+f.length;if(k=this.a[k][l][n]){for(l=k.data.length;l<e;)k.data[l++]=k.pattern;l=0;k.ma=e;for(k.ba=f.length;e<g;)k.data[e++]=f[l++];b++}}}0>b&&-2!=b&&this.controller.G("Unable to restore disk '"+this.wa+": "+c);return b};
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=Gf(this,a++);)If(b);a=JSON.stringify(this.a,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 If(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RL11",a,N);this.g=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Aa("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype;
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.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.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Jf(d,a)},!0;case "loadDrive":return this.o[b]=
|
||||
c,c.onclick=function(){var a=d.o.listDisks;a&&Kf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Gf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(Hf(a,k,l));b=btoa(b);a=a.ac.replace(".json",".img");c=null;b="data:application/octet-stream;base64,"+b;a&&(c=document.createElement("a"),"string"!=
|
||||
h.toJSON=function(){var a;a=0;for(var b;b=Hf(this,a++);)Jf(b);a=JSON.stringify(this.a,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 Jf(a){var b=a.data,c=b.length;if(c<<2==a.length){for(var d=c-1,e=b[d],f=0;d--&&b[d]===e;)f++;f++&&(b.length=c-f,a.pattern=e)}}function N(a){x.call(this,"RL11",a,N);this.g=a.autoMount||null;this.s=0;this.b=Array(4);this.A=!Aa("Mobi")&&window&&"FileReader"in window}z(N);h=N.prototype;
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case "listDisks":return this.o[b]=c,c.onchange=function(){var a=d.o.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("("+b+")")}catch(k){t("RL11 option error: "+k.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.o[b]=c,c.onchange=function(){var a=ja(c.value);null!=a&&Kf(d,a)},!0;case "loadDrive":return this.o[b]=
|
||||
c,c.onclick=function(){var a=d.o.listDisks;a&&Lf(d,a.options[a.selectedIndex].text,a.value)},!0;case "saveDrive":if(!this.A){c.parentNode.removeChild(c);break}this.o[b]=c;c.onclick=function(){var a=d.o.listDrives;if(a&&a.options&&d.b)if(a=d.b[ja(a.value)||0])if(a=a.ca){var b;b="";for(var c=0,k;k=Hf(a,c++);)for(var l=0,n=k.length;l<n;l++)b+=String.fromCharCode(If(a,k,l));b=btoa(b);a=a.$b.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+")":"")+".");t(a)}else d.G("No disk loaded in drive.");else d.G("No disk drive selected.")};return!0;case "mountDrive":if(this.A)return this.o[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;Kf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;if((this.g=sc(this.l,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}Lf(this);this.F=Vb(112,5);cb(b,this,Mf,4194304);eb(b,this.reset.bind(this));Nf(this,"None","",!0);this.A&&Nf(this,"Local Disk","?");Nf(this,"Remote Disk","??");Of(this)||F(this)};
|
||||
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Mb){for(a=0;a<this.b.length;a++)Pf(this,a,!0);Of(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.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";Jf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Lf(this)};h.save=function(){return(new O(this)).data()};
|
||||
h.restore=function(a){return Lf(this,a[0])};function Of(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(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.b.length)){!Qf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
|
||||
function Kf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Qf(a,e,b,c,!1,d)}else Pf(a,e)}
|
||||
function Qf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ca.toLowerCase()!=d.toLowerCase()&&(g++,Pf(a,b,!0),k.vb?a.G("RL11 busy"):(k.vb=!0,e&&(k.ub=!0,a.s++),k.ib=!!f,Df(new zf(a,k,"preload"),c,d,f,a.lc)&&g++));return g}
|
||||
h.lc=function(a,b,c,d,e){var f;a.vb=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.yb)),b=null);b?(a.ca=b,a.wa=c,a.Ca=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.yb),a.ub||e),this.l&&yc(this.l)):a.ib=!1;a.ub&&(a.ub=!1,--this.s||F(this));Jf(this,a.yb)};
|
||||
function Nf(a,b,c,d){if((a=a.o.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 Jf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.ib?"?":c.Ca,!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 Pf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.wa="",d.Ca="",d.ca=null,d.ib=!1,c||(a.G("Drive RL"+b+" unloaded",c),Jf(a,b))}
|
||||
function Lf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.yb=b;d.vb=d.ib=!1;d.name=c.ya;d.U=512;d.Y=2;d.S=40;d.ha=256;d.wb=!0;d.ke=0;d.je=0;d.Kb=1;d.ic=d.S;d.Qb=d.ha;d.ne=0;d.oe=null;d.ca||(d.Ca="");d.status=29|(512==d.U?128:0)}return!0}
|
||||
h.jc=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
|
||||
h.Ac=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};
|
||||
h.xd=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Xc=function(){return this.L&65535};
|
||||
h.Sd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.Ac;case 10:b||(b=this.xd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w&
|
||||
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.jc.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.F))}};h.Vc=function(){return this.v};h.Qd=function(a){this.v=a&65534};h.Yc=function(){return this.c};h.Td=function(a){this.c=a};h.Zc=function(){return this.m};h.Ud=function(a){this.m=a};h.Wc=function(){return this.w};h.Rd=function(a){this.w=a&63};
|
||||
var Rf={},Mf=(Rf[63744]=[null,null,N.prototype.Xc,N.prototype.Sd,"RLCS"],Rf[63746]=[null,null,N.prototype.Vc,N.prototype.Qd,"RLBA"],Rf[63748]=[null,null,N.prototype.Yc,N.prototype.Td,"RLDA"],Rf[63750]=[null,null,N.prototype.Zc,N.prototype.Ud,"RLMP"],Rf[63752]=[null,null,N.prototype.Wc,N.prototype.Rd,"RLBE"],Rf);
|
||||
function Sf(a,b,c){x.call(this,"Computer",a,Sf);this.j.N=!1;Tf(this,b);this.A=sc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Uf;this.s=null;this.i=this.I=!1;this.O=sc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Vf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.h=new vb({id:this.pa+".bus",busWidth:this.M},this.a,this.D);var d,e=A(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Xa)for(b=0;b<e.length;b++)d=e[b],d.G=this.w.G,d.T=this.w.T,d.Xa=this.w.Xa;
|
||||
this.T("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.T("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.ia&&d.ia(this,this.h,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=sc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=Uf),this.b&&(this.v=new O(this,
|
||||
"1.30.3"),Wf(this.v)?b=null:delete this.v);!b&&this.b&&(b=Xf(this))&&(this.i=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.s=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Yf(this,this.Za)}else t("Unable to find CPU component")}z(Sf);var Uf=0;
|
||||
function Tf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function sc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Yf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Yf(a,b,c)});return}}b.call(a,c)}
|
||||
function Zf(a,b){var c=new O(a,"1.30.3","validate");if(Wf(c)&&$f(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Sf.prototype;
|
||||
h.Za=function(a){void 0===a&&(a=this.b||(this.s?1:Uf));if(!this.l){this.l++;var b=!1,c=!1;this.F=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Uf){if(Wf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Wf(this.g)&&(ag(this,d),a=2,bg(this.g));this.g.set("timestamp",sa());cg(this.g);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=$f(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Wf(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),bg(d),Wf(d)?(c=$f(d),e=!0):c=!1))}e&&Zf(this,c?d:null)}else 2==a&&d.clear()}else Zf(this);delete this.s;delete this.v}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=dg(this,g,d,b,c));b=[d,a,c];-1!=a?Yf(this,this.Lb,b):this.Lb(b)}};
|
||||
function dg(a,b,c,d,e){if(!b.j.N){b.j.N=!0;if(b.ka){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.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Uf,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.Rb)for(a=b.Rb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Lb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(dg(this,this.a,b,c,a),this.xa(),this.a.Wa());this.F&&(ag(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0};
|
||||
function ag(a,b){if(ua("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.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function fg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l<k.length;l++){var n=k[l];n.j.N&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id,
|
||||
d)),c&&(n.j.N=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&gg(a,a.c,f.toString()),cg(g)&&cg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.N=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.xa(-1)};
|
||||
c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Lf(d,q(b,!0),b,a)}return!1},!0;c.parentNode.removeChild(c)}return!1};
|
||||
h.ia=function(a,b,c,d){this.l=a;this.h=b;this.a=c;this.D=d;if((this.g=sc(this.l,"autoMount")||this.g)&&"string"==typeof this.g)try{this.g=eval("("+this.g+")")}catch(e){t("RL11 auto-mount error: "+e.message+" ("+this.g+")"),this.g=null}Mf(this);this.F=Vb(112,5);cb(b,this,Nf,4194304);eb(b,this.reset.bind(this));Of(this,"None","",!0);this.A&&Of(this,"Local Disk","?");Of(this,"Remote Disk","??");Pf(this)||F(this)};
|
||||
h.ka=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.l.Lb){for(a=0;a<this.b.length;a++)Qf(this,a,!0);Pf(this,!0)}}else if(!this.restore(a))return!1;if(a=this.o.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";Kf(this,0)}}return!0};h.ja=function(a){return a?this.save():!0};h.reset=function(){Mf(this)};h.save=function(){return(new O(this)).data()};
|
||||
h.restore=function(a){return Mf(this,a[0])};function Pf(a,b){b||(a.s=0);if(a.g)for(var c in a.g){var d=a.g[c],e=d.path||"",f;if(!(f=d.name))a:{if((f=a.o.listDisks)&&f.options)for(var g=0;g<f.options.length;g++){var k=f.options[g];if(k.value==e){f=k.text;break a}}f=q(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.b.length)){!Rf(a,g,f,e,!0)&&b&&F(a,!1);continue}a.G("Incorrect auto-mount settings for drive "+c+" ("+JSON.stringify(d)+")")}return!!a.s}
|
||||
function Lf(a,b,c,d){var e=a.o.listDrives,e=e&&ja(e.value);if(void 0===e||0>e||e>=a.b.length)a.G("Unable to load the selected drive");else if(c)if("?"==c)a.G('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=q(c);a.status("Attempting to load "+c+' as "'+b+'"')}Rf(a,e,b,c,!1,d)}else Qf(a,e)}
|
||||
function Rf(a,b,c,d,e,f){var g=-1,k=a.b[b];k.Ba.toLowerCase()!=d.toLowerCase()&&(g++,Qf(a,b,!0),k.ub?a.G("RL11 busy"):(k.ub=!0,e&&(k.tb=!0,a.s++),k.hb=!!f,Ef(new Af(a,k,"preload"),c,d,f,a.kc)&&g++));return g}
|
||||
h.kc=function(a,b,c,d,e){var f;a.ub=!1;b&&(f=b.a.length?[b.a.length,b.a[0].length,b.a[0][0].length,b.a[0][0][0].length]:[0,0,0,0],b&&f[0]>a.U||f[1]>a.Y)&&(this.G('Disk "'+c+'" too large for drive '+("RL"+a.xb)),b=null);b?(a.ca=b,a.wa=c,a.Ba=d,this.G('Mounted disk "'+c+'" in drive '+("RL"+a.xb),a.tb||e),this.l&&yc(this.l)):a.hb=!1;a.tb&&(a.tb=!1,--this.s||F(this));Kf(this,a.xb)};
|
||||
function Of(a,b,c,d){if((a=a.o.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 Kf(a,b){if(0<=b&&b<a.b.length){var c=a.b[b],d=a.o.listDisks;a=a.o.listDrives;if(d&&a&&d.options&&a.options&&(a=ja(a.value),c=c.hb?"?":c.Ba,!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 Qf(a,b,c){var d=a.b[b];if(d.ca||!1===c)d.wa="",d.Ba="",d.ca=null,d.hb=!1,c||(a.G("Drive RL"+b+" unloaded",c),Kf(a,b))}
|
||||
function Mf(a,b){var c=0;b||(b=[]);a.L=b[c++]||0;a.v=b[c++]||0;a.c=b[c++]||0;a.i=b[c++]||0;a.m=b[c++]||0;a.w=b[c]||0;for(b=0;b<a.b.length;b++){var d=a.b[b];void 0===d&&(d=a.b[b]={});c=a;d.xb=b;d.ub=d.hb=!1;d.name=c.ya;d.U=512;d.Y=2;d.S=40;d.ha=256;d.vb=!0;d.je=0;d.ie=0;d.Jb=1;d.hc=d.S;d.Pb=d.ha;d.me=0;d.ne=null;d.ca||(d.Ba="");d.status=29|(512==d.U?128:0)}return!0}
|
||||
h.ic=function(a,b,c,d,e,f){this.v=f&65535;this.L=this.L&-49|f>>12&48;this.w=f>>16&63;this.i=this.c=b<<7|(c?64:0)|d&63;this.m=65536-e&65535;a&&(this.L=this.L|a|32768);return!0};
|
||||
h.zc=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){if(!n){n=a.ca.seek(b,c,d+1);if(!n){k=5120;break}p=0}var u,w;if(0>(u=a.ca.read(n,p++))||0>(w=a.ca.read(n,p++))){k=5120;break}Ob(this.h,f,u|w<<8);if(Rb(this.h)){k=8192;break}f+=2;if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};
|
||||
h.wd=function(a,b,c,d,e,f,g){var k=0,l=a.ca,n=null,p;l||(k=5120,e=0);for(;e--;){var u=Mb(this.h,f);if(Rb(this.h)){k=8192;break}f+=2;if(!n){n=a.ca.seek(b,c,d+1,!0);if(!n){k=5120;break}p=0}if(!a.ca.write(n,p++,u&255)||!a.ca.write(n,p++,u>>8)){k=5120;break}if(p>=l.ha&&(n=null,++d>=l.S&&(d=0,++c>=l.Y&&(c=0,++b>=l.U)))){k=5120;break}}return g(k,b,c,d,e,f)};h.Wc=function(){return this.L&65535};
|
||||
h.Rd=function(a){this.L=this.L&-1023|a&1022;this.C=this.C&-4|(a&48)>>4;if(!(this.L&128)){var b;a=!0;var c=this.b[(this.L&768)>>8],d,e,f,g;this.L&=-2;switch(this.L&14){case 4:this.c&8&&(this.L&=63);this.m=c.status|this.i&64;break;case 6:1==(this.c&3)&&(b=this.c&65408,c=(this.c&16)<<2,this.i=this.c&4?this.i+b:this.i-b,this.c=this.i=this.i&65408|c);break;case 8:this.m=this.i;break;case 12:b=this.zc;case 10:b||(b=this.wd),d=this.c>>7,e=this.c&64?1:0,f=this.c&63,d>=c.U||f>=c.S?this.L|=37888:(g=(this.w&
|
||||
63)<<16|this.v,a=65536-this.m&65535,a=b.call(this,c,d,e,f,a,g,this.ic.bind(this)))}a&&(this.L|=129,this.L&64&&Tb(this.a,this.F))}};h.Uc=function(){return this.v};h.Pd=function(a){this.v=a&65534};h.Xc=function(){return this.c};h.Sd=function(a){this.c=a};h.Yc=function(){return this.m};h.Td=function(a){this.m=a};h.Vc=function(){return this.w};h.Qd=function(a){this.w=a&63};
|
||||
var Sf={},Nf=(Sf[63744]=[null,null,N.prototype.Wc,N.prototype.Rd,"RLCS"],Sf[63746]=[null,null,N.prototype.Uc,N.prototype.Pd,"RLBA"],Sf[63748]=[null,null,N.prototype.Xc,N.prototype.Sd,"RLDA"],Sf[63750]=[null,null,N.prototype.Yc,N.prototype.Td,"RLMP"],Sf[63752]=[null,null,N.prototype.Vc,N.prototype.Qd,"RLBE"],Sf);
|
||||
function Tf(a,b,c){x.call(this,"Computer",a,Tf);this.j.N=!1;Uf(this,b);this.A=sc(this,"autoPower",a);this.l=0;this.M=a.busWidth||a.buswidth;this.b=Vf;this.s=null;this.i=this.I=!1;this.O=sc(this,"url")||"";(Math.random()+.1).toString(36);this.c=Wf(this);if(this.a=Ta("CPU",this.id)){this.D=Ta("Debugger",this.id);this.h=new vb({id:this.pa+".bus",busWidth:this.M},this.a,this.D);var d,e=A(this.id);if((this.w=Ta("Panel",this.id))&&this.w.Wa)for(b=0;b<e.length;b++)d=e[b],d.G=this.w.G,d.T=this.w.T,d.Wa=this.w.Wa;
|
||||
this.T("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.T("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.ia&&d.ia(this,this.h,this.a,this.D);b=null;d=a.resume;void 0!==d&&(1<d.length?b=this.m=d:this.b=parseInt(d,10));var f;if(a=sc(this,"state")||(f=!0,a.state))b=this.C=a,f||(this.i=!0,this.b=Vf),this.b&&(this.v=new O(this,
|
||||
"1.30.3"),Xf(this.v)?b=null:delete this.v);!b&&this.b&&(b=Yf(this))&&(this.i=!0);if(b){var g=this;r(b,null,!0,function(a,b,c){c?(g.m=null,g.i=!1,g.G("Unable to load machine state from server (error "+c+(b?": "+pa(b):"")+")")):(g.s=b,g.I=!0);F(g)})}else F(this);this.o.power||(this.A=!0);!c&&this.A&&Zf(this,this.Ya)}else t("Unable to find CPU component")}z(Tf);var Vf=0;
|
||||
function Uf(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){t(d.message+" ("+c+")")}}a.J=b}function sc(a,b,c){var d=b.toLowerCase(),d=La[b]||La[d];void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Zf(a,b,c){for(var d=A(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Va(f)){Va(f,function(){Zf(a,b,c)});return}}b.call(a,c)}
|
||||
function $f(a,b){var c=new O(a,"1.30.3","validate");if(Xf(c)&&ag(c)){var d=c.get("timestamp"),e=b?b.get("timestamp"):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}h=Tf.prototype;
|
||||
h.Ya=function(a){void 0===a&&(a=this.b||(this.s?1:Vf));if(!this.l){this.l++;var b=!1,c=!1;this.F=!1;var d=this.v||new O(this,"1.30.3");if(-1==a)b=!0;else if(a>Vf){if(Xf(d,this.s)){this.g=new O(this,"1.30.3","failsafe");Xf(this.g)&&(bg(this,d),a=2,cg(this.g));this.g.set("timestamp",sa());dg(this.g);var e=this.b&&!this.i;if(1==a||ua("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=ag(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Xf(d,g):("error"==
|
||||
f&&"no machine state"!=g?(this.G("Error: "+g),"unable to verify user"==g&&(za("user",""),this.c=null)):this.T(f+": "+g),cg(d),Xf(d)?(c=ag(d),e=!0):c=!1))}e&&$f(this,c?d:null)}else 2==a&&d.clear()}else $f(this);delete this.s;delete this.v}e=A(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.a&&(c=eg(this,g,d,b,c));b=[d,a,c];-1!=a?Zf(this,this.Kb,b):this.Kb(b)}};
|
||||
function eg(a,b,c,d,e){if(!b.j.N){b.j.N=!0;if(b.ka){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.ka(f,d)&&f&&(t("Unable to restore state for "+b.type),a.C&&!a.I?(c.clear(),a.b=Vf,window&&window.location.reload()):a.F=!0,b.ka(null),e=!1)}if(!d&&b.Qb)for(a=b.Qb.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||
h.Kb=function(a){var b=a[0],c=0>a[1];a=a[2];this.R=!0;this.j.N=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.a&&(eg(this,this.a,b,c,a),this.xa(),this.a.Va());this.F&&(bg(this,b),b.clear());!c&&this.g&&(this.g.clear(),delete this.g);this.l=0};
|
||||
function bg(a,b){if(ua("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.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.3"};d.url=a.O;d.user=c;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function gg(a,b,c){var d,e="none";if(a.l)return null;a.l--;var f=new O(a,"1.30.3"),g=new O(a,"1.30.3","validate"),k=sa();g.set("timestamp",k);f.set("timestamp",k);f.set("version","1.30.3");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ja&&(c&&G(a.a),d=a.a.ja(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.j.N=!1,!1===d&&(e=null)));for(var k=A(a.id),l=0;l<k.length;l++){var n=k[l];n.j.N&&(n.ja&&(d=n.ja(b,c),"object"===typeof d&&f.set(n.id,
|
||||
d)),c&&(n.j.N=!1,!1===d&&(e=null)))}e&&(c?(k=d=!1,b?(a.c&&hg(a,a.c,f.toString()),dg(g)&&dg(f)||(e=null,d=k=!0)):a.b&&(d=!0,k=3==a.b),d&&f.clear(k)):e=f.toString());c&&(a.j.N=!1,b=a.o.power)&&(b.textContent="Power");a.l=0;return e}h.reset=function(){this.h&&this.h.reset&&this.h.reset();this.a&&this.a.reset&&this.a.reset();for(var a=A(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.h&&c!==this.a&&c.reset&&c.reset()}this.xa(-1)};
|
||||
h.start=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}this.xa(-1)};h.stop=function(a,b){for(var c=A(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}this.xa(-1)};
|
||||
h.xa=function(a){if(this.a){var b=this.a,c=a||0,d=b.o.speed;d&&(0>=c||30<=(b.xb+=c))&&(d.textContent=b.j.P?b.Ha.toFixed(2)+"Mhz":"Stopped",b.xb=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.j.P;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e<b.a.f.length;e++)kb(b,"R"+e,b.a.f[e]);e=Zb(b.a);kb(b,"PS",e);kb(b,"NF",e&8?1:0,1);kb(b,"ZF",e&4?1:0,1);kb(b,"VF",e&2?1:0,1);kb(b,"CF",e&1?1:0,1);b.s=0}sb(b,0<a&&c&&!d?b.a.f[7]:b.da);rb(b,b.m);a=b.a.Ba?b.a.Fa&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",
|
||||
h.xa=function(a){if(this.a){var b=this.a,c=a||0,d=b.o.speed;d&&(0>=c||30<=(b.wb+=c))&&(d.textContent=b.j.P?b.Ga.toFixed(2)+"Mhz":"Stopped",b.wb=0)}if(this.w&&(b=this.w,a=a||0,b.v)){c=b.a.j.P;d=!!(b.a.u&4);if(0>=a||60<=(b.s+=a)){for(var e=0;e<b.a.f.length;e++)kb(b,"R"+e,b.a.f[e]);e=Yb(b.a);kb(b,"PS",e);kb(b,"NF",e&8?1:0,1);kb(b,"ZF",e&4?1:0,1);kb(b,"VF",e&2?1:0,1);kb(b,"CF",e&1?1:0,1);b.s=0}sb(b,0<a&&c&&!d?b.a.f[7]:b.da);rb(b,b.m);a=b.a.Aa?b.a.Ea&16?1:2:4;tb(b,"B22",a&1);tb(b,"B18",a&2);tb(b,"B16",
|
||||
a&4)}};
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.N?fg(d,!1,!0):Yf(d,d.Za))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.N&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");fg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Mb=!0),d.Za(Uf),d.Mb=!1)}else d.reset(),d.a&&d.a.Wa()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]=
|
||||
c,c.onclick=function(){var a=Vf(d,!0);if(a){var b=!!(d.b&&!d.m||d.C),c=fg(d,b);b?gg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Vf(a,b){var c=a.c;c||((c=ya("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=hg(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||
function hg(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Xf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+ig(a,"1.30.3"));return b}
|
||||
function gg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ig(a,"1.30.3");d.data=c;b=r(v()+"/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.G("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.G(c),za("user",""),a.c=null)}}
|
||||
function of(a){var b;a=A(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}function yc(a){if(a.Xa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Xa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Sf(g,d,!0);C(g,f);g.A&&Yf(g,g.Za)}});
|
||||
Ba.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.j.N&&c.Za(-1)}});Ba.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.j.N&&fg(c,!(!c.b||c.m),!0)}});function O(a,b,c){this.id=a.id;this.key=ig(a,b,c);this.D=a.D;bg(this,a.sd)}function ig(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){bg(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 bg(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function cg(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function $f(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Wf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=ya(a.key))?(a[a.id]=b,a.a=!0):!1}var jg=0;
|
||||
function kg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):lg(k,a,b,c,d,e,f)})}
|
||||
function lg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(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(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?mg(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function mg(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);mg(a,b,c)}})}else c(a,null)}
|
||||
function ng(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--jg||Ia(!0));l=!1}var g,k,l=!0;jg++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?kg(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--jg||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--jg||Ia(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?kg(b,a,d,!0,e,n):lg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return ng(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map
|
||||
h.Z=function(a,b,c){var d=this;switch(b){case "power":return this.o[b]=c,c.onclick=function(){d.l||(d.j.N?gg(d,!1,!0):Zf(d,d.Ya))},!0;case "reset":return this.o[b]=c,c.onclick=function(){if(d.j.N&&!d.l)if(d.b&&!d.m){var a=ua("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");gg(d,a,!0);!a&&d.C?window&&window.location.reload():(a||(d.Lb=!0),d.Ya(Vf),d.Lb=!1)}else d.reset(),d.a&&d.a.Va()},!0;case "save":if(ma(v(),"pcjs.org"))c.parentNode.removeChild(c);else return this.o[b]=
|
||||
c,c.onclick=function(){var a=Wf(d,!0);if(a){var b=!!(d.b&&!d.m||d.C),c=gg(d,b);b?hg(d,a,c):d.G("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function Wf(a,b){var c=a.c;c||((c=xa("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=ig(a,c))||a.G("The user ID is invalid.")):b&&a.G("Browser local storage is not available"));return c}
|
||||
function ig(a,b){a.c=null;b=r(v()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(za("user",b.data),a.c=b.data)}catch(d){t(d.message+" ("+c+")")}return a.c}function Yf(a){var b=null;a.c&&(b=v()+"/api/v1/user?req=load&user="+a.c+"&state="+jg(a,"1.30.3"));return b}
|
||||
function hg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=jg(a,"1.30.3");d.data=c;b=r(v()+"/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.G("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.G(c),za("user",""),a.c=null)}}
|
||||
function pf(a){var b;a=A(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}function yc(a){if(a.Wa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.Wa.focus();window&&window.scrollTo(b,c)}}Ga(function(){for(var a=E(document,"pdp11-machine"),b=0;b<a.length;b++)for(var c=a[b],d=B(c),c=E(c,"pdp11","computer"),e=0;e<c.length;e++){var f=c[e],g=B(f),g=new Tf(g,d,!0);C(g,f);g.A&&Zf(g,g.Ya)}});
|
||||
Ba.show.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.R&&!c.j.N&&c.Ya(-1)}});Ba.exit.push(function(){for(var a=E(document,"pdp11","computer"),b=0;b<a.length;b++){var c=B(a[b]);(c=Ta("Computer",c.id))&&c.j.N&&gg(c,!(!c.b||c.m),!0)}});function O(a,b,c){this.id=a.id;this.key=jg(a,b,c);this.D=a.D;cg(this,a.rd)}function jg(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}
|
||||
O.prototype={constructor:O,set:function(a,b){try{this[this.id][a]=b}catch(c){}},get:function(a){return this[this.id][a]||null},value:function(){return this[this.id]},data:function(){return this[this.id]},toString:function(){var a=this[this.id];return"string"==typeof a?a:JSON.stringify(a)},clear:function(a){cg(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 cg(a,b){a[a.id]={};b&&a.set("parms",b);a.a=!1}function dg(a){var b=!0;if(wa()){var c=JSON.stringify(a[a.id]);za(a.key,c)||(t("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}function ag(a){var b=!0;try{a[a.id]=JSON.parse(a[a.id])}catch(c){t(c.message||c),b=!1}return b}function Xf(a,b){return b?(a[a.id]=b,a.a=!0):a.a?!0:wa()&&(b=xa(a.key))?(a[a.id]=b,a.a=!0):!1}var kg=0;
|
||||
function lg(a,b,c,d,e,f){e("Loading "+a+"...");r(a,null,!0,function(g,k,l){l?(k||(k="unable to load "+a+" ("+l+")"),f(k,null)):mg(k,a,b,c,d,e,f)})}
|
||||
function mg(a,b,c,d,e,f,g){function k(a,f){if(f)g(f,null);else{c&&(Ra(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(p){f=null,a=p.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);g(a,f)}}a?e?ng(a,f,k):k(a,null):g("no data"+(b?" for file: "+b:""),null)}
|
||||
function ng(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)l=0>l.indexOf(n[1])?l.replace(">",n[0]+">"):l.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);ng(a,b,c)}})}else c(a,null)}
|
||||
function og(a,b,c,d){function e(a){if(void 0===k){var b=g&&E(g,"machine-warning");k=b&&b[0]||g}k&&(k.innerHTML=oa(a))}function f(a){e("Error: "+a);l&&(--kg||Ia(!0));l=!1}var g,k,l=!0;kg++;Qa[a]={};try{if(g=document.getElementById(a)){var n;if("object"==typeof resources&&(n=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.type="text/css";u.styleSheet?u.styleSheet.cssText=n:u.appendChild(document.createTextNode(n));p.appendChild(u)}c||
|
||||
(c="/versions/pdpjs/1.30.3/components.xsl");n=function(d,k){k?lg(c,null,null,!1,e,function(d,l){l?(Ra(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(l=k.transformNode(l))?(g.outerHTML=l,--kg||Ia(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(l),(l=d.transformToFragment(k,document))?g.parentNode?(g.parentNode.replaceChild(l,g),--kg||Ia(!0)):f("invalid machine element: "+
|
||||
a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?lg(b,a,d,!0,e,n):mg(b,null,a,d,!1,e,n)}else f("missing machine element: "+a)}catch(w){f(w.message)}return l}window.embedPDP11=function(a,b,c,d){Ia(!1);return og(a,b,c,d)};window.enableEvents=Ia;window.sendEvent=Ja;})();//# sourceMappingURL=/tmp/pdpjs/1.30.3/pdp11.map
|
||||
|
|
|
|||
Loading…
Reference in a new issue