Added logic (untested) for ASH
This commit is contained in:
parent
20c24053b9
commit
5d48383363
4 changed files with 424 additions and 302 deletions
|
|
@ -998,7 +998,7 @@ PDP10.opMOVN = function(op, acc)
|
|||
PDP10.opMOVNI = function(op, acc)
|
||||
{
|
||||
/*
|
||||
* We perform an in-line two's complement of regEA, since negate() updates the flags, and the documentation
|
||||
* We perform an in-line twos complement of regEA, since negate() updates the flags, and the documentation
|
||||
* above claims that this operation must "set no flags." It's certainly true that regEA, being an 18-bit value,
|
||||
* could never be -2^35, but it COULD be zero -- and apparently this instruction treats zero differently from MOVN.
|
||||
*
|
||||
|
|
@ -1356,7 +1356,40 @@ PDP10.opDIVB = function(op, acc)
|
|||
};
|
||||
|
||||
/**
|
||||
* opASH(0o240000)
|
||||
* opASH(0o240000): Artithmetic Shift
|
||||
*
|
||||
* From the DEC PDP-10 System Reference Manual (May 1968), p. 2-31:
|
||||
*
|
||||
* Arithmetic Shifting
|
||||
*
|
||||
* These two instructions produce an arithmetic shift right or left of the number in AC or the
|
||||
* double length number in accumulators A and A+1. Shifting is the movement of the contents of
|
||||
* a register bit-to-bit. The operation discussed here is similar to logical shifting [see §2.4
|
||||
* and the illustration on page 2-24], but in an arithmetic shift only the magnitude part is
|
||||
* shifted - the sign is unaffected. In a double length number the 70-bit string made up of the
|
||||
* magnitude parts of the two words is shifted, but the sign of the low order word is made equal
|
||||
* to the sign of the high order word.
|
||||
*
|
||||
* Null bits are brought in at the end being vacated: a left shift brings in 0s at the right,
|
||||
* whereas a right shift brings in the equivalent of the sign bit at the left. In either case,
|
||||
* information shifted out at the other end is lost. A single shift left is equivalent to multiplying
|
||||
* the number by 2 (provided no bit of significance is shifted out); a shift right divides the number
|
||||
* by 2.
|
||||
*
|
||||
* The number of places shifted is specified by the result of the effective address calculation
|
||||
* taken as a signed number (in twos complement notation) modulo 28 in magnitude. In other words
|
||||
* the effective shift E is the number composed of bit 18 (which is the sign) and bits 28-35 of the
|
||||
* calculation result. Hence the programmer may specify the shift directly in the instruction
|
||||
* (perhaps indexed) or give an indirect address to be used in calculating the shift. A positive E
|
||||
* produces motion to the left, a negative E to the right; E is thus the power of 2 by which the
|
||||
* number is multiplied. Maximum movement is 255 places.
|
||||
*
|
||||
* ASH: Arithmetic Shift
|
||||
*
|
||||
* Shift AC arithmetically the number of places specified by E. Do not shift bit 0. If E is positive,
|
||||
* shift left bringing 0s into bit 35; data shifted out of bit 1 is lost; set Overflow if any bit of
|
||||
* significance is lost (a 1 in a positive number, a 0 in a negative one). If E is negative, shift right
|
||||
* bringing 0s into bit 1 if AC is positive, 1s if negative; data shifted out of bit 35 is lost.
|
||||
*
|
||||
* @this {CPUStatePDP10}
|
||||
* @param {number} op
|
||||
|
|
@ -1364,7 +1397,62 @@ PDP10.opDIVB = function(op, acc)
|
|||
*/
|
||||
PDP10.opASH = function(op, acc)
|
||||
{
|
||||
this.opUndefined(op);
|
||||
/*
|
||||
* Convert the unsigned 18-bit value in regEA to a signed 8-bit value (+/-255).
|
||||
*/
|
||||
var s = (this.regEA << 14) >> 24;
|
||||
if (s) {
|
||||
var w = this.readWord(acc), bitsShifted;
|
||||
/*
|
||||
* Convert the unsigned word (w) to a signed value (i), for convenience.
|
||||
*/
|
||||
var i = w > PDP10.MAX_POS36? -(PDP10.WORD_LIMIT - w) : w;
|
||||
if (s > 0) {
|
||||
if (s >= 35) {
|
||||
i = (i < 0? PDP10.INT_LIMIT : 0);
|
||||
bitsShifted = PDP10.INT_MASK;
|
||||
} else {
|
||||
i = (i * Math.pow(2, s)) % PDP10.INT_LIMIT;
|
||||
/*
|
||||
* bitsShifted must be set to the mask of all magnitude bits shifted out of
|
||||
* the original word. Using 8-bit signed words as an example, this table shows
|
||||
* the bitsShifted values that would correspond to shifting 1-7 bits left:
|
||||
*
|
||||
* shifts bitsShifted value calculation
|
||||
* ------ ----------- ------ -----------
|
||||
* 1 0b01000000 128-64 128-Math.pow(2, 7-1)
|
||||
* 2 0b01100000 128-32 128-Math.pow(2, 7-2)
|
||||
* 3 0b01110000 128-16 128-Math.pow(2, 7-3)
|
||||
* ...
|
||||
* 7 0b01111111 128-1 128-Math.pow(2, 7-7)
|
||||
*/
|
||||
bitsShifted = PDP10.INT_LIMIT - Math.pow(2, 35-s);
|
||||
}
|
||||
if (w <= PDP10.MAX_POS36) {
|
||||
/*
|
||||
* Since w was positive, overflow occurs ONLY if any of the bits we shifted out were 1s.
|
||||
* If all those bits in the original value (w) were 0s, then adding bitsShifted to it could NOT
|
||||
* produce a value > MAX_POS36.
|
||||
*/
|
||||
if (w + bitsShifted > PDP10.MAX_POS36) this.fOverflow = true;
|
||||
} else {
|
||||
/*
|
||||
* Since w was negative, overflow occurs ONLY if any of the bits we shifted out were 0s.
|
||||
* If all those bits in the original value (w) were 1s, subtracting bitsShifted from it could NOT
|
||||
* produce a value <= MAX_POS36.
|
||||
*/
|
||||
if (w - bitsShifted <= PDP10.MAX_POS36) this.fOverflow = true;
|
||||
}
|
||||
} else {
|
||||
if (s <= -35) {
|
||||
i = (i < 0? -1 : 0);
|
||||
} else {
|
||||
i = Math.trunc(i / Math.pow(2, -s));
|
||||
}
|
||||
}
|
||||
w = (i < 0? i + PDP10.WORD_LIMIT: i);
|
||||
this.writeWord(acc, w);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1399,7 +1487,26 @@ PDP10.opROT = function(op, acc)
|
|||
/**
|
||||
* opLSH(0o242000): Logical Shift
|
||||
*
|
||||
* From the DEC PDP-10 System Reference Manual (May 1968), p. 2-25:
|
||||
* From the DEC PDP-10 System Reference Manual (May 1968), p. 2-24:
|
||||
*
|
||||
* Shift and Rotate
|
||||
*
|
||||
* The remaining logical instructions shift or rotate right or left the contents of AC or the contents
|
||||
* of two accumulators, A and A+1 (mod 20 [base 8]), concatenated into a 72-bit register with A on the
|
||||
* left. The illustration below shows the movement of information these instructions produce in the
|
||||
* accumulators. In a (logical) shift the contents of a register are moved bit-to-bit with 0s brought
|
||||
* in at the end being vacated; information shifted out at the other end is lost. [For a discussion of
|
||||
* arithmetic shifting see § 2.5.] In rotation the contents are moved cyclically such that information
|
||||
* rotated out at one end is put in at the other.
|
||||
*
|
||||
* The number of places moved is specified by the result of the effective address calculation taken as a
|
||||
* signed number (in twos complement notation) modulo 2^8 in magnitude. In other words the effective shift
|
||||
* E is the number composed of bit 18 (which is the sign) and bits 28-35 of the calculation result. Hence
|
||||
* the programmer may specify the shift directly in the instruction (perhaps indexed) or give an indirect
|
||||
* address to be used in calculating the shift. A positive E produces motion to the left, a negative E to
|
||||
* the right; maximum movement is 255 places.
|
||||
*
|
||||
* LSH: Logical Shift
|
||||
*
|
||||
* Shift AC the number of places specified by E. If E is positive, shift left bringing 0s into bit 35;
|
||||
* data shifted out of bit 0 is lost. If E is negative, shift right bringing 0s into bit 0; data shifted
|
||||
|
|
@ -1447,7 +1554,19 @@ PDP10.opJFFO = function(op, acc)
|
|||
};
|
||||
|
||||
/**
|
||||
* opASHC(0o244000)
|
||||
* opASHC(0o244000): Arithmetic Shift
|
||||
*
|
||||
* From the DEC PDP-10 System Reference Manual (May 1968), p. 2-32:
|
||||
*
|
||||
* Concatenate the magnitude portions of accumulators A and A+1 with A on the left, and shift
|
||||
* the 70-bit combination in bits 1-35 and 37-71 the number of places specified by E. Do not shift
|
||||
* AC bit 0, but make bit 0 of AC A +1 equal to it if at least one shift occurs (ie if E is nonzero).
|
||||
*
|
||||
* If E is positive, shift left bringing 0s into bit 71 (bit 35 of AC A+1); bit 37 (bit 1 of AC A+1)
|
||||
* is shifted into bit 35; data shifted out of bit 1 is lost; set Overflow if any bit of significance
|
||||
* is lost (a 1 in a positive number, a 0 in a negative one). If E is negative, shift right bringing 0s
|
||||
* into bit 1 if AC is positive, 1s if negative; bit 35 is shifted into bit 37; data shifted out of
|
||||
* bit 71 is lost.
|
||||
*
|
||||
* @this {CPUStatePDP10}
|
||||
* @param {number} op
|
||||
|
|
@ -1504,7 +1623,7 @@ PDP10.opROTC = function(op, acc)
|
|||
* From the DEC PDP-10 System Reference Manual (May 1968), p. 2-25:
|
||||
*
|
||||
* Concatenate accumulators A and A+1 with A on the left, and shift the 72-bit combination the number
|
||||
* of places specified by E. If E is positive, shift left bringing 0s into bit 71 (bit 35 of AC A + 1);
|
||||
* of places specified by E. If E is positive, shift left bringing 0s into bit 71 (bit 35 of AC A+1);
|
||||
* bit 36 is shifted into bit 35; data shifted out of bit 0 is lost. If E is negative, shift right
|
||||
* bringing 0s into bit 0; bit 35 is shifted into bit 36; data shifted out of bit 71 is lost.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -104,10 +104,12 @@ var PDP10 = {
|
|||
ADDR_LIMIT: Math.pow(2, 18),
|
||||
ADDR_MASK: Math.pow(2, 18) - 1,
|
||||
WORD_INVALID: -1,
|
||||
WORD_LIMIT: Math.pow(2, 36),
|
||||
WORD_MASK: Math.pow(2, 36) - 1,
|
||||
HALF_SHIFT: Math.pow(2, 18),
|
||||
HALF_MASK: Math.pow(2, 18) - 1,
|
||||
INT_LIMIT: Math.pow(2, 35), // signed word (magnitude) limit
|
||||
INT_MASK: Math.pow(2, 35) - 1, // signed word (magnitude) mask
|
||||
WORD_LIMIT: Math.pow(2, 36), // unsigned word limit
|
||||
WORD_MASK: Math.pow(2, 36) - 1, // unsigned word mask
|
||||
HALF_SHIFT: Math.pow(2, 18), // unsigned half-word shift
|
||||
HALF_MASK: Math.pow(2, 18) - 1, // unsigned half-word mask
|
||||
|
||||
/*
|
||||
* 18-bit and 36-bit largest positive (and smallest negative) values; however, since we store all
|
||||
|
|
|
|||
|
|
@ -35,18 +35,18 @@ var ra=Math.pow(2,36),sa=-Math.pow(2,35),q={cc:0,vb:1,ec:2,fc:3,gc:4,hc:5,ic:6,j
|
|||
Mc:82,Nc:83,Oc:84,Pc:85,Qc:86,Rc:87,Sc:88,Tc:89,zb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Uc:97,Vc:98,Wc:99,d:100,e:101,Xc:102,Yc:103,Zc:104,$c:105,ad:106,k:107,bd:108,cd:109,n:110,dd:111,p:112,q:113,r:114,ed:115,t:116,gd:117,hd:118,jd:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,yb:127};
|
||||
function ta(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 g,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(g=parseInt(a,b))&&(c=g)}return c}function ua(a,b,c,d){var e="";if(null==a||isNaN(a))for(;0<c--;)e="?"+e;else for(0>a&&-1<a&&(a=-1);0<c--;){var g=a%b,g=g+(0<=g&&9>=g?48:55),e=String.fromCharCode(g)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function va(a,b,c){b?12<b&&(b=12):b=a&-16777216?11:a&-65536?8:6;return ua(a,8,b,c?"0o":"")}function t(a,b,c){b?9<b&&(b=9):b=a&-65536?8:4;return ua(a,16,b,c?"0x":"")}
|
||||
function wa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function xa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function Da(){var a=Ea();return-1!==a.indexOf("pcjs.org",a.length-8)}function Fa(a){return a.replace(/[&<>"']/g,function(a){return Ga[a]})}function Ha(a,b){return(a+" ").slice(0,b)}
|
||||
function wa(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}function xa(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function ya(){var a=Ea();return-1!==a.indexOf("pcjs.org",a.length-8)}function Fa(a){return a.replace(/[&<>"']/g,function(a){return Ga[a]})}function Ha(a,b){return(a+" ").slice(0,b)}
|
||||
function Ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Ga={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ja(a,b,c){var d=0,e=a.length,g=0;for(c||(c=function(a,b){return a>b?1:a<b?-1:0});d<e;){var f=d+e>>1,h;h=c(b,a[f]);0<h?d=f+1:(e=f,g=!h)}return g?d:~d}function Ka(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function La(a,b,c,d){c=void 0===c?!1:c;var e=0,g=null,f=null;if("object"==typeof resources&&(g=resources[a]))return d&&d(a,g,e),[g,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),f;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(g=h.responseText,200==h.status||!h.status&&g.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,
|
||||
g,e))});if(b&&"object"==typeof b){var k="",m;for(m in b)b.hasOwnProperty(m)&&(k&&(k+="&"),k+=m+"="+encodeURIComponent(b[m]));k=k.replace(/%20/g,"+");h.open("POST",a,c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(k)}else h.open("GET",a,c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(g=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,g,e),f=[g,e]);return f}
|
||||
function Ma(a,b){var c,d={Y:null,T:null,na:null,ma:null};if("["==b.charAt(0)||"{"==b.charAt(0))try{var e,g,f;if("<"==b.substr(0,1))throw Error(b);f=0>b.indexOf("0x")&&0>b.indexOf("0o")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.na=f.load;d.ma=f.exec;if(e=f.bytes)d.Y=e;else if(e=f.words)for(d.Y=Array(2*e.length),g=c=0;c<e.length;c++)d.Y[g++]=e[c]&255,d.Y[g++]=e[c]>>8&255;else if(e=f.longs)for(d.Y=Array(4*e.length),g=c=0;c<e.length;c++)d.Y[g++]=
|
||||
e[c]&255,d.Y[g++]=e[c]>>8&255,d.Y[g++]=e[c]>>16&255,d.Y[g++]=e[c]>>24&255;else(e=f.data)?d.Ca=e:d.Y=f;d.Y&&(d.Y.length?1==d.Y.length&&(u(d.Y[0]),d=null):(u("Empty resource: "+a),d=null));d.T=f.symbols}catch(h){u("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){g=parseInt(b[c],16);if(isNaN(g)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(g&255)}c==b.length&&(d.Y=e)}return d}
|
||||
function Ea(){return"http://"+(window?window.location.host:"www.pcjs.org")}function Na(){if(null==Wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Wa=a}return Wa}function Xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function Ea(){return"http://"+(window?window.location.host:"www.pcjs.org")}function Na(){if(null==Oa){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}Oa=a}return Oa}function Xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function Ya(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Za(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)}return!1}
|
||||
function $a(a){if(!ab){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,g=/([^&=]+)=?([^&]*)/g;d=g.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}ab=c}return ab[a]}function bb(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
|
||||
function cb(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,g=!1;a.onmousedown=function(){g||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);g=!0}}function db(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function eb(a){fb.init.push(a)}
|
||||
function gb(a){if(hb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ib(a){!hb&&a?(hb=!0,jb&&kb("init"),lb&&kb("show")):hb=a}function kb(a){fb[a]&&gb(fb[a])}var ab=null,fb={init:[],show:[],exit:[]},jb=!1,lb=!1,hb=!0,Wa=null;db("onload",function(){jb=!0;gb(fb.init)});db("onpageshow",function(){lb=!0;gb(fb.show)});db(Za("Opera")||Za("iOS")?"onunload":"onbeforeunload",function(){gb(fb.exit)});
|
||||
function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.hb=b.comment;this.Bb=b;this.exports={};this.I=this.bindings={};a=this.id.indexOf(".");0>a?this.Ka=this.id:(this.La=this.id.substr(0,a),this.Ka=this.id.substr(a+1));this.v={ready:!1,Fa:!1,Xa:!1,U:!1,error:!1};this.Ma=null;this.v.error=!1;this.X=c||0;this.C=this.u=this.G=this.F=this.oa=null;w.push(this)}function nb(a,b,c){wb[a]&&b&&(wb[a][b]=c)}function xb(){return Date.now()||+new Date}
|
||||
function gb(a){if(hb)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function ib(a){!hb&&a?(hb=!0,jb&&kb("init"),lb&&kb("show")):hb=a}function kb(a){fb[a]&&gb(fb[a])}var ab=null,fb={init:[],show:[],exit:[]},jb=!1,lb=!1,hb=!0,Oa=null;db("onload",function(){jb=!0;gb(fb.init)});db("onpageshow",function(){lb=!0;gb(fb.show)});db(Za("Opera")||Za("iOS")?"onunload":"onbeforeunload",function(){gb(fb.exit)});
|
||||
function v(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.hb=b.comment;this.Bb=b;this.exports={};this.I=this.bindings={};a=this.id.indexOf(".");0>a?this.Ka=this.id:(this.La=this.id.substr(0,a),this.Ka=this.id.substr(a+1));this.v={ready:!1,Fa:!1,Xa:!1,U:!1,error:!1};this.Na=null;this.v.error=!1;this.X=c||0;this.C=this.u=this.G=this.F=this.oa=null;w.push(this)}function mb(a,b,c){ob[a]&&b&&(ob[a][b]=c)}function xb(){return Date.now()||+new Date}
|
||||
function u(a){window&&window.alert(a)}function yb(a){var b=!1;window&&(b=window.confirm(a));return b}function zb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<w.length;b++){var d=w[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Ab(a){if(void 0!==a){var b;for(b=0;b<w.length;b++)if(w[b].id===a)return w[b]}return null}
|
||||
function Bb(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<w.length;d++)if(c)c==w[d]&&(c=null);else if(!(a!=w[d].type||b&&w[d].id.indexOf(b)))return w[d]}return null}function x(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b}
|
||||
function Cb(a,b){var c=y;b=z(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,g=0;g<e.length;g++){var f=e[g];if(1===f.nodeType){var h=f.getAttribute("class");if(h)for(var k=h.split(" "),m=0;m<k.length;m++)switch(h=k[m],h){case c+"-binding":(h=x(f))&&h.binding&&a.ga(h.type,h.binding,f,h.value),m=k.length}}}}
|
||||
|
|
@ -54,183 +54,183 @@ function z(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.g
|
|||
function Db(a){for(var b=!0,c=Eb[a];c&&c.length;){var d=c.splice(0,1)[0],e=d[0],g=null;0<=Fb.indexOf(e)&&(g=function(){return function(){Db(a)}}());var f=Gb[e];if(f)if(!g)b=f(d[1],d[2],d[3]);else{if(!f(g,d[1],d[2],d[3]))break}else{var b=!1,h=Bb(d[1],a);if(h)if(f=Hb[e])b=f(h,d[2],d[3]);else{var k=h.exports;if(k&&(f=k[e]))if(b=!0,!g)b=f.call(h,d[2],d[3]);else if(!f.call(h,g,d[2],d[3]))break}}if(!b){u("Script error: "+e+(f?" failed":" unrecognized"));break}}c&&!c.length&&delete Eb[a];return b}l=v.prototype;
|
||||
l.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
l.ga=function(a,b,c){switch(b){case "clear":return this.I[b]||(this.I[b]=c,c.onclick=function(a){return function(){a.I.print&&(a.I.print.value="")}}(this)),!0;case "print":return this.I[b]||(this.oa=this.I[b]=c,c.value="",this.i=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),this.da=function(a){this.i(a,this.Ka)}),!0;default:return!1}};l.log=function(){};l.i=function(){};
|
||||
l.status=function(a){this.i(this.Ka+": "+a)};l.da=function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)};function Ib(a,b){a.v.error=!0;a.da(b)}function Jb(a){return a.v.error?(a.i(a.toString()+" error"),!0):!1}function Kb(a,b){b&&(a.v.ready?b():a.Ma=b);return a.v.ready}function A(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.Ma;a.Ma=null;b&&b()}}function Lb(a,b){a.v.Fa&&(b?a.v.Xa=!0:void 0===b&&a.i(a.toString()+" busy"));return a.v.Fa}
|
||||
l.status=function(a){this.i(this.Ka+": "+a)};l.da=function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)};function Ib(a,b){a.v.error=!0;a.da(b)}function Jb(a){return a.v.error?(a.i(a.toString()+" error"),!0):!1}function Kb(a,b){b&&(a.v.ready?b():a.Na=b);return a.v.ready}function B(a){if(!a.v.error&&(a.v.ready=!0,a.v.ready)){var b=a.Na;a.Na=null;b&&b()}}function Lb(a,b){a.v.Fa&&(b?a.v.Xa=!0:void 0===b&&a.i(a.toString()+" busy"));return a.v.Fa}
|
||||
function Mb(a,b){if(a.v.Xa)return a.v.Fa=!1,a.v.Xa=!1;if(a.v.error)return a.i(a.toString()+" error"),!1;a.v.Fa=b;return a.v.Fa}l.pa=function(){return this.v.U=!0};l.fa=function(a,b){b&&(this.v.U=!1);return!0};function Nb(a,b){if(a.C){a===a.C?b|=0:b=b||a.X;var c=a.C.X&b;return!!b&&c===b||!!(c&a.C.nb)}return!1}function Ob(a,b,c,d){a.C&&(!0===c||Nb(a,c|0))&&a.C.message(b,d)}
|
||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]),window.PCjs.Commands||(window.PCjs.Commands={}));
|
||||
var wb=window?window.PCjs.Machines:{},w=window?window.PCjs.Components:[],Eb=window?window.PCjs.Commands:{},Fb=["hold","sleep","wait"],Gb={alert:function(a){u(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},Hb={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
|
||||
var ob=window?window.PCjs.Machines:{},w=window?window.PCjs.Components:[],Eb=window?window.PCjs.Commands:{},Fb=["hold","sleep","wait"],Gb={alert:function(a){u(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},Hb={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
|
||||
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 y="pdp10",Pb="PDPjs",Qb=Math.pow(2,18),Rb=Math.pow(2,18)-1,E=Math.pow(2,36),F=Math.pow(2,36)-1,G=Math.pow(2,18),H=Math.pow(2,18)-1,Sb=Math.pow(2,17)-1,Tb=Math.pow(2,35)-1,Ub=Math.pow(2,35),Vb=Math.pow(2,36),I=Math.pow(2,32),Wb=Math.pow(2,21),Xb=Math.pow(2,26),Yb=Math.pow(2,23),Zb=Math.pow(2,30),y="pdp10",Pb="PDPjs",K={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,paper:4096,read:16384,write:32768,serial:1048576,timer:2097152,speaker:16777216,
|
||||
computer:33554432,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||
function $b(a,b){v.call(this,"Panel",a,512);this.L=this.M=0;this.W=b;this.f=this.J=this.w=this.A=0;this.N=this.O=-1;this.P=this.R=this.H=!1;this.S=ac;this.D={};this.b={START:[1,1,!0,!1,this.Nb],STEP:[1,1,!1,!1,this.Ob],ENABLE:[1,1,!1,!1,this.Ib],CONT:[1,1,!0,!1,this.Gb],DEP:[0,0,!0,!1,this.Hb],EXAM:[1,1,!0,!1,this.Jb],LOAD:[1,1,!0,!1,this.Lb],TEST:[0,0,!0,!1,this.Kb]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Mb,a];this.C=this.u=this.G=this.F=null;this.exports={hold:this.Eb,toggle:this.Xb,reset:this.Tb,
|
||||
set:this.Wb};A(this)}p($b,v);l=$b.prototype;l.reset=function(a){this.stop();a&&bc(this,this.A=0)};
|
||||
l.ga=function(a,b,c,d){if(this.F&&this.F.ga(a,b,c,d)||this.u&&this.u.ga(a,b,c,d)||this.C&&this.C.ga(a,b,c,d))return!0;switch(b){case "PC":return this.I[b]=c,this.M++,!0;default:return"led"==a||"rled"==a?(this.I[b]=c,this.D[b]=d?1:0,this.M++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.I[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){cc(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){dc(a,b)}}(this,b),a.ontouchstart=
|
||||
function(a,b){return function(c){cc(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){dc(a,b)}}(this,b),!0):v.prototype.ga.call(this,a,b,c,d)}};l.wa=function(a,b,c,d){this.F=a;this.G=b;this.u=c;this.C=d;ec(this);fc(this)};l.pa=function(a,b){if(!b)if(this.W&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};l.fa=function(a){return a?this.save():!0};l.save=function(){var a=new L(this);a.set(0,[this.f,this.A,this.w]);return a.data()};
|
||||
l.restore=function(a){if(a=a[0])hc(this,this.f=a[0]),bc(this,this.A=a[1]),ic(this,a[2]);return!0};l.Tb=function(){for(var a in this.b){var b=this.b[a];b[1]=b[0]}fc(this);return!0};function jc(a,b,c){if(a=a.I[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.D)jc(a,c,null!=b?b:a.D[c])}function kc(a,b,c){if(a=a.I[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function fc(a){for(var b in a.b)kc(a,b,a.b[b][1])}
|
||||
l.Eb=function(a,b,c){if(cc(this,b)){if(c){var d=this;setTimeout(function(){dc(d,b);a&&a()},+c);return!1}dc(this,b)}return!0};l.Wb=function(a,b){if("SR"==a)return ic(this,ta(b,8));var c=this.b[a];return c?(c[1]=+b?1:0,kc(this,a,c[1]),!0):!1};l.Xb=function(a){return cc(this,a)?(dc(this,a),!0):!1};function cc(a,b){var c=a.b[b];return c?(kc(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=lc&&(a.P=b==tc,a.R=b==uc),!0):!1}
|
||||
function dc(a,b){var c=a.b[b];c&&(c[2]&&c[3]&&(kc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}l.Nb=function(a){a||this.u.v.K||(this.u.w=this.f%Qb,this.b[vc]&&this.b[vc][1]&&wc(this.u))};l.Ob=function(){};l.Ib=function(a){a||this.u.V()};
|
||||
l.Gb=function(a){if(!a&&!this.u.v.K)if(this.b[vc]&&this.b[vc][1])wc(this.u);else{if((a=this.C)&&!Lb(a,!0))Mb(a,!0),xc(a,0,null),Mb(a,!1);else try{var b=this.u.Ja(1);0<b&&(yc(this.u,b),zc(this.u,b,!0),Ac(this.u,b))}catch(c){"number"!=typeof c&&Ib(this.u,c.stack||c.message)}this.stop();this.F&&M(this.F)}};l.Hb=function(a){a&&!this.u.v.K&&(this.P&&Bc(this),a=bc(this,this.A=this.w),this.S==ac?Cc(this.G,this.f,a):this.u.j(this.f,a))};
|
||||
l.Jb=function(a){if(!a&&!this.u.v.K){var b;this.R&&Bc(this);this.S==ac?b=Dc(this.G,this.f):b=this.u.g(this.f);bc(this,this.A=b)}};l.Lb=function(a){a||this.u.v.K||hc(this,this.w)};l.Kb=function(a){a?(this.H=!0,ec(this,!0)):(this.H=!1,ec(this),ic(this,0))};l.Mb=function(a,b){this.w=a?this.w|1<<b:this.w&~(1<<b)};function Bc(a){var b=1,c=a.G.w;a.b[lc]&&a.b[lc][1]||(b=-b);hc(a,a.f&~c|a.f+b&c)}
|
||||
function hc(a,b){a.f=b&a.G.w;if(a.N!==a.f){a.N=a.f;b=a.N;for(var c=0;22>c;c++){var d=a,e="A"+c,g=b&1<<c;d.D[e]=g;d.H||jc(d,e,g)}}}function bc(a,b){a.J=b%E;if(a.O!==a.J){a.O=a.J;b=a.O;for(var c=0;16>c;c++){var d=a,e="D"+c,g=b&1<<c;d.D[e]=g;d.H||jc(d,e,g)}}return a.J}function ic(a,b){a.w=b|0;for(b=0;22>b;b++)a.b["S"+b][1]=a.w&1<<b?1:0;fc(a);return!0}l.stop=function(){hc(this,this.u.w)};
|
||||
function gc(){for(var a=z(document,y,"panel"),b=0;b<a.length;b++){var c=a[b],d=x(c),e=Ab(d.id);e||(e=new $b(d,!0));Cb(e,c)}}var ac=7,tc="DEP",vc="ENABLE",uc="EXAM",lc="STEP";eb(gc);function Ec(a,b,c){v.call(this,"Bus",a,16);this.u=b;this.C=c;this.J=+a.busWidth||18;this.H=1<<this.J;this.w=this.H-1;this.f=Math.log2(16384);this.D=this.H/16384|0;this.A=0;this.b=[];a=new Fc(this);Gc(a,this.C);this.b=Array(this.D);for(b=0;b<this.D;b++)this.b[b]=a;A(this)}p(Ec,v);l=Ec.prototype;l.reset=function(){};
|
||||
l.pa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.fa=function(a){return a?this.save():!0};l.save=function(){var a=new L(this);a.set(0,Hc(this));return a.data()};l.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&4096>d.length){for(var e=0,g=Array(4096),f=0;f<d.length-1;)for(var h=d[f++],k=d[f++];h--;)g[e++]=k;d=g}e=this.b[c];if(!e||!e.restore(d)){u("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
||||
function Ic(a,b,c,d){for(var e=b,g=c,f=e>>>a.f;0<g&&f<a.b.length;){var h=a.b[f],k=16384*f,m=16384-(e-k);m>g&&(m=g);if(h&&h.size){if(h.type==d){if(e+g<=h.B)return h.Ha+=h.B-e,h.B=e,!0;if(e>=h.B+h.Ha){m=h.size-(e-k);m>g&&(m=g);h.Ha=e-h.B+m;e=k+16384;g-=m;f++;continue}}return Jc(Kc,e,g)}e=new Fc(a,e,m,16384,d);Gc(e,a.C,h);a.b[f++]=e;e=k+16384;g-=m}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Lc[d]+" at "+va(b)),!0):Jc(Mc,b,c)}
|
||||
function Dc(a,b){var c=a.b[(b&a.w)>>>a.f];a.A++;b=c.G(b&16383,b);a.A--;return b}function Cc(a,b,c){var d=a.b[(b&a.w)>>>a.f];a.A++;d.F(c,b&16383,b);a.A--}function Hc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.b[d];if(e.Za||e.Cb){c[b++]=d;var g=b++;if(e=e.save()){for(var f=0,h=0,k=[];f<e.length;){for(var m=e[f],n=f+1;n<e.length&&e[n]===m;)n++;k[h++]=n-f;k[h++]=m;f=n}k.length<e.length&&(e=k)}c[g]=e}}return c}
|
||||
l.Db=function(a){this.A||(this.C&&Nb(this.C,4)&&Ob(this.C,"memory fault on "+N(this.C,a),!0,!0),this.u.V())};function Jc(a,b,c){u("Memory block error ("+a+": "+t(b)+","+t(c)+")");return!1}var Kc=1,Mc=2;function Nc(a){v.call(this,"Device",a,256)}p(Nc,v);l=Nc.prototype;l.wa=function(a,b,c,d){this.G=b;this.F=a;this.u=c;this.C=d;A(this)};l.pa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.fa=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){return(new L(this)).data()};
|
||||
l.restore=function(){return!0};eb(function(){for(var a=z(document,y,"device"),b=0;b<a.length;b++){var c,d=a[b];c=x(d);switch(c.type){case "default":c=new Nc(c),Cb(c,d)}}});function Fc(a,b,c,d,e){this.w=a;this.id=Oc+=2;this.B=b;this.Ha=c;this.size=d||0;this.type=e||Pc;this.I=e==Qc;this.b=null;this.g=this.G=this.ab;this.j=this.F=this.Ia;this.f=this.u=0;Gc(this);this.Za=this.Cb=!1;if(this.size){a=this.C=Array(this.size);for(b=0;b<a.length;b++)a[b]=0;Rc(this,Sc)}else Rc(this)}l=Fc.prototype;l.save=function(){return this.C};
|
||||
l.restore=function(a){return a&&this.size==a.length?(this.C=a,this.Za=!0):!1};function Rc(a,b){b||(b=Tc);Uc(a,b,void 0);Vc(a,b,void 0)}function Uc(a,b,c){c&&a.f||(a.g=b[0]||a.ab);if(c||void 0===c)a.G=b[0]||a.ab}function Vc(a,b,c){c&&a.u||(a.j=!a.I&&b[1]||a.Ia);if(c||void 0===c)a.F=b[1]||a.Ia}l.Da=function(a,b){b?this.u++||Vc(this,Wc,!1):this.f++||Uc(this,Wc,!1)};function Xc(a,b){b?--a.u||(a.j=a.I?a.Ia:a.F):--a.f||(a.g=a.G)}
|
||||
function Gc(a,b,c){a.b=b;a.f=a.u=0;c&&((a.f=c.f)&&Uc(a,Wc,!1),(a.u=c.u)&&Vc(a,Wc,!1))}l.ab=function(a,b){this.b&&Nb(this.b,32)&&Ob(this.b,"attempt to read invalid address "+N(this.b,b),!0);this.w.Db(b);return-1};l.Ia=function(a,b,c){this.b&&Nb(this.b,32)&&Ob(this.b,"attempt to write "+N(this.b,a)+" to invalid addresses "+N(this.b,c),!0)};l.Rb=function(a){return this.C[a]};l.$b=function(a,b){this.C[b]!=a&&(this.C[b]=a,this.Za=!0)};
|
||||
l.Pb=function(a,b){if(this.b&&null!=this.B){var c=this.b;Yc(c,this.B+a,2,c.M)&&c.V(!1)}return this.G(a,b)};l.Zb=function(a,b,c){if(this.b&&null!=this.B){var d=this.b;Yc(d,this.B+b,2,d.J)&&d.V(!1)}this.I?this.Ia(a,0,c):this.F(a,b,c)};var Pc=0,Qc=2,Lc=["NONE","RAM","ROM"],Oc=0,Tc=[],Sc=[Fc.prototype.Rb,Fc.prototype.$b],Wc=[Fc.prototype.Pb,Fc.prototype.Zb];
|
||||
function Zc(a,b){v.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Qa=0;this.Va=b;this.aa=c;this.Ta=Math.round(this.Va/1E4)/100;this.W=this.Ta*this.aa;this.Ua=this.va=this.ba=this.Aa=0;this.v.K=this.v.Pa=!1;this.v.Z=a.autoStart;"string"==typeof this.v.Z&&(this.v.Z="true"==this.v.Z);this.v.Ea=!1;this.ta=this.ia=0;this.ua=+a.csStart;this.ha=+a.csInterval;this.ja=+a.csStop;this.M=[];this.kb=this.Ub.bind(this);this.R=this.L=this.O=this.P=this.J=this.sa=this.N=this.ka=this.Wa=this.S=0;
|
||||
this.ya=null;A(this)}p(Zc,v);l=Zc.prototype;l.wa=function(a,b,c,d){this.F=a;this.G=b;this.C=d;this.ya=a.w;for(a=0;a<$c.length;a++)(b=this.I[$c[a]])&&this.F.ga(null,$c[a],b);A(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
|
||||
l.pa=function(a,b){var c=ad(this.F,"autoStart");null!=c?this.v.Z="true"==c?!0:"false"==c?!1:!!c:null==this.v.Z&&(this.v.Z=!this.C&&void 0===this.I.run);if(!b){if(a){bd(this);if(!this.restore(a))return!1;cd(this)}else this.reset();this.C?(a=this.C,b=this.v.Z,a.ya=!0,a.i("Type ? for help with PDPjs Debugger commands"),dd(a),b||ed(a),a.ua&&(b=a.ua,a.ua=null,fd(a,b))):this.status("No debugger detected");this.v.Z||this.i("CPU will not be auto-started "+(this.ya?"(click Run to start)":"(type 'go' to start)"))}return!0};
|
||||
l.fa=function(a){return a?this.save():!0};l.Z=function(){return this.v.K?!0:this.v.Z?(wc(this),!0):!1};l.rb=function(){return 0};function cd(a){void 0===a.ua&&(a.ua=0);void 0===a.ha&&(a.ha=-1);void 0===a.ja&&(a.ja=-1);a.v.Ea=0<=a.ua&&0<a.ha;a.v.Ea&&(a.ta=0,a.ia=a.ua-a.R)}function Ac(a,b){if(a.v.Ea){var c=!1;a.ta=a.ta+a.rb()|0;a.ia-=b;0>=a.ia&&(a.ia+=a.ha,c=!0);0<=a.ja&&a.ja<=gd(a)&&(a.ha=a.ja=-1,cd(a),a.V(),c=!0);c&&a.i(gd(a)+" cycles: checksum="+t(a.ta))}}
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.F)if(a=d.F,a.v.U)a=!0;else{var b=null,c,h=zb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.v.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.v.U);c++);c==h.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.Ma?" (waiting for notification)":""))+".");a=!1}a&&(d.v.K?d.V():wc(d))},!0;case "speed":return this.I[b]=
|
||||
c,!0;case "setSpeed":return this.I[b]=c,c.onclick=function(){hd(d,d.aa<<1,!0)},c.textContent=this.W.toFixed(2)+"Mhz",!0}return!1};function zc(a,b,c){a.R+=b;c&&(a.O=a.P=0)}function id(a,b){var c=1;b&&1<a.aa&&a.S&&(c=a.S/a.Ta);a.Ua=Math.round(1E3/jd);a.va=Math.floor(a.Va/jd*c);b||(a.ba=a.va);a.Aa=0}function gd(a){return a.R+a.L+a.O-a.P}function bd(a){a.S=0;a.Wa=0;a.R=a.L=a.O=a.P=0;cd(a);hd(a,1)}
|
||||
function hd(a,b,c){var d=!1;if(void 0!==b){.8>a.S/a.W?b=1:d=!0;a.aa=b;b=a.Ta*a.aa;if(a.W!=b){a.W=b;b=a.W.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.F&&kd(a.F)}zc(a,a.L);a.L=0;a.J=xb();a.N=0;id(a);return d}function ld(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function md(a){for(var b=[],c=0;c<a.M.length;c++)b.push(a.M[c][0]);return b}
|
||||
function yc(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function nd(a,b){var c=a.O-=a.P;a.P=0;b&&(a.O=0);return c}
|
||||
l.Ub=function(){if(this.v.K){this.Aa>=this.Va&&id(this,!0);this.ka=0;this.sa=xb();if(this.N){var a=this.sa-this.N;a>this.Ua&&(this.J+=a,this.J>this.sa&&(this.J=this.sa))}try{do{var b=ld(this,this.v.Ea?1:this.va);try{this.Ja(b)}catch(e){if("number"!=typeof e)throw e;}b=nd(this,!0);this.ka+=b;this.L+=b;Ac(this,b);yc(this,b);this.ba-=b;if(0>=this.ba){this.ba+=this.va;++this.Wa>=Id&&(this.F&&M(this.F,void 0),this.Wa=0);break}}while(this.v.K)}catch(e){this.V();this.F&&this.F.stop(xb(),gd(this));Ib(this,
|
||||
e.stack||e.message);return}if(this.v.K){a=setTimeout;b=this.kb;this.N=xb();var c=this.Ua;this.ka&&(c=Math.round(c*this.ka/this.va));var c=c-(this.N-this.sa),d=this.N-this.J;d&&(this.S=Math.round(this.L/(10*d))/100,864E5<=d&&(this.R=0,hd(this)));if(0>c||this.S<this.W)-1E3>c&&(this.J-=c),c=0;this.Aa+=this.ka;this.N+=c;a(b,c)}}};
|
||||
function wc(a,b){if(!Jb(a))if(a.v.K)a.i(a.toString()+" busy");else{hd(a);a.v.K=!0;a.v.Pa=!0;var c=a.I.run;c&&(c.textContent="Halt");a.F&&(b&&kd(a.F,!0),a.F.start(a.J,gd(a)));a.C||a.status("Started");setTimeout(a.kb,0)}}l.Ja=function(){return 0};l.V=function(a){var b=!1;if(this.v.K){nd(this);zc(this,this.L);this.L=0;this.v.K=!1;if(b=this.I.run)b.textContent="Run";this.F&&this.F.stop(xb(),gd(this));b=!0;this.C||this.status("Stopped")}this.v.complete=a;return b};var jd=30,Id=15,$c=["power","reset"];
|
||||
function Jd(a){var b=+a.model||1001;Zc.call(this,a,1E6);this.jb=b;this.gb=+a.addrReset||0;this.Ab=Kd.bind(this);this.b=O.bind(this);this.la=null;this.fb=[];this.v.complete=!1}p(Jd,Zc);l=Jd.prototype;l.reset=function(){this.status("Model "+this.jb);this.v.K&&this.V();this.f=this.H=this.Ba=0;this.w=this.ra=this.gb;this.Ra=this.ib=this.za=this.ub=this.Sa=!1;this.D=-1;this.qa=this.w;this.A=0;this.g=this.Qb;this.j=this.ac;this.la=null;bd(this);this.v.error=!1;Zc.prototype.reset.call(this)};l.rb=function(){return 0};
|
||||
l.save=function(){var a=new L(this);a.set(0,[this.f,this.H,this.D,this.Ba,this.w,this.ra,this.qa,this.A]);a.set(1,[]);a.set(2,[this.R,this.aa,this.v.Z]);a.set(3,Ld(this));a.set(4,md(this));return a.data()};
|
||||
l.restore=function(a){var b;b=a[0];la();ia();la();var c=b[Symbol.iterator];b=c?c.call(b):ma(b);this.f=b.next().value;this.H=b.next().value;this.D=b.next().value;this.Ba=b.next().value;this.w=b.next().value;this.ra=b.next().value;this.qa=b.next().value;this.A=b.next().value;b=a[2];this.R=b[0];hd(this,b[1]);this.v.Z=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.fb.length;d++){var e=this.fb[d];if(e.Yb===b[c]){d=e;break a}}d=null}d&&(d.next=this.la,this.la=d)}a=a[4];for(b=0;b<this.M.length&&
|
||||
b<a.length;b++)this.M[b][0]=a[b];return!0};function Md(a,b){var c=a.w;a.w=(c+b)%Qb;return c}l.abs=function(a){a>Tb&&(a!=Ub?a=Vb-a:this.Ra=this.za=!0);return a};function Nd(a,b){b?b==Ub?a.Ra=a.za=!0:b=Vb-b:a.ib=a.za=!0;return b}function Ld(a){var b=[];for(a=a.la;a;)b.push(a.Yb),a=a.next;return b}l.Qb=function(a){var b=this.G;a=this.qa=a;return b.b[(a&b.w)>>>b.f].g(a&16383,a)};l.ac=function(a,b){var c=this.G;a=this.qa=a;c.b[(a&c.w)>>>c.f].j(b,a&16383,a);return b};
|
||||
l.Ja=function(a){this.v.complete=!0;var b=this.C?Od(this.C)?1:this.v.Pa?-1:0:0,c=a?this.v.Pa?0:1:-1;this.v.Pa=!1;this.O=this.P=a;this.A=this.A&-5|(b?4:0);do{if(this.A){if(this.A&4){if(Pd(this.C,this.w,c)){this.V();break}++b||(this.A&=-5);c||c++}if(a=this.A&11)this.A&2?this.la||(this.A&=-3):this.A&1&&this.A++,a=!1;if(a){if(this.A&4&&Pd(this.C,this.w,c)){this.V();break}if(0>c)break}}this.A&=15;this.H=this.H&4194304?this.g(this.f):this.Ba=this.g(this.ra=this.w);this.H&=8388607;this.f=this.H&262143;if(a=
|
||||
this.H>>18&15)this.f=this.f+this.g(a)&Rb;this.H&4194304?a=-1:(this.w=(this.w+1)%Qb,a=this.Ba/Yb|0);0<=a&&this.Ab(a)}while(0<this.P);return this.v.complete?this.O-this.P:!1===this.v.complete?-1:0};eb(function(){for(var a=z(document,y,"cpu"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Jd(d);Cb(d,c)}});function Kd(a){Qd[a>>4].call(this,a,a&15)}function Q(a){this.b(a)}
|
||||
function Rd(){var a=0,b=this.g(this.f),c=b/Zb&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*Zb+(d<<24)+(b&16777215);a&&(b=(b+a)%E);this.j(this.f,b)}function Sd(a,b){a=this.g(this.f);if(0>this.D)this.D=a,this.H=this.f|4194304,Md(this,-1);else{var c=this.D/Zb&63,d=this.D>>24&63;a=32>=c+d?(a>>c&(1<<d)-1)>>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.j(b,a);this.D=-1}}
|
||||
function Td(a,b){a=this.g(this.f);if(0>this.D)this.D=a,this.H=this.f|4194304,Md(this,-1);else{var c=this.D/Zb&63,d=this.D>>24&63;b=this.g(b)%Math.pow(2,d)*Math.pow(2,c)%E;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.j(this.f,a);this.D=-1}}function Ud(a,b){this.j(b,this.g(this.f))}function Vd(a,b){this.j(b,this.f)}function Wd(a,b){this.j(this.f,this.g(b))}function Xd(a,b){this.j(b,0)}function Yd(a,b){this.j(b,F-this.g(b))}function Zd(a,b){this.j(b,F)}
|
||||
function $d(a,b){var c=this.g(this.f),d=this.g(b);this.j(b,ae(a,d,c)+(c-(c&H)))}function be(a,b){var c=this.g(b);this.j(b,ae(a,c,0))}function ce(a,b){b=this.g(b);var c=this.g(this.f);this.j(this.f,ae(a,c,b)+(b-(b&H)))}function de(a,b){var c=this.g(this.f),d=c;if(a&=384)switch(d-=d&H,a){case 256:d+=H;break;case 384:d+=c>Tb?H:0}c=d;this.j(this.f,c);b&&this.j(b,c)}function ee(a,b){var c=(this.g(this.f)&H)*G,d=this.g(b);this.j(b,ae(a,d,c)+c)}
|
||||
function fe(a,b){var c=this.f*G,d=this.g(b);this.j(b,ae(a,d,c)+c)}function ge(a,b){b=(this.g(b)&H)*G;var c=this.g(this.f);this.j(this.f,ae(a,c,b)+b)}function he(a,b){var c=this.g(this.f),d=(c&H)*G,c=ae(a,c,d)+d;this.j(this.f,c);b&&this.j(b,c)}function ie(a,b){var c=this.g(this.f)&H,d=this.g(b);this.j(b,je(a,d,c)+c)}function ke(a,b){var c=this.g(b);this.j(b,je(a,c,this.f)+this.f)}function le(a,b){b=this.g(b)&H;var c=this.g(this.f);this.j(this.f,je(a,c,b)+b)}
|
||||
function me(a,b){var c=this.g(this.f),d=c;if(a&=384)switch(d&=H,a){case 256:d+=H*G;break;case 384:d+=c>Sb?H*G:0}c=d;this.j(this.f,c);b&&this.j(b,c)}function ne(a,b){var c=this.g(this.f)/G|0,d=this.g(b);this.j(b,je(a,d,c)+c)}function oe(a,b){var c=this.g(b);this.j(b,je(a,c,0))}function pe(a,b){b=this.g(b)/G|0;var c=this.g(this.f);this.j(this.f,je(a,c,b)+b)}function qe(a,b){var c=this.g(this.f),d=c/G|0,c=je(a,c,d)+d;this.j(this.f,c);b&&this.j(b,c)}function R(a){this.b(a)}function re(){}
|
||||
function O(a){this.i("undefined opcode: "+va(a));Md(this,-1);this.V()}function je(a,b,c){switch(a&384){case 0:b-=b&H;break;case 128:b=0;break;case 256:b=H*G;break;case 384:b=c>Sb?H*G:0}return b}function ae(a,b,c){switch(a&384){case 0:b&=H;break;case 128:b=0;break;case 256:b=H;break;case 384:b=c>Tb?H:0}return b}function S(a,b){return((a/I|0)&(b/I|0))*I+((a&b)>>>0)}function se(a,b){return((a/I|0)^(b/I|0))*I+((a^b)>>>0)}function te(a,b){return(~((a/I|0)^(b/I|0))&15)*I+(~(a^b)>>>0)}
|
||||
var y="pdp10",Pb="PDPjs",Qb=Math.pow(2,18),Rb=Math.pow(2,18)-1,Sb=Math.pow(2,35),Tb=Math.pow(2,35)-1,E=Math.pow(2,36),F=Math.pow(2,36)-1,G=Math.pow(2,18),H=Math.pow(2,18)-1,Ub=Math.pow(2,17)-1,Vb=Math.pow(2,35)-1,Wb=Math.pow(2,35),Xb=Math.pow(2,36),I=Math.pow(2,32),Yb=Math.pow(2,21),Zb=Math.pow(2,26),$b=Math.pow(2,23),ac=Math.pow(2,30),y="pdp10",Pb="PDPjs",K={cpu:1,trap:2,fault:4,"int":8,bus:16,memory:32,mmu:64,rom:128,device:256,panel:512,keyboard:1024,key:2048,paper:4096,read:16384,write:32768,
|
||||
serial:1048576,timer:2097152,speaker:16777216,computer:33554432,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};
|
||||
function bc(a,b){v.call(this,"Panel",a,512);this.L=this.M=0;this.W=b;this.f=this.J=this.w=this.A=0;this.N=this.O=-1;this.P=this.R=this.H=!1;this.S=cc;this.D={};this.b={START:[1,1,!0,!1,this.Nb],STEP:[1,1,!1,!1,this.Ob],ENABLE:[1,1,!1,!1,this.Ib],CONT:[1,1,!0,!1,this.Gb],DEP:[0,0,!0,!1,this.Hb],EXAM:[1,1,!0,!1,this.Jb],LOAD:[1,1,!0,!1,this.Lb],TEST:[0,0,!0,!1,this.Kb]};for(a=0;22>a;a++)this.b["S"+a]=[0,0,!1,!1,this.Mb,a];this.C=this.u=this.G=this.F=null;this.exports={hold:this.Eb,toggle:this.Xb,reset:this.Tb,
|
||||
set:this.Wb};B(this)}p(bc,v);l=bc.prototype;l.reset=function(a){this.stop();a&&dc(this,this.A=0)};
|
||||
l.ga=function(a,b,c,d){if(this.F&&this.F.ga(a,b,c,d)||this.u&&this.u.ga(a,b,c,d)||this.C&&this.C.ga(a,b,c,d))return!0;switch(b){case "PC":return this.I[b]=c,this.M++,!0;default:return"led"==a||"rled"==a?(this.I[b]=c,this.D[b]=d?1:0,this.M++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.I[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ec(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){fc(a,b)}}(this,b),a.ontouchstart=
|
||||
function(a,b){return function(c){ec(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){fc(a,b)}}(this,b),!0):v.prototype.ga.call(this,a,b,c,d)}};l.xa=function(a,b,c,d){this.F=a;this.G=b;this.u=c;this.C=d;gc(this);hc(this)};l.pa=function(a,b){if(!b)if(this.W&&ic(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};l.fa=function(a){return a?this.save():!0};l.save=function(){var a=new L(this);a.set(0,[this.f,this.A,this.w]);return a.data()};
|
||||
l.restore=function(a){if(a=a[0])jc(this,this.f=a[0]),dc(this,this.A=a[1]),kc(this,a[2]);return!0};l.Tb=function(){for(var a in this.b){var b=this.b[a];b[1]=b[0]}hc(this);return!0};function lc(a,b,c){if(a=a.I[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function gc(a,b){for(var c in a.D)lc(a,c,null!=b?b:a.D[c])}function mc(a,b,c){if(a=a.I[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hc(a){for(var b in a.b)mc(a,b,a.b[b][1])}
|
||||
l.Eb=function(a,b,c){if(ec(this,b)){if(c){var d=this;setTimeout(function(){fc(d,b);a&&a()},+c);return!1}fc(this,b)}return!0};l.Wb=function(a,b){if("SR"==a)return kc(this,ta(b,8));var c=this.b[a];return c?(c[1]=+b?1:0,mc(this,a,c[1]),!0):!1};l.Xb=function(a){return ec(this,a)?(fc(this,a),!0):!1};function ec(a,b){var c=a.b[b];return c?(mc(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=uc&&(a.P=b==vc,a.R=b==wc),!0):!1}
|
||||
function fc(a,b){var c=a.b[b];c&&(c[2]&&c[3]&&(mc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}l.Nb=function(a){a||this.u.v.K||(this.u.w=this.f%Qb,this.b[xc]&&this.b[xc][1]&&yc(this.u))};l.Ob=function(){};l.Ib=function(a){a||this.u.V()};
|
||||
l.Gb=function(a){if(!a&&!this.u.v.K)if(this.b[xc]&&this.b[xc][1])yc(this.u);else{if((a=this.C)&&!Lb(a,!0))Mb(a,!0),zc(a,0,null),Mb(a,!1);else try{var b=this.u.Ja(1);0<b&&(Ac(this.u,b),Bc(this.u,b,!0),Cc(this.u,b))}catch(c){"number"!=typeof c&&Ib(this.u,c.stack||c.message)}this.stop();this.F&&M(this.F)}};l.Hb=function(a){a&&!this.u.v.K&&(this.P&&Dc(this),a=dc(this,this.A=this.w),this.S==cc?Ec(this.G,this.f,a):this.u.j(this.f,a))};
|
||||
l.Jb=function(a){if(!a&&!this.u.v.K){var b;this.R&&Dc(this);this.S==cc?b=Fc(this.G,this.f):b=this.u.g(this.f);dc(this,this.A=b)}};l.Lb=function(a){a||this.u.v.K||jc(this,this.w)};l.Kb=function(a){a?(this.H=!0,gc(this,!0)):(this.H=!1,gc(this),kc(this,0))};l.Mb=function(a,b){this.w=a?this.w|1<<b:this.w&~(1<<b)};function Dc(a){var b=1,c=a.G.w;a.b[uc]&&a.b[uc][1]||(b=-b);jc(a,a.f&~c|a.f+b&c)}
|
||||
function jc(a,b){a.f=b&a.G.w;if(a.N!==a.f){a.N=a.f;b=a.N;for(var c=0;22>c;c++){var d=a,e="A"+c,g=b&1<<c;d.D[e]=g;d.H||lc(d,e,g)}}}function dc(a,b){a.J=b%E;if(a.O!==a.J){a.O=a.J;b=a.O;for(var c=0;16>c;c++){var d=a,e="D"+c,g=b&1<<c;d.D[e]=g;d.H||lc(d,e,g)}}return a.J}function kc(a,b){a.w=b|0;for(b=0;22>b;b++)a.b["S"+b][1]=a.w&1<<b?1:0;hc(a);return!0}l.stop=function(){jc(this,this.u.w)};
|
||||
function ic(){for(var a=z(document,y,"panel"),b=0;b<a.length;b++){var c=a[b],d=x(c),e=Ab(d.id);e||(e=new bc(d,!0));Cb(e,c)}}var cc=7,vc="DEP",xc="ENABLE",wc="EXAM",uc="STEP";eb(ic);function Gc(a,b,c){v.call(this,"Bus",a,16);this.u=b;this.C=c;this.J=+a.busWidth||18;this.H=1<<this.J;this.w=this.H-1;this.f=Math.log2(16384);this.D=this.H/16384|0;this.A=0;this.b=[];a=new Hc(this);Ic(a,this.C);this.b=Array(this.D);for(b=0;b<this.D;b++)this.b[b]=a;B(this)}p(Gc,v);l=Gc.prototype;l.reset=function(){};
|
||||
l.pa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.fa=function(a){return a?this.save():!0};l.save=function(){var a=new L(this);a.set(0,Jc(this));return a.data()};l.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&4096>d.length){for(var e=0,g=Array(4096),f=0;f<d.length-1;)for(var h=d[f++],k=d[f++];h--;)g[e++]=k;d=g}e=this.b[c];if(!e||!e.restore(d)){u("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
||||
function Kc(a,b,c,d){for(var e=b,g=c,f=e>>>a.f;0<g&&f<a.b.length;){var h=a.b[f],k=16384*f,m=16384-(e-k);m>g&&(m=g);if(h&&h.size){if(h.type==d){if(e+g<=h.B)return h.Ha+=h.B-e,h.B=e,!0;if(e>=h.B+h.Ha){m=h.size-(e-k);m>g&&(m=g);h.Ha=e-h.B+m;e=k+16384;g-=m;f++;continue}}return Lc(Mc,e,g)}e=new Hc(a,e,m,16384,d);Ic(e,a.C,h);a.b[f++]=e;e=k+16384;g-=m}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Nc[d]+" at "+va(b)),!0):Lc(Oc,b,c)}
|
||||
function Fc(a,b){var c=a.b[(b&a.w)>>>a.f];a.A++;b=c.G(b&16383,b);a.A--;return b}function Ec(a,b,c){var d=a.b[(b&a.w)>>>a.f];a.A++;d.F(c,b&16383,b);a.A--}function Jc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.b[d];if(e.Za||e.Cb){c[b++]=d;var g=b++;if(e=e.save()){for(var f=0,h=0,k=[];f<e.length;){for(var m=e[f],n=f+1;n<e.length&&e[n]===m;)n++;k[h++]=n-f;k[h++]=m;f=n}k.length<e.length&&(e=k)}c[g]=e}}return c}
|
||||
l.Db=function(a){this.A||(this.C&&Nb(this.C,4)&&Ob(this.C,"memory fault on "+N(this.C,a),!0,!0),this.u.V())};function Lc(a,b,c){u("Memory block error ("+a+": "+t(b)+","+t(c)+")");return!1}var Mc=1,Oc=2;function Pc(a){v.call(this,"Device",a,256)}p(Pc,v);l=Pc.prototype;l.xa=function(a,b,c,d){this.G=b;this.F=a;this.u=c;this.C=d;B(this)};l.pa=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};l.fa=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){return(new L(this)).data()};
|
||||
l.restore=function(){return!0};eb(function(){for(var a=z(document,y,"device"),b=0;b<a.length;b++){var c,d=a[b];c=x(d);switch(c.type){case "default":c=new Pc(c),Cb(c,d)}}});function Hc(a,b,c,d,e){this.w=a;this.id=Qc+=2;this.B=b;this.Ha=c;this.size=d||0;this.type=e||Rc;this.I=e==Sc;this.b=null;this.g=this.G=this.ab;this.j=this.F=this.Ia;this.f=this.u=0;Ic(this);this.Za=this.Cb=!1;if(this.size){a=this.C=Array(this.size);for(b=0;b<a.length;b++)a[b]=0;Tc(this,Uc)}else Tc(this)}l=Hc.prototype;l.save=function(){return this.C};
|
||||
l.restore=function(a){return a&&this.size==a.length?(this.C=a,this.Za=!0):!1};function Tc(a,b){b||(b=Vc);Wc(a,b,void 0);Xc(a,b,void 0)}function Wc(a,b,c){c&&a.f||(a.g=b[0]||a.ab);if(c||void 0===c)a.G=b[0]||a.ab}function Xc(a,b,c){c&&a.u||(a.j=!a.I&&b[1]||a.Ia);if(c||void 0===c)a.F=b[1]||a.Ia}l.Da=function(a,b){b?this.u++||Xc(this,Yc,!1):this.f++||Wc(this,Yc,!1)};function Zc(a,b){b?--a.u||(a.j=a.I?a.Ia:a.F):--a.f||(a.g=a.G)}
|
||||
function Ic(a,b,c){a.b=b;a.f=a.u=0;c&&((a.f=c.f)&&Wc(a,Yc,!1),(a.u=c.u)&&Xc(a,Yc,!1))}l.ab=function(a,b){this.b&&Nb(this.b,32)&&Ob(this.b,"attempt to read invalid address "+N(this.b,b),!0);this.w.Db(b);return-1};l.Ia=function(a,b,c){this.b&&Nb(this.b,32)&&Ob(this.b,"attempt to write "+N(this.b,a)+" to invalid addresses "+N(this.b,c),!0)};l.Rb=function(a){return this.C[a]};l.$b=function(a,b){this.C[b]!=a&&(this.C[b]=a,this.Za=!0)};
|
||||
l.Pb=function(a,b){if(this.b&&null!=this.B){var c=this.b;$c(c,this.B+a,2,c.M)&&c.V(!1)}return this.G(a,b)};l.Zb=function(a,b,c){if(this.b&&null!=this.B){var d=this.b;$c(d,this.B+b,2,d.J)&&d.V(!1)}this.I?this.Ia(a,0,c):this.F(a,b,c)};var Rc=0,Sc=2,Nc=["NONE","RAM","ROM"],Qc=0,Vc=[],Uc=[Hc.prototype.Rb,Hc.prototype.$b],Yc=[Hc.prototype.Pb,Hc.prototype.Zb];
|
||||
function ad(a,b){v.call(this,"CPU",a,1);b=+a.cycles||b;var c=+a.multiplier||1;this.Ra=0;this.Va=b;this.aa=c;this.Ta=Math.round(this.Va/1E4)/100;this.W=this.Ta*this.aa;this.Ua=this.wa=this.ba=this.Ba=0;this.v.K=this.v.Qa=!1;this.v.Z=a.autoStart;"string"==typeof this.v.Z&&(this.v.Z="true"==this.v.Z);this.v.Ea=!1;this.ua=this.ia=0;this.va=+a.csStart;this.ha=+a.csInterval;this.ja=+a.csStop;this.M=[];this.kb=this.Ub.bind(this);this.R=this.L=this.O=this.P=this.J=this.ta=this.N=this.ka=this.Wa=this.S=0;
|
||||
this.za=null;B(this)}p(ad,v);l=ad.prototype;l.xa=function(a,b,c,d){this.F=a;this.G=b;this.C=d;this.za=a.w;for(a=0;a<bd.length;a++)(b=this.I[bd[a]])&&this.F.ga(null,bd[a],b);B(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
|
||||
l.pa=function(a,b){var c=cd(this.F,"autoStart");null!=c?this.v.Z="true"==c?!0:"false"==c?!1:!!c:null==this.v.Z&&(this.v.Z=!this.C&&void 0===this.I.run);if(!b){if(a){dd(this);if(!this.restore(a))return!1;ed(this)}else this.reset();this.C?(a=this.C,b=this.v.Z,a.wa=!0,a.i("Type ? for help with PDPjs Debugger commands"),fd(a),b||gd(a),a.ua&&(b=a.ua,a.ua=null,hd(a,b))):this.status("No debugger detected");this.v.Z||this.i("CPU will not be auto-started "+(this.za?"(click Run to start)":"(type 'go' to start)"))}return!0};
|
||||
l.fa=function(a){return a?this.save():!0};l.Z=function(){return this.v.K?!0:this.v.Z?(yc(this),!0):!1};l.rb=function(){return 0};function ed(a){void 0===a.va&&(a.va=0);void 0===a.ha&&(a.ha=-1);void 0===a.ja&&(a.ja=-1);a.v.Ea=0<=a.va&&0<a.ha;a.v.Ea&&(a.ua=0,a.ia=a.va-a.R)}function Cc(a,b){if(a.v.Ea){var c=!1;a.ua=a.ua+a.rb()|0;a.ia-=b;0>=a.ia&&(a.ia+=a.ha,c=!0);0<=a.ja&&a.ja<=id(a)&&(a.ha=a.ja=-1,ed(a),a.V(),c=!0);c&&a.i(id(a)+" cycles: checksum="+t(a.ua))}}
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.I[b]=c,!0;case "run":return this.I[b]=c,c.onclick=function(){var a;if(a=d.F)if(a=d.F,a.v.U)a=!0;else{var b=null,c,h=zb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.v.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.v.U);c++);c==h.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.v.ready?"powered yet":"ready yet"+(b.Na?" (waiting for notification)":""))+".");a=!1}a&&(d.v.K?d.V():yc(d))},!0;case "speed":return this.I[b]=
|
||||
c,!0;case "setSpeed":return this.I[b]=c,c.onclick=function(){jd(d,d.aa<<1,!0)},c.textContent=this.W.toFixed(2)+"Mhz",!0}return!1};function Bc(a,b,c){a.R+=b;c&&(a.O=a.P=0)}function kd(a,b){var c=1;b&&1<a.aa&&a.S&&(c=a.S/a.Ta);a.Ua=Math.round(1E3/ld);a.wa=Math.floor(a.Va/ld*c);b||(a.ba=a.wa);a.Ba=0}function id(a){return a.R+a.L+a.O-a.P}function dd(a){a.S=0;a.Wa=0;a.R=a.L=a.O=a.P=0;ed(a);jd(a,1)}
|
||||
function jd(a,b,c){var d=!1;if(void 0!==b){.8>a.S/a.W?b=1:d=!0;a.aa=b;b=a.Ta*a.aa;if(a.W!=b){a.W=b;b=a.W.toFixed(2)+"Mhz";var e=a.I.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.F&&md(a.F)}Bc(a,a.L);a.L=0;a.J=xb();a.N=0;kd(a);return d}function nd(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function od(a){for(var b=[],c=0;c<a.M.length;c++)b.push(a.M[c][0]);return b}
|
||||
function Ac(a,b){for(var c=a.M.length-1;0<=c;c--){var d=a.M[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Jd(a,b){var c=a.O-=a.P;a.P=0;b&&(a.O=0);return c}
|
||||
l.Ub=function(){if(this.v.K){this.Ba>=this.Va&&kd(this,!0);this.ka=0;this.ta=xb();if(this.N){var a=this.ta-this.N;a>this.Ua&&(this.J+=a,this.J>this.ta&&(this.J=this.ta))}try{do{var b=nd(this,this.v.Ea?1:this.wa);try{this.Ja(b)}catch(e){if("number"!=typeof e)throw e;}b=Jd(this,!0);this.ka+=b;this.L+=b;Cc(this,b);Ac(this,b);this.ba-=b;if(0>=this.ba){this.ba+=this.wa;++this.Wa>=Kd&&(this.F&&M(this.F,void 0),this.Wa=0);break}}while(this.v.K)}catch(e){this.V();this.F&&this.F.stop(xb(),id(this));Ib(this,
|
||||
e.stack||e.message);return}if(this.v.K){a=setTimeout;b=this.kb;this.N=xb();var c=this.Ua;this.ka&&(c=Math.round(c*this.ka/this.wa));var c=c-(this.N-this.ta),d=this.N-this.J;d&&(this.S=Math.round(this.L/(10*d))/100,864E5<=d&&(this.R=0,jd(this)));if(0>c||this.S<this.W)-1E3>c&&(this.J-=c),c=0;this.Ba+=this.ka;this.N+=c;a(b,c)}}};
|
||||
function yc(a,b){if(!Jb(a))if(a.v.K)a.i(a.toString()+" busy");else{jd(a);a.v.K=!0;a.v.Qa=!0;var c=a.I.run;c&&(c.textContent="Halt");a.F&&(b&&md(a.F,!0),a.F.start(a.J,id(a)));a.C||a.status("Started");setTimeout(a.kb,0)}}l.Ja=function(){return 0};l.V=function(a){var b=!1;if(this.v.K){Jd(this);Bc(this,this.L);this.L=0;this.v.K=!1;if(b=this.I.run)b.textContent="Run";this.F&&this.F.stop(xb(),id(this));b=!0;this.C||this.status("Stopped")}this.v.complete=a;return b};var ld=30,Kd=15,bd=["power","reset"];
|
||||
function Ld(a){var b=+a.model||1001;ad.call(this,a,1E6);this.jb=b;this.gb=+a.addrReset||0;this.Ab=Md.bind(this);this.b=O.bind(this);this.qa=null;this.fb=[];this.v.complete=!1}p(Ld,ad);l=Ld.prototype;l.reset=function(){this.status("Model "+this.jb);this.v.K&&this.V();this.f=this.H=this.Ma=0;this.w=this.sa=this.gb;this.la=this.ib=this.Aa=this.ub=this.Sa=!1;this.D=-1;this.ra=this.w;this.A=0;this.g=this.Qb;this.j=this.ac;this.qa=null;dd(this);this.v.error=!1;ad.prototype.reset.call(this)};l.rb=function(){return 0};
|
||||
l.save=function(){var a=new L(this);a.set(0,[this.f,this.H,this.D,this.Ma,this.w,this.sa,this.ra,this.A]);a.set(1,[]);a.set(2,[this.R,this.aa,this.v.Z]);a.set(3,Nd(this));a.set(4,od(this));return a.data()};
|
||||
l.restore=function(a){var b;b=a[0];la();ia();la();var c=b[Symbol.iterator];b=c?c.call(b):ma(b);this.f=b.next().value;this.H=b.next().value;this.D=b.next().value;this.Ma=b.next().value;this.w=b.next().value;this.sa=b.next().value;this.ra=b.next().value;this.A=b.next().value;b=a[2];this.R=b[0];jd(this,b[1]);this.v.Z=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.fb.length;d++){var e=this.fb[d];if(e.Yb===b[c]){d=e;break a}}d=null}d&&(d.next=this.qa,this.qa=d)}a=a[4];for(b=0;b<this.M.length&&
|
||||
b<a.length;b++)this.M[b][0]=a[b];return!0};function Od(a,b){var c=a.w;a.w=(c+b)%Qb;return c}l.abs=function(a){a>Vb&&(a!=Wb?a=Xb-a:this.la=this.Aa=!0);return a};function Pd(a,b){b?b==Wb?a.la=a.Aa=!0:b=Xb-b:a.ib=a.Aa=!0;return b}function Nd(a){var b=[];for(a=a.qa;a;)b.push(a.Yb),a=a.next;return b}l.Qb=function(a){var b=this.G;a=this.ra=a;return b.b[(a&b.w)>>>b.f].g(a&16383,a)};l.ac=function(a,b){var c=this.G;a=this.ra=a;c.b[(a&c.w)>>>c.f].j(b,a&16383,a);return b};
|
||||
l.Ja=function(a){this.v.complete=!0;var b=this.C?Qd(this.C)?1:this.v.Qa?-1:0:0,c=a?this.v.Qa?0:1:-1;this.v.Qa=!1;this.O=this.P=a;this.A=this.A&-5|(b?4:0);do{if(this.A){if(this.A&4){if(Rd(this.C,this.w,c)){this.V();break}++b||(this.A&=-5);c||c++}if(a=this.A&11)this.A&2?this.qa||(this.A&=-3):this.A&1&&this.A++,a=!1;if(a){if(this.A&4&&Rd(this.C,this.w,c)){this.V();break}if(0>c)break}}this.A&=15;this.H=this.H&4194304?this.g(this.f):this.Ma=this.g(this.sa=this.w);this.H&=8388607;this.f=this.H&262143;if(a=
|
||||
this.H>>18&15)this.f=this.f+this.g(a)&Rb;this.H&4194304?a=-1:(this.w=(this.w+1)%Qb,a=this.Ma/$b|0);0<=a&&this.Ab(a)}while(0<this.P);return this.v.complete?this.O-this.P:!1===this.v.complete?-1:0};eb(function(){for(var a=z(document,y,"cpu"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Ld(d);Cb(d,c)}});function Md(a){Sd[a>>4].call(this,a,a&15)}function Q(a){this.b(a)}
|
||||
function Td(){var a=0,b=this.g(this.f),c=b/ac&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*ac+(d<<24)+(b&16777215);a&&(b=(b+a)%E);this.j(this.f,b)}function Ud(a,b){a=this.g(this.f);if(0>this.D)this.D=a,this.H=this.f|4194304,Od(this,-1);else{var c=this.D/ac&63,d=this.D>>24&63;a=32>=c+d?(a>>c&(1<<d)-1)>>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.j(b,a);this.D=-1}}
|
||||
function Vd(a,b){a=this.g(this.f);if(0>this.D)this.D=a,this.H=this.f|4194304,Od(this,-1);else{var c=this.D/ac&63,d=this.D>>24&63;b=this.g(b)%Math.pow(2,d)*Math.pow(2,c)%E;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.j(this.f,a);this.D=-1}}function Wd(a,b){this.j(b,this.g(this.f))}function Xd(a,b){this.j(b,this.f)}function Yd(a,b){this.j(this.f,this.g(b))}function Zd(a,b){this.j(b,0)}function $d(a,b){this.j(b,F-this.g(b))}function ae(a,b){this.j(b,F)}
|
||||
function be(a,b){var c=this.g(this.f),d=this.g(b);this.j(b,ce(a,d,c)+(c-(c&H)))}function de(a,b){var c=this.g(b);this.j(b,ce(a,c,0))}function ee(a,b){b=this.g(b);var c=this.g(this.f);this.j(this.f,ce(a,c,b)+(b-(b&H)))}function fe(a,b){var c=this.g(this.f),d=c;if(a&=384)switch(d-=d&H,a){case 256:d+=H;break;case 384:d+=c>Vb?H:0}c=d;this.j(this.f,c);b&&this.j(b,c)}function ge(a,b){var c=(this.g(this.f)&H)*G,d=this.g(b);this.j(b,ce(a,d,c)+c)}
|
||||
function he(a,b){var c=this.f*G,d=this.g(b);this.j(b,ce(a,d,c)+c)}function ie(a,b){b=(this.g(b)&H)*G;var c=this.g(this.f);this.j(this.f,ce(a,c,b)+b)}function je(a,b){var c=this.g(this.f),d=(c&H)*G,c=ce(a,c,d)+d;this.j(this.f,c);b&&this.j(b,c)}function ke(a,b){var c=this.g(this.f)&H,d=this.g(b);this.j(b,le(a,d,c)+c)}function me(a,b){var c=this.g(b);this.j(b,le(a,c,this.f)+this.f)}function ne(a,b){b=this.g(b)&H;var c=this.g(this.f);this.j(this.f,le(a,c,b)+b)}
|
||||
function oe(a,b){var c=this.g(this.f),d=c;if(a&=384)switch(d&=H,a){case 256:d+=H*G;break;case 384:d+=c>Ub?H*G:0}c=d;this.j(this.f,c);b&&this.j(b,c)}function pe(a,b){var c=this.g(this.f)/G|0,d=this.g(b);this.j(b,le(a,d,c)+c)}function qe(a,b){var c=this.g(b);this.j(b,le(a,c,0))}function re(a,b){b=this.g(b)/G|0;var c=this.g(this.f);this.j(this.f,le(a,c,b)+b)}function se(a,b){var c=this.g(this.f),d=c/G|0,c=le(a,c,d)+d;this.j(this.f,c);b&&this.j(b,c)}function R(a){this.b(a)}function te(){}
|
||||
function O(a){this.i("undefined opcode: "+va(a));Od(this,-1);this.V()}function le(a,b,c){switch(a&384){case 0:b-=b&H;break;case 128:b=0;break;case 256:b=H*G;break;case 384:b=c>Ub?H*G:0}return b}function ce(a,b,c){switch(a&384){case 0:b&=H;break;case 128:b=0;break;case 256:b=H;break;case 384:b=c>Vb?H:0}return b}function S(a,b){return((a/I|0)&(b/I|0))*I+((a&b)>>>0)}function ue(a,b){return((a/I|0)^(b/I|0))*I+((a^b)>>>0)}function ve(a,b){return(~((a/I|0)^(b/I|0))&15)*I+(~(a^b)>>>0)}
|
||||
function U(a,b){return(a/I|0|b/I|0)*I+((a|b)>>>0)}
|
||||
var Qd=[Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},Rd,function(a,b){0>this.D&&Rd.call(this);Sd.call(this,0,b)},Sd,function(a,b){0>this.D&&Rd.call(this);Td.call(this,0,b)},Td,function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
var Sd=[Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,Q,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},Td,function(a,b){0>this.D&&Td.call(this);Ud.call(this,0,b)},Ud,function(a,b){0>this.D&&Td.call(this);Vd.call(this,0,b)},Vd,function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},Ud,Vd,Wd,function(a,b){b&&this.j(b,this.g(this.f))},function(a,b){a=this.g(this.f);a=(a/G|0)+a%G*G;this.j(b,a)},function(a,b){this.j(b,this.f*G)},function(a,b){a=this.g(b);a=(a/G|0)+a%G*G;this.j(this.f,a)},function(a,b){a=this.g(this.f);a=(a/G|0)+a%G*G;this.j(this.f,a);b&&this.j(b,a)},function(a,b){this.j(b,Nd(this,this.g(this.f)))},function(a,b){this.j(b,this.f?Vb-this.f:0)},function(a,b){this.j(this.f,Nd(this,
|
||||
this.g(b)))},function(a,b){a=Nd(this,this.g(this.f));this.j(this.f,a);b&&this.j(b,a)},function(a,b){this.j(b,this.abs(this.g(this.f)))},function(a,b){this.j(b,this.f)},function(a,b){this.j(this.f,this.abs(this.g(b)))},function(a,b){a=this.abs(this.g(this.f));this.j(this.f,a);b&&this.j(b,a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a,b){if(a=(this.f<<14>>24)%36){var c=this.g(b),c=0<a?c*Math.pow(2,a)%E+Math.trunc(c/Math.pow(2,36-a)):Math.trunc(c/Math.pow(2,-a))+c*Math.pow(2,36+a)%E;this.j(b,c)}},function(a,b){if(a=this.f<<14>>24){var c=this.g(b),c=0<a?36<=a?0:c*Math.pow(2,a)%E:-36>=a?0:Math.trunc(c/Math.pow(2,-a));this.j(b,c)}},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a,b){if(a=(this.f<<14>>24)%72){var c=this.g(b),d=this.g(b+1&15),e=c;0<a?36>a?(c=c*Math.pow(2,a)%E+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%E+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%E+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%E+Math.trunc(d/Math.pow(2,72-a))):-36<a?(c=Math.trunc(c/Math.pow(2,-a))+d*Math.pow(2,36+a)%E,d=Math.trunc(d/Math.pow(2,-a))+e*Math.pow(2,36+a)%E):(c=Math.trunc(d/Math.pow(2,-a-36))+c*Math.pow(2,72+a)%E,d=Math.trunc(e/Math.pow(2,-a-36))+
|
||||
d*Math.pow(2,72+a)%E);this.j(b,c);this.j(b+1&15,d)}},function(a,b){if(a=this.f<<14>>24){var c=this.g(b),d=this.g(b+1&15);0<a?36<=a?(d=0,c=72<=a?0:d*Math.pow(2,a-36)%E):(c=c*Math.pow(2,a)%E+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%E):-36>=a?(c=0,d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36))):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%E,c=Math.trunc(c/Math.pow(2,-a)));this.j(b,c);this.j(b+1&15,d)}},O,function(a,b){a=this.g(b);this.j(b,this.g(this.f));this.j(this.f,a)},function(a,b){a=!1;
|
||||
for(var c=this.g(b),d=c/G|0,c=c&H;!a;)this.j(c,this.g(d)),c==this.f&&(a=!0),d=d+1&H,c=c+1&H,this.v.K||(this.j(b,d*G+c),a||Md(this,-1),a=!0)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},O,function(a){this.b(a)},function(a,b){a=this.g(b);a+=262145;this.j(a&H,this.g(this.f));a>=E&&(a-=E);a/G|0||(this.Sa=!0);this.j(b,a)},function(a,b){a=this.g(b);var c=this.g(a&H);this.j(this.f,c);this.f==b&&(a=c);a-=262145;0>a&&(a+=E);(a/G|0)==H&&
|
||||
(this.Sa=!0);this.j(b,a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},Wd,Xd,Yd,function(a,b){b&&this.j(b,this.g(this.f))},function(a,b){a=this.g(this.f);a=(a/G|0)+a%G*G;this.j(b,a)},function(a,b){this.j(b,this.f*G)},function(a,b){a=this.g(b);a=(a/G|0)+a%G*G;this.j(this.f,a)},function(a,b){a=this.g(this.f);a=(a/G|0)+a%G*G;this.j(this.f,a);b&&this.j(b,a)},function(a,b){this.j(b,Pd(this,this.g(this.f)))},function(a,b){this.j(b,this.f?Xb-this.f:0)},function(a,b){this.j(this.f,Pd(this,
|
||||
this.g(b)))},function(a,b){a=Pd(this,this.g(this.f));this.j(this.f,a);b&&this.j(b,a)},function(a,b){this.j(b,this.abs(this.g(this.f)))},function(a,b){this.j(b,this.f)},function(a,b){this.j(this.f,this.abs(this.g(b)))},function(a,b){a=this.abs(this.g(this.f));this.j(this.f,a);b&&this.j(b,a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a,b){var c=this.f<<14>>24;if(c){a=this.g(b);var d=a>Vb?-(E-a):a;0<c?(35<=c?(d=0>d?Sb:0,c=Tb):(d=d*Math.pow(2,c)%Sb,c=Sb-Math.pow(2,35-c)),a<=Vb?a+c>Vb&&(this.la=!0):a-c<=Vb&&(this.la=!0)):d=-35>=c?0>d?-1:0:Math.trunc(d/Math.pow(2,-c));a=0>d?d+E:d;this.j(b,a)}},function(a,b){if(a=(this.f<<14>>24)%36){var c=this.g(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%E+Math.trunc(c/
|
||||
Math.pow(2,36-a));this.j(b,c)}},function(a,b){if(a=this.f<<14>>24){var c=this.g(b),c=0<a?36<=a?0:c*Math.pow(2,a)%E:-36>=a?0:Math.trunc(c/Math.pow(2,-a));this.j(b,c)}},function(a){this.b(a)},function(a){this.b(a)},function(a,b){if(a=(this.f<<14>>24)%72){var c=this.g(b),d=this.g(b+1&15),e=c;0>a&&(a=72+a);36>a?(c=c*Math.pow(2,a)%E+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%E+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%E+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%E+Math.trunc(d/
|
||||
Math.pow(2,72-a)));this.j(b,c);this.j(b+1&15,d)}},function(a,b){if(a=this.f<<14>>24){var c=this.g(b),d=this.g(b+1&15);0<a?36<=a?(d=0,c=72<=a?0:d*Math.pow(2,a-36)%E):(c=c*Math.pow(2,a)%E+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%E):-36>=a?(c=0,d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36))):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%E,c=Math.trunc(c/Math.pow(2,-a)));this.j(b,c);this.j(b+1&15,d)}},O,function(a,b){a=this.g(b);this.j(b,this.g(this.f));this.j(this.f,a)},function(a,b){a=!1;for(var c=
|
||||
this.g(b),d=c/G|0,c=c&H;!a;)this.j(c,this.g(d)),c==this.f&&(a=!0),d=d+1&H,c=c+1&H,this.v.K||(this.j(b,d*G+c),a||Od(this,-1),a=!0)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},O,function(a){this.b(a)},function(a,b){a=this.g(b);a+=262145;this.j(a&H,this.g(this.f));a>=E&&(a-=E);a/G|0||(this.Sa=!0);this.j(b,a)},function(a,b){a=this.g(b);var c=this.g(a&H);this.j(this.f,c);this.f==b&&(a=c);a-=262145;0>a&&(a+=E);(a/G|0)==H&&(this.Sa=
|
||||
!0);this.j(b,a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},Xd,Xd,function(){this.j(this.f,0)},function(a,b){this.j(this.f,this.j(b,0))},function(a,b){this.j(b,S(this.g(b),this.g(this.f)))},function(a,b){this.j(b,S(this.g(b),this.f))},function(a,b){this.j(this.f,S(this.g(b),this.g(this.f)))},
|
||||
function(a,b){this.j(this.f,this.j(b,S(this.g(b),this.g(this.f))))},function(a,b){this.j(b,S(F-this.g(b),this.g(this.f)))},function(a,b){this.j(b,S(F-this.g(b),this.f))},function(a,b){this.j(this.f,S(F-this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,S(F-this.g(b),this.g(this.f))))},Ud,Vd,re,Ud,function(a,b){this.j(b,S(this.g(b),F-this.g(this.f)))},function(a,b){this.j(b,S(this.g(b),F-this.f))},function(a,b){this.j(this.f,S(this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,
|
||||
this.j(b,S(this.g(b),F-this.g(this.f))))},re,re,Wd,Wd,function(a,b){this.j(b,se(this.g(b),this.g(this.f)))},function(a,b){this.j(b,se(this.g(b),this.f))},function(a,b){this.j(this.f,se(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,se(this.g(b),this.g(this.f))))},function(a,b){this.j(b,U(this.g(b),this.g(this.f)))},function(a,b){this.j(b,U(this.g(b),this.f))},function(a,b){this.j(this.f,U(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(this.g(b),this.g(this.f))))},
|
||||
function(a,b){this.j(b,S(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(b,S(F-this.g(b),F-this.f))},function(a,b){this.j(this.f,S(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,S(F-this.g(b),F-this.g(this.f))))},function(a,b){this.j(b,te(this.g(b),this.g(this.f)))},function(a,b){this.j(b,te(this.g(b),this.f))},function(a,b){this.j(this.f,te(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,te(this.g(b),this.g(this.f))))},Yd,Yd,function(a,b){this.j(this.f,
|
||||
F-this.g(b))},function(a,b){this.j(this.f,this.j(b,F-this.g(b)))},function(a,b){this.j(b,U(F-this.g(b),this.g(this.f)))},function(a,b){this.j(b,U(F-this.g(b),this.f))},function(a,b){this.j(this.f,U(F-this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(F-this.g(b),this.g(this.f))))},function(a,b){this.j(b,F-this.g(this.f))},function(a,b){this.j(b,F-this.f)},function(){this.j(this.f,F-this.g(this.f))},function(a,b){this.j(this.f,this.j(b,F-this.g(this.f)))},function(a,b){this.j(b,U(this.g(b),
|
||||
F-this.g(this.f)))},function(a,b){this.j(b,U(this.g(b),F-this.f))},function(a,b){this.j(this.f,U(this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(this.g(b),F-this.g(this.f))))},function(a,b){this.j(b,U(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(b,U(F-this.g(b),F-this.f))},function(a,b){this.j(this.f,U(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(F-this.g(b),F-this.g(this.f))))},Zd,Zd,function(){this.j(this.f,F)},function(a,b){this.j(this.f,this.j(b,
|
||||
F))},$d,be,ce,de,ee,fe,ge,he,$d,be,ce,de,ee,fe,ge,he,$d,be,ce,de,ee,fe,ge,he,$d,be,ce,de,ee,fe,ge,he,ie,ke,le,me,ne,oe,pe,qe,ie,ke,le,me,ne,oe,pe,qe,ie,ke,le,me,ne,oe,pe,qe,ie,ke,le,me,ne,oe,pe,qe,function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},Zd,Zd,function(){this.j(this.f,0)},function(a,b){this.j(this.f,this.j(b,0))},function(a,b){this.j(b,S(this.g(b),this.g(this.f)))},function(a,b){this.j(b,S(this.g(b),this.f))},function(a,b){this.j(this.f,S(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,
|
||||
this.j(b,S(this.g(b),this.g(this.f))))},function(a,b){this.j(b,S(F-this.g(b),this.g(this.f)))},function(a,b){this.j(b,S(F-this.g(b),this.f))},function(a,b){this.j(this.f,S(F-this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,S(F-this.g(b),this.g(this.f))))},Wd,Xd,te,Wd,function(a,b){this.j(b,S(this.g(b),F-this.g(this.f)))},function(a,b){this.j(b,S(this.g(b),F-this.f))},function(a,b){this.j(this.f,S(this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,S(this.g(b),F-this.g(this.f))))},
|
||||
te,te,Yd,Yd,function(a,b){this.j(b,ue(this.g(b),this.g(this.f)))},function(a,b){this.j(b,ue(this.g(b),this.f))},function(a,b){this.j(this.f,ue(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,ue(this.g(b),this.g(this.f))))},function(a,b){this.j(b,U(this.g(b),this.g(this.f)))},function(a,b){this.j(b,U(this.g(b),this.f))},function(a,b){this.j(this.f,U(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(this.g(b),this.g(this.f))))},function(a,b){this.j(b,S(F-this.g(b),
|
||||
F-this.g(this.f)))},function(a,b){this.j(b,S(F-this.g(b),F-this.f))},function(a,b){this.j(this.f,S(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,S(F-this.g(b),F-this.g(this.f))))},function(a,b){this.j(b,ve(this.g(b),this.g(this.f)))},function(a,b){this.j(b,ve(this.g(b),this.f))},function(a,b){this.j(this.f,ve(this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,ve(this.g(b),this.g(this.f))))},$d,$d,function(a,b){this.j(this.f,F-this.g(b))},function(a,b){this.j(this.f,
|
||||
this.j(b,F-this.g(b)))},function(a,b){this.j(b,U(F-this.g(b),this.g(this.f)))},function(a,b){this.j(b,U(F-this.g(b),this.f))},function(a,b){this.j(this.f,U(F-this.g(b),this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(F-this.g(b),this.g(this.f))))},function(a,b){this.j(b,F-this.g(this.f))},function(a,b){this.j(b,F-this.f)},function(){this.j(this.f,F-this.g(this.f))},function(a,b){this.j(this.f,this.j(b,F-this.g(this.f)))},function(a,b){this.j(b,U(this.g(b),F-this.g(this.f)))},function(a,b){this.j(b,
|
||||
U(this.g(b),F-this.f))},function(a,b){this.j(this.f,U(this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(this.g(b),F-this.g(this.f))))},function(a,b){this.j(b,U(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(b,U(F-this.g(b),F-this.f))},function(a,b){this.j(this.f,U(F-this.g(b),F-this.g(this.f)))},function(a,b){this.j(this.f,this.j(b,U(F-this.g(b),F-this.g(this.f))))},ae,ae,function(){this.j(this.f,F)},function(a,b){this.j(this.f,this.j(b,F))},be,de,ee,fe,ge,he,ie,je,be,de,
|
||||
ee,fe,ge,he,ie,je,be,de,ee,fe,ge,he,ie,je,be,de,ee,fe,ge,he,ie,je,ke,me,ne,oe,pe,qe,re,se,ke,me,ne,oe,pe,qe,re,se,ke,me,ne,oe,pe,qe,re,se,ke,me,ne,oe,pe,qe,re,se,function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R];
|
||||
function ue(a){v.call(this,"ROM",a,128);this.T=this.b=null;this.D=+a.addr;this.w=+a.size;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.A=a.file;this.H=wa(this.A);if(this.A){a=this.A;var b=xa(this.H);"json"!=b&&"hex"!=b&&(a=Ea()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;La(a,null,!0,function(a,b,g){g?(c.da("Unable to load ROM resource (error "+g+": "+a+")"),c.A=null):(nb(c.La,a,b),(a=Ma(a,b))?(c.b=a.Y,c.T=a.T):c.A=null);ve(c)})}}p(ue,v);
|
||||
ue.prototype.wa=function(a,b,c,d){this.G=b;this.u=c;this.C=d;ve(this)};ue.prototype.pa=function(){this.T&&(this.C&&we(this.C,this.id,this.D,this.w,this.T),delete this.T);return!0};ue.prototype.fa=function(){return!0};
|
||||
function ve(a){if(!Kb(a)){if(a.A){if(!a.b||!a.G)return;a.w||(a.w=a.b.length);if(a.b.length!=a.w)Ib(a,"ROM size ("+t(a.b.length,8,!0)+") does not match specified size ("+t(a.w,8,!0)+")");else{var b;b=a.D;if(Ic(a.G,b,a.w,Qc)){var c;for(c=0;c<a.b.length;c++)Cc(a.G,b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],g=d.G,f=d.w,h=[],k=d.D>>>g.f;0<f&&k<g.b.length;)h.push(g.b[k++]),f-=16384;g=d.G;d=d.w;f=0;for(e>>>=
|
||||
g.f;0<d&&e<g.b.length;){k=h[f++];if(!k)break;g.b[e++]=k;d-=16384}}delete a.b}}}A(a)}}eb(function(){for(var a=z(document,y,"rom"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new ue(d);Cb(d,c)}});
|
||||
function xe(a){v.call(this,"RAM",a);this.T=this.Ca=null;this.f=+a.addr;this.w=+a.size;this.na=a.load;this.ma=a.exec;null!=this.na&&(this.na=+this.na);null!=this.ma&&(this.ma=+this.ma);this.A=this.H=!1;this.b=a.file;this.D=wa(this.b);if(this.b){a=this.b;var b=xa(this.D);"json"!=b&&"hex"!=b&&(a=Ea()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;La(a,null,!0,function(a,b,g){g?(c.da("Unable to load RAM resource (error "+g+": "+a+")"),c.b=null):(nb(c.La,a,b),(a=Ma(a,b))?(c.Ca=a.Ca,
|
||||
c.T=a.T,null==c.na&&(c.na=a.na),null==c.ma&&(c.ma=a.ma)):c.b=null);ye(c)})}}p(xe,v);xe.prototype.wa=function(a,b,c,d){this.G=b;this.u=c;this.C=d;ye(this)};xe.prototype.pa=function(a,b){this.T&&(this.C&&we(this.C,this.id,this.f,this.w,this.T),delete this.T);b||this.reset();return!0};xe.prototype.fa=function(){return!0};
|
||||
function ye(a){if(a.G&&(!a.A&&a.w&&(Ic(a.G,a.f,a.w,1)?a.A=!0:a.w=0),!Kb(a))){if(!a.A)u("No RAM allocated");else if(a.b){if(!a.Ca)return;ze(a,a.Ca,a.na,a.ma,a.f)?a.status('Loaded image "'+a.D+'"'):a.da('Error loading image "'+a.D+'"')}a.H=!0;A(a)}}
|
||||
xe.prototype.reset=function(){if(this.A&&!this.H){for(var a=this.G,b=this.f,c=this.w,d=b&16383,b=b>>>a.f;0<c&&b<a.b.length;){var e=a.b[b],g=c,f=0,h,d=d||0,f=f||0;0>f&&f>=sa&&(f+=ra);f=Math.trunc(Math.abs(f))%ra;void 0===g&&(g=e.size);for(h=d;g--&&h<e.size;h++)e.F(f,d,e.B+d);c-=16384;b++;d=0}this.Ca&&ze(this,this.Ca,this.na,this.ma,this.f,!this.C)}this.H=!1};
|
||||
function ze(a,b,c,d,e,g){var f=!1;null==c&&(c=e);if(null!=c){for(f=0;f<b.length;f++)Cc(a.G,c+f,b[f]);f=!0}f&&(null==d&&(a.u.V(),g=!1),null!=d&&(a=a.u,a.gb=d,a.w=d%Qb,g?a.v.U?a.v.K||wc(a):a.v.Z=!0:a.C&&a.v.U?a.V()||a.F.v.reset||(dd(a.C),M(a.F,-1)):!1===g&&a.V(),!a.v.K&&a.ya&&a.ya.stop()));return f}eb(function(){for(var a=z(document,y,"ram"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new xe(d);Cb(d,c)}});
|
||||
function Ae(a){v.call(this,"SerialPort",a,1048576);this.A=a.upperCase;"string"==typeof this.A&&(this.A="true"==this.A);this.w=!0;this.f=[];var b=a.binding;if("console"!=b){var c;a=Be;b&&(void 0===c&&(c="Panel"),(c=Bb(c,this.id))&&(b=c.I[b])&&this.ga(null,a,b))}this.b=this.D=null;this.exports={connect:this.tb,receiveData:this.Na,receiveStatus:this.Sb,setConnection:this.Vb}}p(Ae,v);l=Ae.prototype;
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case Be:return this.I[b]=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.cb:q.yb:46==c?b=q.cb:a.ctrlKey&&c>=q.bb&&c<=q.zb&&(b=c-(q.bb-q.vb));b&&(a.preventDefault&&a.preventDefault(),d.Na(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.xb&&(b=q.wb);d.Na(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
||||
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Na(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};l.wa=function(a,b,c,d){this.F=a;this.G=b;this.u=c;this.C=d;A(this)};
|
||||
l.tb=function(a){if(!this.b){var b=ad(this.F,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ia(c[0]);if(d!=this.Ka)return;c=Ia(c[1]);if(this.b=Ab(c)){var e=this.b.exports;if(e){var g=e.connect;g&&g.call(this.b,this.w);if(this.D=e.receiveData){this.w=a;this.status("Connected "+this.La+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.pa=function(a,b){if(!b)if(this.tb(this.w),!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
l.fa=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){var a=new L(this);a.set(0,[]);return a.data()};l.restore=function(){return!0};l.Na=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.f.push(b)}else this.f=this.f.concat(a);return!0};l.Sb=function(){};l.Vb=function(a,b){return this.b?!1:(this.b=a,this.D=b,!0)};var Be="buffer";
|
||||
eb(function(){for(var a=z(document,y,"serial"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Ae(d);Cb(d,c)}});function Ce(a){v.call(this,"Debugger",a);this.ca=+a.base||16;this.la=!1;this.D=0;this.P=!1;this.A=-1;this.w=[];this.W={}}p(Ce,v);Ce.prototype.sb=function(){return-1};Ce.prototype.$a=function(){};
|
||||
function De(a,b,c,d){if(c)if(b){0>a.A&&a.w.length&&(a.A=0);if(0>a.A||b!=a.w[a.A])a.w.splice(0,0,b),a.A=0;a.A--}else a.P?b="end":b=a.w[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var g=0;g<=b.length;g++){var f=b.charAt(g);if('"'==f||"'"==f)e?f==e&&(e=null):e=f;else if(f==d&&!e||!f)a.push(Ia(b.substring(c,g))),c=g+1}}return a}
|
||||
function Ee(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),g=a.pop();switch(d){case "*":d=g*e;break;case "/":if(!e)return!1;d=g/e;break;case "%":if(!e)return!1;d=g%e;break;case "+":d=g+e;break;case "-":d=g-e;break;case "<<":d=g<<e;break;case ">>":d=g>>e;break;case ">>>":d=g>>>e;break;case "<":d=g<e?1:0;break;case "<=":d=g<=e?1:0;break;case ">":d=g>e?1:0;break;case ">=":d=g>=e?1:0;break;case "==":d=g==e?1:0;break;case "!=":d=g!=e?1:0;break;case "&":d=g&e;break;
|
||||
function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R,R];
|
||||
function we(a){v.call(this,"ROM",a,128);this.T=this.b=null;this.D=+a.addr;this.w=+a.size;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.A=a.file;this.H=wa(this.A);if(this.A){a=this.A;var b=xa(this.H);"json"!=b&&"hex"!=b&&(a=Ea()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;La(a,null,!0,function(a,b,g){g?(c.da("Unable to load ROM resource (error "+g+": "+a+")"),c.A=null):(mb(c.La,a,b),(a=Ma(a,b))?(c.b=a.Y,c.T=a.T):c.A=null);xe(c)})}}p(we,v);
|
||||
we.prototype.xa=function(a,b,c,d){this.G=b;this.u=c;this.C=d;xe(this)};we.prototype.pa=function(){this.T&&(this.C&&ye(this.C,this.id,this.D,this.w,this.T),delete this.T);return!0};we.prototype.fa=function(){return!0};
|
||||
function xe(a){if(!Kb(a)){if(a.A){if(!a.b||!a.G)return;a.w||(a.w=a.b.length);if(a.b.length!=a.w)Ib(a,"ROM size ("+t(a.b.length,8,!0)+") does not match specified size ("+t(a.w,8,!0)+")");else{var b;b=a.D;if(Kc(a.G,b,a.w,Sc)){var c;for(c=0;c<a.b.length;c++)Ec(a.G,b+c,a.b[c]);b=!0}else b=!1;if(b){b=[];"number"==typeof a.f?b.push(a.f):null!=a.f&&a.f.length&&(b=a.f);for(c=0;c<b.length;c++){for(var d=a,e=b[c],g=d.G,f=d.w,h=[],k=d.D>>>g.f;0<f&&k<g.b.length;)h.push(g.b[k++]),f-=16384;g=d.G;d=d.w;f=0;for(e>>>=
|
||||
g.f;0<d&&e<g.b.length;){k=h[f++];if(!k)break;g.b[e++]=k;d-=16384}}delete a.b}}}B(a)}}eb(function(){for(var a=z(document,y,"rom"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new we(d);Cb(d,c)}});
|
||||
function ze(a){v.call(this,"RAM",a);this.T=this.Ca=null;this.f=+a.addr;this.w=+a.size;this.na=a.load;this.ma=a.exec;null!=this.na&&(this.na=+this.na);null!=this.ma&&(this.ma=+this.ma);this.A=this.H=!1;this.b=a.file;this.D=wa(this.b);if(this.b){a=this.b;var b=xa(this.D);"json"!=b&&"hex"!=b&&(a=Ea()+"/api/v1/dump?file="+this.b+"&format=bytes&decimal=true");var c=this;La(a,null,!0,function(a,b,g){g?(c.da("Unable to load RAM resource (error "+g+": "+a+")"),c.b=null):(mb(c.La,a,b),(a=Ma(a,b))?(c.Ca=a.Ca,
|
||||
c.T=a.T,null==c.na&&(c.na=a.na),null==c.ma&&(c.ma=a.ma)):c.b=null);Ae(c)})}}p(ze,v);ze.prototype.xa=function(a,b,c,d){this.G=b;this.u=c;this.C=d;Ae(this)};ze.prototype.pa=function(a,b){this.T&&(this.C&&ye(this.C,this.id,this.f,this.w,this.T),delete this.T);b||this.reset();return!0};ze.prototype.fa=function(){return!0};
|
||||
function Ae(a){if(a.G&&(!a.A&&a.w&&(Kc(a.G,a.f,a.w,1)?a.A=!0:a.w=0),!Kb(a))){if(!a.A)u("No RAM allocated");else if(a.b){if(!a.Ca)return;Be(a,a.Ca,a.na,a.ma,a.f)?a.status('Loaded image "'+a.D+'"'):a.da('Error loading image "'+a.D+'"')}a.H=!0;B(a)}}
|
||||
ze.prototype.reset=function(){if(this.A&&!this.H){for(var a=this.G,b=this.f,c=this.w,d=b&16383,b=b>>>a.f;0<c&&b<a.b.length;){var e=a.b[b],g=c,f=0,h,d=d||0,f=f||0;0>f&&f>=sa&&(f+=ra);f=Math.trunc(Math.abs(f))%ra;void 0===g&&(g=e.size);for(h=d;g--&&h<e.size;h++)e.F(f,d,e.B+d);c-=16384;b++;d=0}this.Ca&&Be(this,this.Ca,this.na,this.ma,this.f,!this.C)}this.H=!1};
|
||||
function Be(a,b,c,d,e,g){var f=!1;null==c&&(c=e);if(null!=c){for(f=0;f<b.length;f++)Ec(a.G,c+f,b[f]);f=!0}f&&(null==d&&(a.u.V(),g=!1),null!=d&&(a=a.u,a.gb=d,a.w=d%Qb,g?a.v.U?a.v.K||yc(a):a.v.Z=!0:a.C&&a.v.U?a.V()||a.F.v.reset||(fd(a.C),M(a.F,-1)):!1===g&&a.V(),!a.v.K&&a.za&&a.za.stop()));return f}eb(function(){for(var a=z(document,y,"ram"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new ze(d);Cb(d,c)}});
|
||||
function Ce(a){v.call(this,"SerialPort",a,1048576);this.A=a.upperCase;"string"==typeof this.A&&(this.A="true"==this.A);this.w=!0;this.f=[];var b=a.binding;if("console"!=b){var c;a=De;b&&(void 0===c&&(c="Panel"),(c=Bb(c,this.id))&&(b=c.I[b])&&this.ga(null,a,b))}this.b=this.D=null;this.exports={connect:this.tb,receiveData:this.Oa,receiveStatus:this.Sb,setConnection:this.Vb}}p(Ce,v);l=Ce.prototype;
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case De:return this.I[b]=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.cb:q.yb:46==c?b=q.cb:a.ctrlKey&&c>=q.bb&&c<=q.zb&&(b=c-(q.bb-q.vb));b&&(a.preventDefault&&a.preventDefault(),d.Oa(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.xb&&(b=q.wb);d.Oa(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
||||
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.Oa(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};l.xa=function(a,b,c,d){this.F=a;this.G=b;this.u=c;this.C=d;B(this)};
|
||||
l.tb=function(a){if(!this.b){var b=cd(this.F,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ia(c[0]);if(d!=this.Ka)return;c=Ia(c[1]);if(this.b=Ab(c)){var e=this.b.exports;if(e){var g=e.connect;g&&g.call(this.b,this.w);if(this.D=e.receiveData){this.w=a;this.status("Connected "+this.La+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.pa=function(a,b){if(!b)if(this.tb(this.w),!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
l.fa=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){var a=new L(this);a.set(0,[]);return a.data()};l.restore=function(){return!0};l.Oa=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.f.push(b)}else this.f=this.f.concat(a);return!0};l.Sb=function(){};l.Vb=function(a,b){return this.b?!1:(this.b=a,this.D=b,!0)};var De="buffer";
|
||||
eb(function(){for(var a=z(document,y,"serial"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Ce(d);Cb(d,c)}});function Ee(a){v.call(this,"Debugger",a);this.ca=+a.base||16;this.la=!1;this.D=0;this.P=!1;this.A=-1;this.w=[];this.W={}}p(Ee,v);Ee.prototype.sb=function(){return-1};Ee.prototype.$a=function(){};
|
||||
function Fe(a,b,c,d){if(c)if(b){0>a.A&&a.w.length&&(a.A=0);if(0>a.A||b!=a.w[a.A])a.w.splice(0,0,b),a.A=0;a.A--}else a.P?b="end":b=a.w[a.A+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var g=0;g<=b.length;g++){var f=b.charAt(g);if('"'==f||"'"==f)e?f==e&&(e=null):e=f;else if(f==d&&!e||!f)a.push(Ia(b.substring(c,g))),c=g+1}}return a}
|
||||
function Ge(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),g=a.pop();switch(d){case "*":d=g*e;break;case "/":if(!e)return!1;d=g/e;break;case "%":if(!e)return!1;d=g%e;break;case "+":d=g+e;break;case "-":d=g-e;break;case "<<":d=g<<e;break;case ">>":d=g>>e;break;case ">>>":d=g>>>e;break;case "<":d=g<e?1:0;break;case "<=":d=g<=e?1:0;break;case ">":d=g>e?1:0;break;case ">=":d=g>=e?1:0;break;case "==":d=g==e?1:0;break;case "!=":d=g!=e?1:0;break;case "&":d=g&e;break;
|
||||
case "^":d=g^e;break;case "|":d=g|e;break;case "&&":d=g&&e?1:0;break;case "||":d=g||e?1:0;break;default:return!1}a.push(d|0)}return!0}
|
||||
function V(a,b,c){var d;if(b){b=Fe(a,b);for(var e=0,g=!1,f=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=Ia(n);if(!n){g=!0;break}n=Ge(a,n,null,!1===c);if(void 0===n){g=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],C=n.length;k.length&&He[n]<He[k[k.length-1]]&&Ee(h,k,1);k.push(n);b=b.substr(r+C)}Ee(h,k)&&1==h.length||(g=!0);g?c&&a.i("error parsing '"+f+"' at character "+(f.length-b.length)):(d=h.pop(),c&&Ie(a,null,
|
||||
d))}return d}function Fe(a,b){for(var c,d=a.la?"(":"{",e=a.la?")":"}",g=new RegExp(a.la?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(g))&&!(0<=c[1].indexOf(d));){var f=V(a,c[1]);b=b.replace(d+c[1]+e,null!=f?N(a,f):"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 Ge(a,b,c,d){var e;null!=b?(e=a.sb(b),0<=e?e=a.$a(e):(e=a.W[b],null==e&&(e=ta(b,a.ca))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
||||
function Ie(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var g=4,f="";if(!g||4<g)g=4;for(var h=0;h<g;h++){f&&(f=","+f);var k=d&255,m=void 0,n=8,r="";n?32<n&&(n=32):n=32;for(var C=null==k||isNaN(k),aa=m=m||n;0<n--;)aa||(r=","+r,aa=m),r=(C?"?":k&1?"1":"0")+r,k>>=1,aa--;f=r+f;d>>=8}d=t(c,0,!0)+" "+c+". "+va(c,0,!0)+" "+("0b"+f);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}
|
||||
function Je(a,b){if(b)return Ie(a,b,a.W[b]);var c=0;for(b in a.W)Ie(a,b,a.W[b]),c++;return 0<c}function N(a,b,c){c=void 0===c?0:c;switch(a.ca){case 8:b=va(b,0<c?(c+2)/3|0:0);break;case 10:(a=0<c?Math.ceil(.3*c):0)?11<a&&(a=11):a=b&-65536?10:5;b=ua(b,10,a);break;default:b=t(b,0<c?c+3>>2:0)}0>c?c=b.replace(/^0+([0-9A-F]+)$/i,"$1"):c=b;return c}var He={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function Ke(a){Ce.call(this,a);this.ya=!1;this.la=!0;this.va=W();this.L=W(0);this.ja=W(0);this.ba=W(0);this.H=[];this.b=this.M=this.J=[];Le(this);this.R=this.ka=0;this.f=[];this.sa=void 0;Me(this);this.C=this;this.qa={};this.X=this.nb=0;this.S=null;this.O=[];Ne(this,a.messages);this.ua=a.commands;this.N=0;this.Ba=this.ta=null;this.D=this.Aa=this.za=this.ia=this.ra=0;this.ha=this.aa=null;var b=this;window?void 0===window[y]&&(window[y]=function(a){return fd(b,a)}):void 0===global[y]&&(global[y]=function(a){return fd(b,
|
||||
a)})}p(Ke,Ce);function Y(a){a=a&&a.B;null==a&&(a=-1);return a}function W(a,b,c){return{B:void 0===a?null:a,qb:void 0===b?!1:b,ea:!1,ca:c}}function Oe(a,b,c,d){a.B=b;a.qb=c||!1;a.ea=!1;a.ca=d}function Pe(a){return[a.B,a.qb,a.ca,a.ea,a.Oa]}function Qe(a,b){var c=W(b[0],b[1],b[2]);c.ea=b[3];b[4]&&(c.lb=De(a,c.Oa=b[4]));return c}l=Ke.prototype;
|
||||
l.wa=function(a,b,c,d){this.G=b;this.F=a;this.u=c;this.ha=a.w;(a=ad(a,"messages"))&&Ne(this,a);Re(this,function(a){a:{var b=d.G.b,c=a[0],e=a=0,k=b.length;if(c){a=Y(Z(d,c,d.ja));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.G.f;k=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;k--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Lc[c],n&&d.i(t(n.id,8)+" %"+t(e<<d.G.f,8)+" %"+t(n.B,8)+" "+t(n.Ha,
|
||||
4,!0)+" "+t(n.size,4,!0)+" "+m),c!=Pc&&(c=-1),m=0);a+=16384;e++}}});A(this)};
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case "debugInput":return this.aa=this.I[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",fd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.w.length-1&&(b=d.w[++d.A])):40==a.keyCode&&(0<d.A?b=d.w[--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.I[b]=c,cb(c,function(){if(d.aa){var a=d.aa.value;
|
||||
d.aa.value="";fd(d,a,!0);return!0}return!1}),!0;case "step":return this.I[b]=c,cb(c,function(a){var b=!1;Lb(d,!0)||(Mb(d,!0),b=xc(d,a?1:0,null),Mb(d,!1));return b}),!0}return!1};function ed(a){if(a.aa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.aa.focus();window&&window.scrollTo(b,c)}}l.xa=function(a,b){var c=-1,d=Y(a);-1!==d&&(c=Dc(this.G,d),b&&null!=a.B&&(a.B+=b||1));return c};l.eb=function(a,b,c){var d=Y(a);-1!==d&&(Cc(this.G,d,b),c&&null!=a.B&&(a.B+=c||1),M(this.F,-1))};
|
||||
function Z(a,b,c){var d,e;c||(c=W());var g=c.B;if(void 0!==b){b=Fe(a,b);"%"==b.charAt(0)&&(d=!0,b=b.substr(1));var f,g=b,h;if(g.match(/^[a-z_][a-z0-9_]*$/i))for(var g=g.toUpperCase(),k=0;k<a.H.length;k++){var m=a.H[k].T[g];if(null!=m){h=m.o;break}}null!=h&&(f=W(h));if(f)return f;0<=b.indexOf("0x")?e=16:0<=b.indexOf("0o")?e=8:0<=b.indexOf(".")&&(e=10);g=V(a,b,void 0)}null!=g&&Oe(c,g,d,e);return c}function Se(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.lb=De(a,b.Oa=c[2]))}
|
||||
function Te(a){return va(a/Qb,6)+" "+va(a%Qb,6)}function Ne(a,b){a.C=a;a.X=a.nb=536870916;a.S=null;a.O=[];b=De(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in K){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.X|=K[c],a.i(c+" messages enabled"))}}function Re(a,b){for(var c in K)if(16==K[c]){a.qa[c]=b;break}}l.sb=function(a){return Ue.indexOf(a.toUpperCase())};
|
||||
l.$a=function(a){var b;switch(a){case Ve:b=this.u.w;break;case We:b=this.u.H;break;case Xe:b=this.u.f;break;case Ye:b=this.u.ib?1:0;break;case Ze:b=this.u.za?1:0;break;case $e:b=this.u.Ra?1:0;break;case af:b=this.u.ub?1:0;break;case bf:b=this.u.Sa?1:0}return b};
|
||||
l.message=function(a,b){b&&(a+=" @"+N(this,W(this.u.ra).B));if(!this.S||a!=this.S)if(this.S=a,this.X&1073741824)this.O.push(a);else{var c;if(this.X&-2147483648&&this.u&&(c=this.u.v.K)||Lb(this,!0))this.V(),c&&(a+=" (cpu halted)");this.i(a);this.u&&(a=this.u,nd(a),a.ba=0,a.F&&M(a.F,void 0))}};
|
||||
function Me(a){var b;if(!Od(a))a.f&&a.f.length&&a.i("instruction history buffer freed"),a.R=0,a.f=[];else if(!a.f||!a.f.length){a.f=Array(cf);for(b=0;b<a.f.length;b++)a.f[b]=W();a.R=0;a.i("instruction history buffer allocated")}}function df(a,b,c){if(!ef(a,c))return!1;wc(a.u,b);return!0}
|
||||
function xc(a,b,c,d){if(!ef(a))return!1;var e="";null===c&&(e=(c=!a.ta||"tr"==a.ta)?"tr":"t");a.D=0;b||Od(a)&&Pd(a,a.u.w,0);try{b=ld(a.u,b);var g=a.u.Ja(b);0<g&&(yc(a.u,g),a.D+=g,zc(a.u,g,!0),Ac(a.u,g),a.ia++)}catch(f){"number"!=typeof f&&(a.D=0,Ib(a.u,f.stack||f.message))}!1!==d&&(a.ha&&a.ha.stop(),M(a.F,-1));dd(a,c||!1,e);return 0<a.D}l.V=function(a){this.u&&this.u.V(a)};function dd(a,b,c){b=void 0===b?!0:b;a.ya&&(c&&a.i(Nf+c),Oe(a.L,a.u.w),b&&1!=a.N?Pf(a):Qf(a))}
|
||||
function ef(a,b){var c;(c=!a.u||!Kb(a.u))||(c=a.u,c.v.U?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.u.v.K?(b||a.i("cpu busy or unavailable, command ignored"),!1):!Jb(a.u)}l.pa=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0};l.fa=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){Me(this);this.ia=0;this.S=null;this.D=0;Oe(this.L,this.u.w);this.v.K=!1;Rf(this);a||dd(this)};
|
||||
l.save=function(){var a=new L(this);a.set(0,Pe(this.L));a.set(1,Pe(this.ja));a.set(2,Pe(this.ba));a.set(3,[this.w,this.P,this.X]);a.set(4,this.H);return a.data()};l.restore=function(a){var b=0;void 0!==a[3]&&(this.L=Qe(this,a[b++]),this.ja=Qe(this,a[b++]),this.ba=Qe(this,a[b++]),this.w=a[b][0],"string"==typeof this.w&&(this.w=[this.w]),this.P=a[b][1],this.X|=a[b][2]);a[4]&&(this.H=a[4]);return!0};l.start=function(a,b){this.N||this.i("running");this.v.K=!0;this.za=a;this.Aa=b};
|
||||
l.stop=function(a,b){if(this.v.K){this.v.K=!1;this.D=b-this.Aa;if(!this.N){b="stopped";if(this.D){a-=this.za;var c=0<a?Math.round(1E3*this.D/a):0;b+=" (";Od(this)&&(b+=this.ia+" instructions, ",this.ia=0);b+=this.D+" cycles, "+a+" ms, "+c+" hz)"}else Nb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}dd(this,!0);ed(this);Rf(this,this.u.w);this.S=null}};function Od(a){return 1<a.b.length||!!a.ka}
|
||||
function Pd(a,b,c){var d=-1;c||(d=a.u.g(b),2756==d>>23&&a.u.ra==b&&(b=Md(a.u,1)));if(0<c&&(a.ka&&!--a.ka||Yc(a,b,1,a.b)))return!0;0<=c&&a.f.length&&(a.ia++,0>d&&(d=a.u.g(b)),0<=d&&(Oe(a.f[a.R],b),++a.R==a.f.length&&(a.R=0)));return!1}
|
||||
function Sf(a,b,c,d){var e=W(b.B),g=a.xa(b,1),f,h,k,m=0,n=g/Wb|0,r;for(r in Tf)if(f=Tf[r][n&r]){h=+r;n>>=6;switch(h){case 32512:k=Uf;m=n&3;break;case 32256:k=Vf;m=n&7;break;case 29248:k=Wf,m=(n&48)>>2|(n&6)>>1}break}k=k&&k[m]||"";"S"==k&&f>Xf&&(k="B");k=Yf[f||0]+k;k=Ha(k,8);f?(k=28700==h?k+N(a,g/Xb&127,-1):k+N(a,g>>23&15,-1),k+=",",g&4194304&&(k+="@"),k+=N(a,g&262143,-1),(g=g>>18&15)&&(k+="("+N(a,g,-1)+")")):k+=Te(g);g=k;f="";h=N(a,e.B)+":";if(-1!==e.B&&-1!==b.B){do if(k=a.xa(e,1),f+=" "+Te(k),null==
|
||||
e.B)break;while(e.B!=b.B)}h+=Ha(f,16)+g;c&&(h=Ha(h,48)+";"+(c||""),h=a.u.v.Ea?h+("cycles="+gd(a.u).toString()+" cs="+t(a.u.ta)):h+(null!=d?"="+d.toString():""));return h}function Le(a){var b,c;a.b=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];c=Y(c);var d=a.G;Xc(d.b[c>>>d.f],!1)}a.M=["br"];if(a.J)for(b=1;b<a.J.length;b++)c=a.J[b],c=Y(c),d=a.G,Xc(d.b[c>>>d.f],!0);a.J=["bw"];a.ra=0;a.ka=0}
|
||||
l.Da=function(a,b,c){var d=!0;c||Zf(this,a,b,!1,!0);if(a!=this.b){var e=Y(b);if(-1===e)this.i("invalid address: "+N(this,b.B)),d=!1;else{var g=this.G;g.b[e>>>g.f].Da(e&16383,a==this.J)}}d&&(a.push(b),c?b.ea=!0:($f(this,a,a.length-1,"set"),Me(this)));return d};function Zf(a,b,c,d,e){var g=!1;c=Y(c);for(var f=1;f<b.length;f++){var h=b[f];if(c==Y(h)&&(!d||h.ea)){g=!0;h.ea||e||$f(a,b,f,"cleared");b.splice(f,1);b!=a.b&&(d=a.G,Xc(d.b[c>>>d.f],b==a.J));h.ea||Me(a);break}}return g}
|
||||
function ag(a,b){for(var c=1;c<b.length;c++)$f(a,b,c);return b.length-1}function $f(a,b,c,d){c=b[c];a.i(b[0]+" "+N(a,c.B)+(d?" "+d:c.Oa?' "'+c.Oa+'"':""))}function Rf(a,b){if(void 0!==b)Yc(a,b,1,a.b,!0),a.N=0;else for(b=1;b<a.b.length;b++){var c=a.b[b];if(c.ea){if(!Zf(a,a.b,c,!0))break;b=0}}}
|
||||
function Yc(a,b,c,d,e){var g=!1;if(!a.ra++)for(var f=1;!g&&f<d.length;f++){var h=d[f];if(!e||h.ea)for(var k=Y(h)&(d==a.b?65535:-1),m=0;m<c;m++)if(b+m==k){var n,g=!0;h.ea&&(Zf(a,d,h,!0),e=!0);if(n=h.lb){for(var g=!1,r=0;r<n.length;r++)if(!bg(a,n[r],!0)){if(n[r].indexOf("if")){g=!0;break}for(var C=r+1;C<n.length&&n[C].indexOf("else");C++)r++;if(C==n.length){g=!0;break}}a.u.v.K||(g=!0)}if(g){e||$f(a,d,f,"hit");break}}}a.ra--;return g}
|
||||
function cg(a,b){b=void 0===b?!0:b;for(var c="",d=0;16>d;d++){!d||d&3||(c+="\n");var e=a,g=va(d,2);Oe(e.va,d);g+="="+N(e,e.xa(e.va),36)+" ";c+=g}if(b){b="";for(d=0;d<Ue.length;d++)(e=Ue[d]||"")&&(e+="="+N(a,a.$a(d),d>=Ye?1:d==We?23:18)+" "),b+=e;c+="\n"+b}return c}l.ob=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function we(a,b,c,d,e){var g=[],f;for(f in e){var h=e[f];"number"==typeof h&&(e[f]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var n=g,k=[k>>>0,f],r=Ja(n,k,a.ob);0>r&&n.splice(-(r+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({fd:b,B:c,Fb:d,T:e,mb:g})}function dg(a,b,c){var d=[],e=Y(b)>>>0;for(b=0;b<a.H.length;b++){var g=a.H[b],f=g.B>>>0,h=g.Fb;if(e>=f&&e<f+h){e=Ja(g.mb,[e-f],a.ob);0<=e?eg(a,b,e,d):c&&(e=~e,eg(a,b,e-1,d),eg(a,b,e,d));break}}return d}
|
||||
function eg(a,b,c,d){var e={},g=a.H[b].mb,f=0,h=null;0<=c&&c<g.length&&(f=g[c][0],h=g[c][1]);h&&(e=a.H[b].T[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(f);d.push(e.a);d.push(e.c)}function fg(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Je(a)||a.i("no variables"),!0;if(!c[2])return Je(a,c[1]);if(!c[3])return delete a.W[c[1]],!0;b=V(a,c[3]);return void 0!==b?(a.W[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||
function gg(a,b,c){var d=null;if(b=Z(a,b)){var e=dg(a,b,!0);if(e.length){var g,f;e[0]&&(f="",(g=b.B-e[1])&&(f=" + "+t(g,4,!0)),g=e[0]+" ("+N(a,e[1])+")"+f,c&&a.i(g),d=g);4<e.length&&e[4]&&(f="",(g=e[5]-b.B)&&(f=" - "+t(g,4,!0)),g=e[4]+" ("+N(a,e[5])+")"+f,c&&a.i(g),d||(d=g))}else c&&a.i("no symbols")}return d}
|
||||
function Pf(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trm\tdump misc registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=a.u,e=void 0;null==c&&(c=!0);if(b&&1<b.length){var g=b[1];if("m"==g)e=!0;else{var f=g.indexOf("=");if(0<f)b=g.substr(f+1),g=g.substr(0,f);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}f=V(a,b);if(void 0===f)return;switch(g.toUpperCase()){case "PC":d.w=f%Qb;Oe(a.L,d.w);break;default:a.i("unknown register: "+
|
||||
g);return}M(a.F);a.i("updated registers:")}}a.i(cg(a,e));c&&(Oe(a.L,d.w),Qf(a,N(a,a.L.B)))}}function hg(a,b){b=Ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):Ie(a,null,c[2].charCodeAt(0)):V(a,b,!0)}
|
||||
function ig(a,b,c){if("?"==c)a.i("trace commands:"),a.i("\tt [#]\ttrace # instructions"),a.i("\ttr [#]\ttrace # instructions with register updates"),a.i("\ttc [#]\ttrace # cycles"),a.i("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=Ge(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.ta=b;bb(c,function(){return Mb(a,!0)&&xc(a,e,d,!1)},function(){a.ha&&a.ha.stop();M(a.F,-1);Mb(a,!1)})}}
|
||||
function Qf(a,b,c,d){if(b=Z(a,b,a.L)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ge(a,c.substr(1)),null!=c&&(d=c);else{d=Z(a,c);if(!d||d.B<b.B)return;e=d.B-b.B;if(256<e){a.i("range too large");return}d=-1}for(c=0;0<e&&d--;){var g=Lb(a,!1)||a.N?a.D:null,f=null!=g?"cycles":null,h=dg(a,b),k=b.B;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(f=h[3],g=null);h=a.ba;m=b;h.B=m.B;h.ea=m.ea;h.ca=m.ca;a.i(Sf(a,b,f,g));e-=b.B-k;c++}}}
|
||||
function bg(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(Nf+b):(a.P&&(a.i("ended assemble at "+N(a,a.ba.B)),a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Kb(a)&&0<b.length){a.P&&(b="a "+N(a,a.ba.B)+" "+b);var g=!1,f=b.replace(/ +/g," ").split(" ");f[0]=f[0].toLowerCase();if(f&&f.length)for(var h=f[0],k=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==k||"r"==k||"a">n||"z"<n){f[0]=h.substr(m);f.unshift(h.substr(0,m));break}}switch(f[0].charAt(0)){case "a":var r=Z(a,
|
||||
f[1],a.ba);if(r){var C=f[2];if(void 0==C)a.i("begin assemble at "+N(a,r.B)),a.P=!0,M(a.F);else{f.shift();f.shift();f.shift();var aa,ff=f.join(""),B=-1,mc,Kg=C.toUpperCase(),od;for(od in Tf){var Oa;mc=+od;var gf=Tf[od];switch(mc){case 32512:Oa=Uf;break;case 32256:Oa=Vf;break;case 29248:Oa=Wf;break;default:Oa=[""]}var hf,pd;for(pd in gf){for(var jf=gf[pd],Pa=0;Pa<Oa.length;Pa++){var qd=Oa[Pa];"S"==qd&&jf>Xf&&(qd="B");if(Kg==Yf[jf]+qd){hf=29248!=mc?Pa:(Pa&3)<<1|(Pa&12)<<2;B=(pd|hf<<6)*Wb;break}}if(0<=
|
||||
B)break}if(0<=B)break}if(0<=B)if(ff)for(var rd=ff.split(","),mb=0;mb<rd.length;mb++){var nc=rd[mb].trim();if(nc){if(1<mb){a.i("too many operands: "+nc);B=-1;break}var ba=nc.match(/(@?)([^(]*)\(?([^)]*)\)?/);if(!ba){a.i("unknown operand: "+nc);B=-1;break}var J=V(a,ba[2]);if(void 0==J){B=-1;break}if(!mb&&1<rd.length)if(28700==mc){if(0>J||127<J){a.i("device code out of range: "+ba[2]);B=-1;break}B+=J*Xb}else{if(0>J||15<J){a.i("accumulator address out of range: "+ba[2]);B=-1;break}B+=J<<23}else{if(0>
|
||||
J||262143<J){a.i("memory address out of range: "+ba[2]);B=-1;break}B+=J;if(ba[3]){J=V(a,ba[3]);if(void 0==J){B=-1;break}if(0>J||15<J){a.i("memory index out of range: "+ba[3]);B=-1;break}B+=J<<18}ba[1]&&(B+=4194304)}}}else a.i("missing operand(s)"),B=-1;else a.i("unknown instruction: "+C);aa=B;0<=aa&&(a.eb(r,aa),a.i(Sf(a,r)))}}break;case "b":a:{var Lg=f[0],Qa=f[1],Mg=b;if("?"==Qa)a.i("breakpoint commands:"),a.i("\tbp #\tset exec breakpoint"),a.i("\tbr #\tset read breakpoint"),a.i("\tbw #\tset write breakpoint"),
|
||||
a.i("\tbc #\tclear breakpoint (* to clear all)"),a.i("\tbl\tlist all breakpoints"),a.i("\tbn [#]\tbreak after # instruction(s)");else{var ya=Lg.charAt(1);if("l"==ya){var sd;sd=0+ag(a,a.b);sd+=ag(a,a.M);(sd+=ag(a,a.J))||a.i("no breakpoints")}else if("n"==ya){var kf=+Qa||0;Qa&&(a.ka=kf);a.i("break after "+kf+" instruction(s)")}else if(void 0===Qa)a.i("missing breakpoint address");else{var P=W();if("*"!=Qa&&(P=Z(a,Qa,a.L),!P))break a;"c"==ya?null==P.B?(Le(a),a.i("all breakpoints cleared")):Zf(a,a.b,
|
||||
P)||Zf(a,a.M,P)||Zf(a,a.J,P)||a.i("breakpoint missing: "+N(a,P.B)):null!=P.B&&(Se(a,P,Mg),"p"==ya?a.Da(a.b,P):"r"==ya?a.Da(a.M,P):"w"==ya?a.Da(a.J,P):a.i("unknown breakpoint command: "+ya))}}}break;case "c":a.oa&&(a.oa.value="");break;case "d":a:{var Ra,Sa=f[0],ca=f[1],oa=f[2],Ng=f[3];if("?"==ca){var Ta="";for(Ra in K)a.qa[Ra]&&(Ta&&(Ta+=","),Ta+=Ra);Ta+=",state,symbols";a.i("dump memory commands:");a.i("\tdw [a] [n] dump n words at address a");a.i("\tds [a] [n] dump n words at address a as JSON");
|
||||
a.i("\tdh [p] [n] dump n instructions from history position p");Ta.length&&a.i("dump extension commands:\n\t"+Ta)}else if("state"==ca){var td=jg(a.F,!0);"console"==oa?console.log(td):(a.oa&&(a.oa.value=""),td&&a.i(td))}else if("symbols"==ca)for(var ud=0;ud<a.H.length;ud++){var vd=a.H[ud],Ua;for(Ua in vd.T)if("."!=Ua.charAt(0)){var lf=vd.T[Ua].o;if(void 0!==lf){var mf=vd.T[Ua].l;mf&&(Ua=mf);a.i(N(a,lf)+" "+Ua)}}}else{if("d"==Sa){for(Ra in K)if(f[1]==Ra){var nf=a.qa[Ra];nf?(f.shift(),f.shift(),nf(f)):
|
||||
a.i("no dump registered for "+ca);break a}ca||(Sa=a.Ba||"dw")}else a.Ba=Sa;if("dh"==Sa){var of=ca,pf=oa,qf="",rf=0,X=a.R,da=a.f;if(da.length){var T=+of||a.sa,ob=+pf||10;isNaN(T)?T=ob:qf="more ";T>da.length&&(a.i("note: only "+da.length+" available"),T=da.length);X-=T;0>X&&(null==da[da.length-1].B?(T=X+T,X=0):X+=da.length);var wd=[];"call"==pf&&(ob=1E5,wd=["CALL"]);for(void 0!==of&&a.i(T+" instructions earlier:");0<ob&&X!=a.R;){var sf=da[X++];if(null==sf.B)break;var pb=W(sf.B),Og=T--,tf=Sf(a,pb,"history",
|
||||
Og);(!wd.length||0<=tf.indexOf(wd[0]))&&a.i(tf);pb.Ya&&(X+=pb.Ya,ob-=pb.Ya,T-=pb.Ya);X>=da.length&&(X=0);a.sa=T;rf++;ob--}}rf||(a.i("no "+qf+"history available"),a.sa=void 0)}else{var Va=Z(a,ca,a.ja);if(Va){var za=0,uf="ds"==Sa;if(oa){if("l"==oa.charAt(0))oa=oa.substr(1)||Ng,za=Ge(a,oa);else{var vf=Z(a,oa);vf&&(za=vf.B-Va.B)}0>za&&(za=0);65536<za&&(za=65536)}var Pg=a.ca;Va.ca&&(a.ca=Va.ca);for(var wf="db"==Sa?1:2,xd=za||32,yd=1==wf?2:4,Qg=(xd+yd-1)/yd|0||1,Aa="";Qg--&&0<xd;){for(var Ba="",xf="",ca=
|
||||
N(a,Va.B),yf=yd;0<yf--&&0<xd--;){var oc=a.xa(Va,1);uf?(Ba&&(Ba+=","),Ba+=oc):(Ba+=Te(oc),Ba+=" ");for(var zf=0;1==wf&&6>zf;zf++)xf+=String.fromCharCode((oc%64|0)+32),oc/=64}Aa&&(Aa+="\n");Aa=uf?Aa+(Ba+","):Aa+(ca+": "+Ba+(0>yf?" "+xf:""))}Aa&&a.i(Aa);a.ca=Pg}}}}break;case "e":if("else"==f[0])break;var Af,Bf,Cf=f[0],zd=f[1];"e"==Cf||"ew"==Cf?(Af=a.xa,Bf=a.eb):zd=null;if(null==zd)a.i("edit memory commands:"),a.i("\tew [a] [...] edit words at address a");else{var pc=Z(a,zd,a.ja);if(pc)for(var qc=2;qc<
|
||||
f.length;qc++){var Ad=V(a,f[qc]);if(void 0===Ad){a.i("unknown value: "+f[qc]);break}a.i("changing "+N(a,pc.B)+" from "+Te(Af.call(a,pc))+" to "+Te(Ad));Bf.call(a,pc,Ad,1)}}break;case "g":a:{var Df=f[1],Rg=b;if(void 0!==Df){var Bd=Z(a,Df);if(!Bd)break a;Se(a,Bd,Rg);a.Da(a.b,Bd,!0)}df(a,!0,c)}break;case "h":a.v.K?(c||a.i("halting"),a.V()):Lb(a,!0)||c||a.i("already halted");break;case "i":if("if"==f[0]){var Cd;var qb=b.substr(2),qb=Ia(qb);V(a,qb)?(c||a.i("true: "+qb),Cd=!0):(c||a.i("false: "+qb),Cd=
|
||||
!1);Cd||(d=!1);break}g=!0;break;case "k":var Sg=f[0];if("?"==f[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var Dd=0,Ed=W(),rb=W();for(a.i("stack trace for "+N(a,rb.B));10>Dd;){for(var Ca=null,Tg=256;65536>rb.B>>>0;){Ed.B=a.xa(rb,2);if(null==rb.B||!Tg--)break;if(!(Ed.B&1)){for(var Ug=a,rc=Ed,Ef=null,sb=rc.B,Ff=sb,Fd=1;6>=Fd&&sb;Fd++){if(2<Fd){rc.B=sb;var sc=Sf(Ug,rc);if(0<=sc.indexOf("JSR")){var Gf=sc.indexOf(" ");if(sb+(sc.indexOf(" ",
|
||||
Gf+1)-Gf-1)/2==Ff){Ef=sc;break}}}sb-=2}rc.B=Ff;if(Ca=Ef)break}}if(!Ca||null==Ca)break;var Hf=null;if("ks"==Sg){var If=Ca.match(/[0-9A-F]+$/);If&&(Hf=gg(a,If[0]))}Ca=Ha(Ca,50)+" ;"+(Hf||"stack="+N(a,rb.B));a.i(Ca);Dd++}Dd||a.i("no return addresses found")}break;case "l":if("ln"==f[0]){gg(a,f[1],!0);break}g=!0;break;case "m":a:{var ea,fa=null,D=f[1];"?"==D&&(D=void 0);if(void 0!==D){var pa=0;if("all"==D)pa=1879046143,D=null;else if("on"==D)fa=!0,D=null;else if("off"==D)fa=!1,D=null;else{"keys"==D&&
|
||||
(D="key");"kbd"==D&&(D="keyboard");for(ea in K)if(D==ea){pa=K[ea];fa=!!(a.X&pa);break}if(!pa){a.i("unknown message category: "+D);break a}}if(pa)if("on"==f[2])a.X|=pa,fa=!0;else if("off"==f[2]&&(a.X&=~pa,fa=!1,1073741824==pa)){for(var Jf=1E3<=a.O.length?a.O.length-1E3:0;Jf<a.O.length;)a.i(a.O[Jf++]);a.O=[]}}var Vg=0,tb="";for(ea in K)if(!D||D==ea){var Wg=!!(a.X&K[ea]);if(null===fa||fa==Wg)tb&&(tb+=","),++Vg%10||(tb+="\n\t"),"key"==ea&&(ea="keys"),tb+=ea}void 0===D&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.i((null!==fa?fa?"messages on: ":"messages off: ":"message categories:\n\t")+(tb||"none"));Me(a)}break;case "p":if("print"==f[0]){hg(a,b.substr(5));break}var Kf=f[0],Lf="p"==Kf?0:"pr"==Kf?1:-1;if("?"==f[1]||0>Lf)a.i("step commands:"),a.i("\tp\tstep over instruction"),a.i("\tpr\tstep over instruction with register update");else if(a.N)a.i("step in progress");else{var Mf=W(a.u.w);a.xa(Mf);a.N?(a.Da(a.b,Mf,!0),df(a)||(a.F&&kd(a.F),a.N=0)):ig(a,Lf?"tr":"t")}break;case "r":if("reset"==b){a.F&&a.F.reset();
|
||||
break}Pf(a,f);break;case "s":a:switch(f[1]){case "base":if(f[2]){var ub=+f[2];if(8==ub||10==ub||16==ub)a.ca=ub;else{a.i("invalid base: "+ub);break}}a.i("default base: "+a.ca);break;case "cs":var vb;void 0!==f[3]&&(vb=+f[3]);switch(f[2]){case "int":a.u.ha=vb;break;case "start":a.u.ua=vb;break;case "stop":a.u.ja=vb;break;default:a.i("unknown cs option");break a}void 0!==vb&&cd(a.u);a.i("checksums "+(a.u.v.Ea?"enabled":"disabled"));break;case "sp":void 0!==f[2]&&(hd(a.u,+f[2])||a.i("warning: using 1x multiplier, previous target not reached"));
|
||||
a.i("target speed: "+(a.u.W.toFixed(2)+"Mhz")+" ("+a.u.aa+"x)");break;default:if(f[1]){a.i("unknown option: "+f[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":ig(a,f[0],f[1]);break;case "u":Qf(a,f[1],f[2],8);break;case "v":if("var"==f[0]){fg(a,
|
||||
b.substr(3))||(d=!1);break}if("ver"==f[0]){a.i((Pb||"PDP10")+" version 1.34.2 ("+a.u.jb+",RELEASE)");a.i(window?window.navigator.userAgent:"");break}g=!0;break;case "?":if(f[1]){hg(a,b.substr(1));break}var Gd="commands:",Hd;for(Hd in kg)Gd+="\n"+Ha(Hd,9)+kg[Hd];Od(a)||(Gd+="\nnote: history disabled if no exec breakpoints");a.i(Gd);break;default:g=!0}g&&(a.i("unknown command: "+b),d=!1)}}catch(Of){a.i("debugger error: "+(Of.stack||Of.message)),d=!1}return d}
|
||||
function fd(a,b,c){b=De(a,b,c);for(var d in b)if(!bg(a,b[+d]))return!1;return!0}
|
||||
var kg={"?":"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"},Xf=20,Yf=".WORD HLL HLLZ HLLO HLLE HRL HRLZ HRLO HRLE HRR HRRZ HRRO HRRE HLR HLRZ HLRO HLRE MOVE MOVS MOVN MOVM EXCH BLT PUSH POP LDB DPB IBP ILDB IDPB SETZ SETO SETA SETCA SETM SETCM AND ANDCA ANDCM ANDCB IOR ORCA ORCM ORCB XOR EQV LSH LSHC ROT ROTC ADD SUB MUL IMUL DIV IDIV ASH ASHC FSC FADR FSBR FMPR FDVR DFN UFA FAD FSB FMP FDV AOBJP AOBJN CAI CA JUMP SKIP AOJ AOS SOJ SOS TR TL TD TS XCT JFFO JFCL JSR JSP JRST JSA JRA PUSHJ POPJ BLKI DATAI BLKO DATAO CONO CONI CONSZ CONSO UUO".split(" "),
|
||||
Ve=0,We=1,Xe=2,Ye=3,Ze=4,$e=5,af=6,bf=7,Ue="PC RA EA C0 C1 OV ND PD".split(" "),lg={},Tf=(lg[28672]={0:101},lg[32704]={5632:64,5696:63,5760:58,5824:27,5888:28,5952:25,6016:29,6080:26,10240:56,10304:48,10368:46,10432:84,10496:57,10560:49,10624:47,10752:21,10816:22,10880:69,10944:70,11008:88,11072:85,11136:83,11264:91,11328:23,11392:24,11456:92,11520:86,11584:87,11648:89,11712:90},lg[32512]={6144:65,6400:59,6656:66,6912:60,7168:67,7424:61,7680:68,7936:62,8192:17,8448:18,8704:19,8960:Xf,9216:53,9472:52,
|
||||
9728:55,9984:54,11776:50,12032:51,16384:30,16640:36,16896:37,17152:34,17408:38,17664:32,17920:44,18176:40,18432:39,18688:45,18944:33,19200:41,19456:35,19712:42,19968:43,20224:31,20480:1,20736:5,20992:2,21248:6,21504:3,21760:7,22016:4,22272:8,22528:9,22784:13,23040:10,23296:14,23552:11,23808:15,24064:12,24320:16},lg[32256]={12288:71,12800:72,13312:73,13824:74,14336:75,14848:76,15360:77,15872:78},lg[29248]={24576:79,24640:80,25088:81,25152:82},lg[28700]={28672:93,28676:94,28680:95,28684:96,28688:97,
|
||||
28692:98,28696:99,28700:100},lg),Uf=["","I","M","S"],Vf=" L E LE A GE N G".split(" "),Wf="N NE NA NN Z ZE ZA ZN C CE CA CN O OE OA ON".split(" "),cf=1E3,Nf=">> ";eb(function(){for(var a=z(document,y,"debugger"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Ke(d);Cb(d,c)}});
|
||||
function mg(a,b,c){v.call(this,"Computer",a,33554432);this.v.U=!1;this.R=null;ng(this,b);this.O=ad(this,"autoPower",a,6);this.A=0;this.aa=+a.busWidth||+a.buswidth;this.M=this.H=this.N=null;this.L=this.W=!1;this.J=this.D=null;this.S=this.P=!1;this.ba=ad(this,"url")||"";(Math.random()+.1).toString(36);this.f=og(this);if(this.u=Bb("CPU",this.id)){this.C=Bb("Debugger",this.id);this.G=new Ec({id:this.La+".bus",busWidth:this.aa},this.u,this.C);var d,e=zb(this.id);if((this.w=Bb("Panel",this.id))&&this.w.oa)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.da=this.w.da,d.i=this.w.i,d.oa=this.w.oa;this.i(Pb+" v1.34.2\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.wa&&d.wa(this,this.G,this.u,this.C);b=null;d=ad(this,"resume",a);void 0!==d&&(1<d.length?b=this.H=d:this.b=parseInt(d,10));var g;if(a=ad(this,"state")||(g=!0,a.state))this.N=b=a,g||(this.L=!0,this.b=pg),this.b&&(this.J=new L(this,"1.34.2"),qg(this.J)?b=null:
|
||||
delete this.J);!b&&this.b&&(b=rg(this))&&(this.L=!0);if(b){var f=this;La(b,null,!0,function(a,b,c){c?(f.H=null,f.L=!1,f.da("Unable to load machine state from server (error "+c+(b?": "+Ia(b):"")+")")):(f.M=b,f.W=!0);A(f)})}else A(this);this.I.power||(this.O=!0);!c&&this.O&&sg(this,this.Ga)}else u("Unable to find CPU component")}p(mg,v);function ng(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.R=b}
|
||||
function ad(a,b,c,d){var e=b.toLowerCase(),e=$a(b)||$a(e);void 0===e&&a.R&&(e=a.R[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}function sg(a,b,c){for(var d=zb(a.id),e=0;e<=d.length;e++){var g=e<d.length?d[e]:a;if(!Kb(g)){Kb(g,function(){sg(a,b,c)});return}}b.call(a,c)}
|
||||
function tg(a,b){var c=new L(a,"1.34.2",ug);if(qg(c)&&vg(c)){var d=c.get(wg),e=b?b.get(wg):"unknown";d!=e&&(a.da("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=mg.prototype;
|
||||
l.Ga=function(a){void 0===a&&(a=this.b||(this.M?xg:pg));if(!this.A){this.A++;var b=!1,c=!1;this.P=!1;var d=this.J||new L(this,"1.34.2");if(a==yg)b=!0;else if(a>pg){if(qg(d,this.M)){this.D=new L(this,"1.34.2",zg);qg(this.D)&&(Ag(this,d),a=Bg,Cg(this.D));this.D.set(wg,Ka());Dg(this.D);var e=this.b&&!this.L;if(a==xg||yb("Click OK to restore the previous "+Pb+" machine state, or CANCEL to reset the machine.")){if(c=vg(d)){var g=d.get("code"),f=d.get("data");g&&("ok"==g?qg(d,f):("error"==g&&"no machine state"!=
|
||||
f?(this.da("Error: "+f),"unable to verify user"==f&&(Ya(Eg,""),this.f=null)):this.i(g+": "+f),Cg(d),qg(d)?(c=vg(d),e=!0):c=!1))}e&&tg(this,c?d:null)}else a==Bg&&d.clear()}else tg(this);delete this.M;delete this.J}e=zb(this.id);for(g=0;g<e.length;g++)f=e[g],f!==this&&f!=this.u&&(c=Fg(this,f,d,b,c));b=[d,a,c];a!=yg?sg(this,this.pb,b):this.pb(b)}};
|
||||
function Fg(a,b,c,d,e){if(!b.v.U){b.v.U=!0;var g=null;try{if(e&&((g=c.get(b.id))||(g=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof g&&(g=null),!b.pa(g,d)&&g&&(u("Unable to restore state for "+b.type),a.N&&!a.W?(c.clear(),a.b=pg,window&&window.location.reload()):a.P=!0,b.pa(null),e=!1),!d&&b.hb){var f=b.hb.split("|");for(a=0;a<f.length;a++)b.status(f[a])}}catch(h){u("Error restoring state for "+b.type+" ("+h.message+")")}}return e}
|
||||
l.pb=function(a){var b=a[0],c=0>a[1];a=a[2];this.S=!0;this.v.U=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.u&&(Fg(this,this.u,b,c,a),M(this,-2),this.u.Z());this.P&&(Ag(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.A=0};
|
||||
function Ag(a,b){if(yb("There may be a problem with your "+Pb+" machine.\n\nTo help us diagnose it, click OK to send this "+Pb+" machine state to http://www.pcjs.org.")){var c=a.ba;a=a.f||"";b=b.toString();var d={};d.app=Pb;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;La("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function jg(a,b,c){var d,e="none";if(a.A)return null;a.A--;var g=new L(a,"1.34.2"),f=new L(a,"1.34.2",ug),h=Ka();f.set(wg,h);g.set(wg,h);g.set(Gg,"1.34.2");g.set(Hg,window?window.location.href:null);g.set(Ig,window?window.navigator.userAgent:"");a.u&&a.u.fa&&(c&&(b&&(a.u.v.Z=a.u.v.K),a.u.V()),d=a.u.fa(b,c),"object"===typeof d&&g.set(a.u.id,d),c&&(a.u.v.U=!1,!1===d&&(e=null)));for(var h=zb(a.id),k=0;k<h.length;k++){var m=h[k];m.v.U&&(m.fa&&(d=m.fa(b,c),"object"===typeof d&&g.set(m.id,d)),c&&(m.v.U=
|
||||
!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.f&&Jg(a,a.f,g.toString()),Dg(f)&&Dg(g)||(e=null,d=h=!0)):a.b&&(d=!0,h=a.b==Xg),d&&g.clear(h)):e=g.toString());c&&(a.v.U=!1,b=a.I.power)&&(b.textContent="Power");a.A=0;return e}
|
||||
function V(a,b,c){var d;if(b){b=He(a,b);for(var e=0,g=!1,f=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e<m.length;){var n=m[e++],r=n.length,n=Ia(n);if(!n){g=!0;break}n=Ie(a,n,null,!1===c);if(void 0===n){g=!0;c=!1;break}h.push(n);if(e==m.length)break;var n=m[e++],C=n.length;k.length&&Je[n]<Je[k[k.length-1]]&&Ge(h,k,1);k.push(n);b=b.substr(r+C)}Ge(h,k)&&1==h.length||(g=!0);g?c&&a.i("error parsing '"+f+"' at character "+(f.length-b.length)):(d=h.pop(),c&&Ke(a,null,
|
||||
d))}return d}function He(a,b){for(var c,d=a.la?"(":"{",e=a.la?")":"}",g=new RegExp(a.la?"\\((.*?)\\)":"\\{(.*?)\\}");(c=b.match(g))&&!(0<=c[1].indexOf(d));){var f=V(a,c[1]);b=b.replace(d+c[1]+e,null!=f?N(a,f):"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 Ie(a,b,c,d){var e;null!=b?(e=a.sb(b),0<=e?e=a.$a(e):(e=a.W[b],null==e&&(e=ta(b,a.ca))),null!=e||d||a.i("invalid "+(c?c:"value")+": "+b)):d||a.i("missing "+(c||"value"));return e}
|
||||
function Ke(a,b,c){var d,e=!1;if(void 0!==c){e=!0;d=c;var g=4,f="";if(!g||4<g)g=4;for(var h=0;h<g;h++){f&&(f=","+f);var k=d&255,m=void 0,n=8,r="";n?32<n&&(n=32):n=32;for(var C=null==k||isNaN(k),aa=m=m||n;0<n--;)aa||(r=","+r,aa=m),r=(C?"?":k&1?"1":"0")+r,k>>=1,aa--;f=r+f;d>>=8}d=t(c,0,!0)+" "+c+". "+va(c,0,!0)+" "+("0b"+f);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}
|
||||
function Le(a,b){if(b)return Ke(a,b,a.W[b]);var c=0;for(b in a.W)Ke(a,b,a.W[b]),c++;return 0<c}function N(a,b,c){c=void 0===c?0:c;switch(a.ca){case 8:b=va(b,0<c?(c+2)/3|0:0);break;case 10:(a=0<c?Math.ceil(.3*c):0)?11<a&&(a=11):a=b&-65536?10:5;b=ua(b,10,a);break;default:b=t(b,0<c?c+3>>2:0)}0>c?c=b.replace(/^0+([0-9A-F]+)$/i,"$1"):c=b;return c}var Je={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};
|
||||
function Me(a){Ee.call(this,a);this.wa=!1;this.la=!0;this.va=W();this.L=W(0);this.ja=W(0);this.ba=W(0);this.H=[];this.b=this.M=this.J=[];Ne(this);this.R=this.ka=0;this.f=[];this.sa=void 0;Oe(this);this.C=this;this.qa={};this.X=this.nb=0;this.S=null;this.O=[];Pe(this,a.messages);this.ua=a.commands;this.N=0;this.Ba=this.ta=null;this.D=this.Aa=this.za=this.ia=this.ra=0;this.ha=this.aa=null;var b=this;window?void 0===window[y]&&(window[y]=function(a){return hd(b,a)}):void 0===global[y]&&(global[y]=function(a){return hd(b,
|
||||
a)})}p(Me,Ee);function Y(a){a=a&&a.B;null==a&&(a=-1);return a}function W(a,b,c){return{B:void 0===a?null:a,qb:void 0===b?!1:b,ea:!1,ca:c}}function Qe(a,b,c,d){a.B=b;a.qb=c||!1;a.ea=!1;a.ca=d}function Re(a){return[a.B,a.qb,a.ca,a.ea,a.Pa]}function Se(a,b){var c=W(b[0],b[1],b[2]);c.ea=b[3];b[4]&&(c.lb=Fe(a,c.Pa=b[4]));return c}l=Me.prototype;
|
||||
l.xa=function(a,b,c,d){this.G=b;this.F=a;this.u=c;this.ha=a.w;(a=cd(a,"messages"))&&Pe(this,a);Te(this,function(a){a:{var b=d.G.b,c=a[0],e=a=0,k=b.length;if(c){a=Y(Z(d,c,d.ja));if(-1===a){d.i("invalid address: "+c);break a}e=a>>>d.G.f;k=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;k--;){var n=b[e];n.type==c?m++||d.i("..."):(c=n.type,m=Nc[c],n&&d.i(t(n.id,8)+" %"+t(e<<d.G.f,8)+" %"+t(n.B,8)+" "+t(n.Ha,
|
||||
4,!0)+" "+t(n.size,4,!0)+" "+m),c!=Rc&&(c=-1),m=0);a+=16384;e++}}});B(this)};
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case "debugInput":return this.aa=this.I[b]=c,c.onkeydown=function(a){var b;if(13==a.keyCode)b=c.value,c.value="",hd(d,b,!0);else if(27==a.keyCode)c.value=b="";else if(38==a.keyCode?(b=null,d.A<d.w.length-1&&(b=d.w[++d.A])):40==a.keyCode&&(0<d.A?b=d.w[--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.I[b]=c,cb(c,function(){if(d.aa){var a=d.aa.value;
|
||||
d.aa.value="";hd(d,a,!0);return!0}return!1}),!0;case "step":return this.I[b]=c,cb(c,function(a){var b=!1;Lb(d,!0)||(Mb(d,!0),b=zc(d,a?1:0,null),Mb(d,!1));return b}),!0}return!1};function gd(a){if(a.aa){var b=0,c=0;window&&(b=window.scrollX,c=window.scrollY);a.aa.focus();window&&window.scrollTo(b,c)}}l.ya=function(a,b){var c=-1,d=Y(a);-1!==d&&(c=Fc(this.G,d),b&&null!=a.B&&(a.B+=b||1));return c};l.eb=function(a,b,c){var d=Y(a);-1!==d&&(Ec(this.G,d,b),c&&null!=a.B&&(a.B+=c||1),M(this.F,-1))};
|
||||
function Z(a,b,c){var d,e;c||(c=W());var g=c.B;if(void 0!==b){b=He(a,b);"%"==b.charAt(0)&&(d=!0,b=b.substr(1));var f,g=b,h;if(g.match(/^[a-z_][a-z0-9_]*$/i))for(var g=g.toUpperCase(),k=0;k<a.H.length;k++){var m=a.H[k].T[g];if(null!=m){h=m.o;break}}null!=h&&(f=W(h));if(f)return f;0<=b.indexOf("0x")?e=16:0<=b.indexOf("0o")?e=8:0<=b.indexOf(".")&&(e=10);g=V(a,b,void 0)}null!=g&&Qe(c,g,d,e);return c}function Ue(a,b,c){c&&(c=c.match(/(['"])(.*?)\1/))&&(b.lb=Fe(a,b.Pa=c[2]))}
|
||||
function Ve(a){return va(a/Qb,6)+" "+va(a%Qb,6)}function Pe(a,b){a.C=a;a.X=a.nb=536870916;a.S=null;a.O=[];b=Fe(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in K){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.X|=K[c],a.i(c+" messages enabled"))}}function Te(a,b){for(var c in K)if(16==K[c]){a.qa[c]=b;break}}l.sb=function(a){return We.indexOf(a.toUpperCase())};
|
||||
l.$a=function(a){var b;switch(a){case Xe:b=this.u.w;break;case Ye:b=this.u.H;break;case Ze:b=this.u.f;break;case $e:b=this.u.ib?1:0;break;case af:b=this.u.Aa?1:0;break;case bf:b=this.u.la?1:0;break;case cf:b=this.u.ub?1:0;break;case df:b=this.u.Sa?1:0}return b};
|
||||
l.message=function(a,b){b&&(a+=" @"+N(this,W(this.u.sa).B));if(!this.S||a!=this.S)if(this.S=a,this.X&1073741824)this.O.push(a);else{var c;if(this.X&-2147483648&&this.u&&(c=this.u.v.K)||Lb(this,!0))this.V(),c&&(a+=" (cpu halted)");this.i(a);this.u&&(a=this.u,Jd(a),a.ba=0,a.F&&M(a.F,void 0))}};
|
||||
function Oe(a){var b;if(!Qd(a))a.f&&a.f.length&&a.i("instruction history buffer freed"),a.R=0,a.f=[];else if(!a.f||!a.f.length){a.f=Array(ef);for(b=0;b<a.f.length;b++)a.f[b]=W();a.R=0;a.i("instruction history buffer allocated")}}function ff(a,b,c){if(!Of(a,c))return!1;yc(a.u,b);return!0}
|
||||
function zc(a,b,c,d){if(!Of(a))return!1;var e="";null===c&&(e=(c=!a.ta||"tr"==a.ta)?"tr":"t");a.D=0;b||Qd(a)&&Rd(a,a.u.w,0);try{b=nd(a.u,b);var g=a.u.Ja(b);0<g&&(Ac(a.u,g),a.D+=g,Bc(a.u,g,!0),Cc(a.u,g),a.ia++)}catch(f){"number"!=typeof f&&(a.D=0,Ib(a.u,f.stack||f.message))}!1!==d&&(a.ha&&a.ha.stop(),M(a.F,-1));fd(a,c||!1,e);return 0<a.D}l.V=function(a){this.u&&this.u.V(a)};function fd(a,b,c){b=void 0===b?!0:b;a.wa&&(c&&a.i(Qf+c),Qe(a.L,a.u.w),b&&1!=a.N?Rf(a):Sf(a))}
|
||||
function Of(a,b){var c;(c=!a.u||!Kb(a.u))||(c=a.u,c.v.U?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.u.v.K?(b||a.i("cpu busy or unavailable, command ignored"),!1):!Jb(a.u)}l.pa=function(a,b){return!b&&(this.reset(!0),a)?this.restore(a):!0};l.fa=function(a,b){b&&this.i(a?"suspending":"shutting down");return a?this.save():!0};l.reset=function(a){Oe(this);this.ia=0;this.S=null;this.D=0;Qe(this.L,this.u.w);this.v.K=!1;Tf(this);a||fd(this)};
|
||||
l.save=function(){var a=new L(this);a.set(0,Re(this.L));a.set(1,Re(this.ja));a.set(2,Re(this.ba));a.set(3,[this.w,this.P,this.X]);a.set(4,this.H);return a.data()};l.restore=function(a){var b=0;void 0!==a[3]&&(this.L=Se(this,a[b++]),this.ja=Se(this,a[b++]),this.ba=Se(this,a[b++]),this.w=a[b][0],"string"==typeof this.w&&(this.w=[this.w]),this.P=a[b][1],this.X|=a[b][2]);a[4]&&(this.H=a[4]);return!0};l.start=function(a,b){this.N||this.i("running");this.v.K=!0;this.za=a;this.Aa=b};
|
||||
l.stop=function(a,b){if(this.v.K){this.v.K=!1;this.D=b-this.Aa;if(!this.N){b="stopped";if(this.D){a-=this.za;var c=0<a?Math.round(1E3*this.D/a):0;b+=" (";Qd(this)&&(b+=this.ia+" instructions, ",this.ia=0);b+=this.D+" cycles, "+a+" ms, "+c+" hz)"}else Nb(this,-2147483648)&&(b+=" (use the 't' command to execute blocked faults)");this.i(b)}fd(this,!0);gd(this);Tf(this,this.u.w);this.S=null}};function Qd(a){return 1<a.b.length||!!a.ka}
|
||||
function Rd(a,b,c){var d=-1;c||(d=a.u.g(b),2756==d>>23&&a.u.sa==b&&(b=Od(a.u,1)));if(0<c&&(a.ka&&!--a.ka||$c(a,b,1,a.b)))return!0;0<=c&&a.f.length&&(a.ia++,0>d&&(d=a.u.g(b)),0<=d&&(Qe(a.f[a.R],b),++a.R==a.f.length&&(a.R=0)));return!1}
|
||||
function Uf(a,b,c,d){var e=W(b.B),g=a.ya(b,1),f,h,k,m=0,n=g/Yb|0,r;for(r in Vf)if(f=Vf[r][n&r]){h=+r;n>>=6;switch(h){case 32512:k=Wf;m=n&3;break;case 32256:k=Xf;m=n&7;break;case 29248:k=Yf,m=(n&48)>>2|(n&6)>>1}break}k=k&&k[m]||"";"S"==k&&f>Zf&&(k="B");k=$f[f||0]+k;k=Ha(k,8);f?(k=28700==h?k+N(a,g/Zb&127,-1):k+N(a,g>>23&15,-1),k+=",",g&4194304&&(k+="@"),k+=N(a,g&262143,-1),(g=g>>18&15)&&(k+="("+N(a,g,-1)+")")):k+=Ve(g);g=k;f="";h=N(a,e.B)+":";if(-1!==e.B&&-1!==b.B){do if(k=a.ya(e,1),f+=" "+Ve(k),null==
|
||||
e.B)break;while(e.B!=b.B)}h+=Ha(f,16)+g;c&&(h=Ha(h,48)+";"+(c||""),h=a.u.v.Ea?h+("cycles="+id(a.u).toString()+" cs="+t(a.u.ua)):h+(null!=d?"="+d.toString():""));return h}function Ne(a){var b,c;a.b=["bp"];if(a.M)for(b=1;b<a.M.length;b++){c=a.M[b];c=Y(c);var d=a.G;Zc(d.b[c>>>d.f],!1)}a.M=["br"];if(a.J)for(b=1;b<a.J.length;b++)c=a.J[b],c=Y(c),d=a.G,Zc(d.b[c>>>d.f],!0);a.J=["bw"];a.ra=0;a.ka=0}
|
||||
l.Da=function(a,b,c){var d=!0;c||ag(this,a,b,!1,!0);if(a!=this.b){var e=Y(b);if(-1===e)this.i("invalid address: "+N(this,b.B)),d=!1;else{var g=this.G;g.b[e>>>g.f].Da(e&16383,a==this.J)}}d&&(a.push(b),c?b.ea=!0:(bg(this,a,a.length-1,"set"),Oe(this)));return d};function ag(a,b,c,d,e){var g=!1;c=Y(c);for(var f=1;f<b.length;f++){var h=b[f];if(c==Y(h)&&(!d||h.ea)){g=!0;h.ea||e||bg(a,b,f,"cleared");b.splice(f,1);b!=a.b&&(d=a.G,Zc(d.b[c>>>d.f],b==a.J));h.ea||Oe(a);break}}return g}
|
||||
function cg(a,b){for(var c=1;c<b.length;c++)bg(a,b,c);return b.length-1}function bg(a,b,c,d){c=b[c];a.i(b[0]+" "+N(a,c.B)+(d?" "+d:c.Pa?' "'+c.Pa+'"':""))}function Tf(a,b){if(void 0!==b)$c(a,b,1,a.b,!0),a.N=0;else for(b=1;b<a.b.length;b++){var c=a.b[b];if(c.ea){if(!ag(a,a.b,c,!0))break;b=0}}}
|
||||
function $c(a,b,c,d,e){var g=!1;if(!a.ra++)for(var f=1;!g&&f<d.length;f++){var h=d[f];if(!e||h.ea)for(var k=Y(h)&(d==a.b?65535:-1),m=0;m<c;m++)if(b+m==k){var n,g=!0;h.ea&&(ag(a,d,h,!0),e=!0);if(n=h.lb){for(var g=!1,r=0;r<n.length;r++)if(!dg(a,n[r],!0)){if(n[r].indexOf("if")){g=!0;break}for(var C=r+1;C<n.length&&n[C].indexOf("else");C++)r++;if(C==n.length){g=!0;break}}a.u.v.K||(g=!0)}if(g){e||bg(a,d,f,"hit");break}}}a.ra--;return g}
|
||||
function eg(a,b){b=void 0===b?!0:b;for(var c="",d=0;16>d;d++){!d||d&3||(c+="\n");var e=a,g=va(d,2);Qe(e.va,d);g+="="+N(e,e.ya(e.va),36)+" ";c+=g}if(b){b="";for(d=0;d<We.length;d++)(e=We[d]||"")&&(e+="="+N(a,a.$a(d),d>=$e?1:d==Ye?23:18)+" "),b+=e;c+="\n"+b}return c}l.ob=function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0};
|
||||
function ye(a,b,c,d,e){var g=[],f;for(f in e){var h=e[f];"number"==typeof h&&(e[f]=h={o:h});var k=h.o,m=h.a;if(void 0!==k){var n=g,k=[k>>>0,f],r=Ja(n,k,a.ob);0>r&&n.splice(-(r+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.H.push({fd:b,B:c,Fb:d,T:e,mb:g})}function fg(a,b,c){var d=[],e=Y(b)>>>0;for(b=0;b<a.H.length;b++){var g=a.H[b],f=g.B>>>0,h=g.Fb;if(e>=f&&e<f+h){e=Ja(g.mb,[e-f],a.ob);0<=e?gg(a,b,e,d):c&&(e=~e,gg(a,b,e-1,d),gg(a,b,e,d));break}}return d}
|
||||
function gg(a,b,c,d){var e={},g=a.H[b].mb,f=0,h=null;0<=c&&c<g.length&&(f=g[c][0],h=g[c][1]);h&&(e=a.H[b].T[h],h="."==h.charAt(0)?null:e.l||h);d.push(h);d.push(f);d.push(e.a);d.push(e.c)}function hg(a,b){var c=b.match(/^\s*([A-Z_]?[A-Z0-9_]*)\s*(=?)\s*(.*)$/i);if(c){if(!c[1])return Le(a)||a.i("no variables"),!0;if(!c[2])return Le(a,c[1]);if(!c[3])return delete a.W[c[1]],!0;b=V(a,c[3]);return void 0!==b?(a.W[c[1]]=b,!0):!1}a.i("invalid assignment:"+b);return!1}
|
||||
function ig(a,b,c){var d=null;if(b=Z(a,b)){var e=fg(a,b,!0);if(e.length){var g,f;e[0]&&(f="",(g=b.B-e[1])&&(f=" + "+t(g,4,!0)),g=e[0]+" ("+N(a,e[1])+")"+f,c&&a.i(g),d=g);4<e.length&&e[4]&&(f="",(g=e[5]-b.B)&&(f=" - "+t(g,4,!0)),g=e[4]+" ("+N(a,e[5])+")"+f,c&&a.i(g),d||(d=g))}else c&&a.i("no symbols")}return d}
|
||||
function Rf(a,b){var c;if(b&&"?"==b[1])a.i("register commands:"),a.i("\tr\tdump registers"),a.i("\trm\tdump misc registers"),a.i("\trx [#]\tset flag or register x to [#]");else{var d=a.u,e=void 0;null==c&&(c=!0);if(b&&1<b.length){var g=b[1];if("m"==g)e=!0;else{var f=g.indexOf("=");if(0<f)b=g.substr(f+1),g=g.substr(0,f);else if(2<b.length)b=b[2];else{a.i("missing value for "+b[1]);return}f=V(a,b);if(void 0===f)return;switch(g.toUpperCase()){case "PC":d.w=f%Qb;Qe(a.L,d.w);break;default:a.i("unknown register: "+
|
||||
g);return}M(a.F);a.i("updated registers:")}}a.i(eg(a,e));c&&(Qe(a.L,d.w),Sf(a,N(a,a.L.B)))}}function jg(a,b){b=Ia(b);var c=b.match(/^(['"])(.*?)\1$/);c?1<c[2].length?a.i(c[2]):Ke(a,null,c[2].charCodeAt(0)):V(a,b,!0)}
|
||||
function kg(a,b,c){if("?"==c)a.i("trace commands:"),a.i("\tt [#]\ttrace # instructions"),a.i("\ttr [#]\ttrace # instructions with register updates"),a.i("\ttc [#]\ttrace # cycles"),a.i("note: bn [#] breaks after # instructions without updates");else{var d="t"!=b;c=Ie(a,c,null,!0)||1;var e=0;"tc"==b&&(e=c,c=1);a.ta=b;bb(c,function(){return Mb(a,!0)&&zc(a,e,d,!1)},function(){a.ha&&a.ha.stop();M(a.F,-1);Mb(a,!1)})}}
|
||||
function Sf(a,b,c,d){if(b=Z(a,b,a.L)){void 0===d&&(d=1);var e=256;if(void 0!==c)if("l"==c.charAt(0))c=Ie(a,c.substr(1)),null!=c&&(d=c);else{d=Z(a,c);if(!d||d.B<b.B)return;e=d.B-b.B;if(256<e){a.i("range too large");return}d=-1}for(c=0;0<e&&d--;){var g=Lb(a,!1)||a.N?a.D:null,f=null!=g?"cycles":null,h=fg(a,b),k=b.B;if(h[0]&&d&&(!c&&d||0>h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.i(m)}h[3]&&(f=h[3],g=null);h=a.ba;m=b;h.B=m.B;h.ea=m.ea;h.ca=m.ca;a.i(Uf(a,b,f,g));e-=b.B-k;c++}}}
|
||||
function dg(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(Qf+b):(a.P&&(a.i("ended assemble at "+N(a,a.ba.B)),a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Kb(a)&&0<b.length){a.P&&(b="a "+N(a,a.ba.B)+" "+b);var g=!1,f=b.replace(/ +/g," ").split(" ");f[0]=f[0].toLowerCase();if(f&&f.length)for(var h=f[0],k=h.charAt(0),m=1;m<h.length;m++){var n=h.charAt(m);if("?"==k||"r"==k||"a">n||"z"<n){f[0]=h.substr(m);f.unshift(h.substr(0,m));break}}switch(f[0].charAt(0)){case "a":var r=Z(a,
|
||||
f[1],a.ba);if(r){var C=f[2];if(void 0==C)a.i("begin assemble at "+N(a,r.B)),a.P=!0,M(a.F);else{f.shift();f.shift();f.shift();var aa,gf=f.join(""),A=-1,nc,Mg=C.toUpperCase(),pd;for(pd in Vf){var Pa;nc=+pd;var hf=Vf[pd];switch(nc){case 32512:Pa=Wf;break;case 32256:Pa=Xf;break;case 29248:Pa=Yf;break;default:Pa=[""]}var jf,qd;for(qd in hf){for(var kf=hf[qd],Qa=0;Qa<Pa.length;Qa++){var rd=Pa[Qa];"S"==rd&&kf>Zf&&(rd="B");if(Mg==$f[kf]+rd){jf=29248!=nc?Qa:(Qa&3)<<1|(Qa&12)<<2;A=(qd|jf<<6)*Yb;break}}if(0<=
|
||||
A)break}if(0<=A)break}if(0<=A)if(gf)for(var sd=gf.split(","),nb=0;nb<sd.length;nb++){var oc=sd[nb].trim();if(oc){if(1<nb){a.i("too many operands: "+oc);A=-1;break}var ba=oc.match(/(@?)([^(]*)\(?([^)]*)\)?/);if(!ba){a.i("unknown operand: "+oc);A=-1;break}var J=V(a,ba[2]);if(void 0==J){A=-1;break}if(!nb&&1<sd.length)if(28700==nc){if(0>J||127<J){a.i("device code out of range: "+ba[2]);A=-1;break}A+=J*Zb}else{if(0>J||15<J){a.i("accumulator address out of range: "+ba[2]);A=-1;break}A+=J<<23}else{if(0>
|
||||
J||262143<J){a.i("memory address out of range: "+ba[2]);A=-1;break}A+=J;if(ba[3]){J=V(a,ba[3]);if(void 0==J){A=-1;break}if(0>J||15<J){a.i("memory index out of range: "+ba[3]);A=-1;break}A+=J<<18}ba[1]&&(A+=4194304)}}}else a.i("missing operand(s)"),A=-1;else a.i("unknown instruction: "+C);aa=A;0<=aa&&(a.eb(r,aa),a.i(Uf(a,r)))}}break;case "b":a:{var Ng=f[0],Ra=f[1],Og=b;if("?"==Ra)a.i("breakpoint commands:"),a.i("\tbp #\tset exec breakpoint"),a.i("\tbr #\tset read breakpoint"),a.i("\tbw #\tset write breakpoint"),
|
||||
a.i("\tbc #\tclear breakpoint (* to clear all)"),a.i("\tbl\tlist all breakpoints"),a.i("\tbn [#]\tbreak after # instruction(s)");else{var za=Ng.charAt(1);if("l"==za){var td;td=0+cg(a,a.b);td+=cg(a,a.M);(td+=cg(a,a.J))||a.i("no breakpoints")}else if("n"==za){var lf=+Ra||0;Ra&&(a.ka=lf);a.i("break after "+lf+" instruction(s)")}else if(void 0===Ra)a.i("missing breakpoint address");else{var P=W();if("*"!=Ra&&(P=Z(a,Ra,a.L),!P))break a;"c"==za?null==P.B?(Ne(a),a.i("all breakpoints cleared")):ag(a,a.b,
|
||||
P)||ag(a,a.M,P)||ag(a,a.J,P)||a.i("breakpoint missing: "+N(a,P.B)):null!=P.B&&(Ue(a,P,Og),"p"==za?a.Da(a.b,P):"r"==za?a.Da(a.M,P):"w"==za?a.Da(a.J,P):a.i("unknown breakpoint command: "+za))}}}break;case "c":a.oa&&(a.oa.value="");break;case "d":a:{var Sa,Ta=f[0],ca=f[1],oa=f[2],Pg=f[3];if("?"==ca){var Ua="";for(Sa in K)a.qa[Sa]&&(Ua&&(Ua+=","),Ua+=Sa);Ua+=",state,symbols";a.i("dump memory commands:");a.i("\tdw [a] [n] dump n words at address a");a.i("\tds [a] [n] dump n words at address a as JSON");
|
||||
a.i("\tdh [p] [n] dump n instructions from history position p");Ua.length&&a.i("dump extension commands:\n\t"+Ua)}else if("state"==ca){var ud=lg(a.F,!0);"console"==oa?console.log(ud):(a.oa&&(a.oa.value=""),ud&&a.i(ud))}else if("symbols"==ca)for(var vd=0;vd<a.H.length;vd++){var wd=a.H[vd],Va;for(Va in wd.T)if("."!=Va.charAt(0)){var mf=wd.T[Va].o;if(void 0!==mf){var nf=wd.T[Va].l;nf&&(Va=nf);a.i(N(a,mf)+" "+Va)}}}else{if("d"==Ta){for(Sa in K)if(f[1]==Sa){var of=a.qa[Sa];of?(f.shift(),f.shift(),of(f)):
|
||||
a.i("no dump registered for "+ca);break a}ca||(Ta=a.Ba||"dw")}else a.Ba=Ta;if("dh"==Ta){var pf=ca,qf=oa,rf="",sf=0,X=a.R,da=a.f;if(da.length){var T=+pf||a.sa,pb=+qf||10;isNaN(T)?T=pb:rf="more ";T>da.length&&(a.i("note: only "+da.length+" available"),T=da.length);X-=T;0>X&&(null==da[da.length-1].B?(T=X+T,X=0):X+=da.length);var xd=[];"call"==qf&&(pb=1E5,xd=["CALL"]);for(void 0!==pf&&a.i(T+" instructions earlier:");0<pb&&X!=a.R;){var tf=da[X++];if(null==tf.B)break;var qb=W(tf.B),Qg=T--,uf=Uf(a,qb,"history",
|
||||
Qg);(!xd.length||0<=uf.indexOf(xd[0]))&&a.i(uf);qb.Ya&&(X+=qb.Ya,pb-=qb.Ya,T-=qb.Ya);X>=da.length&&(X=0);a.sa=T;sf++;pb--}}sf||(a.i("no "+rf+"history available"),a.sa=void 0)}else{var Wa=Z(a,ca,a.ja);if(Wa){var Aa=0,vf="ds"==Ta;if(oa){if("l"==oa.charAt(0))oa=oa.substr(1)||Pg,Aa=Ie(a,oa);else{var wf=Z(a,oa);wf&&(Aa=wf.B-Wa.B)}0>Aa&&(Aa=0);65536<Aa&&(Aa=65536)}var Rg=a.ca;Wa.ca&&(a.ca=Wa.ca);for(var xf="db"==Ta?1:2,yd=Aa||32,zd=1==xf?2:4,Sg=(yd+zd-1)/zd|0||1,Ba="";Sg--&&0<yd;){for(var Ca="",yf="",ca=
|
||||
N(a,Wa.B),zf=zd;0<zf--&&0<yd--;){var pc=a.ya(Wa,1);vf?(Ca&&(Ca+=","),Ca+=pc):(Ca+=Ve(pc),Ca+=" ");for(var Af=0;1==xf&&6>Af;Af++)yf+=String.fromCharCode((pc%64|0)+32),pc/=64}Ba&&(Ba+="\n");Ba=vf?Ba+(Ca+","):Ba+(ca+": "+Ca+(0>zf?" "+yf:""))}Ba&&a.i(Ba);a.ca=Rg}}}}break;case "e":if("else"==f[0])break;var Bf,Cf,Df=f[0],Ad=f[1];"e"==Df||"ew"==Df?(Bf=a.ya,Cf=a.eb):Ad=null;if(null==Ad)a.i("edit memory commands:"),a.i("\tew [a] [...] edit words at address a");else{var qc=Z(a,Ad,a.ja);if(qc)for(var rc=2;rc<
|
||||
f.length;rc++){var Bd=V(a,f[rc]);if(void 0===Bd){a.i("unknown value: "+f[rc]);break}a.i("changing "+N(a,qc.B)+" from "+Ve(Bf.call(a,qc))+" to "+Ve(Bd));Cf.call(a,qc,Bd,1)}}break;case "g":a:{var Ef=f[1],Tg=b;if(void 0!==Ef){var Cd=Z(a,Ef);if(!Cd)break a;Ue(a,Cd,Tg);a.Da(a.b,Cd,!0)}ff(a,!0,c)}break;case "h":a.v.K?(c||a.i("halting"),a.V()):Lb(a,!0)||c||a.i("already halted");break;case "i":if("if"==f[0]){var Dd;var rb=b.substr(2),rb=Ia(rb);V(a,rb)?(c||a.i("true: "+rb),Dd=!0):(c||a.i("false: "+rb),Dd=
|
||||
!1);Dd||(d=!1);break}g=!0;break;case "k":var Ug=f[0];if("?"==f[1])a.i("stack trace commands:"),a.i("\tk\tshow frame addresses"),a.i("\tks\tshow symbol information");else{var Ed=0,Fd=W(),sb=W();for(a.i("stack trace for "+N(a,sb.B));10>Ed;){for(var Da=null,Vg=256;65536>sb.B>>>0;){Fd.B=a.ya(sb,2);if(null==sb.B||!Vg--)break;if(!(Fd.B&1)){for(var Wg=a,sc=Fd,Ff=null,tb=sc.B,Gf=tb,Gd=1;6>=Gd&&tb;Gd++){if(2<Gd){sc.B=tb;var tc=Uf(Wg,sc);if(0<=tc.indexOf("JSR")){var Hf=tc.indexOf(" ");if(tb+(tc.indexOf(" ",
|
||||
Hf+1)-Hf-1)/2==Gf){Ff=tc;break}}}tb-=2}sc.B=Gf;if(Da=Ff)break}}if(!Da||null==Da)break;var If=null;if("ks"==Ug){var Jf=Da.match(/[0-9A-F]+$/);Jf&&(If=ig(a,Jf[0]))}Da=Ha(Da,50)+" ;"+(If||"stack="+N(a,sb.B));a.i(Da);Ed++}Ed||a.i("no return addresses found")}break;case "l":if("ln"==f[0]){ig(a,f[1],!0);break}g=!0;break;case "m":a:{var ea,fa=null,D=f[1];"?"==D&&(D=void 0);if(void 0!==D){var pa=0;if("all"==D)pa=1879046143,D=null;else if("on"==D)fa=!0,D=null;else if("off"==D)fa=!1,D=null;else{"keys"==D&&
|
||||
(D="key");"kbd"==D&&(D="keyboard");for(ea in K)if(D==ea){pa=K[ea];fa=!!(a.X&pa);break}if(!pa){a.i("unknown message category: "+D);break a}}if(pa)if("on"==f[2])a.X|=pa,fa=!0;else if("off"==f[2]&&(a.X&=~pa,fa=!1,1073741824==pa)){for(var Kf=1E3<=a.O.length?a.O.length-1E3:0;Kf<a.O.length;)a.i(a.O[Kf++]);a.O=[]}}var Xg=0,ub="";for(ea in K)if(!D||D==ea){var Yg=!!(a.X&K[ea]);if(null===fa||fa==Yg)ub&&(ub+=","),++Xg%10||(ub+="\n\t"),"key"==ea&&(ea="keys"),ub+=ea}void 0===D&&a.i("message commands:\n\tm [category] [on|off]\tturn categories on/off");
|
||||
a.i((null!==fa?fa?"messages on: ":"messages off: ":"message categories:\n\t")+(ub||"none"));Oe(a)}break;case "p":if("print"==f[0]){jg(a,b.substr(5));break}var Lf=f[0],Mf="p"==Lf?0:"pr"==Lf?1:-1;if("?"==f[1]||0>Mf)a.i("step commands:"),a.i("\tp\tstep over instruction"),a.i("\tpr\tstep over instruction with register update");else if(a.N)a.i("step in progress");else{var Nf=W(a.u.w);a.ya(Nf);a.N?(a.Da(a.b,Nf,!0),ff(a)||(a.F&&md(a.F),a.N=0)):kg(a,Mf?"tr":"t")}break;case "r":if("reset"==b){a.F&&a.F.reset();
|
||||
break}Rf(a,f);break;case "s":a:switch(f[1]){case "base":if(f[2]){var vb=+f[2];if(8==vb||10==vb||16==vb)a.ca=vb;else{a.i("invalid base: "+vb);break}}a.i("default base: "+a.ca);break;case "cs":var wb;void 0!==f[3]&&(wb=+f[3]);switch(f[2]){case "int":a.u.ha=wb;break;case "start":a.u.va=wb;break;case "stop":a.u.ja=wb;break;default:a.i("unknown cs option");break a}void 0!==wb&&ed(a.u);a.i("checksums "+(a.u.v.Ea?"enabled":"disabled"));break;case "sp":void 0!==f[2]&&(jd(a.u,+f[2])||a.i("warning: using 1x multiplier, previous target not reached"));
|
||||
a.i("target speed: "+(a.u.W.toFixed(2)+"Mhz")+" ("+a.u.aa+"x)");break;default:if(f[1]){a.i("unknown option: "+f[1]);break}case "?":a.i("debugger options:"),a.i("\tbase #\t\tset default base to #"),a.i("\tcs int #\tset checksum cycle interval to #"),a.i("\tcs start #\tset checksum cycle start count to #"),a.i("\tcs stop #\tset checksum cycle stop count to #"),a.i("\tsp #\t\tset speed multiplier to #")}break;case "t":kg(a,f[0],f[1]);break;case "u":Sf(a,f[1],f[2],8);break;case "v":if("var"==f[0]){hg(a,
|
||||
b.substr(3))||(d=!1);break}if("ver"==f[0]){a.i((Pb||"PDP10")+" version 1.34.2 ("+a.u.jb+",RELEASE)");a.i(window?window.navigator.userAgent:"");break}g=!0;break;case "?":if(f[1]){jg(a,b.substr(1));break}var Hd="commands:",Id;for(Id in mg)Hd+="\n"+Ha(Id,9)+mg[Id];Qd(a)||(Hd+="\nnote: history disabled if no exec breakpoints");a.i(Hd);break;default:g=!0}g&&(a.i("unknown command: "+b),d=!1)}}catch(Pf){a.i("debugger error: "+(Pf.stack||Pf.message)),d=!1}return d}
|
||||
function hd(a,b,c){b=Fe(a,b,c);for(var d in b)if(!dg(a,b[+d]))return!1;return!0}
|
||||
var mg={"?":"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"},Zf=20,$f=".WORD HLL HLLZ HLLO HLLE HRL HRLZ HRLO HRLE HRR HRRZ HRRO HRRE HLR HLRZ HLRO HLRE MOVE MOVS MOVN MOVM EXCH BLT PUSH POP LDB DPB IBP ILDB IDPB SETZ SETO SETA SETCA SETM SETCM AND ANDCA ANDCM ANDCB IOR ORCA ORCM ORCB XOR EQV LSH LSHC ROT ROTC ADD SUB MUL IMUL DIV IDIV ASH ASHC FSC FADR FSBR FMPR FDVR DFN UFA FAD FSB FMP FDV AOBJP AOBJN CAI CA JUMP SKIP AOJ AOS SOJ SOS TR TL TD TS XCT JFFO JFCL JSR JSP JRST JSA JRA PUSHJ POPJ BLKI DATAI BLKO DATAO CONO CONI CONSZ CONSO UUO".split(" "),
|
||||
Xe=0,Ye=1,Ze=2,$e=3,af=4,bf=5,cf=6,df=7,We="PC RA EA C0 C1 OV ND PD".split(" "),ng={},Vf=(ng[28672]={0:101},ng[32704]={5632:64,5696:63,5760:58,5824:27,5888:28,5952:25,6016:29,6080:26,10240:56,10304:48,10368:46,10432:84,10496:57,10560:49,10624:47,10752:21,10816:22,10880:69,10944:70,11008:88,11072:85,11136:83,11264:91,11328:23,11392:24,11456:92,11520:86,11584:87,11648:89,11712:90},ng[32512]={6144:65,6400:59,6656:66,6912:60,7168:67,7424:61,7680:68,7936:62,8192:17,8448:18,8704:19,8960:Zf,9216:53,9472:52,
|
||||
9728:55,9984:54,11776:50,12032:51,16384:30,16640:36,16896:37,17152:34,17408:38,17664:32,17920:44,18176:40,18432:39,18688:45,18944:33,19200:41,19456:35,19712:42,19968:43,20224:31,20480:1,20736:5,20992:2,21248:6,21504:3,21760:7,22016:4,22272:8,22528:9,22784:13,23040:10,23296:14,23552:11,23808:15,24064:12,24320:16},ng[32256]={12288:71,12800:72,13312:73,13824:74,14336:75,14848:76,15360:77,15872:78},ng[29248]={24576:79,24640:80,25088:81,25152:82},ng[28700]={28672:93,28676:94,28680:95,28684:96,28688:97,
|
||||
28692:98,28696:99,28700:100},ng),Wf=["","I","M","S"],Xf=" L E LE A GE N G".split(" "),Yf="N NE NA NN Z ZE ZA ZN C CE CA CN O OE OA ON".split(" "),ef=1E3,Qf=">> ";eb(function(){for(var a=z(document,y,"debugger"),b=0;b<a.length;b++){var c=a[b],d=x(c),d=new Me(d);Cb(d,c)}});
|
||||
function og(a,b,c){v.call(this,"Computer",a,33554432);this.v.U=!1;this.R=null;pg(this,b);this.O=cd(this,"autoPower",a,6);this.A=0;this.aa=+a.busWidth||+a.buswidth;this.M=this.H=this.N=null;this.L=this.W=!1;this.J=this.D=null;this.S=this.P=!1;this.ba=cd(this,"url")||"";(Math.random()+.1).toString(36);this.f=qg(this);if(this.u=Bb("CPU",this.id)){this.C=Bb("Debugger",this.id);this.G=new Gc({id:this.La+".bus",busWidth:this.aa},this.u,this.C);var d,e=zb(this.id);if((this.w=Bb("Panel",this.id))&&this.w.oa)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.da=this.w.da,d.i=this.w.i,d.oa=this.w.oa;this.i(Pb+" v1.34.2\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.xa&&d.xa(this,this.G,this.u,this.C);b=null;d=cd(this,"resume",a);void 0!==d&&(1<d.length?b=this.H=d:this.b=parseInt(d,10));var g;if(a=cd(this,"state")||(g=!0,a.state))this.N=b=a,g||(this.L=!0,this.b=rg),this.b&&(this.J=new L(this,"1.34.2"),sg(this.J)?b=null:
|
||||
delete this.J);!b&&this.b&&(b=tg(this))&&(this.L=!0);if(b){var f=this;La(b,null,!0,function(a,b,c){c?(f.H=null,f.L=!1,f.da("Unable to load machine state from server (error "+c+(b?": "+Ia(b):"")+")")):(f.M=b,f.W=!0);B(f)})}else B(this);this.I.power||(this.O=!0);!c&&this.O&&ug(this,this.Ga)}else u("Unable to find CPU component")}p(og,v);function pg(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.R=b}
|
||||
function cd(a,b,c,d){var e=b.toLowerCase(),e=$a(b)||$a(e);void 0===e&&a.R&&(e=a.R[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}function ug(a,b,c){for(var d=zb(a.id),e=0;e<=d.length;e++){var g=e<d.length?d[e]:a;if(!Kb(g)){Kb(g,function(){ug(a,b,c)});return}}b.call(a,c)}
|
||||
function vg(a,b){var c=new L(a,"1.34.2",wg);if(sg(c)&&xg(c)){var d=c.get(yg),e=b?b.get(yg):"unknown";d!=e&&(a.da("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=og.prototype;
|
||||
l.Ga=function(a){void 0===a&&(a=this.b||(this.M?zg:rg));if(!this.A){this.A++;var b=!1,c=!1;this.P=!1;var d=this.J||new L(this,"1.34.2");if(a==Ag)b=!0;else if(a>rg){if(sg(d,this.M)){this.D=new L(this,"1.34.2",Bg);sg(this.D)&&(Cg(this,d),a=Dg,Eg(this.D));this.D.set(yg,Ka());Fg(this.D);var e=this.b&&!this.L;if(a==zg||yb("Click OK to restore the previous "+Pb+" machine state, or CANCEL to reset the machine.")){if(c=xg(d)){var g=d.get("code"),f=d.get("data");g&&("ok"==g?sg(d,f):("error"==g&&"no machine state"!=
|
||||
f?(this.da("Error: "+f),"unable to verify user"==f&&(Ya(Gg,""),this.f=null)):this.i(g+": "+f),Eg(d),sg(d)?(c=xg(d),e=!0):c=!1))}e&&vg(this,c?d:null)}else a==Dg&&d.clear()}else vg(this);delete this.M;delete this.J}e=zb(this.id);for(g=0;g<e.length;g++)f=e[g],f!==this&&f!=this.u&&(c=Hg(this,f,d,b,c));b=[d,a,c];a!=Ag?ug(this,this.pb,b):this.pb(b)}};
|
||||
function Hg(a,b,c,d,e){if(!b.v.U){b.v.U=!0;var g=null;try{if(e&&((g=c.get(b.id))||(g=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof g&&(g=null),!b.pa(g,d)&&g&&(u("Unable to restore state for "+b.type),a.N&&!a.W?(c.clear(),a.b=rg,window&&window.location.reload()):a.P=!0,b.pa(null),e=!1),!d&&b.hb){var f=b.hb.split("|");for(a=0;a<f.length;a++)b.status(f[a])}}catch(h){u("Error restoring state for "+b.type+" ("+h.message+")")}}return e}
|
||||
l.pb=function(a){var b=a[0],c=0>a[1];a=a[2];this.S=!0;this.v.U=!0;var d=this.I.power;d&&(d.textContent="Shutdown");this.u&&(Hg(this,this.u,b,c,a),M(this,-2),this.u.Z());this.P&&(Cg(this,b),b.clear());!c&&this.D&&(this.D.clear(),delete this.D);this.A=0};
|
||||
function Cg(a,b){if(yb("There may be a problem with your "+Pb+" machine.\n\nTo help us diagnose it, click OK to send this "+Pb+" machine state to http://www.pcjs.org.")){var c=a.ba;a=a.f||"";b=b.toString();var d={};d.app=Pb;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;La("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function lg(a,b,c){var d,e="none";if(a.A)return null;a.A--;var g=new L(a,"1.34.2"),f=new L(a,"1.34.2",wg),h=Ka();f.set(yg,h);g.set(yg,h);g.set(Ig,"1.34.2");g.set(Jg,window?window.location.href:null);g.set(Kg,window?window.navigator.userAgent:"");a.u&&a.u.fa&&(c&&(b&&(a.u.v.Z=a.u.v.K),a.u.V()),d=a.u.fa(b,c),"object"===typeof d&&g.set(a.u.id,d),c&&(a.u.v.U=!1,!1===d&&(e=null)));for(var h=zb(a.id),k=0;k<h.length;k++){var m=h[k];m.v.U&&(m.fa&&(d=m.fa(b,c),"object"===typeof d&&g.set(m.id,d)),c&&(m.v.U=
|
||||
!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.f&&Lg(a,a.f,g.toString()),Fg(f)&&Fg(g)||(e=null,d=h=!0)):a.b&&(d=!0,h=a.b==Zg),d&&g.clear(h)):e=g.toString());c&&(a.v.U=!1,b=a.I.power)&&(b.textContent="Power");a.A=0;return e}
|
||||
l.reset=function(){this.v.reset=!0;this.G&&this.G.reset&&(Ob(this,"Resetting "+this.G.type),this.G.reset());this.u&&this.u.reset&&(Ob(this,"Resetting "+this.u.type),this.u.reset());for(var a=zb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.G&&c!==this.u&&c.reset&&(Ob(this,"Resetting "+c.type),c.reset())}this.v.reset=!1;M(this,-1)};l.start=function(a,b){for(var c=zb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}M(this,-1)};
|
||||
l.stop=function(a,b){for(var c=zb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}M(this,-1)};
|
||||
function M(a,b){if(a.u){var c=a.u,d=b||0,e=c.I.speed;e&&(0>=d||30<=(c.Qa+=d))&&(e.textContent=c.v.K?c.S.toFixed(2)+"Mhz":"Stopped",c.Qa=0)}if(a.w&&(a=a.w,b=b||0,a.M)){c=a.u.v.K;d=!!(a.u.A&8);if(0>=b||60<=(a.L+=b)){e=a.u.w;if(a.I.PC){var g=a.C&&a.C.ca||8,e=e||0,e=8==g?va(e,void 0):t(e,void 0);a.I.PC.textContent!=e&&(a.I.PC.textContent=e)}a.L=0}-1>b?a.f=a.u.w:0<b&&c&&!d&&(a.f=a.u.qa);hc(a,a.f);bc(a,a.A)}}
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case "power":return this.I[b]=c,c.onclick=function(){d.A||(d.v.U?jg(d,!1,!0):sg(d,d.Ga))},!0;case "reset":return this.I[b]=c,c.onclick=function(){if(d.v.U&&!d.A)if(d.b&&!d.H){var a=yb("Click OK to save changes to this "+Pb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");jg(d,a,!0);!a&&d.N?window&&window.location.reload():d.Ga(pg)}else d.reset(),d.u&&!d.C&&d.u.Z()},!0;case "save":if(Da())c.parentNode.removeChild(c);else return this.I[b]=
|
||||
c,c.onclick=function(){var a=og(d,!0);if(a){var b=!!(d.b&&!d.H||d.N),c=jg(d,b);b?Jg(d,a,c):d.da("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function og(a,b){var c=a.f;c||((c=Xa(Eg),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=Yg(a,c))||a.da("The user ID is invalid.")):b&&a.da("Browser local storage is not available"));return c}
|
||||
function Yg(a,b){a.f=null;b=La(Ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ya(Eg,b.data),a.f=b.data)}catch(d){u(d.message+" ("+c+")")}return a.f}function rg(a){var b=null;a.f&&(b=Ea()+"/api/v1/user?req=load&user="+a.f+"&state="+Zg(a,"1.34.2"));return b}
|
||||
function Jg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Zg(a,"1.34.2");d.data=c;b=La(Ea()+"/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.da("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.da(c),Ya(Eg,""),a.f=null)}}
|
||||
function kd(a,b){if(a.oa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.oa.focus();!b&&window&&window.scrollTo(c,d)}}var zg="failsafe",ug="validate",wg="timestamp",Gg="version",Hg="url",Ig="browser",Eg="user",yg=-1,pg=0,xg=1,Bg=2,Xg=3;eb(function(){for(var a=z(document,y+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=x(c),c=z(c,y,"computer"),e=0;e<c.length;e++){var g=c[e],f=x(g),f=new mg(f,d,!0);Cb(f,g);f.O&&sg(f,f.Ga)}});
|
||||
fb.show.push(function(){for(var a=z(document,y,"computer"),b=0;b<a.length;b++){var c=x(a[b]);(c=Bb("Computer",c.id))&&c.S&&!c.v.U&&c.Ga(yg)}});fb.exit.push(function(){for(var a=z(document,y,"computer"),b=0;b<a.length;b++){var c=x(a[b]);(c=Bb("Computer",c.id))&&c.v.U&&jg(c,!(!c.b||c.H),!0)}});function L(a,b,c){this.id=a.id;this.f="";this.b={};this.u=this.C=!1;this.key=Zg(a,b,c);Cg(this,a.Bb)}l=L.prototype;l.set=function(a,b){try{this.b[a]=b}catch(c){}};l.get=function(a){return this.b[a]||null};
|
||||
l.data=function(){return this.b};function qg(a,b){return b?(a.f=b,a.u=!0,a.C=!1,!0):a.u?!0:Na()&&(b=Xa(a.key))?(a.f=b,a.u=!0):!1}function vg(a){var b=!0;if(!a.C)try{a.b=JSON.parse(a.f),a.C=!0}catch(c){u(c.message||c),b=!1}return b}function Dg(a){var b=!0;if(Na()){var c=JSON.stringify(a.b);Ya(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}l.toString=function(){return this.b?JSON.stringify(this.b):this.f};
|
||||
function Cg(a,b){a.f="";a.b={};a.u=a.C=!1;b&&a.set("parms",b)}l.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 Zg(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}var $g=0;
|
||||
function ah(a,b,c,d,e,g,f){g("Loading "+a+"...");La(a,null,!0,function(h,k,m){m?(k||(k="unable to load "+a+" ("+m+")"),f(k,null)):bh(k,a,b,c,d,e,g,f)})}
|
||||
function bh(a,b,c,d,e,g,f,h){function k(a,f){if(f)h(f,null);else{c&&(nb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1<e.length&&(e+=",")):e='{state:"'+e+'",':e="{",e+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(f?' url="'+f+'"':"")));g||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1"+d+"$2"));f=null;if("<"==a.charAt(0))try{g||(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(r){f=null,a=r.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?g?ch(a,f,k):k(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function ch(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");La(e,null,!0,function(g,f,h){if(h||!f)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=f.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(f=f.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}f=f.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],f);ch(a,b,c)}})}else c(a,null)}
|
||||
function dh(a,b,c,d,e){function g(a){if(void 0===k){var b=h&&z(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=Fa(a))}function f(a){g("Error: "+a);m&&(--$g||ib(!0));m=!1}var h,k,m=!0;$g++;wb[b]={};try{if(h=document.getElementById(b)){var n;if("object"==typeof resources&&(n=resources.css)){var r=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css";C.styleSheet?C.styleSheet.cssText=n:C.appendChild(document.createTextNode(n));r.appendChild(C)}d||
|
||||
(n=a,"pdp"==a.substr(0,3)&&(n="pdpjs"),d="/versions/"+n+"/1.34.2/components.xsl");n=function(e,k){k?ah(d,null,a,null,!1,g,function(a,e){e?(nb(b,d,a),g("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=k.transformNode(e))?(h.outerHTML=e,--$g||ib(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(k,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--$g||
|
||||
ib(!0)):f("invalid machine element: "+b):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(a)}):f(e)};"<"!=c.charAt(0)?ah(c,b,a,e,!0,g,n):bh(c,null,b,a,e,!1,g,n)}else f("missing machine element: "+b)}catch(aa){f(aa.message)}return m}window.embedPDP10=function(a,b,c,d){ib(!1);return dh("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){ib(!1);return dh("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return Bb(b,a+".machine")};
|
||||
function M(a,b){if(a.u){var c=a.u,d=b||0,e=c.I.speed;e&&(0>=d||30<=(c.Ra+=d))&&(e.textContent=c.v.K?c.S.toFixed(2)+"Mhz":"Stopped",c.Ra=0)}if(a.w&&(a=a.w,b=b||0,a.M)){c=a.u.v.K;d=!!(a.u.A&8);if(0>=b||60<=(a.L+=b)){e=a.u.w;if(a.I.PC){var g=a.C&&a.C.ca||8,e=e||0,e=8==g?va(e,void 0):t(e,void 0);a.I.PC.textContent!=e&&(a.I.PC.textContent=e)}a.L=0}-1>b?a.f=a.u.w:0<b&&c&&!d&&(a.f=a.u.ra);jc(a,a.f);dc(a,a.A)}}
|
||||
l.ga=function(a,b,c){var d=this;switch(b){case "power":return this.I[b]=c,c.onclick=function(){d.A||(d.v.U?lg(d,!1,!0):ug(d,d.Ga))},!0;case "reset":return this.I[b]=c,c.onclick=function(){if(d.v.U&&!d.A)if(d.b&&!d.H){var a=yb("Click OK to save changes to this "+Pb+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");lg(d,a,!0);!a&&d.N?window&&window.location.reload():d.Ga(rg)}else d.reset(),d.u&&!d.C&&d.u.Z()},!0;case "save":if(ya())c.parentNode.removeChild(c);else return this.I[b]=
|
||||
c,c.onclick=function(){var a=qg(d,!0);if(a){var b=!!(d.b&&!d.H||d.N),c=lg(d,b);b?Lg(d,a,c):d.da("Resume disabled, machine state not saved")}},!0}return!1};
|
||||
function qg(a,b){var c=a.f;c||((c=Xa(Gg),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=$g(a,c))||a.da("The user ID is invalid.")):b&&a.da("Browser local storage is not available"));return c}
|
||||
function $g(a,b){a.f=null;b=La(Ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ya(Gg,b.data),a.f=b.data)}catch(d){u(d.message+" ("+c+")")}return a.f}function tg(a){var b=null;a.f&&(b=Ea()+"/api/v1/user?req=load&user="+a.f+"&state="+ah(a,"1.34.2"));return b}
|
||||
function Lg(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=ah(a,"1.34.2");d.data=c;b=La(Ea()+"/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.da("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.da(c),Ya(Gg,""),a.f=null)}}
|
||||
function md(a,b){if(a.oa){var c=0,d=0;!b&&window&&(c=window.scrollX,d=window.scrollY);a.oa.focus();!b&&window&&window.scrollTo(c,d)}}var Bg="failsafe",wg="validate",yg="timestamp",Ig="version",Jg="url",Kg="browser",Gg="user",Ag=-1,rg=0,zg=1,Dg=2,Zg=3;eb(function(){for(var a=z(document,y+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=x(c),c=z(c,y,"computer"),e=0;e<c.length;e++){var g=c[e],f=x(g),f=new og(f,d,!0);Cb(f,g);f.O&&ug(f,f.Ga)}});
|
||||
fb.show.push(function(){for(var a=z(document,y,"computer"),b=0;b<a.length;b++){var c=x(a[b]);(c=Bb("Computer",c.id))&&c.S&&!c.v.U&&c.Ga(Ag)}});fb.exit.push(function(){for(var a=z(document,y,"computer"),b=0;b<a.length;b++){var c=x(a[b]);(c=Bb("Computer",c.id))&&c.v.U&&lg(c,!(!c.b||c.H),!0)}});function L(a,b,c){this.id=a.id;this.f="";this.b={};this.u=this.C=!1;this.key=ah(a,b,c);Eg(this,a.Bb)}l=L.prototype;l.set=function(a,b){try{this.b[a]=b}catch(c){}};l.get=function(a){return this.b[a]||null};
|
||||
l.data=function(){return this.b};function sg(a,b){return b?(a.f=b,a.u=!0,a.C=!1,!0):a.u?!0:Na()&&(b=Xa(a.key))?(a.f=b,a.u=!0):!1}function xg(a){var b=!0;if(!a.C)try{a.b=JSON.parse(a.f),a.C=!0}catch(c){u(c.message||c),b=!1}return b}function Fg(a){var b=!0;if(Na()){var c=JSON.stringify(a.b);Ya(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}l.toString=function(){return this.b?JSON.stringify(this.b):this.f};
|
||||
function Eg(a,b){a.f="";a.b={};a.u=a.C=!1;b&&a.set("parms",b)}l.clear=function(a){Eg(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 ah(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}var bh=0;
|
||||
function ch(a,b,c,d,e,g,f){g("Loading "+a+"...");La(a,null,!0,function(h,k,m){m?(k||(k="unable to load "+a+" ("+m+")"),f(k,null)):dh(k,a,b,c,d,e,g,f)})}
|
||||
function dh(a,b,c,d,e,g,f,h){function k(a,f){if(f)h(f,null);else{c&&(mb(c,b,a),(f=b)&&0>f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1<e.length&&(e+=",")):e='{state:"'+e+'",':e="{",e+='url:"'+f+'"}',"object"==typeof resources&&(f=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(f?' url="'+f+'"':"")));g||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1"+d+"$2"));f=null;if("<"==a.charAt(0))try{g||(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(r){f=null,a=r.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,f)}}a?g?eh(a,f,k):k(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function eh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");La(e,null,!0,function(g,f,h){if(h||!f)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(g=d[3])if(h=f.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=h[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=k&&(f=f.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}f=f.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],f);eh(a,b,c)}})}else c(a,null)}
|
||||
function fh(a,b,c,d,e){function g(a){if(void 0===k){var b=h&&z(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=Fa(a))}function f(a){g("Error: "+a);m&&(--bh||ib(!0));m=!1}var h,k,m=!0;bh++;ob[b]={};try{if(h=document.getElementById(b)){var n;if("object"==typeof resources&&(n=resources.css)){var r=document.head||document.getElementsByTagName("head")[0],C=document.createElement("style");C.type="text/css";C.styleSheet?C.styleSheet.cssText=n:C.appendChild(document.createTextNode(n));r.appendChild(C)}d||
|
||||
(n=a,"pdp"==a.substr(0,3)&&(n="pdpjs"),d="/versions/"+n+"/1.34.2/components.xsl");n=function(e,k){k?ch(d,null,a,null,!1,g,function(a,e){e?(mb(b,d,a),g("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=k.transformNode(e))?(h.outerHTML=e,--bh||ib(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(k,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--bh||
|
||||
ib(!0)):f("invalid machine element: "+b):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(a)}):f(e)};"<"!=c.charAt(0)?ch(c,b,a,e,!0,g,n):dh(c,null,b,a,e,!1,g,n)}else f("missing machine element: "+b)}catch(aa){f(aa.message)}return m}window.embedPDP10=function(a,b,c,d){ib(!1);return fh("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){ib(!1);return fh("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return Bb(b,a+".machine")};
|
||||
window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!Eb[a]){for(var c=!0,d=Eb,e=a,g=b.length,f=[],h=[],k="",m=null,n=0;n<g;n++){var r=b[n];if('"'==r||"'"==r)m&&r!=m?k+=r:(m?m=null:m=r,k&&(h.push(k),k=""));else{if(!m){if("\r"==r||"\n"==r)r=";";if(" "==r||"\t"==r||";"==r){k&&(h.push(k),k="");";"==r&&h.length&&(f.push(h),h=[]);continue}}k+=r}}k&&h.push(k);h.length&&f.push(h);d[e]=f;Db(a)||(c=!1)}return c};window.enableEvents=ib;window.sendEvent=kb;})();//# sourceMappingURL=/tmp/pdpjs/1.34.2/pdp10-dbg.map
|
||||
|
|
|
|||
|
|
@ -31,138 +31,139 @@ var k,aa="function"==typeof Object.defineProperties?Object.defineProperty:functi
|
|||
function ea(){ba();var a=m.Symbol.iterator;a||(a=m.Symbol.iterator=m.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return fa(this)}});ea=function(){}}function fa(a){var b=0;return ga(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function ga(a){ea();a={next:a};a[m.Symbol.iterator]=function(){return this};return a}
|
||||
function n(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]}function ha(a,b){if(b){var c=m;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}
|
||||
ha("Math.trunc",function(a){return a?a:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||!a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}});ha("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}});
|
||||
var ia=Math.pow(2,36),ja=-Math.pow(2,35),q={Cb:0,Va:1,Eb:2,Fb:3,Gb:4,Hb:5,Ib:6,Jb:7,La:8,Kb:9,Wa:10,Lb:11,Mb:12,Xa:13,Nb:14,Ob:15,Pb:16,Qb:17,Rb:18,Sb:19,Tb:20,Ub:21,Vb:22,Wb:23,Xb:24,Yb:25,Zb:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,Ka:65,Bb:66,Db:67,$b:68,E:69,ac:70,bc:71,cc:72,dc:73,ec:74,fc:75,gc:76,hc:77,ic:78,jc:79,kc:80,Q:81,
|
||||
var ia=Math.pow(2,36),ja=-Math.pow(2,35),q={Cb:0,Va:1,Eb:2,Fb:3,Gb:4,Hb:5,Ib:6,Jb:7,Ma:8,Kb:9,Wa:10,Lb:11,Mb:12,Xa:13,Nb:14,Ob:15,Pb:16,Qb:17,Rb:18,Sb:19,Tb:20,Ub:21,Vb:22,Wb:23,Xb:24,Yb:25,Zb:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,La:65,Bb:66,Db:67,$b:68,E:69,ac:70,bc:71,cc:72,dc:73,ec:74,fc:75,gc:76,hc:77,ic:78,jc:79,kc:80,Q:81,
|
||||
lc:82,mc:83,nc:84,oc:85,pc:86,qc:87,rc:88,sc:89,ab:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,tc:97,uc:98,vc:99,d:100,e:101,wc:102,xc:103,yc:104,zc:105,Ac:106,k:107,Bc:108,Cc:109,n:110,Dc:111,p:112,q:113,r:114,Ec:115,t:116,Fc:117,Gc:118,Hc:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Ya:127};
|
||||
function ka(a,b,c,d){var e="";if(null==a||isNaN(a))for(;0<c--;)e="?"+e;else for(0>a&&-1<a&&(a=-1);0<c--;){var f=a%b,f=f+(0<=f&&9>=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function la(a,b){b?12<b&&(b=12):b=a&-16777216?11:a&-65536?8:6;return ka(a,8,b,"")}function r(a,b,c){b?9<b&&(b=9):b=a&-65536?8:4;return ka(a,16,b,c?"0x":"")}function ma(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0<c&&(b=b.substr(0,c));return b}
|
||||
function na(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function oa(){var a=t();return-1!==a.indexOf("pcjs.org",a.length-8)}function pa(a){return a.replace(/[&<>"']/g,function(a){return ra[a]})}function sa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var ra={"&":"&","<":"<",">":">",'"':""","'":"'"};
|
||||
function ta(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function u(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,
|
||||
function na(a){var b="",c=a.lastIndexOf(".");0<=c&&(b=a.substr(c+1).toLowerCase());return b}function oa(){var a=pa();return-1!==a.indexOf("pcjs.org",a.length-8)}function qa(a){return a.replace(/[&<>"']/g,function(a){return sa[a]})}function ta(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var sa={"&":"&","<":"<",">":">",'"':""","'":"'"};
|
||||
function ua(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())}
|
||||
function t(a,b,c,d){c=void 0===c?!1:c;var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var h=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(h.onreadystatechange=function(){4===h.readyState&&(f=h.responseText,200==h.status||!h.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=h.status||-1),d&&d(a,
|
||||
f,e))});if(b&&"object"==typeof b){var l="",p;for(p in b)b.hasOwnProperty(p)&&(l&&(l+="&"),l+=p+"="+encodeURIComponent(b[p]));l=l.replace(/%20/g,"+");h.open("POST",a,c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(l)}else h.open("GET",a,c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g}
|
||||
function ua(a,b){var c,d={H:null,N:null,T:null,S: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")&&0>b.indexOf("0o")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.T=g.load;d.S=g.exec;if(e=g.bytes)d.H=e;else if(e=g.words)for(d.H=Array(2*e.length),f=c=0;c<e.length;c++)d.H[f++]=e[c]&255,d.H[f++]=e[c]>>8&255;else if(e=g.longs)for(d.H=Array(4*e.length),f=c=0;c<e.length;c++)d.H[f++]=
|
||||
e[c]&255,d.H[f++]=e[c]>>8&255,d.H[f++]=e[c]>>16&255,d.H[f++]=e[c]>>24&255;else(e=g.data)?d.Y=e:d.H=g;d.H&&(d.H.length?1==d.H.length&&(w(d.H[0]),d=null):(w("Empty resource: "+a),d=null));d.N=g.symbols}catch(h){w("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)){w("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.H=e)}return d}
|
||||
function t(){return"http://"+(window?window.location.host:"www.pcjs.org")}function va(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function ya(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function za(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)}return!1}
|
||||
function Aa(a){if(!Ba){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Ba=c}return Ba[a]}function Ca(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function x(a){z.init.push(a)}
|
||||
function Da(a){if(Ea)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){w(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Fa(a){!Ea&&a?(Ea=!0,Ga&&Ha("init"),Ia&&Ha("show")):Ea=a}function Ha(a){z[a]&&Da(z[a])}var Ba=null,z={init:[],show:[],exit:[]},Ga=!1,Ia=!1,Ea=!0,wa=null;Ca("onload",function(){Ga=!0;Da(z.init)});Ca("onpageshow",function(){Ia=!0;Da(z.show)});Ca(za("Opera")||za("iOS")?"onunload":"onbeforeunload",function(){Da(z.exit)});
|
||||
function A(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Oa=b.comment;this.Ua=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.ma=this.id:(this.na=this.id.substr(0,a),this.ma=this.id.substr(a+1));this.g={ready:!1,sa:!1,Fa:!1,C:!1,error:!1};this.ua=null;this.g.error=!1;this.v=this.h=this.o=this.u=this.ba=null;B.push(this)}function Ja(a,b,c){Ka[a]&&b&&(Ka[a][b]=c)}function La(){return Date.now()||+new Date}
|
||||
function w(a){window&&window.alert(a)}function Ma(a){var b=!1;window&&(b=window.confirm(a));return b}function C(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<B.length;b++){var d=B[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Na(a){if(void 0!==a){var b;for(b=0;b<B.length;b++)if(B[b].id===a)return B[b]}return null}
|
||||
function D(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<B.length;d++)if(c)c==B[d]&&(c=null);else if(!(a!=B[d].type||b&&B[d].id.indexOf(b)))return B[d]}return null}function E(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){w(c.message+" ("+a+")")}return b}
|
||||
function F(a,b){var c=G;b=H(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var h=g.getAttribute("class");if(h)for(var l=h.split(" "),p=0;p<l.length;p++)switch(h=l[p],h){case c+"-binding":(h=E(g))&&h.binding&&a.U(h.type,h.binding,g,h.value),p=l.length}}}}
|
||||
function H(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}
|
||||
function Oa(a){for(var b=!0,c=Pa[a];c&&c.length;){var d=c.splice(0,1)[0],e=d[0],f=null;0<=Qa.indexOf(e)&&(f=function(){return function(){Oa(a)}}());var g=Ra[e];if(g)if(!f)b=g(d[1],d[2],d[3]);else{if(!g(f,d[1],d[2],d[3]))break}else{var b=!1,h=D(d[1],a);if(h)if(g=Sa[e])b=g(h,d[2],d[3]);else{var l=h.exports;if(l&&(g=l[e]))if(b=!0,!f)b=g.call(h,d[2],d[3]);else if(!g.call(h,f,d[2],d[3]))break}}if(!b){w("Script error: "+e+(g?" failed":" unrecognized"));break}}c&&!c.length&&delete Pa[a];return b}k=A.prototype;
|
||||
function va(a,b){var c,d={H:null,N:null,T:null,S: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")&&0>b.indexOf("0o")&&'["'!=b.substr(0,2)?JSON.parse(b.replace(/([a-z]+):/gm,'"$1":').replace(/\/\/[^\n]*/gm,"")):eval("("+b+")");d.T=g.load;d.S=g.exec;if(e=g.bytes)d.H=e;else if(e=g.words)for(d.H=Array(2*e.length),f=c=0;c<e.length;c++)d.H[f++]=e[c]&255,d.H[f++]=e[c]>>8&255;else if(e=g.longs)for(d.H=Array(4*e.length),f=c=0;c<e.length;c++)d.H[f++]=
|
||||
e[c]&255,d.H[f++]=e[c]>>8&255,d.H[f++]=e[c]>>16&255,d.H[f++]=e[c]>>24&255;else(e=g.data)?d.Y=e:d.H=g;d.H&&(d.H.length?1==d.H.length&&(u(d.H[0]),d=null):(u("Empty resource: "+a),d=null));d.N=g.symbols}catch(h){u("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)){u("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.H=e)}return d}
|
||||
function pa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function wa(){if(null==xa){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}xa=a}return xa}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)}return!1}
|
||||
function Ba(a){if(!Ca){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Ca=c}return Ca[a]}function Da(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function w(a){x.init.push(a)}
|
||||
function Ea(a){if(Fa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){u(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ga(a){!Fa&&a?(Fa=!0,Ha&&Ia("init"),Ja&&Ia("show")):Fa=a}function Ia(a){x[a]&&Ea(x[a])}var Ca=null,x={init:[],show:[],exit:[]},Ha=!1,Ja=!1,Fa=!0,xa=null;Da("onload",function(){Ha=!0;Ea(x.init)});Da("onpageshow",function(){Ja=!0;Ea(x.show)});Da(Aa("Opera")||Aa("iOS")?"onunload":"onbeforeunload",function(){Ea(x.exit)});
|
||||
function y(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Pa=b.comment;this.Ua=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.na=this.id:(this.oa=this.id.substr(0,a),this.na=this.id.substr(a+1));this.g={ready:!1,ta:!1,Ga:!1,C:!1,error:!1};this.va=null;this.g.error=!1;this.v=this.h=this.o=this.u=this.ba=null;A.push(this)}function Ka(a,b,c){La[a]&&b&&(La[a][b]=c)}function Ma(){return Date.now()||+new Date}
|
||||
function u(a){window&&window.alert(a)}function Na(a){var b=!1;window&&(b=window.confirm(a));return b}function B(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<A.length;b++){var d=A[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Oa(a){if(void 0!==a){var b;for(b=0;b<A.length;b++)if(A[b].id===a)return A[b]}return null}
|
||||
function C(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<A.length;d++)if(c)c==A[d]&&(c=null);else if(!(a!=A[d].type||b&&A[d].id.indexOf(b)))return A[d]}return null}function D(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){u(c.message+" ("+a+")")}return b}
|
||||
function E(a,b){var c=F;b=G(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var h=g.getAttribute("class");if(h)for(var l=h.split(" "),p=0;p<l.length;p++)switch(h=l[p],h){case c+"-binding":(h=D(g))&&h.binding&&a.U(h.type,h.binding,g,h.value),p=l.length}}}}
|
||||
function G(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}
|
||||
function Pa(a){for(var b=!0,c=Qa[a];c&&c.length;){var d=c.splice(0,1)[0],e=d[0],f=null;0<=Ra.indexOf(e)&&(f=function(){return function(){Pa(a)}}());var g=Sa[e];if(g)if(!f)b=g(d[1],d[2],d[3]);else{if(!g(f,d[1],d[2],d[3]))break}else{var b=!1,h=C(d[1],a);if(h)if(g=Ta[e])b=g(h,d[2],d[3]);else{var l=h.exports;if(l&&(g=l[e]))if(b=!0,!f)b=g.call(h,d[2],d[3]);else if(!g.call(h,f,d[2],d[3]))break}}if(!b){u("Script error: "+e+(g?" failed":" unrecognized"));break}}c&&!c.length&&delete Qa[a];return b}k=y.prototype;
|
||||
k.toString=function(){return this.name?this.name:this.id||this.type};
|
||||
k.U=function(a,b,c){switch(b){case "clear":return this.m[b]||(this.m[b]=c,c.onclick=function(a){return function(){a.m.print&&(a.m.print.value="")}}(this)),!0;case "print":return this.m[b]||(this.ba=this.m[b]=c,c.value="",this.M=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.F=function(a){this.M(a,this.ma)}),!0;default:return!1}};k.log=function(){};k.M=function(){};
|
||||
k.status=function(a){this.M(this.ma+": "+a)};k.F=function(a,b,c){c=c||this.type;b||w((c?c+": ":"")+a)};function Ta(a,b){b&&(a.g.ready?b():a.ua=b);return a.g.ready}function I(a){if(!a.g.error&&(a.g.ready=!0,a.g.ready)){var b=a.ua;a.ua=null;b&&b()}}function Ua(a,b){a.g.Fa?(a.g.sa=!1,a.g.Fa=!1):a.g.error?a.M(a.toString()+" error"):a.g.sa=b}k.V=function(){return this.g.C=!0};k.P=function(a,b){b&&(this.g.C=!1);return!0};
|
||||
k.U=function(a,b,c){switch(b){case "clear":return this.m[b]||(this.m[b]=c,c.onclick=function(a){return function(){a.m.print&&(a.m.print.value="")}}(this)),!0;case "print":return this.m[b]||(this.ba=this.m[b]=c,c.value="",this.M=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.F=function(a){this.M(a,this.na)}),!0;default:return!1}};k.log=function(){};k.M=function(){};
|
||||
k.status=function(a){this.M(this.na+": "+a)};k.F=function(a,b,c){c=c||this.type;b||u((c?c+": ":"")+a)};function Ua(a,b){b&&(a.g.ready?b():a.va=b);return a.g.ready}function H(a){if(!a.g.error&&(a.g.ready=!0,a.g.ready)){var b=a.va;a.va=null;b&&b()}}function Va(a,b){a.g.Ga?(a.g.ta=!1,a.g.Ga=!1):a.g.error?a.M(a.toString()+" error"):a.g.ta=b}k.V=function(){return this.g.C=!0};k.P=function(a,b){b&&(this.g.C=!1);return!0};
|
||||
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]),window.PCjs.Commands||(window.PCjs.Commands={}));
|
||||
var Ka=window?window.PCjs.Machines:{},B=window?window.PCjs.Components:[],Pa=window?window.PCjs.Commands:{},Qa=["hold","sleep","wait"],Ra={alert:function(a){w(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},Sa={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
|
||||
var La=window?window.PCjs.Machines:{},A=window?window.PCjs.Components:[],Qa=window?window.PCjs.Commands:{},Ra=["hold","sleep","wait"],Sa={alert:function(a){u(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},Ta={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
|
||||
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 G="pdp10",J="PDPjs",Va=Math.pow(2,18),Wa=Math.pow(2,18)-1,K=Math.pow(2,36),L=Math.pow(2,36)-1,M=Math.pow(2,18),N=Math.pow(2,18)-1,Xa=Math.pow(2,17)-1,Ya=Math.pow(2,35)-1,Za=Math.pow(2,35),$a=Math.pow(2,36),O=Math.pow(2,32),ab=Math.pow(2,23),bb=Math.pow(2,30),G="pdp10",J="PDPjs";
|
||||
function cb(a,b){A.call(this,"Panel",a);this.B=this.D=0;this.R=b;this.b=this.w=this.i=this.j=0;this.G=this.I=-1;this.K=this.L=this.s=!1;this.O=db;this.l={};this.a={START:[1,1,!0,!1,this.mb],STEP:[1,1,!1,!1,this.nb],ENABLE:[1,1,!1,!1,this.hb],CONT:[1,1,!0,!1,this.fb],DEP:[0,0,!0,!1,this.gb],EXAM:[1,1,!0,!1,this.ib],LOAD:[1,1,!0,!1,this.kb],TEST:[0,0,!0,!1,this.jb]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.lb,a];this.v=this.h=this.o=this.u=null;this.exports={hold:this.eb,toggle:this.wb,reset:this.sb,
|
||||
set:this.vb};I(this)}n(cb,A);k=cb.prototype;k.reset=function(a){this.stop();a&&eb(this,this.j=0)};
|
||||
k.U=function(a,b,c,d){if(this.u&&this.u.U(a,b,c,d)||this.h&&this.h.U(a,b,c,d))return!0;switch(b){case "PC":return this.m[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.l[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[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):A.prototype.U.call(this,a,b,c,d)}};k.Z=function(a,b,c,d){this.u=a;this.o=b;this.h=c;this.v=d;hb(this);ib(this)};k.V=function(a,b){if(!b)if(this.R&&jb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.P=function(a){return a?this.save():!0};k.save=function(){var a=new P(this);a.set(0,[this.b,this.j,this.i]);return a.data()};
|
||||
k.restore=function(a){if(a=a[0])kb(this,this.b=a[0]),eb(this,this.j=a[1]),lb(this,a[2]);return!0};k.sb=function(){for(var a in this.a){var b=this.a[a];b[1]=b[0]}ib(this);return!0};function mb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function hb(a,b){for(var c in a.l)mb(a,c,null!=b?b:a.l[c])}function nb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function ib(a){for(var b in a.a)nb(a,b,a.a[b][1])}
|
||||
k.eb=function(a,b,c){if(fb(this,b)){if(c){var d=this;setTimeout(function(){gb(d,b);a&&a()},+c);return!1}gb(this,b)}return!0};
|
||||
var F="pdp10",I="PDPjs",Wa=Math.pow(2,18),Xa=Math.pow(2,18)-1,Ya=Math.pow(2,35),Za=Math.pow(2,35)-1,J=Math.pow(2,36),K=Math.pow(2,36)-1,L=Math.pow(2,18),M=Math.pow(2,18)-1,$a=Math.pow(2,17)-1,N=Math.pow(2,35)-1,ab=Math.pow(2,35),bb=Math.pow(2,36),O=Math.pow(2,32),cb=Math.pow(2,23),db=Math.pow(2,30),F="pdp10",I="PDPjs";
|
||||
function eb(a,b){y.call(this,"Panel",a);this.B=this.D=0;this.R=b;this.b=this.w=this.i=this.j=0;this.G=this.I=-1;this.K=this.L=this.s=!1;this.O=fb;this.l={};this.a={START:[1,1,!0,!1,this.mb],STEP:[1,1,!1,!1,this.nb],ENABLE:[1,1,!1,!1,this.hb],CONT:[1,1,!0,!1,this.fb],DEP:[0,0,!0,!1,this.gb],EXAM:[1,1,!0,!1,this.ib],LOAD:[1,1,!0,!1,this.kb],TEST:[0,0,!0,!1,this.jb]};for(a=0;22>a;a++)this.a["S"+a]=[0,0,!1,!1,this.lb,a];this.v=this.h=this.o=this.u=null;this.exports={hold:this.eb,toggle:this.wb,reset:this.sb,
|
||||
set:this.vb};H(this)}n(eb,y);k=eb.prototype;k.reset=function(a){this.stop();a&&gb(this,this.j=0)};
|
||||
k.U=function(a,b,c,d){if(this.u&&this.u.U(a,b,c,d)||this.h&&this.h.U(a,b,c,d))return!0;switch(b){case "PC":return this.m[b]=c,this.D++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.l[b]=d?1:0,this.D++,!0):"switch"==a?(void 0===this.a[b]&&(this.a[b]=[d?1:0,d?1:0]),this.m[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){hb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){ib(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){hb(a,
|
||||
b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){ib(a,b)}}(this,b),!0):y.prototype.U.call(this,a,b,c,d)}};k.Z=function(a,b,c,d){this.u=a;this.o=b;this.h=c;this.v=d;jb(this);kb(this)};k.V=function(a,b){if(!b)if(this.R&&lb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.P=function(a){return a?this.save():!0};k.save=function(){var a=new P(this);a.set(0,[this.b,this.j,this.i]);return a.data()};
|
||||
k.restore=function(a){if(a=a[0])mb(this,this.b=a[0]),gb(this,this.j=a[1]),nb(this,a[2]);return!0};k.sb=function(){for(var a in this.a){var b=this.a[a];b[1]=b[0]}kb(this);return!0};function ob(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function jb(a,b){for(var c in a.l)ob(a,c,null!=b?b:a.l[c])}function pb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function kb(a){for(var b in a.a)pb(a,b,a.a[b][1])}
|
||||
k.eb=function(a,b,c){if(hb(this,b)){if(c){var d=this;setTimeout(function(){ib(d,b);a&&a()},+c);return!1}ib(this,b)}return!0};
|
||||
k.vb=function(a,b){if("SR"==a){a=b;b=8;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)}return lb(this,c)}return(c=this.a[a])?(c[1]=+b?1:0,nb(this,a,c[1]),!0):!1};k.wb=function(a){return fb(this,a)?(gb(this,a),!0):!1};function fb(a,b){var c=a.a[b];return c?(nb(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=ob&&(a.K=b==pb,a.L=b==qb),!0):!1}function gb(a,b){var c=a.a[b];c&&(c[2]&&c[3]&&(nb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}
|
||||
k.mb=function(a){a||this.h.g.A||(this.h.j=this.b%Va,this.a[rb]&&this.a[rb][1]&&sb(this.h))};k.nb=function(){};k.hb=function(a){a||Q(this.h)};k.fb=function(a){if(!a&&!this.h.g.A)if(this.a[rb]&&this.a[rb][1])sb(this.h);else{a=this.v;var b;if(b=a)a.g.sa&&(a.g.Fa=!0),b=!a.g.sa;if(b)Ua(a,!0),a.b(0,null),Ua(a,!1);else try{var c=this.h.xa(1);0<c&&(tb(this.h,c),ub(this.h,c,!0),vb(this.h,c))}catch(d){"number"!=typeof d&&(c=this.h,a=d.stack||d.message,c.g.error=!0,c.F(a))}this.stop();this.u&&R(this.u)}};
|
||||
k.gb=function(a){a&&!this.h.g.A&&(this.K&&wb(this),a=eb(this,this.j=this.i),this.O==db?xb(this.o,this.b,a):this.h.f(this.b,a))};k.ib=function(a){if(!a&&!this.h.g.A){this.L&&wb(this);if(this.O==db){a=this.o;var b=this.b,c=a.a[(b&a.i)>>>a.b];a.j++;b=c.o(b&16383,b);a.j--;a=b}else a=this.h.c(this.b);eb(this,this.j=a)}};k.kb=function(a){a||this.h.g.A||kb(this,this.i)};k.jb=function(a){a?(this.s=!0,hb(this,!0)):(this.s=!1,hb(this),lb(this,0))};k.lb=function(a,b){this.i=a?this.i|1<<b:this.i&~(1<<b)};
|
||||
function wb(a){var b=1,c=a.o.i;a.a[ob]&&a.a[ob][1]||(b=-b);kb(a,a.b&~c|a.b+b&c)}function kb(a,b){a.b=b&a.o.i;if(a.G!==a.b){a.G=a.b;b=a.G;for(var c=0;22>c;c++){var d=a,e="A"+c,f=b&1<<c;d.l[e]=f;d.s||mb(d,e,f)}}}function eb(a,b){a.w=b%K;if(a.I!==a.w){a.I=a.w;b=a.I;for(var c=0;16>c;c++){var d=a,e="D"+c,f=b&1<<c;d.l[e]=f;d.s||mb(d,e,f)}}return a.w}function lb(a,b){a.i=b|0;for(b=0;22>b;b++)a.a["S"+b][1]=a.i&1<<b?1:0;ib(a);return!0}k.stop=function(){kb(this,this.h.j)};
|
||||
function jb(){for(var a=H(document,G,"panel"),b=0;b<a.length;b++){var c=a[b],d=E(c),e=Na(d.id);e||(e=new cb(d,!0));F(e,c)}}var db=7,pb="DEP",rb="ENABLE",qb="EXAM",ob="STEP";x(jb);function yb(a,b,c){A.call(this,"Bus",a);this.h=b;this.v=c;this.w=+a.busWidth||18;this.s=1<<this.w;this.i=this.s-1;this.b=Math.log2(16384);this.l=this.s/16384|0;this.j=0;this.a=[];a=new S(this);zb(a);this.a=Array(this.l);for(b=0;b<this.l;b++)this.a[b]=a;I(this)}n(yb,A);k=yb.prototype;k.reset=function(){};
|
||||
k.V=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.P=function(a){return a?this.save():!0};k.save=function(){var a=new P(this);a.set(0,Ab(this));return a.data()};k.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&4096>d.length){for(var e=0,f=Array(4096),g=0;g<d.length-1;)for(var h=d[g++],l=d[g++];h--;)f[e++]=l;d=f}e=this.a[c];if(!e||!e.restore(d)){w("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
||||
function Bb(a,b,c,d){for(var e=b,f=c,g=e>>>a.b;0<f&&g<a.a.length;){var h=a.a[g],l=16384*g,p=16384-(e-l);p>f&&(p=f);if(h&&h.size){if(h.type==d){if(e+f<=h.aa)return h.wa+=h.aa-e,h.aa=e,!0;if(e>=h.aa+h.wa){p=h.size-(e-l);p>f&&(p=f);h.wa=e-h.aa+p;e=l+16384;f-=p;g++;continue}}return Cb(Db,e,f)}e=new S(a,e,p,16384,d);zb(e,h);a.a[g++]=e;e=l+16384;f-=p}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Eb[d]+" at "+la(b)),!0):Cb(Fb,b,c)}function xb(a,b,c){var d=a.a[(b&a.i)>>>a.b];a.j++;d.m(c,b&16383,b);a.j--}
|
||||
function Ab(a){for(var b=0,c=[],d=0;d<a.l;d++){var e=a.a[d];if(e.Ga||e.cb){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var p=e[g],v=g+1;v<e.length&&e[v]===p;)v++;l[h++]=v-g;l[h++]=p;g=v}l.length<e.length&&(e=l)}c[f]=e}}return c}function Cb(a,b,c){w("Memory block error ("+a+": "+r(b)+","+r(c)+")");return!1}var Db=1,Fb=2;function Gb(a){A.call(this,"Device",a)}n(Gb,A);k=Gb.prototype;k.Z=function(a,b,c,d){this.o=b;this.u=a;this.h=c;this.v=d;I(this)};
|
||||
k.V=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.P=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};x(function(){for(var a=H(document,G,"device"),b=0;b<a.length;b++){var c,d=a[b];c=E(d);switch(c.type){case "default":c=new Gb(c),F(c,d)}}});
|
||||
function S(a,b,c,d,e){this.v=a;this.id=Hb+=2;this.aa=b;this.wa=c;this.size=d||0;this.type=e||Ib;this.u=e==Jb;this.c=this.o=this.Ha;this.f=this.m=this.Ja;this.b=this.h=0;zb(this);this.Ga=this.cb=!1;if(this.size){a=this.a=Array(this.size);for(b=0;b<a.length;b++)a[b]=0;Kb(this,Lb)}else Kb(this)}k=S.prototype;k.save=function(){return this.a};k.restore=function(a){return a&&this.size==a.length?(this.a=a,this.Ga=!0):!1};function Kb(a,b){b||(b=Mb);Nb(a,b,void 0);Ob(a,b,void 0)}
|
||||
function Nb(a,b,c){c&&a.b||(a.c=b[0]||a.Ha);if(c||void 0===c)a.o=b[0]||a.Ha}function Ob(a,b,c){c&&a.h||(a.f=!a.u&&b[1]||a.Ja);if(c||void 0===c)a.m=b[1]||a.Ja}function zb(a,b){a.b=a.h=0;b&&((a.b=b.b)&&Nb(a,Pb,!1),(a.h=b.h)&&Ob(a,Pb,!1))}k.Ha=function(){var a=this.v;a.j||Q(a.h);return-1};k.Ja=function(){};k.qb=function(a){return this.a[a]};k.zb=function(a,b){this.a[b]!=a&&(this.a[b]=a,this.Ga=!0)};k.ob=function(a,b){return this.o(a,b)};k.yb=function(a,b,c){this.u||this.m(a,b,c)};
|
||||
var Ib=0,Jb=2,Eb=["NONE","RAM","ROM"],Hb=0,Mb=[],Lb=[S.prototype.qb,S.prototype.zb],Pb=[S.prototype.ob,S.prototype.yb];
|
||||
function Qb(a,b){A.call(this,"CPU",a);b=+a.cycles||b;var c=+a.multiplier||1;this.ya=0;this.Da=b;this.X=c;this.Ba=Math.round(this.Da/1E4)/100;this.R=this.Ba*this.X;this.Ca=this.ha=this.ca=this.qa=0;this.g.A=this.g.Ia=!1;this.g.J=a.autoStart;"string"==typeof this.g.J&&(this.g.J="true"==this.g.J);this.g.ta=!1;this.oa=this.W=0;this.pa=+a.csStart;this.fa=+a.csInterval;this.ga=+a.csStop;this.D=[];this.Qa=this.tb.bind(this);this.L=this.B=this.I=this.K=this.w=this.ea=this.G=this.da=this.Ea=this.O=0;this.la=
|
||||
null;I(this)}n(Qb,A);k=Qb.prototype;k.Z=function(a,b,c,d){this.u=a;this.o=b;this.v=d;this.la=a.i;for(a=0;a<Rb.length;a++)(b=this.m[Rb[a]])&&this.u.U(null,Rb[a],b);I(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||
k.V=function(a,b){var c=Sb(this.u,"autoStart");null!=c?this.g.J="true"==c?!0:"false"==c?!1:!!c:null==this.g.J&&(this.g.J=void 0===this.m.run);if(!b){if(a){Tb(this);if(!this.restore(a))return!1;Ub(this)}else this.reset();this.status("No debugger detected");this.g.J||this.M("CPU will not be auto-started "+(this.la?"(click Run to start)":"(type 'go' to start)"))}return!0};k.P=function(a){return a?this.save():!0};k.J=function(){return this.g.A?!0:this.g.J?(sb(this),!0):!1};k.Sa=function(){return 0};
|
||||
function Ub(a){void 0===a.pa&&(a.pa=0);void 0===a.fa&&(a.fa=-1);void 0===a.ga&&(a.ga=-1);a.g.ta=0<=a.pa&&0<a.fa;a.g.ta&&(a.oa=0,a.W=a.pa-a.L)}function vb(a,b){if(a.g.ta){var c=!1;a.oa=a.oa+a.Sa()|0;a.W-=b;0>=a.W&&(a.W+=a.fa,c=!0);0<=a.ga&&a.ga<=Vb(a)&&(a.fa=a.ga=-1,Ub(a),Q(a),c=!0);c&&a.M(Vb(a)+" cycles: checksum="+r(a.oa))}}
|
||||
k.U=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.u)if(a=d.u,a.g.C)a=!0;else{var b=null,c,h=C(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.g.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.g.C);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.g.ready?"powered yet":"ready yet"+(b.ua?" (waiting for notification)":""))+".");a=!1}a&&(d.g.A?Q(d):sb(d))},!0;case "speed":return this.m[b]=
|
||||
c,!0;case "setSpeed":return this.m[b]=c,c.onclick=function(){Wb(d,d.X<<1,!0)},c.textContent=this.R.toFixed(2)+"Mhz",!0}return!1};function ub(a,b,c){a.L+=b;c&&(a.I=a.K=0)}function Xb(a,b){var c=1;b&&1<a.X&&a.O&&(c=a.O/a.Ba);a.Ca=Math.round(1E3/Yb);a.ha=Math.floor(a.Da/Yb*c);b||(a.ca=a.ha);a.qa=0}function Vb(a){return a.L+a.B+a.I-a.K}function Tb(a){a.O=0;a.Ea=0;a.L=a.B=a.I=a.K=0;Ub(a);Wb(a,1)}
|
||||
function Wb(a,b,c){if(void 0!==b){.8>a.O/a.R&&(b=1);a.X=b;b=a.Ba*a.X;if(a.R!=b){a.R=b;b=a.R.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.M("target speed: "+b)}c&&a.u&&(c=a.u,c.ba&&(d=b=0,window&&(b=window.scrollX,d=window.scrollY),c.ba.focus(),window&&window.scrollTo(b,d)))}ub(a,a.B);a.B=0;a.w=La();a.G=0;Xb(a)}function Zb(a){for(var b=[],c=0;c<a.D.length;c++)b.push(a.D[c][0]);return b}
|
||||
function tb(a,b){for(var c=a.D.length-1;0<=c;c--){var d=a.D[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function $b(a,b){var c=a.I-=a.K;a.K=0;b&&(a.I=0);return c}
|
||||
k.tb=function(){if(this.g.A){this.qa>=this.Da&&Xb(this,!0);this.da=0;this.ea=La();if(this.G){var a=this.ea-this.G;a>this.Ca&&(this.w+=a,this.w>this.ea&&(this.w=this.ea))}try{do{for(var b,c=this.g.ta?1:this.ha,d=this.D.length-1;0<=d;d--){var e=this.D[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.xa(b)}catch(f){if("number"!=typeof f)throw f;}b=$b(this,!0);this.da+=b;this.B+=b;vb(this,b);tb(this,b);this.ca-=b;if(0>=this.ca){this.ca+=this.ha;++this.Ea>=ac&&(this.u&&R(this.u,void 0),this.Ea=0);break}}while(this.g.A)}catch(f){Q(this);
|
||||
this.u&&this.u.stop(La(),Vb(this));a=f.stack||f.message;this.g.error=!0;this.F(a);return}if(this.g.A){a=setTimeout;b=this.Qa;this.G=La();c=this.Ca;this.da&&(c=Math.round(c*this.da/this.ha));c-=this.G-this.ea;if(d=this.G-this.w)this.O=Math.round(this.B/(10*d))/100,864E5<=d&&(this.L=0,Wb(this));if(0>c||this.O<this.R)-1E3>c&&(this.w-=c),c=0;this.qa+=this.da;this.G+=c;a(b,c)}}};
|
||||
function sb(a){var b;a.g.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.g.A)a.M(a.toString()+" busy");else{Wb(a);a.g.A=!0;a.g.Ia=!0;if(b=a.m.run)b.textContent="Halt";a.u&&a.u.start(a.w,Vb(a));a.v||a.status("Started");setTimeout(a.Qa,0)}}k.xa=function(){return 0};function Q(a){var b=!1;if(a.g.A){$b(a);ub(a,a.B);a.B=0;a.g.A=!1;if(b=a.m.run)b.textContent="Run";a.u&&a.u.stop(La(),Vb(a));b=!0;a.v||a.status("Stopped")}a.g.complete=void 0;return b}var Yb=30,ac=15,Rb=["power","reset"];
|
||||
function bc(a){var b=+a.model||1001;Qb.call(this,a,1E6);this.$a=b;this.Na=+a.addrReset||0;this.bb=cc.bind(this);this.a=T.bind(this);this.ja=null;this.Ma=[];this.g.complete=!1}n(bc,Qb);k=bc.prototype;k.reset=function(){this.status("Model "+this.$a);this.g.A&&Q(this);this.b=this.s=this.ra=0;this.j=this.Aa=this.Na;this.Pa=this.Za=this.za=!1;this.l=-1;this.ka=this.j;this.i=0;this.c=this.pb;this.f=this.Ab;this.ja=null;Tb(this);this.g.error=!1;Qb.prototype.reset.call(this)};k.Sa=function(){return 0};
|
||||
k.save=function(){var a=new P(this);a.set(0,[this.b,this.s,this.l,this.ra,this.j,this.Aa,this.ka,this.i]);a.set(1,[]);a.set(2,[this.L,this.X,this.g.J]);a.set(3,dc(this));a.set(4,Zb(this));return a.data()};
|
||||
k.restore=function(a){var b;b=a[0];ea();ba();ea();var c=b[Symbol.iterator];b=c?c.call(b):fa(b);this.b=b.next().value;this.s=b.next().value;this.l=b.next().value;this.ra=b.next().value;this.j=b.next().value;this.Aa=b.next().value;this.ka=b.next().value;this.i=b.next().value;b=a[2];this.L=b[0];Wb(this,b[1]);this.g.J=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.Ma.length;d++){var e=this.Ma[d];if(e.xb===b[c]){d=e;break a}}d=null}d&&(d.next=this.ja,this.ja=d)}a=a[4];for(b=0;b<this.D.length&&
|
||||
b<a.length;b++)this.D[b][0]=a[b];return!0};function ec(a){a.j=(a.j+-1)%Va}k.abs=function(a){a>Ya&&(a!=Za?a=$a-a:this.Pa=this.za=!0);return a};function fc(a,b){b?b==Za?a.Pa=a.za=!0:b=$a-b:a.Za=a.za=!0;return b}function dc(a){var b=[];for(a=a.ja;a;)b.push(a.xb),a=a.next;return b}k.pb=function(a){var b=this.o;a=this.ka=a;return b.a[(a&b.i)>>>b.b].c(a&16383,a)};k.Ab=function(a,b){var c=this.o;a=this.ka=a;c.a[(a&c.i)>>>c.b].f(b,a&16383,a);return b};
|
||||
k.xa=function(a){this.g.complete=!0;var b=a?this.g.Ia?0:1:-1;this.g.Ia=!1;this.I=this.K=a;this.i=this.i&-5|0;do{if(a=this.i)if(a=this.i&11)this.i&2?this.ja||(this.i&=-3):this.i&1&&this.i++,a=!1;if(a){if(this.i&4&&this.v.j(this.j,b)){Q(this);break}if(0>b)break}this.i&=15;this.s=this.s&4194304?this.c(this.b):this.ra=this.c(this.Aa=this.j);this.s&=8388607;this.b=this.s&262143;if(a=this.s>>18&15)this.b=this.b+this.c(a)&Wa;this.s&4194304?a=-1:(this.j=(this.j+1)%Va,a=this.ra/ab|0);0<=a&&this.bb(a)}while(0<
|
||||
this.K);return this.g.complete?this.I-this.K:!1===this.g.complete?-1:0};x(function(){for(var a=H(document,G,"cpu"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new bc(d);F(d,c)}});function cc(a){gc[a>>4].call(this,a,a&15)}function U(a){this.a(a)}function hc(){var a=0,b=this.c(this.b),c=b/bb&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*bb+(d<<24)+(b&16777215);a&&(b=(b+a)%K);this.f(this.b,b)}
|
||||
function ic(a,b){a=this.c(this.b);if(0>this.l)this.l=a,this.s=this.b|4194304,ec(this);else{var c=this.l/bb&63,d=this.l>>24&63;a=32>=c+d?(a>>c&(1<<d)-1)>>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.f(b,a);this.l=-1}}function jc(a,b){a=this.c(this.b);if(0>this.l)this.l=a,this.s=this.b|4194304,ec(this);else{var c=this.l/bb&63,d=this.l>>24&63;b=this.c(b)%Math.pow(2,d)*Math.pow(2,c)%K;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.f(this.b,a);this.l=-1}}function kc(a,b){this.f(b,this.c(this.b))}
|
||||
function lc(a,b){this.f(b,this.b)}function mc(a,b){this.f(this.b,this.c(b))}function nc(a,b){this.f(b,0)}function oc(a,b){this.f(b,L-this.c(b))}function pc(a,b){this.f(b,L)}function qc(a,b){var c=this.c(this.b),d=this.c(b);this.f(b,V(a,d,c)+(c-(c&N)))}function rc(a,b){var c=this.c(b);this.f(b,V(a,c,0))}function sc(a,b){b=this.c(b);var c=this.c(this.b);this.f(this.b,V(a,c,b)+(b-(b&N)))}
|
||||
function tc(a,b){var c=this.c(this.b),d=c;if(a&=384)switch(d-=d&N,a){case 256:d+=N;break;case 384:d+=c>Ya?N:0}c=d;this.f(this.b,c);b&&this.f(b,c)}function uc(a,b){var c=(this.c(this.b)&N)*M,d=this.c(b);this.f(b,V(a,d,c)+c)}function vc(a,b){var c=this.b*M,d=this.c(b);this.f(b,V(a,d,c)+c)}function wc(a,b){b=(this.c(b)&N)*M;var c=this.c(this.b);this.f(this.b,V(a,c,b)+b)}function xc(a,b){var c=this.c(this.b),d=(c&N)*M,c=V(a,c,d)+d;this.f(this.b,c);b&&this.f(b,c)}
|
||||
function yc(a,b){var c=this.c(this.b)&N,d=this.c(b);this.f(b,W(a,d,c)+c)}function zc(a,b){var c=this.c(b);this.f(b,W(a,c,this.b)+this.b)}function Ac(a,b){b=this.c(b)&N;var c=this.c(this.b);this.f(this.b,W(a,c,b)+b)}function Bc(a,b){var c=this.c(this.b),d=c;if(a&=384)switch(d&=N,a){case 256:d+=N*M;break;case 384:d+=c>Xa?N*M:0}c=d;this.f(this.b,c);b&&this.f(b,c)}function Cc(a,b){var c=this.c(this.b)/M|0,d=this.c(b);this.f(b,W(a,d,c)+c)}function Dc(a,b){var c=this.c(b);this.f(b,W(a,c,0))}
|
||||
function Ec(a,b){b=this.c(b)/M|0;var c=this.c(this.b);this.f(this.b,W(a,c,b)+b)}function Fc(a,b){var c=this.c(this.b),d=c/M|0,c=W(a,c,d)+d;this.f(this.b,c);b&&this.f(b,c)}function X(a){this.a(a)}function Gc(){}function T(a){this.M("undefined opcode: "+la(a));ec(this);Q(this)}function W(a,b,c){switch(a&384){case 0:b-=b&N;break;case 128:b=0;break;case 256:b=N*M;break;case 384:b=c>Xa?N*M:0}return b}
|
||||
function V(a,b,c){switch(a&384){case 0:b&=N;break;case 128:b=0;break;case 256:b=N;break;case 384:b=c>Ya?N:0}return b}function Y(a,b){return((a/O|0)&(b/O|0))*O+((a&b)>>>0)}function Hc(a,b){return((a/O|0)^(b/O|0))*O+((a^b)>>>0)}function Ic(a,b){return(~((a/O|0)^(b/O|0))&15)*O+(~(a^b)>>>0)}function Z(a,b){return(a/O|0|b/O|0)*O+((a|b)>>>0)}
|
||||
var gc=[U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},hc,function(a,b){0>this.l&&hc.call(this);ic.call(this,0,b)},ic,function(a,b){0>this.l&&hc.call(this);jc.call(this,0,b)},jc,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
2==e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f)}return nb(this,c)}return(c=this.a[a])?(c[1]=+b?1:0,pb(this,a,c[1]),!0):!1};k.wb=function(a){return hb(this,a)?(ib(this,a),!0):!1};function hb(a,b){var c=a.a[b];return c?(pb(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=qb&&(a.K=b==rb,a.L=b==sb),!0):!1}function ib(a,b){var c=a.a[b];c&&(c[2]&&c[3]&&(pb(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}
|
||||
k.mb=function(a){a||this.h.g.A||(this.h.j=this.b%Wa,this.a[tb]&&this.a[tb][1]&&ub(this.h))};k.nb=function(){};k.hb=function(a){a||Q(this.h)};k.fb=function(a){if(!a&&!this.h.g.A)if(this.a[tb]&&this.a[tb][1])ub(this.h);else{a=this.v;var b;if(b=a)a.g.ta&&(a.g.Ga=!0),b=!a.g.ta;if(b)Va(a,!0),a.b(0,null),Va(a,!1);else try{var c=this.h.ya(1);0<c&&(vb(this.h,c),wb(this.h,c,!0),xb(this.h,c))}catch(d){"number"!=typeof d&&(c=this.h,a=d.stack||d.message,c.g.error=!0,c.F(a))}this.stop();this.u&&R(this.u)}};
|
||||
k.gb=function(a){a&&!this.h.g.A&&(this.K&&yb(this),a=gb(this,this.j=this.i),this.O==fb?zb(this.o,this.b,a):this.h.f(this.b,a))};k.ib=function(a){if(!a&&!this.h.g.A){this.L&&yb(this);if(this.O==fb){a=this.o;var b=this.b,c=a.a[(b&a.i)>>>a.b];a.j++;b=c.o(b&16383,b);a.j--;a=b}else a=this.h.c(this.b);gb(this,this.j=a)}};k.kb=function(a){a||this.h.g.A||mb(this,this.i)};k.jb=function(a){a?(this.s=!0,jb(this,!0)):(this.s=!1,jb(this),nb(this,0))};k.lb=function(a,b){this.i=a?this.i|1<<b:this.i&~(1<<b)};
|
||||
function yb(a){var b=1,c=a.o.i;a.a[qb]&&a.a[qb][1]||(b=-b);mb(a,a.b&~c|a.b+b&c)}function mb(a,b){a.b=b&a.o.i;if(a.G!==a.b){a.G=a.b;b=a.G;for(var c=0;22>c;c++){var d=a,e="A"+c,f=b&1<<c;d.l[e]=f;d.s||ob(d,e,f)}}}function gb(a,b){a.w=b%J;if(a.I!==a.w){a.I=a.w;b=a.I;for(var c=0;16>c;c++){var d=a,e="D"+c,f=b&1<<c;d.l[e]=f;d.s||ob(d,e,f)}}return a.w}function nb(a,b){a.i=b|0;for(b=0;22>b;b++)a.a["S"+b][1]=a.i&1<<b?1:0;kb(a);return!0}k.stop=function(){mb(this,this.h.j)};
|
||||
function lb(){for(var a=G(document,F,"panel"),b=0;b<a.length;b++){var c=a[b],d=D(c),e=Oa(d.id);e||(e=new eb(d,!0));E(e,c)}}var fb=7,rb="DEP",tb="ENABLE",sb="EXAM",qb="STEP";w(lb);function Ab(a,b,c){y.call(this,"Bus",a);this.h=b;this.v=c;this.w=+a.busWidth||18;this.s=1<<this.w;this.i=this.s-1;this.b=Math.log2(16384);this.l=this.s/16384|0;this.j=0;this.a=[];a=new S(this);Bb(a);this.a=Array(this.l);for(b=0;b<this.l;b++)this.a[b]=a;H(this)}n(Ab,y);k=Ab.prototype;k.reset=function(){};
|
||||
k.V=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.P=function(a){return a?this.save():!0};k.save=function(){var a=new P(this);a.set(0,Cb(this));return a.data()};k.restore=function(a){a:{a=a[0];var b;for(b=0;b<a.length-1;b+=2){var c=a[b],d=a[b+1];if(d&&4096>d.length){for(var e=0,f=Array(4096),g=0;g<d.length-1;)for(var h=d[g++],l=d[g++];h--;)f[e++]=l;d=f}e=this.a[c];if(!e||!e.restore(d)){u("Unable to restore memory block "+c);a=!1;break a}}a=!0}return a};
|
||||
function Db(a,b,c,d){for(var e=b,f=c,g=e>>>a.b;0<f&&g<a.a.length;){var h=a.a[g],l=16384*g,p=16384-(e-l);p>f&&(p=f);if(h&&h.size){if(h.type==d){if(e+f<=h.aa)return h.xa+=h.aa-e,h.aa=e,!0;if(e>=h.aa+h.xa){p=h.size-(e-l);p>f&&(p=f);h.xa=e-h.aa+p;e=l+16384;f-=p;g++;continue}}return Eb(Fb,e,f)}e=new S(a,e,p,16384,d);Bb(e,h);a.a[g++]=e;e=l+16384;f-=p}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Gb[d]+" at "+la(b)),!0):Eb(Hb,b,c)}function zb(a,b,c){var d=a.a[(b&a.i)>>>a.b];a.j++;d.m(c,b&16383,b);a.j--}
|
||||
function Cb(a){for(var b=0,c=[],d=0;d<a.l;d++){var e=a.a[d];if(e.Ha||e.cb){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var p=e[g],v=g+1;v<e.length&&e[v]===p;)v++;l[h++]=v-g;l[h++]=p;g=v}l.length<e.length&&(e=l)}c[f]=e}}return c}function Eb(a,b,c){u("Memory block error ("+a+": "+r(b)+","+r(c)+")");return!1}var Fb=1,Hb=2;function Ib(a){y.call(this,"Device",a)}n(Ib,y);k=Ib.prototype;k.Z=function(a,b,c,d){this.o=b;this.u=a;this.h=c;this.v=d;H(this)};
|
||||
k.V=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.P=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){return(new P(this)).data()};k.restore=function(){return!0};w(function(){for(var a=G(document,F,"device"),b=0;b<a.length;b++){var c,d=a[b];c=D(d);switch(c.type){case "default":c=new Ib(c),E(c,d)}}});
|
||||
function S(a,b,c,d,e){this.v=a;this.id=Jb+=2;this.aa=b;this.xa=c;this.size=d||0;this.type=e||Kb;this.u=e==Lb;this.c=this.o=this.Ia;this.f=this.m=this.Ka;this.b=this.h=0;Bb(this);this.Ha=this.cb=!1;if(this.size){a=this.a=Array(this.size);for(b=0;b<a.length;b++)a[b]=0;Mb(this,Nb)}else Mb(this)}k=S.prototype;k.save=function(){return this.a};k.restore=function(a){return a&&this.size==a.length?(this.a=a,this.Ha=!0):!1};function Mb(a,b){b||(b=Ob);Pb(a,b,void 0);Qb(a,b,void 0)}
|
||||
function Pb(a,b,c){c&&a.b||(a.c=b[0]||a.Ia);if(c||void 0===c)a.o=b[0]||a.Ia}function Qb(a,b,c){c&&a.h||(a.f=!a.u&&b[1]||a.Ka);if(c||void 0===c)a.m=b[1]||a.Ka}function Bb(a,b){a.b=a.h=0;b&&((a.b=b.b)&&Pb(a,Rb,!1),(a.h=b.h)&&Qb(a,Rb,!1))}k.Ia=function(){var a=this.v;a.j||Q(a.h);return-1};k.Ka=function(){};k.qb=function(a){return this.a[a]};k.zb=function(a,b){this.a[b]!=a&&(this.a[b]=a,this.Ha=!0)};k.ob=function(a,b){return this.o(a,b)};k.yb=function(a,b,c){this.u||this.m(a,b,c)};
|
||||
var Kb=0,Lb=2,Gb=["NONE","RAM","ROM"],Jb=0,Ob=[],Nb=[S.prototype.qb,S.prototype.zb],Rb=[S.prototype.ob,S.prototype.yb];
|
||||
function Sb(a,b){y.call(this,"CPU",a);b=+a.cycles||b;var c=+a.multiplier||1;this.za=0;this.Ea=b;this.X=c;this.Ca=Math.round(this.Ea/1E4)/100;this.R=this.Ca*this.X;this.Da=this.ha=this.ca=this.ra=0;this.g.A=this.g.Ja=!1;this.g.J=a.autoStart;"string"==typeof this.g.J&&(this.g.J="true"==this.g.J);this.g.ua=!1;this.pa=this.W=0;this.qa=+a.csStart;this.fa=+a.csInterval;this.ga=+a.csStop;this.D=[];this.Qa=this.tb.bind(this);this.L=this.B=this.I=this.K=this.w=this.ea=this.G=this.da=this.Fa=this.O=0;this.la=
|
||||
null;H(this)}n(Sb,y);k=Sb.prototype;k.Z=function(a,b,c,d){this.u=a;this.o=b;this.v=d;this.la=a.i;for(a=0;a<Tb.length;a++)(b=this.m[Tb[a]])&&this.u.U(null,Tb[a],b);H(this)};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
|
||||
k.V=function(a,b){var c=Ub(this.u,"autoStart");null!=c?this.g.J="true"==c?!0:"false"==c?!1:!!c:null==this.g.J&&(this.g.J=void 0===this.m.run);if(!b){if(a){Vb(this);if(!this.restore(a))return!1;Wb(this)}else this.reset();this.status("No debugger detected");this.g.J||this.M("CPU will not be auto-started "+(this.la?"(click Run to start)":"(type 'go' to start)"))}return!0};k.P=function(a){return a?this.save():!0};k.J=function(){return this.g.A?!0:this.g.J?(ub(this),!0):!1};k.Sa=function(){return 0};
|
||||
function Wb(a){void 0===a.qa&&(a.qa=0);void 0===a.fa&&(a.fa=-1);void 0===a.ga&&(a.ga=-1);a.g.ua=0<=a.qa&&0<a.fa;a.g.ua&&(a.pa=0,a.W=a.qa-a.L)}function xb(a,b){if(a.g.ua){var c=!1;a.pa=a.pa+a.Sa()|0;a.W-=b;0>=a.W&&(a.W+=a.fa,c=!0);0<=a.ga&&a.ga<=Xb(a)&&(a.fa=a.ga=-1,Wb(a),Q(a),c=!0);c&&a.M(Xb(a)+" cycles: checksum="+r(a.pa))}}
|
||||
k.U=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.m[b]=c,!0;case "run":return this.m[b]=c,c.onclick=function(){var a;if(a=d.u)if(a=d.u,a.g.C)a=!0;else{var b=null,c,h=B(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.g.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.g.C);c++);c==h.length&&(b=a);u("The "+b.type+" component ("+b.id+") is not "+(b.g.ready?"powered yet":"ready yet"+(b.va?" (waiting for notification)":""))+".");a=!1}a&&(d.g.A?Q(d):ub(d))},!0;case "speed":return this.m[b]=
|
||||
c,!0;case "setSpeed":return this.m[b]=c,c.onclick=function(){Yb(d,d.X<<1,!0)},c.textContent=this.R.toFixed(2)+"Mhz",!0}return!1};function wb(a,b,c){a.L+=b;c&&(a.I=a.K=0)}function Zb(a,b){var c=1;b&&1<a.X&&a.O&&(c=a.O/a.Ca);a.Da=Math.round(1E3/$b);a.ha=Math.floor(a.Ea/$b*c);b||(a.ca=a.ha);a.ra=0}function Xb(a){return a.L+a.B+a.I-a.K}function Vb(a){a.O=0;a.Fa=0;a.L=a.B=a.I=a.K=0;Wb(a);Yb(a,1)}
|
||||
function Yb(a,b,c){if(void 0!==b){.8>a.O/a.R&&(b=1);a.X=b;b=a.Ca*a.X;if(a.R!=b){a.R=b;b=a.R.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.M("target speed: "+b)}c&&a.u&&(c=a.u,c.ba&&(d=b=0,window&&(b=window.scrollX,d=window.scrollY),c.ba.focus(),window&&window.scrollTo(b,d)))}wb(a,a.B);a.B=0;a.w=Ma();a.G=0;Zb(a)}function ac(a){for(var b=[],c=0;c<a.D.length;c++)b.push(a.D[c][0]);return b}
|
||||
function vb(a,b){for(var c=a.D.length-1;0<=c;c--){var d=a.D[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function bc(a,b){var c=a.I-=a.K;a.K=0;b&&(a.I=0);return c}
|
||||
k.tb=function(){if(this.g.A){this.ra>=this.Ea&&Zb(this,!0);this.da=0;this.ea=Ma();if(this.G){var a=this.ea-this.G;a>this.Da&&(this.w+=a,this.w>this.ea&&(this.w=this.ea))}try{do{for(var b,c=this.g.ua?1:this.ha,d=this.D.length-1;0<=d;d--){var e=this.D[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.ya(b)}catch(f){if("number"!=typeof f)throw f;}b=bc(this,!0);this.da+=b;this.B+=b;xb(this,b);vb(this,b);this.ca-=b;if(0>=this.ca){this.ca+=this.ha;++this.Fa>=cc&&(this.u&&R(this.u,void 0),this.Fa=0);break}}while(this.g.A)}catch(f){Q(this);
|
||||
this.u&&this.u.stop(Ma(),Xb(this));a=f.stack||f.message;this.g.error=!0;this.F(a);return}if(this.g.A){a=setTimeout;b=this.Qa;this.G=Ma();c=this.Da;this.da&&(c=Math.round(c*this.da/this.ha));c-=this.G-this.ea;if(d=this.G-this.w)this.O=Math.round(this.B/(10*d))/100,864E5<=d&&(this.L=0,Yb(this));if(0>c||this.O<this.R)-1E3>c&&(this.w-=c),c=0;this.ra+=this.da;this.G+=c;a(b,c)}}};
|
||||
function ub(a){var b;a.g.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.g.A)a.M(a.toString()+" busy");else{Yb(a);a.g.A=!0;a.g.Ja=!0;if(b=a.m.run)b.textContent="Halt";a.u&&a.u.start(a.w,Xb(a));a.v||a.status("Started");setTimeout(a.Qa,0)}}k.ya=function(){return 0};function Q(a){var b=!1;if(a.g.A){bc(a);wb(a,a.B);a.B=0;a.g.A=!1;if(b=a.m.run)b.textContent="Run";a.u&&a.u.stop(Ma(),Xb(a));b=!0;a.v||a.status("Stopped")}a.g.complete=void 0;return b}var $b=30,cc=15,Tb=["power","reset"];
|
||||
function dc(a){var b=+a.model||1001;Sb.call(this,a,1E6);this.$a=b;this.Oa=+a.addrReset||0;this.bb=ec.bind(this);this.a=T.bind(this);this.ja=null;this.Na=[];this.g.complete=!1}n(dc,Sb);k=dc.prototype;k.reset=function(){this.status("Model "+this.$a);this.g.A&&Q(this);this.b=this.s=this.sa=0;this.j=this.Ba=this.Oa;this.ma=this.Za=this.Aa=!1;this.l=-1;this.ka=this.j;this.i=0;this.c=this.pb;this.f=this.Ab;this.ja=null;Vb(this);this.g.error=!1;Sb.prototype.reset.call(this)};k.Sa=function(){return 0};
|
||||
k.save=function(){var a=new P(this);a.set(0,[this.b,this.s,this.l,this.sa,this.j,this.Ba,this.ka,this.i]);a.set(1,[]);a.set(2,[this.L,this.X,this.g.J]);a.set(3,fc(this));a.set(4,ac(this));return a.data()};
|
||||
k.restore=function(a){var b;b=a[0];ea();ba();ea();var c=b[Symbol.iterator];b=c?c.call(b):fa(b);this.b=b.next().value;this.s=b.next().value;this.l=b.next().value;this.sa=b.next().value;this.j=b.next().value;this.Ba=b.next().value;this.ka=b.next().value;this.i=b.next().value;b=a[2];this.L=b[0];Yb(this,b[1]);this.g.J=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d<this.Na.length;d++){var e=this.Na[d];if(e.xb===b[c]){d=e;break a}}d=null}d&&(d.next=this.ja,this.ja=d)}a=a[4];for(b=0;b<this.D.length&&
|
||||
b<a.length;b++)this.D[b][0]=a[b];return!0};function gc(a){a.j=(a.j+-1)%Wa}k.abs=function(a){a>N&&(a!=ab?a=bb-a:this.ma=this.Aa=!0);return a};function hc(a,b){b?b==ab?a.ma=a.Aa=!0:b=bb-b:a.Za=a.Aa=!0;return b}function fc(a){var b=[];for(a=a.ja;a;)b.push(a.xb),a=a.next;return b}k.pb=function(a){var b=this.o;a=this.ka=a;return b.a[(a&b.i)>>>b.b].c(a&16383,a)};k.Ab=function(a,b){var c=this.o;a=this.ka=a;c.a[(a&c.i)>>>c.b].f(b,a&16383,a);return b};
|
||||
k.ya=function(a){this.g.complete=!0;var b=a?this.g.Ja?0:1:-1;this.g.Ja=!1;this.I=this.K=a;this.i=this.i&-5|0;do{if(a=this.i)if(a=this.i&11)this.i&2?this.ja||(this.i&=-3):this.i&1&&this.i++,a=!1;if(a){if(this.i&4&&this.v.j(this.j,b)){Q(this);break}if(0>b)break}this.i&=15;this.s=this.s&4194304?this.c(this.b):this.sa=this.c(this.Ba=this.j);this.s&=8388607;this.b=this.s&262143;if(a=this.s>>18&15)this.b=this.b+this.c(a)&Xa;this.s&4194304?a=-1:(this.j=(this.j+1)%Wa,a=this.sa/cb|0);0<=a&&this.bb(a)}while(0<
|
||||
this.K);return this.g.complete?this.I-this.K:!1===this.g.complete?-1:0};w(function(){for(var a=G(document,F,"cpu"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new dc(d);E(d,c)}});function ec(a){ic[a>>4].call(this,a,a&15)}function U(a){this.a(a)}function jc(){var a=0,b=this.c(this.b),c=b/db&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*db+(d<<24)+(b&16777215);a&&(b=(b+a)%J);this.f(this.b,b)}
|
||||
function kc(a,b){a=this.c(this.b);if(0>this.l)this.l=a,this.s=this.b|4194304,gc(this);else{var c=this.l/db&63,d=this.l>>24&63;a=32>=c+d?(a>>c&(1<<d)-1)>>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.f(b,a);this.l=-1}}function lc(a,b){a=this.c(this.b);if(0>this.l)this.l=a,this.s=this.b|4194304,gc(this);else{var c=this.l/db&63,d=this.l>>24&63;b=this.c(b)%Math.pow(2,d)*Math.pow(2,c)%J;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.f(this.b,a);this.l=-1}}function mc(a,b){this.f(b,this.c(this.b))}
|
||||
function nc(a,b){this.f(b,this.b)}function oc(a,b){this.f(this.b,this.c(b))}function pc(a,b){this.f(b,0)}function qc(a,b){this.f(b,K-this.c(b))}function rc(a,b){this.f(b,K)}function sc(a,b){var c=this.c(this.b),d=this.c(b);this.f(b,V(a,d,c)+(c-(c&M)))}function tc(a,b){var c=this.c(b);this.f(b,V(a,c,0))}function uc(a,b){b=this.c(b);var c=this.c(this.b);this.f(this.b,V(a,c,b)+(b-(b&M)))}
|
||||
function vc(a,b){var c=this.c(this.b),d=c;if(a&=384)switch(d-=d&M,a){case 256:d+=M;break;case 384:d+=c>N?M:0}c=d;this.f(this.b,c);b&&this.f(b,c)}function wc(a,b){var c=(this.c(this.b)&M)*L,d=this.c(b);this.f(b,V(a,d,c)+c)}function xc(a,b){var c=this.b*L,d=this.c(b);this.f(b,V(a,d,c)+c)}function yc(a,b){b=(this.c(b)&M)*L;var c=this.c(this.b);this.f(this.b,V(a,c,b)+b)}function zc(a,b){var c=this.c(this.b),d=(c&M)*L,c=V(a,c,d)+d;this.f(this.b,c);b&&this.f(b,c)}
|
||||
function Ac(a,b){var c=this.c(this.b)&M,d=this.c(b);this.f(b,W(a,d,c)+c)}function Bc(a,b){var c=this.c(b);this.f(b,W(a,c,this.b)+this.b)}function Cc(a,b){b=this.c(b)&M;var c=this.c(this.b);this.f(this.b,W(a,c,b)+b)}function Dc(a,b){var c=this.c(this.b),d=c;if(a&=384)switch(d&=M,a){case 256:d+=M*L;break;case 384:d+=c>$a?M*L:0}c=d;this.f(this.b,c);b&&this.f(b,c)}function Ec(a,b){var c=this.c(this.b)/L|0,d=this.c(b);this.f(b,W(a,d,c)+c)}function Fc(a,b){var c=this.c(b);this.f(b,W(a,c,0))}
|
||||
function Gc(a,b){b=this.c(b)/L|0;var c=this.c(this.b);this.f(this.b,W(a,c,b)+b)}function Hc(a,b){var c=this.c(this.b),d=c/L|0,c=W(a,c,d)+d;this.f(this.b,c);b&&this.f(b,c)}function X(a){this.a(a)}function Ic(){}function T(a){this.M("undefined opcode: "+la(a));gc(this);Q(this)}function W(a,b,c){switch(a&384){case 0:b-=b&M;break;case 128:b=0;break;case 256:b=M*L;break;case 384:b=c>$a?M*L:0}return b}
|
||||
function V(a,b,c){switch(a&384){case 0:b&=M;break;case 128:b=0;break;case 256:b=M;break;case 384:b=c>N?M:0}return b}function Y(a,b){return((a/O|0)&(b/O|0))*O+((a&b)>>>0)}function Jc(a,b){return((a/O|0)^(b/O|0))*O+((a^b)>>>0)}function Kc(a,b){return(~((a/O|0)^(b/O|0))&15)*O+(~(a^b)>>>0)}function Z(a,b){return(a/O|0|b/O|0)*O+((a|b)>>>0)}
|
||||
var ic=[U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},jc,function(a,b){0>this.l&&jc.call(this);kc.call(this,0,b)},kc,function(a,b){0>this.l&&jc.call(this);lc.call(this,0,b)},lc,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},kc,lc,mc,function(a,b){b&&this.f(b,this.c(this.b))},function(a,b){a=this.c(this.b);a=(a/M|0)+a%M*M;this.f(b,a)},function(a,b){this.f(b,this.b*M)},function(a,b){a=this.c(b);a=(a/M|0)+a%M*M;this.f(this.b,a)},function(a,b){a=this.c(this.b);a=(a/M|0)+a%M*M;this.f(this.b,a);b&&this.f(b,a)},function(a,b){this.f(b,fc(this,this.c(this.b)))},function(a,b){this.f(b,this.b?$a-this.b:0)},function(a,b){this.f(this.b,fc(this,
|
||||
this.c(b)))},function(a,b){a=fc(this,this.c(this.b));this.f(this.b,a);b&&this.f(b,a)},function(a,b){this.f(b,this.abs(this.c(this.b)))},function(a,b){this.f(b,this.b)},function(a,b){this.f(this.b,this.abs(this.c(b)))},function(a,b){a=this.abs(this.c(this.b));this.f(this.b,a);b&&this.f(b,a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a,b){if(a=(this.b<<14>>24)%36){var c=this.c(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%K+Math.trunc(c/Math.pow(2,36-a));this.f(b,c)}},function(a,b){if(a=this.b<<14>>24){var c=this.c(b),c=0<a?36<=a?0:c*Math.pow(2,a)%K:-36>=a?0:Math.trunc(c/Math.pow(2,-a));this.f(b,c)}},function(a){this.a(a)},function(a){this.a(a)},function(a,b){if(a=(this.b<<
|
||||
14>>24)%72){var c=this.c(b),d=this.c(b+1&15),e=c;0>a&&(a=72+a);36>a?(c=c*Math.pow(2,a)%K+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%K+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%K+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%K+Math.trunc(d/Math.pow(2,72-a)));this.f(b,c);this.f(b+1&15,d)}},function(a,b){if(a=this.b<<14>>24){var c=this.c(b),d=this.c(b+1&15);0<a?36<=a?(d=0,c=72<=a?0:d*Math.pow(2,a-36)%K):(c=c*Math.pow(2,a)%K+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%K):
|
||||
-36>=a?(c=0,d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36))):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%K,c=Math.trunc(c/Math.pow(2,-a)));this.f(b,c);this.f(b+1&15,d)}},T,function(a,b){a=this.c(b);this.f(b,this.c(this.b));this.f(this.b,a)},function(a,b){a=!1;for(var c=this.c(b),d=c/M|0,c=c&N;!a;)this.f(c,this.c(d)),c==this.b&&(a=!0),d=d+1&N,c=c+1&N,this.g.A||(this.f(b,d*M+c),a||ec(this),a=!0)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
T,function(a){this.a(a)},function(a,b){a=this.c(b);a+=262145;this.f(a&N,this.c(this.b));a>=K&&(a-=K);this.f(b,a)},function(a,b){a=this.c(b);var c=this.c(a&N);this.f(this.b,c);this.b==b&&(a=c);a-=262145;0>a&&(a+=K);this.f(b,a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},mc,nc,oc,function(a,b){b&&this.f(b,this.c(this.b))},function(a,b){a=this.c(this.b);a=(a/L|0)+a%L*L;this.f(b,a)},function(a,b){this.f(b,this.b*L)},function(a,b){a=this.c(b);a=(a/L|0)+a%L*L;this.f(this.b,a)},function(a,b){a=this.c(this.b);a=(a/L|0)+a%L*L;this.f(this.b,a);b&&this.f(b,a)},function(a,b){this.f(b,hc(this,this.c(this.b)))},function(a,b){this.f(b,this.b?bb-this.b:0)},function(a,b){this.f(this.b,hc(this,
|
||||
this.c(b)))},function(a,b){a=hc(this,this.c(this.b));this.f(this.b,a);b&&this.f(b,a)},function(a,b){this.f(b,this.abs(this.c(this.b)))},function(a,b){this.f(b,this.b)},function(a,b){this.f(this.b,this.abs(this.c(b)))},function(a,b){a=this.abs(this.c(this.b));this.f(this.b,a);b&&this.f(b,a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a,b){var c=this.b<<14>>24;if(c){a=this.c(b);var d=a>N?-(J-a):a;0<c?(35<=c?(d=0>d?Ya:0,c=Za):(d=d*Math.pow(2,c)%Ya,c=Ya-Math.pow(2,35-c)),a<=N?a+c>N&&(this.ma=!0):a-c<=N&&(this.ma=!0)):d=-35>=c?0>d?-1:0:Math.trunc(d/Math.pow(2,-c));a=0>d?d+J:d;this.f(b,a)}},function(a,b){if(a=(this.b<<14>>24)%36){var c=this.c(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%J+Math.trunc(c/
|
||||
Math.pow(2,36-a));this.f(b,c)}},function(a,b){if(a=this.b<<14>>24){var c=this.c(b),c=0<a?36<=a?0:c*Math.pow(2,a)%J:-36>=a?0:Math.trunc(c/Math.pow(2,-a));this.f(b,c)}},function(a){this.a(a)},function(a){this.a(a)},function(a,b){if(a=(this.b<<14>>24)%72){var c=this.c(b),d=this.c(b+1&15),e=c;0>a&&(a=72+a);36>a?(c=c*Math.pow(2,a)%J+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%J+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%J+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%J+Math.trunc(d/
|
||||
Math.pow(2,72-a)));this.f(b,c);this.f(b+1&15,d)}},function(a,b){if(a=this.b<<14>>24){var c=this.c(b),d=this.c(b+1&15);0<a?36<=a?(d=0,c=72<=a?0:d*Math.pow(2,a-36)%J):(c=c*Math.pow(2,a)%J+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%J):-36>=a?(c=0,d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36))):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%J,c=Math.trunc(c/Math.pow(2,-a)));this.f(b,c);this.f(b+1&15,d)}},T,function(a,b){a=this.c(b);this.f(b,this.c(this.b));this.f(this.b,a)},function(a,b){a=!1;for(var c=
|
||||
this.c(b),d=c/L|0,c=c&M;!a;)this.f(c,this.c(d)),c==this.b&&(a=!0),d=d+1&M,c=c+1&M,this.g.A||(this.f(b,d*L+c),a||gc(this),a=!0)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},T,function(a){this.a(a)},function(a,b){a=this.c(b);a+=262145;this.f(a&M,this.c(this.b));a>=J&&(a-=J);this.f(b,a)},function(a,b){a=this.c(b);var c=this.c(a&M);this.f(this.b,c);this.b==b&&(a=c);a-=262145;0>a&&(a+=J);this.f(b,a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},nc,nc,function(){this.f(this.b,
|
||||
0)},function(a,b){this.f(this.b,this.f(b,0))},function(a,b){this.f(b,Y(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Y(this.c(b),this.b))},function(a,b){this.f(this.b,Y(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(this.c(b),this.c(this.b))))},function(a,b){this.f(b,Y(L-this.c(b),this.c(this.b)))},function(a,b){this.f(b,Y(L-this.c(b),this.b))},function(a,b){this.f(this.b,Y(L-this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(L-this.c(b),this.c(this.b))))},
|
||||
kc,lc,Gc,kc,function(a,b){this.f(b,Y(this.c(b),L-this.c(this.b)))},function(a,b){this.f(b,Y(this.c(b),L-this.b))},function(a,b){this.f(this.b,Y(this.c(b),L-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(this.c(b),L-this.c(this.b))))},Gc,Gc,mc,mc,function(a,b){this.f(b,Hc(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Hc(this.c(b),this.b))},function(a,b){this.f(this.b,Hc(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Hc(this.c(b),this.c(this.b))))},function(a,b){this.f(b,
|
||||
Z(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Z(this.c(b),this.b))},function(a,b){this.f(this.b,Z(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(this.c(b),this.c(this.b))))},function(a,b){this.f(b,Y(L-this.c(b),L-this.c(this.b)))},function(a,b){this.f(b,Y(L-this.c(b),L-this.b))},function(a,b){this.f(this.b,Y(L-this.c(b),L-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(L-this.c(b),L-this.c(this.b))))},function(a,b){this.f(b,Ic(this.c(b),this.c(this.b)))},function(a,
|
||||
b){this.f(b,Ic(this.c(b),this.b))},function(a,b){this.f(this.b,Ic(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Ic(this.c(b),this.c(this.b))))},oc,oc,function(a,b){this.f(this.b,L-this.c(b))},function(a,b){this.f(this.b,this.f(b,L-this.c(b)))},function(a,b){this.f(b,Z(L-this.c(b),this.c(this.b)))},function(a,b){this.f(b,Z(L-this.c(b),this.b))},function(a,b){this.f(this.b,Z(L-this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(L-this.c(b),this.c(this.b))))},function(a,
|
||||
b){this.f(b,L-this.c(this.b))},function(a,b){this.f(b,L-this.b)},function(){this.f(this.b,L-this.c(this.b))},function(a,b){this.f(this.b,this.f(b,L-this.c(this.b)))},function(a,b){this.f(b,Z(this.c(b),L-this.c(this.b)))},function(a,b){this.f(b,Z(this.c(b),L-this.b))},function(a,b){this.f(this.b,Z(this.c(b),L-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(this.c(b),L-this.c(this.b))))},function(a,b){this.f(b,Z(L-this.c(b),L-this.c(this.b)))},function(a,b){this.f(b,Z(L-this.c(b),L-this.b))},
|
||||
function(a,b){this.f(this.b,Z(L-this.c(b),L-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(L-this.c(b),L-this.c(this.b))))},pc,pc,function(){this.f(this.b,L)},function(a,b){this.f(this.b,this.f(b,L))},qc,rc,sc,tc,uc,vc,wc,xc,qc,rc,sc,tc,uc,vc,wc,xc,qc,rc,sc,tc,uc,vc,wc,xc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},pc,pc,function(){this.f(this.b,0)},function(a,b){this.f(this.b,this.f(b,0))},function(a,b){this.f(b,Y(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Y(this.c(b),this.b))},function(a,b){this.f(this.b,Y(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(this.c(b),this.c(this.b))))},
|
||||
function(a,b){this.f(b,Y(K-this.c(b),this.c(this.b)))},function(a,b){this.f(b,Y(K-this.c(b),this.b))},function(a,b){this.f(this.b,Y(K-this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(K-this.c(b),this.c(this.b))))},mc,nc,Ic,mc,function(a,b){this.f(b,Y(this.c(b),K-this.c(this.b)))},function(a,b){this.f(b,Y(this.c(b),K-this.b))},function(a,b){this.f(this.b,Y(this.c(b),K-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(this.c(b),K-this.c(this.b))))},Ic,Ic,oc,oc,function(a,b){this.f(b,
|
||||
Jc(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Jc(this.c(b),this.b))},function(a,b){this.f(this.b,Jc(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Jc(this.c(b),this.c(this.b))))},function(a,b){this.f(b,Z(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Z(this.c(b),this.b))},function(a,b){this.f(this.b,Z(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(this.c(b),this.c(this.b))))},function(a,b){this.f(b,Y(K-this.c(b),K-this.c(this.b)))},function(a,b){this.f(b,
|
||||
Y(K-this.c(b),K-this.b))},function(a,b){this.f(this.b,Y(K-this.c(b),K-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y(K-this.c(b),K-this.c(this.b))))},function(a,b){this.f(b,Kc(this.c(b),this.c(this.b)))},function(a,b){this.f(b,Kc(this.c(b),this.b))},function(a,b){this.f(this.b,Kc(this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Kc(this.c(b),this.c(this.b))))},qc,qc,function(a,b){this.f(this.b,K-this.c(b))},function(a,b){this.f(this.b,this.f(b,K-this.c(b)))},function(a,b){this.f(b,
|
||||
Z(K-this.c(b),this.c(this.b)))},function(a,b){this.f(b,Z(K-this.c(b),this.b))},function(a,b){this.f(this.b,Z(K-this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(K-this.c(b),this.c(this.b))))},function(a,b){this.f(b,K-this.c(this.b))},function(a,b){this.f(b,K-this.b)},function(){this.f(this.b,K-this.c(this.b))},function(a,b){this.f(this.b,this.f(b,K-this.c(this.b)))},function(a,b){this.f(b,Z(this.c(b),K-this.c(this.b)))},function(a,b){this.f(b,Z(this.c(b),K-this.b))},function(a,b){this.f(this.b,
|
||||
Z(this.c(b),K-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(this.c(b),K-this.c(this.b))))},function(a,b){this.f(b,Z(K-this.c(b),K-this.c(this.b)))},function(a,b){this.f(b,Z(K-this.c(b),K-this.b))},function(a,b){this.f(this.b,Z(K-this.c(b),K-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z(K-this.c(b),K-this.c(this.b))))},rc,rc,function(){this.f(this.b,K)},function(a,b){this.f(this.b,this.f(b,K))},sc,tc,uc,vc,wc,xc,yc,zc,sc,tc,uc,vc,wc,xc,yc,zc,sc,tc,uc,vc,wc,xc,yc,zc,sc,tc,uc,vc,
|
||||
wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ac,Bc,Cc,Dc,Ec,Fc,Gc,Hc,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},
|
||||
function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X];
|
||||
function Jc(a){A.call(this,"ROM",a);this.N=this.a=null;this.l=+a.addr;this.i=+a.size;this.b=a.alias;"string"==typeof this.b&&(this.b=eval(this.b));this.j=a.file;this.s=ma(this.j);if(this.j){a=this.j;var b=na(this.s);"json"!=b&&"hex"!=b&&(a=t()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;u(a,null,!0,function(a,b,f){f?(c.F("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Ja(c.na,a,b),(a=ua(a,b))?(c.a=a.H,c.N=a.N):c.j=null);Kc(c)})}}n(Jc,A);
|
||||
Jc.prototype.Z=function(a,b,c,d){this.o=b;this.h=c;this.v=d;Kc(this)};Jc.prototype.V=function(){this.N&&(this.v&&this.v.a(this.id,this.l,this.i,this.N),delete this.N);return!0};Jc.prototype.P=function(){return!0};
|
||||
function Kc(a){if(!Ta(a)){if(a.j){if(!a.a||!a.o)return;a.i||(a.i=a.a.length);if(a.a.length!=a.i){var b="ROM size ("+r(a.a.length,8,!0)+") does not match specified size ("+r(a.i,8,!0)+")";a.g.error=!0;a.F(b)}else{b=a.l;if(Bb(a.o,b,a.i,Jb)){var c;for(c=0;c<a.a.length;c++)xb(a.o,b+c,a.a[c]);b=!0}else 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++){for(var d=a,e=b[c],f=d.o,g=d.i,h=[],l=d.l>>>f.b;0<g&&l<f.a.length;)h.push(f.a[l++]),g-=16384;f=d.o;
|
||||
d=d.i;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=h[g++];if(!l)break;f.a[e++]=l;d-=16384}}delete a.a}}}I(a)}}x(function(){for(var a=H(document,G,"rom"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Jc(d);F(d,c)}});
|
||||
function Lc(a){A.call(this,"RAM",a);this.N=this.Y=null;this.b=+a.addr;this.i=+a.size;this.T=a.load;this.S=a.exec;null!=this.T&&(this.T=+this.T);null!=this.S&&(this.S=+this.S);this.j=this.s=!1;this.a=a.file;this.l=ma(this.a);if(this.a){a=this.a;var b=na(this.l);"json"!=b&&"hex"!=b&&(a=t()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;u(a,null,!0,function(a,b,f){f?(c.F("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(Ja(c.na,a,b),(a=ua(a,b))?(c.Y=a.Y,c.N=a.N,null==
|
||||
c.T&&(c.T=a.T),null==c.S&&(c.S=a.S)):c.a=null);Mc(c)})}}n(Lc,A);Lc.prototype.Z=function(a,b,c,d){this.o=b;this.h=c;this.v=d;Mc(this)};Lc.prototype.V=function(a,b){this.N&&(this.v&&this.v.a(this.id,this.b,this.i,this.N),delete this.N);b||this.reset();return!0};Lc.prototype.P=function(){return!0};
|
||||
function Mc(a){if(a.o&&(!a.j&&a.i&&(Bb(a.o,a.b,a.i,1)?a.j=!0:a.i=0),!Ta(a))){if(!a.j)w("No RAM allocated");else if(a.a){if(!a.Y)return;Nc(a,a.Y,a.T,a.S,a.b)?a.status('Loaded image "'+a.l+'"'):a.F('Error loading image "'+a.l+'"')}a.s=!0;I(a)}}
|
||||
Lc.prototype.reset=function(){if(this.j&&!this.s){for(var a=this.o,b=this.b,c=this.i,d=b&16383,b=b>>>a.b;0<c&&b<a.a.length;){var e=a.a[b],f=c,g=0,h,d=d||0,g=g||0;0>g&&g>=ja&&(g+=ia);g=Math.trunc(Math.abs(g))%ia;void 0===f&&(f=e.size);for(h=d;f--&&h<e.size;h++)e.m(g,d,e.aa+d);c-=16384;b++;d=0}this.Y&&Nc(this,this.Y,this.T,this.S,this.b,!this.v)}this.s=!1};
|
||||
function Nc(a,b,c,d,e,f){var g=!1;null==c&&(c=e);if(null!=c){for(g=0;g<b.length;g++)xb(a.o,c+g,b[g]);g=!0}g&&(null==d&&(Q(a.h),f=!1),null!=d&&(a=a.h,a.Na=d,a.j=d%Va,f?a.g.C?a.g.A||sb(a):a.g.J=!0:a.v&&a.g.C?Q(a)||a.u.g.reset||(a.v.i(),R(a.u,-1)):!1===f&&Q(a),!a.g.A&&a.la&&a.la.stop()));return g}x(function(){for(var a=H(document,G,"ram"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Lc(d);F(d,c)}});
|
||||
function Oc(a){A.call(this,"SerialPort",a);this.j=a.upperCase;"string"==typeof this.j&&(this.j="true"==this.j);this.i=!0;this.b=[];var b=a.binding;if("console"!=b){var c;a=Pc;b&&(void 0===c&&(c="Panel"),(c=D(c,this.id))&&(b=c.m[b])&&this.U(null,a,b))}this.a=this.l=null;this.exports={connect:this.Ta,receiveData:this.va,receiveStatus:this.rb,setConnection:this.ub}}n(Oc,A);k=Oc.prototype;
|
||||
k.U=function(a,b,c){var d=this;switch(b){case Pc:return this.m[b]=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.La:q.Ya:46==c?b=q.La:a.ctrlKey&&c>=q.Ka&&c<=q.ab&&(b=c-(q.Ka-q.Va));b&&(a.preventDefault&&a.preventDefault(),d.va(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Xa&&(b=q.Wa);d.va(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
||||
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.va(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};k.Z=function(a,b,c,d){this.u=a;this.o=b;this.h=c;this.v=d;I(this)};
|
||||
k.Ta=function(a){if(!this.a){var b=Sb(this.u,"connection");if(b){var c=b.split("->");if(2==c.length){var d=sa(c[0]);if(d!=this.ma)return;c=sa(c[1]);if(this.a=Na(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.i);if(this.l=e.receiveData){this.i=a;this.status("Connected "+this.na+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};k.V=function(a,b){if(!b)if(this.Ta(this.i),!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
k.P=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.va=function(a){if("number"==typeof a)this.b.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.b.push(b)}else this.b=this.b.concat(a);return!0};k.rb=function(){};k.ub=function(a,b){return this.a?!1:(this.a=a,this.l=b,!0)};var Pc="buffer";
|
||||
x(function(){for(var a=H(document,G,"serial"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Oc(d);F(d,c)}});
|
||||
function Qc(a,b,c){A.call(this,"Computer",a);this.g.C=!1;this.L=null;Rc(this,b);this.I=Sb(this,"autoPower",a,6);this.j=0;this.W=+a.busWidth||+a.buswidth;this.D=this.s=this.G=null;this.B=this.R=!1;this.w=this.l=null;this.O=this.K=!1;this.X=Sb(this,"url")||"";(Math.random()+.1).toString(36);this.b=Sc(this);if(this.h=D("CPU",this.id)){this.v=D("Debugger",this.id);this.o=new yb({id:this.na+".bus",busWidth:this.W},this.h,this.v);var d,e=C(this.id);if((this.i=D("Panel",this.id))&&this.i.ba)for(b=0;b<e.length;b++)d=
|
||||
e[b],d.F=this.i.F,d.M=this.i.M,d.ba=this.i.ba;this.M(J+" v1.34.2\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Z&&d.Z(this,this.o,this.h,this.v);b=null;d=Sb(this,"resume",a);void 0!==d&&(1<d.length?b=this.s=d:this.a=parseInt(d,10));var f;if(a=Sb(this,"state")||(f=!0,a.state))this.G=b=a,f||(this.B=!0,this.a=Tc),this.a&&(this.w=new P(this,"1.34.2"),Uc(this.w)?b=null:delete this.w);!b&&this.a&&
|
||||
(b=Vc(this))&&(this.B=!0);if(b){var g=this;u(b,null,!0,function(a,b,c){c?(g.s=null,g.B=!1,g.F("Unable to load machine state from server (error "+c+(b?": "+sa(b):"")+")")):(g.D=b,g.R=!0);I(g)})}else I(this);this.m.power||(this.I=!0);!c&&this.I&&Wc(this,this.ia)}else w("Unable to find CPU component")}n(Qc,A);function Rc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){w(d.message+" ("+c+")")}}a.L=b}
|
||||
function Sb(a,b,c,d){var e=b.toLowerCase(),e=Aa(b)||Aa(e);void 0===e&&a.L&&(e=a.L[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}function Wc(a,b,c){for(var d=C(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ta(f)){Ta(f,function(){Wc(a,b,c)});return}}b.call(a,c)}
|
||||
function Xc(a,b){var c=new P(a,"1.34.2",Yc);if(Uc(c)&&Zc(c)){var d=c.get($c),e=b?b.get($c):"unknown";d!=e&&(a.F("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Qc.prototype;
|
||||
k.ia=function(a){void 0===a&&(a=this.a||(this.D?ad:Tc));if(!this.j){this.j++;var b=!1,c=!1;this.K=!1;var d=this.w||new P(this,"1.34.2");if(a==bd)b=!0;else if(a>Tc){if(Uc(d,this.D)){this.l=new P(this,"1.34.2",cd);Uc(this.l)&&(dd(this,d),a=ed,fd(this.l));this.l.set($c,ta());gd(this.l);var e=this.a&&!this.B;if(a==ad||Ma("Click OK to restore the previous "+J+" machine state, or CANCEL to reset the machine.")){if(c=Zc(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Uc(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.F("Error: "+g),"unable to verify user"==g&&(ya(hd,""),this.b=null)):this.M(f+": "+g),fd(d),Uc(d)?(c=Zc(d),e=!0):c=!1))}e&&Xc(this,c?d:null)}else a==ed&&d.clear()}else Xc(this);delete this.D;delete this.w}e=C(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.h&&(c=id(this,g,d,b,c));b=[d,a,c];a!=bd?Wc(this,this.Ra,b):this.Ra(b)}};
|
||||
function id(a,b,c,d,e){if(!b.g.C){b.g.C=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.V(f,d)&&f&&(w("Unable to restore state for "+b.type),a.G&&!a.R?(c.clear(),a.a=Tc,window&&window.location.reload()):a.K=!0,b.V(null),e=!1),!d&&b.Oa){var g=b.Oa.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(h){w("Error restoring state for "+b.type+" ("+h.message+")")}}return e}
|
||||
k.Ra=function(a){var b=a[0],c=0>a[1];a=a[2];this.O=!0;this.g.C=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.h&&(id(this,this.h,b,c,a),R(this,-2),this.h.J());this.K&&(dd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.j=0};
|
||||
function dd(a,b){if(Ma("There may be a problem with your "+J+" machine.\n\nTo help us diagnose it, click OK to send this "+J+" machine state to http://www.pcjs.org.")){var c=a.X;a=a.b||"";b=b.toString();var d={};d.app=J;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;u("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function jd(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.34.2"),g=new P(a,"1.34.2",Yc),h=ta();g.set($c,h);f.set($c,h);f.set(kd,"1.34.2");f.set(ld,window?window.location.href:null);f.set(md,window?window.navigator.userAgent:"");a.h&&a.h.P&&(c&&(b&&(a.h.g.J=a.h.g.A),Q(a.h)),d=a.h.P(b,c),"object"===typeof d&&f.set(a.h.id,d),c&&(a.h.g.C=!1,!1===d&&(e=null)));for(var h=C(a.id),l=0;l<h.length;l++){var p=h[l];p.g.C&&(p.P&&(d=p.P(b,c),"object"===typeof d&&f.set(p.id,d)),c&&(p.g.C=!1,!1===
|
||||
d&&(e=null)))}e&&(c?(h=d=!1,b?(a.b&&nd(a,a.b,f.toString()),gd(g)&&gd(f)||(e=null,d=h=!0)):a.a&&(d=!0,h=a.a==od),d&&f.clear(h)):e=f.toString());c&&(a.g.C=!1,b=a.m.power)&&(b.textContent="Power");a.j=0;return e}k.reset=function(){this.g.reset=!0;this.o&&this.o.reset&&this.o.reset();this.h&&this.h.reset&&this.h.reset();for(var a=C(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.o&&c!==this.h&&c.reset&&c.reset()}this.g.reset=!1;R(this,-1)};
|
||||
k.start=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}R(this,-1)};k.stop=function(a,b){for(var c=C(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}R(this,-1)};
|
||||
function R(a,b){if(a.h){var c=a.h,d=b||0,e=c.m.speed;e&&(0>=d||30<=(c.ya+=d))&&(e.textContent=c.g.A?c.O.toFixed(2)+"Mhz":"Stopped",c.ya=0)}if(a.i&&(a=a.i,b=b||0,a.D)){c=a.h.g.A;d=!!(a.h.i&8);if(0>=b||60<=(a.B+=b)){e=a.h.j;if(a.m.PC){var f=a.v&&a.v.l||8,e=e||0,e=8==f?la(e,void 0):r(e,void 0);a.m.PC.textContent!=e&&(a.m.PC.textContent=e)}a.B=0}-1>b?a.b=a.h.j:0<b&&c&&!d&&(a.b=a.h.ka);kb(a,a.b);eb(a,a.j)}}
|
||||
k.U=function(a,b,c){var d=this;switch(b){case "power":return this.m[b]=c,c.onclick=function(){d.j||(d.g.C?jd(d,!1,!0):Wc(d,d.ia))},!0;case "reset":return this.m[b]=c,c.onclick=function(){if(d.g.C&&!d.j)if(d.a&&!d.s){var a=Ma("Click OK to save changes to this "+J+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");jd(d,a,!0);!a&&d.G?window&&window.location.reload():d.ia(Tc)}else d.reset(),d.h&&!d.v&&d.h.J()},!0;case "save":if(oa())c.parentNode.removeChild(c);else return this.m[b]=
|
||||
c,c.onclick=function(){var a=Sc(d,!0);if(a){var b=!!(d.a&&!d.s||d.G),c=jd(d,b);b?nd(d,a,c):d.F("Resume disabled, machine state not saved")}},!0}return!1};function Sc(a,b){var c=a.b;c||((c=xa(hd),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=pd(a,c))||a.F("The user ID is invalid.")):b&&a.F("Browser local storage is not available"));return c}
|
||||
function pd(a,b){a.b=null;b=u(t()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(ya(hd,b.data),a.b=b.data)}catch(d){w(d.message+" ("+c+")")}return a.b}function Vc(a){var b=null;a.b&&(b=t()+"/api/v1/user?req=load&user="+a.b+"&state="+qd(a,"1.34.2"));return b}
|
||||
function nd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=qd(a,"1.34.2");d.data=c;b=u(t()+"/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.F("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.F(c),ya(hd,""),a.b=null)}}
|
||||
var cd="failsafe",Yc="validate",$c="timestamp",kd="version",ld="url",md="browser",hd="user",bd=-1,Tc=0,ad=1,ed=2,od=3;x(function(){for(var a=H(document,G+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=E(c),c=H(c,G,"computer"),e=0;e<c.length;e++){var f=c[e],g=E(f),g=new Qc(g,d,!0);F(g,f);g.I&&Wc(g,g.ia)}});z.show.push(function(){for(var a=H(document,G,"computer"),b=0;b<a.length;b++){var c=E(a[b]);(c=D("Computer",c.id))&&c.O&&!c.g.C&&c.ia(bd)}});
|
||||
z.exit.push(function(){for(var a=H(document,G,"computer"),b=0;b<a.length;b++){var c=E(a[b]);(c=D("Computer",c.id))&&c.g.C&&jd(c,!(!c.a||c.s),!0)}});function P(a,b,c){this.id=a.id;this.b="";this.a={};this.h=this.m=!1;this.key=qd(a,b,c);fd(this,a.Ua)}k=P.prototype;k.set=function(a,b){try{this.a[a]=b}catch(c){}};k.get=function(a){return this.a[a]||null};k.data=function(){return this.a};function Uc(a,b){return b?(a.b=b,a.h=!0,a.m=!1,!0):a.h?!0:va()&&(b=xa(a.key))?(a.b=b,a.h=!0):!1}
|
||||
function Zc(a){var b=!0;if(!a.m)try{a.a=JSON.parse(a.b),a.m=!0}catch(c){w(c.message||c),b=!1}return b}function gd(a){var b=!0;if(va()){var c=JSON.stringify(a.a);ya(a.key,c)||(w("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}k.toString=function(){return this.a?JSON.stringify(this.a):this.b};function fd(a,b){a.b="";a.a={};a.h=a.m=!1;b&&a.set("parms",b)}
|
||||
k.clear=function(a){fd(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 qd(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}var rd=0;
|
||||
function sd(a,b,c,d,e,f,g){f("Loading "+a+"...");u(a,null,!0,function(h,l,p){p?(l||(l="unable to load "+a+" ("+p+")"),g(l,null)):td(l,a,b,c,d,e,f,g)})}
|
||||
function td(a,b,c,d,e,f,g,h){function l(a,g){if(g)h(g,null);else{c&&(Ja(c,b,a),(g=b)&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1<e.length&&(e+=",")):e='{state:"'+e+'",':e="{",e+='url:"'+g+'"}',"object"==typeof resources&&(g=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(y){g=null,a=y.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?f?ud(a,g,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function ud(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");u(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],p,v=/( [a-z]+=)(['"])(.*?)\2/g;p=v.exec(f);)l=0>l.indexOf(p[1])?l.replace(">",p[0]+">"):l.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[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);ud(a,b,c)}})}else c(a,null)}
|
||||
function vd(a,b,c,d,e){function f(a){if(void 0===l){var b=h&&H(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=pa(a))}function g(a){f("Error: "+a);p&&(--rd||Fa(!0));p=!1}var h,l,p=!0;rd++;Ka[b]={};try{if(h=document.getElementById(b)){var v;if("object"==typeof resources&&(v=resources.css)){var y=document.head||document.getElementsByTagName("head")[0],qa=document.createElement("style");qa.type="text/css";qa.styleSheet?qa.styleSheet.cssText=v:qa.appendChild(document.createTextNode(v));y.appendChild(qa)}d||
|
||||
(v=a,"pdp"==a.substr(0,3)&&(v="pdpjs"),d="/versions/"+v+"/1.34.2/components.xsl");v=function(e,l){l?sd(d,null,a,null,!1,f,function(a,e){e?(Ja(b,d,a),f("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=l.transformNode(e))?(h.outerHTML=e,--rd||Fa(!0)):g("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--rd||
|
||||
Fa(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?sd(c,b,a,e,!0,f,v):td(c,null,b,a,e,!1,f,v)}else g("missing machine element: "+b)}catch(wd){g(wd.message)}return p}window.embedPDP10=function(a,b,c,d){Fa(!1);return vd("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){Fa(!1);return vd("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return D(b,a+".machine")};
|
||||
window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!Pa[a]){for(var c=!0,d=Pa,e=a,f=b.length,g=[],h=[],l="",p=null,v=0;v<f;v++){var y=b[v];if('"'==y||"'"==y)p&&y!=p?l+=y:(p?p=null:p=y,l&&(h.push(l),l=""));else{if(!p){if("\r"==y||"\n"==y)y=";";if(" "==y||"\t"==y||";"==y){l&&(h.push(l),l="");";"==y&&h.length&&(g.push(h),h=[]);continue}}l+=y}}l&&h.push(l);h.length&&g.push(h);d[e]=g;Oa(a)||(c=!1)}return c};window.enableEvents=Fa;window.sendEvent=Ha;})();//# sourceMappingURL=/tmp/pdpjs/1.34.2/pdp10.map
|
||||
function(a){this.a(a)},function(a){this.a(a)},X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X];
|
||||
function Lc(a){y.call(this,"ROM",a);this.N=this.a=null;this.l=+a.addr;this.i=+a.size;this.b=a.alias;"string"==typeof this.b&&(this.b=eval(this.b));this.j=a.file;this.s=ma(this.j);if(this.j){a=this.j;var b=na(this.s);"json"!=b&&"hex"!=b&&(a=pa()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;t(a,null,!0,function(a,b,f){f?(c.F("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Ka(c.oa,a,b),(a=va(a,b))?(c.a=a.H,c.N=a.N):c.j=null);Mc(c)})}}n(Lc,y);
|
||||
Lc.prototype.Z=function(a,b,c,d){this.o=b;this.h=c;this.v=d;Mc(this)};Lc.prototype.V=function(){this.N&&(this.v&&this.v.a(this.id,this.l,this.i,this.N),delete this.N);return!0};Lc.prototype.P=function(){return!0};
|
||||
function Mc(a){if(!Ua(a)){if(a.j){if(!a.a||!a.o)return;a.i||(a.i=a.a.length);if(a.a.length!=a.i){var b="ROM size ("+r(a.a.length,8,!0)+") does not match specified size ("+r(a.i,8,!0)+")";a.g.error=!0;a.F(b)}else{b=a.l;if(Db(a.o,b,a.i,Lb)){var c;for(c=0;c<a.a.length;c++)zb(a.o,b+c,a.a[c]);b=!0}else 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++){for(var d=a,e=b[c],f=d.o,g=d.i,h=[],l=d.l>>>f.b;0<g&&l<f.a.length;)h.push(f.a[l++]),g-=16384;f=d.o;
|
||||
d=d.i;g=0;for(e>>>=f.b;0<d&&e<f.a.length;){l=h[g++];if(!l)break;f.a[e++]=l;d-=16384}}delete a.a}}}H(a)}}w(function(){for(var a=G(document,F,"rom"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Lc(d);E(d,c)}});
|
||||
function Nc(a){y.call(this,"RAM",a);this.N=this.Y=null;this.b=+a.addr;this.i=+a.size;this.T=a.load;this.S=a.exec;null!=this.T&&(this.T=+this.T);null!=this.S&&(this.S=+this.S);this.j=this.s=!1;this.a=a.file;this.l=ma(this.a);if(this.a){a=this.a;var b=na(this.l);"json"!=b&&"hex"!=b&&(a=pa()+"/api/v1/dump?file="+this.a+"&format=bytes&decimal=true");var c=this;t(a,null,!0,function(a,b,f){f?(c.F("Unable to load RAM resource (error "+f+": "+a+")"),c.a=null):(Ka(c.oa,a,b),(a=va(a,b))?(c.Y=a.Y,c.N=a.N,null==
|
||||
c.T&&(c.T=a.T),null==c.S&&(c.S=a.S)):c.a=null);Oc(c)})}}n(Nc,y);Nc.prototype.Z=function(a,b,c,d){this.o=b;this.h=c;this.v=d;Oc(this)};Nc.prototype.V=function(a,b){this.N&&(this.v&&this.v.a(this.id,this.b,this.i,this.N),delete this.N);b||this.reset();return!0};Nc.prototype.P=function(){return!0};
|
||||
function Oc(a){if(a.o&&(!a.j&&a.i&&(Db(a.o,a.b,a.i,1)?a.j=!0:a.i=0),!Ua(a))){if(!a.j)u("No RAM allocated");else if(a.a){if(!a.Y)return;Pc(a,a.Y,a.T,a.S,a.b)?a.status('Loaded image "'+a.l+'"'):a.F('Error loading image "'+a.l+'"')}a.s=!0;H(a)}}
|
||||
Nc.prototype.reset=function(){if(this.j&&!this.s){for(var a=this.o,b=this.b,c=this.i,d=b&16383,b=b>>>a.b;0<c&&b<a.a.length;){var e=a.a[b],f=c,g=0,h,d=d||0,g=g||0;0>g&&g>=ja&&(g+=ia);g=Math.trunc(Math.abs(g))%ia;void 0===f&&(f=e.size);for(h=d;f--&&h<e.size;h++)e.m(g,d,e.aa+d);c-=16384;b++;d=0}this.Y&&Pc(this,this.Y,this.T,this.S,this.b,!this.v)}this.s=!1};
|
||||
function Pc(a,b,c,d,e,f){var g=!1;null==c&&(c=e);if(null!=c){for(g=0;g<b.length;g++)zb(a.o,c+g,b[g]);g=!0}g&&(null==d&&(Q(a.h),f=!1),null!=d&&(a=a.h,a.Oa=d,a.j=d%Wa,f?a.g.C?a.g.A||ub(a):a.g.J=!0:a.v&&a.g.C?Q(a)||a.u.g.reset||(a.v.i(),R(a.u,-1)):!1===f&&Q(a),!a.g.A&&a.la&&a.la.stop()));return g}w(function(){for(var a=G(document,F,"ram"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Nc(d);E(d,c)}});
|
||||
function Qc(a){y.call(this,"SerialPort",a);this.j=a.upperCase;"string"==typeof this.j&&(this.j="true"==this.j);this.i=!0;this.b=[];var b=a.binding;if("console"!=b){var c;a=Rc;b&&(void 0===c&&(c="Panel"),(c=C(c,this.id))&&(b=c.m[b])&&this.U(null,a,b))}this.a=this.l=null;this.exports={connect:this.Ta,receiveData:this.wa,receiveStatus:this.rb,setConnection:this.ub}}n(Qc,y);k=Qc.prototype;
|
||||
k.U=function(a,b,c){var d=this;switch(b){case Rc:return this.m[b]=c,c.onkeydown=function(a){a=a||window.event;var b=0,c=a.keyCode;8==c?b=a.altKey?q.Ma:q.Ya:46==c?b=q.Ma:a.ctrlKey&&c>=q.La&&c<=q.ab&&(b=c-(q.La-q.Va));b&&(a.preventDefault&&a.preventDefault(),d.wa(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Xa&&(b=q.Wa);d.wa(b);a.preventDefault&&a.preventDefault()}return!0},c.onpaste=function(a){a.stopPropagation&&a.stopPropagation();
|
||||
a.preventDefault&&a.preventDefault();(a=a.clipboardData||window.clipboardData)&&d.wa(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};k.Z=function(a,b,c,d){this.u=a;this.o=b;this.h=c;this.v=d;H(this)};
|
||||
k.Ta=function(a){if(!this.a){var b=Ub(this.u,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ta(c[0]);if(d!=this.na)return;c=ta(c[1]);if(this.a=Oa(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.i);if(this.l=e.receiveData){this.i=a;this.status("Connected "+this.oa+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};k.V=function(a,b){if(!b)if(this.Ta(this.i),!a)this.reset();else if(!this.restore(a))return!1;return!0};
|
||||
k.P=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){var a=new P(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.wa=function(a){if("number"==typeof a)this.b.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d<a.length;d++){c=b;b=a.charCodeAt(d);if(10==b){if(13==c)continue;b=13}this.b.push(b)}else this.b=this.b.concat(a);return!0};k.rb=function(){};k.ub=function(a,b){return this.a?!1:(this.a=a,this.l=b,!0)};var Rc="buffer";
|
||||
w(function(){for(var a=G(document,F,"serial"),b=0;b<a.length;b++){var c=a[b],d=D(c),d=new Qc(d);E(d,c)}});
|
||||
function Sc(a,b,c){y.call(this,"Computer",a);this.g.C=!1;this.L=null;Tc(this,b);this.I=Ub(this,"autoPower",a,6);this.j=0;this.W=+a.busWidth||+a.buswidth;this.D=this.s=this.G=null;this.B=this.R=!1;this.w=this.l=null;this.O=this.K=!1;this.X=Ub(this,"url")||"";(Math.random()+.1).toString(36);this.b=Uc(this);if(this.h=C("CPU",this.id)){this.v=C("Debugger",this.id);this.o=new Ab({id:this.oa+".bus",busWidth:this.W},this.h,this.v);var d,e=B(this.id);if((this.i=C("Panel",this.id))&&this.i.ba)for(b=0;b<e.length;b++)d=
|
||||
e[b],d.F=this.i.F,d.M=this.i.M,d.ba=this.i.ba;this.M(I+" v1.34.2\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Z&&d.Z(this,this.o,this.h,this.v);b=null;d=Ub(this,"resume",a);void 0!==d&&(1<d.length?b=this.s=d:this.a=parseInt(d,10));var f;if(a=Ub(this,"state")||(f=!0,a.state))this.G=b=a,f||(this.B=!0,this.a=Vc),this.a&&(this.w=new P(this,"1.34.2"),Wc(this.w)?b=null:delete this.w);!b&&this.a&&
|
||||
(b=Xc(this))&&(this.B=!0);if(b){var g=this;t(b,null,!0,function(a,b,c){c?(g.s=null,g.B=!1,g.F("Unable to load machine state from server (error "+c+(b?": "+ta(b):"")+")")):(g.D=b,g.R=!0);H(g)})}else H(this);this.m.power||(this.I=!0);!c&&this.I&&Yc(this,this.ia)}else u("Unable to find CPU component")}n(Sc,y);function Tc(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){u(d.message+" ("+c+")")}}a.L=b}
|
||||
function Ub(a,b,c,d){var e=b.toLowerCase(),e=Ba(b)||Ba(e);void 0===e&&a.L&&(e=a.L[b]);void 0===e&&c&&(e=c[b]);void 0===e&&"object"==typeof resources&&resources[b]&&(e=b);void 0===e&&(e=void 0);if("string"==typeof e&&d)switch(d){case 4:e=+e;isNaN(e)&&(e=0);break;case 6:e="true"==e}return e}function Yc(a,b,c){for(var d=B(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Ua(f)){Ua(f,function(){Yc(a,b,c)});return}}b.call(a,c)}
|
||||
function Zc(a,b){var c=new P(a,"1.34.2",$c);if(Wc(c)&&ad(c)){var d=c.get(bd),e=b?b.get(bd):"unknown";d!=e&&(a.F("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Sc.prototype;
|
||||
k.ia=function(a){void 0===a&&(a=this.a||(this.D?cd:Vc));if(!this.j){this.j++;var b=!1,c=!1;this.K=!1;var d=this.w||new P(this,"1.34.2");if(a==dd)b=!0;else if(a>Vc){if(Wc(d,this.D)){this.l=new P(this,"1.34.2",ed);Wc(this.l)&&(fd(this,d),a=gd,hd(this.l));this.l.set(bd,ua());id(this.l);var e=this.a&&!this.B;if(a==cd||Na("Click OK to restore the previous "+I+" machine state, or CANCEL to reset the machine.")){if(c=ad(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Wc(d,g):("error"==f&&"no machine state"!=
|
||||
g?(this.F("Error: "+g),"unable to verify user"==g&&(za(jd,""),this.b=null)):this.M(f+": "+g),hd(d),Wc(d)?(c=ad(d),e=!0):c=!1))}e&&Zc(this,c?d:null)}else a==gd&&d.clear()}else Zc(this);delete this.D;delete this.w}e=B(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.h&&(c=kd(this,g,d,b,c));b=[d,a,c];a!=dd?Yc(this,this.Ra,b):this.Ra(b)}};
|
||||
function kd(a,b,c,d,e){if(!b.g.C){b.g.C=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.V(f,d)&&f&&(u("Unable to restore state for "+b.type),a.G&&!a.R?(c.clear(),a.a=Vc,window&&window.location.reload()):a.K=!0,b.V(null),e=!1),!d&&b.Pa){var g=b.Pa.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(h){u("Error restoring state for "+b.type+" ("+h.message+")")}}return e}
|
||||
k.Ra=function(a){var b=a[0],c=0>a[1];a=a[2];this.O=!0;this.g.C=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.h&&(kd(this,this.h,b,c,a),R(this,-2),this.h.J());this.K&&(fd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.j=0};
|
||||
function fd(a,b){if(Na("There may be a problem with your "+I+" machine.\n\nTo help us diagnose it, click OK to send this "+I+" machine state to http://www.pcjs.org.")){var c=a.X;a=a.b||"";b=b.toString();var d={};d.app=I;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;t("http://www.pcjs.org/api/v1/report",d,!0)}}
|
||||
function ld(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new P(a,"1.34.2"),g=new P(a,"1.34.2",$c),h=ua();g.set(bd,h);f.set(bd,h);f.set(md,"1.34.2");f.set(nd,window?window.location.href:null);f.set(od,window?window.navigator.userAgent:"");a.h&&a.h.P&&(c&&(b&&(a.h.g.J=a.h.g.A),Q(a.h)),d=a.h.P(b,c),"object"===typeof d&&f.set(a.h.id,d),c&&(a.h.g.C=!1,!1===d&&(e=null)));for(var h=B(a.id),l=0;l<h.length;l++){var p=h[l];p.g.C&&(p.P&&(d=p.P(b,c),"object"===typeof d&&f.set(p.id,d)),c&&(p.g.C=!1,!1===
|
||||
d&&(e=null)))}e&&(c?(h=d=!1,b?(a.b&&pd(a,a.b,f.toString()),id(g)&&id(f)||(e=null,d=h=!0)):a.a&&(d=!0,h=a.a==qd),d&&f.clear(h)):e=f.toString());c&&(a.g.C=!1,b=a.m.power)&&(b.textContent="Power");a.j=0;return e}k.reset=function(){this.g.reset=!0;this.o&&this.o.reset&&this.o.reset();this.h&&this.h.reset&&this.h.reset();for(var a=B(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.o&&c!==this.h&&c.reset&&c.reset()}this.g.reset=!1;R(this,-1)};
|
||||
k.start=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}R(this,-1)};k.stop=function(a,b){for(var c=B(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}R(this,-1)};
|
||||
function R(a,b){if(a.h){var c=a.h,d=b||0,e=c.m.speed;e&&(0>=d||30<=(c.za+=d))&&(e.textContent=c.g.A?c.O.toFixed(2)+"Mhz":"Stopped",c.za=0)}if(a.i&&(a=a.i,b=b||0,a.D)){c=a.h.g.A;d=!!(a.h.i&8);if(0>=b||60<=(a.B+=b)){e=a.h.j;if(a.m.PC){var f=a.v&&a.v.l||8,e=e||0,e=8==f?la(e,void 0):r(e,void 0);a.m.PC.textContent!=e&&(a.m.PC.textContent=e)}a.B=0}-1>b?a.b=a.h.j:0<b&&c&&!d&&(a.b=a.h.ka);mb(a,a.b);gb(a,a.j)}}
|
||||
k.U=function(a,b,c){var d=this;switch(b){case "power":return this.m[b]=c,c.onclick=function(){d.j||(d.g.C?ld(d,!1,!0):Yc(d,d.ia))},!0;case "reset":return this.m[b]=c,c.onclick=function(){if(d.g.C&&!d.j)if(d.a&&!d.s){var a=Na("Click OK to save changes to this "+I+" machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");ld(d,a,!0);!a&&d.G?window&&window.location.reload():d.ia(Vc)}else d.reset(),d.h&&!d.v&&d.h.J()},!0;case "save":if(oa())c.parentNode.removeChild(c);else return this.m[b]=
|
||||
c,c.onclick=function(){var a=Uc(d,!0);if(a){var b=!!(d.a&&!d.s||d.G),c=ld(d,b);b?pd(d,a,c):d.F("Resume disabled, machine state not saved")}},!0}return!1};function Uc(a,b){var c=a.b;c||((c=ya(jd),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=rd(a,c))||a.F("The user ID is invalid.")):b&&a.F("Browser local storage is not available"));return c}
|
||||
function rd(a,b){a.b=null;b=t(pa()+"/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(jd,b.data),a.b=b.data)}catch(d){u(d.message+" ("+c+")")}return a.b}function Xc(a){var b=null;a.b&&(b=pa()+"/api/v1/user?req=load&user="+a.b+"&state="+sd(a,"1.34.2"));return b}
|
||||
function pd(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=sd(a,"1.34.2");d.data=c;b=t(pa()+"/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.F("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.F(c),za(jd,""),a.b=null)}}
|
||||
var ed="failsafe",$c="validate",bd="timestamp",md="version",nd="url",od="browser",jd="user",dd=-1,Vc=0,cd=1,gd=2,qd=3;w(function(){for(var a=G(document,F+"-machine"),b=0;b<a.length;b++)for(var c=a[b],d=D(c),c=G(c,F,"computer"),e=0;e<c.length;e++){var f=c[e],g=D(f),g=new Sc(g,d,!0);E(g,f);g.I&&Yc(g,g.ia)}});x.show.push(function(){for(var a=G(document,F,"computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=C("Computer",c.id))&&c.O&&!c.g.C&&c.ia(dd)}});
|
||||
x.exit.push(function(){for(var a=G(document,F,"computer"),b=0;b<a.length;b++){var c=D(a[b]);(c=C("Computer",c.id))&&c.g.C&&ld(c,!(!c.a||c.s),!0)}});function P(a,b,c){this.id=a.id;this.b="";this.a={};this.h=this.m=!1;this.key=sd(a,b,c);hd(this,a.Ua)}k=P.prototype;k.set=function(a,b){try{this.a[a]=b}catch(c){}};k.get=function(a){return this.a[a]||null};k.data=function(){return this.a};function Wc(a,b){return b?(a.b=b,a.h=!0,a.m=!1,!0):a.h?!0:wa()&&(b=ya(a.key))?(a.b=b,a.h=!0):!1}
|
||||
function ad(a){var b=!0;if(!a.m)try{a.a=JSON.parse(a.b),a.m=!0}catch(c){u(c.message||c),b=!1}return b}function id(a){var b=!0;if(wa()){var c=JSON.stringify(a.a);za(a.key,c)||(u("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}k.toString=function(){return this.a?JSON.stringify(this.a):this.b};function hd(a,b){a.b="";a.a={};a.h=a.m=!1;b&&a.set("parms",b)}
|
||||
k.clear=function(a){hd(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 sd(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}var td=0;
|
||||
function ud(a,b,c,d,e,f,g){f("Loading "+a+"...");t(a,null,!0,function(h,l,p){p?(l||(l="unable to load "+a+" ("+p+")"),g(l,null)):vd(l,a,b,c,d,e,f,g)})}
|
||||
function vd(a,b,c,d,e,f,g,h){function l(a,g){if(g)h(g,null);else{c&&(Ka(c,b,a),(g=b)&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1<e.length&&(e+=",")):e='{state:"'+e+'",':e="{",e+='url:"'+g+'"}',"object"==typeof resources&&(g=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
|
||||
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(z){g=null,a=z.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?f?wd(a,g,l):l(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function wd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");t(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],p,v=/( [a-z]+=)(['"])(.*?)\2/g;p=v.exec(f);)l=0>l.indexOf(p[1])?l.replace(">",p[0]+">"):l.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[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);wd(a,b,c)}})}else c(a,null)}
|
||||
function xd(a,b,c,d,e){function f(a){if(void 0===l){var b=h&&G(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=qa(a))}function g(a){f("Error: "+a);p&&(--td||Ga(!0));p=!1}var h,l,p=!0;td++;La[b]={};try{if(h=document.getElementById(b)){var v;if("object"==typeof resources&&(v=resources.css)){var z=document.head||document.getElementsByTagName("head")[0],ra=document.createElement("style");ra.type="text/css";ra.styleSheet?ra.styleSheet.cssText=v:ra.appendChild(document.createTextNode(v));z.appendChild(ra)}d||
|
||||
(v=a,"pdp"==a.substr(0,3)&&(v="pdpjs"),d="/versions/"+v+"/1.34.2/components.xsl");v=function(e,l){l?ud(d,null,a,null,!1,f,function(a,e){e?(Ka(b,d,a),f("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=l.transformNode(e))?(h.outerHTML=e,--td||Ga(!0)):g("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--td||
|
||||
Ga(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?ud(c,b,a,e,!0,f,v):vd(c,null,b,a,e,!1,f,v)}else g("missing machine element: "+b)}catch(yd){g(yd.message)}return p}window.embedPDP10=function(a,b,c,d){Ga(!1);return xd("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){Ga(!1);return xd("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return C(b,a+".machine")};
|
||||
window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!Qa[a]){for(var c=!0,d=Qa,e=a,f=b.length,g=[],h=[],l="",p=null,v=0;v<f;v++){var z=b[v];if('"'==z||"'"==z)p&&z!=p?l+=z:(p?p=null:p=z,l&&(h.push(l),l=""));else{if(!p){if("\r"==z||"\n"==z)z=";";if(" "==z||"\t"==z||";"==z){l&&(h.push(l),l="");";"==z&&h.length&&(g.push(h),h=[]);continue}}l+=z}}l&&h.push(l);h.length&&g.push(h);d[e]=g;Pa(a)||(c=!1)}return c};window.enableEvents=Ga;window.sendEvent=Ia;})();//# sourceMappingURL=/tmp/pdpjs/1.34.2/pdp10.map
|
||||
|
|
|
|||
Loading…
Reference in a new issue