diff --git a/apps/c1p/6502/jeffpar/assembler/ASSEMBLER-4K.bin b/apps/c1p/6502/jeffpar/assembler/ASSEMBLER-4K.bin deleted file mode 100644 index 8a2ff0639..000000000 Binary files a/apps/c1p/6502/jeffpar/assembler/ASSEMBLER-4K.bin and /dev/null differ diff --git a/apps/c1p/6502/jeffpar/assembler/ASSEMBLER-8K.bin b/apps/c1p/6502/jeffpar/assembler/ASSEMBLER-8K.bin deleted file mode 100644 index 9d2cb6365..000000000 Binary files a/apps/c1p/6502/jeffpar/assembler/ASSEMBLER-8K.bin and /dev/null differ diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index 106ecf05b..fa9d87a28 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -50,9 +50,9 @@ var la={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[4 "(":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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,dn:108,hn:109,n:110,qn:111,p:112,q:113,r:114,No:115,t:116,Qo:117,Ro:118,So:119,x:120, y:121,z:122,"{":123,"|":124,"}":125,"~":126,Mp:127},ma={};ma[173]=n["-"];ma[186]=n[";"];ma[187]=n["="];ma[189]=n["-"];ma[188]=n[","];ma[190]=n["."];ma[191]=n["/"];ma[192]=n["`"];ma[219]=n["["];ma[220]=n["\\"];ma[221]=n["]"];ma[222]=n["'"];var na={};na[n["1"]]=n["!"];na[n["2"]]=n["@"];na[n["3"]]=n["#"];na[n["4"]]=n.$;na[n["5"]]=n["%"];na[n["6"]]=n["^"];na[n["7"]]=n["&"];na[n["8"]]=n["*"];na[n["9"]]=n["("];na[n["0"]]=n[")"];na[186]=n[":"];na[187]=n["+"];na[188]=n["<"];na[189]=n._;na[190]=n[">"]; na[191]=n["?"];na[192]=n["~"];na[219]=n["{"];na[220]=n["|"];na[221]=n["}"];na[222]=n['"'];na[173]=n._;na[61]=n["+"];na[59]=n[":"]; -function oa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function qa(a,b){var c,d="";b?32>=1,f--;return d} -function ra(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d}function sa(a,b,c){b?12a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e} +function qa(a,b){var c,d="";b?32>=1,f--;return d}function ra(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d}function sa(a,b,c){b?12"']/g,function(a){return Aa[a]})} function Ba(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function Ca(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var Aa={"&":"&","<":"<",">":">",'"':""","'":"'"},Da={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function Ea(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0":62,"?":63,"@":64,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Pl:109,n:110,Vl:111,p:112,q:113,r:114,pn:115,t:116,sn:117,tn:118,un:119,x:120, y:121,z:122,"{":123,"|":124,"}":125,"~":126,po:127},ma={};ma[173]=n["-"];ma[186]=n[";"];ma[187]=n["="];ma[189]=n["-"];ma[188]=n[","];ma[190]=n["."];ma[191]=n["/"];ma[192]=n["`"];ma[219]=n["["];ma[220]=n["\\"];ma[221]=n["]"];ma[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"]; p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"]; -function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} +function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(16,b)),0>a||a>=Math.pow(16,b))&&(a=null);if(null==a)for(;0=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} function pa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return ta[a]})}function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ta={"&":"&","<":"<",">":">",'"':""","'":"'"},va={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function wa(){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 xa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.qg|g<>a.shift}var za=[31,28,31,30,31,30,31,31,30,31,30,31],Aa=Date.now||function(){return+new Date}; diff --git a/modules/pdp10/lib/cpuops.js b/modules/pdp10/lib/cpuops.js index 83e442a6b..598179ce9 100644 --- a/modules/pdp10/lib/cpuops.js +++ b/modules/pdp10/lib/cpuops.js @@ -30,6 +30,7 @@ if (NODE) { var Str = require("../../shared/lib/strlib"); + var Component = require("../../shared/lib/component"); var PDP10 = require("./defines"); } @@ -240,7 +241,7 @@ PDP10.opDFN = function(op, acc) * FSC AC,233 * * inserts the correct exponent to move the binary point from the right end to the left of bit 9 and then normalizes - * (233(base 8) = 155(base 10) = 128 + 27). + * (233 [base 8] = 155 [base 10] = 128 + 27). * * @this {CPUStatePDP10} * @param {number} op @@ -277,7 +278,7 @@ PDP10.opFSC = function(op, acc) * in position P. * * NOTE: Until I can conduct real-world testing, I'm assuming when they say "100 - S", DEC really meant "64 - S", - * which is 100 (base 8), which makes much more sense, since P is limited to a range of 00-77 (base 8). + * which is 100 [base 8], which makes much more sense, since P is limited to a range of 00-77 [base 8]. * * @this {CPUStatePDP10} * @param {number} op @@ -458,7 +459,6 @@ PDP10.opDPB = function(op, acc) if (this.regBP < 0) { this.regBP = w; this.regRA = this.regEA | PDP10.OPCODE.I_BIT; - this.advancePC(-1); return; } var p = (this.regBP / PDP10.OPCODE.P_SCALE) & PDP10.OPCODE.P_MASK; @@ -961,7 +961,7 @@ PDP10.opMOVES = function(op, acc) PDP10.opMOVS = function(op, acc) { var src = this.readWord(this.regEA); - src = ((src / PDP10.HALF_SHIFT)|0) + ((src % PDP10.HALF_SHIFT) * PDP10.HALF_SHIFT); + src = ((src / PDP10.HALF_SHIFT)|0) + ((src & PDP10.HALF_MASK) * PDP10.HALF_SHIFT); this.writeWord(acc, src); }; @@ -1003,7 +1003,7 @@ PDP10.opMOVSI = function(op, acc) PDP10.opMOVSM = function(op, acc) { var src = this.readWord(acc); - src = ((src / PDP10.HALF_SHIFT)|0) + ((src % PDP10.HALF_SHIFT) * PDP10.HALF_SHIFT); + src = ((src / PDP10.HALF_SHIFT)|0) + ((src & PDP10.HALF_MASK) * PDP10.HALF_SHIFT); this.writeWord(this.regEA, src); }; @@ -1024,7 +1024,7 @@ PDP10.opMOVSM = function(op, acc) PDP10.opMOVSS = function(op, acc) { var src = this.readWord(this.regEA); - src = ((src / PDP10.HALF_SHIFT)|0) + ((src % PDP10.HALF_SHIFT) * PDP10.HALF_SHIFT); + src = ((src / PDP10.HALF_SHIFT)|0) + ((src & PDP10.HALF_MASK) * PDP10.HALF_SHIFT); this.writeWord(this.regEA, src); if (acc) this.writeWord(acc, src) }; @@ -1079,13 +1079,14 @@ PDP10.opMOVN = function(op, acc) PDP10.opMOVNI = function(op, acc) { /* - * We perform an in-line twos complement of regEA, since doNEG() 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. + * We used to perform an in-line two's complement of regEA, since doNEG() updates the flags, and the + * documentation above claimed that MOVNI 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. However, SIMH doesn't treat zero any + * differently for MOVNI, so we currently don't either. * - * TODO: Verify the "set no flags" assertion. + * TODO: Verify the "set no flags" assertion on *real* (KA10) hardware. */ - this.writeWord(acc, this.regEA? PDP10.TWO_POW36 - this.regEA : 0); + this.writeWord(acc, PDP10.doNEG.call(this, this.regEA) /* this.regEA? PDP10.TWO_POW36 - this.regEA : 0 */); }; /** @@ -1189,10 +1190,7 @@ PDP10.opMOVM = function(op, acc) */ PDP10.opMOVMI = function(op, acc) { - /* - * Since the src is an 18-bit immediate value, there's no need to call doABS(). - */ - this.writeWord(acc, this.regEA); + this.writeWord(acc, this.regEA); // src is an 18-bit immediate value, so there's no need to call doABS() }; /** @@ -1248,7 +1246,15 @@ PDP10.opMOVMS = function(op, acc) }; /** - * opIMUL(0o220000) + * opIMUL(0o220000): Integer Multiply + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-28: + * + * Multiply AC by the operand specified by M, and place the sign and the 35 low order magnitude bits of the + * product in the specified destination. Set Overflow if the product is >= 2^35 or < -2^35 (ie if the high order + * word of the double length product is not null); the high order word is lost. + * + * NOTE: This is a "Basic" mode instruction: the source is [E] and the destination is [A] (opposite of "Memory"). * * @this {CPUStatePDP10} * @param {number} op @@ -1256,11 +1262,19 @@ PDP10.opMOVMS = function(op, acc) */ PDP10.opIMUL = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.doMUL.call(this, this.readWord(acc), this.readWord(this.regEA), true)); }; /** - * opIMULI(0o221000) + * opIMULI(0o221000): Integer Multiply Immediate + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-28: + * + * Multiply AC by the operand specified by M, and place the sign and the 35 low order magnitude bits of the + * product in the specified destination. Set Overflow if the product is >= 2^35 or < -2^35 (ie if the high order + * word of the double length product is not null); the high order word is lost. + * + * NOTE: This is an "Immediate" mode instruction: the source is the word 0,E and the destination is [A]. * * @this {CPUStatePDP10} * @param {number} op @@ -1268,11 +1282,19 @@ PDP10.opIMUL = function(op, acc) */ PDP10.opIMULI = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.doMUL.call(this, this.readWord(acc), this.regEA, true)); }; /** - * opIMULM(0o222000) + * opIMULM(0o222000): Integer Multiply to Memory + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-28: + * + * Multiply AC by the operand specified by M, and place the sign and the 35 low order magnitude bits of the + * product in the specified destination. Set Overflow if the product is >= 2^35 or < -2^35 (ie if the high order + * word of the double length product is not null); the high order word is lost. + * + * NOTE: This is a "Memory" mode instruction: the source is [E] and the destination is [E] (opposite of "Basic"). * * @this {CPUStatePDP10} * @param {number} op @@ -1280,11 +1302,19 @@ PDP10.opIMULI = function(op, acc) */ PDP10.opIMULM = function(op, acc) { - this.opUndefined(op); + this.writeWord(this.regEA, PDP10.doMUL.call(this, this.readWord(acc), this.readWord(this.regEA), true)); }; /** - * opIMULB(0o223000) + * opIMULB(0o223000): Integer Multiply to Both + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-28: + * + * Multiply AC by the operand specified by M, and place the sign and the 35 low order magnitude bits of the + * product in the specified destination. Set Overflow if the product is >= 2^35 or < -2^35 (ie if the high order + * word of the double length product is not null); the high order word is lost. + * + * NOTE: This is a "Both" mode instruction: the source is [E] and the destination is [E] and [A]. * * @this {CPUStatePDP10} * @param {number} op @@ -1292,7 +1322,7 @@ PDP10.opIMULM = function(op, acc) */ PDP10.opIMULB = function(op, acc) { - this.opUndefined(op); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.doMUL.call(this, this.readWord(acc), this.readWord(this.regEA), true))); }; /** @@ -1379,7 +1409,17 @@ PDP10.opMULB = function(op, acc) }; /** - * opIDIV(0o230000) + * opIDIV(0o230000): Integer Divide + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the operand specified by M is zero, set Overflow and No Divide, and go immediately to the next instruction + * without affecting the original AC or memory operand in any way. Otherwise divide AC by the specified operand, + * calculating a quotient of 35 magnitude bits including leading zeros. Place the unrounded quotient in the + * specified destination. If M specifies AC as the destination, place the remainder, with the same sign as the + * dividend, in accumulator A+1. + * + * NOTE: This is a "Basic" mode instruction: the source is [E] and the destination is [A],[A+1] (opposite of "Memory"). * * @this {CPUStatePDP10} * @param {number} op @@ -1387,11 +1427,24 @@ PDP10.opMULB = function(op, acc) */ PDP10.opIDIV = function(op, acc) { - this.opUndefined(op); + var dst = PDP10.doDIV.call(this, this.readWord(acc), 0, this.readWord(this.regEA)); + if (dst < 0) return; + this.writeWord(acc, dst); + this.writeWord((acc + 1) & 0o17, this.regExt); }; /** - * opIDIVI(0o231000) + * opIDIVI(0o231000): Integer Divide Immediate + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the operand specified by M is zero, set Overflow and No Divide, and go immediately to the next instruction + * without affecting the original AC or memory operand in any way. Otherwise divide AC by the specified operand, + * calculating a quotient of 35 magnitude bits including leading zeros. Place the unrounded quotient in the + * specified destination. If M specifies AC as the destination, place the remainder, with the same sign as the + * dividend, in accumulator A+1. + * + * NOTE: This is an "Immediate" mode instruction: the source is the word 0,E and the destination is [A],[A+1]. * * @this {CPUStatePDP10} * @param {number} op @@ -1399,11 +1452,24 @@ PDP10.opIDIV = function(op, acc) */ PDP10.opIDIVI = function(op, acc) { - this.opUndefined(op); + var dst = PDP10.doDIV.call(this, this.readWord(acc), 0, this.regEA); + if (dst < 0) return; + this.writeWord(acc, dst); + this.writeWord((acc + 1) & 0o17, this.regExt); }; /** - * opIDIVM(0o232000) + * opIDIVM(0o232000): Integer Divide to Memory + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the operand specified by M is zero, set Overflow and No Divide, and go immediately to the next instruction + * without affecting the original AC or memory operand in any way. Otherwise divide AC by the specified operand, + * calculating a quotient of 35 magnitude bits including leading zeros. Place the unrounded quotient in the + * specified destination. If M specifies AC as the destination, place the remainder, with the same sign as the + * dividend, in accumulator A+1. + * + * NOTE: This is a "Memory" mode instruction: the source is [E] and the destination is [E] (opposite of "Basic"). * * @this {CPUStatePDP10} * @param {number} op @@ -1411,11 +1477,23 @@ PDP10.opIDIVI = function(op, acc) */ PDP10.opIDIVM = function(op, acc) { - this.opUndefined(op); + var dst = PDP10.doDIV.call(this, this.readWord(acc), 0, this.readWord(this.regEA)); + if (dst < 0) return; + this.writeWord(this.regEA, dst); }; /** - * opIDIVB(0o233000) + * opIDIVB(0o233000): Integer Divide to Both + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the operand specified by M is zero, set Overflow and No Divide, and go immediately to the next instruction + * without affecting the original AC or memory operand in any way. Otherwise divide AC by the specified operand, + * calculating a quotient of 35 magnitude bits including leading zeros. Place the unrounded quotient in the + * specified destination. If M specifies AC as the destination, place the remainder, with the same sign as the + * dividend, in accumulator A+1. + * + * NOTE: This is a "Both" mode instruction: the source is [E] and the destination is [E] and [A],[A+1]. * * @this {CPUStatePDP10} * @param {number} op @@ -1423,11 +1501,24 @@ PDP10.opIDIVM = function(op, acc) */ PDP10.opIDIVB = function(op, acc) { - this.opUndefined(op); + var dst = PDP10.doDIV.call(this, this.readWord(acc), 0, this.readWord(this.regEA)); + if (dst < 0) return; + this.writeWord(this.regEA, dst); }; /** - * opDIV(0o234000) + * opDIV(0o234000): Divide + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the magnitude of the number in AC is greater than or equal to that of the operand specified by M, + * set Overflow and No Divide, and go immediately to the next instruction without affecting the original AC + * or memory operand in any way. Otherwise divide the double length number contained in accumulators A and A+1 + * by the specified operand, calculating a quotient of 35 magnitude bits including leading zeros. Place the + * unrounded quotient in the specified destination. If M specifies AC as a destination, place the remainder, + * with the same sign as the dividend, in accumulator A+1. + * + * NOTE: This is a "Basic" mode instruction: the source is [E] and the destination is [A],[A+1] (opposite of "Memory"). * * @this {CPUStatePDP10} * @param {number} op @@ -1435,11 +1526,27 @@ PDP10.opIDIVB = function(op, acc) */ PDP10.opDIV = function(op, acc) { - this.opUndefined(op); + var ext = this.readWord(acc); + var dst = this.readWord((acc + 1) & 0o17); + dst = PDP10.doDIV.call(this, dst, ext, this.readWord(this.regEA)); + if (dst < 0) return; + this.writeWord(acc, dst); + this.writeWord((acc + 1) & 0o17, this.regExt); }; /** - * opDIVI(0o235000) + * opDIVI(0o235000): Divide Immediate + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the magnitude of the number in AC is greater than or equal to that of the operand specified by M, + * set Overflow and No Divide, and go immediately to the next instruction without affecting the original AC + * or memory operand in any way. Otherwise divide the double length number contained in accumulators A and A+1 + * by the specified operand, calculating a quotient of 35 magnitude bits including leading zeros. Place the + * unrounded quotient in the specified destination. If M specifies AC as a destination, place the remainder, + * with the same sign as the dividend, in accumulator A+1. + * + * NOTE: This is an "Immediate" mode instruction: the source is the word 0,E and the destination is [A],[A+1]. * * @this {CPUStatePDP10} * @param {number} op @@ -1447,11 +1554,27 @@ PDP10.opDIV = function(op, acc) */ PDP10.opDIVI = function(op, acc) { - this.opUndefined(op); + var ext = this.readWord(acc); + var dst = this.readWord((acc + 1) & 0o17); + dst = PDP10.doDIV.call(this, dst, ext, this.regEA); + if (dst < 0) return; + this.writeWord(acc, dst); + this.writeWord((acc + 1) & 0o17, this.regExt); }; /** - * opDIVM(0o236000) + * opDIVM(0o236000): Divide to Memory + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the magnitude of the number in AC is greater than or equal to that of the operand specified by M, + * set Overflow and No Divide, and go immediately to the next instruction without affecting the original AC + * or memory operand in any way. Otherwise divide the double length number contained in accumulators A and A+1 + * by the specified operand, calculating a quotient of 35 magnitude bits including leading zeros. Place the + * unrounded quotient in the specified destination. If M specifies AC as a destination, place the remainder, + * with the same sign as the dividend, in accumulator A+1. + * + * NOTE: This is a "Memory" mode instruction: the source is [E] and the destination is [E] (opposite of "Basic"). * * @this {CPUStatePDP10} * @param {number} op @@ -1459,11 +1582,26 @@ PDP10.opDIVI = function(op, acc) */ PDP10.opDIVM = function(op, acc) { - this.opUndefined(op); + var ext = this.readWord(acc); + var dst = this.readWord((acc + 1) & 0o17); + dst = PDP10.doDIV.call(this, dst, ext, this.readWord(this.regEA)); + if (dst < 0) return; + this.writeWord(this.regEA, dst); }; /** - * opDIVB(0o237000) + * opDIVB(0o237000): Divide to Both + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-29: + * + * If the magnitude of the number in AC is greater than or equal to that of the operand specified by M, + * set Overflow and No Divide, and go immediately to the next instruction without affecting the original AC + * or memory operand in any way. Otherwise divide the double length number contained in accumulators A and A+1 + * by the specified operand, calculating a quotient of 35 magnitude bits including leading zeros. Place the + * unrounded quotient in the specified destination. If M specifies AC as a destination, place the remainder, + * with the same sign as the dividend, in accumulator A+1. + * + * NOTE: This is a "Both" mode instruction: the source is [E] and the destination is [E] and [A],[A+1]. * * @this {CPUStatePDP10} * @param {number} op @@ -1471,7 +1609,12 @@ PDP10.opDIVM = function(op, acc) */ PDP10.opDIVB = function(op, acc) { - this.opUndefined(op); + var ext = this.readWord(acc); + var dst = this.readWord((acc + 1) & 0o17); + dst = PDP10.doDIV.call(this, dst, ext, this.readWord(this.regEA)); + if (dst < 0) return; + this.writeWord(acc, this.writeWord(this.regEA, dst)); + this.writeWord((acc + 1) & 0o17, this.regExt); }; /** @@ -1525,7 +1668,7 @@ PDP10.opASH = function(op, acc) /* * Convert the unsigned word (w) to a signed value (i), for convenience. */ - var i = w > PDP10.MAX_POS36? -(PDP10.WORD_LIMIT - w) : w; + var i = w > PDP10.INT_MASK? -(PDP10.WORD_LIMIT - w) : w; if (s > 0) { if (s >= 35) { i = (i < 0? PDP10.INT_LIMIT : 0); @@ -1547,20 +1690,20 @@ PDP10.opASH = function(op, acc) */ bits = PDP10.INT_LIMIT - Math.pow(2, 35 - s); } - if (w <= PDP10.MAX_POS36) { + if (w <= PDP10.INT_MASK) { /* * 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 bits to it could NOT - * produce a value > MAX_POS36. + * produce a value > INT_MASK. */ - if (w + bits > PDP10.MAX_POS36) this.regPS |= PDP10.PSFLAG.OVFL; + if (w + bits > PDP10.INT_MASK) this.regPS |= PDP10.PSFLAG.OVFL; } 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 bits from it could NOT - * produce a value <= MAX_POS36. + * produce a value <= INT_MASK. */ - if (w - bits <= PDP10.MAX_POS36) this.regPS |= PDP10.PSFLAG.OVFL; + if (w - bits <= PDP10.INT_MASK) this.regPS |= PDP10.PSFLAG.OVFL; } } else { if (s <= -35) { @@ -1747,20 +1890,20 @@ PDP10.opASHC = function(op, acc) */ wLeft = (wRight * Math.pow(2, s - 35)) % PDP10.INT_LIMIT; bits = PDP10.INT_LIMIT - Math.pow(2, 70 - s); - if (wLeftOrig <= PDP10.MAX_POS36) { + if (wLeftOrig <= PDP10.INT_MASK) { /* * Since wLeft was positive, overflow occurs ONLY if any of the bits we shifted out were 1s. * If all those bits in the original value were 0s, then adding bits to it could NOT produce - * a value > MAX_POS36. + * a value > INT_MASK. */ - if (wRight + bits > PDP10.MAX_POS36) this.regPS |= PDP10.PSFLAG.OVFL; + if (wRight + bits > PDP10.INT_MASK) this.regPS |= PDP10.PSFLAG.OVFL; } else { /* * Since wLeft was negative, overflow occurs ONLY if any of the bits we shifted out were 0s. * If all those bits in the original value were 1s, subtracting bits from it could NOT produce - * a value <= MAX_POS36. + * a value <= INT_MASK. */ - if (wRight - bits <= PDP10.MAX_POS36) this.regPS |= PDP10.PSFLAG.OVFL; + if (wRight - bits <= PDP10.INT_MASK) this.regPS |= PDP10.PSFLAG.OVFL; } } wRight = 0; @@ -1778,20 +1921,20 @@ PDP10.opASHC = function(op, acc) * Determine overflow and update the sign bits. */ bits = PDP10.INT_LIMIT - Math.pow(2, 35 - s); - if (wLeftOrig <= PDP10.MAX_POS36) { + if (wLeftOrig <= PDP10.INT_MASK) { /* * Since wLeft was positive, overflow occurs ONLY if any of the bits we shifted out were 1s. * If all those bits in the original value were 0s, then adding bits to it could NOT produce - * a value > MAX_POS36. + * a value > INT_MASK. */ - if (wLeftOrig + bits > PDP10.MAX_POS36) this.regPS |= PDP10.PSFLAG.OVFL; + if (wLeftOrig + bits > PDP10.INT_MASK) this.regPS |= PDP10.PSFLAG.OVFL; } else { /* * Since wLeft was negative, overflow occurs ONLY if any of the bits we shifted out were 0s. * If all those bits in the original value were 1s, subtracting bits from it could NOT produce - * a value <= MAX_POS36. + * a value <= INT_MASK. */ - if (wLeftOrig - bits <= PDP10.MAX_POS36) this.regPS |= PDP10.PSFLAG.OVFL; + if (wLeftOrig - bits <= PDP10.INT_MASK) this.regPS |= PDP10.PSFLAG.OVFL; /* * Last but not least, update the sign bits of wLeft and wRight to indicate negative values. */ @@ -1999,7 +2142,17 @@ PDP10.opBLT = function(op, acc) }; /** - * opAOBJP(0o252000) + * opAOBJP(0o252000): Add One to Both Halves of AC and Jump if Positive + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-41: + * + * Add 1000001 [base 8] to AC and place the result back in AC. If the result is greater than or equal + * to zero (ie if bit 0 is 0, and hence a negative count in the left half has reached zero or a positive + * count has not yet reached 2^17), take the next instruction from location E and continue sequential + * operation from there. + * + * The incrementing of both halves of AC simultaneously is effected by adding 1000001 [base 8]. A count + * of -2 in AC left is therefore increased to zero if 2^18 - 1 is incremented in AC right. * * @this {CPUStatePDP10} * @param {number} op @@ -2007,11 +2160,23 @@ PDP10.opBLT = function(op, acc) */ PDP10.opAOBJP = function(op, acc) { - this.opUndefined(op); + var dst = (this.readWord(acc) + 0o000001000001) % PDP10.WORD_MASK; + this.writeWord(acc, dst); + if (dst < PDP10.INT_LIMIT) this.setPC(this.regEA); }; /** - * opAOBJN(0o253000) + * opAOBJN(0o253000): Add One to Both Halves of AC and Jump if Negative + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-41: + * + * Add 1000001 [base 8] to AC and place the result back in AC. If the result is less than zero + * (ie if bit 0 is 1, and hence a negative count in the left half has not yet reached zero or a positive + * count has reached 2^17), take the next instruction from location E and continue sequential operation + * from there. + * + * The incrementing of both halves of AC simultaneously is effected by adding 1000001 [base 8]. A count + * of -2 in AC left is therefore increased to zero if 2^18 - 1 is incremented in AC right. * * @this {CPUStatePDP10} * @param {number} op @@ -2019,11 +2184,47 @@ PDP10.opAOBJP = function(op, acc) */ PDP10.opAOBJN = function(op, acc) { - this.opUndefined(op); + var dst = (this.readWord(acc) + 0o000001000001) % PDP10.WORD_MASK; + this.writeWord(acc, dst); + if (dst >= PDP10.INT_LIMIT) this.setPC(this.regEA); }; /** - * opJRST(0o254000) + * opJRST(0o254000): Jump and Restore + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-57: + * + * Perform the functions specified by F, then take the next instruction from location E and continue sequential + * operation from there. Bits 9-12 are programmed as follows. + * + * 9 Restore the channel on which the highest priority interrupt is currently being held [§ 2.13]. + * + * Unless the User In-out flag is set, this function cannot be executed in a user program. Instead + * of restoring the channel, it stores its own instruction code, F and effective address E in bits 0-8, + * 9-12 and 18-35 respectively of unrelocated location 40 (clearing bits 13-17), and then executes the + * instruction contained in location 41, which is under control of the monitor [§ 2.15]. + * + * 10 Halt the processor. When it stops, the MA lights on the console display an address one greater + * than that of the location containing the instruction that caused the halt, and PC displays the jump + * address (the location from which the next instruction will be taken if the operator causes the processor + * to resume operation without changing PC). + * + * Unless the User In-out flag is set, this function cannot be executed in a user program. Instead of + * halting the processor, it stores its own instruction code, F and effective address E in Bits 0-8, 9-12 + * and 18-35 respectively of unrelocated location 40 (clearing bits 13-17), and then executes the + * instruction contained in location 41, which is under control of the monitor [§ 2.15]. + * + * 11 Restore the flags listed above from the left half of the word in the last location referenced in the + * effective address calculation. Hence to restore flags requires that the JRST instruction use indexing + * or indirect addressing. + * + * Restoration of all but the user flags is directly according to the contents of the corresponding bits + * as given above: a flag is set by a 1 in the bit, cleared by a 0. A 1 in bit 5 sets User but a 0 has no + * effect, so the Monitor can restart a user program by restoring flags but the user cannot leave user + * mode by this method. A 0 in bit 6 clears User In-out, but a 1 sets it only if the JRST is being + * executed by the Monitor, ie if User is clear. + * + * 12 Enter user mode. The user program starts at relocated location E. * * @this {CPUStatePDP10} * @param {number} op @@ -2204,7 +2405,17 @@ PDP10.opPOPJ = function(op, acc) }; /** - * opJSR(0o264000) + * opJSR(0o264000): Jump to Subroutine + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-57: + * + * Place the current contents of the flags (as described above) in the left half of location E and the + * contents of PC in the right half (at this time PC contains an address one greater than the location of + * the JSR instruction). Take the next instruction from location E + 1 and continue sequential operation + * from there. The flags are unaffected except Byte Interrupt, which is cleared. + * + * If this instruction is executed as a result of a priority interrupt or in un-relocated 41 or 61 while + * the processor is in user mode, bit 5 of the PC word stored is 1 and the processor leaves user mode. * * @this {CPUStatePDP10} * @param {number} op @@ -2212,7 +2423,8 @@ PDP10.opPOPJ = function(op, acc) */ PDP10.opJSR = function(op, acc) { - this.opUndefined(op); + this.writeWord(this.regEA, this.getPS() + this.getPC()); + this.setPC(this.regEA + 1); }; /** @@ -2437,19 +2649,12 @@ PDP10.opSUBB = function(op, acc) }; /** - * opCAI(0o300000) + * opCAIL(0o301000): Compare AC Immediate and Skip if AC Less than E * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opCAI = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opCAIL(0o301000) + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2457,11 +2662,16 @@ PDP10.opCAI = function(op, acc) */ PDP10.opCAIL = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.regEA) < 0) this.setPC(this.regPC + 1); }; /** - * opCAIE(0o302000) + * opCAIE(0o302000): Compare AC Immediate and Skip if Equal + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2469,11 +2679,16 @@ PDP10.opCAIL = function(op, acc) */ PDP10.opCAIE = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.regEA) == 0) this.setPC(this.regPC + 1); }; /** - * opCAILE(0o303000) + * opCAILE(0o303000): Compare AC Immediate and Skip if AC Less than or Equal to E + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2481,11 +2696,16 @@ PDP10.opCAIE = function(op, acc) */ PDP10.opCAILE = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.regEA) <= 0) this.setPC(this.regPC + 1); }; /** - * opCAIA(0o304000) + * opCAIA(0o304000): Compare AC Immediate but Always Skip + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2493,11 +2713,17 @@ PDP10.opCAILE = function(op, acc) */ PDP10.opCAIA = function(op, acc) { - this.opUndefined(op); + // TODO: Determine if there's any need to actually perform the comparison. + this.setPC(this.regPC + 1); }; /** - * opCAIGE(0o305000) + * opCAIGE(0o305000): Compare AC Immediate and Skip if AC Greater than or Equal to E + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2505,11 +2731,16 @@ PDP10.opCAIA = function(op, acc) */ PDP10.opCAIGE = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.regEA) >= 0) this.setPC(this.regPC + 1); }; /** - * opCAIN(0o306000) + * opCAIN(0o306000): Compare AC Immediate and Skip if Not Equal + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2517,11 +2748,16 @@ PDP10.opCAIGE = function(op, acc) */ PDP10.opCAIN = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.regEA) != 0) this.setPC(this.regPC + 1); }; /** - * opCAIG(0o307000) + * opCAIG(0o307000): Compare AC Immediate and Skip if AC Greater than E + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-42: + * + * Compare AC with E (ie with the word 0,E) and skip the next instruction in sequence if the condition + * specified by M is satisfied. * * @this {CPUStatePDP10} * @param {number} op @@ -2529,119 +2765,143 @@ PDP10.opCAIN = function(op, acc) */ PDP10.opCAIG = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.regEA) > 0) this.setPC(this.regPC + 1); }; /** - * opCA(0o310000) + * opCAML(0o311000): Compare AC with Memory and Skip if AC Less + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCA = function(op, acc) +PDP10.opCAML = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.readWord(this.regEA)) < 0) this.setPC(this.regPC + 1); }; /** - * opCAL(0o311000) + * opCAME(0o312000): Compare AC with Memory and Skip if Equal + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCAL = function(op, acc) +PDP10.opCAME = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.readWord(this.regEA)) == 0) this.setPC(this.regPC + 1); }; /** - * opCAE(0o312000) + * opCAMLE(0o313000): Compare AC with Memory and Skip if AC Less or Equal + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCAE = function(op, acc) +PDP10.opCAMLE = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.readWord(this.regEA)) <= 0) this.setPC(this.regPC + 1); }; /** - * opCALE(0o313000) + * opCAMA(0o314000): Compare AC with Memory but Always Skip + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCALE = function(op, acc) +PDP10.opCAMA = function(op, acc) { - this.opUndefined(op); + // TODO: Determine if there's any need to actually perform the comparison. + this.setPC(this.regPC + 1); }; /** - * opCAA(0o314000) + * opCAMGE(0o315000): Compare AC with Memory and Skip if AC Greater or Equal + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCAA = function(op, acc) +PDP10.opCAMGE = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.readWord(this.regEA)) >= 0) this.setPC(this.regPC + 1); }; /** - * opCAGE(0o315000) + * opCAMN(0o316000): Compare AC with Memory and Skip if Not Equal + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCAGE = function(op, acc) +PDP10.opCAMN = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.readWord(this.regEA)) != 0) this.setPC(this.regPC + 1); }; /** - * opCAN(0o316000) + * opCAMG(0o317000): Compare AC with Memory and Skip if AC Greater + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC with the contents of location E and skip the next instruction in sequence if the condition + * specified by M is satisfied. The pair of numbers compared may be either both fixed or both normalized + * floating point. * * @this {CPUStatePDP10} * @param {number} op * @param {number} acc */ -PDP10.opCAN = function(op, acc) +PDP10.opCAMG = function(op, acc) { - this.opUndefined(op); + if (PDP10.CMP(this.readWord(acc), this.readWord(this.regEA)) > 0) this.setPC(this.regPC + 1); }; /** - * opCAG(0o317000) + * opJUMPL(0o321000): Jump if AC Less than Zero * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opCAG = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opJUMP(0o320000) + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opJUMP = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opJUMPL(0o321000) + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2649,11 +2909,16 @@ PDP10.opJUMP = function(op, acc) */ PDP10.opJUMPL = function(op, acc) { - this.opUndefined(op); + if (PDP10.SIGN(this.readWord(acc)) < 0) this.setPC(this.regEA); }; /** - * opJUMPE(0o322000) + * opJUMPE(0o322000): Jump if AC Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2661,11 +2926,16 @@ PDP10.opJUMPL = function(op, acc) */ PDP10.opJUMPE = function(op, acc) { - this.opUndefined(op); + if (PDP10.SIGN(this.readWord(acc)) == 0) this.setPC(this.regEA); }; /** - * opJUMPLE(0o323000) + * opJUMPLE(0o323000): Jump if AC Less than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2673,11 +2943,16 @@ PDP10.opJUMPE = function(op, acc) */ PDP10.opJUMPLE = function(op, acc) { - this.opUndefined(op); + if (PDP10.SIGN(this.readWord(acc)) <= 0) this.setPC(this.regEA); }; /** - * opJUMPA(0o324000) + * opJUMPA(0o324000): Jump Always + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2685,11 +2960,16 @@ PDP10.opJUMPLE = function(op, acc) */ PDP10.opJUMPA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regEA); }; /** - * opJUMPGE(0o325000) + * opJUMPGE(0o325000): Jump if AC Greater than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2697,11 +2977,16 @@ PDP10.opJUMPA = function(op, acc) */ PDP10.opJUMPGE = function(op, acc) { - this.opUndefined(op); + if (PDP10.SIGN(this.readWord(acc)) >= 0) this.setPC(this.regEA); }; /** - * opJUMPN(0o326000) + * opJUMPN(0o326000): Jump if AC Not Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2709,11 +2994,16 @@ PDP10.opJUMPGE = function(op, acc) */ PDP10.opJUMPN = function(op, acc) { - this.opUndefined(op); + if (PDP10.SIGN(this.readWord(acc)) != 0) this.setPC(this.regEA); }; /** - * opJUMPG(0o327000) + * opJUMPG(0o327000): Jump if AC Greater than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-43: + * + * Compare AC (fixed or floating) with zero, and if the condition specified by M is satisfied, + * take the next instruction from location E and continue sequential operation from there. * * @this {CPUStatePDP10} * @param {number} op @@ -2721,11 +3011,17 @@ PDP10.opJUMPN = function(op, acc) */ PDP10.opJUMPG = function(op, acc) { - this.opUndefined(op); + if (PDP10.SIGN(this.readWord(acc)) > 0) this.setPC(this.regEA); }; /** - * opSKIP(0o330000) + * opSKIP(0o330000): Do Not Skip + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2733,11 +3029,17 @@ PDP10.opJUMPG = function(op, acc) */ PDP10.opSKIP = function(op, acc) { - this.opUndefined(op); + if (acc) this.writeWord(acc, this.readWord(this.regEA)); }; /** - * opSKIPL(0o331000) + * opSKIPL(0o331000): Skip if Memory Less than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2745,11 +3047,19 @@ PDP10.opSKIP = function(op, acc) */ PDP10.opSKIPL = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(this.regEA); + if (PDP10.SIGN(dst) < 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSKIPE(0o332000) + * opSKIPE(0o332000): Skip if Memory Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2757,11 +3067,19 @@ PDP10.opSKIPL = function(op, acc) */ PDP10.opSKIPE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(this.regEA); + if (PDP10.SIGN(dst) == 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSKIPLE(0o333000) + * opSKIPLE(0o333000): Skip if Memory Less than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2769,11 +3087,19 @@ PDP10.opSKIPE = function(op, acc) */ PDP10.opSKIPLE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(this.regEA); + if (PDP10.SIGN(dst) <= 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSKIPA(0o334000) + * opSKIPA(0o334000): Skip Always + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2781,11 +3107,18 @@ PDP10.opSKIPLE = function(op, acc) */ PDP10.opSKIPA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, this.readWord(this.regEA)); }; /** - * opSKIPGE(0o335000) + * opSKIPGE(0o335000): Skip if Memory Greater than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2793,11 +3126,19 @@ PDP10.opSKIPA = function(op, acc) */ PDP10.opSKIPGE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(this.regEA); + if (PDP10.SIGN(dst) >= 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSKIPN(0o336000) + * opSKIPN(0o336000): Skip if Memory Not Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2805,11 +3146,19 @@ PDP10.opSKIPGE = function(op, acc) */ PDP10.opSKIPN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(this.regEA); + if (PDP10.SIGN(dst) != 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSKIPG(0o337000) + * opSKIPG(0o337000): Skip if Memory Greater than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Compare the contents (fixed or floating) of location E with zero, and skip the next instruction + * in sequence if the condition specified by M is satisfied. If A is nonzero also place the contents + * of location E in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2817,11 +3166,20 @@ PDP10.opSKIPN = function(op, acc) */ PDP10.opSKIPG = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(this.regEA); + if (PDP10.SIGN(dst) > 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOJ(0o340000) + * opAOJ(0o340000): Add One to AC but Do Not Jump + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2829,11 +3187,18 @@ PDP10.opSKIPG = function(op, acc) */ PDP10.opAOJ = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); }; /** - * opAOJL(0o341000) + * opAOJL(0o341000): Add One to AC and Jump if Less than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2841,11 +3206,19 @@ PDP10.opAOJ = function(op, acc) */ PDP10.opAOJL = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) < 0) this.setPC(this.regEA); }; /** - * opAOJE(0o342000) + * opAOJE(0o342000): Add One to AC and Jump if Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2853,11 +3226,19 @@ PDP10.opAOJL = function(op, acc) */ PDP10.opAOJE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) == 0) this.setPC(this.regEA); }; /** - * opAOJLE(0o343000) + * opAOJLE(0o343000): Add One to AC and Jump if Less than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2865,11 +3246,19 @@ PDP10.opAOJE = function(op, acc) */ PDP10.opAOJLE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) <= 0) this.setPC(this.regEA); }; /** - * opAOJA(0o344000) + * opAOJA(0o344000): Add One to AC and Jump Always + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2877,11 +3266,19 @@ PDP10.opAOJLE = function(op, acc) */ PDP10.opAOJA = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + this.setPC(this.regEA); }; /** - * opAOJGE(0o345000) + * opAOJGE(0o345000): Add One to AC and Jump if Greater than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2889,11 +3286,19 @@ PDP10.opAOJA = function(op, acc) */ PDP10.opAOJGE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) >= 0) this.setPC(this.regEA); }; /** - * opAOJN(0o346000) + * opAOJN(0o346000): Add One to AC and Jump if Not Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2901,11 +3306,19 @@ PDP10.opAOJGE = function(op, acc) */ PDP10.opAOJN = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) != 0) this.setPC(this.regEA); }; /** - * opAOJG(0o347000) + * opAOJG(0o347000): Add One to AC and Jump if Greater than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-44: + * + * Increment AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue + * sequential operation from there. If AC originally contained 2^35 - 1, set the Overflow and Carry 1 + * flags; if -1, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -2913,11 +3326,19 @@ PDP10.opAOJN = function(op, acc) */ PDP10.opAOJG = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doADD.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) > 0) this.setPC(this.regEA); }; /** - * opAOS(0o350000) + * opAOS(0o350000): Add One to Memory but Do Not Skip + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2925,11 +3346,19 @@ PDP10.opAOJG = function(op, acc) */ PDP10.opAOS = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSL(0o351000) + * opAOSL(0o351000): Add One to Memory and Skip if Less than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2937,11 +3366,20 @@ PDP10.opAOS = function(op, acc) */ PDP10.opAOSL = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) < 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSE(0o352000) + * opAOSE(0o352000): Add One to Memory and Skip if Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2949,11 +3387,20 @@ PDP10.opAOSL = function(op, acc) */ PDP10.opAOSE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) == 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSLE(0o353000) + * opAOSLE(0o353000): Add One to Memory and Skip if Less than to Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2961,11 +3408,20 @@ PDP10.opAOSE = function(op, acc) */ PDP10.opAOSLE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) <= 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSA(0o354000) + * opAOSA(0o354000): Add One to Memory and Skip Always + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2973,11 +3429,20 @@ PDP10.opAOSLE = function(op, acc) */ PDP10.opAOSA = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSGE(0o355000) + * opAOSGE(0o355000): Add One to Memory and Skip if Greater than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2985,11 +3450,20 @@ PDP10.opAOSA = function(op, acc) */ PDP10.opAOSGE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) >= 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSN(0o356000) + * opAOSN(0o356000): Add One to Memory and Skip if Not Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -2997,11 +3471,20 @@ PDP10.opAOSGE = function(op, acc) */ PDP10.opAOSN = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) != 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opAOSG(0o357000) + * opAOSG(0o357000): Add One to Memory and Skip if Greater than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Increment the contents of location E by one and place the result back in E. Compare the result + * with zero, and skip the next instruction in sequence if the condition specified by M is satisfied. + * If location E originally contained 2^35 - 1, set the Overflow and Carry 1 flags; if -1, set Carry 0 + * and Carry 1. If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3009,11 +3492,20 @@ PDP10.opAOSN = function(op, acc) */ PDP10.opAOSG = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doADD.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) > 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOJ(0o360000) + * opSOJ(0o360000): Subtract One from AC but Do Not Jump + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3021,11 +3513,18 @@ PDP10.opAOSG = function(op, acc) */ PDP10.opSOJ = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); }; /** - * opSOJL(0o361000) + * opSOJL(0o361000): Subtract One from AC and Jump if Less than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3033,11 +3532,19 @@ PDP10.opSOJ = function(op, acc) */ PDP10.opSOJL = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) < 0) this.setPC(this.regEA); }; /** - * opSOJE(0o362000) + * opSOJE(0o362000): Subtract One from AC and Jump if Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3045,11 +3552,19 @@ PDP10.opSOJL = function(op, acc) */ PDP10.opSOJE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) == 0) this.setPC(this.regEA); }; /** - * opSOJLE(0o363000) + * opSOJLE(0o363000): Subtract One from AC and Jump if Less than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3057,11 +3572,19 @@ PDP10.opSOJE = function(op, acc) */ PDP10.opSOJLE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) <= 0) this.setPC(this.regEA); }; /** - * opSOJA(0o364000) + * opSOJA(0o364000): Subtract One from AC and Jump Always + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3069,11 +3592,19 @@ PDP10.opSOJLE = function(op, acc) */ PDP10.opSOJA = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + this.setPC(this.regEA); }; /** - * opSOJGE(0o365000) + * opSOJGE(0o365000): Subtract One from AC and Jump if Greater than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3081,11 +3612,19 @@ PDP10.opSOJA = function(op, acc) */ PDP10.opSOJGE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) >= 0) this.setPC(this.regEA); }; /** - * opSOJN(0o366000) + * opSOJN(0o366000): Subtract One from AC and Jump if Not Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3093,11 +3632,19 @@ PDP10.opSOJGE = function(op, acc) */ PDP10.opSOJN = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) != 0) this.setPC(this.regEA); }; /** - * opSOJG(0o367000) + * opSOJG(0o367000): Subtract One from AC and Jump if Greater than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-45: + * + * Decrement AC by one and place the result back in AC. Compare the result with zero, and if the + * condition specified by M is satisfied, take the next instruction from location E and continue sequential + * operation from there. If AC originally contained - 2^35 , set the Overflow and Carry 0 flags; if any + * other nonzero number, set Carry 0 and Carry 1. * * @this {CPUStatePDP10} * @param {number} op @@ -3105,11 +3652,19 @@ PDP10.opSOJN = function(op, acc) */ PDP10.opSOJG = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(acc, PDP10.doSUB.call(this, this.readWord(acc), 1)); + if (PDP10.SIGN(dst) > 0) this.setPC(this.regEA); }; /** - * opSOS(0o370000) + * opSOS(0o370000): Subtract One from Memory but Do Not Skip + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3117,11 +3672,19 @@ PDP10.opSOJG = function(op, acc) */ PDP10.opSOS = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSL(0o371000) + * opSOSL(0o371000): Subtract One from Memory and Skip if Less than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3129,11 +3692,20 @@ PDP10.opSOS = function(op, acc) */ PDP10.opSOSL = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) < 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSE(0o372000) + * opSOSE(0o372000): Subtract One from Memory and Skip if Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3141,11 +3713,20 @@ PDP10.opSOSL = function(op, acc) */ PDP10.opSOSE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) == 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSLE(0o373000) + * opSOSLE(0o373000): Subtract One from Memory and Skip if Less than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3153,11 +3734,20 @@ PDP10.opSOSE = function(op, acc) */ PDP10.opSOSLE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) <= 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSA(0o374000) + * opSOSA(0o374000): Subtract One from Memory and Skip Always + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3165,11 +3755,20 @@ PDP10.opSOSLE = function(op, acc) */ PDP10.opSOSA = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSGE(0o375000) + * opSOSGE(0o375000): Subtract One from Memory and Skip if Greater than or Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3177,11 +3776,20 @@ PDP10.opSOSA = function(op, acc) */ PDP10.opSOSGE = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) >= 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSN(0o376000) + * opSOSN(0o376000): Subtract One from Memory and Skip if Not Equal to Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3189,11 +3797,20 @@ PDP10.opSOSGE = function(op, acc) */ PDP10.opSOSN = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) != 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** - * opSOSG(0o377000) + * opSOSG(0o377000): Subtract One from Memory and Skip if Greater than Zero + * + * From the DEC PDP-10 System Reference Manual (May 1968), p. 2-46: + * + * Decrement the contents of location E by one and place the result back in E. Compare the result with zero, + * and skip the next instruction in sequence if the condition specified by M is satisfied. If location E originally + * contained -2^35 , set the Overflow and Carry 0 flags; if any other nonzero number, set Carry 0 and Carry 1. + * If A is nonzero also place the result in AC. * * @this {CPUStatePDP10} * @param {number} op @@ -3201,7 +3818,9 @@ PDP10.opSOSN = function(op, acc) */ PDP10.opSOSG = function(op, acc) { - this.opUndefined(op); + var dst = this.writeWord(this.regEA, PDP10.doSUB.call(this, this.readWord(this.regEA), 1)); + if (PDP10.SIGN(dst) > 0) this.setPC(this.regPC + 1); + if (acc) this.writeWord(acc, dst); }; /** @@ -3266,7 +3885,7 @@ PDP10.opSETZB = function(op, acc) */ PDP10.opAND = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(acc, PDP10.AND(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3282,7 +3901,7 @@ PDP10.opAND = function(op, acc) */ PDP10.opANDI = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, this.readWord(acc), this.regEA)); + this.writeWord(acc, PDP10.AND(this.readWord(acc), this.regEA)); }; /** @@ -3298,7 +3917,7 @@ PDP10.opANDI = function(op, acc) */ PDP10.opANDM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doAND.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.AND(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3315,7 +3934,7 @@ PDP10.opANDM = function(op, acc) */ PDP10.opANDB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doAND.call(this, this.readWord(acc), this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.AND(this.readWord(acc), this.readWord(this.regEA)))); }; /** @@ -3332,7 +3951,7 @@ PDP10.opANDB = function(op, acc) */ PDP10.opANDCA = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(acc, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3349,7 +3968,7 @@ PDP10.opANDCA = function(op, acc) */ PDP10.opANDCAI = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), this.regEA)); + this.writeWord(acc, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), this.regEA)); }; /** @@ -3366,7 +3985,7 @@ PDP10.opANDCAI = function(op, acc) */ PDP10.opANDCAM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3383,7 +4002,7 @@ PDP10.opANDCAM = function(op, acc) */ PDP10.opANDCAB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA)))); }; /** @@ -3400,7 +4019,7 @@ PDP10.opANDCAB = function(op, acc) */ PDP10.opANDCM = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(acc, PDP10.AND(this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -3417,7 +4036,7 @@ PDP10.opANDCM = function(op, acc) */ PDP10.opANDCMI = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, this.readWord(acc), PDP10.WORD_MASK - this.regEA)); + this.writeWord(acc, PDP10.AND(this.readWord(acc), PDP10.WORD_MASK - this.regEA)); }; /** @@ -3434,7 +4053,7 @@ PDP10.opANDCMI = function(op, acc) */ PDP10.opANDCMM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doAND.call(this, this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.AND(this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -3451,7 +4070,7 @@ PDP10.opANDCMM = function(op, acc) */ PDP10.opANDCMB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doAND.call(this, this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.AND(this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); }; /** @@ -3468,7 +4087,7 @@ PDP10.opANDCMB = function(op, acc) */ PDP10.opXOR = function(op, acc) { - this.writeWord(acc, PDP10.doEOR.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3485,7 +4104,7 @@ PDP10.opXOR = function(op, acc) */ PDP10.opXORI = function(op, acc) { - this.writeWord(acc, PDP10.doEOR.call(this, this.readWord(acc), this.regEA)); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.regEA)); }; /** @@ -3502,7 +4121,7 @@ PDP10.opXORI = function(op, acc) */ PDP10.opXORM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doEOR.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.XOR(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3519,7 +4138,7 @@ PDP10.opXORM = function(op, acc) */ PDP10.opXORB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doEOR.call(this, this.readWord(acc), this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.readWord(this.regEA)))); }; /** @@ -3536,7 +4155,7 @@ PDP10.opXORB = function(op, acc) */ PDP10.opIOR = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3553,7 +4172,7 @@ PDP10.opIOR = function(op, acc) */ PDP10.opIORI = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, this.readWord(acc), this.regEA)); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.regEA)); }; /** @@ -3570,7 +4189,7 @@ PDP10.opIORI = function(op, acc) */ PDP10.opIORM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doIOR.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.IOR(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3587,7 +4206,7 @@ PDP10.opIORM = function(op, acc) */ PDP10.opIORB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doIOR.call(this, this.readWord(acc), this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.readWord(this.regEA)))); }; /** @@ -3604,7 +4223,7 @@ PDP10.opIORB = function(op, acc) */ PDP10.opANDCB = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(acc, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -3621,7 +4240,7 @@ PDP10.opANDCB = function(op, acc) */ PDP10.opANDCBI = function(op, acc) { - this.writeWord(acc, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.regEA)); + this.writeWord(acc, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.regEA)); }; /** @@ -3638,7 +4257,7 @@ PDP10.opANDCBI = function(op, acc) */ PDP10.opANDCBM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -3655,7 +4274,7 @@ PDP10.opANDCBM = function(op, acc) */ PDP10.opANDCBB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doAND.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.AND(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); }; /** @@ -3672,7 +4291,7 @@ PDP10.opANDCBB = function(op, acc) */ PDP10.opEQV = function(op, acc) { - this.writeWord(acc, PDP10.doEQV.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(acc, PDP10.EQV(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3689,7 +4308,7 @@ PDP10.opEQV = function(op, acc) */ PDP10.opEQVI = function(op, acc) { - this.writeWord(acc, PDP10.doEQV.call(this, this.readWord(acc), this.regEA)); + this.writeWord(acc, PDP10.EQV(this.readWord(acc), this.regEA)); }; /** @@ -3706,7 +4325,7 @@ PDP10.opEQVI = function(op, acc) */ PDP10.opEQVM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doEQV.call(this, this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.EQV(this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3723,7 +4342,7 @@ PDP10.opEQVM = function(op, acc) */ PDP10.opEQVB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doEQV.call(this, this.readWord(acc), this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.EQV(this.readWord(acc), this.readWord(this.regEA)))); }; /** @@ -3789,7 +4408,7 @@ PDP10.opSETCAB = function(op, acc) */ PDP10.opORCA = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(acc, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3806,7 +4425,7 @@ PDP10.opORCA = function(op, acc) */ PDP10.opORCAI = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), this.regEA)); + this.writeWord(acc, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), this.regEA)); }; /** @@ -3823,7 +4442,7 @@ PDP10.opORCAI = function(op, acc) */ PDP10.opORCAM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA))); }; /** @@ -3840,7 +4459,7 @@ PDP10.opORCAM = function(op, acc) */ PDP10.opORCAB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), this.readWord(this.regEA)))); }; /** @@ -3925,7 +4544,7 @@ PDP10.opSETCMB = function(op, acc) */ PDP10.opORCM = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -3942,7 +4561,7 @@ PDP10.opORCM = function(op, acc) */ PDP10.opORCMI = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, this.readWord(acc), PDP10.WORD_MASK - this.regEA)); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), PDP10.WORD_MASK - this.regEA)); }; /** @@ -3959,7 +4578,7 @@ PDP10.opORCMI = function(op, acc) */ PDP10.opORCMM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doIOR.call(this, this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.IOR(this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -3976,7 +4595,7 @@ PDP10.opORCMM = function(op, acc) */ PDP10.opORCMB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doIOR.call(this, this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.IOR(this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); }; /** @@ -3993,7 +4612,7 @@ PDP10.opORCMB = function(op, acc) */ PDP10.opORCB = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(acc, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -4010,7 +4629,7 @@ PDP10.opORCB = function(op, acc) */ PDP10.opORCBI = function(op, acc) { - this.writeWord(acc, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.regEA)); + this.writeWord(acc, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.regEA)); }; /** @@ -4027,7 +4646,7 @@ PDP10.opORCBI = function(op, acc) */ PDP10.opORCBM = function(op, acc) { - this.writeWord(this.regEA, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); + this.writeWord(this.regEA, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA))); }; /** @@ -4044,7 +4663,7 @@ PDP10.opORCBM = function(op, acc) */ PDP10.opORCBB = function(op, acc) { - this.writeWord(this.regEA, this.writeWord(acc, PDP10.doIOR.call(this, PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); + this.writeWord(this.regEA, this.writeWord(acc, PDP10.IOR(PDP10.WORD_MASK - this.readWord(acc), PDP10.WORD_MASK - this.readWord(this.regEA)))); }; /** @@ -4114,7 +4733,7 @@ PDP10.opHLL = function(op, acc) { var src = this.readWord(this.regEA); var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHR(op, dst, src) + (src - (src & PDP10.HALF_MASK))); + this.writeWord(acc, PDP10.GETHR(op, dst, src) + (src - (src & PDP10.HALF_MASK))); }; /** @@ -4137,7 +4756,7 @@ PDP10.opHLL = function(op, acc) PDP10.opHLLI = function(op, acc) { var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHR(op, dst, 0)); + this.writeWord(acc, PDP10.GETHR(op, dst, 0)); }; /** @@ -4158,7 +4777,7 @@ PDP10.opHLLM = function(op, acc) { var src = this.readWord(acc); var dst = this.readWord(this.regEA); - this.writeWord(this.regEA, PDP10.getHR(op, dst, src) + (src - (src & PDP10.HALF_MASK))); + this.writeWord(this.regEA, PDP10.GETHR(op, dst, src) + (src - (src & PDP10.HALF_MASK))); }; /** @@ -4180,7 +4799,7 @@ PDP10.opHLLM = function(op, acc) PDP10.opHLLS = function(op, acc) { var dst = this.readWord(this.regEA); - dst = PDP10.setHR(op, dst, dst); + dst = PDP10.SETHR(op, dst, dst); this.writeWord(this.regEA, dst); if (acc) this.writeWord(acc, dst); }; @@ -4204,7 +4823,7 @@ PDP10.opHRL = function(op, acc) { var src = (this.readWord(this.regEA) & PDP10.HALF_MASK) * PDP10.HALF_SHIFT; var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHR(op, dst, src) + src); + this.writeWord(acc, PDP10.GETHR(op, dst, src) + src); }; /** @@ -4226,7 +4845,7 @@ PDP10.opHRLI = function(op, acc) { var src = this.regEA * PDP10.HALF_SHIFT; var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHR(op, dst, src) + src); + this.writeWord(acc, PDP10.GETHR(op, dst, src) + src); }; /** @@ -4248,7 +4867,7 @@ PDP10.opHRLM = function(op, acc) { var src = (this.readWord(acc) & PDP10.HALF_MASK) * PDP10.HALF_SHIFT; var dst = this.readWord(this.regEA); - this.writeWord(this.regEA, PDP10.getHR(op, dst, src) + src); + this.writeWord(this.regEA, PDP10.GETHR(op, dst, src) + src); }; /** @@ -4270,7 +4889,7 @@ PDP10.opHRLS = function(op, acc) { var dst = this.readWord(this.regEA); var src = (dst & PDP10.HALF_MASK) * PDP10.HALF_SHIFT; - dst = PDP10.getHR(op, dst, src) + src; + dst = PDP10.GETHR(op, dst, src) + src; this.writeWord(this.regEA, dst); if (acc) this.writeWord(acc, dst); }; @@ -4294,7 +4913,7 @@ PDP10.opHRR = function(op, acc) { var src = this.readWord(this.regEA) & PDP10.HALF_MASK; var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHL(op, dst, src) + src); + this.writeWord(acc, PDP10.GETHL(op, dst, src) + src); }; /** @@ -4315,7 +4934,7 @@ PDP10.opHRR = function(op, acc) PDP10.opHRRI = function(op, acc) { var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHL(op, dst, this.regEA) + this.regEA); + this.writeWord(acc, PDP10.GETHL(op, dst, this.regEA) + this.regEA); }; /** @@ -4337,7 +4956,7 @@ PDP10.opHRRM = function(op, acc) { var src = this.readWord(acc) & PDP10.HALF_MASK; var dst = this.readWord(this.regEA); - this.writeWord(this.regEA, PDP10.getHL(op, dst, src) + src); + this.writeWord(this.regEA, PDP10.GETHL(op, dst, src) + src); }; /** @@ -4360,7 +4979,7 @@ PDP10.opHRRM = function(op, acc) PDP10.opHRRS = function(op, acc) { var dst = this.readWord(this.regEA); - dst = PDP10.setHL(op, dst, dst); + dst = PDP10.SETHL(op, dst, dst); this.writeWord(this.regEA, dst); if (acc) this.writeWord(acc, dst); }; @@ -4383,7 +5002,7 @@ PDP10.opHLR = function(op, acc) { var src = (this.readWord(this.regEA) / PDP10.HALF_SHIFT)|0; var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHL(op, dst, src) + src); + this.writeWord(acc, PDP10.GETHL(op, dst, src) + src); }; /** @@ -4405,7 +5024,7 @@ PDP10.opHLR = function(op, acc) PDP10.opHLRI = function(op, acc) { var dst = this.readWord(acc); - this.writeWord(acc, PDP10.getHL(op, dst, 0)); + this.writeWord(acc, PDP10.GETHL(op, dst, 0)); }; /** @@ -4426,7 +5045,7 @@ PDP10.opHLRM = function(op, acc) { var src = (this.readWord(acc) / PDP10.HALF_SHIFT)|0; var dst = this.readWord(this.regEA); - this.writeWord(this.regEA, PDP10.getHL(op, dst, src) + src); + this.writeWord(this.regEA, PDP10.GETHL(op, dst, src) + src); }; /** @@ -4447,37 +5066,13 @@ PDP10.opHLRS = function(op, acc) { var dst = this.readWord(this.regEA); var src = (dst / PDP10.HALF_SHIFT)|0; - dst = PDP10.getHL(op, dst, src) + src; + dst = PDP10.GETHL(op, dst, src) + src; this.writeWord(this.regEA, dst); if (acc) this.writeWord(acc, dst); }; /** - * opTRN(0o600000) - * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opTRN = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opTLN(0o601000) - * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opTLN = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opTRNE(0o602000) + * opTRNE(0o602000): Test Right, No Modification, and Skip if All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4485,11 +5080,11 @@ PDP10.opTLN = function(op, acc) */ PDP10.opTRNE = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), this.regEA) == 0) this.setPC(this.regPC + 1); }; /** - * opTLNE(0o603000) + * opTLNE(0o603000): Test Left, No Modification, and Skip if All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4497,11 +5092,11 @@ PDP10.opTRNE = function(op, acc) */ PDP10.opTLNE = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT) == 0) this.setPC(this.regPC + 1); }; /** - * opTRNA(0o604000) + * opTRNA(0o604000): Test Right, No Modification, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4509,11 +5104,11 @@ PDP10.opTLNE = function(op, acc) */ PDP10.opTRNA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); }; /** - * opTLNA(0o605000) + * opTLNA(0o605000): Test Left, No Modification, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4521,11 +5116,11 @@ PDP10.opTRNA = function(op, acc) */ PDP10.opTLNA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); }; /** - * opTRNN(0o606000) + * opTRNN(0o606000): Test Right, No Modification, and Skip if Not All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4533,11 +5128,11 @@ PDP10.opTLNA = function(op, acc) */ PDP10.opTRNN = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), this.regEA) != 0) this.setPC(this.regPC + 1); }; /** - * opTLNN(0o607000) + * opTLNN(0o607000): Test Left, No Modification, and Skip if Not All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4545,35 +5140,11 @@ PDP10.opTRNN = function(op, acc) */ PDP10.opTLNN = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT) != 0) this.setPC(this.regPC + 1); }; /** - * opTDN(0o610000) - * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opTDN = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opTSN(0o611000) - * - * @this {CPUStatePDP10} - * @param {number} op - * @param {number} acc - */ -PDP10.opTSN = function(op, acc) -{ - this.opUndefined(op); -}; - -/** - * opTDNE(0o612000) + * opTDNE(0o612000): Test Direct, No Modification, and Skip if All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4581,11 +5152,11 @@ PDP10.opTSN = function(op, acc) */ PDP10.opTDNE = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), this.readWord(this.regEA)) == 0) this.setPC(this.regPC + 1); }; /** - * opTSNE(0o613000) + * opTSNE(0o613000): Test Swapped, No Modification, and Skip if All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4593,11 +5164,11 @@ PDP10.opTDNE = function(op, acc) */ PDP10.opTSNE = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA))) == 0) this.setPC(this.regPC + 1); }; /** - * opTDNA(0o614000) + * opTDNA(0o614000): Test Direct, No Modification, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4605,11 +5176,11 @@ PDP10.opTSNE = function(op, acc) */ PDP10.opTDNA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); }; /** - * opTSNA(0o615000) + * opTSNA(0o615000): Test Swapped, No Modification, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4617,11 +5188,11 @@ PDP10.opTDNA = function(op, acc) */ PDP10.opTSNA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); }; /** - * opTDNN(0o616000) + * opTDNN(0o616000): Test Direct, No Modification, and Skip if Not All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4629,11 +5200,11 @@ PDP10.opTSNA = function(op, acc) */ PDP10.opTDNN = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), this.readWord(this.regEA)) != 0) this.setPC(this.regPC + 1); }; /** - * opTSNN(0o617000) + * opTSNN(0o617000): Test Swapped, No Modification, and Skip if Not All Masked Bits Equal 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4641,11 +5212,11 @@ PDP10.opTDNN = function(op, acc) */ PDP10.opTSNN = function(op, acc) { - this.opUndefined(op); + if (PDP10.AND(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA))) != 0) this.setPC(this.regPC + 1); }; /** - * opTRZ(0o620000) + * opTRZ(0o620000): Test Right, Zeros, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4653,11 +5224,11 @@ PDP10.opTSNN = function(op, acc) */ PDP10.opTRZ = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), this.regEA)); }; /** - * opTLZ(0o621000) + * opTLZ(0o621000): Test Left, Zeros, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4665,11 +5236,11 @@ PDP10.opTRZ = function(op, acc) */ PDP10.opTLZ = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTRZE(0o622000) + * opTRZE(0o622000): Test Right, Zeros, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4677,11 +5248,13 @@ PDP10.opTLZ = function(op, acc) */ PDP10.opTRZE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, this.regEA)); }; /** - * opTLZE(0o623000) + * opTLZE(0o623000): Test Left, Zeros, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4689,11 +5262,14 @@ PDP10.opTRZE = function(op, acc) */ PDP10.opTLZE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.regEA * PDP10.HALF_SHIFT; + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, src)); }; /** - * opTRZA(0o624000) + * opTRZA(0o624000): Test Right, Zeros, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4701,11 +5277,12 @@ PDP10.opTLZE = function(op, acc) */ PDP10.opTRZA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), this.regEA)); }; /** - * opTLZA(0o625000) + * opTLZA(0o625000): Test Left, Zeros, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4713,11 +5290,12 @@ PDP10.opTRZA = function(op, acc) */ PDP10.opTLZA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTRZN(0o626000) + * opTRZN(0o626000): Test Right, Zeros, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4725,11 +5303,13 @@ PDP10.opTLZA = function(op, acc) */ PDP10.opTRZN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, this.regEA)); }; /** - * opTLZN(0o627000) + * opTLZN(0o627000): Test Left, Zeros, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4737,11 +5317,14 @@ PDP10.opTRZN = function(op, acc) */ PDP10.opTLZN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.regEA * PDP10.HALF_SHIFT; + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, src)); }; /** - * opTDZ(0o630000) + * opTDZ(0o630000): Test Direct, Zeros, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4749,11 +5332,11 @@ PDP10.opTLZN = function(op, acc) */ PDP10.opTDZ = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), this.readWord(this.regEA))); }; /** - * opTSZ(0o631000) + * opTSZ(0o631000): Test Swapped, Zeros, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4761,11 +5344,11 @@ PDP10.opTDZ = function(op, acc) */ PDP10.opTSZ = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA)))); }; /** - * opTDZE(0o632000) + * opTDZE(0o632000): Test Direct, Zeros, and Skip if All Masked Bits Equaled a * * @this {CPUStatePDP10} * @param {number} op @@ -4773,11 +5356,14 @@ PDP10.opTSZ = function(op, acc) */ PDP10.opTDZE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.readWord(this.regEA); + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, src)); }; /** - * opTSZE(0o633000) + * opTSZE(0o633000): Test Swapped, Zeros, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4785,11 +5371,14 @@ PDP10.opTDZE = function(op, acc) */ PDP10.opTSZE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = PDP10.SWAP(this.readWord(this.regEA)); + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, src)); }; /** - * opTDZA(0o634000) + * opTDZA(0o634000): Test Direct, Zeros, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4797,11 +5386,12 @@ PDP10.opTSZE = function(op, acc) */ PDP10.opTDZA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), this.readWord(this.regEA))); }; /** - * opTSZA(0o635000) + * opTSZA(0o635000): Test Swapped, Zeros, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4809,11 +5399,12 @@ PDP10.opTDZA = function(op, acc) */ PDP10.opTSZA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA)))); }; /** - * opTDZN(0o636000) + * opTDZN(0o636000): Test Direct, Zeros, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4821,11 +5412,14 @@ PDP10.opTSZA = function(op, acc) */ PDP10.opTDZN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.readWord(this.regEA); + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, src)); }; /** - * opTSZN(0o637000) + * opTSZN(0o637000): Test Swapped, Zeros, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4833,11 +5427,14 @@ PDP10.opTDZN = function(op, acc) */ PDP10.opTSZN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = PDP10.SWAP(this.readWord(this.regEA)); + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.CLR(dst, src)); }; /** - * opTRC(0o640000) + * opTRC(0o640000): Test Right, Complement, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4845,11 +5442,11 @@ PDP10.opTSZN = function(op, acc) */ PDP10.opTRC = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.regEA)); }; /** - * opTLC(0o641000) + * opTLC(0o641000): Test Left, Complement, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4857,11 +5454,11 @@ PDP10.opTRC = function(op, acc) */ PDP10.opTLC = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTRCE(0o642000) + * opTRCE(0o642000): Test Right, Complement, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4869,11 +5466,13 @@ PDP10.opTLC = function(op, acc) */ PDP10.opTRCE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, this.regEA)); }; /** - * opTLCE(0o643000) + * opTLCE(0o643000): Test Left, Complement, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4881,11 +5480,14 @@ PDP10.opTRCE = function(op, acc) */ PDP10.opTLCE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.regEA * PDP10.HALF_SHIFT; + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, src)); }; /** - * opTRCA(0o644000) + * opTRCA(0o644000): Test Right, Complement, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4893,11 +5495,12 @@ PDP10.opTLCE = function(op, acc) */ PDP10.opTRCA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.regEA)); }; /** - * opTLCA(0o645000) + * opTLCA(0o645000): Test Left, Complement, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4905,11 +5508,12 @@ PDP10.opTRCA = function(op, acc) */ PDP10.opTLCA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTRCN(0o646000) + * opTRCN(0o646000): Test Right, Complement, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4917,11 +5521,13 @@ PDP10.opTLCA = function(op, acc) */ PDP10.opTRCN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, this.regEA)); }; /** - * opTLCN(0o647000) + * opTLCN(0o647000): Test Left, Complement, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4929,11 +5535,14 @@ PDP10.opTRCN = function(op, acc) */ PDP10.opTLCN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.regEA * PDP10.HALF_SHIFT; + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, src)); }; /** - * opTDC(0o650000) + * opTDC(0o650000): Test Direct, Complement, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4941,11 +5550,11 @@ PDP10.opTLCN = function(op, acc) */ PDP10.opTDC = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.readWord(this.regEA))); }; /** - * opTSC(0o651000) + * opTSC(0o651000): Test Swapped, Complement, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4953,11 +5562,11 @@ PDP10.opTDC = function(op, acc) */ PDP10.opTSC = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA)))); }; /** - * opTDCE(0o652000) + * opTDCE(0o652000): Test Direct, Complement, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4965,11 +5574,14 @@ PDP10.opTSC = function(op, acc) */ PDP10.opTDCE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.readWord(this.regEA); + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, src)); }; /** - * opTSCE(0o653000) + * opTSCE(0o653000): Test Swapped, Complement, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -4977,11 +5589,14 @@ PDP10.opTDCE = function(op, acc) */ PDP10.opTSCE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = PDP10.SWAP(this.readWord(this.regEA)); + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, src)); }; /** - * opTDCA(0o654000) + * opTDCA(0o654000): Test Direct, Complement, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -4989,11 +5604,12 @@ PDP10.opTSCE = function(op, acc) */ PDP10.opTDCA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), this.readWord(this.regEA))); }; /** - * opTSCA(0o655000) + * opTSCA(0o655000): Test Swapped, Complement, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5001,11 +5617,12 @@ PDP10.opTDCA = function(op, acc) */ PDP10.opTSCA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA)))); }; /** - * opTDCN(0o656000) + * opTDCN(0o656000): Test Direct, Complement, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5013,11 +5630,14 @@ PDP10.opTSCA = function(op, acc) */ PDP10.opTDCN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.readWord(this.regEA); + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, src)); }; /** - * opTSCN(0o657000) + * opTSCN(0o657000): Test Swapped, Complement, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5025,11 +5645,14 @@ PDP10.opTDCN = function(op, acc) */ PDP10.opTSCN = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = PDP10.SWAP(this.readWord(this.regEA)); + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.XOR(dst, src)); }; /** - * opTRO(0o660000) + * opTRO(0o660000): Test Right, Ones, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5037,11 +5660,11 @@ PDP10.opTSCN = function(op, acc) */ PDP10.opTRO = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.regEA)); }; /** - * opTLO(0o661000) + * opTLO(0o661000): Test Left, Ones, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5049,11 +5672,11 @@ PDP10.opTRO = function(op, acc) */ PDP10.opTLO = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTROE(0o662000) + * opTROE(0o662000): Test Right, Ones, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5061,11 +5684,13 @@ PDP10.opTLO = function(op, acc) */ PDP10.opTROE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, this.regEA)); }; /** - * opTLOE(0o663000) + * opTLOE(0o663000): Test Left, Ones, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5073,11 +5698,13 @@ PDP10.opTROE = function(op, acc) */ PDP10.opTLOE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA * PDP10.HALF_SHIFT) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTROA(0o664000) + * opTROA(0o664000): Test Right, Ones, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5085,11 +5712,12 @@ PDP10.opTLOE = function(op, acc) */ PDP10.opTROA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.regEA)); }; /** - * opTLOA(0o665000) + * opTLOA(0o665000): Test Left, Ones, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5097,11 +5725,12 @@ PDP10.opTROA = function(op, acc) */ PDP10.opTLOA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.regEA * PDP10.HALF_SHIFT)); }; /** - * opTRON(0o666000) + * opTRON(0o666000): Test Right, Ones, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5109,11 +5738,13 @@ PDP10.opTLOA = function(op, acc) */ PDP10.opTRON = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + if (PDP10.AND(dst, this.regEA) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, this.regEA)); }; /** - * opTLON(0o667000) + * opTLON(0o667000): Test Left, Ones, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5121,11 +5752,14 @@ PDP10.opTRON = function(op, acc) */ PDP10.opTLON = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.regEA * PDP10.HALF_SHIFT; + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, src)); }; /** - * opTDO(0o670000) + * opTDO(0o670000): Test Direct, Ones, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5133,11 +5767,11 @@ PDP10.opTLON = function(op, acc) */ PDP10.opTDO = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.readWord(this.regEA))); }; /** - * opTSO(0o671000) + * opTSO(0o671000): Test Swapped, Ones, but Do Not Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5145,11 +5779,11 @@ PDP10.opTDO = function(op, acc) */ PDP10.opTSO = function(op, acc) { - this.opUndefined(op); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA)))); }; /** - * opTDOE(0o672000) + * opTDOE(0o672000): Test Direct, Ones, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5157,11 +5791,14 @@ PDP10.opTSO = function(op, acc) */ PDP10.opTDOE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.readWord(this.regEA); + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, src)); }; /** - * opTSOE(0o673000) + * opTSOE(0o673000): Test Swapped, Ones, and Skip if All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5169,11 +5806,14 @@ PDP10.opTDOE = function(op, acc) */ PDP10.opTSOE = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = PDP10.SWAP(this.readWord(this.regEA)); + if (PDP10.AND(dst, src) == 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, src)); }; /** - * opTDOA(0o674000) + * opTDOA(0o674000): Test Direct, Ones, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5181,11 +5821,12 @@ PDP10.opTSOE = function(op, acc) */ PDP10.opTDOA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), this.readWord(this.regEA))); }; /** - * opTSOA(0o675000) + * opTSOA(0o675000): Test Swapped, Ones, but Always Skip * * @this {CPUStatePDP10} * @param {number} op @@ -5193,11 +5834,12 @@ PDP10.opTDOA = function(op, acc) */ PDP10.opTSOA = function(op, acc) { - this.opUndefined(op); + this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(this.readWord(acc), PDP10.SWAP(this.readWord(this.regEA)))); }; /** - * opTDON(0o676000) + * opTDON(0o676000): Test Direct, Ones, and Skip if Not All Masked Bits Equaled 0 * * @this {CPUStatePDP10} * @param {number} op @@ -5205,11 +5847,14 @@ PDP10.opTSOA = function(op, acc) */ PDP10.opTDON = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = this.readWord(this.regEA); + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, src)); }; /** - * opTSON(0o677000) + * opTSON(0o677000): Test Swapped, Ones, and Skip if Not All Masked Bits Equaled a * * @this {CPUStatePDP10} * @param {number} op @@ -5217,7 +5862,10 @@ PDP10.opTDON = function(op, acc) */ PDP10.opTSON = function(op, acc) { - this.opUndefined(op); + var dst = this.readWord(acc); + var src = PDP10.SWAP(this.readWord(this.regEA)); + if (PDP10.AND(dst, src) != 0) this.setPC(this.regPC + 1); + this.writeWord(acc, PDP10.IOR(dst, src)); }; /** @@ -5357,7 +6005,7 @@ PDP10.opIO = function(op) /** * opNOP(op, acc) * - * Used for all "defined" operations that, in fact, do nothing (eg, SETA and SETAI). + * Used for all "defined" operations that, in fact, do nothing (eg, SETA, SETAI, CAI, JUMP). * * @this {CPUStatePDP10} * @param {number} op @@ -5367,6 +6015,19 @@ PDP10.opNOP = function(op, acc) { }; +/** + * opNOPM(op, acc) + * + * Used for all "defined" operations that, in fact, do nothing (eg, SETMM, CAM) EXCEPT reference memory. + * + * @this {CPUStatePDP10} + * @param {number} op + * @param {number} acc + */ +PDP10.opNOPM = function(op, acc) +{ +}; + /** * opUndefined(op, acc) * @@ -5384,7 +6045,7 @@ PDP10.opUndefined = function(op, acc) /** * doABS(src) * - * Used by the MOVM* (Move Magnitude) instructions. + * Returns the absolute value (ABS) of the 36-bit operand; used by the MOVM* (Move Magnitude) instructions. * * @this {CPUStatePDP10} * @param {number} src (36-bit) @@ -5392,8 +6053,8 @@ PDP10.opUndefined = function(op, acc) */ PDP10.doABS = function(src) { - if (src > PDP10.MAX_POS36) { - if (src != PDP10.MIN_NEG36) { + if (src > PDP10.INT_MASK) { + if (src != PDP10.INT_LIMIT) { src = PDP10.TWO_POW36 - src; } else { this.regPS |= (PDP10.PSFLAG.OVFL | PDP10.PSFLAG.CARRY1); @@ -5405,7 +6066,7 @@ PDP10.doABS = function(src) /** * doADD(dst, src) * - * Used by callers to perform the addition (ADD) of two signed 36-bit operands. + * Performs the addition (ADD) of two signed 36-bit operands. * * @this {CPUStatePDP10} * @param {number} dst (36-bit value) @@ -5424,112 +6085,110 @@ PDP10.doADD = function(dst, src) }; /** - * doAND(dst, src) + * doDIV(dst, ext, src) * - * Used by callers to perform the logical "and" (AND) of two 36-bit operands. + * Performs the division (DIV) of a 72-bit operand by a 36-bit operand. * * @this {CPUStatePDP10} * @param {number} dst (36-bit value) - * @param {number} src (36-bit value) - * @return {number} (dst & src) + * @param {number} ext (36-bit value extension) + * @param {number} src (36-bit divisor) + * @return {number} (dst / src) (the remainder is stored in regExt); -1 if error (no division performed) */ -PDP10.doAND = function(dst, src) +PDP10.doDIV = function(dst, ext, src) { + var fNegQ = false, fNegR = false; + + dst = PDP10.merge72.call(this, dst, ext); + ext = this.regExt; + + if (src > PDP10.INT_MASK) { + src = PDP10.WORD_LIMIT - src; + fNegQ = !fNegQ; + } + + if (ext > PDP10.INT_MASK) { + if (dst) { + ext = PDP10.WORD_MASK - ext; + dst = PDP10.WORD_LIMIT - dst; + } + else { + if (ext) ext = PDP10.WORD_LIMIT - ext; + } + fNegR = true; fNegQ = !fNegQ; + } + + if (ext >= src) { + this.regPS |= PDP10.PSFLAG.NO_DIVIDE | PDP10.PSFLAG.OVFL; + return -1; + } + /* - * Since dst and src are 36-bit values, we must AND the low 32 bits separately from the higher bits, - * and then combine them with addition. Since all bits above 36 will be zero, and since 0 AND 0 is 0, - * no special masking for the higher bits is required. + * Initialize the four double-length 72-bit values we need for the division process. * - * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a - * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is - * positive. + * The process involves shifting the divisor left 1 bit (ie, doubling it) until it equals + * or exceeds the dividend, and then repeatedly subtracting the divisor from the dividend and + * shifting the divisor right 1 bit until the divisor is "exhausted" (no bits left), with an + * "early out" if the dividend gets "exhausted" first. + * + * Note that each element of these double arrays is a 36-bit value, so it's rarely a good idea + * to use bit-wise operators on them, because those would operate on only the low 32 bits. + * Stick with the double worker functions I've created, and trust your JavaScript engine to + * inline/optimize the code. */ - return ((((dst / PDP10.TWO_POW32)|0) & ((src / PDP10.TWO_POW32)|0)) * PDP10.TWO_POW32) + ((dst & src) >>> 0); + PDP10.INITD(this.regRes, 0, 0); + PDP10.INITD(this.regPow, 1, 0); + PDP10.INITD(this.regDiv, src, 0); + PDP10.INITD(this.regRem, dst, ext); + + while (PDP10.CMPD(this.regRem, this.regDiv) > 0) { + PDP10.ADDD(this.regDiv, this.regDiv); + PDP10.ADDD(this.regPow, this.regPow); + } + do { + if (PDP10.CMPD(this.regRem, this.regDiv) >= 0) { + PDP10.SUBD(this.regRem, this.regDiv); + PDP10.ADDD(this.regRes, this.regPow); + if (PDP10.ZEROD(this.regRem)) break; + } + PDP10.SHRD(this.regDiv); + PDP10.SHRD(this.regPow); + } while (!PDP10.ZEROD(this.regPow)); + + this.assert(!this.regRes[1], "extended quotient"); + this.assert(!this.regRem[1], "extended remainder"); + + dst = this.regRes[0]; + this.regExt = this.regRem[0]; + + if (fNegQ && dst) { + dst = PDP10.WORD_LIMIT - dst; + } + + if (fNegR && this.regExt) { + this.regExt = PDP10.WORD_LIMIT - this.regExt; + } + + return dst; }; /** - * doEOR(dst, src) + * doMUL(dst, src, fTruncate) * - * Used by callers to perform the logical "exclusive-or" (XOR) of two 36-bit operands. - * - * @this {CPUStatePDP10} - * @param {number} dst (36-bit value) - * @param {number} src (36-bit value) - * @return {number} (dst ^ src) - */ -PDP10.doEOR = function(dst, src) -{ - /* - * Since dst and src are 36-bit values, we must XOR the low 32 bits separately from the higher bits, - * and then combine them with addition. Since all bits above 36 will be zero, and since 0 XOR 0 is 0, - * no special masking for the higher bits is required. - * - * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a - * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is - * positive. - */ - return ((((dst / PDP10.TWO_POW32)|0) ^ ((src / PDP10.TWO_POW32)|0)) * PDP10.TWO_POW32) + ((dst ^ src) >>> 0); -}; - -/** - * doEQV(dst, src) - * - * Used by callers to perform the logical "equivalence" (EQV) of two 36-bit operands. - * - * @this {CPUStatePDP10} - * @param {number} dst (36-bit value) - * @param {number} src (36-bit value) - * @return {number} (~(dst ^ src)) - */ -PDP10.doEQV = function(dst, src) -{ - /* - * Since dst and src are 36-bit values, we must EQV the low 32 bits separately from the higher bits, - * and then combine them with addition. Since all bits above 36 will be zero, and since 0 EQV 0 is 1, - * we must mask the higher 4 bits with 0o17. - * - * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a - * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is - * positive. - */ - return ((~(((dst / PDP10.TWO_POW32)|0) ^ ((src / PDP10.TWO_POW32)|0)) & 0o17) * PDP10.TWO_POW32) + (~(dst ^ src) >>> 0); -}; - -/** - * doIOR(dst, src) - * - * Used by callers to perform the logical "inclusive-or" (OR) of two 36-bit operands. - * - * @this {CPUStatePDP10} - * @param {number} dst (36-bit value) - * @param {number} src (36-bit value) - * @return {number} (dst | src) - */ -PDP10.doIOR = function(dst, src) -{ - /* - * Since dst and src are 36-bit values, we must OR the low 32 bits separately from the higher bits, - * and then combine them with addition. Since all bits above 36 will be zero, and since 0 OR 0 is 0, - * no special masking for the higher bits is required. - * - * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a - * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is - * positive. - */ - return ((((dst / PDP10.TWO_POW32)|0) | ((src / PDP10.TWO_POW32)|0)) * PDP10.TWO_POW32) + ((dst | src) >>> 0); -}; - -/** - * doMUL(dst, src) - * - * Used by callers to perform the multiplication (MUL) of two signed 36-bit operands. + * Performs the multiplication (MUL) of two signed 36-bit operands. + * + * To support 72-bit results, we perform the multiplication process as you would "by hand", + * treating the operands to be multiplied as two 2-digit numbers, where each "digit" is an 18-bit + * number (base 2^18). Each individual multiplication of these 18-bit "digits" will produce + * a result within 2^36, well within JavaScript integer accuracy. * * @this {CPUStatePDP10} * @param {number} dst (36-bit value) * @param {number} src (36-bit value) + * @param {boolean} [fTruncate] (true to truncate the result to 36 bits) * @return {number} (dst * src) (the high 36 bits of the result; the low 36 bits are stored in regExt) */ -PDP10.doMUL = function(dst, src) +PDP10.doMUL = function(dst, src, fTruncate) { var n1 = dst, n2 = src; var fNeg = false, res, ext; @@ -5538,12 +6197,12 @@ PDP10.doMUL = function(dst, src) * If either input is in the negative range, record the sign and make it positive; * we'll negate the result afterward if necessary. */ - if (n1 > PDP10.MAX_POS36) { + if (n1 > PDP10.INT_MASK) { n1 = PDP10.WORD_LIMIT - n1; fNeg = !fNeg; } - if (n2 > PDP10.MAX_POS36) { + if (n2 > PDP10.INT_MASK) { n2 = PDP10.WORD_LIMIT - n2; fNeg = !fNeg; } @@ -5553,15 +6212,15 @@ PDP10.doMUL = function(dst, src) ext = 0; } else { - var n1d1 = (n1 % PDP10.HALF_SHIFT); + var n1d1 = (n1 & PDP10.HALF_MASK); var n1d2 = Math.trunc(n1 / PDP10.HALF_SHIFT); - var n2d1 = (n2 % PDP10.HALF_SHIFT); + var n2d1 = (n2 & PDP10.HALF_MASK); var n2d2 = Math.trunc(n2 / PDP10.HALF_SHIFT); var m1d1 = n1d1 * n2d1; var m1d2 = (n1d2 * n2d1) + Math.trunc(m1d1 / PDP10.HALF_SHIFT); ext = Math.trunc(m1d2 / PDP10.HALF_SHIFT); - m1d2 = (m1d2 % PDP10.HALF_SHIFT) + (n1d1 * n2d2); - res = (m1d2 * PDP10.HALF_SHIFT) + (m1d1 % PDP10.HALF_SHIFT); + m1d2 = (m1d2 & PDP10.HALF_MASK) + (n1d1 * n2d2); + res = (m1d2 * PDP10.HALF_SHIFT) + (m1d1 & PDP10.HALF_MASK); ext += Math.trunc(m1d2 / PDP10.HALF_SHIFT) + (n1d2 * n2d2); } @@ -5578,31 +6237,27 @@ PDP10.doMUL = function(dst, src) } } - /* - * We just produced a signed 72-bit result, whereas the PDP-10 stores 72-bit arithmetic values as two - * signed 36-bit results with matching signs. Since that's effectively only 70 bits of magnitude (with - * two sign bits), we lose one bit of magnitude. - * - * The conversion requires shifting ext left one bit so that we can move the high bit of res into the - * low bit of ext, and then set the sign bit of res to match the sign bit of ext. - */ - var sign = ext - (ext % PDP10.INT_LIMIT); - ext = ((ext * 2) % PDP10.WORD_LIMIT) + Math.trunc(res / PDP10.INT_LIMIT); - res = sign + (res % PDP10.INT_LIMIT); - var signNew = ext - (ext % PDP10.INT_LIMIT); - if (sign != signNew) { - ext = sign + (ext - signNew); - this.regPS |= PDP10.PSFLAG.OVFL; + if (fTruncate) { + /* + * If ext is something OTHER than an extension of the res sign bit, then we have overflow. + */ + if ((ext || res > PDP10.INT_MASK) && (ext != PDP10.WORD_MASK || res <= PDP10.INT_MASK)) { + this.regPS |= PDP10.PSFLAG.OVFL; + } + /* + * Also note that, in the truncate case, we return the low order bits (res), rather than the + * the high order bits (ext) that split72() does. + */ + return res; } - this.regExt = res; - return ext; + return PDP10.split72.call(this, res, ext); }; /** * doNEG(src) * - * Used by the MOVN* (Move Negative) instructions. + * Returns the negation (NEG) of the 36-bit operand; used by the MOVN* (Move Negative) instructions. * * @this {CPUStatePDP10} * @param {number} src (36-bit) @@ -5616,9 +6271,9 @@ PDP10.doNEG = function(src) else { /* * In the non-zero case, it's always safe to subtract src from TWO_POW36, but since we have to check for - * the MIN_NEG36 case anyway, and since subtraction in that case doesn't alter src, we skip the subtraction. + * the INT_LIMIT case anyway, and since subtraction in that case doesn't alter src, we skip the subtraction. */ - if (src == PDP10.MIN_NEG36) { + if (src == PDP10.INT_LIMIT) { this.regPS |= (PDP10.PSFLAG.OVFL | PDP10.PSFLAG.CARRY1); } else { src = PDP10.TWO_POW36 - src; @@ -5630,7 +6285,7 @@ PDP10.doNEG = function(src) /** * doSUB(dst, src) * - * Used by callers to perform the subtraction (SUB) of two signed 36-bit operands. + * Performs the subtraction (SUB) of two signed 36-bit operands. * * @this {CPUStatePDP10} * @param {number} dst (36-bit value) @@ -5653,6 +6308,65 @@ PDP10.doSUB = function(dst, src) return res; }; +/** + * merge72(dst, ext) + * + * Returns a unified 72-bit result from two independently-signed 36-bit values. + * + * @this {CPUStatePDP10} + * @param {number} dst (36-bit value) + * @param {number} ext (36-bit value) + * @return {number} (returns the lower 36 bits; the upper 36 bits are stored in regExt) + */ +PDP10.merge72 = function(dst, ext) +{ + var sign = (ext - (ext % PDP10.INT_LIMIT)); + + /* + * Let's assert that the sign bits of both halves match. + */ + Component.assert(sign == (dst - (dst % PDP10.INT_LIMIT)), "sign mismatch"); + + /* + * Compute value without the sign bit and add the low bit of extended in its place. + */ + dst = (dst % PDP10.INT_LIMIT) + ((ext * PDP10.INT_LIMIT) % PDP10.WORD_LIMIT); + this.regExt = sign + Math.trunc(ext / 2); + return dst; +}; + +/** + * split72(res, ext) + * + * Returns two 36-bit values with matching sign bits from a unified 72-bit result. + * + * @this {CPUStatePDP10} + * @param {number} res (36-bit value) + * @param {number} ext (36-bit value) + * @return {number} (returns the upper 36 bits; the lower 36 bits are stored in regExt) + */ +PDP10.split72 = function(res, ext) +{ + /* + * We just produced a signed 72-bit result, whereas the PDP-10 stores 72-bit arithmetic values as two + * signed 36-bit results with matching signs. Since that's effectively only 70 bits of magnitude (with + * two sign bits), we lose one bit of magnitude. + * + * The conversion requires shifting ext left one bit so that we can move the high bit of res into the + * low bit of ext, and then set the sign bit of res to match the sign bit of ext. + */ + var sign = ext - (ext % PDP10.INT_LIMIT); + ext = ((ext * 2) % PDP10.WORD_LIMIT) + Math.trunc(res / PDP10.INT_LIMIT); + res = sign + (res % PDP10.INT_LIMIT); + var signNew = ext - (ext % PDP10.INT_LIMIT); + if (sign != signNew) { + ext = sign + (ext - signNew); + this.regPS |= PDP10.PSFLAG.OVFL; + } + this.regExt = res; + return ext; +}; + /** * setAddFlags(dst, src, res) * @@ -5663,18 +6377,222 @@ PDP10.doSUB = function(dst, src) */ PDP10.setAddFlags = function(dst, src, res) { + /* + * Isolate the top two bits of dst, src, and res by "shifting" them into bits 0 and 1 of the following variables. + */ var dst01 = Math.trunc(dst / PDP10.TWO_POW34); var src01 = Math.trunc(src / PDP10.TWO_POW34); var res01 = Math.trunc(res / PDP10.TWO_POW34); + + /* + * Transform bits 0 and 1 into carry flags, based on the following truth table: + * + * D S R C Carry? + * - - - - ------ + * 0 0 0 0 no + * 0 0 1 0 no (there must have been a carry out of the preceding bit, but it was "absorbed") + * 0 1 0 1 yes (there must have been a carry out of the preceding bit, but it was NOT "absorbed") + * 0 1 1 0 no + * 1 0 0 1 yes (same as the preceding "yes" case) + * 1 0 1 0 no + * 1 1 0 1 yes (since the addition of two ones must always produce a carry) + * 1 1 1 1 yes (since the addition of two ones must always produce a carry) + */ var bitsCarry = (dst01 ^ ((dst01 ^ src01) & (src01 ^ res01))); var fCarry0 = bitsCarry & 0b10; var fCarry1 = bitsCarry & 0b01; + + /* + * Similarly, we transform bit 1 into an overflow flag, based on the following truth table; + * note that X is (D ^ R) and Y is (S ^ R): + * + * D S R X Y O Overflow? + * - - - - - - --------- + * 0 0 0 0 0 0 no + * 0 0 1 1 1 1 yes (adding two positive values yielded a negative value) + * 0 1 0 0 1 0 no + * 0 1 1 1 0 0 no + * 1 0 0 1 0 0 no + * 1 0 1 0 1 0 no + * 1 1 0 1 1 1 yes (adding two negative values yielded a positive value) + * 1 1 1 0 0 0 no + */ var fOverflow = ((dst01 ^ res01) & (src01 ^ res01)) & 0b10; this.regPS |= (fCarry0? PDP10.PSFLAG.CARRY0 : 0) | (fCarry1? PDP10.PSFLAG.CARRY1 : 0) | (fOverflow? PDP10.PSFLAG.OVFL : 0); }; /** - * getHL(op, dst, src) + * AND(dst, src) + * + * Performs the logical "and" (AND) of two 36-bit operands. + * + * @param {number} dst (36-bit value) + * @param {number} src (36-bit value) + * @return {number} (dst & src) + */ +PDP10.AND = function(dst, src) +{ + /* + * Since dst and src are 36-bit values, we must AND the low 32 bits separately from the higher bits, + * and then combine them with addition. Since all bits above 36 will be zero, and since 0 AND 0 is 0, + * no special masking for the higher bits is required. + * + * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a + * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is + * positive. + */ + return ((((dst / PDP10.TWO_POW32)|0) & ((src / PDP10.TWO_POW32)|0)) * PDP10.TWO_POW32) + ((dst & src) >>> 0); +}; + +/** + * CLR(dst, src) + * + * Performs the logical "and" (AND) of a 36-bit operand and its complement. + * + * @param {number} dst (36-bit value) + * @param {number} src (36-bit value) + * @return {number} (dst & ~src) + */ +PDP10.CLR = function(dst, src) +{ + return PDP10.AND(dst, PDP10.NOT(src)); +}; + +/** + * CMP(dst, src) + * + * Performs the SIGNED comparison (CMP) of two 36-bit operands. + * + * @param {number} dst (36-bit value) + * @param {number} src (36-bit value) + * @return {number} (dst - src) + */ +PDP10.CMP = function(dst, src) +{ + return (dst < PDP10.INT_LIMIT? dst : dst - PDP10.WORD_LIMIT) - (src < PDP10.INT_LIMIT? src : src - PDP10.INT_LIMIT); +}; + +/** + * EQV(dst, src) + * + * Performs the logical "equivalence" (EQV) of two 36-bit operands (ie, NOT XOR) + * + * @param {number} dst (36-bit value) + * @param {number} src (36-bit value) + * @return {number} (~(dst ^ src)) + */ +PDP10.EQV = function(dst, src) +{ + /* + * Since dst and src are 36-bit values, we must EQV the low 32 bits separately from the higher bits, + * and then combine them with addition. Since all bits above 36 will be zero, and since 0 EQV 0 is 1, + * we must mask the higher 4 bits with 0o17. + * + * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a + * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is + * positive. + */ + return ((~(((dst / PDP10.TWO_POW32)|0) ^ ((src / PDP10.TWO_POW32)|0)) & 0o17) * PDP10.TWO_POW32) + (~(dst ^ src) >>> 0); +}; + +/** + * IOR(dst, src) + * + * Performs the logical "inclusive-or" (OR) of two 36-bit operands. + * + * @param {number} dst (36-bit value) + * @param {number} src (36-bit value) + * @return {number} (dst | src) + */ +PDP10.IOR = function(dst, src) +{ + /* + * Since dst and src are 36-bit values, we must OR the low 32 bits separately from the higher bits, + * and then combine them with addition. Since all bits above 36 will be zero, and since 0 OR 0 is 0, + * no special masking for the higher bits is required. + * + * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a + * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is + * positive. + */ + return ((((dst / PDP10.TWO_POW32)|0) | ((src / PDP10.TWO_POW32)|0)) * PDP10.TWO_POW32) + ((dst | src) >>> 0); +}; + +/** + * NOT(src) + * + * Performs the one's complement (NOT) of a 36-bit operand. + * + * @param {number} src (36-bit value) + * @return {number} (~src) + */ +PDP10.NOT = function(src) +{ + /* + * Since src is a 36-bit value, we must NOT the low 32 bits separately from the higher bits, + * and then combine them with addition. Since all bits above 36 will be zero, and since ~0 is 1, + * we must mask the higher 4 bits with 0o17. + * + * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a + * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is + * positive. + */ + return ((~((src / PDP10.TWO_POW32)|0) & 0o17) * PDP10.TWO_POW32) + (~src >>> 0); +}; + +/** + * SIGN(dst) + * + * Returns the signed form of the 36-bit operand; more efficient than doCMP(dst, 0). + * + * @param {number} dst (36-bit value) + * @return {number} + */ +PDP10.SIGN = function(dst) +{ + return (dst < PDP10.INT_LIMIT? dst : dst - PDP10.WORD_LIMIT); +}; + +/** + * XOR(dst, src) + * + * Performs the logical "exclusive-or" (XOR) of two 36-bit operands. + * + * @param {number} dst (36-bit value) + * @param {number} src (36-bit value) + * @return {number} (dst ^ src) + */ +PDP10.XOR = function(dst, src) +{ + /* + * Since dst and src are 36-bit values, we must XOR the low 32 bits separately from the higher bits, + * and then combine them with addition. Since all bits above 36 will be zero, and since 0 XOR 0 is 0, + * no special masking for the higher bits is required. + * + * WARNING: When using JavaScript's 32-bit operators with values that could set bit 31 and produce a + * negative value, it's critical to perform a final right-shift of 0, ensuring that the final result is + * positive. + */ + return ((((dst / PDP10.TWO_POW32)|0) ^ ((src / PDP10.TWO_POW32)|0)) * PDP10.TWO_POW32) + ((dst ^ src) >>> 0); +}; + +/** + * SWAP(src) + * + * Used by callers to "swap" the left and right half-words of a 36-bit operand. + * + * NOTE: Since HALF_MASK is an 18-bit value, it's safe to use "&" with HALF_MASK (equivalent to "%" with HALF_SHIFT). + * + * @param {number} src + * @return {number} (updated src) + */ +PDP10.SWAP = function(src) +{ + return ((src / PDP10.HALF_SHIFT)|0) + ((src & PDP10.HALF_MASK) * PDP10.HALF_SHIFT); +}; + +/** + * GETHL(op, dst, src) * * Used by callers to obtain HL (half-word left) with HR (half-word right) zeroed. * @@ -5683,7 +6601,7 @@ PDP10.setAddFlags = function(dst, src, res) * @param {number} src (18-bit value used to determine the sign extension, if any, for the left half of dst) * @return {number} (updated dst) */ -PDP10.getHL = function(op, dst, src) +PDP10.GETHL = function(op, dst, src) { switch(op & 0o600) { case 0o000: @@ -5696,14 +6614,14 @@ PDP10.getHL = function(op, dst, src) dst = (PDP10.HALF_MASK * PDP10.HALF_SHIFT); break; case 0o600: - dst = (src > PDP10.MAX_POS18? (PDP10.HALF_MASK * PDP10.HALF_SHIFT) : 0); + dst = (src > PDP10.HINT_MASK? (PDP10.HALF_MASK * PDP10.HALF_SHIFT) : 0); break; } return dst; }; /** - * setHL(op, dst, src) + * SETHL(op, dst, src) * * Used by callers to obtain HL (half-word left) with HR (half-word right) preserved. * @@ -5712,7 +6630,7 @@ PDP10.getHL = function(op, dst, src) * @param {number} src (18-bit value used to determine the sign extension, if any, for the left half of dst) * @return {number} (updated dst) */ -PDP10.setHL = function(op, dst, src) +PDP10.SETHL = function(op, dst, src) { if (op &= 0o600) { dst &= PDP10.HALF_MASK; @@ -5721,7 +6639,7 @@ PDP10.setHL = function(op, dst, src) dst += (PDP10.HALF_MASK * PDP10.HALF_SHIFT); break; case 0o600: - dst += (src > PDP10.MAX_POS18? (PDP10.HALF_MASK * PDP10.HALF_SHIFT) : 0); + dst += (src > PDP10.HINT_MASK? (PDP10.HALF_MASK * PDP10.HALF_SHIFT) : 0); break; } } @@ -5729,7 +6647,7 @@ PDP10.setHL = function(op, dst, src) }; /** - * getHR(op, dst, src) + * GETHR(op, dst, src) * * Used by callers to obtain HR (half-word right) with HL (half-word left) zeroed. * @@ -5738,7 +6656,7 @@ PDP10.setHL = function(op, dst, src) * @param {number} src (36-bit value used to determine the sign extension, if any, for the right half of dst) * @return {number} (updated dst) */ -PDP10.getHR = function(op, dst, src) +PDP10.GETHR = function(op, dst, src) { switch(op & 0o600) { case 0o000: @@ -5751,14 +6669,14 @@ PDP10.getHR = function(op, dst, src) dst = PDP10.HALF_MASK; break; case 0o600: - dst = (src > PDP10.MAX_POS36? PDP10.HALF_MASK : 0); + dst = (src > PDP10.INT_MASK? PDP10.HALF_MASK : 0); break; } return dst; }; /** - * setHR(op, dst, src) + * SETHR(op, dst, src) * * Used by callers to obtain HR (half-word right) with HL (half-word left) preserved. * @@ -5767,7 +6685,7 @@ PDP10.getHR = function(op, dst, src) * @param {number} src (36-bit value used to determine the sign extension, if any, for the right half of dst) * @return {number} (updated dst) */ -PDP10.setHR = function(op, dst, src) +PDP10.SETHR = function(op, dst, src) { if (op &= 0o600) { dst -= (dst & PDP10.HALF_MASK); @@ -5776,13 +6694,109 @@ PDP10.setHR = function(op, dst, src) dst += PDP10.HALF_MASK; break; case 0o600: - dst += (src > PDP10.MAX_POS36? PDP10.HALF_MASK : 0); + dst += (src > PDP10.INT_MASK? PDP10.HALF_MASK : 0); break; } } return dst; }; +/** + * ADDD(dDst, dSrc) + * + * Adds a double-length value (dSrc) to another (dDst). + * + * @param {Array.} dDst + * @param {Array.} dSrc + */ +PDP10.ADDD = function(dDst, dSrc) +{ + dDst[0] += dSrc[0]; + dDst[1] += dSrc[1]; + if (dDst[0] >= PDP10.WORD_LIMIT) { + dDst[0] %= PDP10.WORD_LIMIT; + dDst[1]++; + } +}; + +/** + * CMPD(dDst, dSrc) + * + * Compares double-length values (dDst and dSrc) by computing dDst - dSrc. + * + * @param {Array.} dDst + * @param {Array.} dSrc + * @return {number} > 0 if dDst > dSrc, == 0 if dDst == dSrc, < 0 if dDst < dSrc + */ +PDP10.CMPD = function(dDst, dSrc) +{ + var result = dDst[1] - dSrc[1]; + if (!result) result = dDst[0] - dSrc[0]; + return result; +}; + +/** + * INITD(dDst, lo, hi) + * + * Initializes a double-length value (dDst). + * + * @param {Array.} dDst + * @param {number} lo + * @param {number} hi + */ +PDP10.INITD = function(dDst, lo, hi) +{ + dDst[0] = lo; + dDst[1] = hi; +}; + +/** + * SHRD(dDst) + * + * Shifts a double-length value (dDst) right one bit. + * + * @param {Array.} dDst + */ +PDP10.SHRD = function(dDst) +{ + if (dDst[1] % 2) { + dDst[0] += PDP10.WORD_LIMIT; + } + dDst[0] = Math.trunc(dDst[0] / 2); + dDst[1] = Math.trunc(dDst[1] / 2); +}; + +/** + * SUBD(dDst, dSrc) + * + * Subtracts a double-length value (dSrc) from another (dDst). + * + * @param {Array.} dDst + * @param {Array.} dSrc + */ +PDP10.SUBD = function(dDst, dSrc) +{ + dDst[0] -= dSrc[0]; + dDst[1] -= dSrc[1]; + if (dDst[0] < 0) { + dDst[0] += PDP10.WORD_LIMIT; + dDst[1]--; + } +}; + +/** + * ZEROD(d) + * + * True if all bits in the double-length value (d) are zero, false otherwise. + * + * @param {Array.} d + * @return {boolean} + */ +PDP10.ZEROD = function(d) +{ + return !d[0] && !d[1]; +}; + /* * If we want the basic half-word operations to handle all the sub-operations; ie: * @@ -5851,8 +6865,15 @@ PDP10.opSETAM = PDP10.opMOVEM; PDP10.opSETAB = PDP10.opMOVEM; PDP10.opSETM = PDP10.opMOVE; PDP10.opSETMI = PDP10.opMOVEI; -PDP10.opSETMM = PDP10.opNOP; +PDP10.opSETMM = PDP10.opNOPM; PDP10.opSETMB = PDP10.opMOVE; +PDP10.opCAI = PDP10.opNOP; +PDP10.opCAM = PDP10.opNOPM; +PDP10.opJUMP = PDP10.opNOP; +PDP10.opTRN = PDP10.opNOP; +PDP10.opTLN = PDP10.opNOP; +PDP10.opTDN = PDP10.opNOPM; +PDP10.opTSN = PDP10.opNOPM; PDP10.aOpXXX_KA10 = [ PDP10.opUUO, // 0o000xxx @@ -6055,14 +7076,14 @@ PDP10.aOpXXX_KA10 = [ PDP10.opCAIGE, // 0o305xxx PDP10.opCAIN, // 0o306xxx PDP10.opCAIG, // 0o307xxx - PDP10.opCA, // 0o310xxx - PDP10.opCAL, // 0o311xxx - PDP10.opCAE, // 0o312xxx - PDP10.opCALE, // 0o313xxx - PDP10.opCAA, // 0o314xxx - PDP10.opCAGE, // 0o315xxx - PDP10.opCAN, // 0o316xxx - PDP10.opCAG, // 0o317xxx + PDP10.opCAM, // 0o310xxx + PDP10.opCAML, // 0o311xxx + PDP10.opCAME, // 0o312xxx + PDP10.opCAMLE, // 0o313xxx + PDP10.opCAMA, // 0o314xxx + PDP10.opCAMGE, // 0o315xxx + PDP10.opCAMN, // 0o316xxx + PDP10.opCAMG, // 0o317xxx PDP10.opJUMP, // 0o320xxx PDP10.opJUMPL, // 0o321xxx PDP10.opJUMPE, // 0o322xxx diff --git a/modules/pdp10/lib/cpustate.js b/modules/pdp10/lib/cpustate.js index 1276eeafa..421b877da 100644 --- a/modules/pdp10/lib/cpustate.js +++ b/modules/pdp10/lib/cpustate.js @@ -174,12 +174,17 @@ class CPUStatePDP10 extends CPUPDP10 { */ initCPU() { - this.regEA = this.regRA = this.regOP = 0; - this.regPC = this.lastPC = this.addrReset; - this.regXC = -1; // if >= 0 this supersedes regPC (refers to an opcode from XCT) - this.regBP = -1; // active byte pointer (-1 if none) - this.regPS = 0; // assorted processor flags (see PSFLAG bit definitions) - this.regExt = 0; // internal "extension" register used for 72-bit calculations (eg, MUL) + this.regEA = this.regRA = this.regOP = 0; + this.regPC = this.lastPC = this.addrReset; + this.regXC = -1; // if >= 0 this supersedes regPC (refers to an opcode from XCT) + this.regBP = -1; // active byte pointer (-1 if none) + this.regPS = 0; // assorted processor flags (see PSFLAG bit definitions) + this.regExt = 0; // internal "extension" register used for 72-bit MUL and DIV calculations + + this.regRes = [0, 0]; // four internal "double-length" registers used for 72-bit DIV calculations + this.regPow = [0, 0]; + this.regDiv = [0, 0]; + this.regRem = [0, 0]; /* * This is queried and displayed by the Panel when it's not displaying its own ADDRESS register @@ -481,11 +486,10 @@ class CPUStatePDP10 extends CPUPDP10 { } /** - * setPC() + * setPC(addr) * - * NOTE: Unlike other PCjs emulators, such as PCx86, where all PC updates MUST go through the setPC() - * function, this function is nothing more than a convenience, because in the PDP-11, the PC can be loaded - * like any other general register. We fully expect this function to be inlined at runtime. + * Updates the PC register with the new address after masking it with ADDR_LIMIT (in case the + * new address was the result of an unchecked calculation). * * @this {CPUStatePDP10} * @param {number} addr diff --git a/modules/pdp10/lib/debugger.js b/modules/pdp10/lib/debugger.js index 149e887aa..1181a30cc 100644 --- a/modules/pdp10/lib/debugger.js +++ b/modules/pdp10/lib/debugger.js @@ -90,6 +90,7 @@ class DebuggerPDP10 extends Debugger { */ this.fInit = false; this.fParens = true; + this.nBusWidth = 18; // default value, updated by initBus() /* * Most commands that require an address call parseAddr(), and if a dbgAddr parameter is supplied @@ -315,6 +316,7 @@ class DebuggerPDP10 extends Debugger { this.cmp = cmp; this.cpu = cpu; this.panel = cmp.panel; + this.nBusWidth = bus.getWidth(); /* * Re-initialize Debugger message support if necessary @@ -527,6 +529,7 @@ class DebuggerPDP10 extends Debugger { addr = this.parseExpression(sAddr, fPrint); } if (addr != null) { + addr = this.validateWord(addr, this.nBusWidth); this.setAddr(dbgAddr, addr, fPhysical, nBase); } return dbgAddr; @@ -549,6 +552,31 @@ class DebuggerPDP10 extends Debugger { } } + /** + * validateWord(w, bits) + * + * @this {DebuggerPDP10} + * @param {number} w + * @param {number} [bits] + * @return {number} + */ + validateWord(w, bits = 36) + { + /* + * Although it's expected that most callers will supply unsigned 36-bit values, we're nice about + * converting any signed values to their unsigned (two's complement) counterpart, provided they are + * within the acceptable range. Any values outside that range will be dealt with afterward. + */ + if (w < 0 && w >= -PDP10.INT_LIMIT) { + w += PDP10.WORD_LIMIT; + } + var value = Math.trunc(Math.abs(w)) % Math.pow(2, bits); + if (DEBUG && w !== value) { + this.println("validateWord(" + Str.toOct(w) + "): out of range, truncated to " + Str.toOct(value)); + } + return value; + } + /** * incAddr(dbgAddr, inc) * @@ -2780,14 +2808,12 @@ class DebuggerPDP10 extends Debugger { var dbgAddr = this.parseAddr(sAddr, this.dbgAddrData); if (!dbgAddr) return; for (var i = 2; i < asArgs.length; i++) { - var vNew = this.parseExpression(asArgs[i]); - if (vNew === undefined) { - this.println("unknown value: " + asArgs[i]); - break; - } - this.println("changing " + this.toStrAddr(dbgAddr) + " from " + this.toStrWord(fnGet.call(this, dbgAddr)) + " to " + this.toStrWord(vNew)); + var w = this.parseExpression(asArgs[i]); + if (w === undefined) break; + w = this.validateWord(w); + this.println("changing " + this.toStrAddr(dbgAddr) + " from " + this.toStrWord(fnGet.call(this, dbgAddr)) + " to " + this.toStrWord(w)); //noinspection JSUnresolvedFunction - fnSet.call(this, dbgAddr, vNew, 1); + fnSet.call(this, dbgAddr, w, 1); } } @@ -3679,7 +3705,7 @@ class DebuggerPDP10 extends Debugger { } } } catch(e) { - this.println("debugger error: " + (e.stack || e.message)); + this.println("Debugger " + (e.stack || e.message)); result = false; } return result; @@ -3843,7 +3869,7 @@ if (DEBUGGER) { ASHC: 57, FSC: 58, FADR: 59, FSBR: 60, FMPR: 61, FDVR: 62, DFN: 63, UFA: 64, FAD: 65, FSB: 66, FMP: 67, FDV: 68, - AOBJP: 69, AOBJN: 70, CAI: 71, CA: 72, + AOBJP: 69, AOBJN: 70, CAI: 71, CAM: 72, JUMP: 73, SKIP: 74, AOJ: 75, AOS: 76, SOJ: 77, SOS: 78, TR: 79, TL: 80, TD: 81, TS: 82, XCT: 83, JFFO: 84, @@ -3877,7 +3903,7 @@ if (DEBUGGER) { "ASHC", "FSC", "FADR", "FSBR", "FMPR", "FDVR", "DFN", "UFA", "FAD", "FSB", "FMP", "FDV", - "AOBJP", "AOBJN", "CAI", "CA", + "AOBJP", "AOBJN", "CAI", "CAM", "JUMP", "SKIP", "AOJ", "AOS", "SOJ", "SOS", "TR", "TL", "TD", "TS", "XCT", "JFFO", @@ -4000,7 +4026,7 @@ if (DEBUGGER) { }, [PDP10.OPCODE.OPCOMP]: { // 0o77000 0o30000: DebuggerPDP10.OPS.CAI, - 0o31000: DebuggerPDP10.OPS.CA, + 0o31000: DebuggerPDP10.OPS.CAM, 0o32000: DebuggerPDP10.OPS.JUMP, 0o33000: DebuggerPDP10.OPS.SKIP, 0o34000: DebuggerPDP10.OPS.AOJ, diff --git a/modules/pdp10/lib/defines.js b/modules/pdp10/lib/defines.js index c8fea8487..276fb86fc 100644 --- a/modules/pdp10/lib/defines.js +++ b/modules/pdp10/lib/defines.js @@ -109,6 +109,7 @@ var PDP10 = { * values as unsigned quantities, these are the unsigned equivalents. */ WORD_INVALID: -1, + HINT_MASK: Math.pow(2, 17) - 1, // 131,071 (377777) signed half-word (half-int) mask HALF_MASK: Math.pow(2, 18) - 1, // 262,143 (000000 777777): unsigned half-word mask HALF_SHIFT: Math.pow(2, 18), // 262,144 (000001 000000): unsigned half-word shift INT_MASK: Math.pow(2, 35) - 1, // 34,359,738,367 (377777 777777): signed word (magnitude) mask @@ -116,14 +117,9 @@ var PDP10 = { WORD_MASK: Math.pow(2, 36) - 1, // 68,719,476,735 (777777 777777): unsigned word mask WORD_LIMIT: Math.pow(2, 36), // 68,719,476,736 (1 000000 000000): unsigned word limit - MAX_POS18: Math.pow(2, 17) - 1, // 131,071 (377777) - MIN_NEG18: Math.pow(2, 17), // -131,072 (400000) - MAX_POS36: Math.pow(2, 35) - 1, // 34,359,738,367 (377777 777777) - MIN_NEG36: Math.pow(2, 35), // -34,359,738,368 (400000 000000) - - TWO_POW36: Math.pow(2, 36), // the two's complement of a 36-bit value is (value? TWO_POW36 - value : 0) - TWO_POW34: Math.pow(2, 34), TWO_POW32: Math.pow(2, 32), + TWO_POW34: Math.pow(2, 34), + TWO_POW36: Math.pow(2, 36), // the two's complement of a 36-bit value is (value? TWO_POW36 - value : 0) /* * PDP-10 opcodes are 36-bit values, most of which use the following layout: diff --git a/modules/pdp10/lib/memory.js b/modules/pdp10/lib/memory.js index 583bedc10..5e7a044d7 100644 --- a/modules/pdp10/lib/memory.js +++ b/modules/pdp10/lib/memory.js @@ -217,7 +217,7 @@ class MemoryPDP10 { * converting any signed values to their unsigned (two's complement) counterpart, provided they are * within the acceptable range. Any values outside that range will be dealt with afterward. */ - if (pattern < 0 && pattern >= -PDP10.MIN_NEG36) { + if (pattern < 0 && pattern >= -PDP10.INT_LIMIT) { pattern += PDP10.WORD_LIMIT; } pattern = Math.trunc(Math.abs(pattern)) % PDP10.WORD_LIMIT; diff --git a/modules/shared/lib/int36.js b/modules/shared/lib/int36.js index d3d625f76..b87c41c03 100644 --- a/modules/shared/lib/int36.js +++ b/modules/shared/lib/int36.js @@ -123,7 +123,7 @@ * @unrestricted * * The 'value' property stores the 36-bit value as an unsigned integer. When the value should be - * interpreted as a signed quantity, subtract BIT36 whenever value > MAX_POS36. + * interpreted as a signed quantity, subtract BIT36 whenever value > INT_MASK. * * The 'extended' property stores an additional 36 bits of data from a multiplication, and can also * provide an additional 36 bits of data to a division. Internally, it should be null whenever the @@ -153,7 +153,7 @@ class Int36 { * 0 <= i <= Math.pow(2, 36) - 1 * * The lower bound is ZERO and the upper bound is Int36.WORD_MASK. Whenever an Int36 value should be - * interpreted as a signed value, values above Int36.MAX_POS36 (ie, values with bit 35 set) should be + * interpreted as a signed value, values above Int36.INT_MASK (ie, values with bit 35 set) should be * converted to their signed counterpart by subtracting the value from Int36.WORD_LIMIT (aka WORD_MASK + 1); * the easiest way to do that is call isNeg() to check the sign bit and then call negate() as * appropriate. @@ -330,12 +330,12 @@ class Int36 { /** * truncate(result, operand, fSub) * - * The range of valid results (0 - WORD_MASK) is divided into two equal sub-ranges: 0 to MAX_POS36, - * where the sign bit is zero (the bottom range), and MAX_POS36+1 to WORD_MASK (the top range), where + * The range of valid results (0 - WORD_MASK) is divided into two equal sub-ranges: 0 to INT_MASK, + * where the sign bit is zero (the bottom range), and INT_MASK+1 to WORD_MASK (the top range), where * the sign bit is one. During a single arithmetic operation, the result can "wrap around" from * the bottom range to the top, or from the top range to the bottom, but it's an overflow/underflow * error ONLY if the result "wraps across" the midpoint between the two ranges, producing an - * unnaturally small delta (<= MAX_POS36). + * unnaturally small delta (<= INT_MASK). * * This can be confirmed independently by examining the sign bits (BIT35) of the original value * (V), the operand (O), the result (R), as well as two intermediate calculations, VR = (V ^ R) @@ -413,9 +413,9 @@ class Int36 { var v = this.value / Int36.INT_LIMIT, r = result / Int36.INT_LIMIT, o = operand / Int36.INT_LIMIT; e = ((v ^ r) & (o ^ (fSub? v : r))) & 1; } - if ((result > Int36.MAX_POS36) != (this.value > Int36.MAX_POS36)) { + if ((result > Int36.INT_MASK) != (this.value > Int36.INT_MASK)) { var delta = result - this.value; - if (Math.abs(delta) <= Int36.MAX_POS36) { + if (Math.abs(delta) <= Int36.INT_MASK) { this.error |= (delta > 0? Int36.ERROR.OVERFLOW : Int36.ERROR.UNDERFLOW); if (DEBUG && (delta > 0) != !(e & v)) e = 0; } @@ -514,12 +514,12 @@ class Int36 { this.error = Int36.ERROR.NONE; - if (n1 > Int36.MAX_POS36) { + if (n1 > Int36.INT_MASK) { n1 = Int36.WORD_LIMIT - n1; fNeg = !fNeg; } - if (n2 > Int36.MAX_POS36) { + if (n2 > Int36.INT_MASK) { n2 = Int36.WORD_LIMIT - n2; fNeg = !fNeg; } @@ -599,7 +599,7 @@ class Int36 { var fNegQ = false, fNegR = false; - if (divisor > Int36.MAX_POS36) { + if (divisor > Int36.INT_MASK) { divisor = Int36.WORD_LIMIT - divisor; fNegQ = !fNegQ; } @@ -704,11 +704,11 @@ class Int36 { /* * Convert the unsigned word (w) to a signed value (i), for convenience. */ - var i = w > Int36.MAX_POS36? -(Int36.WORD_LIMIT - w) : w; + var i = w > Int36.INT_MASK? -(Int36.WORD_LIMIT - w) : w; if (s > 0) { if (s >= 35) { i = (i < 0? Int36.INT_LIMIT : 0); - bitsShifted = Int36.MAX_POS36; + bitsShifted = Int36.INT_MASK; } else { i = (i * Math.pow(2, s)) % Int36.INT_LIMIT; /* @@ -726,20 +726,20 @@ class Int36 { */ bitsShifted = Int36.INT_LIMIT - Math.pow(2, 35 - s); } - if (w <= Int36.MAX_POS36) { + if (w <= Int36.INT_MASK) { /* * 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. + * produce a value > INT_MASK. */ - if (w + bitsShifted > Int36.MAX_POS36) this.error |= Int36.ERROR.OVERFLOW; + if (w + bitsShifted > Int36.INT_MASK) this.error |= Int36.ERROR.OVERFLOW; } 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. + * produce a value <= INT_MASK. */ - if (w - bitsShifted <= Int36.MAX_POS36) this.error |= Int36.ERROR.OVERFLOW; + if (w - bitsShifted <= Int36.INT_MASK) this.error |= Int36.ERROR.OVERFLOW; } } else { if (s <= -35) { @@ -793,20 +793,20 @@ class Int36 { */ wLeft = (wRight * Math.pow(2, s - 35)) % Int36.INT_LIMIT; bits = Int36.INT_LIMIT - Math.pow(2, 70 - s); - if (wLeftOrig <= Int36.MAX_POS36) { + if (wLeftOrig <= Int36.INT_MASK) { /* * Since wLeft was positive, overflow occurs ONLY if any of the bits we shifted out were 1s. * If all those bits in the original value were 0s, then adding bits to it could NOT produce - * a value > MAX_POS36. + * a value > INT_MASK. */ - if (wRight + bits > Int36.MAX_POS36) this.error |= Int36.ERROR.OVERFLOW; + if (wRight + bits > Int36.INT_MASK) this.error |= Int36.ERROR.OVERFLOW; } else { /* * Since wLeft was negative, overflow occurs ONLY if any of the bits we shifted out were 0s. * If all those bits in the original value were 1s, subtracting bits from it could NOT produce - * a value <= MAX_POS36. + * a value <= INT_MASK. */ - if (wRight - bits <= Int36.MAX_POS36) this.error |= Int36.ERROR.OVERFLOW; + if (wRight - bits <= Int36.INT_MASK) this.error |= Int36.ERROR.OVERFLOW; } } wRight = 0; @@ -824,20 +824,20 @@ class Int36 { * Determine overflow and update the sign bits. */ bits = Int36.INT_LIMIT - Math.pow(2, 35 - s); - if (wLeftOrig <= Int36.MAX_POS36) { + if (wLeftOrig <= Int36.INT_MASK) { /* * Since wLeft was positive, overflow occurs ONLY if any of the bits we shifted out were 1s. * If all those bits in the original value were 0s, then adding bits to it could NOT produce - * a value > MAX_POS36. + * a value > INT_MASK. */ - if (wLeftOrig + bits > Int36.MAX_POS36) this.error |= Int36.ERROR.OVERFLOW; + if (wLeftOrig + bits > Int36.INT_MASK) this.error |= Int36.ERROR.OVERFLOW; } else { /* * Since wLeft was negative, overflow occurs ONLY if any of the bits we shifted out were 0s. * If all those bits in the original value were 1s, subtracting bits from it could NOT produce - * a value <= MAX_POS36. + * a value <= INT_MASK. */ - if (wLeftOrig - bits <= Int36.MAX_POS36) this.error |= Int36.ERROR.OVERFLOW; + if (wLeftOrig - bits <= Int36.INT_MASK) this.error |= Int36.ERROR.OVERFLOW; /* * Last but not least, update the sign bits of wLeft and wRight to indicate negative values. */ @@ -1058,7 +1058,7 @@ class Int36 { extend() { if (this.extended == null) { - this.extended = (this.value > Int36.MAX_POS36? Int36.WORD_MASK : 0); + this.extended = (this.value > Int36.INT_MASK? Int36.WORD_MASK : 0); } } @@ -1071,7 +1071,7 @@ class Int36 { */ reduce() { - if (this.extended == 0 && this.value <= Int36.MAX_POS36 || this.extended == Int36.WORD_MASK && this.value > Int36.MAX_POS36) { + if (this.extended == 0 && this.value <= Int36.INT_MASK || this.extended == Int36.WORD_MASK && this.value > Int36.INT_MASK) { this.extended = null; this.magnitude = 35; } @@ -1085,18 +1085,18 @@ class Int36 { */ isNeg() { - return (this.extended > Int36.MAX_POS36 || this.extended == null && this.value > Int36.MAX_POS36); + return (this.extended > Int36.INT_MASK || this.extended == null && this.value > Int36.INT_MASK); } /** * negate() * * negate() MUST automatically extend the value, because the two's complement of the most negative - * number (MIN_NEG36) still has its sign bit set, so we must rely on the sign of the extended value to + * number (INT_LIMIT) still has its sign bit set, so we must rely on the sign of the extended value to * compensate. * * This is handled below by setting extended first, based on the opposite of the value's current sign; - * we could negate extended AFTER negating value, but then we'd need a special test for the MIN_NEG36 value. + * we could negate extended AFTER negating value, but then we'd need a special test for the INT_LIMIT value. * * A side-effect of this call is that the magnitude is forced to 71, on the presumption that we're about * to perform an arithmetic operation that is more easily performed on a unified 71-bit value than two @@ -1111,7 +1111,7 @@ class Int36 { * Set extended to the OPPOSITE of the current value. */ this.assert(this.magnitude == 35); - this.extended = (this.value > Int36.MAX_POS36? 0 : Int36.WORD_MASK); + this.extended = (this.value > Int36.INT_MASK? 0 : Int36.WORD_MASK); this.magnitude = 71; } else { @@ -1352,12 +1352,12 @@ class Int36 { * converting any signed values to their unsigned (two's complement) counterpart, provided they are * within the acceptable range. Any values outside that range will be dealt with afterward. */ - if (num < 0 && num >= -Int36.MIN_NEG36) { + if (num < 0 && num >= -Int36.INT_LIMIT) { num += Int36.WORD_LIMIT; } var value = Math.trunc(Math.abs(num)) % Math.pow(2, bits); if (DEBUG && num !== value) { - console.log("Int36.validate(" + Int36.octal(num) + " out of range, truncated to " + Int36.octal(value) + ")"); + console.log("Int36.validate(" + Int36.octal(num) + "): out of range, truncated to " + Int36.octal(value)); } return value; } @@ -1370,16 +1370,13 @@ Int36.ERROR = { DIVZERO: 0x4 }; +Int36.HINT_MASK = Math.pow(2, 17) - 1; // 131,071 (377777): signed half-word (half-int) mask +Int36.HINT_LIMIT = Math.pow(2, 17); // 131,072 (400000): signed half-word (half-int) limit Int36.HALF_MASK = Math.pow(2, 18) - 1; // 262,143 (000000 777777): unsigned half-word mask Int36.HALF_SHIFT = Math.pow(2, 18); // 262,144 (000001 000000): unsigned half-word shift Int36.INT_MASK = Math.pow(2, 35) - 1; // 34,359,738,367 (377777 777777): signed word (magnitude) mask Int36.INT_LIMIT = Math.pow(2, 35); // 34,359,738,368 (400000 000000): signed word (magnitude) limit -Int36.WORD_MASK = Math.pow(2, 36) - 1; // 68,719,476,735 +Int36.WORD_MASK = Math.pow(2, 36) - 1; // 68,719,476,735 (777777 777777): unsigned word mask Int36.WORD_LIMIT = Math.pow(2, 36); // 68,719,476,736 (1 000000 000000): unsigned word limit -Int36.MAX_POS18 = Math.pow(2, 17) - 1; // 131,071 (377777) -Int36.MIN_NEG18 = Math.pow(2, 17); // -131,072 (400000) -Int36.MAX_POS36 = Math.pow(2, 35) - 1; // 34,359,738,367 (377777 777777) -Int36.MIN_NEG36 = Math.pow(2, 35); // -34,359,738,368 (400000 000000) - if (NODE) module.exports = Int36; diff --git a/modules/shared/lib/strlib.js b/modules/shared/lib/strlib.js index e435808e2..d20da5a6f 100644 --- a/modules/shared/lib/strlib.js +++ b/modules/shared/lib/strlib.js @@ -44,10 +44,10 @@ class Str { */ static isValidInt(s, base) { - if (!base || base == 10) return s.match(/^[0-9]+$/) !== null; - if (base == 16) return s.match(/^[0-9a-f]+$/i) !== null; - if (base == 8) return s.match(/^[0-7]+$/) !== null; - if (base == 2) return s.match(/^[01]+$/) !== null; + if (!base || base == 10) return s.match(/^-?[0-9]+$/) !== null; + if (base == 16) return s.match(/^-?[0-9a-f]+$/i) !== null; + if (base == 8) return s.match(/^-?[0-7]+$/) !== null; + if (base == 2) return s.match(/^-?[01]+$/) !== null; return false; } @@ -165,9 +165,9 @@ class Str { * values displayed differently. */ var s = ""; - if (n == null || isNaN(n)) { - while (cch-- > 0) s = '?' + s; - } else { + if (isNaN(n)) { + n = null; + } else if (n != null) { /* * Callers that produced an input by dividing by a power of two rather than shifting (in order * to access more than 32 bits) may produce a fractional result, which ordinarily we would simply @@ -175,6 +175,20 @@ class Str { * this value as a sign-extension. */ if (n < 0 && n > -1) n = -1; + /* + * Negative values should be two's complemented according to the number of digits; for example, + * 12 octal digits implies an upper limit 8^12. + */ + if (n < 0) { + n += Math.pow(radix, cch); + } + if (n < 0 || n >= Math.pow(radix, cch)) { + n = null; + } + } + if (n == null) { + while (cch-- > 0) s = '?' + s; + } else { while (cch-- > 0) { var d = n % radix; d += (d >= 0 && d <= 9? 0x30 : 0x41 - 10); @@ -266,7 +280,7 @@ class Str { if (cch) { if (cch > 12) cch = 12; } else { - cch = (n & ~0xffffff)? 11 : ((n & ~0xffff)? 8 : 6); + cch = (n & ~0xffffff)? 12 : ((n & ~0xffff)? 8 : 6); } return Str.toBase(n, 8, cch, fPrefix? "0o" : ""); } diff --git a/versions/c1pjs/1.34.2/c1p-dbg.js b/versions/c1pjs/1.34.2/c1p-dbg.js index a2abc2b27..3cab6b316 100644 --- a/versions/c1pjs/1.34.2/c1p-dbg.js +++ b/versions/c1pjs/1.34.2/c1p-dbg.js @@ -21,8 +21,9 @@ */ var f;function p(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]} for(var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},q="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this,ba=["Math","trunc"],ca=0;caa?-b:b};ga!=fa&&null!=ga&&aa(q,ea,{configurable:!0,writable:!0,value:ga});function t(a,b,c){b?9a&&-1=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} -function u(a){return t(a,2,!0)}function v(a){return t(a,4,!0)}function ha(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return ka[a]})}var ka={"&":"&","<":"<",">":">",'"':""","'":"'"},la=Date.now||function(){return+new Date}; +var ea=ba[ba.length-1],fa=q[ea],ga=fa?fa: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};ga!=fa&&null!=ga&&aa(q,ea,{configurable:!0,writable:!0,value:ga}); +function t(a,b,c){b?9a&&-1a&&(a+=Math.pow(16,b)),0>a||a>=Math.pow(16,b))&&(a=null);if(null==a)for(;0=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d}function u(a){return t(a,2,!0)}function v(a){return t(a,4,!0)} +function ha(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return ka[a]})}var ka={"&":"&","<":"<",">":">",'"':""","'":"'"},la=Date.now||function(){return+new Date}; function w(a,b){var c=!0,c=void 0===c?!1:c,d=0,e=null;if("object"==typeof resources&&(e=resources[a]))b&&b(a,e,d);else if(c&&"function"==typeof resources)resources(a,function(c,d){b&&b(a,c,d)});else{var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(g.onreadystatechange=function(){4===g.readyState&&(e=g.responseText,200==g.status||!g.status&&e.length&&"file:"==(window?window.location.protocol:"file:")||(d=g.status||-1),b&&b(a,e,d))});g.open("GET", a,c);g.send();c||(e=g.responseText,200!=g.status&&(d=g.status||-1),b&&b(a,e,d))}}function x(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 ma(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0a?-b:b};fa!=ea&&null!=fa&&aa(r,da,{configurable:!0,writable:!0,value:fa});function u(a,b,c){b?9a&&-1=f?48:55),d=String.fromCharCode(f)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} -function ga(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return ja[a]})}var ja={"&":"&","<":"<",">":">",'"':""","'":"'"},ka=Date.now||function(){return+new Date}; +var da=t[t.length-1],ea=r[da],fa=ea?ea: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};fa!=ea&&null!=fa&&aa(r,da,{configurable:!0,writable:!0,value:fa}); +function u(a,b,c){b?9a&&-1a&&(a+=Math.pow(16,b)),0>a||a>=Math.pow(16,b))&&(a=null);if(null==a)for(;0=f?48:55),d=String.fromCharCode(f)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d}function ga(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return ja[a]})}var ja={"&":"&","<":"<",">":">",'"':""","'":"'"},ka=Date.now||function(){return+new Date}; function v(a,b){var c=!0,c=void 0===c?!1:c,d=0,f=null;if("object"==typeof resources&&(f=resources[a]))b&&b(a,f,d);else if(c&&"function"==typeof resources)resources(a,function(c,d){b&&b(a,c,d)});else{var g=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(g.onreadystatechange=function(){4===g.readyState&&(f=g.responseText,200==g.status||!g.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(d=g.status||-1),b&&b(a,f,d))});g.open("GET", a,c);g.send();c||(f=g.responseText,200!=g.status&&(d=g.status||-1),b&&b(a,f,d))}}function w(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 la(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function x(a){y.init.push(a)} function z(a){if(A)try{for(var b=0;ba?-b:b};ka!=ia&&null!=ka&&ca(da,ha,{configurable:!0,writable:!0,value:ka}); var m={Be:0,Ee:1,Fe:2,Ge:3,He:4,Ie:5,Je:6,Ke:7,Le:8,Me:9,Ne:10,Oe:11,Pe:12,Qe:13,Re:14,Se:15,Te:16,Ue:17,Ve:18,We:19,Xe:20,Ye:21,Ze:22,$e:23,af:24,bf:25,cf: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,ab:65,Ub:66,Vb:67,Fb:68,E:69,Yb:70,Zb:71,$b:72,ac:73,bc:74,cc:75,Hb:76,gc:77,hc:78,lc:79,mc:80,Q:81,nc:82,pc:83,qc:84,rc:85,tc:86,uc:87, wc:88,xc:89,wb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yc:97,ud:98,xd:99,d:100,e:101,Bd:102,Dd:103,Ed:104,Fd:105,Od:106,k:107,Pd:108,Rd:109,n:110,Sd:111,p:112,q:113,r:114,oe:115,t:116,pe:117,qe:118,re:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,df:127},la={59:186,61:187,173:189,224:91}; -function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function pa(a,b,c){b?12"']/g,function(a){return xa[a]})}function ya(a,b){return(a+" ").slice(0,b)} -function Aa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var xa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ca={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function pa(a,b,c){b?12"']/g,function(a){return xa[a]})} +function ya(a,b){return(a+" ").slice(0,b)}function Aa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var xa={"&":"&","<":"<",">":">",'"':""","'":"'"},Ca={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function Da(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Fa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;ca?-b:b};ia!=ha&&null!=ia&&aa(ba,ga,{configurable:!0,writable:!0,value:ia}); var n={Yd:0,ae:1,be:2,ce:3,de:4,ee:5,fe:6,ge:7,he:8,ie:9,je:10,ke:11,le:12,me:13,ne:14,oe:15,pe:16,qe:17,re:18,se:19,te:20,ue:21,ve:22,we:23,xe:24,ye:25,ze: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,Ia:65,sb:66,tb:67,kb:68,E:69,wb:70,xb:71,yb:72,zb:73,Ab:74,Bb:75,lb:76,Fb:77,Gb:78,Jb:79,Kb:80,Q:81,Lb:82,Nb:83,Ob:84,Pb:85,Rb:86,Sb:87, Ub:88,Vb:89,$a:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Wb:97,Rc:98,Tc:99,d:100,e:101,Xc:102,Yc:103,Zc:104,$c:105,jd:106,k:107,kd:108,ld:109,n:110,md:111,p:112,q:113,r:114,Kd:115,t:116,Ld:117,Md:118,Nd:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Ae:127},ja={59:186,61:187,173:189,224:91}; -function ka(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d}function la(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return qa[a]})}function ra(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +function ka(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(16,b)),0>a||a>=Math.pow(16,b))&&(a=null);if(null==a)for(;0=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} +function la(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0"']/g,function(a){return qa[a]})}function ra(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var qa={"&":"&","<":"<",">":">",'"':""","'":"'"},sa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function 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 ua(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, diff --git a/versions/pcx86/1.34.2/pcx86-dbg.js b/versions/pcx86/1.34.2/pcx86-dbg.js index 106ecf05b..fa9d87a28 100644 --- a/versions/pcx86/1.34.2/pcx86-dbg.js +++ b/versions/pcx86/1.34.2/pcx86-dbg.js @@ -50,9 +50,9 @@ var la={163840:[40,1,8,,254],184320:[40,1,9,,252],327680:[40,2,8,,255],368640:[4 "(":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,ce:65,ti:66,ui:67,vi:68,E:69,wi:70,xi:71,yi:72,zi:73,Ai:74,Bi:75,Ci:76,Di:77,Ei:78,Fi:79,Gi:80,Q:81,Hi:82,Ii:83,Ji:84,Ki:85,Li:86,Mi:87,Ni:88,Oi:89,eg:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,de:97,vl:98,xl:99,d:100,e:101,Hl:102,Il:103,Jl:104,Kl:105,an:106,k:107,dn:108,hn:109,n:110,qn:111,p:112,q:113,r:114,No:115,t:116,Qo:117,Ro:118,So:119,x:120, y:121,z:122,"{":123,"|":124,"}":125,"~":126,Mp:127},ma={};ma[173]=n["-"];ma[186]=n[";"];ma[187]=n["="];ma[189]=n["-"];ma[188]=n[","];ma[190]=n["."];ma[191]=n["/"];ma[192]=n["`"];ma[219]=n["["];ma[220]=n["\\"];ma[221]=n["]"];ma[222]=n["'"];var na={};na[n["1"]]=n["!"];na[n["2"]]=n["@"];na[n["3"]]=n["#"];na[n["4"]]=n.$;na[n["5"]]=n["%"];na[n["6"]]=n["^"];na[n["7"]]=n["&"];na[n["8"]]=n["*"];na[n["9"]]=n["("];na[n["0"]]=n[")"];na[186]=n[":"];na[187]=n["+"];na[188]=n["<"];na[189]=n._;na[190]=n[">"]; na[191]=n["?"];na[192]=n["~"];na[219]=n["{"];na[220]=n["|"];na[221]=n["}"];na[222]=n['"'];na[173]=n._;na[61]=n["+"];na[59]=n[":"]; -function oa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function qa(a,b){var c,d="";b?32>=1,f--;return d} -function ra(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d}function sa(a,b,c){b?12a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e} +function qa(a,b){var c,d="";b?32>=1,f--;return d}function ra(a,b,c){var d="";if(!b||4>=8;return(c?"0b":"")+d}function sa(a,b,c){b?12"']/g,function(a){return Aa[a]})} function Ba(a,b,c){return c?(" "+a).slice(-b):(a+" ").slice(0,b)}function Ca(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var Aa={"&":"&","<":"<",">":">",'"':""","'":"'"},Da={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function Ea(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0":62,"?":63,"@":64,Bd:65,wh:66,xh:67,zh:68,E:69,Ah:70,Bh:71,Ch:72,Dh:73,Eh:74,Fh:75,Gh:76,Hh:77,Ih:78,Jh:79,Kh:80,Q:81,Lh:82,Mh:83,Nh:84,Oh:85,Ph:86,Qh:87,Rh:88,Sh:89,sf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Cd:97,jk:98,kk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Jl:106,k:107,Ll:108,Pl:109,n:110,Vl:111,p:112,q:113,r:114,pn:115,t:116,sn:117,tn:118,un:119,x:120, y:121,z:122,"{":123,"|":124,"}":125,"~":126,po:127},ma={};ma[173]=n["-"];ma[186]=n[";"];ma[187]=n["="];ma[189]=n["-"];ma[188]=n[","];ma[190]=n["."];ma[191]=n["/"];ma[192]=n["`"];ma[219]=n["["];ma[220]=n["\\"];ma[221]=n["]"];ma[222]=n["'"];var p={};p[n["1"]]=n["!"];p[n["2"]]=n["@"];p[n["3"]]=n["#"];p[n["4"]]=n.$;p[n["5"]]=n["%"];p[n["6"]]=n["^"];p[n["7"]]=n["&"];p[n["8"]]=n["*"];p[n["9"]]=n["("];p[n["0"]]=n[")"];p[186]=n[":"];p[187]=n["+"];p[188]=n["<"];p[189]=n._;p[190]=n[">"];p[191]=n["?"]; p[192]=n["~"];p[219]=n["{"];p[220]=n["|"];p[221]=n["}"];p[222]=n['"'];p[173]=n._;p[61]=n["+"];p[59]=n[":"]; -function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} +function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(16,b)),0>a||a>=Math.pow(16,b))&&(a=null);if(null==a)for(;0=e?48:55),d=String.fromCharCode(e)+d;a=Math.trunc(a/16)}return(void 0===c?"":c)+d} function pa(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0"']/g,function(a){return ta[a]})}function ua(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} var ta={"&":"&","<":"<",">":">",'"':""","'":"'"},va={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function wa(){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 xa(a,b){var c=0,d=1,e;for(e in a){if(d>=arguments.length)break;var f=a[e],g=arguments[d++],c=c&~f.qg|g<>a.shift}var za=[31,28,31,30,31,30,31,31,30,31,30,31],Aa=Date.now||function(){return+new Date}; diff --git a/versions/pdpjs/1.34.2/pdp10-dbg.js b/versions/pdpjs/1.34.2/pdp10-dbg.js index 758eeac79..fa5d1fa46 100644 --- a/versions/pdpjs/1.34.2/pdp10-dbg.js +++ b/versions/pdpjs/1.34.2/pdp10-dbg.js @@ -26,216 +26,233 @@ http://pcjs.org/modules/shared/lib/debugger.js (C) Jeff Parsons 2012-2017 http://pcjs.org/modules/pdp10/lib/debugger.js (C) Jeff Parsons 2012-2017 */ -var l,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this;function da(){da=function(){};ba.Symbol||(ba.Symbol=ea)}var ka=0;function ea(a){return"jscomp_symbol_"+(a||"")+ka++} -function la(){da();var a=ba.Symbol.iterator;a||(a=ba.Symbol.iterator=ba.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ma(this)}});la=function(){}}function ma(a){var b=0;return na(function(){return ba?-b:b}});oa("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}}); -var pa={ac:0,ub:1,cc:2,dc:3,ec:4,fc:5,gc:6,hc:7,gb:8,ic:9,vb:10,jc:11,kc:12,wb:13,lc:14,mc:15,nc:16,oc:17,pc:18,qc:19,rc:20,sc:21,tc:22,uc:23,vc:24,wc:25,xc: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,fb:65,$b:66,bc:67,yc:68,E:69,zc:70,Ac:71,Bc:72,Cc:73,Dc:74,Ec:75,Fc:76,Gc:77,Hc:78,Ic:79,Jc:80,Q:81,Kc:82,Lc:83,Mc:84,Nc:85,Oc:86,Pc:87, -Qc:88,Rc:89,yb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Sc:97,Tc:98,Uc:99,d:100,e:101,Vc:102,Wc:103,Xc:104,Yc:105,Zc:106,k:107,$c:108,ad:109,n:110,bd:111,p:112,q:113,r:114,cd:115,t:116,ed:117,fd:118,gd:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,xb:127}; -function qa(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=g?48:55),e=String.fromCharCode(g)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function sa(a,b,c){b?12"']/g,function(a){return Aa[a]})}function Ba(a,b){return(a+" ").slice(0,b)} -function Ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Aa={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ia(a,b,c){var d=0,e=a.length,g=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[f]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function Ka(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 La(a,b){var c,d={Y:null,T:null,oa:null,na: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.oa=f.load;d.na=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>8&255;else if(e=f.longs)for(d.Y=Array(4*e.length),g=c=0;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&&(r(d.Y[0]),d=null):(r("Empty resource: "+a),d=null));d.T=f.symbols}catch(h){r("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.w={ready:!1,Fa:!1,Za:!1,U:!1,error:!1};this.Qa=null;this.w.error=!1;this.X=c||0;this.D=this.v=this.H=this.G=this.pa=null;v.push(this)}function mb(a,b,c){nb[a]&&b&&(nb[a][b]=c)}function ob(){return Date.now()||+new Date} -function r(a){window&&window.alert(a)}function pb(a){var b=!1;window&&(b=window.confirm(a));return b}function qb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba?-b:b}});ra("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}}); +var sa={ec:0,xb:1,gc:2,hc:3,ic:4,jc:5,kc:6,lc:7,lb:8,mc:9,yb:10,nc:11,oc:12,zb:13,pc:14,qc:15,rc:16,sc:17,tc:18,uc:19,vc:20,wc:21,xc:22,yc:23,zc:24,Ac:25,Bc: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,kb:65,dc:66,fc:67,Cc:68,E:69,Dc:70,Ec:71,Fc:72,Gc:73,Hc:74,Ic:75,Jc:76,Kc:77,Lc:78,Mc:79,Nc:80,Q:81,Oc:82,Pc:83,Qc:84,Rc:85,Sc:86,Tc:87, +Uc:88,Vc:89,Bb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Wc:97,Xc:98,Yc:99,d:100,e:101,Zc:102,$c:103,ad:104,bd:105,cd:106,k:107,dd:108,ed:109,n:110,fd:111,p:112,q:113,r:114,gd:115,t:116,jd:117,kd:118,ld:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Ab:127}; +function ta(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function va(a,b,c){b?12"']/g,function(a){return Da[a]})} +function Ea(a,b){return(a+" ").slice(0,b)}function Fa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var Da={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ga(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function Ia(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 k="",n;for(n in b)b.hasOwnProperty(n)&&(k&&(k+="&"),k+=n+"="+encodeURIComponent(b[n]));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||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} +function Ja(a,b){var c,d={Y:null,U:null,sa:null,ra: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.sa=g.load;d.ra=g.exec;if(e=g.bytes)d.Y=e;else if(e=g.words)for(d.Y=Array(2*e.length),f=c=0;c>8&255;else if(e=g.longs)for(d.Y=Array(4*e.length),f=c=0;c>8&255,d.Y[f++]=e[c]>>16&255,d.Y[f++]=e[c]>>24&255;else(e=g.data)?d.Da=e:d.Y=g;d.Y&&(d.Y.length?1==d.Y.length&&(q(d.Y[0]),d=null):(q("Empty resource: "+a),d=null));d.U=g.symbols}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca?this.Pa=this.id:(this.Qa=this.id.substr(0,a),this.Pa=this.id.substr(a+1));this.A={ready:!1,Ia:!1,cb:!1,V:!1,error:!1};this.Ta=null;this.A.error=!1;this.X=c||0;this.D=this.v=this.H=this.G=this.ta=null;pb.push(this)}function qb(a,b,c){rb[a]&&b&&(rb[a][b]=c)}function sb(){return Date.now()||+new Date} +function q(a){window&&window.alert(a)}function tb(a){var b=!1;window&&(b=window.confirm(a));return b}function ub(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.b["S"+a]=[0,0,!1,!1,this.Kb,a];this.D=this.v=this.H=this.G=null;this.exports={hold:this.Cb,toggle:this.Vb,reset:this.Rb, -set:this.Ub};z(this)}p($b,u);l=$b.prototype;l.reset=function(a){this.stop();a&&bc(this,this.A=0)}; -l.ha=function(a,b,c,d){if(this.G&&this.G.ha(a,b,c,d)||this.v&&this.v.ha(a,b,c,d)||this.D&&this.D.ha(a,b,c,d))return!0;switch(b){case "PC":return this.J[b]=c,this.M++,!0;default:return"led"==a||"rled"==a?(this.J[b]=c,this.B[b]=d?1:0,this.M++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.J[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):u.prototype.ha.call(this,a,b,c,d)}};l.za=function(a,b,c,d){this.G=a;this.H=b;this.v=c;this.D=d;ec(this);fc(this)};l.qa=function(a,b){if(!b)if(this.W&&gc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};l.ga=function(a){return a?this.save():!0};l.save=function(){var a=new O(this);a.set(0,[this.f,this.A,this.u]);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.Rb=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.J[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function ec(a,b){for(var c in a.B)jc(a,c,null!=b?b:a.B[c])}function kc(a,b,c){if(a=a.J[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.Cb=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.Ub=function(a,b){if("SR"==a)return ic(this,qa(b,8));var c=this.b[a];return c?(c[1]=+b?1:0,kc(this,a,c[1]),!0):!1};l.Vb=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==mc,a.R=b==nc),!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.Lb=function(a){a||this.v.w.K||(this.v.A=this.f%A,this.b[oc]&&this.b[oc][1]&&pc(this.v))};l.Mb=function(){};l.Gb=function(a){a||this.v.V()}; -l.Eb=function(a){if(!a&&!this.v.w.K)if(this.b[oc]&&this.b[oc][1])pc(this.v);else{if((a=this.D)&&!Lb(a,!0))Mb(a,!0),qc(a,0,null),Mb(a,!1);else try{var b=this.v.Ja(1);0c;c++){var d=a,e="A"+c,g=b&1<c;c++){var d=a,e="D"+c,g=b&1<b;b++)a.b["S"+b][1]=a.u&1<d.length){for(var e=0,g=Array(4096),f=0;f>>a.f;0g&&(m=g);if(h&&h.size){if(h.type==d){if(e+g<=h.C)return h.Ha+=h.C-e,h.C=e,!0;if(e>=h.C+h.Ha){m=h.size-(e-k);m>g&&(m=g);h.Ha=e-h.C+m;e=k+16384;g-=m;f++;continue}}return Kc(Lc,e,g)}e=new Gc(a,e,m,16384,d);Hc(e,a.D,h);a.b[f++]=e;e=k+16384;g-=m}return 0>=g?(a.status("Added "+(c>>10)+"Kb "+Mc[d]+" at "+sa(b)),!0):Kc(Nc,b,c)} -function Ec(a,b){var c=a.b[(b&a.u)>>>a.f];a.A++;b=c.G(b&16383,b);a.A--;return b}function Dc(a,b,c){var d=a.b[(b&a.u)>>>a.f];a.A++;d.D(c,b&16383,b);a.A--}function Ic(a){for(var b=0,c=[],d=0;d=a.ja&&(a.ja+=a.ia,c=!0);0<=a.ka&&a.ka<=hd(a)&&(a.ia=a.ka=-1,dd(a),a.V(),c=!0);c&&a.j(hd(a)+" cycles: checksum="+q(a.va))}} -l.ha=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.G)if(a=d.G,a.w.U)a=!0;else{var b=null,c,h=qb(a.id);for(c=0;ca.W/a.aa?b=1:d=!0;a.ba=b;b=a.Va*a.ba;if(a.aa!=b){a.aa=b;b=a.aa.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.G&&ld(a.G)}sc(a,a.M);a.M=0;a.L=ob();a.O=0;jd(a);return d}function md(a,b){for(var c=a.N.length-1;0<=c;c--){var d=a.N[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function nd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function od(a,b){var c=a.P-=a.R;a.R=0;b&&(a.P=0);return c} -l.Sb=function(){if(this.w.K){this.Na>=this.Xa&&jd(this,!0);this.la=0;this.ua=ob();if(this.O){var a=this.ua-this.O;a>this.Wa&&(this.L+=a,this.L>this.ua&&(this.L=this.ua))}try{do{var b=md(this,this.w.Ea?1:this.xa);try{this.Ja(b)}catch(e){if("number"!=typeof e)throw e;}b=od(this,!0);this.la+=b;this.M+=b;tc(this,b);rc(this,b);this.ea-=b;if(0>=this.ea){this.ea+=this.xa;++this.Ya>=pd&&(this.G&&P(this.G,void 0),this.Ya=0);break}}while(this.w.K)}catch(e){this.V();this.G&&this.G.stop(ob(),hd(this));Ib(this, -e.stack||e.message);return}if(this.w.K){a=setTimeout;b=this.lb;this.O=ob();var c=this.Wa;this.la&&(c=Math.round(c*this.la/this.xa));var c=c-(this.O-this.ua),d=this.O-this.L;d&&(this.W=Math.round(this.M/(10*d))/100,864E5<=d&&(this.S=0,id(this)));if(0>c||this.Wc&&(this.L-=c),c=0;this.Na+=this.la;this.O+=c;a(b,c)}}}; -function pc(a,b){if(!Jb(a))if(a.w.K)a.j(a.toString()+" busy");else{id(a);a.w.K=!0;a.w.Ta=!0;var c=a.J.run;c&&(c.textContent="Halt");a.G&&(b&&ld(a.G,!0),a.G.start(a.L,hd(a)));a.D||a.status("Started");setTimeout(a.lb,0)}}l.Ja=function(){return 0};l.V=function(a){var b=!1;if(this.w.K){od(this);sc(this,this.M);this.M=0;this.w.K=!1;if(b=this.J.run)b.textContent="Run";this.G&&this.G.stop(ob(),hd(this));b=!0;this.D||this.status("Stopped")}this.w.complete=a;return b};var kd=30,pd=15,ad=["power","reset"]; -function qd(a){var b=+a.model||1001;$c.call(this,a,1E6);this.kb=b;this.Ka=+a.addrReset||0;this.zb=rd.bind(this);this.b=R.bind(this);this.sa=null;this.ib=[];this.w.complete=!1}p(qd,$c);l=qd.prototype;l.reset=function(){this.status("Model "+this.kb);this.w.K&&this.V();this.f=this.I=this.ya=0;this.A=this.ta=this.Ka;this.F=this.ma=-1;this.Oa=this.u=0;this.ra=this.A;this.B=0;this.g=this.Ob;this.i=this.Zb;this.sa=null;cd(this);this.w.error=!1;$c.prototype.reset.call(this)};l.rb=function(){return 0}; -l.save=function(){var a=new O(this);a.set(0,[this.f,this.I,this.ya,this.A,this.ma,this.F,this.u,this.B,this.ta,this.ra,this.Ka]);a.set(1,[]);a.set(2,[this.S,this.ba,this.w.Z]);a.set(3,sd(this));a.set(4,nd(this));return a.data()}; -l.restore=function(a){var b;b=a[0];la();da();la();var c=b[Symbol.iterator];b=c?c.call(b):ma(b);this.f=b.next().value;this.I=b.next().value;this.ya=b.next().value;this.A=b.next().value;this.ma=b.next().value;this.F=b.next().value;this.u=b.next().value;this.B=b.next().value;this.ta=b.next().value;this.ra=b.next().value;this.Ka=b.next().value;b=a[2];this.S=b[0];id(this,b[1]);this.w.Z=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>>b.f].g(a&16383,a)};l.Zb=function(a,b){var c=this.H;a=this.ra=a;c.b[(a&c.u)>>>c.f].i(b,a&16383,a);return b}; -l.Ja=function(a){this.w.complete=!0;var b=this.D?ud(this.D)?1:this.w.Ta?-1:0:0,c=a?this.w.Ta?0:1:-1;this.w.Ta=!1;this.P=this.R=a;this.B=this.B&-5|(b?4:0);do{if(this.B){if(this.B&4){if(vd(this.D,this.A,c)){this.V();break}++b||(this.B&=-5);c||c++}if(a=this.B&11)this.B&2?this.sa||(this.B&=-3):this.B&1&&this.B++,a=!1;if(a){if(this.B&4&&vd(this.D,this.A,c)){this.V();break}if(0>c)break}}this.B&=15;this.I&4194304?this.I=this.g(this.f):0<=this.ma?(this.I=this.ya=this.g(this.ma),this.ma=-1):(this.I=this.ya= -this.g(this.ta=this.A),this.A=(this.A+1)%A);this.I&=8388607;this.f=this.I&262143;if(a=this.I>>18&15)this.f=this.f+this.g(a)&Qb;a=this.I&4194304?-1:this.ya/Yb|0;0<=a&&this.zb(a)}while(0>4].call(this,a,a&15)}function S(a){this.b(a)} -function xd(){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)%I);this.i(this.f,b)}function yd(a,b){a=this.g(this.f);if(0>this.F)this.F=a,this.I=this.f|4194304;else{var c=this.F/Zb&63,d=this.F>>24&63;a=32>=c+d?(a>>c&(1<>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.i(b,a);this.F=-1}} -function zd(a,b){a=this.g(this.f);if(0>this.F)this.F=a,this.I=this.f|4194304,td(this,-1);else{var c=this.F/Zb&63,d=this.F>>24&63;b=this.g(b)%Math.pow(2,d)*Math.pow(2,c)%I;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.i(this.f,a);this.F=-1}}function Ad(a,b){this.i(b,this.g(this.f))}function Bd(a,b){this.i(b,this.f)}function Cd(a,b){this.i(this.f,this.g(b))}function Yd(a,b){this.i(b,0)}function Zd(a,b){this.i(b,H-this.g(b))}function $d(a,b){this.i(b,H)} -function ae(a,b){var c=this.g(this.f),d=this.g(b);this.i(b,be(a,d,c)+(c-(c&E)))}function ce(a,b){var c=this.g(b);this.i(b,be(a,c,0))}function de(a,b){b=this.g(b);var c=this.g(this.f);this.i(this.f,be(a,c,b)+(b-(b&E)))}function ee(a,b){var c=this.g(this.f),d=c;if(a&=384)switch(d-=d&E,a){case 256:d+=E;break;case 384:d+=c>J?E:0}c=d;this.i(this.f,c);b&&this.i(b,c)}function fe(a,b){var c=(this.g(this.f)&E)*F,d=this.g(b);this.i(b,be(a,d,c)+c)} -function ge(a,b){var c=this.f*F,d=this.g(b);this.i(b,be(a,d,c)+c)}function he(a,b){b=(this.g(b)&E)*F;var c=this.g(this.f);this.i(this.f,be(a,c,b)+b)}function ie(a,b){var c=this.g(this.f),d=(c&E)*F,c=be(a,c,d)+d;this.i(this.f,c);b&&this.i(b,c)}function je(a,b){var c=this.g(this.f)&E,d=this.g(b);this.i(b,ke(a,d,c)+c)}function le(a,b){var c=this.g(b);this.i(b,ke(a,c,this.f)+this.f)}function me(a,b){b=this.g(b)&E;var c=this.g(this.f);this.i(this.f,ke(a,c,b)+b)} -function ne(a,b){var c=this.g(this.f),d=c;if(a&=384)switch(d&=E,a){case 256:d+=E*F;break;case 384:d+=c>Sb?E*F:0}c=d;this.i(this.f,c);b&&this.i(b,c)}function oe(a,b){var c=this.g(this.f)/F|0,d=this.g(b);this.i(b,ke(a,d,c)+c)}function pe(a,b){var c=this.g(b);this.i(b,ke(a,c,0))}function qe(a,b){b=this.g(b)/F|0;var c=this.g(this.f);this.i(this.f,ke(a,c,b)+b)}function re(a,b){var c=this.g(this.f),d=c/F|0,c=ke(a,c,d)+d;this.i(this.f,c);b&&this.i(b,c)}function U(a){se[a&7].call(this,a,a>>3&127)} -function te(){}function R(a){this.j("undefined opcode: "+sa(a));td(this,-1);this.V()}function ue(a){a>J&&(a!=Tb?a=Ub-a:this.u|=163840);return a}function ve(a,b){var c=(a+b)%I;we.call(this,a,b,c);return c}function V(a,b){return((a/K|0)&(b/K|0))*K+((a&b)>>>0)}function xe(a,b){return((a/K|0)^(b/K|0))*K+((a^b)>>>0)}function ye(a,b){return(~((a/K|0)^(b/K|0))&15)*K+(~(a^b)>>>0)}function W(a,b){return(a/K|0|b/K|0)*K+((a|b)>>>0)} -function ze(a,b){var c=b;b=!1;var d;a>J&&(a=I-a,b=!b);c>J&&(c=I-c,b=!b);if(ac&&(c+=I);we.call(this,c,b,a);return c}function we(a,b,c){a=Math.trunc(a/Vb);b=Math.trunc(b/Vb);c=Math.trunc(c/Vb);var d=a^(a^b)&(b^c);this.u=this.u|(d&2?65536:0)|(d&1?32768:0)|((a^c)&(b^c)&2?131072:0)}function ke(a,b,c){switch(a&384){case 0:b-=b&E;break;case 128:b=0;break;case 256:b=E*F;break;case 384:b=c>Sb?E*F:0}return b}function be(a,b,c){switch(a&384){case 0:b&=E;break;case 128:b=0;break;case 256:b=E;break;case 384:b=c>J?E:0}return b} -var wd=[S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,S,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(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},xd,function(a,b){0>this.F&&xd.call(this);yd.call(this,0,b)},yd,function(a,b){0>this.F&&xd.call(this);zd.call(this,0,b)},zd,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)},Ad,Bd,Cd,function(a,b){b&&this.i(b,this.g(this.f))},function(a,b){a=this.g(this.f);a=(a/F|0)+a%F*F;this.i(b,a)},function(a,b){this.i(b,this.f*F)},function(a,b){a=this.g(b);a=(a/F|0)+a%F*F;this.i(this.f,a)},function(a,b){a=this.g(this.f);a=(a/F|0)+a%F*F;this.i(this.f,a);b&&this.i(b,a)},function(a,b){this.i(b,Ae.call(this,this.g(this.f)))},function(a,b){this.i(b,this.f?Ub-this.f:0)},function(a,b){this.i(this.f, -Ae.call(this,this.g(b)))},function(a,b){a=Ae.call(this,this.g(this.f));this.i(this.f,a);b&&this.i(b,a)},function(a,b){this.i(b,ue.call(this,this.g(this.f)))},function(a,b){this.i(b,this.f)},function(a,b){this.i(this.f,ue.call(this,this.g(b)))},function(a,b){a=ue.call(this,this.g(this.f));this.i(this.f,a);b&&this.i(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){this.i(b,ze.call(this,this.g(b),this.g(this.f)));this.i(b+1&15,this.Oa)}, -function(a,b){this.i(b,ze.call(this,this.g(b),this.f));this.i(b+1&15,this.Oa)},function(a,b){this.i(this.f,ze.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,ze.call(this,this.g(b),this.g(this.f))));this.i(b+1&15,this.Oa)},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>>14)%256;if(c){a=this.g(b);var d=a> -J?-(I-a):a;0d?G:0,c=Rb):(d=d*Math.pow(2,c)%G,c=G-Math.pow(2,35-c)),a<=J?a+c>J&&(this.u|=131072):a-c<=J&&(this.u|=131072)):d=-35>=c?0>d?-1:0:Math.trunc(d/Math.pow(2,-c));a=0>d?d+I:d;this.i(b,a)}},function(a,b){if(a=(this.f<<14>>14)%36){var c=this.g(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%I+Math.trunc(c/Math.pow(2,36-a));this.i(b,c)}},function(a,b){if(a=(this.f<<14>>14)%256){var c=this.g(b),c=0=a?0:Math.trunc(c/Math.pow(2,-a));this.i(b,c)}},function(a,b){a= -0;var c=this.g(b);if(c){for(;c>14)%256){var c,d=this.g(b),e=this.g(b+1&15);if(0Rb&&dRb&&eJ&&(this.u|=131072):e-c<=J&&(this.u|=131072);e=0;g>Rb&&(d+=G,e+=G)}else d=d*Math.pow(2,a)%G+Math.trunc(e%G/Math.pow(2,35-a)),e=e*Math.pow(2,a)%G,c=G-Math.pow(2,35-a),g<=J?g+c> -J&&(this.u|=131072):(g-c<=J&&(this.u|=131072),d+=G,e+=G)}else-36>=a?(e=-72>=a?d>Rb?H:0:Math.trunc(d%G/Math.pow(2,-a-35)),d<=Rb?d=0:(d=H,e+=G)):(c=d>Rb?I-Math.pow(2,36+a):0,e=Math.trunc(e%G/Math.pow(2,-a))+d%G*Math.pow(2,35+a)%G,d=Math.trunc(d/Math.pow(2,-a))+c,d>Rb&&(e+=G));this.i(b,d);this.i(b+1&15,e)}},function(a,b){if(a=(this.f<<14>>14)%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)%I+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%I+Math.trunc(e/Math.pow(2,36- -a))):(c=d*Math.pow(2,a-36)%I+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%I+Math.trunc(d/Math.pow(2,72-a)));this.i(b,c);this.i(b+1&15,d)}},function(a,b){if(a=(this.f<<14>>14)%256){var c=this.g(b),d=this.g(b+1&15);0=a?(d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36)),c=0):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%I,c=Math.trunc(c/Math.pow(2,-a)));this.i(b,c);this.i(b+ -1&15,d)}},R,function(a,b){a=this.g(b);this.i(b,this.g(this.f));this.i(this.f,a)},function(a,b){a=!1;for(var c=this.g(b),d=c/F|0,c=c&E;!a;)this.i(c,this.g(d)),c==this.f&&(a=!0),d=d+1&E,c=c+1&E,this.w.K||(this.i(b,d*F+c),a||td(this,-1),a=!0)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a,b){a=b<<14;this.u&a&&(this.u&=~a,this.A=this.f%A)},function(){this.ma=this.f},R,function(a){this.b(a)},function(a,b){a=this.g(b);a+=262145;this.i(a&E,this.g(this.f));a>=I&&(a-=I);a/ -F|0||(this.u|=262144);this.i(b,a)},function(a,b){a=this.g(b);var c=this.g(a&E);this.i(this.f,c);this.f==b&&(a=c);a-=262145;0>a&&(a+=I);(a/F|0)==E&&(this.u|=262144);this.i(b,a)},function(a){this.b(a)},function(a){this.b(a)},function(a,b){this.i(b,(this.u&E)*F+this.A);this.A=this.f%A},function(a){this.b(a)},function(a){this.b(a)},function(a,b){this.i(b,ve.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(b,ve.call(this,this.g(b),this.f))},function(a,b){this.i(this.f,ve.call(this,this.g(b), -this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,ve.call(this,this.g(b),this.g(this.f))))},function(a,b){this.i(b,Be.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(b,Be.call(this,this.g(b),this.f))},function(a,b){this.i(this.f,Be.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,Be.call(this,this.g(b),this.g(this.f))))},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)},Yd,Yd,function(){this.i(this.f,0)},function(a,b){this.i(this.f,this.i(b,0))},function(a,b){this.i(b,V.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(b,V.call(this,this.g(b), -this.f))},function(a,b){this.i(this.f,V.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,V.call(this,this.g(b),this.g(this.f))))},function(a,b){this.i(b,V.call(this,H-this.g(b),this.g(this.f)))},function(a,b){this.i(b,V.call(this,H-this.g(b),this.f))},function(a,b){this.i(this.f,V.call(this,H-this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,V.call(this,H-this.g(b),this.g(this.f))))},Ad,Bd,te,Ad,function(a,b){this.i(b,V.call(this,this.g(b),H-this.g(this.f)))}, -function(a,b){this.i(b,V.call(this,this.g(b),H-this.f))},function(a,b){this.i(this.f,V.call(this,this.g(b),H-this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,V.call(this,this.g(b),H-this.g(this.f))))},te,te,Cd,Cd,function(a,b){this.i(b,xe.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(b,xe.call(this,this.g(b),this.f))},function(a,b){this.i(this.f,xe.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,xe.call(this,this.g(b),this.g(this.f))))},function(a,b){this.i(b, -W.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(b,W.call(this,this.g(b),this.f))},function(a,b){this.i(this.f,W.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,W.call(this,this.g(b),this.g(this.f))))},function(a,b){this.i(b,V.call(this,H-this.g(b),H-this.g(this.f)))},function(a,b){this.i(b,V.call(this,H-this.g(b),H-this.f))},function(a,b){this.i(this.f,V.call(this,H-this.g(b),H-this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,V.call(this,H-this.g(b),H- -this.g(this.f))))},function(a,b){this.i(b,ye.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(b,ye.call(this,this.g(b),this.f))},function(a,b){this.i(this.f,ye.call(this,this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,ye.call(this,this.g(b),this.g(this.f))))},Zd,Zd,function(a,b){this.i(this.f,H-this.g(b))},function(a,b){this.i(this.f,this.i(b,H-this.g(b)))},function(a,b){this.i(b,W.call(this,H-this.g(b),this.g(this.f)))},function(a,b){this.i(b,W.call(this,H-this.g(b),this.f))}, -function(a,b){this.i(this.f,W.call(this,H-this.g(b),this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,W.call(this,H-this.g(b),this.g(this.f))))},function(a,b){this.i(b,H-this.g(this.f))},function(a,b){this.i(b,H-this.f)},function(){this.i(this.f,H-this.g(this.f))},function(a,b){this.i(this.f,this.i(b,H-this.g(this.f)))},function(a,b){this.i(b,W.call(this,this.g(b),H-this.g(this.f)))},function(a,b){this.i(b,W.call(this,this.g(b),H-this.f))},function(a,b){this.i(this.f,W.call(this,this.g(b),H- -this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,W.call(this,this.g(b),H-this.g(this.f))))},function(a,b){this.i(b,W.call(this,H-this.g(b),H-this.g(this.f)))},function(a,b){this.i(b,W.call(this,H-this.g(b),H-this.f))},function(a,b){this.i(this.f,W.call(this,H-this.g(b),H-this.g(this.f)))},function(a,b){this.i(this.f,this.i(b,W.call(this,H-this.g(b),H-this.g(this.f))))},$d,$d,function(){this.i(this.f,H)},function(a,b){this.i(this.f,this.i(b,H))},ae,ce,de,ee,fe,ge,he,ie,ae,ce,de,ee,fe,ge,he,ie, -ae,ce,de,ee,fe,ge,he,ie,ae,ce,de,ee,fe,ge,he,ie,je,le,me,ne,oe,pe,qe,re,je,le,me,ne,oe,pe,qe,re,je,le,me,ne,oe,pe,qe,re,je,le,me,ne,oe,pe,qe,re,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)},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],se=[function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a){this.b(a)},function(a,b){switch(b){case 0:a=this.g(this.f);a&8&&(this.u&=-131073);a&131072&&(this.u&=-262145);break;default:this.b(a)}},function(a,b){switch(b){case 0:a=0;this.u&131072&&(a|=8);this.u& -262144&&(a|=65536);this.i(this.f,a);break;default:this.b(a)}},function(a){this.b(a)},function(a){this.b(a)}]; -function Ce(a){u.call(this,"ROM",a,128);this.T=this.b=null;this.B=+a.addr;this.u=+a.size;this.f=a.alias;"string"==typeof this.f&&(this.f=eval(this.f));this.A=a.file;this.F=va(this.A);if(this.A){a=this.A;var b=wa(this.F);"json"!=b&&"hex"!=b&&(a=ya()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;Ka(a,null,!0,function(a,b,g){g?(c.da("Unable to load ROM resource (error "+g+": "+a+")"),c.A=null):(mb(c.Ma,a,b),(a=La(a,b))?(c.b=a.Y,c.T=a.T):c.A=null);De(c)})}}p(Ce,u); -Ce.prototype.za=function(a,b,c,d){this.H=b;this.v=c;this.D=d;De(this)};Ce.prototype.qa=function(){this.T&&(this.D&&Ee(this.D,this.id,this.B,this.u,this.T),delete this.T);return!0};Ce.prototype.ga=function(){return!0}; -function De(a){if(!Kb(a)){if(a.A){if(!a.b||!a.H)return;a.u||(a.u=a.b.length);if(a.b.length!=a.u)Ib(a,"ROM size ("+q(a.b.length,8,!0)+") does not match specified size ("+q(a.u,8,!0)+")");else{var b;b=a.B;if(Jc(a.H,b,a.u,Rc)){var c;for(c=0;c>>g.f;0>>= -g.f;0>>a.f;0f&&f>=-Tb&&(f+=I);for(var f=Math.trunc(Math.abs(f))%I,h=d;g--&&h=pa.fb&&c<=pa.yb&&(b=c-(pa.fb-pa.ub));b&&(a.preventDefault&&a.preventDefault(),d.Ra(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==pa.wb&&(b=pa.vb);d.Ra(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.Ra(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};l.za=function(a,b,c,d){this.G=a;this.H=b;this.v=c;this.D=d;z(this)}; -l.sb=function(a){if(!this.b){var b=bd(this.G,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Ha(c[0]);if(d!=this.La)return;c=Ha(c[1]);if(this.b=sb(c)){var e=this.b.exports;if(e){var g=e.connect;g&&g.call(this.b,this.u);if(this.B=e.receiveData){this.u=a;this.status("Connected "+this.Ma+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.qa=function(a,b){if(!b)if(this.sb(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -l.ga=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){var a=new O(this);a.set(0,[]);return a.data()};l.restore=function(){return!0};l.Ra=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;da.A&&a.u.length&&(a.A=0);if(0>a.A||b!=a.u[a.A])a.u.splice(0,0,b),a.A=0;a.A--}else a.P?b="end":b=a.u[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(Ha(b.substring(c,g))),c=g+1}}return a} -function Me(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<>":d=g>>e;break;case ">>>":d=g>>>e;break;case "<":d=g":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 Ne(a,b,c){var d;if(b){b=Oe(a,b);for(var e=0,g=!1,f=b,h=[],k=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1,fa--;f=t+f;d>>=8}d=q(c,0,!0)+" "+c+". "+sa(c,0,!0)+" "+("0b"+f);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e} -function Se(a,b){if(b)return Re(a,b,a.W[b]);var c=0;for(b in a.W)Re(a,b,a.W[b]),c++;return 0>2:0)}0>c?c=b.replace(/^0+([0-9A-F]+)$/i,"$1"):c=b;return c}var Qe={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; -function Te(a){Ke.call(this,a);this.wa=!1;this.la=!0;this.va=Y();this.L=Y(0);this.ja=Y(0);this.ba=Y(0);this.F=[];this.b=this.M=this.I=[];Ue(this);this.R=this.ka=0;this.f=[];this.sa=void 0;Ve(this);this.D=this;this.ma={};this.X=this.ob=0;this.S=null;this.O=[];We(this,a.messages);this.ua=a.commands;this.N=0;this.Ba=this.ta=null;this.B=this.ya=this.xa=this.ia=this.ra=0;this.ea=this.aa=null;var b=this;window?void 0===window[x]&&(window[x]=function(a){return gd(b,a)}):void 0===global[x]&&(global[x]=function(a){return gd(b, -a)})}p(Te,Ke);function Xe(a){a=a&&a.C;null==a&&(a=-1);return a}function Y(a,b,c){return{C:void 0===a?null:a,Pa:void 0===b?!1:b,fa:!1,ca:c}}function Ye(a,b,c,d){a.C=b;a.Pa=c||!1;a.fa=!1;a.ca=d}function Ze(a){return[a.C,a.Pa,a.fa,a.ca,a.Sa]}function $e(a,b){var c=Y(b[0],b[1],b[2]);c.fa=b[3];b[4]&&(c.mb=Le(a,c.Sa=b[4]));return c}l=Te.prototype; -l.za=function(a,b,c,d){this.H=b;this.G=a;this.v=c;this.ea=a.u;(a=bd(a,"messages"))&&We(this,a);af(this,function(a){a:{var b=d.H.b,c=a[0],e=a=0,k=b.length;if(c){a=Xe(bf(d,c,d.ja));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.H.f;k=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- --------- ------ ------ ----");for(var c=-1,m=0;k--;){var n=b[e];n.type==c?m++||d.j("..."):(c=n.type,m=Mc[c],n&&d.j(q(n.id,8)+" %"+q(e<d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d>23&&a.v.ta==b&&(b=td(a.v,1)));if(0d&&(d=a.v.g(b)),0<=d&&(Ye(a.f[a.R],b),++a.R==a.f.length&&(a.R=0)));return!1} -function vf(a,b,c,d){var e=Y(b.C),g=a.Aa(b,1),f,h,k,m=0,n=g/Wb|0,t;for(t in wf)if(f=wf[t][n&t]){h=+t;n>>=6;switch(h){case 32512:k=xf;m=n&3;break;case 32256:k=dg;m=n&7;break;case 29248:k=fg,m=(n&48)>>2|(n&6)>>1}break}k=k&&k[m]||"";"S"==k&&f>gg&&(k="B");k=hg[f||0]+k;if(f){if(28700==h)m=g/Xb&127,h=Q(a,m,-1);else if(m=g>>23&15,h=Q(a,m,-1),f==ig&&(f=jg[m]))k=hg[f],h="";k=Ba(k,8)+(h?h+",":"");g&4194304&&(k+="@");k+=Q(a,g&262143,-1);(g=g>>18&15)&&(k+="("+Q(a,g,-1)+")")}else k=Ba(k,8)+df(g);g=k;f="";h=Z(a, -e)+":";if(-1!==e.C&&-1!==b.C){do if(k=a.Aa(e,1),f+=" "+df(k),null==e.C)break;while(e.C!=b.C)}h+=Ba(f,16)+g;c&&(h=Ba(h,48)+";"+(c||""),h=a.v.w.Ea?h+("cycles="+hd(a.v).toString()+" cs="+q(a.v.va)):h+(null!=d?"="+d.toString():""));return h}function Ue(a){var b,c;a.b=["bp"];if(a.M)for(b=1;b>>d.f],!1)}a.M=["br"];if(a.I)for(b=1;b>>d.f],!0);a.I=["bw"];a.ra=0;a.ka=0} -l.Da=function(a,b,c){var d=!0;c||kg(this,a,b,!1,!0);if(a!=this.b){var e=Xe(b);if(-1===e)this.j("invalid address: "+Z(this,b)),d=!1;else{var g=this.H;g.b[e>>>g.f].Da(e&16383,a==this.I)}}d&&(a.push(b),c?b.fa=!0:(lg(this,a,a.length-1,"set"),Ve(this)));return d};function kg(a,b,c,d,e){var g=!1;c=Xe(c);for(var f=1;f>>d.f],b==a.I));h.fa||Ve(a);break}}return g} -function mg(a,b){for(var c=1;cd;d++){!d||d&3||(c+="\n");var e=a,g=sa(d,2);Ye(e.va,d);g+="="+Q(e,e.Aa(e.va),36)+" ";c+=g}if(b){b="";for(d=0;d=jf?1:d==gf?23:18)+" "),b+=e;c+="\n"+b}return c}l.pb=function(a,b){return a[0]>b[0]?1:a[0]>>0,f],t=Ia(n,k,a.pb);0>t&&n.splice(-(t+1),0,k)}m&&(h.a=m.replace(/''/g,'"'))}a.F.push({dd:b,C:c,Db:d,T:e,nb:g})}function pg(a,b,c){var d=[],e=Xe(b)>>>0;for(b=0;b>>0,h=g.Db;if(e>=f&&eb){a.j("unknown register: "+g);return}var g=0,h=a.v;switch(b){case ff:h.A= -f%A;Ye(a.L,h.A);break;case jf:g=65536;break;case kf:g=32768;break;case lf:g=131072;break;case mf:g=32;break;case nf:g=262144}g&&(h.u=f?h.u|g:h.u&~g);P(a.G);a.j("updated registers:")}}a.j(og(a,e));c&&(Ye(a.L,d.A),tf(a,Z(a,a.L)))}}function tg(a,b){b=Ha(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.j(m)}h[3]&&(f=h[3],g=null);h=a.ba;m=b;h.C=m.C;h.Pa=m.Pa;h.fa=m.fa;h.ca=m.ca;a.j(vf(a,b,f,g));e-=b.C-k;c++}}} -function ng(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(rf+b):(a.P&&(a.j("ended assemble at "+Z(a,a.ba)),a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Kb(a)&&0n||"z"gg&&(Gd="B");if(Dd== -hg[rb]+Gd){Af=29248!=wc?Ua:(Ua&3)<<1|(Ua&12)<<2;B=(Fd|Af<<6)*Wb;break}}if(0<=B)break}if(0<=B)break}if(0<=B)if(vc)for(var Hd=vc.split(","),Va=0;VaL||127L||15L||262143L||15ha.length&&(a.j("note: only "+ha.length+" available"),X=ha.length);ca-=X;0>ca&&(null==ha[ha.length-1].C?(X=ca+X,ca=0):ca+=ha.length);var Md=[];"call"==Gf&&(tb=1E5,Md=["CALL"]);for(void 0!==Ff&& -a.j(X+" instructions earlier:");0=ha.length&&(ca=0);a.sa=X;If++;tb--}}If||(a.j("no "+Hf+"history available"),a.sa=void 0)}else{var ab=bf(a,ga,a.ja);if(ab){var Da=0,Lf="ds"==Ya;if(ta){if("l"==ta.charAt(0))ta=ta.substr(1)||Yg,Da=Pe(a,ta);else{var Mf=bf(a,ta);Mf&&(Da=Mf.C-ab.C)}0>Da&&(Da=0);65536Qf;Qf++)Of+=String.fromCharCode((yc%64|0)+32),yc/=64}Ea&&(Ea+="\n");Ea=Lf?Ea+(Fa+","):Ea+(ga+": "+Fa+(0>Pf?" "+Of:""))}Ea&&a.j(Ea);a.ca=$g}}}}break;case "e":if("else"==f[0])break;var Rf,Sf,Tf=f[0],Pd=f[1];"e"==Tf||"ew"==Tf?(Rf=a.Aa,Sf=a.hb):Pd=null;if(null== -Pd)a.j("edit memory commands:"),a.j("\tew [a] [...] edit words at address a");else{var zc=bf(a,Pd,a.ja);if(zc)for(var Ac=2;AcTd;){for(var Ga=null,dh=256;65536>wb.C>>>0;){Ud.C=a.Aa(wb,2);if(null==wb.C||!dh--)break;if(!(Ud.C&1)){for(var eh=a,Bc=Ud,Vf=null,xb=Bc.C,Wf=xb, -Vd=1;6>=Vd&&xb;Vd++){if(2bg)a.j("step commands:"),a.j("\tp\tstep over instruction"),a.j("\tpr\tstep over instruction with register update");else if(a.N)a.j("step in progress"); -else{var cg=Y(a.v.A);a.Aa(cg);a.N?(a.Da(a.b,cg,!0),pf(a)||(a.G&&ld(a.G),a.N=0)):ug(a,bg?"tr":"t")}break;case "r":if("reset"==b){a.G&&a.G.reset();break}sf(a,f);break;case "s":a:switch(f[1]){case "base":if(f[2]){var zb=+f[2];if(8==zb||10==zb||16==zb)a.ca=zb;else{a.j("invalid base: "+zb);break}}a.j("default base: "+a.ca);break;case "cs":var Ab;void 0!==f[3]&&(Ab=+f[3]);switch(f[2]){case "int":a.v.ia=Ab;break;case "start":a.v.wa=Ab;break;case "stop":a.v.ka=Ab;break;default:a.j("unknown cs option");break a}void 0!== -Ab&&dd(a.v);a.j("checksums "+(a.v.w.Ea?"enabled":"disabled"));break;case "sp":void 0!==f[2]&&(id(a.v,+f[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.v.aa.toFixed(2)+"Mhz")+" ("+a.v.ba+"x)");break;default:if(f[1]){a.j("unknown option: "+f[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"), -a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":ug(a,f[0],f[1]);break;case "u":tf(a,f[1],f[2],8);break;case "v":if("var"==f[0]){rg(a,b.substr(3))||(d=!1);break}if("ver"==f[0]){a.j((Pb||"PDP10")+" version 1.34.2 ("+a.v.kb+",RELEASE)");a.j(window?window.navigator.userAgent:"");break}g=!0;break;case "?":if(f[1]){tg(a,b.substr(1));break}var Wd="commands:",Xd;for(Xd in wg)Wd+="\n"+Ba(Xd,9)+wg[Xd];ud(a)||(Wd+="\nnote: history disabled if no exec breakpoints");a.j(Wd);break;default:g=!0}g&&(a.j("unknown command: "+ -b),d=!1)}}catch(eg){a.j("debugger error: "+(eg.stack||eg.message)),d=!1}return d}function gd(a,b,c){b=Le(a,b,c);for(var d in b)if(!ng(a,b[+d]))return!1;return!0} -var wg={"?":"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"},gg=20,ig=85,hg=".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 JOV JCRY0 JCRY1 JCRY JFOV".split(" "), -ff=0,gf=1,hf=2,jf=3,kf=4,lf=5,mf=6,nf=7,ef="PC RA EA C0 C1 OV ND PD".split(" "),xg={},wf=(xg[28672]={0:101},xg[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:ig,11136:83,11264:91,11328:23,11392:24,11456:92,11520:86,11584:87,11648:89,11712:90},xg[32512]={6144:65,6400:59,6656:66,6912:60,7168:67,7424:61,7680:68,7936:62,8192:17,8448:18,8704:19,8960:gg,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},xg[32256]={12288:71,12800:72,13312:73,13824:74,14336:75,14848:76,15360:77,15872:78},xg[29248]={24576:79,24640:80,25088:81,25152:82},xg[28700]={28672:93,28676:94,28680:95,28684:96,28688:97, -28692:98,28696:99,28700:100},xg),xf=["","I","M","S"],dg=" L E LE A GE N G".split(" "),fg="N NE NA NN Z ZE ZA ZN C CE CA CN O OE OA ON".split(" "),jg={8:102,4:103,2:104,6:105,1:106},of=1E3,rf=">> ";eb(function(){for(var a=y(document,x,"debugger"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;bBg){if(Cg(d,this.M)){this.B=new O(this,"1.34.2",Lg);Cg(this.B)&&(Mg(this,d),a=Ng,Og(this.B));this.B.set(Ig,Ja());Pg(this.B);var e=this.b&&!this.L;if(a==Jg||pb("Click OK to restore the previous "+Pb+" machine state, or CANCEL to reset the machine.")){if(c=Hg(d)){var g=d.get("code"),f=d.get("data");g&&("ok"==g?Cg(d,f):("error"==g&&"no machine state"!= -f?(this.da("Error: "+f),"unable to verify user"==f&&(Pa(Qg,""),this.f=null)):this.j(g+": "+f),Og(d),Cg(d)?(c=Hg(d),e=!0):c=!1))}e&&Fg(this,c?d:null)}else a==Ng&&d.clear()}else Fg(this);delete this.M;delete this.I}e=qb(this.id);for(g=0;ga[1];a=a[2];this.S=!0;this.w.U=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.v&&(Rg(this,this.v,b,c,a),P(this,-2),this.v.Z());this.P&&(Mg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.A=0}; -function Mg(a,b){if(pb("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;Ka("http://www.pcjs.org/api/v1/report",d,!0)}} -function vg(a,b,c){var d,e="none";if(a.A)return null;a.A--;var g=new O(a,"1.34.2"),f=new O(a,"1.34.2",Gg),h=Ja();f.set(Ig,h);g.set(Ig,h);g.set(Sg,"1.34.2");g.set(Tg,window?window.location.href:null);g.set(Ug,window?window.navigator.userAgent:"");a.v&&a.v.ga&&(c&&(b&&(a.v.w.Z=a.v.w.K),a.v.V()),d=a.v.ga(b,c),"object"===typeof d&&g.set(a.v.id,d),c&&(a.v.w.U=!1,!1===d&&(e=null)));for(var h=qb(a.id),k=0;k=d||30<=(c.Ua+=d))&&(e.textContent=c.w.K?c.W.toFixed(2)+"Mhz":"Stopped",c.Ua=0)}if(a.u&&(a=a.u,b=b||0,a.M)){c=a.v.w.K;d=!!(a.v.B&8);if(0>=b||60<=(a.L+=b)){e=a.v.A;if(a.J.PC){var g=a.D&&a.D.ca||8,e=e||0,e=8==g?sa(e,void 0):q(e,void 0);a.J.PC.textContent!=e&&(a.J.PC.textContent=e)}a.L=0}-1>b?a.f=a.v.A:0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(f?' url="'+f+'"':"")));g||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1"+d+"$2"));f=null;if("<"==a.charAt(0))try{g||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(f=new window.ActiveXObject("Microsoft.XMLDOM"),f.async=!1,f.loadXML(a)):f=(new window.DOMParser).parseFromString(a,"text/xml")}catch(t){f=null,a=t.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ka(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);nh(a,b,c)}})}else c(a,null)} -function oh(a,b,c,d,e){function g(a){if(void 0===k){var b=h&&y(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=za(a))}function f(a){g("Error: "+a);m&&(--kh||ib(!0));m=!1}var h,k,m=!0;kh++;nb[b]={};try{if(h=document.getElementById(b)){var n;if("object"==typeof resources&&(n=resources.css)){var t=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));t.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?lh(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,--kh||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),--kh|| -ib(!0)):f("invalid machine element: "+b):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(a)}):f(e)};"<"!=c.charAt(0)?lh(c,b,a,e,!0,g,n):mh(c,null,b,a,e,!1,g,n)}else f("missing machine element: "+b)}catch(fa){f(fa.message)}return m}window.embedPDP10=function(a,b,c,d){ib(!1);return oh("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){ib(!1);return oh("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;na;a++)this.b["S"+a]=[0,0,!1,!1,this.Ob,a];this.D=this.v=this.H=this.G=null;this.exports={hold:this.Gb,toggle:this.Zb,reset:this.Vb, +set:this.Yb};Qb(this)}la(fc,r);l=fc.prototype;l.reset=function(a){this.stop();a&&hc(this,this.w=0)}; +l.ja=function(a,b,c,d){if(this.G&&this.G.ja(a,b,c,d)||this.v&&this.v.ja(a,b,c,d)||this.D&&this.D.ja(a,b,c,d))return!0;switch(b){case "PC":return this.J[b]=c,this.M++,!0;default:return"led"==a||"rled"==a?(this.J[b]=c,this.B[b]=d?1:0,this.M++,!0):"switch"==a?(void 0===this.b[b]&&(this.b[b]=[d?1:0,d?1:0]),this.J[b]=c,a=c.parentElement||c,a=a.parentElement||a,a.onmousedown=function(a,b){return function(){ic(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){jc(a,b)}}(this,b),a.ontouchstart= +function(a,b){return function(c){ic(a,b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){jc(a,b)}}(this,b),!0):r.prototype.ja.call(this,a,b,c,d)}};l.Ba=function(a,b,c,d){this.G=a;this.H=b;this.v=c;this.D=d;kc(this);lc(this)};l.ua=function(a,b){if(!b)if(this.T&&mc(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};l.ia=function(a){return a?this.save():!0};l.save=function(){var a=new E(this);a.set(0,[this.i,this.w,this.u]);return a.data()}; +l.restore=function(a){if(a=a[0])nc(this,this.i=a[0]),hc(this,this.w=a[1]),oc(this,a[2]);return!0};l.Vb=function(){for(var a in this.b){var b=this.b[a];b[1]=b[0]}lc(this);return!0};function pc(a,b,c){if(a=a.J[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function kc(a,b){for(var c in a.B)pc(a,c,null!=b?b:a.B[c])}function qc(a,b,c){if(a=a.J[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function lc(a){for(var b in a.b)qc(a,b,a.b[b][1])} +l.Gb=function(a,b,c){if(ic(this,b)){if(c){var d=this;setTimeout(function(){jc(d,b);a&&a()},+c);return!1}jc(this,b)}return!0};l.Yb=function(a,b){if("SR"==a)return oc(this,ta(b,8));var c=this.b[a];return c?(c[1]=+b?1:0,qc(this,a,c[1]),!0):!1};l.Zb=function(a){return ic(this,a)?(jc(this,a),!0):!1};function ic(a,b){var c=a.b[b];return c?(qc(a,b,c[1]=1-c[1]),c[3]=!0,c[4]&&c[4].call(a,c[1],c[5]),b!=rc&&(a.P=b==sc,a.R=b==tc),!0):!1} +function jc(a,b){var c=a.b[b];c&&(c[2]&&c[3]&&(qc(a,b,c[1]=c[0]),c[4]&&c[4].call(a,c[1],c[5])),c[3]=!1)}l.Pb=function(a){a||this.v.A.L||(F(this.v,this.i),this.b[uc]&&this.b[uc][1]&&vc(this.v))};l.Qb=function(){};l.Kb=function(a){a||this.v.W()}; +l.Ib=function(a){if(!a&&!this.v.A.L)if(this.b[uc]&&this.b[uc][1])vc(this.v);else{if((a=this.D)&&!Rb(a,!0))Sb(a,!0),wc(a,0,null),Sb(a,!1);else try{var b=this.v.Ma(1);0c;c++){var d=a,e="A"+c,f=b&1<c;c++){var d=a,e="D"+c,f=b&1<b;b++)a.b["S"+b][1]=a.u&1<d.length){for(var e=0,f=Array(4096),g=0;g>>a.i;0f&&(n=f);if(h&&h.size){if(h.type==d){if(e+f<=h.C)return h.Ka+=h.C-e,h.C=e,!0;if(e>=h.C+h.Ka){n=h.size-(e-k);n>f&&(n=f);h.Ka=e-h.C+n;e=k+16384;f-=n;g++;continue}}return Pc(Qc,e,f)}e=new Lc(a,e,n,16384,d);Mc(e,a.D,h);a.b[g++]=e;e=k+16384;f-=n}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Rc[d]+" at "+va(b)),!0):Pc(Sc,b,c)} +function Cc(a,b){var c=a.b[(b&a.u)>>>a.i];a.w++;b=c.D(b&16383,b);a.w--;return b}function Bc(a,b,c){var d=a.b[(b&a.u)>>>a.i];a.w++;d.w(c,b&16383,b);a.w--}function Nc(a){for(var b=0,c=[],d=0;d=a.la&&(a.la+=a.ka,c=!0);0<=a.ma&&a.ma<=md(a)&&(a.ka=a.ma=-1,id(a),a.W(),c=!0);c&&a.j(md(a)+" cycles: checksum="+m(a.za))}} +l.ja=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.J[b]=c,!0;case "run":return this.J[b]=c,c.onclick=function(){var a;if(a=d.G)if(a=d.G,a.A.V)a=!0;else{var b=null,c,h=ub(a.id);for(c=0;ca.aa/a.ba?b=1:d=!0;a.ea=b;b=a.Ya*a.ea;if(a.ba!=b){a.ba=b;b=a.ba.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.j("target speed: "+b)}c&&a.G&&qd(a.G)}yc(a,a.N);a.N=0;a.M=sb();a.P=0;od(a);return d}function rd(a,b){for(var c=a.O.length-1;0<=c;c--){var d=a.O[c];0>d[0]||b>d[0]&&(b=d[0])}return b}function sd(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function td(a,b){var c=a.R-=a.S;a.S=0;b&&(a.R=0);return c} +l.Wb=function(){if(this.A.L){this.Ra>=this.$a&&od(this,!0);this.na=0;this.ya=sb();if(this.P){var a=this.ya-this.P;a>this.Za&&(this.M+=a,this.M>this.ya&&(this.M=this.ya))}try{do{var b=rd(this,this.A.Fa?1:this.Ga);try{this.Ma(b)}catch(e){if("number"!=typeof e)throw e;}b=td(this,!0);this.na+=b;this.N+=b;zc(this,b);xc(this,b);this.fa-=b;if(0>=this.fa){this.fa+=this.Ga;++this.ab>=ud&&(this.G&&G(this.G,void 0),this.ab=0);break}}while(this.A.L)}catch(e){this.W();this.G&&this.G.stop(sb(),md(this));Nb(this, +e.stack||e.message);return}if(this.A.L){a=setTimeout;b=this.rb;this.P=sb();var c=this.Za;this.na&&(c=Math.round(c*this.na/this.Ga));var c=c-(this.P-this.ya),d=this.P-this.M;d&&(this.aa=Math.round(this.N/(10*d))/100,864E5<=d&&(this.T=0,nd(this)));if(0>c||this.aac&&(this.M-=c),c=0;this.Ra+=this.na;this.P+=c;a(b,c)}}}; +function vc(a,b){if(!Ob(a))if(a.A.L)a.j(a.toString()+" busy");else{nd(a);a.A.L=!0;a.A.Wa=!0;var c=a.J.run;c&&(c.textContent="Halt");a.G&&(b&&qd(a.G,!0),a.G.start(a.M,md(a)));a.D||a.status("Started");setTimeout(a.rb,0)}}l.Ma=function(){return 0};l.W=function(a){var b=!1;if(this.A.L){td(this);yc(this,this.N);this.N=0;this.A.L=!1;if(b=this.J.run)b.textContent="Run";this.G&&this.G.stop(sb(),md(this));b=!0;this.D||this.status("Stopped")}this.A.complete=a;return b};var pd=30,ud=15,fd=["power","reset"]; +function vd(a){var b=+a.model||1001;ed.call(this,a,1E6);this.qb=b;this.Oa=+a.addrReset||0;this.Cb=wd.bind(this);this.w=I.bind(this);this.wa=null;this.nb=[];this.A.complete=!1}la(vd,ed);l=vd.prototype;l.reset=function(){this.status("Model "+this.qb);this.A.L&&this.W();this.b=this.K=this.Ha=0;this.i=this.xa=this.Oa;this.I=this.qa=-1;this.F=this.u=0;this.bb=[0,0];this.oa=[0,0];this.ga=[0,0];this.pa=[0,0];this.va=this.i;this.B=0;this.f=this.Sb;this.g=this.cc;this.wa=null;hd(this);this.A.error=!1;ed.prototype.reset.call(this)}; +l.vb=function(){return 0};l.save=function(){var a=new E(this);a.set(0,[this.b,this.K,this.Ha,this.i,this.qa,this.I,this.u,this.B,this.xa,this.va,this.Oa]);a.set(1,[]);a.set(2,[this.T,this.ea,this.A.Z]);a.set(3,xd(this));a.set(4,sd(this));return a.data()}; +l.restore=function(a){var b;b=a[0];ha();da();ha();var c=b[Symbol.iterator];b=c?c.call(b):ia(b);this.b=b.next().value;this.K=b.next().value;this.Ha=b.next().value;this.i=b.next().value;this.qa=b.next().value;this.I=b.next().value;this.u=b.next().value;this.B=b.next().value;this.xa=b.next().value;this.va=b.next().value;this.Oa=b.next().value;b=a[2];this.T=b[0];nd(this,b[1]);this.A.Z=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>>b.i].f(a&16383,a)};l.cc=function(a,b){var c=this.H;a=this.va=a;c.b[(a&c.u)>>>c.i].g(b,a&16383,a);return b}; +l.Ma=function(a){this.A.complete=!0;var b=this.D?zd(this.D)?1:this.A.Wa?-1:0:0,c=a?this.A.Wa?0:1:-1;this.A.Wa=!1;this.R=this.S=a;this.B=this.B&-5|(b?4:0);do{if(this.B){if(this.B&4){if(Ad(this.D,this.i,c)){this.W();break}++b||(this.B&=-5);c||c++}if(a=this.B&11)this.B&2?this.wa||(this.B&=-3):this.B&1&&this.B++,a=!1;if(a){if(this.B&4&&Ad(this.D,this.i,c)){this.W();break}if(0>c)break}}this.B&=15;this.K&4194304?this.K=this.f(this.b):0<=this.qa?(this.K=this.Ha=this.f(this.qa),this.qa=-1):(this.K=this.Ha= +this.f(this.xa=this.i),this.i=(this.i+1)%Xb);this.K&=8388607;this.b=this.K&262143;if(a=this.K>>18&15)this.b=this.b+this.f(a)&Wb;a=this.K&4194304?-1:this.Ha/cc|0;0<=a&&this.Cb(a)}while(0>4].call(this,a,a&15)}function M(a){this.w(a)} +function Cd(){var a=0,b=this.f(this.b),c=b/dc&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*dc+(d<<24)+(b&16777215);a&&(b=(b+a)%C);this.g(this.b,b)}function Dd(a,b){a=this.f(this.b);if(0>this.I)this.I=a,this.K=this.b|4194304;else{var c=this.I/dc&63,d=this.I>>24&63;a=32>=c+d?(a>>c&(1<>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.g(b,a);this.I=-1}} +function Ed(a,b){a=this.f(this.b);if(0>this.I)this.I=a,this.K=this.b|4194304;else{var c=this.I/dc&63,d=this.I>>24&63;b=this.f(b)%Math.pow(2,d)*Math.pow(2,c)%C;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.g(this.b,a);this.I=-1}}function Fd(a,b){this.g(b,this.f(this.b))}function Gd(a,b){this.g(b,this.b)}function Hd(a,b){this.g(this.b,this.f(b))}function ce(a,b){this.g(b,0)}function de(a,b){this.g(b,B-this.f(b))}function ee(a,b){this.g(b,B)} +function fe(a,b){var c=this.f(this.b),d=this.f(b);this.g(b,ge(a,d,c)+(c-(c&x)))}function he(a,b){var c=this.f(b);this.g(b,ge(a,c,0))}function ie(a,b){b=this.f(b);var c=this.f(this.b);this.g(this.b,ge(a,c,b)+(b-(b&x)))}function je(a,b){var c=this.f(this.b),d=c;if(a&=384)switch(d-=d&x,a){case 256:d+=x;break;case 384:d+=c>z?x:0}c=d;this.g(this.b,c);b&&this.g(b,c)}function ke(a,b){var c=(this.f(this.b)&x)*y,d=this.f(b);this.g(b,ge(a,d,c)+c)} +function le(a,b){var c=this.b*y,d=this.f(b);this.g(b,ge(a,d,c)+c)}function me(a,b){b=(this.f(b)&x)*y;var c=this.f(this.b);this.g(this.b,ge(a,c,b)+b)}function ne(a,b){var c=this.f(this.b),d=(c&x)*y,c=ge(a,c,d)+d;this.g(this.b,c);b&&this.g(b,c)}function oe(a,b){var c=this.f(this.b)&x,d=this.f(b);this.g(b,pe(a,d,c)+c)}function qe(a,b){var c=this.f(b);this.g(b,pe(a,c,this.b)+this.b)}function re(a,b){b=this.f(b)&x;var c=this.f(this.b);this.g(this.b,pe(a,c,b)+b)} +function se(a,b){var c=this.f(this.b),d=c;if(a&=384)switch(d&=x,a){case 256:d+=x*y;break;case 384:d+=c>Yb?x*y:0}c=d;this.g(this.b,c);b&&this.g(b,c)}function te(a,b){var c=this.f(this.b)/y|0,d=this.f(b);this.g(b,pe(a,d,c)+c)}function ue(a,b){var c=this.f(b);this.g(b,pe(a,c,0))}function ve(a,b){b=this.f(b)/y|0;var c=this.f(this.b);this.g(this.b,pe(a,c,b)+b)}function we(a,b){var c=this.f(this.b),d=c/y|0,c=pe(a,c,d)+d;this.g(this.b,c);b&&this.g(b,c)}function N(a){xe[a&7].call(this,a,a>>3&127)} +function ye(){}function ze(){}function I(a){this.j("undefined opcode: "+va(a));yd(this,-1);this.W()}function Ae(a){a>z&&(a!=A?a=$b-a:this.u|=163840);return a}function O(a,b){var c=(a+b)%C;Be.call(this,a,b,c);return c} +function Ce(a,b,c){var d=!1,e=!1,f=b-b%A;a=a%A+b*A%C;b=this.F=f+Math.trunc(b/2);c>z&&(c=C-c,d=!d);b>z&&(a?(b=B-b,a=C-a):b&&(b=C-b),e=!0,d=!d);if(b>=c)return this.u|=131104,-1;f=this.bb;f[0]=0;f[1]=0;f=this.oa;f[0]=1;f[1]=0;f=this.ga;f[0]=c;f[1]=0;c=this.pa;c[0]=a;for(c[1]=b;0b[0]&&(b[0]+=C,b[1]--),Ee(this.bb,this.oa),Fe(this.pa)))break;Ge(this.ga);Ge(this.oa)}while(!Fe(this.oa)); +a=this.bb[0];this.F=this.pa[0];d&&a&&(a=C-a);e&&this.F&&(this.F=C-this.F);return a} +function He(a,b,c){var d=a,e=b;b=!1;var f;d>z&&(d=C-d,b=!b);e>z&&(e=C-e,b=!b);if(dz)&&(f!=B||a<=z)&&(this.u|=131072),a;c=a;b=f;a=b-b%A;b=2*b%C+Math.trunc(c/A);c=a+c%A;d=b-b%A;a!=d&&(b=a+(b-d),this.u|=131072);this.F=c;return b} +function Ie(a){a?a==A?this.u|=163840:a=$b-a:this.u|=98304;return a}function P(a,b){var c=a-b;0>c&&(c+=C);Be.call(this,c,b,a);return c}function Be(a,b,c){a=Math.trunc(a/Zb);b=Math.trunc(b/Zb);c=Math.trunc(c/Zb);var d=a^(a^b)&(b^c);this.u=this.u|(d&2?65536:0)|(d&1?32768:0)|((a^c)&(b^c)&2?131072:0)}function Q(a,b){return((a/D|0)&(b/D|0))*D+((a&b)>>>0)}function S(a,b){return Q(a,(~(b/D|0)&15)*D+(~b>>>0))}function Je(a,b){return(a>>0)}function T(a,b){return(a/D|0|b/D|0)*D+((a|b)>>>0)}function U(a){return a>>0)}function X(a){return(a/y|0)+(a&x)*y}function pe(a,b,c){switch(a&384){case 0:b-=b&x;break;case 128:b=0;break;case 256:b=x*y;break;case 384:b=c>Yb?x*y:0}return b}function ge(a,b,c){switch(a&384){case 0:b&=x;break;case 128:b=0;break;case 256:b=x;break;case 384:b=c>z?x:0}return b} +function Ee(a,b){a[0]+=b[0];a[1]+=b[1];a[0]>=C&&(a[0]%=C,a[1]++)}function De(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function Ge(a){a[1]%2&&(a[0]+=C);a[0]=Math.trunc(a[0]/2);a[1]=Math.trunc(a[1]/2)}function Fe(a){return!a[0]&&!a[1]} +var Bd=[M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,M,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},Cd,function(a,b){0>this.I&&Cd.call(this);Dd.call(this,0,b)},Dd,function(a,b){0>this.I&&Cd.call(this);Ed.call(this,0,b)},Ed,function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)}, +function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)}, +function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},function(a){this.w(a)},Fd,Gd,Hd,function(a,b){b&&this.g(b,this.f(this.b))},function(a,b){a=this.f(this.b);a=(a/y|0)+(a&x)*y;this.g(b,a)},function(a,b){this.g(b,this.b*y)},function(a,b){a=this.f(b);a=(a/y|0)+(a&x)*y;this.g(this.b,a)},function(a,b){a=this.f(this.b);a=(a/y|0)+(a&x)*y;this.g(this.b,a);b&&this.g(b,a)},function(a,b){this.g(b,Ie.call(this,this.f(this.b)))},function(a,b){this.g(b,Ie.call(this,this.b))},function(a,b){this.g(this.b, +Ie.call(this,this.f(b)))},function(a,b){a=Ie.call(this,this.f(this.b));this.g(this.b,a);b&&this.g(b,a)},function(a,b){this.g(b,Ae.call(this,this.f(this.b)))},function(a,b){this.g(b,this.b)},function(a,b){this.g(this.b,Ae.call(this,this.f(b)))},function(a,b){a=Ae.call(this,this.f(this.b));this.g(this.b,a);b&&this.g(b,a)},function(a,b){this.g(b,He.call(this,this.f(b),this.f(this.b),!0))},function(a,b){this.g(b,He.call(this,this.f(b),this.b,!0))},function(a,b){this.g(this.b,He.call(this,this.f(b),this.f(this.b), +!0))},function(a,b){this.g(this.b,this.g(b,He.call(this,this.f(b),this.f(this.b),!0)))},function(a,b){this.g(b,He.call(this,this.f(b),this.f(this.b)));this.g(b+1&15,this.F)},function(a,b){this.g(b,He.call(this,this.f(b),this.b));this.g(b+1&15,this.F)},function(a,b){this.g(this.b,He.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(this.b,this.g(b,He.call(this,this.f(b),this.f(this.b))));this.g(b+1&15,this.F)},function(a,b){a=Ce.call(this,this.f(b),0,this.f(this.b));0>a||(this.g(b,a),this.g(b+ +1&15,this.F))},function(a,b){a=Ce.call(this,this.f(b),0,this.b);0>a||(this.g(b,a),this.g(b+1&15,this.F))},function(a,b){a=Ce.call(this,this.f(b),0,this.f(this.b));0>a||this.g(this.b,a)},function(a,b){a=Ce.call(this,this.f(b),0,this.f(this.b));0>a||this.g(this.b,a)},function(a,b){a=this.f(b);var c=this.f(b+1&15),c=Ce.call(this,c,a,this.f(this.b));0>c||(this.g(b,c),this.g(b+1&15,this.F))},function(a,b){a=this.f(b);var c=this.f(b+1&15),c=Ce.call(this,c,a,this.b);0>c||(this.g(b,c),this.g(b+1&15,this.F))}, +function(a,b){a=this.f(b);b=this.f(b+1&15);b=Ce.call(this,b,a,this.f(this.b));0>b||this.g(this.b,b)},function(a,b){a=this.f(b);var c=this.f(b+1&15),c=Ce.call(this,c,a,this.f(this.b));0>c||(this.g(b,this.g(this.b,c)),this.g(b+1&15,this.F))},function(a,b){var c=(this.b<<14>>14)%256;if(c){a=this.f(b);var d=a>z?-(C-a):a;0d?A:0,c=z):(d=d*Math.pow(2,c)%A,c=A-Math.pow(2,35-c)),a<=z?a+c>z&&(this.u|=131072):a-c<=z&&(this.u|=131072)):d=-35>=c?0>d?-1:0:Math.trunc(d/Math.pow(2,-c));a=0>d?d+C:d; +this.g(b,a)}},function(a,b){if(a=(this.b<<14>>14)%36){var c=this.f(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%C+Math.trunc(c/Math.pow(2,36-a));this.g(b,c)}},function(a,b){if(a=(this.b<<14>>14)%256){var c=this.f(b),c=0=a?0:Math.trunc(c/Math.pow(2,-a));this.g(b,c)}},function(a,b){a=0;var c=this.f(b);if(c){for(;c>14)%256){var c,d=this.f(b),e=this.f(b+1&15);if(0z&& +dz&&ez&&(this.u|=131072):e-c<=z&&(this.u|=131072);e=0;f>z&&(d+=A,e+=A)}else d=d*Math.pow(2,a)%A+Math.trunc(e%A/Math.pow(2,35-a)),e=e*Math.pow(2,a)%A,c=A-Math.pow(2,35-a),f<=z?f+c>z&&(this.u|=131072):(f-c<=z&&(this.u|=131072),d+=A,e+=A)}else-36>=a?(e=-72>=a?d>z?B:0:Math.trunc(d%A/Math.pow(2,-a-35)),d<=z?d=0:(d=B,e+=A)):(c=d>z?C-Math.pow(2,36+a):0,e=Math.trunc(e%A/Math.pow(2,-a))+ +d%A*Math.pow(2,35+a)%A,d=Math.trunc(d/Math.pow(2,-a))+c,d>z&&(e+=A));this.g(b,d);this.g(b+1&15,e)}},function(a,b){if(a=(this.b<<14>>14)%72){var c=this.f(b),d=this.f(b+1&15),e=c;0>a&&(a=72+a);36>a?(c=c*Math.pow(2,a)%C+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%C+Math.trunc(e/Math.pow(2,36-a))):(c=d*Math.pow(2,a-36)%C+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%C+Math.trunc(d/Math.pow(2,72-a)));this.g(b,c);this.g(b+1&15,d)}},function(a,b){if(a=(this.b<<14>>14)%256){var c=this.f(b),d=this.f(b+ +1&15);0=a?(d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36)),c=0):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%C,c=Math.trunc(c/Math.pow(2,-a)));this.g(b,c);this.g(b+1&15,d)}},I,function(a,b){a=this.f(b);this.g(b,this.f(this.b));this.g(this.b,a)},function(a,b){a=!1;for(var c=this.f(b),d=c/y|0,c=c&x;!a;)this.g(c,this.f(d)),c==this.b&&(a=!0),d=d+1&x,c=c+1&x,this.A.L||(this.g(b,d* +y+c),a||yd(this,-1),a=!0)},function(a,b){a=(this.f(b)+262145)%B;this.g(b,a);a=A&&F(this,this.b)},function(a){this.w(a)},function(a,b){a=b<<14;this.u&a&&(this.u&=~a,F(this,this.b))},function(){this.qa=this.b},I,function(a){this.w(a)},function(a,b){a=this.f(b);a+=262145;this.g(a&x,this.f(this.b));a>=C&&(a-=C);a/y|0||(this.u|=262144);this.g(b,a)},function(a,b){a=this.f(b);var c=this.f(a&x);this.g(this.b,c);this.b==b&&(a=c);a-=262145; +0>a&&(a+=C);(a/y|0)==x&&(this.u|=262144);this.g(b,a)},function(a){this.w(a)},function(){this.g(this.b,(this.u&x)*y+this.i);F(this,this.b+1)},function(a,b){this.g(b,(this.u&x)*y+this.i);F(this,this.b)},function(a){this.w(a)},function(a){this.w(a)},function(a,b){this.g(b,O.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(b,O.call(this,this.f(b),this.b))},function(a,b){this.g(this.b,O.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(this.b,this.g(b,O.call(this,this.f(b),this.f(this.b))))}, +function(a,b){this.g(b,P.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(b,P.call(this,this.f(b),this.b))},function(a,b){this.g(this.b,P.call(this,this.f(b),this.f(this.b)))},function(a,b){this.g(this.b,this.g(b,P.call(this,this.f(b),this.f(this.b))))},ye,function(a,b){0>Je(this.f(b),this.b)&&F(this,this.i+1)},function(a,b){Je(this.f(b),this.b)||F(this,this.i+1)},function(a,b){0>=Je(this.f(b),this.b)&&F(this,this.i+1)},function(){F(this,this.i+1)},function(a,b){0<=Je(this.f(b),this.b)&& +F(this,this.i+1)},function(a,b){Je(this.f(b),this.b)&&F(this,this.i+1)},function(a,b){0Je(this.f(b),this.f(this.b))&&F(this,this.i+1)},function(a,b){Je(this.f(b),this.f(this.b))||F(this,this.i+1)},function(a,b){0>=Je(this.f(b),this.f(this.b))&&F(this,this.i+1)},function(){F(this,this.i+1)},function(a,b){0<=Je(this.f(b),this.f(this.b))&&F(this,this.i+1)},function(a,b){Je(this.f(b),this.f(this.b))&&F(this,this.i+1)},function(a,b){0U(this.f(b))&&F(this,this.b)},function(a,b){U(this.f(b))||F(this,this.b)},function(a,b){0>=U(this.f(b))&&F(this,this.b)},function(){F(this,this.b)},function(a,b){0<=U(this.f(b))&&F(this,this.b)},function(a,b){U(this.f(b))&&F(this,this.b)},function(a,b){0U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.f(this.b);U(a)||F(this,this.i+ +1);b&&this.g(b,a)},function(a,b){a=this.f(this.b);0>=U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){F(this,this.i+1);b&&this.g(b,this.f(this.b))},function(a,b){a=this.f(this.b);0<=U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.f(this.b);U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.f(this.b);0U(a)&&F(this,this.b)},function(a, +b){a=this.g(b,O.call(this,this.f(b),1));U(a)||F(this,this.b)},function(a,b){a=this.g(b,O.call(this,this.f(b),1));0>=U(a)&&F(this,this.b)},function(a,b){this.g(b,O.call(this,this.f(b),1));F(this,this.b)},function(a,b){a=this.g(b,O.call(this,this.f(b),1));0<=U(a)&&F(this,this.b)},function(a,b){a=this.g(b,O.call(this,this.f(b),1));U(a)&&F(this,this.b)},function(a,b){a=this.g(b,O.call(this,this.f(b),1));0U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,O.call(this,this.f(this.b),1));U(a)||F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,O.call(this,this.f(this.b),1));0>=U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,O.call(this,this.f(this.b),1));F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,O.call(this,this.f(this.b),1));0<=U(a)&&F(this,this.i+1);b&&this.g(b,a)}, +function(a,b){a=this.g(this.b,O.call(this,this.f(this.b),1));U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,O.call(this,this.f(this.b),1));0U(a)&&F(this,this.b)},function(a,b){a=this.g(b,P.call(this,this.f(b),1));U(a)||F(this,this.b)},function(a,b){a=this.g(b,P.call(this,this.f(b),1));0>=U(a)&&F(this,this.b)},function(a,b){this.g(b,P.call(this, +this.f(b),1));F(this,this.b)},function(a,b){a=this.g(b,P.call(this,this.f(b),1));0<=U(a)&&F(this,this.b)},function(a,b){a=this.g(b,P.call(this,this.f(b),1));U(a)&&F(this,this.b)},function(a,b){a=this.g(b,P.call(this,this.f(b),1));0U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,P.call(this,this.f(this.b),1));U(a)||F(this, +this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,P.call(this,this.f(this.b),1));0>=U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,P.call(this,this.f(this.b),1));F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,P.call(this,this.f(this.b),1));0<=U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,P.call(this,this.f(this.b),1));U(a)&&F(this,this.i+1);b&&this.g(b,a)},function(a,b){a=this.g(this.b,P.call(this,this.f(this.b),1));0>>f.i;0>>= +f.i;0>>a.i;0g&&g>=-A&&(g+=C);for(var g=Math.trunc(Math.abs(g))%C,h=d;f--&&h=sa.kb&&c<=sa.Bb&&(b=c-(sa.kb-sa.xb));b&&(a.preventDefault&&a.preventDefault(),d.Ua(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==sa.zb&&(b=sa.yb);d.Ua(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.Ua(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};l.Ba=function(a,b,c,d){this.G=a;this.H=b;this.v=c;this.D=d;Qb(this)}; +l.wb=function(a){if(!this.b){var b=gd(this.G,"connection");if(b){var c=b.split("->");if(2==c.length){var d=Fa(c[0]);if(d!=this.Pa)return;c=Fa(c[1]);if(this.b=vb(c)){var e=this.b.exports;if(e){var f=e.connect;f&&f.call(this.b,this.u);if(this.B=e.receiveData){this.u=a;this.status("Connected "+this.Qa+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};l.ua=function(a,b){if(!b)if(this.wb(this.u),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +l.ia=function(a){return a?this.save():!0};l.reset=function(){};l.save=function(){var a=new E(this);a.set(0,[]);return a.data()};l.restore=function(){return!0};l.Ua=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0,c,d=0;da.w&&a.u.length&&(a.w=0);if(0>a.w||b!=a.u[a.w])a.u.splice(0,0,b),a.w=0;a.w--}else a.P?b="end":b=a.u[a.w+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(Fa(b.substring(c,f))),c=f+1}}return a} +function Ve(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} +function We(a,b,c){var d;if(b){b=Xe(a,b);for(var e=0,f=!1,g=b,h=[],k=[],n=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1,ma--;g=w+g;d>>=8}d=m(c,0,!0)+" "+c+". "+va(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.j((null!=b?b+": ":"")+d);return e} +function af(a,b){if(b)return $e(a,b,a.T[b]);var c=0;for(b in a.T)$e(a,b,a.T[b]),c++;return 0>2:0)}0>c?c=b.replace(/^0+([0-9A-F]+)$/i,"$1"):c=b;return c}var Ze={"||":0,"&&":1,"|":2,"^":3,"&":4,"!=":5,"==":5,">=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function bf(a){Te.call(this,a);this.xa=!1;this.la=!0;this.va=18;this.wa=Y();this.K=Y(0);this.ga=Y(0);this.ba=Y(0);this.F=[];this.b=this.M=this.I=[];cf(this);this.R=this.ka=0;this.i=[];this.oa=void 0;df(this);this.D=this;this.ma={};this.X=this.sb=0;this.S=null;this.O=[];ef(this,a.messages);this.qa=a.commands;this.N=0;this.Aa=this.pa=null;this.B=this.za=this.ya=this.fa=this.na=0;this.ea=this.aa=null;var b=this;window?void 0===window[u]&&(window[u]=function(a){return ld(b,a)}):void 0===global[u]&&(global[u]= +function(a){return ld(b,a)})}la(bf,Te);function ff(a){a=a&&a.C;null==a&&(a=-1);return a}function Y(a,b,c){return{C:void 0===a?null:a,Sa:void 0===b?!1:b,ha:!1,ca:c}}function gf(a,b,c,d){a.C=b;a.Sa=c||!1;a.ha=!1;a.ca=d}function hf(a){return[a.C,a.Sa,a.ha,a.ca,a.Va]}function jf(a,b){var c=Y(b[0],b[1],b[2]);c.ha=b[3];b[4]&&(c.ob=Ue(a,c.Va=b[4]));return c}l=bf.prototype; +l.Ba=function(a,b,c,d){this.H=b;this.G=a;this.v=c;this.ea=a.u;this.va=b.F;(a=gd(a,"messages"))&&ef(this,a);kf(this,function(a){a:{var b=d.H.b,c=a[0],e=a=0,k=b.length;if(c){a=ff(lf(d,c,d.ga));if(-1===a){d.j("invalid address: "+c);break a}e=a>>>d.H.i;k=1}d.j("blockid physical blockaddr used size type");d.j("-------- --------- --------- ------ ------ ----");for(var c=-1,n=0;k--;){var p=b[e];p.type==c?n++||d.j("..."):(c=p.type,n=Rc[c],p&&d.j(m(p.id,8)+" %"+m(e<a&&a>=-A&&(a+=C);return Math.trunc(Math.abs(a))%Math.pow(2,void 0===b?36:b)}function Z(a,b){return H(a,b.C)}function of(a){return va(a/Xb,6)+" "+va(a%Xb,6)} +function ef(a,b){a.D=a;a.X=a.sb=536870916;a.S=null;a.O=[];b=Ue(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in ec){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>23&&a.v.xa==b&&(b=yd(a.v,1)));if(0d&&(d=a.v.f(b)),0<=d&&(gf(a.i[a.R],b),++a.R==a.i.length&&(a.R=0)));return!1} +function Ff(a,b,c,d){var e=Y(b.C),f=a.Ca(b,1),g,h,k,n=0,p=f/ac|0,w;for(w in Gf)if(g=Gf[w][p&w]){h=+w;p>>=6;switch(h){case 32512:k=Hf;n=p&3;break;case 32256:k=ng;n=p&7;break;case 29248:k=pg,n=(p&48)>>2|(p&6)>>1}break}k=k&&k[n]||"";"S"==k&&g>qg&&(k="B");k=rg[g||0]+k;if(g){if(28700==h)n=f/bc&127,h=H(a,n,-1);else if(n=f>>23&15,h=H(a,n,-1),g==sg&&(g=tg[n]))k=rg[g],h="";k=Ea(k,8)+(h?h+",":"");f&4194304&&(k+="@");k+=H(a,f&262143,-1);(f=f>>18&15)&&(k+="("+H(a,f,-1)+")")}else k=Ea(k,8)+of(f);f=k;g="";h=Z(a, +e)+":";if(-1!==e.C&&-1!==b.C){do if(k=a.Ca(e,1),g+=" "+of(k),null==e.C)break;while(e.C!=b.C)}h+=Ea(g,16)+f;c&&(h=Ea(h,48)+";"+(c||""),h=a.v.A.Fa?h+("cycles="+md(a.v).toString()+" cs="+m(a.v.za)):h+(null!=d?"="+d.toString():""));return h}function cf(a){var b,c;a.b=["bp"];if(a.M)for(b=1;b>>d.i],!1)}a.M=["br"];if(a.I)for(b=1;b>>d.i],!0);a.I=["bw"];a.na=0;a.ka=0} +l.Ea=function(a,b,c){var d=!0;c||ug(this,a,b,!1,!0);if(a!=this.b){var e=ff(b);if(-1===e)this.j("invalid address: "+Z(this,b)),d=!1;else{var f=this.H;f.b[e>>>f.i].Ea(e&16383,a==this.I)}}d&&(a.push(b),c?b.ha=!0:(vg(this,a,a.length-1,"set"),df(this)));return d};function ug(a,b,c,d,e){var f=!1;c=ff(c);for(var g=1;g>>d.i],b==a.I));h.ha||df(a);break}}return f} +function wg(a,b){for(var c=1;cd;d++){!d||d&3||(c+="\n");var e=a,f=va(d,2);gf(e.wa,d);f+="="+H(e,e.Ca(e.wa),36)+" ";c+=f}if(b){b="";for(d=0;d=tf?1:d==rf?23:18)+" "),b+=e;c+="\n"+b}return c}l.tb=function(a,b){return a[0]>b[0]?1:a[0]>>0,g],w=Ga(p,k,a.tb);0>w&&p.splice(-(w+1),0,k)}n&&(h.a=n.replace(/''/g,'"'))}a.F.push({hd:b,C:c,Hb:d,U:e,pb:f})}function zg(a,b,c){var d=[],e=ff(b)>>>0;for(b=0;b>>0,h=f.Hb;if(e>=g&&eb){a.j("unknown register: "+f);return}var f=0,h=a.v;switch(b){case qf:F(h, +g);gf(a.K,h.i);break;case tf:f=65536;break;case uf:f=32768;break;case vf:f=131072;break;case wf:f=32;break;case xf:f=262144}f&&(h.u=g?h.u|f:h.u&~f);G(a.G);a.j("updated registers:")}}a.j(yg(a,e));c&&(gf(a.K,d.i),Df(a,Z(a,a.K)))}}function Dg(a,b){b=Fa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1h[0].indexOf("+"))){var n=h[0]+":";h[2]&&(n+=" "+h[2]);a.j(n)}h[3]&&(g=h[3],f=null);h=a.ba;n=b;h.C=n.C;h.Sa=n.Sa;h.ha=n.ha;h.ca=n.ca;a.j(Ff(a,b,g,f));e-=b.C-k;c++}}} +function xg(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.j(Bf+b):(a.P&&(a.j("ended assemble at "+Z(a,a.ba)),a.P=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.S=null;if(Pb(a)&&0p||"z"qg&&(Ld="B");if(Id== +rg[Bb]+Ld){Kf=29248!=Ec?cb:(cb&3)<<1|(cb&12)<<2;J=(Kd|Kf<<6)*ac;break}}if(0<=J)break}if(0<=J)break}if(0<=J)if(Dc)for(var Md=Dc.split(","),db=0;dbR||127R||15R||262143R||15oa.length&&(a.j("note: only "+oa.length+" available"),fa=oa.length);ja-=fa;0>ja&&(null==oa[oa.length-1].C?(fa=ja+fa,ja=0):ja+=oa.length);var Rd=[];"call"==Qf&&(Db=1E5,Rd=["CALL"]);for(void 0!== +Pf&&a.j(fa+" instructions earlier:");0=oa.length&&(ja=0);a.oa=fa;Sf++;Db--}}Sf||(a.j("no "+Rf+"history available"),a.oa=void 0)}else{var jb=lf(a,na,a.ga);if(jb){var La=0,Vf="ds"==gb;if(Ba){if("l"==Ba.charAt(0))Ba=Ba.substr(1)||hh,La=Ye(a,Ba);else{var Wf=lf(a,Ba);Wf&&(La=Wf.C-jb.C)}0>La&&(La=0);65536$f;$f++)Yf+=String.fromCharCode((Gc%64|0)+32),Gc/=64}Ma&&(Ma+="\n");Ma=Vf?Ma+(Na+","):Ma+(na+": "+Na+(0>Zf?" "+Yf:""))}Ma&&a.j(Ma);a.ca=jh}}}}break;case "e":if("else"==g[0])break;var ag,bg,cg=g[0],Ud=g[1];"e"==cg||"ew"==cg?(ag=a.Ca,bg=a.mb):Ud=null; +if(null==Ud)a.j("edit memory commands:"),a.j("\tew [a] [...] edit words at address a");else{var Hc=lf(a,Ud,a.ga);if(Hc)for(var Vd=2;VdYd;){for(var Oa=null,nh=256;65536>Hb.C>>>0;){Zd.C=a.Ca(Hb,2);if(null==Hb.C||!nh--)break;if(!(Zd.C&1)){for(var oh=a,Ic=Zd,eg=null,Ib=Ic.C,fg=Ib,$d=1;6>=$d&&Ib;$d++){if(2< +$d){Ic.C=Ib;var Jc=Ff(oh,Ic);if(0<=Jc.indexOf("JSR")){var gg=Jc.indexOf(" ");if(Ib+(Jc.indexOf(" ",gg+1)-gg-1)/2==fg){eg=Jc;break}}}Ib-=2}Ic.C=fg;if(Oa=eg)break}}if(!Oa||null==Oa)break;var hg=null;if("ks"==mh){var ig=Oa.match(/[0-9A-F]+$/);ig&&(hg=Cg(a,ig[0]))}Oa=Ea(Oa,50)+" ;"+(hg||"stack="+Z(a,Hb));a.j(Oa);Yd++}Yd||a.j("no return addresses found")}break;case "l":if("ln"==g[0]){Cg(a,g[1],!0);break}f=!0;break;case "m":a:{var pa,qa=null,L=g[1];"?"==L&&(L=void 0);if(void 0!==L){var Ca=0;if("all"== +L)Ca=1879046143,L=null;else if("on"==L)qa=!0,L=null;else if("off"==L)qa=!1,L=null;else{"keys"==L&&(L="key");"kbd"==L&&(L="keyboard");for(pa in ec)if(L==pa){Ca=ec[pa];qa=!!(a.X&Ca);break}if(!Ca){a.j("unknown message category: "+L);break a}}if(Ca)if("on"==g[2])a.X|=Ca,qa=!0;else if("off"==g[2]&&(a.X&=~Ca,qa=!1,1073741824==Ca)){for(var jg=1E3<=a.O.length?a.O.length-1E3:0;jglg)a.j("step commands:"),a.j("\tp\tstep over instruction"),a.j("\tpr\tstep over instruction with register update");else if(a.N)a.j("step in progress"); +else{var mg=Y(a.v.i);a.Ca(mg);a.N?(a.Ea(a.b,mg,!0),zf(a)||(a.G&&qd(a.G),a.N=0)):Eg(a,lg?"tr":"t")}break;case "r":if("reset"==b){a.G&&a.G.reset();break}Cf(a,g);break;case "s":a:switch(g[1]){case "base":if(g[2]){var Kb=+g[2];if(8==Kb||10==Kb||16==Kb)a.ca=Kb;else{a.j("invalid base: "+Kb);break}}a.j("default base: "+a.ca);break;case "cs":var Lb;void 0!==g[3]&&(Lb=+g[3]);switch(g[2]){case "int":a.v.ka=Lb;break;case "start":a.v.Aa=Lb;break;case "stop":a.v.ma=Lb;break;default:a.j("unknown cs option");break a}void 0!== +Lb&&id(a.v);a.j("checksums "+(a.v.A.Fa?"enabled":"disabled"));break;case "sp":void 0!==g[2]&&(nd(a.v,+g[2])||a.j("warning: using 1x multiplier, previous target not reached"));a.j("target speed: "+(a.v.ba.toFixed(2)+"Mhz")+" ("+a.v.ea+"x)");break;default:if(g[1]){a.j("unknown option: "+g[1]);break}case "?":a.j("debugger options:"),a.j("\tbase #\t\tset default base to #"),a.j("\tcs int #\tset checksum cycle interval to #"),a.j("\tcs start #\tset checksum cycle start count to #"),a.j("\tcs stop #\tset checksum cycle stop count to #"), +a.j("\tsp #\t\tset speed multiplier to #")}break;case "t":Eg(a,g[0],g[1]);break;case "u":Df(a,g[1],g[2],8);break;case "v":if("var"==g[0]){Bg(a,b.substr(3))||(d=!1);break}if("ver"==g[0]){a.j((Vb||"PDP10")+" version 1.34.2 ("+a.v.qb+",RELEASE)");a.j(window?window.navigator.userAgent:"");break}f=!0;break;case "?":if(g[1]){Dg(a,b.substr(1));break}var ae="commands:",be;for(be in Gg)ae+="\n"+Ea(be,9)+Gg[be];zd(a)||(ae+="\nnote: history disabled if no exec breakpoints");a.j(ae);break;default:f=!0}f&&(a.j("unknown command: "+ +b),d=!1)}}catch(og){a.j("Debugger "+(og.stack||og.message)),d=!1}return d}function ld(a,b,c){b=Ue(a,b,c);for(var d in b)if(!xg(a,b[+d]))return!1;return!0} +var Gg={"?":"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"},qg=20,sg=85,rg=".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 CAM 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 JOV JCRY0 JCRY1 JCRY JFOV".split(" "), +qf=0,rf=1,sf=2,tf=3,uf=4,vf=5,wf=6,xf=7,pf="PC RA EA C0 C1 OV ND PD".split(" "),Hg={},Gf=(Hg[28672]={0:101},Hg[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:sg,11136:83,11264:91,11328:23,11392:24,11456:92,11520:86,11584:87,11648:89,11712:90},Hg[32512]={6144:65,6400:59,6656:66,6912:60,7168:67,7424:61,7680:68,7936:62,8192:17,8448:18,8704:19,8960:qg,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},Hg[32256]={12288:71,12800:72,13312:73,13824:74,14336:75,14848:76,15360:77,15872:78},Hg[29248]={24576:79,24640:80,25088:81,25152:82},Hg[28700]={28672:93,28676:94,28680:95,28684:96,28688:97, +28692:98,28696:99,28700:100},Hg),Hf=["","I","M","S"],ng=" L E LE A GE N G".split(" "),pg="N NE NA NN Z ZE ZA ZN C CE CA CN O OE OA ON".split(" "),tg={8:102,4:103,2:104,6:105,1:106},yf=1E3,Bf=">> ";Za(function(){for(var a=v(document,u,"debugger"),b=0;b\nLicense: GPL version 3 or later ");for(b=0;bLg){if(Mg(d,this.M)){this.B=new E(this,"1.34.2",Vg);Mg(this.B)&&(Wg(this,d),a=Xg,Yg(this.B));this.B.set(Sg,Ha());Zg(this.B);var e=this.b&&!this.K;if(a==Tg||tb("Click OK to restore the previous "+Vb+" machine state, or CANCEL to reset the machine.")){if(c=Rg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?Mg(d,g):("error"==f&&"no machine state"!= +g?(this.da("Error: "+g),"unable to verify user"==g&&(Sa($g,""),this.i=null)):this.j(f+": "+g),Yg(d),Mg(d)?(c=Rg(d),e=!0):c=!1))}e&&Pg(this,c?d:null)}else a==Xg&&d.clear()}else Pg(this);delete this.M;delete this.I}e=ub(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.A.V=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.v&&(ah(this,this.v,b,c,a),G(this,-2),this.v.Z());this.P&&(Wg(this,b),b.clear());!c&&this.B&&(this.B.clear(),delete this.B);this.w=0}; +function Wg(a,b){if(tb("There may be a problem with your "+Vb+" machine.\n\nTo help us diagnose it, click OK to send this "+Vb+" machine state to http://www.pcjs.org.")){var c=a.ba;a=a.i||"";b=b.toString();var d={};d.app=Vb;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;Ia("http://www.pcjs.org/api/v1/report",d,!0)}} +function Fg(a,b,c){var d,e="none";if(a.w)return null;a.w--;var f=new E(a,"1.34.2"),g=new E(a,"1.34.2",Qg),h=Ha();g.set(Sg,h);f.set(Sg,h);f.set(bh,"1.34.2");f.set(ch,window?window.location.href:null);f.set(dh,window?window.navigator.userAgent:"");a.v&&a.v.ia&&(c&&(b&&(a.v.A.Z=a.v.A.L),a.v.W()),d=a.v.ia(b,c),"object"===typeof d&&f.set(a.v.id,d),c&&(a.v.A.V=!1,!1===d&&(e=null)));for(var h=ub(a.id),k=0;k=d||30<=(c.Xa+=d))&&(e.textContent=c.A.L?c.aa.toFixed(2)+"Mhz":"Stopped",c.Xa=0)}if(a.u&&(a=a.u,b=b||0,a.M)){c=a.v.A.L;d=!!(a.v.B&8);if(0>=b||60<=(a.K+=b)){e=a.v.i;if(a.J.PC){var f=a.D&&a.D.ca||8,e=e||0,e=8==f?va(e,void 0):m(e,void 0);a.J.PC.textContent!=e&&(a.J.PC.textContent=e)}a.K=0}-1>b?a.i=a.v.i:0g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\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(w){g=null,a=w.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");Ia(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 k=h[0],n,p=/( [a-z]+=)(['"])(.*?)\2/g;n=p.exec(f);)k=0>k.indexOf(n[1])?k.replace(">",n[0]+">"):k.replace(new RegExp(n[1]+"(['\"])(.*?)\\1"),n[0]);h[0]!=k&&(g=g.replace(h[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);xh(a,b,c)}})}else c(a,null)} +function yh(a,b,c,d,e){function f(a){if(void 0===k){var b=h&&v(h,"machine-warning");k=b&&b[0]||h}k&&(k.innerHTML=Aa(a))}function g(a){f("Error: "+a);n&&(--uh||lb(!0));n=!1}var h,k,n=!0;uh++;rb[b]={};try{if(h=document.getElementById(b)){var p;if("object"==typeof resources&&(p=resources.css)){var w=document.head||document.getElementsByTagName("head")[0],K=document.createElement("style");K.type="text/css";K.styleSheet?K.styleSheet.cssText=p:K.appendChild(document.createTextNode(p));w.appendChild(K)}d|| +(p=a,"pdp"==a.substr(0,3)&&(p="pdpjs"),d="/versions/"+p+"/1.34.2/components.xsl");p=function(e,k){k?vh(d,null,a,null,!1,f,function(a,e){e?(qb(b,d,a),f("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=k.transformNode(e))?(h.outerHTML=e,--uh||lb(!0)):g("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),--uh|| +lb(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?vh(c,b,a,e,!0,f,p):wh(c,null,b,a,e,!1,f,p)}else g("missing machine element: "+b)}catch(ma){g(ma.message)}return n}window.embedPDP10=function(a,b,c,d){lb(!1);return yh("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){lb(!1);return yh("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return wb(b,a+".machine")}; +window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!zb[a]){for(var c=!0,d=zb,e=a,f=b.length,g=[],h=[],k="",n=null,p=0;pa?-b:b}});ha("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}}); -var q={Cb:0,Wa:1,Eb:2,Fb:3,Gb:4,Hb:5,Ib:6,Jb:7,Oa:8,Kb:9,Xa:10,Lb:11,Mb:12,Ya: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,Na: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,Za:127};function ia(a,b,c,d){var e="";if(null==a||isNaN(a))for(;0a&&-1=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e} -function ja(a,b){b?12"']/g,function(a){return qa[a]})}function ra(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var qa={"&":"&","<":"<",">":">",'"':""","'":"'"};function sa(){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 r(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 ta(a,b){var c,d={H:null,O: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>8&255;else if(e=g.longs)for(d.H=Array(4*e.length),f=c=0;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&&(t(d.H[0]),d=null):(t("Empty resource: "+a),d=null));d.O=g.symbols}catch(h){t("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca?-b:b}});ia("Math.log2",function(a){return a?a:function(a){return Math.log(a)/Math.LN2}}); +var n={Gb:0,Za:1,Ib:2,Jb:3,Kb:4,Lb:5,Mb:6,Nb:7,Ta:8,Ob:9,$a:10,Pb:11,Qb:12,ab:13,Rb:14,Sb:15,Tb:16,Ub:17,Vb:18,Wb:19,Xb:20,Yb:21,Zb:22,$b:23,ac:24,bc:25,cc: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,Sa:65,Fb:66,Hb:67,dc:68,E:69,ec:70,fc:71,gc:72,hc:73,ic:74,jc:75,kc:76,lc:77,mc:78,nc:79,oc:80,Q:81,pc:82,qc:83,rc:84,sc:85,tc:86,uc:87, +vc:88,wc:89,cb:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,xc:97,yc:98,zc:99,d:100,e:101,Ac:102,Bc:103,Cc:104,Dc:105,Ec:106,k:107,Fc:108,Gc:109,n:110,Hc:111,p:112,q:113,r:114,Ic:115,t:116,Jc:117,Kc:118,Lc:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,bb:127}; +function ja(a,b,c,d){var e="";isNaN(a)?a=null:null!=a&&(0>a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function ka(a,b){b?12"']/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 p(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 m="",u;for(u in b)b.hasOwnProperty(u)&&(m&&(m+="&"),m+=u+"="+encodeURIComponent(b[u]));m=m.replace(/%20/g,"+");h.open("POST",a,c);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.send(m)}else h.open("GET",a,c),"bytes"==b&&h.overrideMimeType("text/plain; charset=x-user-defined"),h.send();c||(f=h.responseText,200!=h.status&&(e=h.status||-1),d&&d(a,f,e),g=[f,e]);return g} +function ua(a,b){var c,d={H:null,O: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>8&255;else if(e=g.longs)for(d.H=Array(4*e.length),f=c=0;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&&(q(d.H[0]),d=null):(q("Empty resource: "+a),d=null));d.O=g.symbols}catch(h){q("Resource data error ("+a+"): "+h.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;ca?this.qa=this.id:(this.ra=this.id.substr(0,a),this.qa=this.id.substr(a+1));this.h={ready:!1,wa:!1,Ia:!1,D:!1,error:!1};this.ya=null;this.h.error=!1;this.w=this.i=this.s=this.u=this.ba=null;y.push(this)}function Ja(a,b,c){Ka[a]&&b&&(Ka[a][b]=c)}function La(){return Date.now()||+new Date} -function t(a){window&&window.alert(a)}function Ma(a){var b=!1;window&&(b=window.confirm(a));return b}function z(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba?this.ua=this.id:(this.va=this.id.substr(0,a),this.ua=this.id.substr(a+1));this.i={ready:!1,za:!1,Ma:!1,F:!1,error:!1};this.Ba=null;this.i.error=!1;this.w=this.j=this.s=this.v=this.fa=null;v.push(this)}function La(a,b,c){Ma[a]&&b&&(Ma[a][b]=c)}function Na(){return Date.now()||+new Date} +function q(a){window&&window.alert(a)}function Oa(a){var b=!1;window&&(b=window.confirm(a));return b}function w(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba;a++)this.a["S"+a]=[0,0,!1,!1,this.lb,a];this.w=this.i=this.s=this.u=null;this.exports={hold:this.eb,toggle:this.wb,reset:this.sb, -set:this.vb};G(this)}n(bb,w);k=bb.prototype;k.reset=function(a){this.stop();a&&db(this,this.j=0)}; -k.U=function(a,b,c,d){if(this.u&&this.u.U(a,b,c,d)||this.i&&this.i.U(a,b,c,d))return!0;switch(b){case "PC":return this.m[b]=c,this.C++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.l[b]=d?1:0,this.C++,!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(){eb(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){fb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){eb(a, -b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){fb(a,b)}}(this,b),!0):w.prototype.U.call(this,a,b,c,d)}};k.Z=function(a,b,c,d){this.u=a;this.s=b;this.i=c;this.w=d;gb(this);hb(this)};k.V=function(a,b){if(!b)if(this.P&&ib(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.R=function(a){return a?this.save():!0};k.save=function(){var a=new R(this);a.set(0,[this.b,this.j,this.g]);return a.data()}; -k.restore=function(a){if(a=a[0])jb(this,this.b=a[0]),db(this,this.j=a[1]),kb(this,a[2]);return!0};k.sb=function(){for(var a in this.a){var b=this.a[a];b[1]=b[0]}hb(this);return!0};function lb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function gb(a,b){for(var c in a.l)lb(a,c,null!=b?b:a.l[c])}function mb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function hb(a){for(var b in a.a)mb(a,b,a.a[b][1])} -k.eb=function(a,b,c){if(eb(this,b)){if(c){var d=this;setTimeout(function(){fb(d,b);a&&a()},+c);return!1}fb(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.b];a.j++;b=c.m(b&16383,b);a.j--;a=b}else a=this.i.c(this.b);db(this,this.j=a)}};k.kb=function(a){a||this.i.h.A||jb(this,this.g)};k.jb=function(a){a?(this.o=!0,gb(this,!0)):(this.o=!1,gb(this),kb(this,0))};k.lb=function(a,b){this.g=a?this.g|1<c;c++){var d=a,e="A"+c,f=b&1<c;c++){var d=a,e="D"+c,f=b&1<b;b++)a.a["S"+b][1]=a.g&1<d.length){for(var e=0,f=Array(4096),g=0;g>>a.b;0f&&(p=f);if(h&&h.size){if(h.type==d){if(e+f<=h.aa)return h.Aa+=h.aa-e,h.aa=e,!0;if(e>=h.aa+h.Aa){p=h.size-(e-l);p>f&&(p=f);h.Aa=e-h.aa+p;e=l+16384;f-=p;g++;continue}}return Bb(Cb,e,f)}e=new U(a,e,p,16384,d);yb(e,h);a.a[g++]=e;e=l+16384;f-=p}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Db[d]+" at "+ja(b)),!0):Bb(Eb,b,c)}function wb(a,b,c){var d=a.a[(b&a.g)>>>a.b];a.j++;d.g(c,b&16383,b);a.j--} -function zb(a){for(var b=0,c=[],d=0;d=a.X&&(a.X+=a.ja,c=!0);0<=a.ka&&a.ka<=Ub(a)&&(a.ja=a.ka=-1,Tb(a),S(a),c=!0);c&&a.M(Ub(a)+" cycles: checksum="+ka(a.sa))}} -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.h.D)a=!0;else{var b=null,c,h=z(a.id);for(c=0;ca.P/a.W&&(b=1);a.ca=b;b=a.Ea*a.ca;if(a.W!=b){a.W=b;b=a.W.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)))}tb(a,a.C);a.C=0;a.B=La();a.I=0;Wb(a)}function Yb(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function Zb(a,b){var c=a.K-=a.L;a.L=0;b&&(a.K=0);return c} -k.tb=function(){if(this.h.A){this.ua>=this.Ga&&Wb(this,!0);this.ea=0;this.ia=La();if(this.I){var a=this.ia-this.I;a>this.Fa&&(this.B+=a,this.B>this.ia&&(this.B=this.ia))}try{do{for(var b,c=this.h.xa?1:this.la,d=this.G.length-1;0<=d;d--){var e=this.G[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Ba(b)}catch(f){if("number"!=typeof f)throw f;}b=Zb(this,!0);this.ea+=b;this.C+=b;ub(this,b);sb(this,b);this.da-=b;if(0>=this.da){this.da+=this.la;++this.Ha>=$b&&(this.u&&T(this.u,void 0),this.Ha=0);break}}while(this.h.A)}catch(f){S(this); -this.u&&this.u.stop(La(),Ub(this));a=f.stack||f.message;this.h.error=!0;this.F(a);return}if(this.h.A){a=setTimeout;b=this.Ra;this.I=La();c=this.Fa;this.ea&&(c=Math.round(c*this.ea/this.la));c-=this.I-this.ia;if(d=this.I-this.B)this.P=Math.round(this.C/(10*d))/100,864E5<=d&&(this.N=0,Vb(this));if(0>c||this.Pc&&(this.B-=c),c=0;this.ua+=this.ea;this.I+=c;a(b,c)}}}; -function rb(a){var b;a.h.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.A)a.M(a.toString()+" busy");else{Vb(a);a.h.A=!0;a.h.La=!0;if(b=a.m.run)b.textContent="Halt";a.u&&a.u.start(a.B,Ub(a));a.w||a.status("Started");setTimeout(a.Ra,0)}}k.Ba=function(){return 0};function S(a){var b=!1;if(a.h.A){Zb(a);tb(a,a.C);a.C=0;a.h.A=!1;if(b=a.m.run)b.textContent="Run";a.u&&a.u.stop(La(),Ub(a));b=!0;a.w||a.status("Stopped")}a.h.complete=void 0;return b}var Xb=30,$b=15,Qb=["power","reset"]; -function ac(a){var b=+a.model||1001;Pb.call(this,a,1E6);this.$a=b;this.pa=+a.addrReset||0;this.bb=bc.bind(this);this.a=V.bind(this);this.ha=null;this.Pa=[];this.h.complete=!1}n(ac,Pb);k=ac.prototype;k.reset=function(){this.status("Model "+this.$a);this.h.A&&S(this);this.b=this.v=this.ma=0;this.j=this.Da=this.pa;this.o=this.fa=-1;this.va=this.g=0;this.ga=this.j;this.l=0;this.c=this.pb;this.f=this.Ab;this.ha=null;Sb(this);this.h.error=!1;Pb.prototype.reset.call(this)};k.Ta=function(){return 0}; -k.save=function(){var a=new R(this);a.set(0,[this.b,this.v,this.ma,this.j,this.fa,this.o,this.g,this.l,this.Da,this.ga,this.pa]);a.set(1,[]);a.set(2,[this.N,this.ca,this.h.J]);a.set(3,cc(this));a.set(4,Yb(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.v=b.next().value;this.ma=b.next().value;this.j=b.next().value;this.fa=b.next().value;this.o=b.next().value;this.g=b.next().value;this.l=b.next().value;this.Da=b.next().value;this.ga=b.next().value;this.pa=b.next().value;b=a[2];this.N=b[0];Vb(this,b[1]);this.h.J=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>>b.b].c(a&16383,a)};k.Ab=function(a,b){var c=this.s;a=this.ga=a;c.a[(a&c.g)>>>c.b].f(b,a&16383,a);return b}; -k.Ba=function(a){this.h.complete=!0;var b=a?this.h.La?0:1:-1;this.h.La=!1;this.K=this.L=a;this.l=this.l&-5|0;do{if(a=this.l)if(a=this.l&11)this.l&2?this.ha||(this.l&=-3):this.l&1&&this.l++,a=!1;if(a){if(this.l&4&&this.w.j(this.j,b)){S(this);break}if(0>b)break}this.l&=15;this.v&4194304?this.v=this.c(this.b):0<=this.fa?(this.v=this.ma=this.c(this.fa),this.fa=-1):(this.v=this.ma=this.c(this.Da=this.j),this.j=(this.j+1)%I);this.v&=8388607;this.b=this.v&262143;if(a=this.v>>18&15)this.b=this.b+this.c(a)& -Va;a=this.v&4194304?-1:this.ma/$a|0;0<=a&&this.bb(a)}while(0>4].call(this,a,a&15)}function W(a){this.a(a)}function fc(){var a=0,b=this.c(this.b),c=b/ab&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*ab+(d<<24)+(b&16777215);a&&(b=(b+a)%O);this.f(this.b,b)} -function gc(a,b){a=this.c(this.b);if(0>this.o)this.o=a,this.v=this.b|4194304;else{var c=this.o/ab&63,d=this.o>>24&63;a=32>=c+d?(a>>c&(1<>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.f(b,a);this.o=-1}}function hc(a,b){a=this.c(this.b);if(0>this.o)this.o=a,this.v=this.b|4194304,dc(this);else{var c=this.o/ab&63,d=this.o>>24&63;b=this.c(b)%Math.pow(2,d)*Math.pow(2,c)%O;a=a-a%Math.pow(2,c+d)+b+a%Math.pow(2,c);this.f(this.b,a);this.o=-1}}function ic(a,b){this.f(b,this.c(this.b))} -function jc(a,b){this.f(b,this.b)}function kc(a,b){this.f(this.b,this.c(b))}function lc(a,b){this.f(b,0)}function mc(a,b){this.f(b,N-this.c(b))}function nc(a,b){this.f(b,N)}function oc(a,b){var c=this.c(this.b),d=this.c(b);this.f(b,pc(a,d,c)+(c-(c&J)))}function qc(a,b){var c=this.c(b);this.f(b,pc(a,c,0))}function rc(a,b){b=this.c(b);var c=this.c(this.b);this.f(this.b,pc(a,c,b)+(b-(b&J)))} -function sc(a,b){var c=this.c(this.b),d=c;if(a&=384)switch(d-=d&J,a){case 256:d+=J;break;case 384:d+=c>P?J:0}c=d;this.f(this.b,c);b&&this.f(b,c)}function tc(a,b){var c=(this.c(this.b)&J)*K,d=this.c(b);this.f(b,pc(a,d,c)+c)}function uc(a,b){var c=this.b*K,d=this.c(b);this.f(b,pc(a,d,c)+c)}function vc(a,b){b=(this.c(b)&J)*K;var c=this.c(this.b);this.f(this.b,pc(a,c,b)+b)}function wc(a,b){var c=this.c(this.b),d=(c&J)*K,c=pc(a,c,d)+d;this.f(this.b,c);b&&this.f(b,c)} -function xc(a,b){var c=this.c(this.b)&J,d=this.c(b);this.f(b,yc(a,d,c)+c)}function zc(a,b){var c=this.c(b);this.f(b,yc(a,c,this.b)+this.b)}function Ac(a,b){b=this.c(b)&J;var c=this.c(this.b);this.f(this.b,yc(a,c,b)+b)}function Bc(a,b){var c=this.c(this.b),d=c;if(a&=384)switch(d&=J,a){case 256:d+=J*K;break;case 384:d+=c>Wa?J*K:0}c=d;this.f(this.b,c);b&&this.f(b,c)}function Cc(a,b){var c=this.c(this.b)/K|0,d=this.c(b);this.f(b,yc(a,d,c)+c)}function Dc(a,b){var c=this.c(b);this.f(b,yc(a,c,0))} -function Ec(a,b){b=this.c(b)/K|0;var c=this.c(this.b);this.f(this.b,yc(a,c,b)+b)}function Fc(a,b){var c=this.c(this.b),d=c/K|0,c=yc(a,c,d)+d;this.f(this.b,c);b&&this.f(b,c)}function X(a){Gc[a&7].call(this,a,a>>3&127)}function Hc(){}function V(a){this.M("undefined opcode: "+ja(a));dc(this);S(this)}function Ic(a){a>P&&(a!=Xa?a=Ya-a:this.g|=163840);return a}function Jc(a,b){var c=(a+b)%O;Kc.call(this,a,b,c);return c}function Y(a,b){return((a/Q|0)&(b/Q|0))*Q+((a&b)>>>0)} -function Lc(a,b){return((a/Q|0)^(b/Q|0))*Q+((a^b)>>>0)}function Mc(a,b){return(~((a/Q|0)^(b/Q|0))&15)*Q+(~(a^b)>>>0)}function Z(a,b){return(a/Q|0|b/Q|0)*Q+((a|b)>>>0)} -function Nc(a,b){var c=b;b=!1;var d;a>P&&(a=O-a,b=!b);c>P&&(c=O-c,b=!b);if(ac&&(c+=O);Kc.call(this,c,b,a);return c}function Kc(a,b,c){a=Math.trunc(a/Za);b=Math.trunc(b/Za);c=Math.trunc(c/Za);var d=a^(a^b)&(b^c);this.g=this.g|(d&2?65536:0)|(d&1?32768:0)|((a^c)&(b^c)&2?131072:0)}function yc(a,b,c){switch(a&384){case 0:b-=b&J;break;case 128:b=0;break;case 256:b=J*K;break;case 384:b=c>Wa?J*K:0}return b}function pc(a,b,c){switch(a&384){case 0:b&=J;break;case 128:b=0;break;case 256:b=J;break;case 384:b=c>P?J:0}return b} -var ec=[W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},fc,function(a,b){0>this.o&&fc.call(this);gc.call(this,0,b)},gc,function(a,b){0>this.o&&fc.call(this);hc.call(this,0,b)},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)},ic,jc,kc,function(a,b){b&&this.f(b,this.c(this.b))},function(a,b){a=this.c(this.b);a=(a/K|0)+a%K*K;this.f(b,a)},function(a,b){this.f(b,this.b*K)},function(a,b){a=this.c(b);a=(a/K|0)+a%K*K;this.f(this.b,a)},function(a,b){a=this.c(this.b);a=(a/K|0)+a%K*K;this.f(this.b,a);b&&this.f(b,a)},function(a,b){this.f(b,Oc.call(this,this.c(this.b)))},function(a,b){this.f(b,this.b?Ya-this.b:0)},function(a,b){this.f(this.b, -Oc.call(this,this.c(b)))},function(a,b){a=Oc.call(this,this.c(this.b));this.f(this.b,a);b&&this.f(b,a)},function(a,b){this.f(b,Ic.call(this,this.c(this.b)))},function(a,b){this.f(b,this.b)},function(a,b){this.f(this.b,Ic.call(this,this.c(b)))},function(a,b){a=Ic.call(this,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,b){this.f(b,Nc.call(this,this.c(b),this.c(this.b)));this.f(b+1&15,this.va)}, -function(a,b){this.f(b,Nc.call(this,this.c(b),this.b));this.f(b+1&15,this.va)},function(a,b){this.f(this.b,Nc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Nc.call(this,this.c(b),this.c(this.b))));this.f(b+1&15,this.va)},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>>14)%256;if(c){a=this.c(b);var d=a> -P?-(O-a):a;0d?M:0,c=L):(d=d*Math.pow(2,c)%M,c=M-Math.pow(2,35-c)),a<=P?a+c>P&&(this.g|=131072):a-c<=P&&(this.g|=131072)):d=-35>=c?0>d?-1:0:Math.trunc(d/Math.pow(2,-c));a=0>d?d+O:d;this.f(b,a)}},function(a,b){if(a=(this.b<<14>>14)%36){var c=this.c(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%O+Math.trunc(c/Math.pow(2,36-a));this.f(b,c)}},function(a,b){if(a=(this.b<<14>>14)%256){var c=this.c(b),c=0=a?0:Math.trunc(c/Math.pow(2,-a));this.f(b,c)}},function(a,b){a= -0;var c=this.c(b);if(c){for(;c>14)%256){var c,d=this.c(b),e=this.c(b+1&15);if(0L&&dL&&eP&&(this.g|=131072):e-c<=P&&(this.g|=131072);e=0;f>L&&(d+=M,e+=M)}else d=d*Math.pow(2,a)%M+Math.trunc(e%M/Math.pow(2,35-a)),e=e*Math.pow(2,a)%M,c=M-Math.pow(2,35-a),f<=P?f+c>P&& -(this.g|=131072):(f-c<=P&&(this.g|=131072),d+=M,e+=M)}else-36>=a?(e=-72>=a?d>L?N:0:Math.trunc(d%M/Math.pow(2,-a-35)),d<=L?d=0:(d=N,e+=M)):(c=d>L?O-Math.pow(2,36+a):0,e=Math.trunc(e%M/Math.pow(2,-a))+d%M*Math.pow(2,35+a)%M,d=Math.trunc(d/Math.pow(2,-a))+c,d>L&&(e+=M));this.f(b,d);this.f(b+1&15,e)}},function(a,b){if(a=(this.b<<14>>14)%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)%O+Math.trunc(d/Math.pow(2,36-a)),d=d*Math.pow(2,a)%O+Math.trunc(e/Math.pow(2,36-a))):(c= -d*Math.pow(2,a-36)%O+Math.trunc(c/Math.pow(2,72-a)),d=e*Math.pow(2,a-36)%O+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>>14)%256){var c=this.c(b),d=this.c(b+1&15);0=a?(d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36)),c=0):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%O,c=Math.trunc(c/Math.pow(2,-a)));this.f(b,c);this.f(b+1&15,d)}}, -V,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/K|0,c=c&J;!a;)this.f(c,this.c(d)),c==this.b&&(a=!0),d=d+1&J,c=c+1&J,this.h.A||(this.f(b,d*K+c),a||dc(this),a=!0)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a,b){a=b<<14;this.g&a&&(this.g&=~a,this.j=this.b%I)},function(){this.fa=this.b},V,function(a){this.a(a)},function(a,b){a=this.c(b);a+=262145;this.f(a&J,this.c(this.b));a>=O&&(a-=O);a/K|0||(this.g|= -262144);this.f(b,a)},function(a,b){a=this.c(b);var c=this.c(a&J);this.f(this.b,c);this.b==b&&(a=c);a-=262145;0>a&&(a+=O);(a/K|0)==J&&(this.g|=262144);this.f(b,a)},function(a){this.a(a)},function(a){this.a(a)},function(a,b){this.f(b,(this.g&J)*K+this.j);this.j=this.b%I},function(a){this.a(a)},function(a){this.a(a)},function(a,b){this.f(b,Jc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(b,Jc.call(this,this.c(b),this.b))},function(a,b){this.f(this.b,Jc.call(this,this.c(b),this.c(this.b)))}, -function(a,b){this.f(this.b,this.f(b,Jc.call(this,this.c(b),this.c(this.b))))},function(a,b){this.f(b,Pc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(b,Pc.call(this,this.c(b),this.b))},function(a,b){this.f(this.b,Pc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Pc.call(this,this.c(b),this.c(this.b))))},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)},lc,lc,function(){this.f(this.b,0)},function(a,b){this.f(this.b,this.f(b,0))},function(a,b){this.f(b,Y.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(b,Y.call(this,this.c(b),this.b))},function(a, -b){this.f(this.b,Y.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y.call(this,this.c(b),this.c(this.b))))},function(a,b){this.f(b,Y.call(this,N-this.c(b),this.c(this.b)))},function(a,b){this.f(b,Y.call(this,N-this.c(b),this.b))},function(a,b){this.f(this.b,Y.call(this,N-this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y.call(this,N-this.c(b),this.c(this.b))))},ic,jc,Hc,ic,function(a,b){this.f(b,Y.call(this,this.c(b),N-this.c(this.b)))},function(a,b){this.f(b, -Y.call(this,this.c(b),N-this.b))},function(a,b){this.f(this.b,Y.call(this,this.c(b),N-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y.call(this,this.c(b),N-this.c(this.b))))},Hc,Hc,kc,kc,function(a,b){this.f(b,Lc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(b,Lc.call(this,this.c(b),this.b))},function(a,b){this.f(this.b,Lc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Lc.call(this,this.c(b),this.c(this.b))))},function(a,b){this.f(b,Z.call(this,this.c(b), -this.c(this.b)))},function(a,b){this.f(b,Z.call(this,this.c(b),this.b))},function(a,b){this.f(this.b,Z.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z.call(this,this.c(b),this.c(this.b))))},function(a,b){this.f(b,Y.call(this,N-this.c(b),N-this.c(this.b)))},function(a,b){this.f(b,Y.call(this,N-this.c(b),N-this.b))},function(a,b){this.f(this.b,Y.call(this,N-this.c(b),N-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Y.call(this,N-this.c(b),N-this.c(this.b))))},function(a, -b){this.f(b,Mc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(b,Mc.call(this,this.c(b),this.b))},function(a,b){this.f(this.b,Mc.call(this,this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Mc.call(this,this.c(b),this.c(this.b))))},mc,mc,function(a,b){this.f(this.b,N-this.c(b))},function(a,b){this.f(this.b,this.f(b,N-this.c(b)))},function(a,b){this.f(b,Z.call(this,N-this.c(b),this.c(this.b)))},function(a,b){this.f(b,Z.call(this,N-this.c(b),this.b))},function(a,b){this.f(this.b, -Z.call(this,N-this.c(b),this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z.call(this,N-this.c(b),this.c(this.b))))},function(a,b){this.f(b,N-this.c(this.b))},function(a,b){this.f(b,N-this.b)},function(){this.f(this.b,N-this.c(this.b))},function(a,b){this.f(this.b,this.f(b,N-this.c(this.b)))},function(a,b){this.f(b,Z.call(this,this.c(b),N-this.c(this.b)))},function(a,b){this.f(b,Z.call(this,this.c(b),N-this.b))},function(a,b){this.f(this.b,Z.call(this,this.c(b),N-this.c(this.b)))},function(a, -b){this.f(this.b,this.f(b,Z.call(this,this.c(b),N-this.c(this.b))))},function(a,b){this.f(b,Z.call(this,N-this.c(b),N-this.c(this.b)))},function(a,b){this.f(b,Z.call(this,N-this.c(b),N-this.b))},function(a,b){this.f(this.b,Z.call(this,N-this.c(b),N-this.c(this.b)))},function(a,b){this.f(this.b,this.f(b,Z.call(this,N-this.c(b),N-this.c(this.b))))},nc,nc,function(){this.f(this.b,N)},function(a,b){this.f(this.b,this.f(b,N))},oc,qc,rc,sc,tc,uc,vc,wc,oc,qc,rc,sc,tc,uc,vc,wc,oc,qc,rc,sc,tc,uc,vc,wc,oc, -qc,rc,sc,tc,uc,vc,wc,xc,zc,Ac,Bc,Cc,Dc,Ec,Fc,xc,zc,Ac,Bc,Cc,Dc,Ec,Fc,xc,zc,Ac,Bc,Cc,Dc,Ec,Fc,xc,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)},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],Gc=[function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a){this.a(a)},function(a,b){switch(b){case 0:a=this.c(this.b);a&8&&(this.g&=-131073);a&131072&&(this.g&=-262145);break;default:this.a(a)}},function(a,b){switch(b){case 0:a=0;this.g&131072&&(a|=8);this.g&262144&&(a|=65536); -this.f(this.b,a);break;default:this.a(a)}},function(a){this.a(a)},function(a){this.a(a)}]; -function Qc(a){w.call(this,"ROM",a);this.O=this.a=null;this.l=+a.addr;this.g=+a.size;this.b=a.alias;"string"==typeof this.b&&(this.b=eval(this.b));this.j=a.file;this.o=la(this.j);if(this.j){a=this.j;var b=ma(this.o);"json"!=b&&"hex"!=b&&(a=oa()+"/api/v1/dump?file="+this.j+"&format=bytes&decimal=true");var c=this;r(a,null,!0,function(a,b,f){f?(c.F("Unable to load ROM resource (error "+f+": "+a+")"),c.j=null):(Ja(c.ra,a,b),(a=ta(a,b))?(c.a=a.H,c.O=a.O):c.j=null);Rc(c)})}}n(Qc,w); -Qc.prototype.Z=function(a,b,c,d){this.s=b;this.i=c;this.w=d;Rc(this)};Qc.prototype.V=function(){this.O&&(this.w&&this.w.a(this.id,this.l,this.g,this.O),delete this.O);return!0};Qc.prototype.R=function(){return!0}; -function Rc(a){if(!Ta(a)){if(a.j){if(!a.a||!a.s)return;a.g||(a.g=a.a.length);if(a.a.length!=a.g){var b="ROM size ("+ka(a.a.length,8,!0)+") does not match specified size ("+ka(a.g,8,!0)+")";a.h.error=!0;a.F(b)}else{b=a.l;if(Ab(a.s,b,a.g,Ib)){var c;for(c=0;c>>f.b;0>>=f.b;0>>a.b;0g&&g>=-Xa&&(g+=O);for(var g=Math.trunc(Math.abs(g))%O,h=d;f--&&h=q.Na&&c<=q.ab&&(b=c-(q.Na-q.Wa));b&&(a.preventDefault&&a.preventDefault(),d.za(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==q.Ya&&(b=q.Xa);d.za(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.za(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};k.Z=function(a,b,c,d){this.u=a;this.s=b;this.i=c;this.w=d;G(this)}; -k.Ua=function(a){if(!this.a){var b=Rb(this.u,"connection");if(b){var c=b.split("->");if(2==c.length){var d=ra(c[0]);if(d!=this.qa)return;c=ra(c[1]);if(this.a=Na(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.g);if(this.l=e.receiveData){this.g=a;this.status("Connected "+this.ra+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};k.V=function(a,b){if(!b)if(this.Ua(this.g),!a)this.reset();else if(!this.restore(a))return!1;return!0}; -k.R=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){var a=new R(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.za=function(a){if("number"==typeof a)this.b.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d\nLicense: GPL version 3 or later ");for(b=0;b$c){if(ad(d,this.C)){this.l=new R(this,"1.34.2",jd);ad(this.l)&&(kd(this,d),a=ld,md(this.l));this.l.set(gd,sa());nd(this.l);var e=this.a&&!this.B;if(a==hd||Ma("Click OK to restore the previous "+H+" machine state, or CANCEL to reset the machine.")){if(c=fd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ad(d,g):("error"==f&&"no machine state"!= -g?(this.F("Error: "+g),"unable to verify user"==g&&(ya(od,""),this.b=null)):this.M(f+": "+g),md(d),ad(d)?(c=fd(d),e=!0):c=!1))}e&&dd(this,c?d:null)}else a==ld&&d.clear()}else dd(this);delete this.C;delete this.v}e=z(this.id);for(f=0;fa[1];a=a[2];this.N=!0;this.h.D=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.i&&(pd(this,this.i,b,c,a),T(this,-2),this.i.J());this.K&&(kd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.j=0}; -function kd(a,b){if(Ma("There may be a problem with your "+H+" machine.\n\nTo help us diagnose it, click OK to send this "+H+" machine state to http://www.pcjs.org.")){var c=a.X;a=a.b||"";b=b.toString();var d={};d.app=H;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;r("http://www.pcjs.org/api/v1/report",d,!0)}} -function qd(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new R(a,"1.34.2"),g=new R(a,"1.34.2",ed),h=sa();g.set(gd,h);f.set(gd,h);f.set(rd,"1.34.2");f.set(sd,window?window.location.href:null);f.set(td,window?window.navigator.userAgent:"");a.i&&a.i.R&&(c&&(b&&(a.i.h.J=a.i.h.A),S(a.i)),d=a.i.R(b,c),"object"===typeof d&&f.set(a.i.id,d),c&&(a.i.h.D=!1,!1===d&&(e=null)));for(var h=z(a.id),l=0;l=d||30<=(c.Ca+=d))&&(e.textContent=c.h.A?c.P.toFixed(2)+"Mhz":"Stopped",c.Ca=0)}if(a.g&&(a=a.g,b=b||0,a.C)){c=a.i.h.A;d=!!(a.i.l&8);if(0>=b||60<=(a.B+=b)){e=a.i.j;if(a.m.PC){var f=a.w&&a.w.l||8,e=e||0,e=8==f?ja(e,void 0):ka(e,void 0);a.m.PC.textContent!=e&&(a.m.PC.textContent=e)}a.B=0}-1>b?a.b=a.i.j:0g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\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(A){g=null,a=A.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");r(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,x=/( [a-z]+=)(['"])(.*?)\2/g;p=x.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);Bd(a,b,c)}})}else c(a,null)} -function Cd(a,b,c,d,e){function f(a){if(void 0===l){var b=h&&F(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=pa(a))}function g(a){f("Error: "+a);p&&(--yd||Fa(!0));p=!1}var h,l,p=!0;yd++;Ka[b]={};try{if(h=document.getElementById(b)){var x;if("object"==typeof resources&&(x=resources.css)){var A=document.head||document.getElementsByTagName("head")[0],ua=document.createElement("style");ua.type="text/css";ua.styleSheet?ua.styleSheet.cssText=x:ua.appendChild(document.createTextNode(x));A.appendChild(ua)}d|| -(x=a,"pdp"==a.substr(0,3)&&(x="pdpjs"),d="/versions/"+x+"/1.34.2/components.xsl");x=function(e,l){l?zd(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,--yd||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),--yd|| -Fa(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?zd(c,b,a,e,!0,f,x):Ad(c,null,b,a,e,!1,f,x)}else g("missing machine element: "+b)}catch(Dd){g(Dd.message)}return p}window.embedPDP10=function(a,b,c,d){Fa(!1);return Cd("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){Fa(!1);return Cd("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return B(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,x=0;xa;a++)this.a["S"+a]=[0,0,!1,!1,this.pb,a];this.w=this.j=this.s=this.v=null;this.exports={hold:this.ib,toggle:this.Ab,reset:this.wb, +set:this.zb};B(this)}l(fb,t);k=fb.prototype;k.reset=function(a){this.stop();a&&hb(this,this.h=0)}; +k.U=function(a,b,c,d){if(this.v&&this.v.U(a,b,c,d)||this.j&&this.j.U(a,b,c,d))return!0;switch(b){case "PC":return this.m[b]=c,this.C++,!0;default:return"led"==a||"rled"==a?(this.m[b]=c,this.l[b]=d?1:0,this.C++,!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(){ib(a,b)}}(this,b),a.onmouseup=a.onmouseout=function(a,b){return function(){jb(a,b)}}(this,b),a.ontouchstart=function(a,b){return function(c){ib(a, +b);c.preventDefault()}}(this,b),a.ontouchend=function(a,b){return function(){jb(a,b)}}(this,b),!0):t.prototype.U.call(this,a,b,c,d)}};k.Z=function(a,b,c,d){this.v=a;this.s=b;this.j=c;this.w=d;kb(this);lb(this)};k.V=function(a,b){if(!b)if(this.P&&mb(),!a)this.reset(!0);else if(!this.restore(a))return!1;return!0};k.R=function(a){return a?this.save():!0};k.save=function(){var a=new L(this);a.set(0,[this.f,this.h,this.g]);return a.data()}; +k.restore=function(a){if(a=a[0])nb(this,this.f=a[0]),hb(this,this.h=a[1]),ob(this,a[2]);return!0};k.wb=function(){for(var a in this.a){var b=this.a[a];b[1]=b[0]}lb(this);return!0};function pb(a,b,c){if(a=a.m[b])a.style.backgroundColor=c?"#ff0000":"#000000"}function kb(a,b){for(var c in a.l)pb(a,c,null!=b?b:a.l[c])}function qb(a,b,c){if(a=a.m[b])a.style.marginTop=c?"0px":"20px",a.style.backgroundColor=c?"#00ff00":"#228B22"}function lb(a){for(var b in a.a)qb(a,b,a.a[b][1])} +k.ib=function(a,b,c){if(ib(this,b)){if(c){var d=this;setTimeout(function(){jb(d,b);a&&a()},+c);return!1}jb(this,b)}return!0}; +k.zb=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.f];a.h++;b=c.h(b&16383,b);a.h--;a=b}else a=this.j.b(this.f);hb(this,this.h=a)}};k.ob=function(a){a||this.j.i.B||nb(this,this.g)};k.nb=function(a){a?(this.o=!0,kb(this,!0)):(this.o=!1,kb(this),ob(this,0))};k.pb=function(a,b){this.g=a?this.g|1<c;c++){var d=a,e="A"+c,f=b&1<c;c++){var d=a,e="D"+c,f=b&1<b;b++)a.a["S"+b][1]=a.g&1<d.length){for(var e=0,f=Array(4096),g=0;g>>a.f;0f&&(u=f);if(h&&h.size){if(h.type==d){if(e+f<=h.ea)return h.Da+=h.ea-e,h.ea=e,!0;if(e>=h.ea+h.Da){u=h.size-(e-m);u>f&&(u=f);h.Da=e-h.ea+u;e=m+16384;f-=u;g++;continue}}return Hb(Ib,e,f)}e=new Db(a,e,u,16384,d);Eb(e,h);a.a[g++]=e;e=m+16384;f-=u}return 0>=f?(a.status("Added "+(c>>10)+"Kb "+Jb[d]+" at "+ka(b)),!0):Hb(Kb,b,c)} +function Bb(a,b,c){var d=a.a[(b&a.g)>>>a.f];a.h++;d.g(c,b&16383,b);a.h--}function Fb(a){for(var b=0,c=[],d=0;d=a.ha&&(a.ha+=a.na,c=!0);0<=a.oa&&a.oa<=$b(a)&&(a.na=a.oa=-1,Zb(a),N(a),c=!0);c&&a.M($b(a)+" cycles: checksum="+la(a.wa))}} +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.v)if(a=d.v,a.i.F)a=!0;else{var b=null,c,h=w(a.id);for(c=0;ca.W/a.ga&&(b=1);a.ia=b;b=a.Ha*a.ia;if(a.ga!=b){a.ga=b;b=a.ga.toFixed(2)+"Mhz";var d=a.m.setSpeed;d&&(d.textContent=b);a.M("target speed: "+b)}c&&a.v&&(c=a.v,c.fa&&(d=b=0,window&&(b=window.scrollX,d=window.scrollY),c.fa.focus(),window&&window.scrollTo(b,d)))}xb(a,a.D);a.D=0;a.C=Na();a.K=0;bc(a)}function dc(a){for(var b=[],c=0;cd[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}}function ec(a,b){var c=a.L-=a.N;a.N=0;b&&(a.L=0);return c} +k.xb=function(){if(this.i.B){this.ya>=this.Ja&&bc(this,!0);this.aa=0;this.ma=Na();if(this.K){var a=this.ma-this.K;a>this.Ia&&(this.C+=a,this.C>this.ma&&(this.C=this.ma))}try{do{for(var b,c=this.i.Aa?1:this.pa,d=this.I.length-1;0<=d;d--){var e=this.I[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.Ea(b)}catch(f){if("number"!=typeof f)throw f;}b=ec(this,!0);this.aa+=b;this.D+=b;yb(this,b);wb(this,b);this.ja-=b;if(0>=this.ja){this.ja+=this.pa;++this.Ka>=fc&&(this.v&&zb(this.v,void 0),this.Ka=0);break}}while(this.i.B)}catch(f){N(this); +this.v&&this.v.stop(Na(),$b(this));a=f.stack||f.message;this.i.error=!0;this.G(a);return}if(this.i.B){a=setTimeout;b=this.Va;this.K=Na();c=this.Ia;this.aa&&(c=Math.round(c*this.aa/this.pa));c-=this.K-this.ma;if(d=this.K-this.C)this.W=Math.round(this.D/(10*d))/100,864E5<=d&&(this.P=0,ac(this));if(0>c||this.Wc&&(this.C-=c),c=0;this.ya+=this.aa;this.K+=c;a(b,c)}}}; +function vb(a){var b;a.i.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.B)a.M(a.toString()+" busy");else{ac(a);a.i.B=!0;a.i.Pa=!0;if(b=a.m.run)b.textContent="Halt";a.v&&a.v.start(a.C,$b(a));a.w||a.status("Started");setTimeout(a.Va,0)}}k.Ea=function(){return 0};function N(a){var b=!1;if(a.i.B){ec(a);xb(a,a.D);a.D=0;a.i.B=!1;if(b=a.m.run)b.textContent="Run";a.v&&a.v.stop(Na(),$b(a));b=!0;a.w||a.status("Stopped")}a.i.complete=void 0;return b}var cc=30,fc=15,Wb=["power","reset"]; +function gc(a){var b=+a.model||1001;Vb.call(this,a,1E6);this.eb=b;this.ta=+a.addrReset||0;this.fb=hc.bind(this);this.g=O.bind(this);this.la=null;this.Ua=[];this.i.complete=!1}l(gc,Vb);k=gc.prototype;k.reset=function(){this.status("Model "+this.eb);this.i.B&&N(this);this.a=this.A=this.qa=0;this.f=this.Ga=this.ta;this.u=this.da=-1;this.o=this.h=0;this.La=[0,0];this.ba=[0,0];this.X=[0,0];this.ca=[0,0];this.ka=this.f;this.l=0;this.b=this.tb;this.c=this.Eb;this.la=null;Yb(this);this.i.error=!1;Vb.prototype.reset.call(this)}; +k.Xa=function(){return 0};k.save=function(){var a=new L(this);a.set(0,[this.a,this.A,this.qa,this.f,this.da,this.u,this.h,this.l,this.Ga,this.ka,this.ta]);a.set(1,[]);a.set(2,[this.P,this.ia,this.i.J]);a.set(3,ic(this));a.set(4,dc(this));return a.data()}; +k.restore=function(a){var b;b=a[0];fa();ca();fa();var c=b[Symbol.iterator];b=c?c.call(b):ga(b);this.a=b.next().value;this.A=b.next().value;this.qa=b.next().value;this.f=b.next().value;this.da=b.next().value;this.u=b.next().value;this.h=b.next().value;this.l=b.next().value;this.Ga=b.next().value;this.ka=b.next().value;this.ta=b.next().value;b=a[2];this.P=b[0];ac(this,b[1]);this.i.J=b[2];b=a[3];for(c=b.length-1;0<=c;c--){var d;a:{for(d=0;d>>b.f].b(a&16383,a)};k.Eb=function(a,b){var c=this.s;a=this.ka=a;c.a[(a&c.g)>>>c.f].c(b,a&16383,a);return b}; +k.Ea=function(a){this.i.complete=!0;var b=a?this.i.Pa?0:1:-1;this.i.Pa=!1;this.L=this.N=a;this.l=this.l&-5|0;do{if(a=this.l)if(a=this.l&11)this.l&2?this.la||(this.l&=-3):this.l&1&&this.l++,a=!1;if(a){if(this.l&4&&this.w.h(this.f,b)){N(this);break}if(0>b)break}this.l&=15;this.A&4194304?this.A=this.b(this.a):0<=this.da?(this.A=this.qa=this.b(this.da),this.da=-1):(this.A=this.qa=this.b(this.Ga=this.f),this.f=(this.f+1)%$a);this.A&=8388607;this.a=this.A&262143;if(a=this.A>>18&15)this.a=this.a+this.b(a)& +Za;a=this.A&4194304?-1:this.qa/db|0;0<=a&&this.fb(a)}while(0>4].call(this,a,a&15)}function P(a){this.g(a)}function kc(){var a=0,b=this.b(this.a),c=b/eb&63,d=b>>24&63,c=c-d;0>c&&(a++,c=36-d,0>c&&(c=64-d));b=c*eb+(d<<24)+(b&16777215);a&&(b=(b+a)%J);this.c(this.a,b)} +function lc(a,b){a=this.b(this.a);if(0>this.u)this.u=a,this.A=this.a|4194304;else{var c=this.u/eb&63,d=this.u>>24&63;a=32>=c+d?(a>>c&(1<>>0:Math.trunc(a/Math.pow(2,c))%Math.pow(2,d);this.c(b,a);this.u=-1}}function mc(a,b){a=this.b(this.a);if(0>this.u)this.u=a,this.A=this.a|4194304;else{var c=this.u/eb&63,d=this.u>>24&63;b=this.b(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.c(this.a,a);this.u=-1}}function nc(a,b){this.c(b,this.b(this.a))} +function oc(a,b){this.c(b,this.a)}function pc(a,b){this.c(this.a,this.b(b))}function qc(a,b){this.c(b,0)}function rc(a,b){this.c(b,H-this.b(b))}function sc(a,b){this.c(b,H)}function tc(a,b){var c=this.b(this.a),d=this.b(b);this.c(b,uc(a,d,c)+(c-(c&D)))}function vc(a,b){var c=this.b(b);this.c(b,uc(a,c,0))}function wc(a,b){b=this.b(b);var c=this.b(this.a);this.c(this.a,uc(a,c,b)+(b-(b&D)))} +function xc(a,b){var c=this.b(this.a),d=c;if(a&=384)switch(d-=d&D,a){case 256:d+=D;break;case 384:d+=c>F?D:0}c=d;this.c(this.a,c);b&&this.c(b,c)}function yc(a,b){var c=(this.b(this.a)&D)*E,d=this.b(b);this.c(b,uc(a,d,c)+c)}function zc(a,b){var c=this.a*E,d=this.b(b);this.c(b,uc(a,d,c)+c)}function Ac(a,b){b=(this.b(b)&D)*E;var c=this.b(this.a);this.c(this.a,uc(a,c,b)+b)}function Bc(a,b){var c=this.b(this.a),d=(c&D)*E,c=uc(a,c,d)+d;this.c(this.a,c);b&&this.c(b,c)} +function Cc(a,b){var c=this.b(this.a)&D,d=this.b(b);this.c(b,Dc(a,d,c)+c)}function Ec(a,b){var c=this.b(b);this.c(b,Dc(a,c,this.a)+this.a)}function Fc(a,b){b=this.b(b)&D;var c=this.b(this.a);this.c(this.a,Dc(a,c,b)+b)}function Gc(a,b){var c=this.b(this.a),d=c;if(a&=384)switch(d&=D,a){case 256:d+=D*E;break;case 384:d+=c>ab?D*E:0}c=d;this.c(this.a,c);b&&this.c(b,c)}function Hc(a,b){var c=this.b(this.a)/E|0,d=this.b(b);this.c(b,Dc(a,d,c)+c)}function Ic(a,b){var c=this.b(b);this.c(b,Dc(a,c,0))} +function Jc(a,b){b=this.b(b)/E|0;var c=this.b(this.a);this.c(this.a,Dc(a,c,b)+b)}function Kc(a,b){var c=this.b(this.a),d=c/E|0,c=Dc(a,c,d)+d;this.c(this.a,c);b&&this.c(b,c)}function Q(a){Lc[a&7].call(this,a,a>>3&127)}function Mc(){}function Nc(){}function O(a){this.M("undefined opcode: "+ka(a));this.f=(this.f+-1)%$a;N(this)}function Oc(a){a>F&&(a!=G?a=cb-a:this.h|=163840);return a}function R(a,b){var c=(a+b)%J;Pc.call(this,a,b,c);return c} +function Qc(a,b,c){var d=!1,e=!1,f=b-b%G;a=a%G+b*G%J;b=this.o=f+Math.trunc(b/2);c>F&&(c=J-c,d=!d);b>F&&(a?(b=H-b,a=J-a):b&&(b=J-b),e=!0,d=!d);if(b>=c)return this.h|=131104,-1;f=this.La;f[0]=0;f[1]=0;f=this.ba;f[0]=1;f[1]=0;f=this.X;f[0]=c;f[1]=0;c=this.ca;c[0]=a;for(c[1]=b;0b[0]&&(b[0]+=J,b[1]--),Sc(this.La,this.ba),Tc(this.ca)))break;Uc(this.X);Uc(this.ba)}while(!Tc(this.ba)); +a=this.La[0];this.o=this.ca[0];d&&a&&(a=J-a);e&&this.o&&(this.o=J-this.o);return a} +function Vc(a,b,c){var d=a,e=b;b=!1;var f;d>F&&(d=J-d,b=!b);e>F&&(e=J-e,b=!b);if(dF)&&(f!=H||a<=F)&&(this.h|=131072),a;c=a;b=f;a=b-b%G;b=2*b%J+Math.trunc(c/G);c=a+c%G;d=b-b%G;a!=d&&(b=a+(b-d),this.h|=131072);this.o=c;return b} +function Wc(a){a?a==G?this.h|=163840:a=cb-a:this.h|=98304;return a}function S(a,b){var c=a-b;0>c&&(c+=J);Pc.call(this,c,b,a);return c}function Pc(a,b,c){a=Math.trunc(a/bb);b=Math.trunc(b/bb);c=Math.trunc(c/bb);var d=a^(a^b)&(b^c);this.h=this.h|(d&2?65536:0)|(d&1?32768:0)|((a^c)&(b^c)&2?131072:0)}function T(a,b){return((a/K|0)&(b/K|0))*K+((a&b)>>>0)}function U(a,b){return T(a,(~(b/K|0)&15)*K+(~b>>>0))}function V(a,b){return(a>>0)}function W(a,b){return(a/K|0|b/K|0)*K+((a|b)>>>0)}function X(a){return a>>0)}function Z(a){return(a/E|0)+(a&D)*E}function Dc(a,b,c){switch(a&384){case 0:b-=b&D;break;case 128:b=0;break;case 256:b=D*E;break;case 384:b=c>ab?D*E:0}return b}function uc(a,b,c){switch(a&384){case 0:b&=D;break;case 128:b=0;break;case 256:b=D;break;case 384:b=c>F?D:0}return b} +function Sc(a,b){a[0]+=b[0];a[1]+=b[1];a[0]>=J&&(a[0]%=J,a[1]++)}function Rc(a,b){var c=a[1]-b[1];c||(c=a[0]-b[0]);return c}function Uc(a){a[1]%2&&(a[0]+=J);a[0]=Math.trunc(a[0]/2);a[1]=Math.trunc(a[1]/2)}function Tc(a){return!a[0]&&!a[1]} +var jc=[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,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.g(a)},function(a){this.g(a)},function(a){this.g(a)},kc,function(a,b){0>this.u&&kc.call(this);lc.call(this,0,b)},lc,function(a,b){0>this.u&&kc.call(this);mc.call(this,0,b)},mc,function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)}, +function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)}, +function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},function(a){this.g(a)},nc,oc,pc,function(a,b){b&&this.c(b,this.b(this.a))},function(a,b){a=this.b(this.a);a=(a/E|0)+(a&D)*E;this.c(b,a)},function(a,b){this.c(b,this.a*E)},function(a,b){a=this.b(b);a=(a/E|0)+(a&D)*E;this.c(this.a,a)},function(a,b){a=this.b(this.a);a=(a/E|0)+(a&D)*E;this.c(this.a,a);b&&this.c(b,a)},function(a,b){this.c(b,Wc.call(this,this.b(this.a)))},function(a,b){this.c(b,Wc.call(this,this.a))},function(a,b){this.c(this.a, +Wc.call(this,this.b(b)))},function(a,b){a=Wc.call(this,this.b(this.a));this.c(this.a,a);b&&this.c(b,a)},function(a,b){this.c(b,Oc.call(this,this.b(this.a)))},function(a,b){this.c(b,this.a)},function(a,b){this.c(this.a,Oc.call(this,this.b(b)))},function(a,b){a=Oc.call(this,this.b(this.a));this.c(this.a,a);b&&this.c(b,a)},function(a,b){this.c(b,Vc.call(this,this.b(b),this.b(this.a),!0))},function(a,b){this.c(b,Vc.call(this,this.b(b),this.a,!0))},function(a,b){this.c(this.a,Vc.call(this,this.b(b),this.b(this.a), +!0))},function(a,b){this.c(this.a,this.c(b,Vc.call(this,this.b(b),this.b(this.a),!0)))},function(a,b){this.c(b,Vc.call(this,this.b(b),this.b(this.a)));this.c(b+1&15,this.o)},function(a,b){this.c(b,Vc.call(this,this.b(b),this.a));this.c(b+1&15,this.o)},function(a,b){this.c(this.a,Vc.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(this.a,this.c(b,Vc.call(this,this.b(b),this.b(this.a))));this.c(b+1&15,this.o)},function(a,b){a=Qc.call(this,this.b(b),0,this.b(this.a));0>a||(this.c(b,a),this.c(b+ +1&15,this.o))},function(a,b){a=Qc.call(this,this.b(b),0,this.a);0>a||(this.c(b,a),this.c(b+1&15,this.o))},function(a,b){a=Qc.call(this,this.b(b),0,this.b(this.a));0>a||this.c(this.a,a)},function(a,b){a=Qc.call(this,this.b(b),0,this.b(this.a));0>a||this.c(this.a,a)},function(a,b){a=this.b(b);var c=this.b(b+1&15),c=Qc.call(this,c,a,this.b(this.a));0>c||(this.c(b,c),this.c(b+1&15,this.o))},function(a,b){a=this.b(b);var c=this.b(b+1&15),c=Qc.call(this,c,a,this.a);0>c||(this.c(b,c),this.c(b+1&15,this.o))}, +function(a,b){a=this.b(b);b=this.b(b+1&15);b=Qc.call(this,b,a,this.b(this.a));0>b||this.c(this.a,b)},function(a,b){a=this.b(b);var c=this.b(b+1&15),c=Qc.call(this,c,a,this.b(this.a));0>c||(this.c(b,this.c(this.a,c)),this.c(b+1&15,this.o))},function(a,b){var c=(this.a<<14>>14)%256;if(c){a=this.b(b);var d=a>F?-(J-a):a;0d?G:0,c=F):(d=d*Math.pow(2,c)%G,c=G-Math.pow(2,35-c)),a<=F?a+c>F&&(this.h|=131072):a-c<=F&&(this.h|=131072)):d=-35>=c?0>d?-1:0:Math.trunc(d/Math.pow(2,-c));a=0>d?d+J:d; +this.c(b,a)}},function(a,b){if(a=(this.a<<14>>14)%36){var c=this.b(b);0>a&&(a=36+a);c=c*Math.pow(2,a)%J+Math.trunc(c/Math.pow(2,36-a));this.c(b,c)}},function(a,b){if(a=(this.a<<14>>14)%256){var c=this.b(b),c=0=a?0:Math.trunc(c/Math.pow(2,-a));this.c(b,c)}},function(a,b){a=0;var c=this.b(b);if(c){for(;c>14)%256){var c,d=this.b(b),e=this.b(b+1&15);if(0F&& +dF&&eF&&(this.h|=131072):e-c<=F&&(this.h|=131072);e=0;f>F&&(d+=G,e+=G)}else d=d*Math.pow(2,a)%G+Math.trunc(e%G/Math.pow(2,35-a)),e=e*Math.pow(2,a)%G,c=G-Math.pow(2,35-a),f<=F?f+c>F&&(this.h|=131072):(f-c<=F&&(this.h|=131072),d+=G,e+=G)}else-36>=a?(e=-72>=a?d>F?H:0:Math.trunc(d%G/Math.pow(2,-a-35)),d<=F?d=0:(d=H,e+=G)):(c=d>F?J-Math.pow(2,36+a):0,e=Math.trunc(e%G/Math.pow(2,-a))+ +d%G*Math.pow(2,35+a)%G,d=Math.trunc(d/Math.pow(2,-a))+c,d>F&&(e+=G));this.c(b,d);this.c(b+1&15,e)}},function(a,b){if(a=(this.a<<14>>14)%72){var c=this.b(b),d=this.b(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.c(b,c);this.c(b+1&15,d)}},function(a,b){if(a=(this.a<<14>>14)%256){var c=this.b(b),d=this.b(b+ +1&15);0=a?(d=-72>=a?0:Math.trunc(c/Math.pow(2,-a-36)),c=0):(d=Math.trunc(d/Math.pow(2,-a))+c*Math.pow(2,36+a)%J,c=Math.trunc(c/Math.pow(2,-a)));this.c(b,c);this.c(b+1&15,d)}},O,function(a,b){a=this.b(b);this.c(b,this.b(this.a));this.c(this.a,a)},function(a,b){a=!1;for(var c=this.b(b),d=c/E|0,c=c&D;!a;)this.c(c,this.b(d)),c==this.a&&(a=!0),d=d+1&D,c=c+1&D,this.i.B||(this.c(b,d* +E+c),a||(this.f=(this.f+-1)%$a),a=!0)},function(a,b){a=(this.b(b)+262145)%H;this.c(b,a);a=G&&M(this,this.a)},function(a){this.g(a)},function(a,b){a=b<<14;this.h&a&&(this.h&=~a,M(this,this.a))},function(){this.da=this.a},O,function(a){this.g(a)},function(a,b){a=this.b(b);a+=262145;this.c(a&D,this.b(this.a));a>=J&&(a-=J);a/E|0||(this.h|=262144);this.c(b,a)},function(a,b){a=this.b(b);var c=this.b(a&D);this.c(this.a,c);this.a==b&& +(a=c);a-=262145;0>a&&(a+=J);(a/E|0)==D&&(this.h|=262144);this.c(b,a)},function(a){this.g(a)},function(){this.c(this.a,(this.h&D)*E+this.f);M(this,this.a+1)},function(a,b){this.c(b,(this.h&D)*E+this.f);M(this,this.a)},function(a){this.g(a)},function(a){this.g(a)},function(a,b){this.c(b,R.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(b,R.call(this,this.b(b),this.a))},function(a,b){this.c(this.a,R.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(this.a,this.c(b,R.call(this,this.b(b), +this.b(this.a))))},function(a,b){this.c(b,S.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(b,S.call(this,this.b(b),this.a))},function(a,b){this.c(this.a,S.call(this,this.b(b),this.b(this.a)))},function(a,b){this.c(this.a,this.c(b,S.call(this,this.b(b),this.b(this.a))))},Mc,function(a,b){0>V(this.b(b),this.a)&&M(this,this.f+1)},function(a,b){V(this.b(b),this.a)||M(this,this.f+1)},function(a,b){0>=V(this.b(b),this.a)&&M(this,this.f+1)},function(){M(this,this.f+1)},function(a,b){0<=V(this.b(b), +this.a)&&M(this,this.f+1)},function(a,b){V(this.b(b),this.a)&&M(this,this.f+1)},function(a,b){0V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(a,b){V(this.b(b),this.b(this.a))||M(this,this.f+1)},function(a,b){0>=V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(){M(this,this.f+1)},function(a,b){0<=V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(a,b){V(this.b(b),this.b(this.a))&&M(this,this.f+1)},function(a,b){0X(this.b(b))&&M(this,this.a)},function(a,b){X(this.b(b))||M(this,this.a)},function(a,b){0>=X(this.b(b))&&M(this,this.a)},function(){M(this,this.a)},function(a,b){0<=X(this.b(b))&&M(this,this.a)},function(a,b){X(this.b(b))&&M(this,this.a)},function(a,b){0X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.b(this.a);X(a)||M(this,this.f+ +1);b&&this.c(b,a)},function(a,b){a=this.b(this.a);0>=X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){M(this,this.f+1);b&&this.c(b,this.b(this.a))},function(a,b){a=this.b(this.a);0<=X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.b(this.a);X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.b(this.a);0X(a)&&M(this,this.a)},function(a, +b){a=this.c(b,R.call(this,this.b(b),1));X(a)||M(this,this.a)},function(a,b){a=this.c(b,R.call(this,this.b(b),1));0>=X(a)&&M(this,this.a)},function(a,b){this.c(b,R.call(this,this.b(b),1));M(this,this.a)},function(a,b){a=this.c(b,R.call(this,this.b(b),1));0<=X(a)&&M(this,this.a)},function(a,b){a=this.c(b,R.call(this,this.b(b),1));X(a)&&M(this,this.a)},function(a,b){a=this.c(b,R.call(this,this.b(b),1));0X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,R.call(this,this.b(this.a),1));X(a)||M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,R.call(this,this.b(this.a),1));0>=X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,R.call(this,this.b(this.a),1));M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,R.call(this,this.b(this.a),1));0<=X(a)&&M(this,this.f+1);b&&this.c(b,a)}, +function(a,b){a=this.c(this.a,R.call(this,this.b(this.a),1));X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,R.call(this,this.b(this.a),1));0X(a)&&M(this,this.a)},function(a,b){a=this.c(b,S.call(this,this.b(b),1));X(a)||M(this,this.a)},function(a,b){a=this.c(b,S.call(this,this.b(b),1));0>=X(a)&&M(this,this.a)},function(a,b){this.c(b,S.call(this, +this.b(b),1));M(this,this.a)},function(a,b){a=this.c(b,S.call(this,this.b(b),1));0<=X(a)&&M(this,this.a)},function(a,b){a=this.c(b,S.call(this,this.b(b),1));X(a)&&M(this,this.a)},function(a,b){a=this.c(b,S.call(this,this.b(b),1));0X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,S.call(this,this.b(this.a),1));X(a)||M(this, +this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,S.call(this,this.b(this.a),1));0>=X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,S.call(this,this.b(this.a),1));M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,S.call(this,this.b(this.a),1));0<=X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,S.call(this,this.b(this.a),1));X(a)&&M(this,this.f+1);b&&this.c(b,a)},function(a,b){a=this.c(this.a,S.call(this,this.b(this.a),1));0>>f.f;0>>=f.f;0>>a.f;0g&&g>=-G&&(g+=J);for(var g=Math.trunc(Math.abs(g))%J,h=d;f--&&h=n.Sa&&c<=n.cb&&(b=c-(n.Sa-n.Za));b&&(a.preventDefault&&a.preventDefault(),d.Ca(b));return!0},c.onkeypress=function(a){a=a||window.event;if(!a.metaKey){var b=a.which||a.keyCode;a.altKey&&b==n.ab&&(b=n.$a);d.Ca(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.Ca(a.getData("Text"))},c.removeAttribute("readonly"),!0}return!1};k.Z=function(a,b,c,d){this.v=a;this.s=b;this.j=c;this.w=d;B(this)}; +k.Ya=function(a){if(!this.a){var b=Xb(this.v,"connection");if(b){var c=b.split("->");if(2==c.length){var d=sa(c[0]);if(d!=this.ua)return;c=sa(c[1]);if(this.a=Pa(c)){var e=this.a.exports;if(e){var f=e.connect;f&&f.call(this.a,this.g);if(this.l=e.receiveData){this.g=a;this.status("Connected "+this.va+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};k.V=function(a,b){if(!b)if(this.Ya(this.g),!a)this.reset();else if(!this.restore(a))return!1;return!0}; +k.R=function(a){return a?this.save():!0};k.reset=function(){};k.save=function(){var a=new L(this);a.set(0,[]);return a.data()};k.restore=function(){return!0};k.Ca=function(a){if("number"==typeof a)this.f.push(a);else if("string"==typeof a)for(var b=0,c,d=0;d\nLicense: GPL version 3 or later ");for(b=0;bhd){if(id(d,this.C)){this.l=new L(this,"1.34.2",rd);id(this.l)&&(sd(this,d),a=td,ud(this.l));this.l.set(od,ta());vd(this.l);var e=this.a&&!this.A;if(a==pd||Oa("Click OK to restore the previous "+Ya+" machine state, or CANCEL to reset the machine.")){if(c=nd(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?id(d,g):("error"==f&&"no machine state"!= +g?(this.G("Error: "+g),"unable to verify user"==g&&(ya(wd,""),this.f=null)):this.M(f+": "+g),ud(d),id(d)?(c=nd(d),e=!0):c=!1))}e&&ld(this,c?d:null)}else a==td&&d.clear()}else ld(this);delete this.C;delete this.u}e=w(this.id);for(f=0;fa[1];a=a[2];this.N=!0;this.i.F=!0;var d=this.m.power;d&&(d.textContent="Shutdown");this.j&&(xd(this,this.j,b,c,a),zb(this,-2),this.j.J());this.K&&(sd(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.h=0}; +function sd(a,b){if(Oa("There may be a problem with your "+Ya+" machine.\n\nTo help us diagnose it, click OK to send this "+Ya+" machine state to http://www.pcjs.org.")){var c=a.X;a=a.f||"";b=b.toString();var d={};d.app=Ya;d.ver="1.34.2";d.url=c;d.user=a;d.type="bug";d.data=b;p("http://www.pcjs.org/api/v1/report",d,!0)}} +function yd(a,b,c){var d,e="none";if(a.h)return null;a.h--;var f=new L(a,"1.34.2"),g=new L(a,"1.34.2",md),h=ta();g.set(od,h);f.set(od,h);f.set(zd,"1.34.2");f.set(Ad,window?window.location.href:null);f.set(Bd,window?window.navigator.userAgent:"");a.j&&a.j.R&&(c&&(b&&(a.j.i.J=a.j.i.B),N(a.j)),d=a.j.R(b,c),"object"===typeof d&&f.set(a.j.id,d),c&&(a.j.i.F=!1,!1===d&&(e=null)));for(var h=w(a.id),m=0;m=d||30<=(c.Fa+=d))&&(e.textContent=c.i.B?c.W.toFixed(2)+"Mhz":"Stopped",c.Fa=0)}if(a.g&&(a=a.g,b=b||0,a.C)){c=a.j.i.B;d=!!(a.j.l&8);if(0>=b||60<=(a.A+=b)){e=a.j.f;if(a.m.PC){var f=a.w&&a.w.l||8,e=e||0,e=8==f?ka(e,void 0):la(e,void 0);a.m.PC.textContent!=e&&(a.m.PC.textContent=e)}a.A=0}-1>b?a.f=a.j.f:0g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/\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(I){g=null,a=I.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");p(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=h[0],u,C=/( [a-z]+=)(['"])(.*?)\2/g;u=C.exec(f);)m=0>m.indexOf(u[1])?m.replace(">",u[0]+">"):m.replace(new RegExp(u[1]+"(['\"])(.*?)\\1"),u[0]);h[0]!=m&&(g=g.replace(h[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Jd(a,b,c)}})}else c(a,null)} +function Kd(a,b,c,d,e){function f(a){if(void 0===m){var b=h&&A(h,"machine-warning");m=b&&b[0]||h}m&&(m.innerHTML=qa(a))}function g(a){f("Error: "+a);u&&(--Gd||Ha(!0));u=!1}var h,m,u=!0;Gd++;Ma[b]={};try{if(h=document.getElementById(b)){var C;if("object"==typeof resources&&(C=resources.css)){var I=document.head||document.getElementsByTagName("head")[0],Da=document.createElement("style");Da.type="text/css";Da.styleSheet?Da.styleSheet.cssText=C:Da.appendChild(document.createTextNode(C));I.appendChild(Da)}d|| +(C=a,"pdp"==a.substr(0,3)&&(C="pdpjs"),d="/versions/"+C+"/1.34.2/components.xsl");C=function(e,m){m?Hd(d,null,a,null,!1,f,function(a,e){e?(La(b,d,a),f("Processing "+c+"..."),window.ActiveXObject||"ActiveXObject"in window?(e=m.transformNode(e))?(h.outerHTML=e,--Gd||Ha(!0)):g("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(a=new XSLTProcessor,a.importStylesheet(e),(e=a.transformToFragment(m,document))?h.parentNode?(h.parentNode.replaceChild(e,h),--Gd|| +Ha(!0)):g("invalid machine element: "+b):g("transformToFragment failed")):g("unable to transform XML: unsupported browser")):g(a)}):g(e)};"<"!=c.charAt(0)?Hd(c,b,a,e,!0,f,C):Id(c,null,b,a,e,!1,f,C)}else g("missing machine element: "+b)}catch(Ld){g(Ld.message)}return u}window.embedPDP10=function(a,b,c,d){Ha(!1);return Kd("pdp10",a,b,c,d)};window.embedPDP11=function(a,b,c,d){Ha(!1);return Kd("pdp11",a,b,c,d)};window.findMachineComponent=function(a,b){return x(b,a+".machine")}; +window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==typeof b&&!Sa[a]){for(var c=!0,d=Sa,e=a,f=b.length,g=[],h=[],m="",u=null,C=0;C":62,"?":63,"@":64,Kd:65,wi:66,Ci:67,cj:68,E:69,ij:70,lj:71,xj:72,zj:73,Aj:74,Bj:75,Cj:76,Fj:77,Hj:78,Nj:79,Qj:80,Q:81,Sj:82,Vj:83,dk:84,fk:85,hk:86,ik:87,mk:88,nk:89,xf:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,pk:97,rk:98,uk:99,d:100,e:101,vk:102,wk:103,xk:104,yk:105,Ck:106,k:107,Dk:108,Ek:109,n:110,Fk:111,p:112,q:113,r:114,Gk:115,t:116,Jk:117,Kk:118,Lk:119,x:120, y:121,z:122,"{":123,"|":124,"}":125,"~":126,cc:127}; -function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function pa(a,b,c){var d="";b?32>=1,f--;return d} -function u(a,b,c){b?12"']/g,function(a){return xa[a]})}function ya(a,b){return(a+" ").slice(0,b)}function za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var xa={"&":"&","<":"<",">":">",'"':""","'":"'"},Aa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"};function Ba(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function ma(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e} +function pa(a,b,c){var d="";b?32>=1,f--;return d}function u(a,b,c){b?12"']/g,function(a){return xa[a]})}function ya(a,b){return(a+" ").slice(0,b)} +function za(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var xa={"&":"&","<":"<",">":">",'"':""","'":"'"},Aa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function Ba(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,k;k=c(b,a[g]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} function Ea(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 k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g} function Fa(a,b){var c,d={Z:null,ga:null,ya:null,xa: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.ya=g.load;d.xa=g.exec;if(e=g.bytes)d.Z=e;else if(e=g.words)for(d.Z=Array(2*e.length),f=c=0;c>8&255;else if(e=g.longs)for(d.Z=Array(4*e.length),f=c=0;c":62,"?":63,"@":64,jd:65,Lh:66,Rh:67,si:68,E:69,yi:70,Bi:71,Ni:72,Pi:73,Qi:74,Ri:75,Si:76,Vi:77,Xi:78,cj:79,fj:80,Q:81,hj:82,kj:83,tj:84,vj:85,xj:86,yj:87,Cj:88,Dj:89,Ke:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Ej:97,Gj:98,Jj:99,d:100,e:101,Kj:102,Lj:103,Mj:104,Nj:105,Rj:106,k:107,Sj:108,Tj:109,n:110,Uj:111,p:112,q:113,r:114,Vj:115,t:116,Xj:117,Yj:118,Zj:119,x:120, y:121,z:122,"{":123,"|":124,"}":125,"~":126,Cb:127}; -function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function pa(a,b){b?12"']/g,function(a){return va[a]})}function wa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var va={"&":"&","<":"<",">":">",'"':""","'":"'"},xa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; +function na(a,b){var c;if(a){b||(b=10);var d=a.charAt(0),e=0a&&-1a&&(a+=Math.pow(b,c)),0>a||a>=Math.pow(b,c))&&(a=null);if(null==a)for(;0=f?48:55),e=String.fromCharCode(f)+e;a=Math.trunc(a/b)}return(void 0===d?"":d)+e}function pa(a,b){b?12"']/g,function(a){return va[a]})} +function wa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var va={"&":"&","<":"<",">":">",'"':""","'":"'"},xa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",10:"LF",11:"VT",12:"FF",13:"CR",14:"SO",15:"SI",16:"DLE",17:"XON",18:"DC2",19:"XOFF",20:"DC4",21:"NAK",22:"SYN",23:"ETB",24:"CAN",25:"EM",26:"SUB",27:"ESC",28:"FS",29:"GS",30:"RS",31:"US"}; function ya(){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 za(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 k=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(k.onreadystatechange=function(){4===k.readyState&&(f=k.responseText,200==k.status||!k.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=k.status||-1),d&&d(a, f,e))});if(b&&"object"==typeof b){var l="",m;for(m in b)b.hasOwnProperty(m)&&(l&&(l+="&"),l+=m+"="+encodeURIComponent(b[m]));l=l.replace(/%20/g,"+");k.open("POST",a,c);k.setRequestHeader("Content-type","application/x-www-form-urlencoded");k.send(l)}else k.open("GET",a,c),"bytes"==b&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send();c||(f=k.responseText,200!=k.status&&(e=k.status||-1),d&&d(a,f,e),g=[f,e]);return g}