diff --git a/devices/pdp11/machine/1170/machine.xml b/devices/pdp11/machine/1170/machine.xml index a0926e60b..83ea462b4 100644 --- a/devices/pdp11/machine/1170/machine.xml +++ b/devices/pdp11/machine/1170/machine.xml @@ -9,6 +9,6 @@ - + diff --git a/devices/pdp11/machine/1170/test/machine.xml b/devices/pdp11/machine/1170/test/machine.xml index 8ceb0eef0..95333a243 100644 --- a/devices/pdp11/machine/1170/test/machine.xml +++ b/devices/pdp11/machine/1170/test/machine.xml @@ -9,6 +9,6 @@ - + diff --git a/devices/pdp11/panel/1170/led.xml b/devices/pdp11/panel/1170/led.xml new file mode 100644 index 000000000..1a3376b83 --- /dev/null +++ b/devices/pdp11/panel/1170/led.xml @@ -0,0 +1,119 @@ + + + Control Panel + + + ADDRESS + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + DATA + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + . + + + + + + + + Enter + Clear + + + + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + 0000 + + 0 + 0 + 0 + 0 + + + + Run + Step + Reset + Fast + + diff --git a/devices/pdp11/panel/1170/wide.xml b/devices/pdp11/panel/1170/test.xml similarity index 100% rename from devices/pdp11/panel/1170/wide.xml rename to devices/pdp11/panel/1170/test.xml diff --git a/devices/pdp11/rom/custom/boot.mac b/devices/pdp11/rom/custom/boot.mac index 05a03da70..65bf107bc 100644 --- a/devices/pdp11/rom/custom/boot.mac +++ b/devices/pdp11/rom/custom/boot.mac @@ -461,6 +461,7 @@ BOOTRP: ; 142460 TSTB (R1) ; WAIT BPL .-2 CLRB (R1) + MOV R3,R0 CLR PC .END START diff --git a/docs/pcx86/examples/components.css b/docs/pcx86/examples/components.css index 4a449ca97..f1782cf02 100644 --- a/docs/pcx86/examples/components.css +++ b/docs/pcx86/examples/components.css @@ -29,7 +29,7 @@ } .pcjs-label { font-size: small; - line-height: 19px; + line-height: 20px; vertical-align: middle; float: left; font-family: Monaco, "Lucida Console", monospace; @@ -47,14 +47,14 @@ font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; } .pcjs-register { font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; border: 1px solid black; } @@ -96,6 +96,18 @@ line-height: 34px; background-color: #ffffff; } +.pcjs-panel-group { + color: #ffffff; + background-color: #404040; +} +.pcjs-tripled-label { + text-align: right; + padding: 8px; +} +.pcjs-ledpad { + line-height: 32px; + background-color: #000000; +} .pcjs-led { float: left; width: 8px; @@ -103,19 +115,18 @@ margin: 4px; border: 1px solid black; text-align: center; - line-height: 19px; + vertical-align: middle; background-color: #000000; } .pcjs-rled { - float: left; width: 8px; height: 8px; margin: 4px; border: 1px solid black; border-radius: 50%; text-align: center; - line-height: 19px; - background-color: #000000; + vertical-align: middle; + background-color: #ff0000; } .pcjs-screen { clear: both; diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index c48ca5c2c..43f7691f9 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -1,6 +1,7 @@ ]> @@ -330,6 +331,7 @@ margin:0 auto; position:; position:relative; + text-align:; float:left; @@ -411,7 +413,7 @@ -
+

diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index 7d9c94ec9..c897ddac6 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -1364,9 +1364,9 @@ a;Lf(this);return a},function(a){this.S|=2;this.A-=14+(-1===this.D?0:2);if(-1!== this.ja?b|=-16777216:80386<=this.ja&&2!=this.ba&&(a|=b<<16);this.nb(this.D+2,b);this.A-=12}return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Ec=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.zd=this.Ec+a,this.S|=2,this.A-=11);return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Mc=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.Sd=this.Mc+a,this.S|=2,this.A-=12);return a},function(){this.A-=2+(-1===this.D?0:1);return this.$a},W,function(a){this.ca&131072? E.call(this,6):(Of(this,a),this.A-=-1===this.D?3:6,this.S|=2);return a},W],tk=[W,W,W,W,Hh,Kh,Jh,Ih]; function X(a){bb.call(this,"ChipSet",a,X,32768);var b=a.model;b&&!uk[b]&&w("Unrecognized ChipSet model: "+b);this.ja=uk[b]||vk;this.C=[];b=wk(a[xk]);this.C[0]=[b,b];null==b&&(this.ia=[360,360],(b=a.floppies)&&b.length&&(this.ia=b),yk(this,zk,this.ia.length),yk(this,Ak,a.monitor||(this.ja=kg&&(this.cb=this.Da=2);this.ka=a.scaleTimers||!1;this.Ub=a.rtcDate;this.Db=!1;a.sound&&(this.sb=this.Fa=null,window&&(this.sb=window.AudioContext|| -window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"Coprocessor"}; +window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"FPU"}; Ek[5150][0][Ak]={Lc:48,gd:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},Pd:"Monitor Type"};Ek[5150][0][5]={Lc:12,gd:{16:0,32:4,48:8,64:12},Pd:"Base Memory (16Kb Increments)"};Ek[5150][1][6]={Lc:31,gd:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},Pd:"Expansion Memory (32Kb Increments)"};Ek[5160]=[{},{}];Ek[5160][0][zk]=Ek[5150][0][zk];Ek[5160][0][3]=Ek[5150][0][3];Ek[5160][0][Ak]=Ek[5150][0][Ak]; -Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"Coprocessor"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype; +Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"FPU"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype; l.Pb=function(a,b,c){switch(b){case xk:return this.qa[b]=c,Fk(this,0,b),!0;case Bk:if(5150==(this.ja|0)||5160.101==this.ja)return this.qa[b]=c,Fk(this,1,b),!0;break;case "swdesc":return this.qa[b]=c,!0}return!1}; l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.Tb=Jb(a,"FPU");yk(this,3,this.Tb?1:0,!0);this.B=Jb(a,"Keyboard");this.gb=c.Y.Id/1193181;qc(b,this,Gk);yc(b,this,Hk);this.jab;b++){var c=13>=b?Sk(e,b):e.A[b];a&&(a+="\n");a+="CMOS["+u(b)+"]: "+u(c)}e.ha.O(a)})}lf(c,26,this.Pm.bind(this))}; @@ -1386,7 +1386,7 @@ function Fk(a,b,c){for(var d="",e=a.qa[c],f=1;8>=f;f++){var g="pcjs-bitCell";f|| function Yk(a,b,c){for(var d=null,e=Ek[a.ja]||Ek[a.ja|0]||Ek[5150],f=0;fg.Ab[0]&&(g.Ab[0]=255,g.Ab[1]--,0>g.Ab[1]&&(g.Ab[1]=255)));return h}function ql(a,b,c,d,e,f){var g=a.L[b];z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.Kb+"]",null,!0);a=g.Dc[c];a.Ab[g.Kb]=a.Fc[g.Kb]=e;g.Kb^=1}function rl(a,b,c,d){var e=a.L[b],f=e.Yb|1;e.Yb&=-16;z(a,768)&&x(a,c,null,d,"DMA"+b+".STATUS",f,!0);return f} function sl(a,b,c,d,e){var f=a.L[b];z(a,768)&&x(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Yb=f.Yb&~(16<=Se&&(this.Ea=this.pa=2);this.Z=a.scaleTimers||!1;this.Xa=a.rtcDate;this.Oa=!1;a.sound&&(this.La=this.qa=null,window&&(this.La=window.AudioContext|| -window.webkitAudioContext),this.La&&(this.qa=new this.La));this.reset(!0);t(this)}Ta(U);var Ci=5150.9,Se=5170,Bi={5150:5150,5160:5160,5170:Se,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Ci,deskpro386:5180},Ei="sw1",Ii="sw2",Ji={Yj:1,ONE:0,gn:64,en:128,Wm:192,lc:192,eg:6},Ki={fn:16,Sm:32,Xm:48,lc:48,eg:4},Gi=1,Hi=4,W={5150:[{},{}]};W[5150][0][Gi]={lc:192,Nc:{1:0,2:64,3:128,4:192},ed:"Number of Floppy Drives"};W[5150][0][3]={lc:2,Nc:{0:0,1:2},ed:"Coprocessor"}; +window.webkitAudioContext),this.La&&(this.qa=new this.La));this.reset(!0);t(this)}Ta(U);var Ci=5150.9,Se=5170,Bi={5150:5150,5160:5160,5170:Se,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Ci,deskpro386:5180},Ei="sw1",Ii="sw2",Ji={Yj:1,ONE:0,gn:64,en:128,Wm:192,lc:192,eg:6},Ki={fn:16,Sm:32,Xm:48,lc:48,eg:4},Gi=1,Hi=4,W={5150:[{},{}]};W[5150][0][Gi]={lc:192,Nc:{1:0,2:64,3:128,4:192},ed:"Number of Floppy Drives"};W[5150][0][3]={lc:2,Nc:{0:0,1:2},ed:"FPU"}; W[5150][0][Hi]={lc:48,Nc:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},ed:"Monitor Type"};W[5150][0][5]={lc:12,Nc:{16:0,32:4,48:8,64:12},ed:"Base Memory (16Kb Increments)"};W[5150][1][6]={lc:31,Nc:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},ed:"Expansion Memory (32Kb Increments)"};W[5160]=[{},{}];W[5160][0][Gi]=W[5150][0][Gi];W[5160][0][3]=W[5150][0][3];W[5160][0][Hi]=W[5150][0][Hi]; -W[5160][0][5]={lc:12,Nc:{64:0,128:4,192:8,256:12},ed:"Base Memory (64Kb Increments)"};W[5160][1][6]=W[5150][1][6];W[5160.101]=[{},{}];W[5160.101][0][5]={lc:143,Nc:{128:1,256:130,512:8,640:141},ed:"Base Memory (128Kb Increments)"};W[5160.101][0][3]={lc:16,Nc:{0:0,1:16},ed:"Coprocessor"};W[5160.101][1][2]={lc:1,Nc:{0:0,1:1},ed:"Floppy Type"};W[5160.101][1][Gi]=W[5150][0][Gi];W[5160.101][1][Hi]=W[5150][0][Hi];l=U.prototype; +W[5160][0][5]={lc:12,Nc:{64:0,128:4,192:8,256:12},ed:"Base Memory (64Kb Increments)"};W[5160][1][6]=W[5150][1][6];W[5160.101]=[{},{}];W[5160.101][0][5]={lc:143,Nc:{128:1,256:130,512:8,640:141},ed:"Base Memory (128Kb Increments)"};W[5160.101][0][3]={lc:16,Nc:{0:0,1:16},ed:"FPU"};W[5160.101][1][2]={lc:1,Nc:{0:0,1:1},ed:"Floppy Type"};W[5160.101][1][Gi]=W[5150][0][Gi];W[5160.101][1][Hi]=W[5150][0][Hi];l=U.prototype; l.zb=function(a,b,c){switch(b){case Ei:return this.la[b]=c,Li(this,0,b),!0;case Ii:if(5150==(this.ca|0)||5160.101==this.ca)return this.la[b]=c,Li(this,1,b),!0;break;case "swdesc":return this.la[b]=c,!0}return!1}; l.pc=function(a,b,c,d){this.ia=b;this.A=c;this.Ia=d;this.ba=a;this.od=mb(a,"FPU");Fi(this,3,this.od?1:0,!0);this.C=mb(a,"Keyboard");this.Ga=c.T.Yc/1193181;Sb(b,this,Mi);Ub(b,this,Ni);this.ca=Se){this.H=16;this.P=0;this.R=16;this.ua=0;this.W=160;512<=$i(this)&&(this.W|=16);3==+aj(this,Hi,void 0)&&(this.W|=64);5180==(this.ca|0)&&(this.W|=12);this.va=3;this.I= @@ -1369,7 +1369,7 @@ function Li(a,b,c){for(var d="",e=a.la[c],f=1;8>=f;f++){var g="pcjs-bitCell";f|| function aj(a,b,c){for(var d=null,e=W[a.ca]||W[a.ca|0]||W[5150],f=0;fd.hb[0]&&(d.hb[0]=255,d.hb[1]--,0>d.hb[1]&&(d.hb[1]=255)));return e}function xj(a,b,c,d){a=a.G[b];c=a.$b[c];c.hb[a.Ib]=c.jc[a.Ib]=d;a.Ib^=1} function yj(a,b){a=a.G[b];b=a.Db|1;a.Db&=-16;return b}function zj(a,b,c){a=a.G[b];b=c&3;a.Db=a.Db&~(16<>2].$b[b&3],c,d,e)}function Bj(a,b,c){b=a.G[b>>2].$b[b&3];b.Ef&&b.qg&&b.Sf?(c&&(b.done=c),b.Rd||Gj(a,b,!0)):c&&c(!0)} function Gj(a,b,c){c&&(b.count=b.hb[1]<<8|b.hb[0],b.type=b.mode&12,b.si=b.Ff=!1);for(var d=!1;0<=b.count&&(c=b.xf<<16|b.gb[1]<<8|b.gb[0],4==b.type?(d=!0,function(c){b.qg.call(b.Ef,b.Sf,-1,function(e,g){0>e&&(b.si||(b.si=!0),e=255);b.Rd||a.ia.Mc(c,e);(d=g)&&setTimeout(function(){Hj(b)||Gj(a,b)},0)})}(c)):8==b.type?(c=a.ia.Jb(c),0>b.qg.call(b.Ef,b.Sf,c)&&(b.Ff=!0)):0!=b.type&&(b.Ff=!0)),!d&&!Hj(b););} diff --git a/modules/pcx86/lib/chipset.js b/modules/pcx86/lib/chipset.js index aeea597aa..2ea035b0a 100644 --- a/modules/pcx86/lib/chipset.js +++ b/modules/pcx86/lib/chipset.js @@ -810,7 +810,7 @@ ChipSet.DIPSW[ChipSet.MODEL_5150][0][ChipSet.SWITCH_TYPE.FPU] = { 0: 0x00, // 0 means an FPU is NOT installed 1: 0x02 // 1 means an FPU is installed }, - LABEL: "Coprocessor" + LABEL: "FPU" }; ChipSet.DIPSW[ChipSet.MODEL_5150][0][ChipSet.SWITCH_TYPE.MONITOR] = { MASK: 0x30, @@ -910,7 +910,7 @@ ChipSet.DIPSW[ChipSet.MODEL_ATT_6300][0][ChipSet.SWITCH_TYPE.FPU] = { 0: 0x00, 1: 0x10 }, - LABEL: "Coprocessor" + LABEL: "FPU" }; ChipSet.DIPSW[ChipSet.MODEL_ATT_6300][1][ChipSet.SWITCH_TYPE.FLOPTYPE] = { MASK: 0x01, @@ -2809,7 +2809,7 @@ ChipSet.prototype.updateDIPSwitchDescriptions = function() 3: "Monochrome" }; sText += this.getDIPMemorySize(true) + "Kb"; - sText += ", " + (+this.getDIPCoprocessor(true)? "" : "No ") + "Coprocessor"; + sText += ", " + (+this.getDIPCoprocessor(true)? "" : "No ") + "FPU"; sText += ", " + asMonitorTypes[this.getDIPVideoMonitor(true)] + " Monitor"; sText += ", " + this.getDIPFloppyDrives(true) + " Floppy Drives"; if (this.aDIPSwitches[0][1] != null && this.aDIPSwitches[0][1] != this.aDIPSwitches[0][0] || diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 423de801f..576f2b2ef 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -77,9 +77,11 @@ function BusPDP11(parmsBus, cpu, dbg) /* * This controls the location of the IOPAGE (ie, at the top of 16-bit, 18-bit, or 22-bit address range). - * It is managed by setIOPageRange(). initMemory() establishes the default (16). + * It is managed by setIOPageRange(). reset() establishes the default (16). */ this.nIOPageRange = 0; // zero means no IOPAGE access (yet) + this.prevIOPageBlocks = []; // this saves any memory blocks we had to replace with IOPAGE blocks + this.realIOPageBlocks = null; // this saves the memory blocks allocated for IOPAGE, so we can reuse them /* * Compute all BusPDP11 memory block parameters, based on the width of the bus. The entire @@ -140,6 +142,7 @@ function BusPDP11(parmsBus, cpu, dbg) */ this.aIOHandlers = []; this.fIOBreakAll = false; + this.nDisableTraps = 0; /* * Array of RESET notification handlers registered by Device components. @@ -183,19 +186,62 @@ BusPDP11.ERROR = { }; /* - * These are our custom controller functions for all IOPAGE accesses. + * Every entry in the aIOHandlers table is an array with the following indexes: + */ +BusPDP11.IOHANDLER = { + READ_BYTE: 0, + WRITE_BYTE: 1, + READ_WORD: 2, + WRITE_WORD: 3, + NAME: 4 +}; + +/* + * These are our custom IOController functions for all IOPAGE accesses. They look up the IOPAGE + * offset in the aIOHandlers table, and if an entry exists, they use the appropriate IOHANDLER indexes + * (above) to locate the appropriate read/write handlers. * - * Note that we try to have reasonable fall-backs for byte reads when only word read handlers exist, - * and word reads if only byte handlers exist. Ditto for writes. These fall-backs may not always be + * Note that we try to have reasonable fallbacks for byte reads when only word read handlers exist, + * and word reads if only byte handlers exist. Ditto for writes. These fallbacks may not always be * appropriate; for example, when a byte write falls back to a word write, the address must be read * first, and depending on the underlying I/O device, that may or may not have side-effects. It's really * up to the device to know whether that matters, and provide all the necessary handlers if it does. * + * TODO: Unlike regular Memory blocks, IOPAGE accesses permit word accesses on ODD addresses; that works + * just fine by registering WORD handlers for the appropriate ODD addresses. What is unclear, however, + * is what is exactly supposed to happen when the CPU reads or writes a BYTE from an ODD IOPAGE address; + * it's likely that our built-in fallbacks are NOT correct for those cases. + * + * For example, let's imagine that only read/write WORD handlers have been registered for ODD address + * 177701 (ie, General Register R1, Set 0). If a readByte(177701) request is made, we would fallback to + * reading the word at 177700 and returning the high byte, but that would fetch the contents of General + * Register R0 instead of R1, which clearly seems wrong. + * + * One solution is for the caller to register both BYTE and WORD handlers for ODD addresses, making + * the caller responsible for the defining the correct behavior in all cases. However, that's more work + * for the caller, and we're just punting the problem instead of solving it. + * + * Another solution is for addIOHandlers() to detect the ODD address case, and install custom fallback + * handlers for read and write BYTE accesses. In the above example, the custom read BYTE handler would + * invoke the read WORD handler and mask the result with 0xff, and the custom write BYTE handler would + * first call the read WORD handler, insert the new data into the low byte of the result, and then + * call the write WORD handler. + * + * addIOHandlers() currently implements the second solution. Again, we're assuming that's the correct + * behavior for ODD IOPAGE accesses, which may not be a valid assumption. + * + * One of things that gives me pause about the second solution is that when the destination of a MOVB + * instruction is a general register, the byte is sign-extended to a word. So it seems to strange to have + * a different MOVB behavior when the destination is ODD general register using an ODD IOPAGE address. + * Other byte instructions, like CLRB, would function identically when modifying ODD general registers, + * regardless how they are referenced. + * * TODO: Another small potential improvement would be for addIOHandlers() to predefine fall-backs for all - * missing handlers, so there's never a need to check each entry (eg, afn[0], afn[1], etc) before calling - * it. However, since there's no avoiding checking afn itself (unless we FULLY populate the aIOHandlers - * array), and since these I/O accesses should be pretty infrequent relative to all other memory accesses, - * the benefit seems pretty minimal. + * missing handlers, in both the ODD and EVEN cases, so there's never a need to check each function index + * before calling it. However, since there's no avoiding checking aIOHandlers[off] (unless we FULLY populate + * the aIOHandlers array), and since these I/O accesses should be pretty infrequent relative to all other + * memory accesses, the benefit seems pretty minimal. Plus, all our fallback assumptions still need to be + * verified, so let's wait until that's done before we start optimizing this code. */ BusPDP11.IOController = { @@ -213,26 +259,26 @@ BusPDP11.IOController = { var bus = this.controller; var afn = bus.aIOHandlers[off]; if (afn) { - if (afn[0]) { - b = afn[0](addr) & 0xff; // we mask the result of readByte() in case the caller is re-using their readWord() handler - } else if (afn[2]) { + if (afn[BusPDP11.IOHANDLER.READ_BYTE]) { + b = afn[BusPDP11.IOHANDLER.READ_BYTE](addr); + } else if (afn[BusPDP11.IOHANDLER.READ_WORD]) { if (!(addr & 0x1)) { - b = afn[2](addr) & 0xff; + b = afn[BusPDP11.IOHANDLER.READ_WORD](addr) & 0xff; } else { - b = afn[2](addr & ~0x1) >> 8; + b = afn[BusPDP11.IOHANDLER.READ_WORD](addr & ~0x1) >> 8; } } } else if (addr & 0x1) { afn = bus.aIOHandlers[off & ~0x1]; if (afn) { - if (afn[2]) { - b = afn[2](addr & ~0x1) >> 8; + if (afn[BusPDP11.IOHANDLER.READ_WORD]) { + b = afn[BusPDP11.IOHANDLER.READ_WORD](addr & ~0x1) >> 8; } } } if (b >= 0) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[4] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true, true); + this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true, true); } return b; } @@ -261,21 +307,21 @@ BusPDP11.IOController = { /* * If a writeByte() handler exists, call it; we're done */ - if (afn[1]) { - afn[1](b, addr); + if (afn[BusPDP11.IOHANDLER.WRITE_BYTE]) { + afn[BusPDP11.IOHANDLER.WRITE_BYTE](b, addr); fWrite = true; } /* * If a writeWord() handler exists, call the readWord() handler first to get the original data, - * then call writeWord() with the new data pre-inserted into the original data. + * then call writeWord() with the new data pre-inserted in the original data. */ - else if (afn[3]) { - w = afn[2]? afn[2](addr) : 0; + else if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { + w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](addr) : 0; if (!(addr & 0x1)) { - afn[3]((w & ~0xff) | b, addr); + afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & ~0xff) | b, addr); fWrite = true; } else { - afn[3]((w & 0xff) | (b << 8), addr & ~0x1); + afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & 0xff) | (b << 8), addr & ~0x1); fWrite = true; } } @@ -283,21 +329,21 @@ BusPDP11.IOController = { /* * If no handler existed, and this address was odd, then perhaps a handler exists for the even address; * if so, call the readWord() handler first to get the original data, then call writeWord() with the new - * data pre-inserted into (the high byte of) the original data. + * data pre-inserted in (the high byte of) the original data. */ afn = bus.aIOHandlers[off & ~0x1]; if (afn) { - if (afn[3]) { + if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { addr &= ~0x1; - w = afn[2]? afn[2](addr) : 0; - afn[3]((w & 0xff) | (b << 8), addr); + w = afn[BusPDP11.IOHANDLER.READ_WORD]? afn[BusPDP11.IOHANDLER.READ_WORD](addr) : 0; + afn[BusPDP11.IOHANDLER.WRITE_WORD]((w & 0xff) | (b << 8), addr); fWrite = true; } } } if (fWrite) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[4] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true, true); + this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true, true); } return; } @@ -321,15 +367,15 @@ BusPDP11.IOController = { var bus = this.controller; var afn = bus.aIOHandlers[off]; if (afn) { - if (afn[2]) { - w = afn[2](addr); - } else if (afn[0]) { - w = afn[0](addr) | (afn[0](addr + 1) << 8); + if (afn[BusPDP11.IOHANDLER.READ_WORD]) { + w = afn[BusPDP11.IOHANDLER.READ_WORD](addr); + } else if (afn[BusPDP11.IOHANDLER.READ_BYTE]) { + w = afn[BusPDP11.IOHANDLER.READ_BYTE](addr) | (afn[BusPDP11.IOHANDLER.READ_BYTE](addr + 1) << 8); } } if (w >= 0) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[4] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true, true); + this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true, true); } return w; } @@ -354,18 +400,18 @@ BusPDP11.IOController = { var bus = this.controller; var afn = bus.aIOHandlers[off]; if (afn) { - if (afn[3]) { - afn[3](w, addr); + if (afn[BusPDP11.IOHANDLER.WRITE_WORD]) { + afn[BusPDP11.IOHANDLER.WRITE_WORD](w, addr); fWrite = true; - } else if (afn[1]) { - afn[1](w & 0xff, addr); - afn[1](w >> 8, addr + 1); + } else if (afn[BusPDP11.IOHANDLER.WRITE_BYTE]) { + afn[BusPDP11.IOHANDLER.WRITE_BYTE](w & 0xff, addr); + afn[BusPDP11.IOHANDLER.WRITE_BYTE](w >> 8, addr + 1); fWrite = true; } } if (fWrite) { if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.BUS)) { - this.dbg.printMessage(afn[4] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true, true); + this.dbg.printMessage(afn[BusPDP11.IOHANDLER.NAME] + ".writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true, true); } return; } @@ -385,13 +431,12 @@ BusPDP11.IOController = { */ BusPDP11.prototype.initMemory = function() { - var block = new MemoryPDP11(this.cpu); + var block = new MemoryPDP11(this); block.copyBreakpoints(this.dbg); this.aMemBlocks = new Array(this.nBlockTotal); for (var iBlock = 0; iBlock < this.nBlockTotal; iBlock++) { this.aMemBlocks[iBlock] = block; } - this.setIOPageRange(16); }; /** @@ -400,8 +445,12 @@ BusPDP11.prototype.initMemory = function() * We can define the IOPAGE address range with a single number, because the size of the IOPAGE is fixed at 8Kb. * The bottom of the range is (2 ^ nRange) - IOPAGE_LENGTH, and the top is (2 ^ nRange) - 1. * + * Note that we defer our initial call to this function as long as possible (ie, at the end of reset()) so that + * other components have first shot at adding their own memory blocks (if any), because addMemory() only allows + * installing memory on top of empty memory blocks. + * * @this {BusPDP11} - * @param {number} nRange (16, 18 or 22) + * @param {number} nRange (16, 18 or 22; 0 removes the IOPAGE altogether) */ BusPDP11.prototype.setIOPageRange = function(nRange) { @@ -409,12 +458,20 @@ BusPDP11.prototype.setIOPageRange = function(nRange) var addr; if (this.nIOPageRange) { addr = (1 << this.nIOPageRange) - BusPDP11.IOPAGE_LENGTH; - if (!this.removeMemory(addr, BusPDP11.IOPAGE_LENGTH)) return; + this.setMemoryBlocks(addr, BusPDP11.IOPAGE_LENGTH, this.prevIOPageBlocks); this.nIOPageRange = 0; } - addr = (1 << nRange) - BusPDP11.IOPAGE_LENGTH; - if (!this.addMemory(addr, BusPDP11.IOPAGE_LENGTH, MemoryPDP11.TYPE.CONTROLLER, this)) return; - this.nIOPageRange = nRange; + if (nRange) { + this.nIOPageRange = nRange; + addr = (1 << nRange) - BusPDP11.IOPAGE_LENGTH; + this.prevIOPageBlocks = this.getMemoryBlocks(addr, BusPDP11.IOPAGE_LENGTH); + if (this.realIOPageBlocks) { + this.setMemoryBlocks(addr, BusPDP11.IOPAGE_LENGTH, this.realIOPageBlocks); + } else { + this.addMemory(addr, BusPDP11.IOPAGE_LENGTH, MemoryPDP11.TYPE.CONTROLLER, this); + this.realIOPageBlocks = this.getMemoryBlocks(addr, BusPDP11.IOPAGE_LENGTH); + } + } } }; @@ -460,6 +517,7 @@ BusPDP11.prototype.reset = function() for (var i = 0; i < this.afnReset.length; i++) { this.afnReset[i](); } + this.setIOPageRange(16); }; /** @@ -474,13 +532,17 @@ BusPDP11.prototype.reset = function() * @param {number} addr (ie, an IOPAGE address) * @param {number} data (-1 if read, otherwise write) * @param {number} byteFlag (true if byte I/O, otherwise word) + * @return {number} */ BusPDP11.prototype.unknownAccess = function(addr, data, byteFlag) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) { - this.dbg.printMessage("warning: unrecognized I/O access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")", true, true); + if (!this.nDisableTraps) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) { + this.dbg.printMessage("warning: unrecognized I/O access(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(data) + "," + byteFlag + ")", true, true); + } + this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); } - this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); + return 0; }; /** @@ -549,8 +611,13 @@ BusPDP11.prototype.addMemory = function(addr, size, type, controller) var sizeBlock = this.nBlockSize - (addrNext - addrBlock); if (sizeBlock > sizeLeft) sizeBlock = sizeLeft; - if (block && block.size) { - if (block.type == type && block.controller == controller) { + /* + * addMemory() will now happily replace an existing block when a memory controller is specified; + * this is a work-around to make life easier for setIOPageRange(), which otherwise would have to call + * removeMemory() first, which would just waste time and memory allocating more (empty) blocks. + */ + if (!controller && block && block.size) { + if (block.type == type /* && block.controller == controller */) { /* * Where there is already a similar block with a non-zero size, we allow the allocation only if: * @@ -575,7 +642,7 @@ BusPDP11.prototype.addMemory = function(addr, size, type, controller) return this.reportError(BusPDP11.ERROR.RANGE_INUSE, addrNext, sizeLeft); } - var blockNew = new MemoryPDP11(this.cpu, addrNext, sizeBlock, this.nBlockSize, type, controller); + var blockNew = new MemoryPDP11(this, addrNext, sizeBlock, this.nBlockSize, type, controller); blockNew.copyBreakpoints(this.dbg, block); this.aMemBlocks[iBlock++] = blockNew; @@ -584,7 +651,7 @@ BusPDP11.prototype.addMemory = function(addr, size, type, controller) } if (sizeLeft <= 0) { - this.status(Math.floor(size / 1024) + "Kb " + MemoryPDP11.TYPE.NAMES[type] + " at " + str.toHexLong(addr)); + this.status(Math.floor(size / 1024) + "Kb " + MemoryPDP11.TYPE_NAMES[type] + " at " + str.toHexLong(addr)); return true; } @@ -713,7 +780,7 @@ BusPDP11.prototype.removeMemory = function(addr, size) var iBlock = addr >>> this.nBlockShift; while (size > 0) { var blockOld = this.aMemBlocks[iBlock]; - var blockNew = new MemoryPDP11(this.cpu, addr); + var blockNew = new MemoryPDP11(this, addr); blockNew.copyBreakpoints(this.dbg, blockOld); this.aMemBlocks[iBlock++] = blockNew; addr = iBlock * this.nBlockSize; @@ -799,7 +866,7 @@ BusPDP11.prototype.setMemoryBlocks = function(addr, size, aBlocks, type) this.assert(block); if (!block) break; if (type !== undefined) { - var blockNew = new MemoryPDP11(this.cpu, addr); + var blockNew = new MemoryPDP11(this, addr); blockNew.clone(block, type, this.dbg); block = blockNew; } @@ -831,7 +898,10 @@ BusPDP11.prototype.getByte = function(addr) */ BusPDP11.prototype.getByteDirect = function(addr) { - return this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByteDirect(addr & this.nBlockLimit, addr); + this.nDisableTraps++; + var b = this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].readByteDirect(addr & this.nBlockLimit, addr); + this.nDisableTraps--; + return b; }; /** @@ -862,12 +932,17 @@ BusPDP11.prototype.getWord = function(addr) */ BusPDP11.prototype.getWordDirect = function(addr) { + var w; var off = addr & this.nBlockLimit; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; + this.nDisableTraps++; if (!PDP11.WORDBUS && off == this.nBlockLimit) { - return this.aMemBlocks[iBlock++].readByteDirect(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByteDirect(0, addr + 1) << 8); + w = this.aMemBlocks[iBlock++].readByteDirect(off, addr) | (this.aMemBlocks[iBlock & this.nBlockMask].readByteDirect(0, addr + 1) << 8); + } else { + w = this.aMemBlocks[iBlock].readWordDirect(off, addr); } - return this.aMemBlocks[iBlock].readWordDirect(off, addr); + this.nDisableTraps--; + return w; }; /** @@ -894,7 +969,9 @@ BusPDP11.prototype.setByte = function(addr, b) */ BusPDP11.prototype.setByteDirect = function(addr, b) { + this.nDisableTraps++; this.aMemBlocks[(addr & this.nBusMask) >>> this.nBlockShift].writeByteDirect(addr & this.nBlockLimit, b & 0xff, addr); + this.nDisableTraps--; }; /** @@ -930,12 +1007,14 @@ BusPDP11.prototype.setWordDirect = function(addr, w) { var off = addr & this.nBlockLimit; var iBlock = (addr & this.nBusMask) >>> this.nBlockShift; + this.nDisableTraps++; if (!PDP11.WORDBUS && off == this.nBlockLimit) { this.aMemBlocks[iBlock++].writeByteDirect(off, w & 0xff, addr); this.aMemBlocks[iBlock & this.nBlockMask].writeByteDirect(0, (w >> 8) & 0xff, addr + 1); - return; + } else { + this.aMemBlocks[iBlock].writeWordDirect(off, w & 0xffff, addr); } - this.aMemBlocks[iBlock].writeWordDirect(off, w & 0xffff, addr); + this.nDisableTraps--; }; /** @@ -1099,13 +1178,41 @@ BusPDP11.prototype.addIOHandlers = function(start, end, fnReadByte, fnWriteByte, BusPDP11.prototype.addIOTable = function(component, table) { for (var port in table) { + var addr = +port; var afn = table[port]; + + /* + * Don't install (ie, ignore) handlers for I/O addresses that are defined with a model number + * that is "greater than" than the current model. + */ if (afn[5] && afn[5] > this.cpu.model) continue; + var fnReadByte = afn[0]? afn[0].bind(component) : null; var fnWriteByte = afn[1]? afn[1].bind(component) : null; var fnReadWord = afn[2]? afn[2].bind(component) : null; var fnWriteWord = afn[3]? afn[3].bind(component) : null; - this.addIOHandlers(+port, +port, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, afn[4]); + + /* + * As discussed in the IOController comments above, when handlers are being registered for ODD addresses, + * we assume that we need different fallback handlers when reading and/or writing bytes. + */ + if (addr & 0x1) { + if (!fnReadByte && fnReadWord) { + fnReadByte = function(fnReadWord) { + return function(addr) { + return fnReadWord(addr) & 0xff; + }.bind(component); + }(fnReadWord); + } + if (!fnWriteByte && fnWriteWord && fnReadWord) { + fnWriteByte = function(fnWriteWord, fnReadWord) { + return function(data, addr) { + return fnWriteWord((fnReadWord(addr) & ~0xff) | data, addr); + }.bind(component); + }(fnWriteWord, fnReadWord); + } + } + this.addIOHandlers(addr, addr, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, afn[4]); } }; @@ -1120,6 +1227,24 @@ BusPDP11.prototype.addResetHandler = function(fnReset) this.afnReset.push(fnReset); }; +/** + * fault(addr) + * + * Memory interface for signaling alignment errors. + * + * @this {BusPDP11} + * @param {number} addr + */ +BusPDP11.prototype.fault = function(addr) +{ + if (!this.nDisableTraps) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.WARN)) { + this.dbg.printMessage("memory fault on address " + this.dbg.toStrBase(addr), true, true); + } + this.cpu.trap(PDP11.TRAP.BUS_ERROR, addr); + } +}; + /** * reportError(errNum, addr, size, fQuiet) * diff --git a/modules/pdp11/lib/cpu.js b/modules/pdp11/lib/cpu.js index 354fda36f..86d26049e 100644 --- a/modules/pdp11/lib/cpu.js +++ b/modules/pdp11/lib/cpu.js @@ -205,22 +205,9 @@ CPUPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.flags.autoStart = (sAutoStart == "true"? true : (sAutoStart == "false"? false : !!sAutoStart)); } - this.initBusComplete(); - this.setReady(); }; -/** - * initBusComplete() - * - * Stub for Bus finalization (overridden by the CPUStatePDP11 component). - * - * @this {CPUPDP11} - */ -CPUPDP11.prototype.initBusComplete = function() -{ -}; - /** * reset() * diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index c7f1324a5..a47d16474 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -98,17 +98,6 @@ Component.subclass(CPUStatePDP11, CPUPDP11); */ var InterruptEvent; -/** - * initBusComplete() - * - * @this {CPUStatePDP11} - */ -CPUStatePDP11.prototype.initBusComplete = function() -{ - this.assert(this.bus); - this.setMemoryAccess(); -}; - /** * initProcessor() * @@ -156,7 +145,7 @@ CPUStatePDP11.prototype.initRegs = function() this.regsAlt = [ // Alternate R0 - R5 0, 0, 0, 0, 0, 0 ]; - this.regsAltStack = [ // Alternate R6 stack pointers (kernel, super, illegal, user) + this.regsAltStack = [ // Alternate R6 stack pointers (KERNEL, SUPER, illegal, USER) 0, 0, 0, 0 ]; this.mmuMode = 0; // current memory management mode (see PDP11.MODE.KERNEL | SUPER | UNUSED | USER) @@ -1029,19 +1018,6 @@ CPUStatePDP11.prototype.updateSubFlags = function(result, src, dst) } }; -/** - * fault(addr) - * - * Memory interface for signaling alignment errors. - * - * @this {CPUStatePDP11} - * @param {number} addr - */ -CPUStatePDP11.prototype.fault = function(addr) -{ - this.trap(PDP11.TRAP.BUS_ERROR, addr); -}; - /** * panic(reason) * diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 8cbd7edde..7a0f34bf8 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -587,12 +587,7 @@ if (DEBUGGER) { var b = 0xff; var addr = this.getAddr(dbgAddr, false, 1); if (addr !== PDP11.ADDR_INVALID) { - this.nDisableMessages++; - /* - * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). - */ b = this.bus.getByteDirect(addr); - this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); } return b; @@ -611,16 +606,7 @@ if (DEBUGGER) { var w = 0xffff; var addr = this.getAddr(dbgAddr, false, 2); if (addr !== PDP11.ADDR_INVALID) { - this.nDisableMessages++; - /* - * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). - * - * NOTE: We don't care if the word address is aligned, because 1) we assume the user knows what - * they're doing, and 2) the Bus simply ignores the low address bit anyway. Alignment checks are - * performed by the CPU, not the Bus. - */ w = this.bus.getWordDirect(addr); - this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); } return w; @@ -638,12 +624,7 @@ if (DEBUGGER) { { var addr = this.getAddr(dbgAddr, true, 1); if (addr !== PDP11.ADDR_INVALID) { - this.nDisableMessages++; - /* - * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). - */ this.bus.setByteDirect(addr, b); - this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); this.cpu.updateCPU(true); // we set fForce to true in case video memory was the target } @@ -661,16 +642,7 @@ if (DEBUGGER) { { var addr = this.getAddr(dbgAddr, true, 2); if (addr !== PDP11.ADDR_INVALID) { - this.nDisableMessages++; - /* - * TODO: We also need a Bus interface to disable accesses that could trigger a trap(). - * - * NOTE: We don't care if the word address is aligned, because 1) we assume the user knows what - * they're doing, and 2) the Bus simply ignores the low address bit anyway. Alignment checks are - * performed by the CPU, not the Bus. - */ this.bus.setWordDirect(addr, w); - this.nDisableMessages--; if (inc) this.incAddr(dbgAddr, inc); this.cpu.updateCPU(true); // we set fForce to true in case video memory was the target } @@ -879,7 +851,7 @@ if (DEBUGGER) { if (!cPrev++) this.println("..."); } else { typePrev = block.type; - var sType = MemoryPDP11.TYPE.NAMES[typePrev]; + var sType = MemoryPDP11.TYPE_NAMES[typePrev]; if (block) { this.println(str.toHex(block.id, 8) + " %" + str.toHex(i << this.bus.nBlockShift, 8) + " %%" + str.toHex(block.addr, 8) + " " + str.toHexWord(block.used) + " " + str.toHexWord(block.size) + " " + sType); } @@ -1034,7 +1006,6 @@ if (DEBUGGER) { this.bitsMessage = this.bitsWarning = MessagesPDP11.WARN; this.sMessagePrev = null; this.aMessageBuffer = []; - this.nDisableMessages = 0; /* * Internally, we use "key" instead of "keys", since the latter is a method on JavasScript objects, * but externally, we allow the user to specify "keys"; "kbd" is also allowed as shorthand for "keyboard". @@ -1154,26 +1125,6 @@ if (DEBUGGER) { return s; }; - /** - * disableMessages(s) - * - * @this {DebuggerPDP11} - */ - DebuggerPDP11.prototype.disableMessages = function() - { - this.nDisableMessages++; - }; - - /** - * enableMessages(s) - * - * @this {DebuggerPDP11} - */ - DebuggerPDP11.prototype.enableMessages = function() - { - this.nDisableMessages--; - }; - /** * message(sMessage, fAddress) * @@ -1183,8 +1134,6 @@ if (DEBUGGER) { */ DebuggerPDP11.prototype.message = function(sMessage, fAddress) { - if (this.nDisableMessages) return; - if (fAddress) { sMessage += " @" + this.toStrAddr(this.newAddr(this.cpu.getPC())); } @@ -1632,9 +1581,7 @@ if (DEBUGGER) { */ if (nState >= 0 && this.aaOpcodeCounts.length) { this.cOpcodes++; - this.nDisableMessages++; var opCode = this.bus.getWordDirect(addr); - this.nDisableMessages--; if (opCode != null) { var dbgAddr = this.aOpcodeHistory[this.iOpcodeHistory]; this.setAddr(dbgAddr, cpu.getPC()); @@ -2741,9 +2688,8 @@ if (DEBUGGER) { /** * doDump(asArgs) * - * The length parameter is interpreted as a number of bytes, in hex, which we convert to the appropriate number - * of lines, because we always display whole lines. If the length is omitted/undefined, it defaults to 0x80 (128.) - * bytes, which normally translates to 8 lines. + * The length parameter is interpreted as a number of bytes (or words, or dwords) to dump, and it is + * interpreted using the current base. * * @this {DebuggerPDP11} * @param {Array.} asArgs (formerly sCmd, [sAddr], [sLen] and [sBytes]) @@ -2840,27 +2786,31 @@ if (DEBUGGER) { var sDump = ""; var size = (sCmd == "dd"? 4 : (sCmd == "dw"? 2 : 1)); - var cb = (size * len) || 128; - var cLines = ((cb + 15) >> 4) || 1; + var nBytes = (size * len) || 128; + var nLines = ((nBytes + 15) >> 4) || 1; - while (cLines-- && cb > 0) { - var data = 0, iByte = 0, i; + while (nLines-- && nBytes > 0) { + var data = 0, shift = 0, i; var sData = "", sChars = ""; sAddr = this.toStrAddr(dbgAddr); /* - * Dump 8 bytes per line when using base 8, and dump 16 bytes when using base 16 (or when dumping dwords) + * Dump 8 bytes per line when using base 8, and dump 16 bytes when using base 16 (or when dumping dwords). + * + * And while we used to always call getByte() and assemble them into words or dwords as appropriate, I've + * changed the logic below to honor "dw" by calling getWord(), since the Bus interfaces have been updated + * to prevent generating traps due to to Debugger access of unaligned memory and/or undefined IOPAGE addresses. */ - var nBytes = (size == 4? 16 : this.nBase); - for (i = nBytes; i > 0 && cb > 0; i--) { - var b = this.getByte(dbgAddr, 1); - data |= (b << (iByte++ << 3)); - if (iByte == size) { + for (i = (size == 4? 16 : this.nBase); i > 0 && nBytes > 0; i--) { + var n, v = size == 2? this.getWord(dbgAddr, n = 2) : this.getByte(dbgAddr, n = 1); + data |= (v << (shift << 3)); + shift += n; + if (shift == size) { sData += this.toStrBase(data, size); sData += (size == 1? (i == 9? '-' : ' ') : " "); - data = iByte = 0; + data = shift = 0; } - sChars += (b >= 32 && b < 128? String.fromCharCode(b) : '.'); - cb--; + sChars += (v >= 32 && v < 128? String.fromCharCode(v) : '.'); + nBytes--; } if (sDump) sDump += '\n'; sDump += sAddr + " " + sData + ((i == 0)? (' ' + sChars) : ""); @@ -3568,14 +3518,14 @@ if (DEBUGGER) { if (n === undefined) n = 1; - var cb = 0x100; + var nBytes = 0x100; if (sAddrEnd !== undefined) { var dbgAddrEnd = this.parseAddr(sAddrEnd, true); if (!dbgAddrEnd || dbgAddrEnd.addr < dbgAddr.addr) return; - cb = dbgAddrEnd.addr - dbgAddr.addr; - if (!DEBUG && cb > 0x100) { + nBytes = dbgAddrEnd.addr - dbgAddr.addr; + if (!DEBUG && nBytes > 0x100) { /* * Limiting the amount of disassembled code to 256 bytes in non-DEBUG builds is partly to * prevent the user from wedging the browser by dumping too many lines, but also a recognition @@ -3587,10 +3537,10 @@ if (DEBUGGER) { n = -1; } - var cLines = 0; + var nLines = 0; var sInstruction; - while (cb > 0 && n--) { + while (nBytes > 0 && n--) { var nSequence = (this.isBusy(false) || this.nStep)? this.nCycles : null; var sComment = (nSequence != null? "cycles" : null); @@ -3599,7 +3549,7 @@ if (DEBUGGER) { var addr = dbgAddr.addr; // we snap dbgAddr.addr *after* calling findSymbol(), which re-evaluates it if (aSymbol[0] && n) { - if (!cLines && n || aSymbol[0].indexOf('+') < 0) { + if (!nLines && n || aSymbol[0].indexOf('+') < 0) { var sLabel = aSymbol[0] + ':'; if (aSymbol[2]) sLabel += ' ' + aSymbol[2]; this.println(sLabel); @@ -3615,8 +3565,8 @@ if (DEBUGGER) { this.println(sInstruction); this.dbgAddrNextCode = dbgAddr; - cb -= dbgAddr.addr - addr; - cLines++; + nBytes -= dbgAddr.addr - addr; + nLines++; } }; diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index 015d87043..3770e9247 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -33,10 +33,12 @@ "use strict"; if (NODE) { - var web = require("../../shared/lib/weblib"); - var Component = require("../../shared/lib/component"); - var State = require("../../shared/lib/state"); - var BusPDP11 = require("./bus"); + var str = require("../../shared/lib/strlib"); + var web = require("../../shared/lib/weblib"); + var Component = require("../../shared/lib/component"); + var State = require("../../shared/lib/state"); + var BusPDP11 = require("./bus"); + var MessagesPDP11 = require("./messages"); } /** @@ -55,7 +57,7 @@ if (NODE) { */ function DevicePDP11(parmsDevice) { - Component.call(this, "Device", parmsDevice, DevicePDP11); + Component.call(this, "Device", parmsDevice, DevicePDP11, MessagesPDP11.DEVICE); this.display = { data: 0, @@ -981,6 +983,20 @@ DevicePDP11.prototype.writePSW = function(data, addr) this.cpu.opFlags |= PDP11.OPFLAG.NO_FLAGS; }; +/** + * writeIgnored(data, addr) + * + * @this {DevicePDP11} + * @param {number} data + * @param {number} addr + */ +DevicePDP11.prototype.writeIgnored = function(data, addr) +{ + if (this.messageEnabled()) { + this.printMessage("writeIgnored(" + str.toOct(addr) + "): " + str.toOct(data), true, true); + } +}; + /** * kw11_interrupt() * @@ -1023,28 +1039,28 @@ DevicePDP11.UNIBUS_IOTABLE = { [PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3"], [PDP11.UNIBUS.LKS]: /* 177546 */ [null, null, DevicePDP11.prototype.readLKS, DevicePDP11.prototype.writeLKS, "LKS"], [PDP11.UNIBUS.MMR0]: /* 177572 */ [null, null, DevicePDP11.prototype.readMMR0, DevicePDP11.prototype.writeMMR0, "MMR0"], - [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, null, "MMR1"], - [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, null, "MMR2"], + [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1"], + [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2"], [PDP11.UNIBUS.UISDR0]: /* 177600 */ [null, null, DevicePDP11.prototype.readUISDR, DevicePDP11.prototype.writeUISDR, "UISDR"], [PDP11.UNIBUS.UDSDR0]: /* 177620 */ [null, null, DevicePDP11.prototype.readUDSDR, DevicePDP11.prototype.writeUDSDR, "UDSDR"], [PDP11.UNIBUS.UISAR0]: /* 177640 */ [null, null, DevicePDP11.prototype.readUISAR, DevicePDP11.prototype.writeUISAR, "UISAR"], [PDP11.UNIBUS.UDSAR0]: /* 177660 */ [null, null, DevicePDP11.prototype.readUDSAR, DevicePDP11.prototype.writeUDSAR, "UDSAR"], - [PDP11.UNIBUS.R0SET0]: /* 177700 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R0SET0"], - [PDP11.UNIBUS.R1SET0]: /* 177701 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R1SET0"], - [PDP11.UNIBUS.R2SET0]: /* 177702 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R2SET0"], - [PDP11.UNIBUS.R3SET0]: /* 177703 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R3SET0"], - [PDP11.UNIBUS.R4SET0]: /* 177704 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R4SET0"], - [PDP11.UNIBUS.R5SET0]: /* 177705 */ [DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R5SET0"], - [PDP11.UNIBUS.R6KERNEL]:/* 177706 */ [DevicePDP11.prototype.readR6KERNEL,DevicePDP11.prototype.writeR6KERNEL,DevicePDP11.prototype.readR6KERNEL, DevicePDP11.prototype.writeR6KERNEL,"R6KERNEL"], - [PDP11.UNIBUS.R7KERNEL]:/* 177707 */ [DevicePDP11.prototype.readR7KERNEL,DevicePDP11.prototype.writeR7KERNEL,DevicePDP11.prototype.readR7KERNEL, DevicePDP11.prototype.writeR7KERNEL,"R7KERNEL"], - [PDP11.UNIBUS.R0SET1]: /* 177710 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R0SET1"], - [PDP11.UNIBUS.R1SET1]: /* 177711 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R1SET1"], - [PDP11.UNIBUS.R2SET1]: /* 177712 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R2SET1"], - [PDP11.UNIBUS.R3SET1]: /* 177713 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R3SET1"], - [PDP11.UNIBUS.R4SET1]: /* 177714 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R4SET1"], - [PDP11.UNIBUS.R5SET1]: /* 177715 */ [DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R5SET1"], - [PDP11.UNIBUS.R6SUPER]: /* 177716 */ [DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, "R6SUPER"], - [PDP11.UNIBUS.R6USER]: /* 177717 */ [DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, "R6USER"], + [PDP11.UNIBUS.R0SET0]: /* 177700 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R0SET0"], + [PDP11.UNIBUS.R1SET0]: /* 177701 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R1SET0"], + [PDP11.UNIBUS.R2SET0]: /* 177702 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R2SET0"], + [PDP11.UNIBUS.R3SET0]: /* 177703 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R3SET0"], + [PDP11.UNIBUS.R4SET0]: /* 177704 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R4SET0"], + [PDP11.UNIBUS.R5SET0]: /* 177705 */ [null, null, DevicePDP11.prototype.readRSET0, DevicePDP11.prototype.writeRSET0, "R5SET0"], + [PDP11.UNIBUS.R6KERNEL]:/* 177706 */ [null, null, DevicePDP11.prototype.readR6KERNEL,DevicePDP11.prototype.writeR6KERNEL,"R6KERNEL"], + [PDP11.UNIBUS.R7KERNEL]:/* 177707 */ [null, null, DevicePDP11.prototype.readR7KERNEL,DevicePDP11.prototype.writeR7KERNEL,"R7KERNEL"], + [PDP11.UNIBUS.R0SET1]: /* 177710 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R0SET1"], + [PDP11.UNIBUS.R1SET1]: /* 177711 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R1SET1"], + [PDP11.UNIBUS.R2SET1]: /* 177712 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R2SET1"], + [PDP11.UNIBUS.R3SET1]: /* 177713 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R3SET1"], + [PDP11.UNIBUS.R4SET1]: /* 177714 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R4SET1"], + [PDP11.UNIBUS.R5SET1]: /* 177715 */ [null, null, DevicePDP11.prototype.readRSET1, DevicePDP11.prototype.writeRSET1, "R5SET1"], + [PDP11.UNIBUS.R6SUPER]: /* 177716 */ [null, null, DevicePDP11.prototype.readR6SUPER, DevicePDP11.prototype.writeR6SUPER, "R6SUPER"], + [PDP11.UNIBUS.R6USER]: /* 177717 */ [null, null, DevicePDP11.prototype.readR6USER, DevicePDP11.prototype.writeR6USER, "R6USER"], [PDP11.UNIBUS.LAERR]: /* 177740 */ [null, null, DevicePDP11.prototype.readCTRL, DevicePDP11.prototype.writeCTRL, "CTRL", PDP11.MODEL_1170], [PDP11.UNIBUS.LSIZE]: /* 177760 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "LSIZE", PDP11.MODEL_1170], [PDP11.UNIBUS.HSIZE]: /* 177762 */ [null, null, DevicePDP11.prototype.readSIZE, DevicePDP11.prototype.writeSIZE, "HSIZE", PDP11.MODEL_1170], diff --git a/modules/pdp11/lib/memory.js b/modules/pdp11/lib/memory.js index a2ed951cb..cc2534331 100644 --- a/modules/pdp11/lib/memory.js +++ b/modules/pdp11/lib/memory.js @@ -56,7 +56,7 @@ var littleEndian = (TYPEDARRAYS? (function() { })() : false); /** - * MemoryPDP11(cpu, addr, used, size, type, controller) + * MemoryPDP11(bus, addr, used, size, type, controller) * * The Bus component allocates Memory objects so that each has a memory buffer with a * block-granular starting address and an address range equal to bus.nBlockSize; however, @@ -89,17 +89,17 @@ var littleEndian = (TYPEDARRAYS? (function() { * is available). * * @constructor - * @param {CPUStatePDP11} cpu + * @param {BusPDP11} bus * @param {number|null} [addr] of lowest used address in block * @param {number} [used] portion of block in bytes (0 for none); must be a multiple of 4 * @param {number} [size] of block's buffer in bytes (0 for none); must be a multiple of 4 * @param {number} [type] is one of the MemoryPDP11.TYPE constants (default is MemoryPDP11.TYPE.NONE) * @param {Object} [controller] is an optional memory controller component */ -function MemoryPDP11(cpu, addr, used, size, type, controller) +function MemoryPDP11(bus, addr, used, size, type, controller) { var i; - this.cpu = cpu; + this.bus = bus; this.id = (MemoryPDP11.idBlock += 2); this.adw = null; this.offset = 0; @@ -209,10 +209,10 @@ MemoryPDP11.TYPE = { RAM: 1, ROM: 2, VIDEO: 3, - CONTROLLER: 4, - COLORS: ["black", "blue", "green", "cyan"], - NAMES: ["NONE", "RAM", "ROM", "VID", "H/W"] + CONTROLLER: 4 }; +MemoryPDP11.TYPE_COLORS = ["black", "blue", "green", "cyan"]; +MemoryPDP11.TYPE_NAMES = ["NONE", "RAM", "ROM", "VID", "H/W"]; /* * Last used block ID (used for debugging only) @@ -469,7 +469,7 @@ MemoryPDP11.prototype = { * @param {string} sMessage */ printAddr: function(sMessage) { - if (DEBUG && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { + if (DEBUG && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY)) { this.dbg.printMessage(sMessage + ' ' + (this.addr != null? ('@' + this.dbg.toStrBase(this.addr)) : '#' + this.id), true); } }, @@ -557,7 +557,7 @@ MemoryPDP11.prototype = { * @return {number} */ readNone: function readNone(off, addr) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM) /* && !off */) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY) /* && !off */) { this.dbg.printMessage("attempt to read invalid block %" + str.toHex(this.addr), true); this.dbg.stopCPU(); } @@ -572,7 +572,7 @@ MemoryPDP11.prototype = { * @param {number} addr */ writeNone: function writeNone(off, v, addr) { - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM) /* && !off */) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY) /* && !off */) { this.dbg.printMessage("attempt to write " + str.toHexWord(v) + " to invalid block %" + str.toHex(this.addr), true); this.dbg.stopCPU(); } @@ -624,7 +624,7 @@ MemoryPDP11.prototype = { */ readWordMemory: function readWordMemory(off, addr) { if (PDP11.MEMFAULT && (off & 0x1)) { - this.cpu.fault(addr); + this.bus.fault(addr); } if (BYTEARRAYS) { return this.ab[off] | (this.ab[off + 1] << 8); @@ -668,7 +668,7 @@ MemoryPDP11.prototype = { */ writeWordMemory: function writeWordMemory(off, w, addr) { if (PDP11.MEMFAULT && (off & 0x1)) { - this.cpu.fault(addr); + this.bus.fault(addr); } if (BYTEARRAYS) { this.ab[off] = (w & 0xff); @@ -763,7 +763,7 @@ MemoryPDP11.prototype = { */ readByteLE: function readByteLE(off, addr) { var b = this.ab[off]; - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY)) { this.dbg.printMessage("Memory.readByte(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(b), true); } return b; @@ -778,7 +778,7 @@ MemoryPDP11.prototype = { */ readWordBE: function readWordBE(off, addr) { if (PDP11.MEMFAULT && (off & 0x1)) { - this.cpu.fault(addr); + this.bus.fault(addr); } return this.dv.getUint16(off, true); }, @@ -793,7 +793,7 @@ MemoryPDP11.prototype = { readWordLE: function readWordLE(off, addr) { var w; if (PDP11.MEMFAULT && (off & 0x1)) { - this.cpu.fault(addr); + this.bus.fault(addr); } /* * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset @@ -804,7 +804,7 @@ MemoryPDP11.prototype = { } else { w = this.ab[off] | (this.ab[off+1] << 8); } - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY)) { this.dbg.printMessage("Memory.readWord(" + this.dbg.toStrBase(addr) + "): " + this.dbg.toStrBase(w), true); } return w; @@ -832,7 +832,7 @@ MemoryPDP11.prototype = { writeByteLE: function writeByteLE(off, b, addr) { this.ab[off] = b; this.fDirty = true; - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY)) { this.dbg.printMessage("Memory.writeByte(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(b) + ")", true); } }, @@ -846,7 +846,7 @@ MemoryPDP11.prototype = { */ writeWordBE: function writeWordBE(off, w, addr) { if (PDP11.MEMFAULT && (off & 0x1)) { - this.cpu.fault(addr); + this.bus.fault(addr); } this.dv.setUint16(off, w, true); this.fDirty = true; @@ -861,7 +861,7 @@ MemoryPDP11.prototype = { */ writeWordLE: function writeWordLE(off, w, addr) { if (PDP11.MEMFAULT && (off & 0x1)) { - this.cpu.fault(addr); + this.bus.fault(addr); } /* * TODO: For non-WORDBUS machines, it remains to be seen if there's any advantage to checking the offset @@ -874,7 +874,7 @@ MemoryPDP11.prototype = { this.ab[off+1] = w >> 8; } this.fDirty = true; - if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEM)) { + if (DEBUGGER && this.dbg && this.dbg.messageEnabled(MessagesPDP11.MEMORY)) { this.dbg.printMessage("Memory.writeWord(" + this.dbg.toStrBase(addr) + "," + this.dbg.toStrBase(w) + ")", true); } } diff --git a/modules/pdp11/lib/messages.js b/modules/pdp11/lib/messages.js index 38ca2f2c2..7a1927419 100644 --- a/modules/pdp11/lib/messages.js +++ b/modules/pdp11/lib/messages.js @@ -36,7 +36,8 @@ var MessagesPDP11 = { CPU: 0x00000001, TRAP: 0x00000010, BUS: 0x00000040, - MEM: 0x00000080, + MEMORY: 0x00000080, + DEVICE: 0x00000100, KEYBOARD: 0x00010000, KEYS: 0x00020000, DISK: 0x00200000, @@ -67,7 +68,8 @@ MessagesPDP11.CATEGORIES = { "cpu": MessagesPDP11.CPU, "trap": MessagesPDP11.TRAP, "bus": MessagesPDP11.BUS, - "mem": MessagesPDP11.MEM, + "memory": MessagesPDP11.MEMORY, + "device": MessagesPDP11.DEVICE, "keyboard": MessagesPDP11.KEYBOARD, // "kbd" is also allowed as shorthand for "keyboard"; see doMessages() "key": MessagesPDP11.KEYS, // using "key" instead of "keys", since the latter is a method on JavasScript objects "disk": MessagesPDP11.DISK, diff --git a/modules/pdp11/lib/ram.js b/modules/pdp11/lib/ram.js index ae533f7ed..67840ad85 100644 --- a/modules/pdp11/lib/ram.js +++ b/modules/pdp11/lib/ram.js @@ -83,6 +83,24 @@ RAMPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.bus = bus; this.cpu = cpu; this.dbg = dbg; + this.initRAM(); +}; + +/** + * initRAM() + * + * @this {RAMPDP11} + */ +RAMPDP11.prototype.initRAM = function() +{ + if (!this.fAllocated && this.sizeRAM) { + if (this.bus.addMemory(this.addrRAM, this.sizeRAM, MemoryPDP11.TYPE.RAM)) { + this.fAllocated = true; + } + } + if (!this.fAllocated) { + Component.error("No RAM allocated"); + } this.setReady(); }; @@ -96,15 +114,12 @@ RAMPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) */ RAMPDP11.prototype.powerUp = function(data, fRepower) { - if (!fRepower) { - /* - * The Computer powers up the CPU last, at which point CPUState state is restored, - * which includes the Bus state, and since we use the Bus to allocate all our memory, - * memory contents are already restored for us, so we don't need the usual restore - * logic. We just need to call reset(), to allocate memory for the RAM. - */ - this.reset(); - } + /* + * The Computer powers up the CPU last, at which point CPUState state is restored, + * which includes the Bus state, and since we use the Bus to allocate all our memory, + * memory contents are already restored for us, so we don't need the usual restore + * logic. + */ return true; }; @@ -124,7 +139,7 @@ RAMPDP11.prototype.powerDown = function(fSave, fShutdown) * our memory, memory contents are already saved for us, so we don't need the usual * save logic. */ - return (fSave)? this.save() : true; + return true; }; /** @@ -134,41 +149,9 @@ RAMPDP11.prototype.powerDown = function(fSave, fShutdown) */ RAMPDP11.prototype.reset = function() { - if (!this.fAllocated && this.sizeRAM) { - if (this.bus.addMemory(this.addrRAM, this.sizeRAM, MemoryPDP11.TYPE.RAM)) { - this.fAllocated = true; - } - } - if (!this.fAllocated) { - Component.error("No RAM allocated"); - } -}; - -/** - * save() - * - * This implements save support for the RAMPDP11 component. - * - * @this {RAMPDP11} - * @return {Object} - */ -RAMPDP11.prototype.save = function() -{ - return null; -}; - -/** - * restore(data) - * - * This implements restore support for the RAMPDP11 component. - * - * @this {RAMPDP11} - * @param {Object} data - * @return {boolean} true if successful, false if failure - */ -RAMPDP11.prototype.restore = function(data) -{ - return true; + /* + * If you want to zero RAM on reset, then this would be a good place to do it. + */ }; /** diff --git a/modules/pdp11/lib/rom.js b/modules/pdp11/lib/rom.js index baa978281..0539e1183 100644 --- a/modules/pdp11/lib/rom.js +++ b/modules/pdp11/lib/rom.js @@ -120,7 +120,7 @@ Component.subclass(ROMPDP11); * ROM contents, so in that case, having a reset() function that restores the original ROM data * might be useful; then again, it might not, depending on what you're trying to debug. * - * If we do add reset(), then we'll want to change copyROM() to hang onto the original + * If we do add reset(), then we'll want to change initROM() to hang onto the original * ROM data; currently, we release it after copying it into the read-only memory allocated * via bus.addMemory(). */ @@ -139,7 +139,7 @@ ROMPDP11.prototype.initBus = function(cmp, bus, cpu, dbg) this.bus = bus; this.cpu = cpu; this.dbg = dbg; - this.copyROM(); + this.initROM(); }; /** @@ -266,11 +266,11 @@ ROMPDP11.prototype.doneLoad = function(sURL, sROMData, nErrorCode) this.abROM[i] = str.parseInt(asHexData[i], 16); } } - this.copyROM(); + this.initROM(); }; /** - * copyROM() + * initROM() * * This function is called by both initBus() and doneLoad(), but it cannot copy the the ROM data into place * until after initBus() has received the Bus component AND doneLoad() has received the abROM data. When both @@ -278,7 +278,7 @@ ROMPDP11.prototype.doneLoad = function(sURL, sROMData, nErrorCode) * * @this {ROMPDP11} */ -ROMPDP11.prototype.copyROM = function() +ROMPDP11.prototype.initROM = function() { if (!this.isReady()) { if (!this.sFilePath) { @@ -341,9 +341,7 @@ ROMPDP11.prototype.addROM = function(addr) if (DEBUG) this.log("addROM(): copying ROM to " + str.toHexLong(addr) + " (" + str.toHexLong(this.abROM.length) + " bytes)"); var i; for (i = 0; i < this.abROM.length; i++) { - if (DEBUGGER && this.dbg) this.dbg.disableMessages(); this.bus.setByteDirect(addr + i, this.abROM[i]); - if (DEBUGGER && this.dbg) this.dbg.enableMessages(); } return true; } diff --git a/modules/shared/templates/components.css b/modules/shared/templates/components.css index 1837bb4bf..3cde83dd7 100644 --- a/modules/shared/templates/components.css +++ b/modules/shared/templates/components.css @@ -34,7 +34,7 @@ } .pcjs-label { font-size: small; - line-height: 19px; + line-height: 20px; vertical-align: middle; float: left; font-family: Monaco, "Lucida Console", monospace; @@ -52,14 +52,14 @@ font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; } .pcjs-register { font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; border: 1px solid black; } @@ -101,6 +101,18 @@ line-height: 34px; /* the equivalent of "vertical-align: middle" for single-line elements */ background-color: #ffffff; } +.pcjs-panel-group { + color: #ffffff; + background-color: #404040; +} +.pcjs-tripled-label { + text-align: right; + padding: 8px; +} +.pcjs-ledpad { + line-height: 32px; + background-color: #000000; +} .pcjs-led { float: left; width: 8px; @@ -108,19 +120,18 @@ margin: 4px; border: 1px solid black; text-align: center; - line-height: 19px; /* the equivalent of "vertical-align: middle" for single-line elements */ + vertical-align: middle; background-color: #000000; } .pcjs-rled { - float: left; width: 8px; height: 8px; margin: 4px; border: 1px solid black; border-radius: 50%; text-align: center; - line-height: 19px; /* the equivalent of "vertical-align: middle" for single-line elements */ - background-color: #000000; + vertical-align: middle; + background-color: #ff0000; } .pcjs-screen { clear: both; diff --git a/modules/shared/templates/components.xsl b/modules/shared/templates/components.xsl index c18a6cb8f..7b72d6fb9 100644 --- a/modules/shared/templates/components.xsl +++ b/modules/shared/templates/components.xsl @@ -2,6 +2,7 @@ + ]> @@ -331,6 +332,7 @@ margin:0 auto; position:; position:relative; + text-align:; float:left; @@ -412,7 +414,7 @@
-
+

diff --git a/versions/pc8080/1.30.1/components.css b/versions/pc8080/1.30.1/components.css index 4a449ca97..f1782cf02 100644 --- a/versions/pc8080/1.30.1/components.css +++ b/versions/pc8080/1.30.1/components.css @@ -29,7 +29,7 @@ } .pcjs-label { font-size: small; - line-height: 19px; + line-height: 20px; vertical-align: middle; float: left; font-family: Monaco, "Lucida Console", monospace; @@ -47,14 +47,14 @@ font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; } .pcjs-register { font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; border: 1px solid black; } @@ -96,6 +96,18 @@ line-height: 34px; background-color: #ffffff; } +.pcjs-panel-group { + color: #ffffff; + background-color: #404040; +} +.pcjs-tripled-label { + text-align: right; + padding: 8px; +} +.pcjs-ledpad { + line-height: 32px; + background-color: #000000; +} .pcjs-led { float: left; width: 8px; @@ -103,19 +115,18 @@ margin: 4px; border: 1px solid black; text-align: center; - line-height: 19px; + vertical-align: middle; background-color: #000000; } .pcjs-rled { - float: left; width: 8px; height: 8px; margin: 4px; border: 1px solid black; border-radius: 50%; text-align: center; - line-height: 19px; - background-color: #000000; + vertical-align: middle; + background-color: #ff0000; } .pcjs-screen { clear: both; diff --git a/versions/pc8080/1.30.1/components.xsl b/versions/pc8080/1.30.1/components.xsl index 2be9e05c8..1bf53a560 100644 --- a/versions/pc8080/1.30.1/components.xsl +++ b/versions/pc8080/1.30.1/components.xsl @@ -1,6 +1,7 @@ ]> @@ -330,6 +331,7 @@ margin:0 auto; position:; position:relative; + text-align:; float:left; @@ -411,7 +413,7 @@
-
+

diff --git a/versions/pcx86/1.30.1/components.css b/versions/pcx86/1.30.1/components.css index 4a449ca97..f1782cf02 100644 --- a/versions/pcx86/1.30.1/components.css +++ b/versions/pcx86/1.30.1/components.css @@ -29,7 +29,7 @@ } .pcjs-label { font-size: small; - line-height: 19px; + line-height: 20px; vertical-align: middle; float: left; font-family: Monaco, "Lucida Console", monospace; @@ -47,14 +47,14 @@ font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; } .pcjs-register { font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; border: 1px solid black; } @@ -96,6 +96,18 @@ line-height: 34px; background-color: #ffffff; } +.pcjs-panel-group { + color: #ffffff; + background-color: #404040; +} +.pcjs-tripled-label { + text-align: right; + padding: 8px; +} +.pcjs-ledpad { + line-height: 32px; + background-color: #000000; +} .pcjs-led { float: left; width: 8px; @@ -103,19 +115,18 @@ margin: 4px; border: 1px solid black; text-align: center; - line-height: 19px; + vertical-align: middle; background-color: #000000; } .pcjs-rled { - float: left; width: 8px; height: 8px; margin: 4px; border: 1px solid black; border-radius: 50%; text-align: center; - line-height: 19px; - background-color: #000000; + vertical-align: middle; + background-color: #ff0000; } .pcjs-screen { clear: both; diff --git a/versions/pcx86/1.30.1/components.xsl b/versions/pcx86/1.30.1/components.xsl index 14ba82384..3dc004f64 100644 --- a/versions/pcx86/1.30.1/components.xsl +++ b/versions/pcx86/1.30.1/components.xsl @@ -1,6 +1,7 @@ ]> @@ -330,6 +331,7 @@ margin:0 auto; position:; position:relative; + text-align:; float:left; @@ -411,7 +413,7 @@
-
+

diff --git a/versions/pcx86/1.30.1/pcx86-dbg.js b/versions/pcx86/1.30.1/pcx86-dbg.js index 7d9c94ec9..c897ddac6 100644 --- a/versions/pcx86/1.30.1/pcx86-dbg.js +++ b/versions/pcx86/1.30.1/pcx86-dbg.js @@ -1364,9 +1364,9 @@ a;Lf(this);return a},function(a){this.S|=2;this.A-=14+(-1===this.D?0:2);if(-1!== this.ja?b|=-16777216:80386<=this.ja&&2!=this.ba&&(a|=b<<16);this.nb(this.D+2,b);this.A-=12}return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Ec=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.zd=this.Ec+a,this.S|=2,this.A-=11);return a},function(a){-1===this.D||this.ca&131072?E.call(this,6):(this.Mc=this.oa(this.D+2)&(this.R|this.R<<8),a&=65535,this.Sd=this.Mc+a,this.S|=2,this.A-=12);return a},function(){this.A-=2+(-1===this.D?0:1);return this.$a},W,function(a){this.ca&131072? E.call(this,6):(Of(this,a),this.A-=-1===this.D?3:6,this.S|=2);return a},W],tk=[W,W,W,W,Hh,Kh,Jh,Ih]; function X(a){bb.call(this,"ChipSet",a,X,32768);var b=a.model;b&&!uk[b]&&w("Unrecognized ChipSet model: "+b);this.ja=uk[b]||vk;this.C=[];b=wk(a[xk]);this.C[0]=[b,b];null==b&&(this.ia=[360,360],(b=a.floppies)&&b.length&&(this.ia=b),yk(this,zk,this.ia.length),yk(this,Ak,a.monitor||(this.ja=kg&&(this.cb=this.Da=2);this.ka=a.scaleTimers||!1;this.Ub=a.rtcDate;this.Db=!1;a.sound&&(this.sb=this.Fa=null,window&&(this.sb=window.AudioContext|| -window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"Coprocessor"}; +window.webkitAudioContext),this.sb&&(this.Fa=new this.sb));this.reset(!0);xb(this)}jb(X);var vk=5150.9,kg=5170,uk={5150:5150,5160:5160,5170:kg,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:vk,deskpro386:5180},xk="sw1",Bk="sw2",Ck={jl:1,ONE:0,Io:64,Go:128,xo:192,Lc:192,Xg:6},Dk={Ho:16,to:32,yo:48,Lc:48,Xg:4},zk=1,Ak=4,Ek={5150:[{},{}]};Ek[5150][0][zk]={Lc:192,gd:{1:0,2:64,3:128,4:192},Pd:"Number of Floppy Drives"};Ek[5150][0][3]={Lc:2,gd:{0:0,1:2},Pd:"FPU"}; Ek[5150][0][Ak]={Lc:48,gd:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},Pd:"Monitor Type"};Ek[5150][0][5]={Lc:12,gd:{16:0,32:4,48:8,64:12},Pd:"Base Memory (16Kb Increments)"};Ek[5150][1][6]={Lc:31,gd:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},Pd:"Expansion Memory (32Kb Increments)"};Ek[5160]=[{},{}];Ek[5160][0][zk]=Ek[5150][0][zk];Ek[5160][0][3]=Ek[5150][0][3];Ek[5160][0][Ak]=Ek[5150][0][Ak]; -Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"Coprocessor"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype; +Ek[5160][0][5]={Lc:12,gd:{64:0,128:4,192:8,256:12},Pd:"Base Memory (64Kb Increments)"};Ek[5160][1][6]=Ek[5150][1][6];Ek[5160.101]=[{},{}];Ek[5160.101][0][5]={Lc:143,gd:{128:1,256:130,512:8,640:141},Pd:"Base Memory (128Kb Increments)"};Ek[5160.101][0][3]={Lc:16,gd:{0:0,1:16},Pd:"FPU"};Ek[5160.101][1][2]={Lc:1,gd:{0:0,1:1},Pd:"Floppy Type"};Ek[5160.101][1][zk]=Ek[5150][0][zk];Ek[5160.101][1][Ak]=Ek[5150][0][Ak];l=X.prototype; l.Pb=function(a,b,c){switch(b){case xk:return this.qa[b]=c,Fk(this,0,b),!0;case Bk:if(5150==(this.ja|0)||5160.101==this.ja)return this.qa[b]=c,Fk(this,1,b),!0;break;case "swdesc":return this.qa[b]=c,!0}return!1}; l.Ic=function(a,b,c,d){this.ga=b;this.F=c;this.ha=d;this.X=a;this.Tb=Jb(a,"FPU");yk(this,3,this.Tb?1:0,!0);this.B=Jb(a,"Keyboard");this.gb=c.Y.Id/1193181;qc(b,this,Gk);yc(b,this,Hk);this.jab;b++){var c=13>=b?Sk(e,b):e.A[b];a&&(a+="\n");a+="CMOS["+u(b)+"]: "+u(c)}e.ha.O(a)})}lf(c,26,this.Pm.bind(this))}; @@ -1386,7 +1386,7 @@ function Fk(a,b,c){for(var d="",e=a.qa[c],f=1;8>=f;f++){var g="pcjs-bitCell";f|| function Yk(a,b,c){for(var d=null,e=Ek[a.ja]||Ek[a.ja|0]||Ek[5150],f=0;fg.Ab[0]&&(g.Ab[0]=255,g.Ab[1]--,0>g.Ab[1]&&(g.Ab[1]=255)));return h}function ql(a,b,c,d,e,f){var g=a.L[b];z(a,768)&&x(a,d,e,f,"DMA"+b+".CHANNEL"+c+".COUNT["+g.Kb+"]",null,!0);a=g.Dc[c];a.Ab[g.Kb]=a.Fc[g.Kb]=e;g.Kb^=1}function rl(a,b,c,d){var e=a.L[b],f=e.Yb|1;e.Yb&=-16;z(a,768)&&x(a,c,null,d,"DMA"+b+".STATUS",f,!0);return f} function sl(a,b,c,d,e){var f=a.L[b];z(a,768)&&x(a,c,d,e,"DMA"+b+".REQ",null,!0);a=d&3;f.Yb=f.Yb&~(16<=Se&&(this.Ea=this.pa=2);this.Z=a.scaleTimers||!1;this.Xa=a.rtcDate;this.Oa=!1;a.sound&&(this.La=this.qa=null,window&&(this.La=window.AudioContext|| -window.webkitAudioContext),this.La&&(this.qa=new this.La));this.reset(!0);t(this)}Ta(U);var Ci=5150.9,Se=5170,Bi={5150:5150,5160:5160,5170:Se,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Ci,deskpro386:5180},Ei="sw1",Ii="sw2",Ji={Yj:1,ONE:0,gn:64,en:128,Wm:192,lc:192,eg:6},Ki={fn:16,Sm:32,Xm:48,lc:48,eg:4},Gi=1,Hi=4,W={5150:[{},{}]};W[5150][0][Gi]={lc:192,Nc:{1:0,2:64,3:128,4:192},ed:"Number of Floppy Drives"};W[5150][0][3]={lc:2,Nc:{0:0,1:2},ed:"Coprocessor"}; +window.webkitAudioContext),this.La&&(this.qa=new this.La));this.reset(!0);t(this)}Ta(U);var Ci=5150.9,Se=5170,Bi={5150:5150,5160:5160,5170:Se,att6300:5160.101,mpc1600:5150.101,z150:5160.15,compaq:5150.102,other:Ci,deskpro386:5180},Ei="sw1",Ii="sw2",Ji={Yj:1,ONE:0,gn:64,en:128,Wm:192,lc:192,eg:6},Ki={fn:16,Sm:32,Xm:48,lc:48,eg:4},Gi=1,Hi=4,W={5150:[{},{}]};W[5150][0][Gi]={lc:192,Nc:{1:0,2:64,3:128,4:192},ed:"Number of Floppy Drives"};W[5150][0][3]={lc:2,Nc:{0:0,1:2},ed:"FPU"}; W[5150][0][Hi]={lc:48,Nc:{0:0,1:16,2:32,3:48,none:0,tv:16,color:32,cga:32,mda:48,mono:48,ega:0,vga:0},ed:"Monitor Type"};W[5150][0][5]={lc:12,Nc:{16:0,32:4,48:8,64:12},ed:"Base Memory (16Kb Increments)"};W[5150][1][6]={lc:31,Nc:{0:0,32:1,64:2,96:3,128:4,160:5,192:6,224:7,256:8,288:9,320:10,352:11,384:12,416:13,448:14,480:15,512:16,544:17,576:18},ed:"Expansion Memory (32Kb Increments)"};W[5160]=[{},{}];W[5160][0][Gi]=W[5150][0][Gi];W[5160][0][3]=W[5150][0][3];W[5160][0][Hi]=W[5150][0][Hi]; -W[5160][0][5]={lc:12,Nc:{64:0,128:4,192:8,256:12},ed:"Base Memory (64Kb Increments)"};W[5160][1][6]=W[5150][1][6];W[5160.101]=[{},{}];W[5160.101][0][5]={lc:143,Nc:{128:1,256:130,512:8,640:141},ed:"Base Memory (128Kb Increments)"};W[5160.101][0][3]={lc:16,Nc:{0:0,1:16},ed:"Coprocessor"};W[5160.101][1][2]={lc:1,Nc:{0:0,1:1},ed:"Floppy Type"};W[5160.101][1][Gi]=W[5150][0][Gi];W[5160.101][1][Hi]=W[5150][0][Hi];l=U.prototype; +W[5160][0][5]={lc:12,Nc:{64:0,128:4,192:8,256:12},ed:"Base Memory (64Kb Increments)"};W[5160][1][6]=W[5150][1][6];W[5160.101]=[{},{}];W[5160.101][0][5]={lc:143,Nc:{128:1,256:130,512:8,640:141},ed:"Base Memory (128Kb Increments)"};W[5160.101][0][3]={lc:16,Nc:{0:0,1:16},ed:"FPU"};W[5160.101][1][2]={lc:1,Nc:{0:0,1:1},ed:"Floppy Type"};W[5160.101][1][Gi]=W[5150][0][Gi];W[5160.101][1][Hi]=W[5150][0][Hi];l=U.prototype; l.zb=function(a,b,c){switch(b){case Ei:return this.la[b]=c,Li(this,0,b),!0;case Ii:if(5150==(this.ca|0)||5160.101==this.ca)return this.la[b]=c,Li(this,1,b),!0;break;case "swdesc":return this.la[b]=c,!0}return!1}; l.pc=function(a,b,c,d){this.ia=b;this.A=c;this.Ia=d;this.ba=a;this.od=mb(a,"FPU");Fi(this,3,this.od?1:0,!0);this.C=mb(a,"Keyboard");this.Ga=c.T.Yc/1193181;Sb(b,this,Mi);Ub(b,this,Ni);this.ca=Se){this.H=16;this.P=0;this.R=16;this.ua=0;this.W=160;512<=$i(this)&&(this.W|=16);3==+aj(this,Hi,void 0)&&(this.W|=64);5180==(this.ca|0)&&(this.W|=12);this.va=3;this.I= @@ -1369,7 +1369,7 @@ function Li(a,b,c){for(var d="",e=a.la[c],f=1;8>=f;f++){var g="pcjs-bitCell";f|| function aj(a,b,c){for(var d=null,e=W[a.ca]||W[a.ca|0]||W[5150],f=0;fd.hb[0]&&(d.hb[0]=255,d.hb[1]--,0>d.hb[1]&&(d.hb[1]=255)));return e}function xj(a,b,c,d){a=a.G[b];c=a.$b[c];c.hb[a.Ib]=c.jc[a.Ib]=d;a.Ib^=1} function yj(a,b){a=a.G[b];b=a.Db|1;a.Db&=-16;return b}function zj(a,b,c){a=a.G[b];b=c&3;a.Db=a.Db&~(16<>2].$b[b&3],c,d,e)}function Bj(a,b,c){b=a.G[b>>2].$b[b&3];b.Ef&&b.qg&&b.Sf?(c&&(b.done=c),b.Rd||Gj(a,b,!0)):c&&c(!0)} function Gj(a,b,c){c&&(b.count=b.hb[1]<<8|b.hb[0],b.type=b.mode&12,b.si=b.Ff=!1);for(var d=!1;0<=b.count&&(c=b.xf<<16|b.gb[1]<<8|b.gb[0],4==b.type?(d=!0,function(c){b.qg.call(b.Ef,b.Sf,-1,function(e,g){0>e&&(b.si||(b.si=!0),e=255);b.Rd||a.ia.Mc(c,e);(d=g)&&setTimeout(function(){Hj(b)||Gj(a,b)},0)})}(c)):8==b.type?(c=a.ia.Jb(c),0>b.qg.call(b.Ef,b.Sf,c)&&(b.Ff=!0)):0!=b.type&&(b.Ff=!0)),!d&&!Hj(b););} diff --git a/versions/pdpjs/1.30.1/components.css b/versions/pdpjs/1.30.1/components.css index 4a449ca97..f1782cf02 100644 --- a/versions/pdpjs/1.30.1/components.css +++ b/versions/pdpjs/1.30.1/components.css @@ -29,7 +29,7 @@ } .pcjs-label { font-size: small; - line-height: 19px; + line-height: 20px; vertical-align: middle; float: left; font-family: Monaco, "Lucida Console", monospace; @@ -47,14 +47,14 @@ font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; } .pcjs-register { font-family: Monaco, "Lucida Console", monospace; font-size: small; text-align: center; - line-height: 19px; + line-height: 20px; vertical-align: middle; border: 1px solid black; } @@ -96,6 +96,18 @@ line-height: 34px; background-color: #ffffff; } +.pcjs-panel-group { + color: #ffffff; + background-color: #404040; +} +.pcjs-tripled-label { + text-align: right; + padding: 8px; +} +.pcjs-ledpad { + line-height: 32px; + background-color: #000000; +} .pcjs-led { float: left; width: 8px; @@ -103,19 +115,18 @@ margin: 4px; border: 1px solid black; text-align: center; - line-height: 19px; + vertical-align: middle; background-color: #000000; } .pcjs-rled { - float: left; width: 8px; height: 8px; margin: 4px; border: 1px solid black; border-radius: 50%; text-align: center; - line-height: 19px; - background-color: #000000; + vertical-align: middle; + background-color: #ff0000; } .pcjs-screen { clear: both; diff --git a/versions/pdpjs/1.30.1/components.xsl b/versions/pdpjs/1.30.1/components.xsl index 9d9d19b93..0fe803637 100644 --- a/versions/pdpjs/1.30.1/components.xsl +++ b/versions/pdpjs/1.30.1/components.xsl @@ -1,6 +1,7 @@ ]> @@ -330,6 +331,7 @@ margin:0 auto; position:; position:relative; + text-align:; float:left; @@ -411,7 +413,7 @@
-
+

diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index 6e1eac17b..9fd884407 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -688,216 +688,217 @@ function da(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf( function oa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}var pa={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",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 qa(a,b,c){var d=0,e=a.length,f=0;for(c||(c=function(a,b){return a>b?1:a>1,l;l=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 ua(a,b,c,d){var e=0,f=null,g=null;if("object"==typeof resources&&(f=resources[a]))return d&&d(a,f,e),[f,e];if(c&&"function"==typeof resources)return resources(a,function(b,c){d&&d(a,b,c)}),g;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var n="",p;for(p in b)b.hasOwnProperty(p)&&(n&&(n+="&"),n+=p+"="+encodeURIComponent(b[p]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ga(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function m(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function Ba(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} +typeof b){var m="",p;for(p in b)b.hasOwnProperty(p)&&(m&&(m+="&"),m+=p+"="+encodeURIComponent(b[p]));m=m.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(m)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),g=[f,e]);return g}function ga(){return"http://"+(window?window.location.host:"www.pcjs.org")} +function n(a){window&&window.alert(a)}function va(a){var b=!1;window&&(b=window.confirm(a));return b}var wa=null;function xa(){if(null==wa){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}wa=a}return wa}function ya(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} function Ca(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Da(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}function Ea(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0b?this.Xa=this.id:(this.xb=this.id.substr(0,b),this.Xa=this.id.substr(b+1));this[a]=c;this.v={ready:!1,hb:!1,yb:!1,fa:!1,error:!1};this.qb=null;this.v.error=!1;this.J={};this.j=null;this.ha=d||0;t.push(this)}var Ua=void 0,Va={}; -if(window){Ua||(Ua=window.location.search.substr(1));for(var Wa,Xa=/\+/g,Ya=/([^&=]+)=?([^&]*)/g;Wa=Ya.exec(Ua);)Va[decodeURIComponent(Wa[1].replace(Xa," "))]=decodeURIComponent(Wa[2].replace(Xa," "))}function Za(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} -function y(a,b){b||(b=r);a.prototype=Za(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var $a=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else $a={},t=[];function ab(a,b,c){$a[a]&&b&&($a[a][b]=c)}function bb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;bb?this.Ta=this.id:(this.vb=this.id.substr(0,b),this.Ta=this.id.substr(b+1));this[a]=c;this.v={ready:!1,gb:!1,wb:!1,fa:!1,error:!1};this.qb=null;this.v.error=!1;this.J={};this.j=null;this.ha=d||0;t.push(this)}var Va=void 0,Wa={}; +if(window){Va||(Va=window.location.search.substr(1));for(var Xa,Ya=/\+/g,Za=/([^&=]+)=?([^&]*)/g;Xa=Za.exec(Va);)Wa[decodeURIComponent(Xa[1].replace(Ya," "))]=decodeURIComponent(Xa[2].replace(Ya," "))}function $a(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} +function y(a,b){b||(b=r);a.prototype=$a(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var ab=window.PCjs.Machines||(window.PCjs.Machines={}),t=window.PCjs.Components||(window.PCjs.Components=[])}else ab={},t=[];function bb(a,b,c){ab[a]&&b&&(ab[a][b]=c)}function cb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.Y&&(this.Y=10);15>2;this.f=this.qa-1;this.A=this.G/this.qa|0;this.Ka=[];this.F=[];this.pc=[Bb,Cb,Db,Eb];a=new H(this.b);Fb(a,this.j);this.P=Array(this.A);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ka[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&F(this.j,64)&&D(this.j,e[4]+".readByte("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=Hb(d,b|4186112,-1,1);this.j&&F(this.j,64)&&D(this.j,"warning: unconverted read access to byte @"+I(this.j,b)+": "+I(this.j,c),!0,!0);return c} -function Cb(a,b,c){var d=!1,e=this.controller,f=e.Ka[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Ka[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&F(this.j,64)&&D(this.j,f[4]+".writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(Hb(e,c|4186112,b,1),this.j&&F(this.j,64)&&D(this.j,"warning: unconverted write access to byte @"+I(this.j,c)+": "+I(this.j,b),!0,!0))} -function Db(a,b){var c=-1,d=this.controller;(a=d.Ka[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&F(this.j,64)&&D(this.j,a[4]+".readWord("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=Hb(d,b|4186112,-1,0);this.j&&F(this.j,64)&&D(this.j,"warning: unconverted read access to word @"+I(this.j,b)+": "+I(this.j,c),!0,!0);return c} -function Eb(a,b,c){var d=!1,e=this.controller;if(a=e.Ka[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.j&&F(this.j,64)&&D(this.j,a[4]+".writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(Hb(e,c|4186112,b,0),this.j&&F(this.j,64)&&D(this.j,"warning: unconverted write access to word @"+I(this.j,c)+": "+I(this.j,b),!0,!0))} -function Gb(a,b){if(b!=a.B){var c;if(a.B){c=(1<>>a.Y;0>>a.Y;0g&&(q=g);if(n&&n.size){if(n.type==d&&n.controller==e){if(f+g<=n.w)return n.ob+=n.w-f,n.w=f,!0;if(f>=n.w+n.ob){q=n.size-(f-p);q>g&&(q=g);n.ob=f-n.w+q;f=p+a.qa;g-=q;l++;continue}}return Ib(1,f,g)}f=new H(a.b,f,q,a.qa,d,e);Fb(f,a.j,n);a.P[l++]=f;f=p+a.qa;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Lb[d]+" at "+k(b,8,!0)),!0):Ib(2,b,c)} -h.Ua=function(a){return this.P[(a&this.g)>>>this.Y].ub(a&this.f,a)};h.ma=function(a){return this.P[(a&this.g)>>>this.Y].cc(a&this.f,a)};function Mb(a,b){return a.P[(b&a.g)>>>a.Y].Cb(b&a.f,b)}h.mb=function(a,b){this.P[(a&this.g)>>>this.Y].vb(a&this.f,b&255,a)};h.Wa=function(a,b){this.P[(a&this.g)>>>this.Y].nc(a&this.f,b&65535,a)}; -function Nb(a){for(var b=0,c=[],d=0;da.b.Wb))for(var f=e[0]?e[0].bind(b):null,g=e[1]?e[1].bind(b):null,l=e[2]?e[2].bind(b):null,n=e[3]?e[3].bind(b):null,p=a,q=+d,e=e[4],v=+d;v<=q;v+=2){var u=v&8191;void 0!==p.Ka[u]?m("I/O address already registered: "+k(v,8,!0)):p.Ka[u]=[f,g,l,n,e||"unknown",!1]}}}function Pb(a,b){a.F.push(b)}function Ib(a,b,c){m("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1} -function J(a){r.call(this,"Device",a,J);this.g={data:0,Gd:0,sb:20,Jd:0};this.f={Hd:0,Hb:-1}}y(J);h=J.prototype;h.Ga=function(a,b,c,d){this.B=b;this.b=c;this.j=d;var e=this;this.f.Hb=Qb(this.b,function(){e.f.Ma|=128;e.f.Ma&64&&(Rb(e.b,0,6,64),Sb(e.b,e.f.Hb,1E3/60))});Ob(b,this,K);Pb(b,this.reset.bind(this));G(this)};h.Gc=function(){var a=this.f.Ma;this.f.Ma&=-129;return a};h.kd=function(a){this.f.Ma=a;a&64&&Sb(this.b,this.f.Hb,1E3/60);this.f.Ma=a&-129}; -h.Ic=function(){var a=this.b;return a.G&62337|a.wa<<5|a.xa<<1};h.md=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.wa=a>>5&3;b.xa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.tb!=c&&(b.tb=c,Tb(b))}Ub(this)};h.Jc=function(){var a=this.b.Oa;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Kc=function(){return this.b.Eb};h.Lc=function(){return this.b.Pa};h.nd=function(a){var b=this.b;b.Pa!=a&&(b.Pa=a,a&16?(b.ab=4194303,b.ya=3915776):(b.ab=262143,b.ya=253952),Tb(b));Ub(this)}; -function Ub(a){a.g.sb=a.g.sb&-8|(a.b.tb?a.b.Pa&16?1:2:4)}h.Tc=function(a){return this.b.T[1][a>>1&7]};h.vd=function(a,b){this.b.T[1][b>>1&7]=a&65295};h.Rc=function(a){return this.b.T[1][(a>>1&7)+8]};h.td=function(a,b){this.b.T[1][(b>>1&7)+8]=a&65295};h.Sc=function(a){return this.b.pa[1][a>>1&7]};h.ud=function(a,b){b=b>>1&7;this.b.pa[1][b]=a;this.b.T[1][b]&=65295};h.Qc=function(a){return this.b.pa[1][(a>>1&7)+8]};h.sd=function(a,b){b=(b>>1&7)+8;this.b.pa[1][b]=a;this.b.T[1][b]&=65295}; -h.Fc=function(a){return this.b.T[0][a>>1&7]};h.jd=function(a,b){this.b.T[0][b>>1&7]=a&65295};h.Dc=function(a){return this.b.T[0][(a>>1&7)+8]};h.gd=function(a,b){this.b.T[0][(b>>1&7)+8]=a&65295};h.Ec=function(a){return this.b.pa[0][a>>1&7]};h.hd=function(a,b){b=b>>1&7;this.b.pa[0][b]=a;this.b.T[0][b]&=65295};h.Cc=function(a){return this.b.pa[0][(a>>1&7)+8]};h.fd=function(a,b){b=(b>>1&7)+8;this.b.pa[0][b]=a;this.b.T[0][b]&=65295};h.Zc=function(a){return this.b.T[3][a>>1&7]}; -h.Bd=function(a,b){this.b.T[3][b>>1&7]=a&65295};h.Xc=function(a){return this.b.T[3][(a>>1&7)+8]};h.zd=function(a,b){this.b.T[3][(b>>1&7)+8]=a&65295};h.Yc=function(a){return this.b.pa[3][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.b.pa[3][b]=a;this.b.T[3][b]&=65295};h.Wc=function(a){return this.b.pa[3][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.b.pa[3][b]=a;this.b.T[3][b]&=65295};h.ra=function(a){a&=7;return this.b.K&2048?this.b.Ha[a]:this.b.u[a]}; -h.ua=function(a,b){b&=7;this.b.K&2048?this.b.Ha[b]=a:this.b.u[b]=a};h.Yb=function(){return this.b.K&49152?this.b.ta[0]:this.b.u[6]};h.ic=function(a){this.b.K&49152?this.b.ta[0]=a:this.b.u[6]=a};h.ac=function(){return this.b.u[7]};h.lc=function(a){this.b.u[7]=a};h.sa=function(a){a&=7;return this.b.K&2048?this.b.u[a]:this.b.Ha[a]};h.va=function(a,b){b&=7;this.b.K&2048?this.b.u[b]=a:this.b.Ha[b]=a};h.Zb=function(){return 1==(this.b.K&49152)>>14?this.b.u[6]:this.b.ta[1]}; -h.jc=function(a){1==(this.b.K&49152)>>14?this.b.u[6]=a:this.b.ta[1]=a};h.$b=function(){return 3==(this.b.K&49152)>>14?this.b.u[6]:this.b.ta[3]};h.kc=function(a){3==(this.b.K&49152)>>14?this.b.u[6]=a:this.b.ta[3]=a};h.Bc=function(a){return this.b.fc[a-65504>>1]};h.ed=function(a,b){this.b.fc[b-65504>>1]=a};h.bc=function(a){return 65520==a?61183:0};h.mc=function(){};h.Vc=function(){return 1};h.xd=function(){};h.Ac=function(){return this.b.$};h.dd=function(){this.b.$=0};h.Hc=function(){return this.b.ec}; -h.ld=function(a,b){b&1||(a&=255);this.b.ec=a};h.Mc=function(){return this.b.Fb};h.od=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Fb=a;b.D|=2};h.Uc=function(){return this.b.Qa&65280};h.wd=function(a){this.b.Qa=a|255};h.Nc=function(){return Vb(this.b)};h.pd=function(a){Wb(this.b,a&-1809|Vb(this.b)&1808);this.b.D|=128};h.reset=function(){this.g.sb=this.g.sb&-120|20;this.f.Ma=0}; -var L={},K=(L[62592]=[null,null,J.prototype.Tc,J.prototype.vd,"SISDR"],L[62608]=[null,null,J.prototype.Rc,J.prototype.td,"SDSDR"],L[62624]=[null,null,J.prototype.Sc,J.prototype.ud,"SISAR"],L[62640]=[null,null,J.prototype.Qc,J.prototype.sd,"SDSAR"],L[62656]=[null,null,J.prototype.Fc,J.prototype.jd,"KISDR"],L[62672]=[null,null,J.prototype.Dc,J.prototype.gd,"KDSDR"],L[62688]=[null,null,J.prototype.Ec,J.prototype.hd,"KISAR"],L[62704]=[null,null,J.prototype.Cc,J.prototype.fd,"KDSAR"],L[62798]=[null,null, -J.prototype.Lc,J.prototype.nd,"MMR3"],L[65382]=[null,null,J.prototype.Gc,J.prototype.kd,"LKS"],L[65402]=[null,null,J.prototype.Ic,J.prototype.md,"MMR0"],L[65404]=[null,null,J.prototype.Jc,null,"MMR1"],L[65406]=[null,null,J.prototype.Kc,null,"MMR2"],L[65408]=[null,null,J.prototype.Zc,J.prototype.Bd,"UISDR"],L[65424]=[null,null,J.prototype.Xc,J.prototype.zd,"UDSDR"],L[65440]=[null,null,J.prototype.Yc,J.prototype.Ad,"UISAR"],L[65456]=[null,null,J.prototype.Wc,J.prototype.yd,"UDSAR"],L[65472]=[J.prototype.ra, -J.prototype.ua,J.prototype.ra,J.prototype.ua,"R0SET0"],L[65473]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R1SET0"],L[65474]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R2SET0"],L[65475]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R3SET0"],L[65476]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R4SET0"],L[65477]=[J.prototype.ra,J.prototype.ua,J.prototype.ra,J.prototype.ua,"R5SET0"],L[65478]=[J.prototype.Yb,J.prototype.ic,J.prototype.Yb, -J.prototype.ic,"R6KERNEL"],L[65479]=[J.prototype.ac,J.prototype.lc,J.prototype.ac,J.prototype.lc,"R7KERNEL"],L[65480]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R0SET1"],L[65481]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R1SET1"],L[65482]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R2SET1"],L[65483]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R3SET1"],L[65484]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R4SET1"], -L[65485]=[J.prototype.sa,J.prototype.va,J.prototype.sa,J.prototype.va,"R5SET1"],L[65486]=[J.prototype.Zb,J.prototype.jc,J.prototype.Zb,J.prototype.jc,"R6SUPER"],L[65487]=[J.prototype.$b,J.prototype.kc,J.prototype.$b,J.prototype.kc,"R6USER"],L[65504]=[null,null,J.prototype.Bc,J.prototype.ed,"CTRL",1170],L[65520]=[null,null,J.prototype.bc,J.prototype.mc,"LSIZE",1170],L[65522]=[null,null,J.prototype.bc,J.prototype.mc,"HSIZE",1170],L[65524]=[null,null,J.prototype.Vc,J.prototype.xd,"SYSID",1170],L[65526]= -[null,null,J.prototype.Ac,J.prototype.dd,"CPUERR",1170],L[65528]=[null,null,J.prototype.Hc,J.prototype.ld,"MB",1170],L[65530]=[null,null,J.prototype.Mc,J.prototype.od,"PIR"],L[65532]=[null,null,J.prototype.Uc,J.prototype.wd,"SL"],L[65534]=[null,null,J.prototype.Nc,J.prototype.pd,"PSW"],L);K[62594]=K[62592];K[62596]=K[62592];K[62598]=K[62592];K[62600]=K[62592];K[62602]=K[62592];K[62604]=K[62592];K[62606]=K[62592];K[62610]=K[62608];K[62612]=K[62608];K[62614]=K[62608];K[62616]=K[62608];K[62618]=K[62608]; -K[62620]=K[62608];K[62622]=K[62608];K[62626]=K[62624];K[62628]=K[62624];K[62630]=K[62624];K[62632]=K[62624];K[62634]=K[62624];K[62636]=K[62624];K[62638]=K[62624];K[62642]=K[62640];K[62644]=K[62640];K[62646]=K[62640];K[62648]=K[62640];K[62650]=K[62640];K[62652]=K[62640];K[62654]=K[62640];K[62658]=K[62656];K[62660]=K[62656];K[62662]=K[62656];K[62664]=K[62656];K[62666]=K[62656];K[62668]=K[62656];K[62670]=K[62656];K[62674]=K[62672];K[62676]=K[62672];K[62678]=K[62672];K[62680]=K[62672];K[62682]=K[62672]; -K[62684]=K[62672];K[62686]=K[62672];K[62690]=K[62688];K[62692]=K[62688];K[62694]=K[62688];K[62696]=K[62688];K[62698]=K[62688];K[62700]=K[62688];K[62702]=K[62688];K[62706]=K[62704];K[62708]=K[62704];K[62710]=K[62704];K[62712]=K[62704];K[62714]=K[62704];K[62716]=K[62704];K[62718]=K[62704];K[65410]=K[65408];K[65412]=K[65408];K[65414]=K[65408];K[65416]=K[65408];K[65418]=K[65408];K[65420]=K[65408];K[65422]=K[65408];K[65426]=K[65424];K[65428]=K[65424];K[65430]=K[65424];K[65432]=K[65424];K[65434]=K[65424]; -K[65436]=K[65424];K[65438]=K[65424];K[65442]=K[65440];K[65444]=K[65440];K[65446]=K[65440];K[65448]=K[65440];K[65450]=K[65440];K[65452]=K[65440];K[65454]=K[65440];K[65458]=K[65456];K[65460]=K[65456];K[65462]=K[65456];K[65464]=K[65456];K[65466]=K[65456];K[65468]=K[65456];K[65470]=K[65456];K[65506]=K[65504];K[65508]=K[65504];K[65510]=K[65504];K[65512]=K[65504];K[65514]=K[65504];K[65516]=K[65504];K[65518]=K[65504]; -La(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.f=new Int32Array(this.A,0,d>>2),lc(this,hc?mc:nc);else{this.f=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},X:function(a){return this.f[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&this.b.O(4,b);b=a>>2;a=(a&3)<<3;var c=this.f[b]>>a;return 24>a?c&65535:c&255|(this.f[b+1]&255)<<8},oa:function(a,b){var c=a>>2;a=(a&3)<<3;this.f[c]= -this.f[c]&~(255<>2;a=(a&3)<<3;24>a?this.f[c]=this.f[c]&~(65535<>8);this.La=!0},U:function(a,b){if(this.j&&null!=this.w){var c=this.j;sc(c,this.w+a,1,c.N)&&c.ea(!0)}return this.Bb(a,b)},ca:function(a,b){if(this.j&&null!=this.w){var c=this.j;sc(c,this.w+a,2,c.N)&&c.ea(!0)}return this.Cb(a,b)},ka:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;sc(d,this.w+a, -1,d.G)&&d.ea(!0)}this.g?this.F(a,b,c):this.wb(a,b,c)},xa:function(a,b,c){if(this.j&&null!=this.w){var d=this.j;sc(d,this.w+a,2,d.G)&&d.ea(!0)}this.g?this.F(a,b,c):this.Ib(a,b,c)},N:function(a){return this.C[a]},W:function(a,b){a=this.C[a];this.j&&F(this.j,128)&&D(this.j,"Memory.readByte("+I(this.j,b)+"): "+I(this.j,a),!0);return a},aa:function(a,b){a&1&&this.b.O(4,b);return this.G.getUint16(a,!0)},da:function(a,b){a&1&&this.b.O(4,b);a=this.I[a>>1];this.j&&F(this.j,128)&&D(this.j,"Memory.readWord("+ -I(this.j,b)+"): "+I(this.j,a),!0);return a},ia:function(a,b){this.C[a]=b;this.La=!0},la:function(a,b,c){this.C[a]=b;this.La=!0;this.j&&F(this.j,128)&&D(this.j,"Memory.writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0)},wa:function(a,b,c){a&1&&this.b.O(4,c);this.G.setUint16(a,b,!0);this.La=!0},ya:function(a,b,c){a&1&&this.b.O(4,c);this.I[a>>1]=b;this.La=!0;this.j&&F(this.j,128)&&D(this.j,"Memory.writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0)}}; -function Fb(a,b,c){a.j=b;a.B=a.J=0;c&&((a.B=c.B)&&rc(a,qc,!1),(a.J=c.J)&&pc(a,qc,!1))}function tc(a,b){b?--a.J||(a.vb=a.g?a.F:a.wb,a.nc=a.g?a.H:a.Ib):--a.B||(a.ub=a.Bb,a.cc=a.Cb)}function pc(a,b,c){c&&a.J||(a.vb=!a.g&&b[1]||a.F,a.nc=!a.g&&b[3]||a.H);if(c||void 0===c)a.wb=b[1]||a.F,a.Ib=b[3]||a.H}function rc(a,b,c){c&&a.B||(a.ub=b[0]||a.L,a.cc=b[2]||a.M);if(c||void 0===c)a.Bb=b[0]||a.L,a.Cb=b[2]||a.M}function lc(a,b){b||(b=uc);rc(a,b,void 0);pc(a,b,void 0)} -var uc=[],oc=[H.prototype.X,H.prototype.oa,H.prototype.ga,H.prototype.Xa],qc=[H.prototype.U,H.prototype.ka,H.prototype.ca,H.prototype.xa];if(wb)var nc=[H.prototype.N,H.prototype.ia,H.prototype.aa,H.prototype.wa],mc=[H.prototype.W,H.prototype.la,H.prototype.da,H.prototype.ya]; -function vc(a,b){r.call(this,"CPU",a,vc,1);var c=a.multiplier||1;this.Ja=a.cycles||b;this.Na=c;this.Za=Math.round(this.Ja/1E4)/100;this.Va=this.Za*this.Na;this.v.ba=!1;this.v.Gb=!1;this.v.gb=a.autoStart;this.v.Lb=!1;this.v.$a=!1;this.jb=this.ia=0;this.kb=a.csStart;this.bb=a.csInterval;this.cb=a.csStop;this.L=[];this.Ub=this.cd.bind(this);G(this)}y(vc);var wc=["power","reset"];h=vc.prototype; -h.Ga=function(a,b,c,d){this.F=a;this.B=b;this.j=d;for(b=0;b=a.ia&&(a.ia+=a.bb,c=!0);0<=a.cb&&a.cb<=Cc(a)&&(a.bb=a.cb=-1,zc(a),a.ea(),c=!0);c&&a.i(Cc(a)+" cycles: checksum="+k(a.jb))}} -function Dc(a,b,c,d){if(a.J[b]){void 0===c&&(vb(a,"Value for "+b+" is invalid"),a.ea());var e=a.j&&a.j.ia||8;c=!a.v.ba||a.v.Lb?8==e?ba(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}} -h.ja=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.J[b]=c;a=!0;break;case "run":this.J[b]=c;c.onclick=function(){var a;if(a=d.F)if(a=d.F,a.v.fa)a=!0;else{var b=null,c,l=bb(a.id);for(c=0;ca.ca/a.Va?b=1:d=!0;a.Na=b;b=a.Za*a.Na;if(a.Va!=b){a.Va=b;b=a.Va.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.i("target speed: "+b)}c&&a.F&&a.F.nb()}Fc(a,a.X);a.X=0;a.W=ra();a.da=0;Gc(a);return d}function Qb(a,b){var c=a.L.length;a.L.push([-1,b]);return c}function Sb(a,b,c){0<=b&&ba.L[b][0]&&(c*=a.Ja*a.Na/1E3,a.L[b][0]=c)}function Hc(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||b>d[0]&&(b=d[0])}return b} -function Ic(a,b){for(var c=a.L.length-1;0<=c;c--){var d=a.L[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}} -h.cd=function(){if(this.v.ba){this.ib>=this.Ja&&Gc(this,!0);this.oa=0;this.Ia=ra();if(this.da){var a=this.Ia-this.da;a>this.rb&&(this.W+=a,this.W>this.Ia&&(this.W=this.Ia))}try{do{var b=Hc(this,this.v.$a?1:this.Ra);try{this.fb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.N-this.b;Ic(this,c);this.oa+=c;this.X+=c;Fc(this,0,!0);Bc(this,c);this.ka-=c;if(0>=this.ka){this.ka+=this.Ra;15<=++this.Rb&&(this.F&&this.F.za(),this.Rb=0);break}}while(this.v.ba)}catch(e){this.ea();M(this);this.F&&this.F.stop(ra(), -Cc(this));vb(this,e.stack||e.message);return}if(this.v.ba){a=setTimeout;b=this.Ub;this.da=ra();c=this.rb;this.oa&&(c=Math.round(c*this.oa/this.Ra));var c=c-(this.da-this.Ia),d=this.da-this.W;d&&(this.ca=Math.round(this.X/(10*d))/100,864E5<=d&&(this.ga=0,Ec(this)));if(0>c||this.cac&&(this.W-=c),c=0;this.ib+=this.oa;this.da+=c;a(b,c)}}}; -h.eb=function(a){if(ib(this))return!1;if(this.v.ba)return this.i(this.toString()+" busy"),!1;Ec(this);this.v.ba=!0;this.v.Gb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.F&&(a&&this.F.nb(!0),this.F.start(this.W,Cc(this)));M(this,!0);setTimeout(this.Ub,0);return!0};h.fb=function(){return 0};h.ea=function(a){if(this.v.ba){this.N-=this.b;this.b=0;Fc(this,this.X);this.X=0;this.v.ba=!1;var b=this.J.run;b&&(b.textContent="Run");this.F&&this.F.stop(ra(),Cc(this));M(this)}this.v.complete=a}; -function M(a,b){a.F&&a.F.za(b)} -function Jc(a){this.Wb=+a.model||1170;this.yc=a.resetAddr||0;vc.call(this,a,6666667);this.pb=0;this.decode=Kc.bind(this);this.R=65536;this.S=32768;this.Z=65535;this.V=32768;this.K=15;this.u=[0,0,0,0,0,0,0,this.yc];this.Ha=[0,0,0,0,0,0];this.ta=[0,0,0,0];this.xa=this.C=0;this.vc=[4,2,0,1];this.T=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.pa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.zc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.fc=[0,0,0,0,0,0,0,0];this.g=this.f=this.Ya=this.H=this.I=this.D=this.ec=0;this.la=-1;Lc(this);this.v.complete=this.v.rc=!1}y(Jc,vc);h=Jc.prototype;h.Sb=function(){Tb(this)};h.reset=function(){this.v.ba&&this.ea();Lc(this);yc(this);this.v.error=!1;this.parent.reset.call(this)}; -function Lc(a){a.Qa=255;a.$=0;a.Fb=0;a.G=0;a.Oa=0;a.Eb=0;a.Pa=0;a.tb=0;a.wa=0;a.ab=262143;a.ya=253952;a.A=[];a.D|=2;a.B&&Tb(a)}function Tb(a){a.tb?(a.aa=65536,a.M=a.uc,a.U=a.dc,a.Vb=a.Dd,Gb(a.B,a.Pa&16?22:18)):(a.aa=0,a.M=a.tc,a.U=a.$c,a.Vb=a.Cd,Gb(a.B,16))}h.Ob=function(){return 0};h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ga,this.Na]);a.set(2,Nb(this.B));return a.data()}; -h.restore=function(a){var b=a[1];this.ga=b[1];Ec(this,b[3]);a:{b=this.B;a=a[2];var c;for(c=0;c>1)+2;10>this.Y&&(this.Y=10);15>2;this.f=this.ta-1;this.C=this.I/this.ta|0;this.Fa=[];this.w=0;this.B=[];this.hc=[Db,Eb,Fb,Gb];a=new H(this);Hb(a,this.j);this.W=Array(this.C);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Fa[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.j&&E(this.j,64)&&B(this.j,e[4]+".readByte("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=Ib(d,b|4186112,-1,1);this.j&&E(this.j,64)&&B(this.j,"warning: unconverted read access to byte @"+I(this.j,b)+": "+I(this.j,c),!0,!0);return c} +function Eb(a,b,c){var d=!1,e=this.controller,f=e.Fa[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.Fa[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d?this.j&&E(this.j,64)&&B(this.j,f[4]+".writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(Ib(e,c|4186112,b,1),this.j&&E(this.j,64)&&B(this.j,"warning: unconverted write access to byte @"+I(this.j,c)+": "+I(this.j,b),!0,!0))} +function Fb(a,b){var c=-1,d=this.controller;(a=d.Fa[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return this.j&&E(this.j,64)&&B(this.j,a[4]+".readWord("+I(this.j,b)+"): "+I(this.j,c),!0,!0),c;c=Ib(d,b|4186112,-1,0);this.j&&E(this.j,64)&&B(this.j,"warning: unconverted read access to word @"+I(this.j,b)+": "+I(this.j,c),!0,!0);return c} +function Gb(a,b,c){var d=!1,e=this.controller;if(a=e.Fa[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d?this.j&&E(this.j,64)&&B(this.j,a[4]+".writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0,!0):(Ib(e,c|4186112,b,0),this.j&&E(this.j,64)&&B(this.j,"warning: unconverted write access to word @"+I(this.j,c)+": "+I(this.j,b),!0,!0))} +function Jb(a,b){if(b!=a.F){var c;a.F&&(c=(1<>>a.Y;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.A)return m.ob+=m.A-f,m.A=f,!0;if(f>=m.A+m.ob){q=m.size-(f-p);q>g&&(q=g);m.ob=f-m.A+q;f=p+a.ta;g-=q;l++;continue}}return Ob(1,f,g)}f=new H(a,f,q,a.ta,d,e);Hb(f,a.j,m);a.W[l++]=f;f=p+a.ta;g-=q}return 0>=g?(a.status(Math.floor(c/1024)+"Kb "+Pb[d]+" at "+k(b,8,!0)),!0):Ob(2,b,c)} +function Lb(a,b,c){var d=[];for(b>>>=a.Y;0>>=a.Y;0>>this.Y].tb(a&this.f,a)};h.ia=function(a){return this.W[(a&this.i)>>>this.Y].Yb(a&this.f,a)};function Qb(a,b){var c=b&a.f,d=(b&a.i)>>>a.Y;a.w++;b=a.W[d].Ab(c,b);a.w--;return b}h.mb=function(a,b){this.W[(a&this.i)>>>this.Y].ub(a&this.f,b&255,a)}; +function Rb(a,b,c){a.w++;a.W[(b&a.i)>>>a.Y].Gb(b&a.f,c&255,b);a.w--}h.Sa=function(a,b){this.W[(a&this.i)>>>this.Y].fc(a&this.f,b&65535,a)};function Sb(a){for(var b=0,c=[],d=0;da.b.Vb)){var g=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,m=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;e&1&&(!g&&m&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(m)),!l&&p&&m&&(l=function(a,c){return function(b,d){return a(c(d)&-256|b,d)}.bind(b)}(p,m)));Tb(a,e,e,g,l,m,p,f[4])}}}function Vb(a,b){a.B.push(b)} +function Wb(a,b){a.w||(a.j&&E(a.j,536870912)&&B(a.j,"memory fault on address "+I(a.j,b),!0,!0),a.b.$(4,b))}function Ob(a,b,c){n("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function J(a){r.call(this,"Device",a,J,256);this.i={data:0,Gd:0,rb:20,Jd:0};this.f={Hd:0,Fb:-1}}y(J);h=J.prototype;h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.j=d;var e=this;this.f.Fb=Xb(this.b,function(){e.f.Ha|=128;e.f.Ha&64&&(Yb(e.b,0,6,64),Zb(e.b,e.f.Fb,1E3/60))});Ub(b,this,K);Vb(b,this.reset.bind(this));G(this)}; +h.yc=function(){var a=this.f.Ha;this.f.Ha&=-129;return a};h.fd=function(a){this.f.Ha=a;a&64&&Zb(this.b,this.f.Fb,1E3/60);this.f.Ha=a&-129};h.Ac=function(){var a=this.b;return a.G&62337|a.ra<<5|a.sa<<1};h.hd=function(a){var b=this.b;a&=62337;if(b.G!=a){b.G=a;b.ra=a>>5&3;b.sa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.sb!=c&&(b.sb=c,hc(b))}ic(this)};h.Bc=function(){var a=this.b.Ja;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Cc=function(){return this.b.Cb};h.Dc=function(){return this.b.Ka}; +h.jd=function(a){var b=this.b;b.Ka!=a&&(b.Ka=a,a&16?(b.hb=4194303,b.va=3915776):(b.hb=262143,b.va=253952),hc(b));ic(this)};function ic(a){a.i.rb=a.i.rb&-8|(a.b.sb?a.b.Ka&16?1:2:4)}h.Pc=function(a){return this.b.R[1][a>>1&7]};h.vd=function(a,b){this.b.R[1][b>>1&7]=a&65295};h.Nc=function(a){return this.b.R[1][(a>>1&7)+8]};h.td=function(a,b){this.b.R[1][(b>>1&7)+8]=a&65295};h.Oc=function(a){return this.b.oa[1][a>>1&7]};h.ud=function(a,b){b=b>>1&7;this.b.oa[1][b]=a;this.b.R[1][b]&=65295}; +h.Mc=function(a){return this.b.oa[1][(a>>1&7)+8]};h.sd=function(a,b){b=(b>>1&7)+8;this.b.oa[1][b]=a;this.b.R[1][b]&=65295};h.xc=function(a){return this.b.R[0][a>>1&7]};h.ed=function(a,b){this.b.R[0][b>>1&7]=a&65295};h.vc=function(a){return this.b.R[0][(a>>1&7)+8]};h.cd=function(a,b){this.b.R[0][(b>>1&7)+8]=a&65295};h.wc=function(a){return this.b.oa[0][a>>1&7]};h.dd=function(a,b){b=b>>1&7;this.b.oa[0][b]=a;this.b.R[0][b]&=65295};h.uc=function(a){return this.b.oa[0][(a>>1&7)+8]}; +h.bd=function(a,b){b=(b>>1&7)+8;this.b.oa[0][b]=a;this.b.R[0][b]&=65295};h.Vc=function(a){return this.b.R[3][a>>1&7]};h.Bd=function(a,b){this.b.R[3][b>>1&7]=a&65295};h.Tc=function(a){return this.b.R[3][(a>>1&7)+8]};h.zd=function(a,b){this.b.R[3][(b>>1&7)+8]=a&65295};h.Uc=function(a){return this.b.oa[3][a>>1&7]};h.Ad=function(a,b){b=b>>1&7;this.b.oa[3][b]=a;this.b.R[3][b]&=65295};h.Sc=function(a){return this.b.oa[3][(a>>1&7)+8]};h.yd=function(a,b){b=(b>>1&7)+8;this.b.oa[3][b]=a;this.b.R[3][b]&=65295}; +h.Za=function(a){a&=7;return this.b.L&2048?this.b.Da[a]:this.b.u[a]};h.cb=function(a,b){b&=7;this.b.L&2048?this.b.Da[b]=a:this.b.u[b]=a};h.Gc=function(){return this.b.L&49152?this.b.qa[0]:this.b.u[6]};h.md=function(a){this.b.L&49152?this.b.qa[0]=a:this.b.u[6]=a};h.Jc=function(){return this.b.u[7]};h.pd=function(a){this.b.u[7]=a};h.$a=function(a){a&=7;return this.b.L&2048?this.b.u[a]:this.b.Da[a]};h.eb=function(a,b){b&=7;this.b.L&2048?this.b.u[b]=a:this.b.Da[b]=a}; +h.Hc=function(){return 1==(this.b.L&49152)>>14?this.b.u[6]:this.b.qa[1]};h.nd=function(a){1==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.qa[1]=a};h.Ic=function(){return 3==(this.b.L&49152)>>14?this.b.u[6]:this.b.qa[3]};h.od=function(a){3==(this.b.L&49152)>>14?this.b.u[6]=a:this.b.qa[3]=a};h.tc=function(a){return this.b.ac[a-65504>>1]};h.ad=function(a,b){this.b.ac[b-65504>>1]=a};h.Xb=function(a){return 65520==a?61183:0};h.ec=function(){};h.Rc=function(){return 1};h.xd=function(){};h.sc=function(){return this.b.Z}; +h.$c=function(){this.b.Z=0};h.zc=function(){return this.b.$b};h.gd=function(a,b){b&1||(a&=255);this.b.$b=a};h.Ec=function(){return this.b.Db};h.kd=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Db=a;b.D|=2};h.Qc=function(){return this.b.La&65280};h.wd=function(a){this.b.La=a|255};h.Fc=function(){return jc(this.b)};h.ld=function(a){kc(this.b,a&-1809|jc(this.b)&1808);this.b.D|=128};h.dc=function(a,b){E(this)&&B(this,"writeIgnored("+ba(b)+"): "+ba(a),!0,!0)}; +h.reset=function(){this.i.rb=this.i.rb&-120|20;this.f.Ha=0}; +var L={},K=(L[62592]=[null,null,J.prototype.Pc,J.prototype.vd,"SISDR"],L[62608]=[null,null,J.prototype.Nc,J.prototype.td,"SDSDR"],L[62624]=[null,null,J.prototype.Oc,J.prototype.ud,"SISAR"],L[62640]=[null,null,J.prototype.Mc,J.prototype.sd,"SDSAR"],L[62656]=[null,null,J.prototype.xc,J.prototype.ed,"KISDR"],L[62672]=[null,null,J.prototype.vc,J.prototype.cd,"KDSDR"],L[62688]=[null,null,J.prototype.wc,J.prototype.dd,"KISAR"],L[62704]=[null,null,J.prototype.uc,J.prototype.bd,"KDSAR"],L[62798]=[null,null, +J.prototype.Dc,J.prototype.jd,"MMR3"],L[65382]=[null,null,J.prototype.yc,J.prototype.fd,"LKS"],L[65402]=[null,null,J.prototype.Ac,J.prototype.hd,"MMR0"],L[65404]=[null,null,J.prototype.Bc,J.prototype.dc,"MMR1"],L[65406]=[null,null,J.prototype.Cc,J.prototype.dc,"MMR2"],L[65408]=[null,null,J.prototype.Vc,J.prototype.Bd,"UISDR"],L[65424]=[null,null,J.prototype.Tc,J.prototype.zd,"UDSDR"],L[65440]=[null,null,J.prototype.Uc,J.prototype.Ad,"UISAR"],L[65456]=[null,null,J.prototype.Sc,J.prototype.yd,"UDSAR"], +L[65472]=[null,null,J.prototype.Za,J.prototype.cb,"R0SET0"],L[65473]=[null,null,J.prototype.Za,J.prototype.cb,"R1SET0"],L[65474]=[null,null,J.prototype.Za,J.prototype.cb,"R2SET0"],L[65475]=[null,null,J.prototype.Za,J.prototype.cb,"R3SET0"],L[65476]=[null,null,J.prototype.Za,J.prototype.cb,"R4SET0"],L[65477]=[null,null,J.prototype.Za,J.prototype.cb,"R5SET0"],L[65478]=[null,null,J.prototype.Gc,J.prototype.md,"R6KERNEL"],L[65479]=[null,null,J.prototype.Jc,J.prototype.pd,"R7KERNEL"],L[65480]=[null,null, +J.prototype.$a,J.prototype.eb,"R0SET1"],L[65481]=[null,null,J.prototype.$a,J.prototype.eb,"R1SET1"],L[65482]=[null,null,J.prototype.$a,J.prototype.eb,"R2SET1"],L[65483]=[null,null,J.prototype.$a,J.prototype.eb,"R3SET1"],L[65484]=[null,null,J.prototype.$a,J.prototype.eb,"R4SET1"],L[65485]=[null,null,J.prototype.$a,J.prototype.eb,"R5SET1"],L[65486]=[null,null,J.prototype.Hc,J.prototype.nd,"R6SUPER"],L[65487]=[null,null,J.prototype.Ic,J.prototype.od,"R6USER"],L[65504]=[null,null,J.prototype.tc,J.prototype.ad, +"CTRL",1170],L[65520]=[null,null,J.prototype.Xb,J.prototype.ec,"LSIZE",1170],L[65522]=[null,null,J.prototype.Xb,J.prototype.ec,"HSIZE",1170],L[65524]=[null,null,J.prototype.Rc,J.prototype.xd,"SYSID",1170],L[65526]=[null,null,J.prototype.sc,J.prototype.$c,"CPUERR",1170],L[65528]=[null,null,J.prototype.zc,J.prototype.gd,"MB",1170],L[65530]=[null,null,J.prototype.Ec,J.prototype.kd,"PIR"],L[65532]=[null,null,J.prototype.Qc,J.prototype.wd,"SL"],L[65534]=[null,null,J.prototype.Fc,J.prototype.ld,"PSW"], +L);K[62594]=K[62592];K[62596]=K[62592];K[62598]=K[62592];K[62600]=K[62592];K[62602]=K[62592];K[62604]=K[62592];K[62606]=K[62592];K[62610]=K[62608];K[62612]=K[62608];K[62614]=K[62608];K[62616]=K[62608];K[62618]=K[62608];K[62620]=K[62608];K[62622]=K[62608];K[62626]=K[62624];K[62628]=K[62624];K[62630]=K[62624];K[62632]=K[62624];K[62634]=K[62624];K[62636]=K[62624];K[62638]=K[62624];K[62642]=K[62640];K[62644]=K[62640];K[62646]=K[62640];K[62648]=K[62640];K[62650]=K[62640];K[62652]=K[62640];K[62654]=K[62640]; +K[62658]=K[62656];K[62660]=K[62656];K[62662]=K[62656];K[62664]=K[62656];K[62666]=K[62656];K[62668]=K[62656];K[62670]=K[62656];K[62674]=K[62672];K[62676]=K[62672];K[62678]=K[62672];K[62680]=K[62672];K[62682]=K[62672];K[62684]=K[62672];K[62686]=K[62672];K[62690]=K[62688];K[62692]=K[62688];K[62694]=K[62688];K[62696]=K[62688];K[62698]=K[62688];K[62700]=K[62688];K[62702]=K[62688];K[62706]=K[62704];K[62708]=K[62704];K[62710]=K[62704];K[62712]=K[62704];K[62714]=K[62704];K[62716]=K[62704];K[62718]=K[62704]; +K[65410]=K[65408];K[65412]=K[65408];K[65414]=K[65408];K[65416]=K[65408];K[65418]=K[65408];K[65420]=K[65408];K[65422]=K[65408];K[65426]=K[65424];K[65428]=K[65424];K[65430]=K[65424];K[65432]=K[65424];K[65434]=K[65424];K[65436]=K[65424];K[65438]=K[65424];K[65442]=K[65440];K[65444]=K[65440];K[65446]=K[65440];K[65448]=K[65440];K[65450]=K[65440];K[65452]=K[65440];K[65454]=K[65440];K[65458]=K[65456];K[65460]=K[65456];K[65462]=K[65456];K[65464]=K[65456];K[65466]=K[65456];K[65468]=K[65456];K[65470]=K[65456]; +K[65506]=K[65504];K[65508]=K[65504];K[65510]=K[65504];K[65512]=K[65504];K[65514]=K[65504];K[65516]=K[65504];K[65518]=K[65504];La(function(){for(var a=A(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,d>>2),rc(this,nc?sc:tc);else{this.b=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},V:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ga:function(a,b){a&1&&Wb(this.w,b);b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},pa:function(a,b){var c=a>>2;a=(a&3)<<3;this.b[c]= +this.b[c]&~(255<>2;a=(a&3)<<3;24>a?this.b[c]=this.b[c]&~(65535<>8);this.Ga=!0},S:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,1,c.M)&&c.ea(!0)}return this.zb(a,b)},ca:function(a,b){if(this.j&&null!=this.A){var c=this.j;yc(c,this.A+a,2,c.M)&&c.ea(!0)}return this.Ab(a,b)},la:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;yc(d,this.A+a, +1,d.C)&&d.ea(!0)}this.f?this.F(a,b,c):this.Gb(a,b,c)},sa:function(a,b,c){if(this.j&&null!=this.A){var d=this.j;yc(d,this.A+a,2,d.C)&&d.ea(!0)}this.f?this.F(a,b,c):this.Hb(a,b,c)},N:function(a){return this.C[a]},U:function(a,b){a=this.C[a];this.j&&E(this.j,128)&&B(this.j,"Memory.readByte("+I(this.j,b)+"): "+I(this.j,a),!0);return a},ba:function(a,b){a&1&&Wb(this.w,b);return this.G.getUint16(a,!0)},da:function(a,b){a&1&&Wb(this.w,b);a=this.I[a>>1];this.j&&E(this.j,128)&&B(this.j,"Memory.readWord("+ +I(this.j,b)+"): "+I(this.j,a),!0);return a},ka:function(a,b){this.C[a]=b;this.Ga=!0},ma:function(a,b,c){this.C[a]=b;this.Ga=!0;this.j&&E(this.j,128)&&B(this.j,"Memory.writeByte("+I(this.j,c)+","+I(this.j,b)+")",!0)},ra:function(a,b,c){a&1&&Wb(this.w,c);this.G.setUint16(a,b,!0);this.Ga=!0},Ta:function(a,b,c){a&1&&Wb(this.w,c);this.I[a>>1]=b;this.Ga=!0;this.j&&E(this.j,128)&&B(this.j,"Memory.writeWord("+I(this.j,c)+","+I(this.j,b)+")",!0)}}; +function Hb(a,b,c){a.j=b;a.i=a.J=0;c&&((a.i=c.i)&&xc(a,wc,!1),(a.J=c.J)&&vc(a,wc,!1))}function zc(a,b){b?--a.J||(a.ub=a.f?a.F:a.Gb,a.fc=a.f?a.H:a.Hb):--a.i||(a.tb=a.zb,a.Yb=a.Ab)}function vc(a,b,c){c&&a.J||(a.ub=!a.f&&b[1]||a.F,a.fc=!a.f&&b[3]||a.H);if(c||void 0===c)a.Gb=b[1]||a.F,a.Hb=b[3]||a.H}function xc(a,b,c){c&&a.i||(a.tb=b[0]||a.K,a.Yb=b[2]||a.M);if(c||void 0===c)a.zb=b[0]||a.K,a.Ab=b[2]||a.M}function rc(a,b){b||(b=Ac);xc(a,b,void 0);vc(a,b,void 0)} +var Ac=[],uc=[H.prototype.V,H.prototype.pa,H.prototype.ga,H.prototype.va],wc=[H.prototype.S,H.prototype.la,H.prototype.ca,H.prototype.sa];if(lb)var tc=[H.prototype.N,H.prototype.ka,H.prototype.ba,H.prototype.ra],sc=[H.prototype.U,H.prototype.ma,H.prototype.da,H.prototype.Ta]; +function Bc(a,b){r.call(this,"CPU",a,Bc,1);var c=a.multiplier||1;this.Na=a.cycles||b;this.Ia=c;this.Va=Math.round(this.Na/1E4)/100;this.Ra=this.Va*this.Ia;this.v.aa=!1;this.v.Eb=!1;this.v.fb=a.autoStart;this.v.Kb=!1;this.v.Wa=!1;this.jb=this.ka=0;this.kb=a.csStart;this.Xa=a.csInterval;this.Ya=a.csStop;this.K=[];this.Tb=this.Zc.bind(this);G(this)}y(Bc);var Cc=["power","reset"];h=Bc.prototype; +h.Ca=function(a,b,c,d){this.F=a;this.w=b;this.j=d;for(b=0;b=a.ka&&(a.ka+=a.Xa,c=!0);0<=a.Ya&&a.Ya<=Ic(a)&&(a.Xa=a.Ya=-1,Fc(a),a.ea(),c=!0);c&&a.g(Ic(a)+" cycles: checksum="+k(a.jb))}} +function Jc(a,b,c,d){if(a.J[b]){void 0===c&&(kb(a,"Value for "+b+" is invalid"),a.ea());var e=a.j&&a.j.ga||8;c=!a.v.aa||a.v.Kb?8==e?ba(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}} +h.ja=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.J[b]=c;a=!0;break;case "run":this.J[b]=c;c.onclick=function(){var a;if(a=d.F)if(a=d.F,a.v.fa)a=!0;else{var b=null,c,l=cb(a.id);for(c=0;ca.ca/a.Ra?b=1:d=!0;a.Ia=b;b=a.Va*a.Ia;if(a.Ra!=b){a.Ra=b;b=a.Ra.toFixed(2)+"Mhz";var e=a.J.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.F&&a.F.nb()}Lc(a,a.V);a.V=0;a.U=ra();a.da=0;Mc(a);return d}function Xb(a,b){var c=a.K.length;a.K.push([-1,b]);return c}function Zb(a,b,c){0<=b&&ba.K[b][0]&&(c*=a.Na*a.Ia/1E3,a.K[b][0]=c)}function Nc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||b>d[0]&&(b=d[0])}return b} +function Oc(a,b){for(var c=a.K.length-1;0<=c;c--){var d=a.K[c];0>d[0]||(d[0]-=b,0>=d[0]&&(d[0]=-1,d[1]()))}} +h.Zc=function(){if(this.v.aa){this.ib>=this.Na&&Mc(this,!0);this.pa=0;this.Ea=ra();if(this.da){var a=this.Ea-this.da;a>this.Qb&&(this.U+=a,this.U>this.Ea&&(this.U=this.Ea))}try{do{var b=Nc(this,this.v.Wa?1:this.Ma);try{this.bb(b)}catch(e){if("number"!=typeof e)throw e;}var c=this.N-this.b;Oc(this,c);this.pa+=c;this.V+=c;Lc(this,0,!0);Hc(this,c);this.la-=c;if(0>=this.la){this.la+=this.Ma;15<=++this.Rb&&(this.F&&this.F.ua(),this.Rb=0);break}}while(this.v.aa)}catch(e){this.ea();M(this);this.F&&this.F.stop(ra(), +Ic(this));kb(this,e.stack||e.message);return}if(this.v.aa){a=setTimeout;b=this.Tb;this.da=ra();c=this.Qb;this.pa&&(c=Math.round(c*this.pa/this.Ma));var c=c-(this.da-this.Ea),d=this.da-this.U;d&&(this.ca=Math.round(this.V/(10*d))/100,864E5<=d&&(this.ga=0,Kc(this)));if(0>c||this.cac&&(this.U-=c),c=0;this.ib+=this.pa;this.da+=c;a(b,c)}}}; +h.ab=function(a){if(jb(this))return!1;if(this.v.aa)return this.g(this.toString()+" busy"),!1;Kc(this);this.v.aa=!0;this.v.Eb=!0;var b=this.J.run;b&&(b.textContent="Halt");this.F&&(a&&this.F.nb(!0),this.F.start(this.U,Ic(this)));M(this,!0);setTimeout(this.Tb,0);return!0};h.bb=function(){return 0};h.ea=function(a){if(this.v.aa){this.N-=this.b;this.b=0;Lc(this,this.V);this.V=0;this.v.aa=!1;var b=this.J.run;b&&(b.textContent="Run");this.F&&this.F.stop(ra(),Ic(this));M(this)}this.v.complete=a}; +function M(a,b){a.F&&a.F.ua(b)} +function hd(a){this.Vb=+a.model||1170;this.qc=a.resetAddr||0;Bc.call(this,a,6666667);this.pb=0;this.decode=id.bind(this);this.O=65536;this.P=32768;this.X=65535;this.T=32768;this.L=15;this.u=[0,0,0,0,0,0,0,this.qc];this.Da=[0,0,0,0,0,0];this.qa=[0,0,0,0];this.sa=this.C=0;this.nc=[4,2,0,1];this.R=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.oa=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.rc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.ac=[0,0,0,0,0,0,0,0];this.i=this.f=this.Ua=this.H=this.I=this.D=this.$b=0;this.ma=-1;jd(this);this.v.complete=this.v.jc=!1}y(hd,Bc);h=hd.prototype;h.reset=function(){this.v.aa&&this.ea();jd(this);Ec(this);this.v.error=!1;this.parent.reset.call(this)}; +function jd(a){a.La=255;a.Z=0;a.Db=0;a.G=0;a.Ja=0;a.Cb=0;a.Ka=0;a.sb=0;a.ra=0;a.hb=262143;a.va=253952;a.B=[];a.D|=2;a.w&&hc(a)}function hc(a){a.sb?(a.ba=65536,a.M=a.mc,a.S=a.Zb,a.Ub=a.Dd,Jb(a.w,a.Ka&16?22:18)):(a.ba=0,a.M=a.lc,a.S=a.Wc,a.Ub=a.Cd,Jb(a.w,16))}h.Nb=function(){return 0};h.save=function(){var a=new N(this);a.set(0,[]);a.set(1,[this.ga,this.Ia]);a.set(2,Sb(this.w));return a.data()}; +h.restore=function(a){var b=a[1];this.ga=b[1];Kc(this,b[3]);a:{b=this.w;a=a[2];var c;for(c=0;cb){a.A[f].Ea-=b;break}b-=a.A[f].Ea}a.A.splice(f+1,0,{Ea:b,Xb:c<<5&224,hc:d,Ab:e})}a.D|=2}function Vb(a){return a.K=a.K&63728|a.Fa()|gd(a)|fd(a)|ed(a)} -function Wb(a,b){a.V=b<<12;a.Z=~b&4;a.S=b<<14;a.R=b<<16;if((b^a.K)&2048)for(var c=a.Ha.length;0<=--c;){var d=a.u[c];a.u[c]=a.Ha[c];a.Ha[c]=d}a.C=b>>14&3;c=a.K>>14&3;a.C!=c&&(a.ta[c]=a.u[6],a.u[6]=a.ta[a.C]);a.D|=2;a.K=b}function O(a,b){a.D&128||(a.V=a.Z=b,a.S=0)}function jd(a,b,c){a.D&128||(a.V=a.Z=a.R=b,a.S=c||0)}function kd(a,b,c,d){a.D&128||(a.V=a.Z=a.R=b,a.S=(c^b)&(d^b))}function ld(a,b){a.D&128||(a.V=a.Z=a.R=b,a.S=a.V^a.R>>1)}function md(a,b,c,d){a.D&128||(a.V=a.Z=a.R=b,a.S=(c^d)&(d^b))} -h.O=function(a){var b=!1;0>this.la?this.la=Vb(this):this.C||(a=4,b=!0);this.G&57344||(this.Oa=63222,this.Eb=a);this.C=0;var c=this.U(a|this.aa),d=this.U(a+2&65535|this.aa);Wb(this,d&-12289|this.la>>2&12288);b&&(this.$|=4,this.u[6]=4);nd(this,this.la);nd(this,this.u[7]);id(this,c);this.D&=-113;this.la=-1;throw a;};function od(a){var b=pd(a),c=pd(a)&-1793;a.K&49152&&(c=c&-225|a.K&63712);id(a,b);Wb(a,c);a.D&=-17} -function qd(a,b,c){var d,e,f,g=0;d=b>>13;a.Pa&a.vc[a.C]||(d&=7);e=a.T[a.C][d];f=(a.pa[a.C][d]<<6)+(b&8191)&a.ab;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Pa&32&&(f=a.zc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.ya&&4186112>f&&(a.$|=32,a.O(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192: -128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.T[a.C][d]=e;if(4194170!==f||a.C)a.wa=a.C,a.xa=d;g&&(g&57344&&(0<=a.la&&(g|=128),a.G&57344||(a.G=a.G|g|a.wa<<5|a.xa<<1),a.O(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.U(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.U(e)|g;a.b-= -8;break;case 6:return e=hd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=hd(a),e=e+a.u[c]&65535,e=a.U(e|a.aa)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Oa=a.Oa<<8|f<<3&248|c);6==c&&!a.C&&d&4&&0>=f&&(a.u[6]<=a.Qa||65534<=a.u[6])&&(a.u[6]<=a.Qa-32?(a.$|=4,a.u[6]=4,a.O(4,24)):(a.$|=8,a.D|=64));return e}h.tc=function(a,b,c){return rd(this,a,b,c)};h.uc=function(a,b,c){return qd(this,rd(this,a,b,c),c)};h.$c=function(a){return this.B.ma(a)};h.dc=function(a){return this.B.ma(qd(this,a,2))}; -h.Cd=function(a,b){this.B.Wa(a,b&65535)};h.Dd=function(a,b){this.B.Wa(qd(this,a,4),b)};function sd(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=rd(a,b,d,2),c&65536||61440!==(a.K&61440)&&(d&=65535),a.C=a.K>>12&3,c=a.U(d|c&a.aa),a.C=a.K>>14&3):c=6!=d||(a.K>>2&12288)===(a.K&12288)?a.u[d]:a.ta[a.K>>12&3];return c} -function td(a,b,c,d){a.G&57344||(a.Oa=22);var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=rd(a,b,e,4),c&65536||(e&=65535),a.C=a.K>>12&3,e=qd(a,e|c&65536,4),a.C=a.K>>14&3,a.B.Wa(e,d)):6!=e||(a.K>>2&12288)===(a.K&12288)?a.u[e]=d:a.ta[a.K>>12&3]=d}function ud(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.M(b,c,3),a=a.B.Ua(c)):a=a.u[c]&255;return a}function vd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.B.ma(a.M(b,c,2)):a.u[c]}function wd(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return rd(a,b,c,8)} -function xd(a,b){var c=a.f=b&7;(b=a.g=(b&56)>>3)?(c=a.M(b,c,3),a=a.B.Ua(c)):a=a.u[c]&255;return a}function yd(a,b){var c=a.f=b&7;return(b=a.g=(b&56)>>3)?a.B.ma(a.M(b,c,2)):a.u[c]}function P(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.Ya=a.M(b,e,7),c=d.call(a,c,a.B.Ua(e)),e&1&&a.b--,a.B.mb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function Q(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=a.M(b,e,6),a.B.Wa(e,d.call(a,c,a.B.ma(e)))):a.u[e]=d.call(a,c,a.u[e])} -function zd(a,b,c,d){var e=a.f=b&7;(b=a.g=(b&56)>>3)?(d=a.M(b,e,5),d&1&&a.b--,a.B.mb(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Ad(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?a.B.Wa(a.M(b,d,4),c):a.u[d]=c&65535;return c}function R(a,b,c){c&&(id(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} -h.fb=function(a){this.v.complete=!0;var b=this.v.rc=this.j&&Bd(this.j),c=a?this.v.Gb?0:1:-1;this.v.Gb=!1;this.N=this.b=a;do{if(b){if(Cd(this.j,this.u[7],c)){this.ea();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.O(168,28):this.D&64?this.O(4,30):this.D&16&&this.O(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;a=null;for(var d=this.Fb&224,e=this.A.length;0<=--e;){if(0d&&(d=this.A[e].Xb,a=this.A[e],this.A.splice(e,1))}d>(this.K&224)&&(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),a?this.O(a.hc,26):this.O(160,26))}else this.D&1&&this.D++;this.G&57344||(this.Oa=0,this.Eb=this.u[7]);this.D=this.D&7|this.K&16;this.decode(hd(this))}while(0>1|b<<16;ld(this,a);return a&65535}function Id(a,b){a=b&2048|b>>1|b<<8;ld(this,a<<8);return a&255}function Jd(a,b){a=b&~a;O(this,a);return a}function Kd(a,b){a=b&~a;O(this,a<<8);return a}function Ld(a,b){a|=b;O(this,a);return a} -function Md(a,b){a|=b;O(this,a<<8);return a}function Nd(a,b){a=~b|65536;jd(this,a);return a&65535}function Od(a,b){a=~b|256;jd(this,a<<8);return a&255}function Pd(a,b){a=b-a;this.D&128||(this.V=this.Z=a,this.S=b&(b^a));return a&65535}function Qd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.V=this.Z=c,this.S=b&(b^c));return a&255}function Rd(a,b){a=b+a;this.D&128||(this.V=this.Z=a,this.S=a&(b^a));return a&65535} -function Sd(a,b){a=b+a;var c=a<<8;this.D&128||(this.V=this.Z=c,this.S=c&(b<<8^c));return a&255}function Td(a,b){a=-b;jd(this,a,a&b&32768);return a&65535}function Ud(a,b){a=-b;jd(this,a<<8,(a&b&128)<<8);return a&255}function Vd(a,b){a=b<<1|this.R>>16&1;ld(this,a);return a&65535}function Wd(a,b){a=b<<1|this.R>>16&1;ld(this,a<<8);return a&255}function Xd(a,b){a=(this.R&65536|b)>>1|b<<16;ld(this,a);return a&65535}function Yd(a,b){a=((this.R&65536)>>8|b)>>1|b<<8;ld(this,a<<8);return a&255} -function Zd(a,b){var c=b-a;md(this,c,a,b);return c&65535}function $d(a,b){var c=b-a;md(this,c<<8,a<<8,b<<8);return c&255}function ae(a,b){this.D&128||(this.V=this.Z=b&65280,this.S=this.R=0);return(b<<8|b>>8)&65535}function be(a,b){a^=b;O(this,a);return a&65535} -function ce(a){var b=yd(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.R=this.S=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.S=32768)}this.u[a]=c&65535;this.V=this.Z=c;this.b-=(this.g?6:7)+b} -function de(a){var b=yd(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=0;b&=63;if(b&32){b=64-b;32>b-1;this.R=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.V=d>>16;this.Z=d>>16|d;this.b-=(this.g?6:7)+b}function S(a){a&1&&(this.R=0);a&2&&(this.S=0);a&4&&(this.Z=1);a&8&&(this.V=0);this.b-=5} -function ee(a){var b=yd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.R=this.S=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.Z=d>>16|d,this.V=d>>16):(this.S=32768,this.Z=d>>15|d,this.V=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.Z=this.V=0,this.S=32768,this.R=65536,this.b-=7}var fe=[0,7,7,10,7,11,9,13];function ge(a){var b=this.b;id(this,wd(this,a));this.b=b-fe[this.g]} -var he=[0,14,14,17,14,18,16,20];function ie(a){var b=this.b,c=wd(this,a);a=a>>6&7;nd(this,this.u[a]);this.u[a]=this.u[7];id(this,c);this.b=b-he[this.g]}var je=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],ke=[7,13,13,17,14,18,17,21];function le(a){var b=yd(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.D&128||(this.V=b>>16,this.Z=this.V|b,this.S=0,this.R=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)id(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function oe(a){Q(this,a,0,ae);this.b-=this.g?9:3+(7==this.f?2:0)}function pe(a){Q(this,a,vd(this,a),be);this.b-=this.g?9:3+(7==this.f?2:0)}function V(){this.O(8,6)}function Kc(a){qe[a>>12].call(this,a)} -var qe=[function(a){re[a>>8&15].call(this,a)},function(a){var b=vd(this,a),c=this.b;O(this,Ad(this,a,b));this.b=c-je[(this.H?8:0)+this.g]+(7!=this.f||this.g?0:2)},function(a){var b=vd(this,a);a=yd(this,a);md(this,b-a,a,b);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){O(this,vd(this,a)&yd(this,a));this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,vd(this,a),Jd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? -2:0)},function(a){Q(this,a,vd(this,a),Ld);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,vd(this,a),Dd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){se[a>>8&15].call(this,a)},function(a){Me[a>>8&15].call(this,a)},function(a){var b=ud(this,a);O(this,zd(this,a,b,1)<<8);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=ud(this,a)<<8;a=xd(this,a)<<8;md(this,b-a,a,b);this.b-=this.g? -4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){O(this,(ud(this,a)&xd(this,a))<<8);this.b-=this.g?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,a,ud(this,a),Kd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){P(this,a,ud(this,a),Md);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,vd(this,a),Zd);this.b-=this.g?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},V],re= -[function(a){Ne[a>>4&15].call(this,a)},function(a){R(this,a,!0)},function(a){R(this,a,!gd(this))},function(a){R(this,a,gd(this))},function(a){R(this,a,!this.Fa()==!fd(this))},function(a){R(this,a,!this.Fa()!=!fd(this))},function(a){R(this,a,!gd(this)&&!this.Fa()==!fd(this))},function(a){R(this,a,gd(this)||!this.Fa()!=!fd(this))},ie,ie,function(a){Oe[a>>6&3].call(this,a)},function(a){Pe[a>>6&3].call(this,a)},function(a){Qe[a>>6&3].call(this,a)},function(a){Re[a>>6&3].call(this,a)},V,V],Oe=[function(a){jd(this, -Ad(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Nd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Rd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Pd);this.b-=this.g?9:3+(7==this.f?2:0)}],Pe=[function(a){Q(this,a,0,Td);this.b-=this.g?11:6},function(a){Q(this,a,ed(this)?1:0,Dd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,ed(this)?1:0,Zd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=yd(this,a);jd(this,a);this.b-=this.g?4:3+(7==this.f? -2:0)}],Qe=[function(a){Q(this,a,0,Xd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Vd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Hd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Fd);this.b-=this.g?9:3+(7==this.f?2:0)}],Re=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.dc(a|65536);id(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=sd(this,a,0);nd(this,a);O(this,a);this.b-=11},function(a){var b=pd(this),c=this.b;td(this,a, -0,b);O(this,b);this.b=c-ke[this.g]},function(a){O(this,Ad(this,a,this.Fa?65535:0));this.b-=this.g?9:3+(7==this.f?2:0)}],Ne=[function(a){Se[a&15].call(this,a)},V,V,V,ge,ge,ge,ge,function(a){if(a&8)this.O(8,6);else{var b=pd(this);a&=7;id(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.K&49152||(this.K=this.K&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.O(8,6)},function(a){Te[a&15].call(this,a)},function(a){Ue[a&15].call(this,a)},oe,oe,oe,oe],Se=[function(){this.K&49152?(this.$|=128,this.O(4, -3)):this.ea();this.b-=7},function(){this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){od(this);this.D|=this.K&16;this.b-=13},function(){this.O(12,1);this.b-=5},function(){this.O(16,4);this.b-=25},function(){this.K&49152||(Lc(this),this.B.reset());this.b-=667},function(){od(this);this.b-=13},V,V,V,V,V,V,V,V,V],Te=[me,function(){this.R=0;this.b-=5},function(){this.S=0;this.b-=5},S,function(){this.Z=1;this.b-=5},S,S,S,function(){this.V=0;this.b-=5},S,S,S,S,S,S,S],Ue=[me,function(){this.R= -65536;this.b-=5},function(){this.S=32768;this.b-=5},T,function(){this.Z=0;this.b-=5},T,T,T,function(){this.V=32768;this.b-=5},T,T,T,T,T,T,T],se=[le,le,ee,ee,ce,ce,de,de,pe,pe,V,V,V,V,ne,ne],Me=[function(a){R(this,a,!this.Fa())},function(a){R(this,a,this.Fa())},function(a){R(this,a,!ed(this)&&!gd(this))},function(a){R(this,a,ed(this)||gd(this))},function(a){R(this,a,!fd(this))},function(a){R(this,a,fd(this))},function(a){R(this,a,!ed(this))},function(a){R(this,a,ed(this))},function(){this.O(24,2); -this.b-=25},function(){this.O(28,5);this.b-=5},function(a){Ve[a>>6&3].call(this,a)},function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},function(a){Ye[a>>6&3].call(this,a)},V,V],Ve=[function(a){jd(this,zd(this,a,0));this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Sd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Qd);this.b-=this.g?9:3+(7==this.f?2:0)}],We=[function(a){P(this,a,0,Ud);this.b-= -this.g?11:6},function(a){P(this,a,ed(this)?1:0,Ed);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,ed(this)?1:0,$d);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){a=xd(this,a);jd(this,a<<8);this.b-=this.g?4:3+(7==this.f?2:0)}],Xe=[function(a){P(this,a,0,Yd);this.b-=this.g?9+(this.Ya&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Wd);this.b-=this.g?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Id);this.b-=this.g?9+(this.Ya&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Gd);this.b-=this.g?9:3+(7== -this.f?2:0)}],Ye=[V,function(a){a=sd(this,a,65536);nd(this,a);O(this,a);this.b-=11},function(a){var b=pd(this),c=this.b;td(this,a,65536,b);O(this,b);this.b=c-ke[this.g]},V];function Ze(a){r.call(this,"ROM",a,Ze);this.f=null;this.C=a.addr;this.g=a.size;this.G=a.writable;this.F=a.alias;this.A=a.file;this.H=da(this.A);if(this.A){a=this.A;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.A+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){$e(c,a,b,f)})}}y(Ze); -Ze.prototype.Ga=function(a,b,c,d){this.B=b;this.b=c;this.j=d;af(this)};Ze.prototype.Ca=function(){if(this.Da){if(this.j){var a=this.j,b=this.id,c=this.C,d=this.g,e=this.Da,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var n=l.o,p=l.a;if(void 0!==n){var q=f,n=[n>>>0,g],v=qa(q,n,a.Kb);0>v&&q.splice(-(v+1),0,n)}p&&(l.a=p.replace(/''/g,'"'))}a.H.push({Id:b,w:c,wc:d,Da:e,Jb:f})}delete this.Da}return!0};Ze.prototype.Ba=function(){return!0}; -function $e(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{ab(a.xb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.Da=l.symbols;if(!a.f.length){m("Empty ROM: "+ -b);return}if(1==a.f.length){m(a.f[0]);return}}catch(n){a.na("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e>>d.Y].wb(e&d.f,a.f[c]&255,e);a.j&&a.j.g--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.F?b.push(a.F):null!=a.F&&a.F.length&&(b=a.F);for(c=0;c>> -e.Y;0>>=e.Y;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.Xa)return;b=oa(b[1]);if(this.I=cb(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.L=d.receiveData){this.status(this.xb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.Ca=function(a,b){if(!b)if(this.Tb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -h.Ba=function(a){return a?this.save():!0};h.reset=function(){ff(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return ff(this)};function ff(a){a.U=0;a.f=0;a.g=128;a.C=[];return!0}h.Db=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.W||8,c=a-this.H%a,this.W&&(b=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.A.value+=b;this.A.scrollTop=this.A.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.i(this.G), -this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.g&=-129;Rb(this.b,100,4,52,this.N)}};var gf={},ef=(gf[65392]=[null,null,W.prototype.Pc,W.prototype.rd,"RCSR"],gf[65394]=[null,null,W.prototype.Oc,W.prototype.qd,"RBUF"],gf[65396]=[null,null,W.prototype.bd,W.prototype.Fd,"XCSR"],gf[65398]=[null,null,W.prototype.ad,W.prototype.Ed,"XBUF"],gf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};hf.prototype.Pb=function(){return-1};hf.prototype.Qb=function(){}; -function kf(a,b,c,d){if(c)if(b){0>a.C&&a.A.length&&(a.C=0);if(0>a.C||b!=a.A[a.C])a.A.splice(0,0,b),a.C=0;a.C--}else a.X?b="end":b=a.A[a.C+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(oa(b.substring(c,f))),c=f+1}}return a} -function lf(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; +h.ua=function(a){if(this.pb&&(a||!this.v.aa||this.v.Kb)){for(a=0;ab){a.B[f].Aa-=b;break}b-=a.B[f].Aa}a.B.splice(f+1,0,{Aa:b,Wb:c<<5&224,cc:d,yb:e})}a.D|=2}function jc(a){return a.L=a.L&63728|a.Ba()|md(a)|ld(a)|kd(a)} +function kc(a,b){a.T=b<<12;a.X=~b&4;a.P=b<<14;a.O=b<<16;if((b^a.L)&2048)for(var c=a.Da.length;0<=--c;){var d=a.u[c];a.u[c]=a.Da[c];a.Da[c]=d}a.C=b>>14&3;c=a.L>>14&3;a.C!=c&&(a.qa[c]=a.u[6],a.u[6]=a.qa[a.C]);a.D|=2;a.L=b}function O(a,b){a.D&128||(a.T=a.X=b,a.P=0)}function pd(a,b,c){a.D&128||(a.T=a.X=a.O=b,a.P=c||0)}function qd(a,b,c,d){a.D&128||(a.T=a.X=a.O=b,a.P=(c^b)&(d^b))}function rd(a,b){a.D&128||(a.T=a.X=a.O=b,a.P=a.T^a.O>>1)}function sd(a,b,c,d){a.D&128||(a.T=a.X=a.O=b,a.P=(c^d)&(d^b))} +h.$=function(a){var b=!1;0>this.ma?this.ma=jc(this):this.C||(a=4,b=!0);this.G&57344||(this.Ja=63222,this.Cb=a);this.C=0;var c=this.S(a|this.ba),d=this.S(a+2&65535|this.ba);kc(this,d&-12289|this.ma>>2&12288);b&&(this.Z|=4,this.u[6]=4);td(this,this.ma);td(this,this.u[7]);od(this,c);this.D&=-113;this.ma=-1;throw a;};function ud(a){var b=vd(a),c=vd(a)&-1793;a.L&49152&&(c=c&-225|a.L&63712);od(a,b);kc(a,c);a.D&=-17} +function wd(a,b,c){var d,e,f,g=0;d=b>>13;a.Ka&a.nc[a.C]||(d&=7);e=a.R[a.C][d];f=(a.oa[a.C][d]<<6)+(b&8191)&a.hb;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.Ka&32&&(f=a.rc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.va&&4186112>f&&(a.Z|=32,a.$(4,12))}switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192: +128;break;default:g=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.R[a.C][d]=e;if(4194170!==f||a.C)a.ra=a.C,a.sa=d;g&&(g&57344&&(0<=a.ma&&(g|=128),a.G&57344||(a.G=a.G|g|a.ra<<5|a.sa<<1),a.$(168,16)),a.G&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!==c&&(e|=g);e=a.S(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!==c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!==c&&(e|=g);e=a.S(e)|g;a.b-= +8;break;case 6:return e=nd(a),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=nd(a),e=e+a.u[c]&65535,e=a.S(e|a.ba)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;!g||a.G&57344||(a.Ja=a.Ja<<8|f<<3&248|c);6==c&&!a.C&&d&4&&0>=f&&(a.u[6]<=a.La||65534<=a.u[6])&&(a.u[6]<=a.La-32?(a.Z|=4,a.u[6]=4,a.$(4,24)):(a.Z|=8,a.D|=64));return e}h.lc=function(a,b,c){return xd(this,a,b,c)};h.mc=function(a,b,c){return wd(this,xd(this,a,b,c),c)};h.Wc=function(a){return this.w.ia(a)};h.Zb=function(a){return this.w.ia(wd(this,a,2))}; +h.Cd=function(a,b){this.w.Sa(a,b&65535)};h.Dd=function(a,b){this.w.Sa(wd(this,a,4),b)};function yd(a,b,c){var d=a.f=b&7;(b=a.i=(b&56)>>3)?(d=xd(a,b,d,2),c&65536||61440!==(a.L&61440)&&(d&=65535),a.C=a.L>>12&3,c=a.S(d|c&a.ba),a.C=a.L>>14&3):c=6!=d||(a.L>>2&12288)===(a.L&12288)?a.u[d]:a.qa[a.L>>12&3];return c} +function zd(a,b,c,d){a.G&57344||(a.Ja=22);var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=xd(a,b,e,4),c&65536||(e&=65535),a.C=a.L>>12&3,e=wd(a,e|c&65536,4),a.C=a.L>>14&3,a.w.Sa(e,d)):6!=e||(a.L>>2&12288)===(a.L&12288)?a.u[e]=d:a.qa[a.L>>12&3]=d}function Ad(a,b){b>>=6;var c=a.I=b&7;(b=a.H=(b&56)>>3)?(c=a.M(b,c,3),a=a.w.Qa(c)):a=a.u[c]&255;return a}function Bd(a,b){b>>=6;var c=a.I=b&7;return(b=a.H=(b&56)>>3)?a.w.ia(a.M(b,c,2)):a.u[c]}function Cd(a,b){var c=a.f=b&7;b=a.i=(b&56)>>3;return xd(a,b,c,8)} +function Dd(a,b){var c=a.f=b&7;(b=a.i=(b&56)>>3)?(c=a.M(b,c,3),a=a.w.Qa(c)):a=a.u[c]&255;return a}function Ed(a,b){var c=a.f=b&7;return(b=a.i=(b&56)>>3)?a.w.ia(a.M(b,c,2)):a.u[c]}function P(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=a.Ua=a.M(b,e,7),c=d.call(a,c,a.w.Qa(e)),e&1&&a.b--,a.w.mb(e,c&255)):a.u[e]=a.u[e]&65280|d.call(a,c,a.u[e])}function Q(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(e=a.M(b,e,6),a.w.Sa(e,d.call(a,c,a.w.ia(e)))):a.u[e]=d.call(a,c,a.u[e])} +function Fd(a,b,c,d){var e=a.f=b&7;(b=a.i=(b&56)>>3)?(d=a.M(b,e,5),d&1&&a.b--,a.w.mb(d,c&255)):a.u[e]=c?d&1?c<<24>>24&65535:a.u[e]&-256|c&255:a.u[e]&-256;return c}function Gd(a,b,c){var d=a.f=b&7;(b=a.i=(b&56)>>3)?a.w.Sa(a.M(b,d,4),c):a.u[d]=c&65535;return c}function R(a,b,c){c&&(od(a,a.u[7]+(b<<24>>23)),a.b-=2);a.b-=3} +h.bb=function(a){this.v.complete=!0;var b=this.v.jc=this.j&&Hd(this.j),c=a?this.v.Eb?0:1:-1;this.v.Eb=!1;this.N=this.b=a;do{if(b){if(Id(this.j,this.u[7],c)){this.ea();break}c=1}if(this.D&&(this.D&112&&(this.D&32?this.$(168,28):this.D&64?this.$(4,30):this.D&16&&this.$(12,32),this.D&=-113),this.D&7))if(this.D&2){this.D&=-3;a=null;for(var d=this.Db&224,e=this.B.length;0<=--e;){if(0d&&(d=this.B[e].Wb,a=this.B[e],this.B.splice(e,1))}d>(this.L&224)&&(this.D&4&&(this.u[7]=this.u[7]+2&65535,this.D&=-5),a?this.$(a.cc,26):this.$(160,26))}else this.D&1&&this.D++;this.G&57344||(this.Ja=0,this.Cb=this.u[7]);this.D=this.D&7|this.L&16;this.decode(nd(this))}while(0>1|b<<16;rd(this,a);return a&65535}function Od(a,b){a=b&2048|b>>1|b<<8;rd(this,a<<8);return a&255}function Pd(a,b){a=b&~a;O(this,a);return a}function Qd(a,b){a=b&~a;O(this,a<<8);return a}function Rd(a,b){a|=b;O(this,a);return a} +function Sd(a,b){a|=b;O(this,a<<8);return a}function Td(a,b){a=~b|65536;pd(this,a);return a&65535}function Ud(a,b){a=~b|256;pd(this,a<<8);return a&255}function Vd(a,b){a=b-a;this.D&128||(this.T=this.X=a,this.P=b&(b^a));return a&65535}function Wd(a,b){a=b-a;var c=a<<8;b<<=8;this.D&128||(this.T=this.X=c,this.P=b&(b^c));return a&255}function Xd(a,b){a=b+a;this.D&128||(this.T=this.X=a,this.P=a&(b^a));return a&65535} +function Yd(a,b){a=b+a;var c=a<<8;this.D&128||(this.T=this.X=c,this.P=c&(b<<8^c));return a&255}function Zd(a,b){a=-b;pd(this,a,a&b&32768);return a&65535}function $d(a,b){a=-b;pd(this,a<<8,(a&b&128)<<8);return a&255}function ae(a,b){a=b<<1|this.O>>16&1;rd(this,a);return a&65535}function be(a,b){a=b<<1|this.O>>16&1;rd(this,a<<8);return a&255}function ce(a,b){a=(this.O&65536|b)>>1|b<<16;rd(this,a);return a&65535}function de(a,b){a=((this.O&65536)>>8|b)>>1|b<<8;rd(this,a<<8);return a&255} +function ee(a,b){var c=b-a;sd(this,c,a,b);return c&65535}function fe(a,b){var c=b-a;sd(this,c<<8,a<<8,b<<8);return c&255}function ge(a,b){this.D&128||(this.T=this.X=b&65280,this.P=this.O=0);return(b<<8|b>>8)&65535}function he(a,b){a^=b;O(this,a);return a&65535} +function ie(a){var b=Ed(this,a);a=a>>6&7;var c=this.u[a];c&32768&&(c|=4294901760);this.O=this.P=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.P=32768)}this.u[a]=c&65535;this.T=this.X=c;this.b-=(this.i?6:7)+b} +function je(a){var b=Ed(this,a);a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.O=this.P=0;b&=63;if(b&32){b=64-b;32>b-1;this.O=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.u[a|1]=d&65535;this.T=d>>16;this.X=d>>16|d;this.b-=(this.i?6:7)+b}function S(a){a&1&&(this.O=0);a&2&&(this.P=0);a&4&&(this.X=1);a&8&&(this.T=0);this.b-=5} +function ke(a){var b=Ed(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];this.O=this.P=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.u[a]=d&65535,this.u[a|1]=c-d*b&65535,this.X=d>>16|d,this.T=d>>16):(this.P=32768,this.X=d>>15|d,this.T=c>>16,-1===b&&65534===this.u[a]&&(this.u[a]=this.u[a|1]=1));this.b-=53}else this.X=this.T=0,this.P=32768,this.O=65536,this.b-=7}var le=[0,7,7,10,7,11,9,13];function me(a){var b=this.b;od(this,Cd(this,a));this.b=b-le[this.i]} +var ne=[0,14,14,17,14,18,16,20];function oe(a){var b=this.b,c=Cd(this,a);a=a>>6&7;td(this,this.u[a]);this.u[a]=this.u[7];od(this,c);this.b=b-ne[this.i]}var pe=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],qe=[7,13,13,17,14,18,17,21];function re(a){var b=Ed(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.u[a];c&32768&&(c|=-65536);b=~~(b*c);this.u[a]=b>>16&65535;this.u[a|1]=b&65535;this.D&128||(this.T=b>>16,this.X=this.T|b,this.P=0,this.O=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)od(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function ue(a){Q(this,a,0,ge);this.b-=this.i?9:3+(7==this.f?2:0)}function ve(a){Q(this,a,Bd(this,a),he);this.b-=this.i?9:3+(7==this.f?2:0)}function V(){this.$(8,6)}function id(a){we[a>>12].call(this,a)} +var we=[function(a){xe[a>>8&15].call(this,a)},function(a){var b=Bd(this,a),c=this.b;O(this,Gd(this,a,b));this.b=c-pe[(this.H?8:0)+this.i]+(7!=this.f||this.i?0:2)},function(a){var b=Bd(this,a);a=Ed(this,a);sd(this,b-a,a,b);this.b-=this.i?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){O(this,Bd(this,a)&Ed(this,a));this.b-=this.i?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){Q(this,a,Bd(this,a),Pd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f? +2:0)},function(a){Q(this,a,Bd(this,a),Rd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Bd(this,a),Jd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Re[a>>8&15].call(this,a)},function(a){Se[a>>8&15].call(this,a)},function(a){var b=Ad(this,a);O(this,Fd(this,a,b,1)<<8);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){var b=Ad(this,a)<<8;a=Dd(this,a)<<8;sd(this,b-a,a,b);this.b-=this.i? +4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){O(this,(Ad(this,a)&Dd(this,a))<<8);this.b-=this.i?4+(this.I&&6<=this.f?1:0):(this.H?4:3)+(7==this.f?2:0)},function(a){P(this,a,Ad(this,a),Qd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){P(this,a,Ad(this,a),Sd);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},function(a){Q(this,a,Bd(this,a),ee);this.b-=this.i?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)},V],xe= +[function(a){Te[a>>4&15].call(this,a)},function(a){R(this,a,!0)},function(a){R(this,a,!md(this))},function(a){R(this,a,md(this))},function(a){R(this,a,!this.Ba()==!ld(this))},function(a){R(this,a,!this.Ba()!=!ld(this))},function(a){R(this,a,!md(this)&&!this.Ba()==!ld(this))},function(a){R(this,a,md(this)||!this.Ba()!=!ld(this))},oe,oe,function(a){Ue[a>>6&3].call(this,a)},function(a){Ve[a>>6&3].call(this,a)},function(a){We[a>>6&3].call(this,a)},function(a){Xe[a>>6&3].call(this,a)},V,V],Ue=[function(a){pd(this, +Gd(this,a,0));this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Td);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Xd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,1,Vd);this.b-=this.i?9:3+(7==this.f?2:0)}],Ve=[function(a){Q(this,a,0,Zd);this.b-=this.i?11:6},function(a){Q(this,a,kd(this)?1:0,Jd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,kd(this)?1:0,ee);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){a=Ed(this,a);pd(this,a);this.b-=this.i?4:3+(7==this.f? +2:0)}],We=[function(a){Q(this,a,0,ce);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,ae);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Nd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){Q(this,a,0,Ld);this.b-=this.i?9:3+(7==this.f?2:0)}],Xe=[function(a){a=this.u[7]+((a&63)<<1)&65535;var b=this.Zb(a|65536);od(this,this.u[5]);this.u[6]=a+2&65535;this.u[5]=b;this.b-=8},function(a){a=yd(this,a,0);td(this,a);O(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;zd(this,a, +0,b);O(this,b);this.b=c-qe[this.i]},function(a){O(this,Gd(this,a,this.Ba?65535:0));this.b-=this.i?9:3+(7==this.f?2:0)}],Te=[function(a){Ye[a&15].call(this,a)},V,V,V,me,me,me,me,function(a){if(a&8)this.$(8,6);else{var b=vd(this);a&=7;od(this,this.u[a]);this.u[a]=b;this.b-=9}},function(a){a&8?(this.L&49152||(this.L=this.L&-2017|(a&7)<<5,this.D|=1),this.b-=5):this.$(8,6)},function(a){Ze[a&15].call(this,a)},function(a){$e[a&15].call(this,a)},ue,ue,ue,ue],Ye=[function(){this.L&49152?(this.Z|=128,this.$(4, +3)):this.ea();this.b-=7},function(){this.D|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3},function(){ud(this);this.D|=this.L&16;this.b-=13},function(){this.$(12,1);this.b-=5},function(){this.$(16,4);this.b-=25},function(){this.L&49152||(jd(this),this.w.reset());this.b-=667},function(){ud(this);this.b-=13},V,V,V,V,V,V,V,V,V],Ze=[se,function(){this.O=0;this.b-=5},function(){this.P=0;this.b-=5},S,function(){this.X=1;this.b-=5},S,S,S,function(){this.T=0;this.b-=5},S,S,S,S,S,S,S],$e=[se,function(){this.O= +65536;this.b-=5},function(){this.P=32768;this.b-=5},T,function(){this.X=0;this.b-=5},T,T,T,function(){this.T=32768;this.b-=5},T,T,T,T,T,T,T],Re=[re,re,ke,ke,ie,ie,je,je,ve,ve,V,V,V,V,te,te],Se=[function(a){R(this,a,!this.Ba())},function(a){R(this,a,this.Ba())},function(a){R(this,a,!kd(this)&&!md(this))},function(a){R(this,a,kd(this)||md(this))},function(a){R(this,a,!ld(this))},function(a){R(this,a,ld(this))},function(a){R(this,a,!kd(this))},function(a){R(this,a,kd(this))},function(){this.$(24,2); +this.b-=25},function(){this.$(28,5);this.b-=5},function(a){af[a>>6&3].call(this,a)},function(a){bf[a>>6&3].call(this,a)},function(a){cf[a>>6&3].call(this,a)},function(a){df[a>>6&3].call(this,a)},V,V],af=[function(a){pd(this,Fd(this,a,0));this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Ud);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Yd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,1,Wd);this.b-=this.i?9:3+(7==this.f?2:0)}],bf=[function(a){P(this,a,0,$d);this.b-= +this.i?11:6},function(a){P(this,a,kd(this)?1:0,Kd);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,kd(this)?1:0,fe);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){a=Dd(this,a);pd(this,a<<8);this.b-=this.i?4:3+(7==this.f?2:0)}],cf=[function(a){P(this,a,0,de);this.b-=this.i?9+(this.Ua&1):3+(7==this.f?2:0)},function(a){P(this,a,0,be);this.b-=this.i?9:3+(7==this.f?2:0)},function(a){P(this,a,0,Od);this.b-=this.i?9+(this.Ua&1):3+(7==this.f?2:0)},function(a){P(this,a,0,Md);this.b-=this.i?9:3+(7== +this.f?2:0)}],df=[V,function(a){a=yd(this,a,65536);td(this,a);O(this,a);this.b-=11},function(a){var b=vd(this),c=this.b;zd(this,a,65536,b);O(this,b);this.b=c-qe[this.i]},V];function ef(a){r.call(this,"ROM",a,ef);this.f=null;this.C=a.addr;this.i=a.size;this.G=a.writable;this.F=a.alias;this.B=a.file;this.H=da(this.B);if(this.B){a=this.B;var b=ea(this.H);"json"!=b&&"hex"!=b&&(a=ga()+"/api/v1/dump?file="+this.B+"&format=bytes&decimal=true");var c=this;ua(a,null,!0,function(a,b,f){ff(c,a,b,f)})}}y(ef); +ef.prototype.Ca=function(a,b,c,d){this.w=b;this.b=c;this.j=d;gf(this)};ef.prototype.ya=function(){if(this.za){if(this.j){var a=this.j,b=this.id,c=this.C,d=this.i,e=this.za,f=[],g;for(g in e){var l=e[g];"number"==typeof l&&(e[g]=l={o:l});var m=l.o,p=l.a;if(void 0!==m){var q=f,m=[m>>>0,g],w=qa(q,m,a.Jb);0>w&&q.splice(-(w+1),0,m)}p&&(l.a=p.replace(/''/g,'"'))}a.G.push({Id:b,A:c,oc:d,za:e,Ib:f})}delete this.za}return!0};ef.prototype.xa=function(){return!0}; +function ff(a,b,c,d){if(d)a.na("Unable to load system ROM (error "+d+": "+b+")");else{bb(a.vb,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,g,l=eval("("+c+")");if(f=l.bytes)a.f=f;else if(f=l.words)for(a.f=Array(2*f.length),g=e=0;e>8&255;else if(f=l.data)for(a.f=Array(4*f.length),g=e=0;e>8&255,a.f[g++]=f[e]>>16&255,a.f[g++]=f[e]>>24&255;else a.f=l;a.za=l.symbols;if(!a.f.length){n("Empty ROM: "+ +b);return}if(1==a.f.length){n(a.f[0]);return}}catch(m){a.na("ROM data error: "+m.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.f=Array(b.length),e=0;e=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=oa(b[0]);if(c!=this.Ta)return;b=oa(b[1]);if(this.I=db(b)){var d=this.I.exports;if(d){var e=d.connect;e&&e.call(this.I);if(this.K=d.receiveData){this.status(this.vb+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};h.ya=function(a,b){if(!b)if(this.Sb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +h.xa=function(a){return a?this.save():!0};h.reset=function(){mf(this)};h.save=function(){var a=new N(this);a.set(0,[]);return a.data()};h.restore=function(){return mf(this)};function mf(a){a.S=0;a.f=0;a.i=128;a.C=[];return!0}h.Bb=function(a){if("number"==typeof a)this.C.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.U||8,c=a-this.H%a,this.U&&(b=na("",c)));this.M&&!this.H&&c&&(b=String.fromCharCode(this.M)+b);this.B.value+=b;this.B.scrollTop=this.B.scrollHeight;this.H+=c}else if(null!=this.G){if(10==a||1024<=this.G.length)this.g(this.G), +this.G="";10!=a&&(this.G+=String.fromCharCode(a))}this.i&=-129;Yb(this.b,100,4,52,this.N)}};var nf={},lf=(nf[65392]=[null,null,W.prototype.Lc,W.prototype.rd,"RCSR"],nf[65394]=[null,null,W.prototype.Kc,W.prototype.qd,"RBUF"],nf[65396]=[null,null,W.prototype.Yc,W.prototype.Fd,"XCSR"],nf[65398]=[null,null,W.prototype.Xc,W.prototype.Ed,"XBUF"],nf);La(function(){for(var a=A(document,"pdp11","serial"),b=0;b=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9};of.prototype.Ob=function(){return-1};of.prototype.Pb=function(){}; +function qf(a,b,c,d){if(c)if(b){0>a.B&&a.i.length&&(a.B=0);if(0>a.B||b!=a.i[a.B])a.i.splice(0,0,b),a.B=0;a.B--}else a.U?b="end":b=a.i[a.B+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(oa(b.substring(c,f))),c=f+1}}return a} +function rf(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 mf(a,b,c){var d;if(b){b=nf(a,b);for(var e=0,f=!1,g=b,l=[],n=[],p=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.i((null!=b?b+": ":"")+d);return e}function qf(a,b){if(b)return pf(a,b,a.ca[b]);var c=0;for(b in a.ca)pf(a,b,a.ca[b]),c++;return 0=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;g=q+g;d>>=8}d=k(c,0,!0)+" "+c+". "+ba(c,0,!0)+" "+("0b"+g);32<=c&&127>c&&(d+=" '"+String.fromCharCode(c)+"'")}a.g((null!=b?b+": ":"")+d);return e}function wf(a,b){if(b)return vf(a,b,a.ba[b]);var c=0;for(b in a.ba)vf(a,b,a.ba[b]),c++;return 0>>d.B.Y;n=1}d.i("blockid physical blockaddr used size type");d.i("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;n--;){var q=b[e];q.type==c?p++||d.i("..."):(c=q.type,p=Lb[c],q&&d.i(k(q.id,8)+" %"+k(e<>>c.Y].Bb(d&c.f,d),this.g--,b&&Af(a,b));return c};h.ma=function(a,b){var c=65535,d=Y(a);-1!==d&&(this.g++,c=Mb(this.B,d),this.g--,b&&Af(a,b));return c}; -h.mb=function(a,b,c){var d=Y(a);if(-1!==d){this.g++;var e=this.B;e.P[(d&e.g)>>>e.Y].wb(d&e.f,b&255,d);this.g--;c&&Af(a,c);M(this.b,!0)}};h.Wa=function(a,b,c){var d=Y(a);if(-1!==d){this.g++;var e=this.B;e.P[(d&e.g)>>>e.Y].Ib(d&e.f,b&65535,d);this.g--;c&&Af(a,c);M(this.b,!0)}};function X(a){return{w:a,Aa:!1}}function Bf(a){return[a.w,a.Aa]}function Cf(a){return{w:a[0],Aa:a[1]}} -function zf(a,b,c){var d;c=(c?a.M:a.Ra).w;if(void 0!==b){d=b=nf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Qb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Ha[a-8]:20>a?b=this.b.ta[a-16]:20==a&&(b=Vb(this.b)));return b}; -h.message=function(a,b){this.g||(b&&(a+=" @"+I(this,X(this.b.u[7]).w)),this.ha&1073741824?this.wa.push(a):this.oa&&a==this.oa||(this.oa=a,this.ha&-2147483648&&(this.ea(),a+=" (cpu halted)"),this.i(a),this.b&&(a=this.b,a.N-=a.b,a.b=0,a.ka=0,M(a))))}; -function tf(a){var b;if(Bd(a)){if(!a.L||!a.L.length){a.L=Array(1E3);for(b=0;b>>d.Y],!1)}a.N=["br"];if(a.G)for(b=1;b>>d.Y],!0);a.G=["bw"];a.Ya=0} -h.Sa=function(a,b,c){var d=!0;c||Jf(this,a,b,!1,!0);if(a!=this.f){var e=Y(b);if(-1===e)this.i("invalid address: "+I(this,b.w)),d=!1;else{var f=this.B;f.P[e>>>f.Y].Sa(e&f.f,a==this.G)}}d&&(a.push(b),c?b.Aa=!0:(Kf(this,a,a.length-1,"set"),tf(this)));return d};function Jf(a,b,c,d,e){var f=!1;c=Y(c);for(var g=1;g>>d.Y],b==a.G));l.Aa||tf(a);break}}return f} -function Lf(a,b){for(var c=1;c>23)&65535,x=I(w,u);else if(8192==C)u=u.w-((f&63)<<1)&65535,x=I(w,u);else if(12288==C)x=I(w,f&7,1);else if(24576==C)x=I(w,f&63,1);else if(C=f&B,B&4032&&(C>>=6,B>>=6),B&63)switch(B=C&7,C&56){case 0:x=Ef(B);break;case 8:x="@"+Ef(B);break;case 16:7>B?x="("+Ef(B)+ -")+":(C=w.ma(u,2),x="#"+I(w,C,0,!0));break;case 24:7>B?x="@("+Ef(B)+")+":(C=w.ma(u,2),x="@#"+I(w,C,0,!0));break;case 32:x="-("+Ef(B)+")";break;case 40:x="@-("+Ef(B)+")";break;case 48:C=w.ma(u,2);x=I(w,C,0,!0)+"("+Ef(B)+")";7==B&&(x=[x,I(w,C+u.w&65535)]);break;case 56:C=w.ma(u,2),x="@"+I(w,C)+"("+Ef(B)+")",7==B&&(x=[x,I(w,C+u.w&65535)])}w=x;if(!w||!w.length){l="INVALID";break}"string"!=typeof w&&(n=w[1],w=w[0]);0b?(c=Ef(b),c+="="+I(a,d.u[b])):13>b?c="A"+(b-8)+"="+I(a,d.Ha[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+I(a,d.ta[b-16]):20==b&&(c="PS="+I(a,Vb(d)));c&&(c+=" ");return c}function Qf(a){var b,c="";for(b=0;6>b;b++)c+=Pf(a,b);c=c+"\n"+(Pf(a,6)+Pf(a,7)+Pf(a,20));return c+=Of(a,"T")+Of(a,"N")+Of(a,"Z")+Of(a,"V")+Of(a,"C")}h.Kb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.wc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.i("unknown register: "+e);return}M(d);a.i("updated registers:")}a.i(Qf(a));c&&(a.M=X(d.u[7]),Hf(a,I(a,a.M.w)))}}function Vf(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.i(p)}l[3]&&(g=l[3],f=null);f=Nf(a,b,g,f);a.i(f);a.M=b;e-=b.w-n;c++}}} -function Mf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.i(">> "+b):(a.X&&(a.i("ended assemble at "+I(a,a.W.w)),a.M=a.W,a.X=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.oa=null;if(hb(a)&&0q||"z"ja.length&&(a.i("note: only "+ja.length+" available"),Z=ja.length);ca-=Z;0>ca&&(null==ja[ja.length-1].w?(Z=ca+Z,ca=0):ca+=ja.length);var Pc=[];"call"==ye&&(jb=1E5,Pc=["CALL"]);for(void 0!==xe&&a.i(Z+" instructions earlier:");0=ja.length&&(ca=0);a.Za=Z;Ae++;jb--}}Ae||(a.i("no "+ze+"history available"),a.Za=void 0)}else{var Yb=zf(a,ia);if(Yb){var Zb=0;za&&("l"==za.charAt(0)&&(za=za.substr(1)||og),Zb=of(a,za)>>>0,65536>4||1;qg--&&0<$b;){var ac=0,Qc=0,nb,Rc="",De="",ia=I(a,Yb.w);for(nb=4==mb?16:a.ia;0bc?String.fromCharCode(bc):".";$b--}lb&&(lb+="\n");lb+=ia+" "+Rc+(0==nb?" "+De:"")}lb&&a.i(lb);a.Ra=Yb}}}}break;case "e":if("else"==g[0])break;var Ra,Sc,Tc,Uc,Vc=g[0],Wc=g[1];"eb"==Vc?(Ra=1,Sc=255,Tc=a.Ua,Uc=a.mb):"e"==Vc||"ew"==Vc?(Ra=2,Sc=65535,Tc=a.ma,Uc=a.Wa):Wc=null;if(null==Wc)a.i("edit memory commands:"),a.i("\teb [a] [...] edit bytes at address a"),a.i("\tew [a] [...] edit words at address a");else{var cc=zf(a,Wc);if(cc)for(var dc=2;dcZc;){for(var Aa=null,ug=256;65536>qb.w>>>0;){$c.w=a.ma(qb,2);if(null==qb.w||!ug--)break;if(!($c.w&1)){for(var vg=a,ec=$c,Fe=null,rb=ec.w,Ge=rb,ad=1;6>=ad&& -rb;ad++){if(2\nLicense: GPL version 3 or later ");this.i("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;b$f){if(bg(d,this.I)){this.C=new N(this,"1.30.1","failsafe");bg(this.C)&&(gg(this,d),a=2,hg(this.C));this.C.set("timestamp",sa());ig(this.C);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=fg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?bg(d,g):("error"== -f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.g=null)):this.i(f+": "+g),hg(d),bg(d)?(c=fg(d),e=!0):c=!1))}e&&eg(this,c?d:null)}else 2==a&&d.clear()}else eg(this);delete this.I;delete this.L}e=bb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.v.fa=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(jg(this,this.b,b,c,a),this.b.gb());this.U&&(gg(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.F=0}; -function gg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} -function Xf(a,b,c){var d,e="none";if(a.F)return null;a.F--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=sa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.Ba&&(c&&a.b.ea(),d=a.b.Ba(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.fa=!1,!1===d&&(e=null)));for(var l=bb(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(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(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)n=0>n.indexOf(p[1])?n.replace(">",p[0]+">"):n.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=n&&(g=g.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],g);Bg(a,b,c)}})}else c(a,null)} -function Cg(a,b,c,d){function e(a){if(void 0===l){var b=g&&A(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ma(a))}function f(a){e("Error: "+a);n&&(--ng||Sa(!0));n=!1}var g,l,n=!0;ng++;$a[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}c|| -(c="/versions/pdp11/1.30.1/components.xsl");p=function(d,l){l?zg(c,null,null,!1,e,function(d,n){n?(ab(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(g.outerHTML=n,--ng||Sa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(n,g),--ng||Sa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?zg(b,a,d,!0,e,p):Ag(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(u){f(u.message)}return n}window.embedPDP11=function(a,b,c,d){Sa(!1);return Cg(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ta;})(); +63],35968:[7,63],36032:[5,63],36096:[66,63],36160:[59,63],36224:[64,63],36288:[61,63]},65528:{128:[76,7],152:[108,12288]},65535:{0:[55],1:[99],2:[75],3:[26],4:[109],5:[70],6:[110],7:[111],160:[69],161:[31],162:[41],163:[33],164:[45],165:[36],166:[43],167:[35],168:[38],169:[32],170:[42],171:[34],172:[46],173:[37],174:[44],175:[30],176:[69],177:[80],178:[88],179:[82],180:[92],181:[85],182:[90],183:[84],184:[87],185:[81],186:[89],187:[83],188:[93],189:[86],190:[91],191:[79]}};h=xf.prototype; +h.Ca=function(a,b,c,d){this.w=b;this.b=c;this.F=a;(a=Dc(a,"messages"))&&Af(this,a);this.Va=Df;Ef(this,function(a){a:{var b=d.w.W,c=a[0],e=a=0,m=b.length;if(c){a=Y(Ff(d,c));if(-1===a){d.g("invalid address: "+c);break a}e=a>>>d.w.Y;m=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,p=0;m--;){var q=b[e];q.type==c?p++||d.g("..."):(c=q.type,p=Pb[c],q&&d.g(k(q.id,8)+" %"+k(e<>>c.Y].zb(d&c.f,d),c.w--,c=d,b&&Gf(a,b));return c};h.ia=function(a,b){var c=65535,d=Y(a);-1!==d&&(c=Qb(this.w,d),b&&Gf(a,b));return c}; +h.mb=function(a,b,c){var d=Y(a);-1!==d&&(Rb(this.w,d,b),c&&Gf(a,c),M(this.b,!0))};h.Sa=function(a,b,c){var d=Y(a);if(-1!==d){var e=this.w,f=d&e.f,g=(d&e.i)>>>e.Y;e.w++;e.W[g].Hb(f,b&65535,d);e.w--;c&&Gf(a,c);M(this.b,!0)}};function X(a){return{A:a,wa:!1}}function Hf(a){return[a.A,a.wa]}function If(a){return{A:a[0],wa:a[1]}} +function Ff(a,b,c){var d;c=(c?a.K:a.Na).A;if(void 0!==b){d=b=tf(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cd&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"}h.Pb=function(a){var b;0<=a&&(8>a?b=this.b.u[a]:16>a?b=this.b.Da[a-8]:20>a?b=this.b.qa[a-16]:20==a&&(b=jc(this.b)));return b}; +h.message=function(a,b){b&&(a+=" @"+I(this,X(this.b.u[7]).A));this.ha&1073741824?this.pa.push(a):this.ma&&a==this.ma||(this.ma=a,this.ha&-2147483648&&(this.ea(),a+=" (cpu halted)"),this.g(a),this.b&&(a=this.b,a.N-=a.b,a.b=0,a.la=0,M(a)))}; +function zf(a){var b;if(Hd(a)){if(!a.I||!a.I.length){a.I=Array(1E3);for(b=0;b>>d.Y],!1)}a.M=["br"];if(a.C)for(b=1;b>>d.Y],!0);a.C=["bw"];a.Ma=0} +h.Oa=function(a,b,c){var d=!0;c||Pf(this,a,b,!1,!0);if(a!=this.f){var e=Y(b);if(-1===e)this.g("invalid address: "+I(this,b.A)),d=!1;else{var f=this.w;f.W[e>>>f.Y].Oa(e&f.f,a==this.C)}}d&&(a.push(b),c?b.wa=!0:(Qf(this,a,a.length-1,"set"),zf(this)));return d};function Pf(a,b,c,d,e){var f=!1;c=Y(c);for(var g=1;g>>d.Y],b==a.C));l.wa||zf(a);break}}return f} +function Rf(a,b){for(var c=1;c>23)&65535,x=I(v,u);else if(8192==D)u=u.A-((f&63)<<1)&65535,x=I(v,u);else if(12288==D)x=I(v,f&7,1);else if(24576==D)x=I(v,f&63,1);else if(D=f&C,C&4032&&(D>>=6,C>>=6),C&63)switch(C=D&7,D&56){case 0:x=Kf(C);break;case 8:x="@"+Kf(C);break;case 16:7>C?x="("+Kf(C)+ +")+":(D=v.ia(u,2),x="#"+I(v,D,0,!0));break;case 24:7>C?x="@("+Kf(C)+")+":(D=v.ia(u,2),x="@#"+I(v,D,0,!0));break;case 32:x="-("+Kf(C)+")";break;case 40:x="@-("+Kf(C)+")";break;case 48:D=v.ia(u,2);x=I(v,D,0,!0)+"("+Kf(C)+")";7==C&&(x=[x,I(v,D+u.A&65535)]);break;case 56:D=v.ia(u,2),x="@"+I(v,D)+"("+Kf(C)+")",7==C&&(x=[x,I(v,D+u.A&65535)])}v=x;if(!v||!v.length){l="INVALID";break}"string"!=typeof v&&(m=v[1],v=v[0]);0b?(c=Kf(b),c+="="+I(a,d.u[b])):13>b?c="A"+(b-8)+"="+I(a,d.Da[b-8]):16<=b&&20>b?c="S"+(b-16)+"="+I(a,d.qa[b-16]):20==b&&(c="PS="+I(a,jc(d)));c&&(c+=" ");return c}function Wf(a){var b,c="";for(b=0;6>b;b++)c+=Vf(a,b);c=c+"\n"+(Vf(a,6)+Vf(a,7)+Vf(a,20));return c+=Uf(a,"T")+Uf(a,"N")+Uf(a,"Z")+Uf(a,"V")+Uf(a,"C")}h.Jb=function(a,b){return a[0]>b[0]?1:a[0]>>0;for(b=0;b>>0,l=f.oc;if(e>=g&&eb)){d.u[b]=f&65535;break}a.g("unknown register: "+e);return}M(d);a.g("updated registers:")}a.g(Wf(a));c&&(a.K=X(d.u[7]),Nf(a,I(a,a.K.A)))}}function ag(a,b){b=oa(b);var c=b.match(/^(['"])(.*?)\1$/);c?1l[0].indexOf("+"))){var p=l[0]+":";l[2]&&(p+=" "+l[2]);a.g(p)}l[3]&&(g=l[3],f=null);f=Tf(a,b,g,f);a.g(f);a.K=b;e-=b.A-m;c++}}} +function Sf(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.U&&(a.g("ended assemble at "+I(a,a.S.A)),a.K=a.S,a.U=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ma=null;if(ib(a)&&0q||"z"ja.length&&(a.g("note: only "+ja.length+" available"),Z=ja.length);ca-=Z;0>ca&&(null==ja[ja.length-1].A?(Z=ca+Z,ca=0):ca+=ja.length);var Sc=[];"call"==De&&(nb=1E5,Sc=["CALL"]);for(void 0!==Ce&&a.g(Z+" instructions earlier:");0=ja.length&&(ca=0);a.Ua=Z;Fe++;nb--}}Fe||(a.g("no "+Ee+"history available"),a.Ua=void 0)}else{var pb=Ff(a,ia);if(pb){var $b=0;Aa&&("l"==Aa.charAt(0)&&(Aa=Aa.substr(1)||ug),$b=uf(a,Aa)>>>0,65536<$b&&($b=65536));for(var qb="",Ta="dd"==Qa?4:"dw"==Qa?2:1,ac=Ta*$b||128,wg=ac+15>>4||1;wg--&&0cc?String.fromCharCode(cc):".";ac--}qb&&(qb+="\n");qb+=ia+" "+Tc+(0==sb?" "+Ie:"")}qb&&a.g(qb);a.Na=pb}}}}break;case "e":if("else"==g[0])break;var Ua,Vc,Wc,Xc,Yc=g[0],Zc=g[1];"eb"==Yc?(Ua=1,Vc=255,Wc=a.Qa,Xc=a.mb):"e"==Yc||"ew"==Yc?(Ua=2,Vc=65535,Wc=a.ia,Xc=a.Sa):Zc=null;if(null==Zc)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"),a.g("\tew [a] [...] edit words at address a");else{var dc=Ff(a,Zc);if(dc)for(var ec=2;ec< +g.length;ec++){var tb=sf(a,g[ec]);if(void 0===tb){a.g("unrecognized value: "+g[ec]);break}tb&~Vc&&a.g("warning: "+k(tb)+" exceeds "+Ua+"-byte value");var xg=Wc.call(a,dc);a.g("changing "+I(a,dc.A)+" from "+I(a,xg,Ua)+" to "+I(a,tb,Ua));Xc.call(a,dc,tb,Ua)}}break;case "g":a:{var Je=g[1],yg=b;if(void 0!==Je){var $c=Ff(a,Je,!0);if(!$c)break a;Jf(a,$c,yg);a.Oa(a.f,$c,!0)}a.ab(!0)||c||a.g("cpu busy or unavailable, run command ignored")}break;case "h":a.v.aa?(c||a.g("halting"),a.ea()):hb(a,!0)||c||a.g("already halted"); +break;case "i":if("if"==g[0]){var ad;var ub=b.substr(2),ub=oa(ub);sf(a,ub)?(c||a.g("true: "+ub),ad=!0):(c||a.g("false: "+ub),ad=!1);ad||(d=!1);break}f=!0;break;case "k":var zg=g[0];if("?"==g[1])a.g("stack trace commands:"),a.g("\tk\tshow frame addresses"),a.g("\tks\tshow symbol information");else{var bd=0,cd=X(),vb=X(a.b.u[6]);for(a.g("stack trace for "+I(a,vb.A));10>bd;){for(var Ba=null,Ag=256;65536>vb.A>>>0;){cd.A=a.ia(vb,2);if(null==vb.A||!Ag--)break;if(!(cd.A&1)){for(var Bg=a,fc=cd,Ke=null,wb= +fc.A,Le=wb,dd=1;6>=dd&&wb;dd++){if(2\nLicense: GPL version 3 or later ");this.g("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bfg){if(hg(d,this.I)){this.C=new N(this,"1.30.1","failsafe");hg(this.C)&&(mg(this,d),a=2,ng(this.C));this.C.set("timestamp",sa());og(this.C);var e=this.f&&!this.G;if(1==a||va("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=lg(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hg(d,g):("error"== +f&&"no machine state"!=g?(this.na("Error: "+g),"unable to verify user"==g&&(Ca("user",""),this.i=null)):this.g(f+": "+g),ng(d),hg(d)?(c=lg(d),e=!0):c=!1))}e&&kg(this,c?d:null)}else 2==a&&d.clear()}else kg(this);delete this.I;delete this.K}e=cb(this.id);for(f=0;fa[1];a=a[2];this.da=!0;this.v.fa=!0;var d=this.J.power;d&&(d.textContent="Shutdown");this.b&&(pg(this,this.b,b,c,a),this.b.fb());this.S&&(mg(this,b),b.clear());!c&&this.C&&(this.C.clear(),delete this.C);this.F=0}; +function mg(a,b){if(va("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.i||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}} +function cg(a,b,c){var d,e="none";if(a.F)return null;a.F--;var f=new N(a,"1.30.1"),g=new N(a,"1.30.1","validate"),l=sa();g.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.xa&&(c&&a.b.ea(),d=a.b.xa(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.v.fa=!1,!1===d&&(e=null)));for(var l=cb(a.id),m=0;mf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(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(q){f=null,a=q.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");ua(e,null,!0,function(f,g,l){if(l||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=l[0],p,q=/( [a-z]+=)(['"])(.*?)\2/g;p=q.exec(f);)m=0>m.indexOf(p[1])?m.replace(">",p[0]+">"):m.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=m&&(g=g.replace(l[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],g);Hg(a,b,c)}})}else c(a,null)} +function Ig(a,b,c,d){function e(a){if(void 0===l){var b=g&&A(g,"machine-warning");l=b&&b[0]||g}l&&(l.innerHTML=ma(a))}function f(a){e("Error: "+a);m&&(--tg||Na(!0));m=!1}var g,l,m=!0;tg++;ab[a]={};try{if(g=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],w=document.createElement("style");w.type="text/css";w.styleSheet?w.styleSheet.cssText=p:w.appendChild(document.createTextNode(p));q.appendChild(w)}c|| +(c="/versions/pdp11/1.30.1/components.xsl");p=function(d,l){l?Fg(c,null,null,!1,e,function(d,m){m?(bb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(m=l.transformNode(m))?(g.outerHTML=m,--tg||Na(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(m),(m=d.transformToFragment(l,document))?g.parentNode?(g.parentNode.replaceChild(m,g),--tg||Na(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Fg(b,a,d,!0,e,p):Gg(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(u){f(u.message)}return m}window.embedPDP11=function(a,b,c,d){Na(!1);return Ig(a,b,c,d)};window.enableEvents=Na;window.sendEvent=Oa;})(); diff --git a/versions/pdpjs/1.30.1/pdp11.js b/versions/pdpjs/1.30.1/pdp11.js index 903f8be0d..248d99dee 100644 --- a/versions/pdpjs/1.30.1/pdp11.js +++ b/versions/pdpjs/1.30.1/pdp11.js @@ -683,151 +683,150 @@ */ var g; function aa(a){var b=16,c;if(a){b||(b=10);var d=a.charAt(0),e=0=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ga(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ha(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} -var ia={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",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"},ja=Date.now||function(){return+new Date}; -function ka(){function a(a){return(10>a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} -function l(a,b,c,d){var e=0,f=null,k=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)}),k;var m=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(m.onreadystatechange=function(){4===m.readyState&&(f=m.responseText,200==m.status||!m.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=m.status||-1),d&&d(a,f,e))});if(b&&"object"== -typeof b){var n="",q;for(q in b)b.hasOwnProperty(q)&&(n&&(n+="&"),n+=q+"="+encodeURIComponent(b[q]));n=n.replace(/%20/g,"+");m.open("POST",a,!!c);m.setRequestHeader("Content-type","application/x-www-form-urlencoded");m.send(n)}else m.open("GET",a,!!c),"bytes"==b&&m.overrideMimeType("text/plain; charset=x-user-defined"),m.send();c||(f=m.responseText,200!=m.status&&(e=m.status||-1),d&&d(a,f,e),k=[f,e]);return k}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} -function p(a){window&&window.alert(a)}function la(a){var b=!1;window&&(b=window.confirm(a));return b}var ma=null;function na(){if(null==ma){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}ma=a}return ma}function oa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} -function pa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function qa(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},ra=!1,sa=!1,ta=!0;function ua(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function u(a){r.init.push(a)} -function va(a){if(ta)try{for(var b=0;bb?this.Da=this.id:(this.Ua=this.id.substr(0,b),this.Da=this.id.substr(b+1));this[a]=c;this.i={ready:!1,Yc:!1,Zc:!1,L:!1,error:!1};this.Ma=null;this.i.error=!1;this.w={};this.I=null;w.push(this)}var ya=void 0,za={}; -if(window){ya||(ya=window.location.search.substr(1));for(var Aa,Ca=/\+/g,Da=/([^&=]+)=?([^&]*)/g;Aa=Da.exec(ya);)za[decodeURIComponent(Aa[1].replace(Ca," "))]=decodeURIComponent(Aa[2].replace(Ca," "))}function Ea(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} +e&&d.match(/^[01]+$/):d.match(/^[0-9]+$/))&&!isNaN(f=parseInt(a,b))&&(c=f|0)}return c}function k(a,b,c){var d="";b?8=e?48:55),d=String.fromCharCode(e)+d;a>>=4}return(c?"0x":"")+d}function ba(a){var b=a,c=a.lastIndexOf("/");0<=c&&(b=a.substr(c+1));c=b.indexOf("&");0":">",'"':""","'":"'"};function ha(a){return a.replace(/[&<>"']/g,function(a){return fa[a]})}function ia(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +var ja={0:"NUL",1:"SOH",2:"STX",3:"ETX",4:"EOT",5:"ENQ",6:"ACK",7:"BEL",8:"BS",9:"TAB",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"},ka=Date.now||function(){return+new Date}; +function la(){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 m(a,b,c,d){var e=0,f=null,h=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)}),h;var l=window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");c&&(l.onreadystatechange=function(){4===l.readyState&&(f=l.responseText,200==l.status||!l.status&&f.length&&"file:"==(window?window.location.protocol:"file:")||(e=l.status||-1),d&&d(a,f,e))});if(b&&"object"== +typeof b){var n="",p;for(p in b)b.hasOwnProperty(p)&&(n&&(n+="&"),n+=p+"="+encodeURIComponent(b[p]));n=n.replace(/%20/g,"+");l.open("POST",a,!!c);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(n)}else l.open("GET",a,!!c),"bytes"==b&&l.overrideMimeType("text/plain; charset=x-user-defined"),l.send();c||(f=l.responseText,200!=l.status&&(e=l.status||-1),d&&d(a,f,e),h=[f,e]);return h}function ea(){return"http://"+(window?window.location.host:"www.pcjs.org")} +function q(a){window&&window.alert(a)}function ma(a){var b=!1;window&&(b=window.confirm(a));return b}var na=null;function oa(){if(null==na){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}na=a}return na}function pa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b} +function qa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function ra(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&b.match(/(iPod|iPhone|iPad)/)&&b.match(/AppleWebKit/)||"MSIE"==a&&b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)?!0:!1}return!1}var r={init:[],show:[],exit:[]},sa=!1,ta=!1,ua=!0;function va(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function t(a){r.init.push(a)} +function wa(a){if(ua)try{for(var b=0;bb?this.Ca=this.id:(this.Ta=this.id.substr(0,b),this.Ca=this.id.substr(b+1));this[a]=c;this.h={ready:!1,Xc:!1,Yc:!1,L:!1,error:!1};this.La=null;this.h.error=!1;this.w={};this.I=null;w.push(this)}var za=void 0,Aa={}; +if(window){za||(za=window.location.search.substr(1));for(var Ba,Ca=/\+/g,Da=/([^&=]+)=?([^&]*)/g;Ba=Da.exec(za);)Aa[decodeURIComponent(Ba[1].replace(Ca," "))]=decodeURIComponent(Ba[2].replace(Ca," "))}function Ea(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b} function x(a,b){b||(b=v);a.prototype=Ea(b.prototype);a.prototype.constructor=a;a.prototype.parent=b.prototype}if(window){window.PCjs||(window.PCjs={});var Fa=window.PCjs.Machines||(window.PCjs.Machines={}),w=window.PCjs.Components||(window.PCjs.Components=[])}else Fa={},w=[];function Ga(a,b,c){Fa[a]&&b&&(Fa[a][b]=c)}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b>1)+2;10>this.c&&(this.c=10);15>2;this.m=this.g-1;this.s=this.B/this.g|0;this.la=[];this.o=[];this.Gb=[Na,Oa,Pa,Qa];a=new E(this.b);Ra(a,this.I);this.a=Array(this.s);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.la[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return c;F(d.b,4)}function Oa(a,b,c){var d=!1,e=this.controller,f=e.la[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.la[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||F(e.b,4)} -function Pa(a,b){var c=-1,d=this.controller;(a=d.la[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));if(0<=c)return c;F(d.b,4)}function Qa(a,b,c){var d=!1,e=this.controller;if(a=e.la[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||F(e.b,4)} -function Sa(a,b){if(b!=a.l){var c;if(a.l){c=(1<>>a.c;0>>a.c;0k&&(t=k);if(n&&n.size){if(n.type==d&&n.controller==e){if(f+k<=n.za)return n.Pa+=n.za-f,n.za=f,!0;if(f>=n.za+n.Pa){t=n.size-(f-q);t>k&&(t=k);n.Pa=f-n.za+t;f=q+a.g;k-=t;m++;continue}}return Ta(1,f,k)}f=new E(a.b,f,t,a.g,d,e);Ra(f,a.I,n);a.a[m++]=f;f=q+a.g;k-=t}return 0>=k?(a.status(Math.floor(c/1024)+"Kb "+Wa[d]+" at "+h(b,8,!0)),!0):Ta(2,b,c)} -function Xa(a,b){return a.a[(b&a.h)>>>a.c].Ya(b&a.m,b)}function Ya(a,b){return a.a[(b&a.h)>>>a.c].oc(b&a.m,b)}function Za(a,b,c){a.a[(b&a.h)>>>a.c].Sc(b&a.m,c&65535,b)}function $a(a){for(var b=0,c=[],d=0;da.b.Mb))for(var f=e[0]?e[0].bind(b):null,k=e[1]?e[1].bind(b):null,m=e[2]?e[2].bind(b):null,n=e[3]?e[3].bind(b):null,q=a,t=+d,e=e[4],J=+d;J<=t;J+=2){var Ba=J&8191;void 0!==q.la[Ba]?p("I/O address already registered: "+h(J,8,!0)):q.la[Ba]=[f,k,m,n,e||"unknown",!1]}}}function bb(a,b){a.o.push(b)}function Ta(a,b,c){p("Memory block error ("+a+": "+h(b)+","+h(c)+")");return!1} -function G(a){v.call(this,"Device",a,G);this.c={data:0,Xc:0,Na:20,ad:0};this.a={$c:0,bb:-1}}x(G);g=G.prototype;g.oa=function(a,b,c,d){this.m=b;this.b=c;this.I=d;var e=this;this.a.bb=cb(this.b,function(){e.a.pa|=128;e.a.pa&64&&(db(e.b,0,6,64),eb(e.b,e.a.bb,1E3/60))});ab(b,this,H);bb(b,this.reset.bind(this));D(this)};g.Vb=function(){var a=this.a.pa;this.a.pa&=-129;return a};g.Ac=function(a){this.a.pa=a;a&64&&eb(this.b,this.a.bb,1E3/60);this.a.pa=a&-129}; -g.Xb=function(){var a=this.b;return a.D&62337|a.Ea<<5|a.Fa<<1};g.Cc=function(a){var b=this.b;a&=62337;if(b.D!=a){b.D=a;b.Ea=a>>5&3;b.Fa=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Oa!=c&&(b.Oa=c,fb(b))}gb(this)};g.Yb=function(){var a=this.b.qa;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Zb=function(){return this.b.$a};g.$b=function(){return this.b.ra};g.Dc=function(a){var b=this.b;b.ra!=a&&(b.ra=a,a&16?(b.Wa=4194303,b.Ga=3915776):(b.Wa=262143,b.Ga=253952),fb(b));gb(this)}; -function gb(a){a.c.Na=a.c.Na&-8|(a.b.Oa?a.b.ra&16?1:2:4)}g.hc=function(a){return this.b.C[1][a>>1&7]};g.Lc=function(a,b){this.b.C[1][b>>1&7]=a&65295};g.fc=function(a){return this.b.C[1][(a>>1&7)+8]};g.Jc=function(a,b){this.b.C[1][(b>>1&7)+8]=a&65295};g.gc=function(a){return this.b.P[1][a>>1&7]};g.Kc=function(a,b){b=b>>1&7;this.b.P[1][b]=a;this.b.C[1][b]&=65295};g.ec=function(a){return this.b.P[1][(a>>1&7)+8]};g.Ic=function(a,b){b=(b>>1&7)+8;this.b.P[1][b]=a;this.b.C[1][b]&=65295}; -g.Ub=function(a){return this.b.C[0][a>>1&7]};g.zc=function(a,b){this.b.C[0][b>>1&7]=a&65295};g.Sb=function(a){return this.b.C[0][(a>>1&7)+8]};g.xc=function(a,b){this.b.C[0][(b>>1&7)+8]=a&65295};g.Tb=function(a){return this.b.P[0][a>>1&7]};g.yc=function(a,b){b=b>>1&7;this.b.P[0][b]=a;this.b.C[0][b]&=65295};g.Rb=function(a){return this.b.P[0][(a>>1&7)+8]};g.wc=function(a,b){b=(b>>1&7)+8;this.b.P[0][b]=a;this.b.C[0][b]&=65295};g.nc=function(a){return this.b.C[3][a>>1&7]}; -g.Rc=function(a,b){this.b.C[3][b>>1&7]=a&65295};g.lc=function(a){return this.b.C[3][(a>>1&7)+8]};g.Pc=function(a,b){this.b.C[3][(b>>1&7)+8]=a&65295};g.mc=function(a){return this.b.P[3][a>>1&7]};g.Qc=function(a,b){b=b>>1&7;this.b.P[3][b]=a;this.b.C[3][b]&=65295};g.kc=function(a){return this.b.P[3][(a>>1&7)+8]};g.Oc=function(a,b){b=(b>>1&7)+8;this.b.P[3][b]=a;this.b.C[3][b]&=65295};g.T=function(a){a&=7;return this.b.v&2048?this.b.va[a]:this.b.f[a]}; -g.W=function(a,b){b&=7;this.b.v&2048?this.b.va[b]=a:this.b.f[b]=a};g.pb=function(){return this.b.v&49152?this.b.Z[0]:this.b.f[6]};g.Bb=function(a){this.b.v&49152?this.b.Z[0]=a:this.b.f[6]=a};g.sb=function(){return this.b.f[7]};g.Eb=function(a){this.b.f[7]=a};g.U=function(a){a&=7;return this.b.v&2048?this.b.f[a]:this.b.va[a]};g.X=function(a,b){b&=7;this.b.v&2048?this.b.f[b]=a:this.b.va[b]=a};g.qb=function(){return 1==(this.b.v&49152)>>14?this.b.f[6]:this.b.Z[1]}; -g.Cb=function(a){1==(this.b.v&49152)>>14?this.b.f[6]=a:this.b.Z[1]=a};g.rb=function(){return 3==(this.b.v&49152)>>14?this.b.f[6]:this.b.Z[3]};g.Db=function(a){3==(this.b.v&49152)>>14?this.b.f[6]=a:this.b.Z[3]=a};g.Qb=function(a){return this.b.wb[a-65504>>1]};g.vc=function(a,b){this.b.wb[b-65504>>1]=a};g.tb=function(a){return 65520==a?61183:0};g.Fb=function(){};g.jc=function(){return 1};g.Nc=function(){};g.Pb=function(){return this.b.F};g.uc=function(){this.b.F=0};g.Wb=function(){return this.b.vb}; -g.Bc=function(a,b){b&1||(a&=255);this.b.vb=a};g.ac=function(){return this.b.ab};g.Ec=function(a){var b=this.b;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.ab=a;b.j|=2};g.ic=function(){return this.b.sa&65280};g.Mc=function(a){this.b.sa=a|255};g.bc=function(){return hb(this.b)};g.Fc=function(a){ib(this.b,a&-1809|hb(this.b)&1808);this.b.j|=128};g.reset=function(){this.c.Na=this.c.Na&-120|20;this.a.pa=0}; -var I={},H=(I[62592]=[null,null,G.prototype.hc,G.prototype.Lc,"SISDR"],I[62608]=[null,null,G.prototype.fc,G.prototype.Jc,"SDSDR"],I[62624]=[null,null,G.prototype.gc,G.prototype.Kc,"SISAR"],I[62640]=[null,null,G.prototype.ec,G.prototype.Ic,"SDSAR"],I[62656]=[null,null,G.prototype.Ub,G.prototype.zc,"KISDR"],I[62672]=[null,null,G.prototype.Sb,G.prototype.xc,"KDSDR"],I[62688]=[null,null,G.prototype.Tb,G.prototype.yc,"KISAR"],I[62704]=[null,null,G.prototype.Rb,G.prototype.wc,"KDSAR"],I[62798]=[null,null, -G.prototype.$b,G.prototype.Dc,"MMR3"],I[65382]=[null,null,G.prototype.Vb,G.prototype.Ac,"LKS"],I[65402]=[null,null,G.prototype.Xb,G.prototype.Cc,"MMR0"],I[65404]=[null,null,G.prototype.Yb,null,"MMR1"],I[65406]=[null,null,G.prototype.Zb,null,"MMR2"],I[65408]=[null,null,G.prototype.nc,G.prototype.Rc,"UISDR"],I[65424]=[null,null,G.prototype.lc,G.prototype.Pc,"UDSDR"],I[65440]=[null,null,G.prototype.mc,G.prototype.Qc,"UISAR"],I[65456]=[null,null,G.prototype.kc,G.prototype.Oc,"UDSAR"],I[65472]=[G.prototype.T, -G.prototype.W,G.prototype.T,G.prototype.W,"R0SET0"],I[65473]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R1SET0"],I[65474]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R2SET0"],I[65475]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R3SET0"],I[65476]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R4SET0"],I[65477]=[G.prototype.T,G.prototype.W,G.prototype.T,G.prototype.W,"R5SET0"],I[65478]=[G.prototype.pb,G.prototype.Bb,G.prototype.pb,G.prototype.Bb, -"R6KERNEL"],I[65479]=[G.prototype.sb,G.prototype.Eb,G.prototype.sb,G.prototype.Eb,"R7KERNEL"],I[65480]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R0SET1"],I[65481]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R1SET1"],I[65482]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R2SET1"],I[65483]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R3SET1"],I[65484]=[G.prototype.U,G.prototype.X,G.prototype.U,G.prototype.X,"R4SET1"],I[65485]=[G.prototype.U,G.prototype.X, -G.prototype.U,G.prototype.X,"R5SET1"],I[65486]=[G.prototype.qb,G.prototype.Cb,G.prototype.qb,G.prototype.Cb,"R6SUPER"],I[65487]=[G.prototype.rb,G.prototype.Db,G.prototype.rb,G.prototype.Db,"R6USER"],I[65504]=[null,null,G.prototype.Qb,G.prototype.vc,"CTRL",1170],I[65520]=[null,null,G.prototype.tb,G.prototype.Fb,"LSIZE",1170],I[65522]=[null,null,G.prototype.tb,G.prototype.Fb,"HSIZE",1170],I[65524]=[null,null,G.prototype.jc,G.prototype.Nc,"SYSID",1170],I[65526]=[null,null,G.prototype.Pb,G.prototype.uc, -"CPUERR",1170],I[65528]=[null,null,G.prototype.Wb,G.prototype.Bc,"MB",1170],I[65530]=[null,null,G.prototype.ac,G.prototype.Ec,"PIR"],I[65532]=[null,null,G.prototype.ic,G.prototype.Mc,"SL"],I[65534]=[null,null,G.prototype.bc,G.prototype.Fc,"PSW"],I);H[62594]=H[62592];H[62596]=H[62592];H[62598]=H[62592];H[62600]=H[62592];H[62602]=H[62592];H[62604]=H[62592];H[62606]=H[62592];H[62610]=H[62608];H[62612]=H[62608];H[62614]=H[62608];H[62616]=H[62608];H[62618]=H[62608];H[62620]=H[62608];H[62622]=H[62608]; -H[62626]=H[62624];H[62628]=H[62624];H[62630]=H[62624];H[62632]=H[62624];H[62634]=H[62624];H[62636]=H[62624];H[62638]=H[62624];H[62642]=H[62640];H[62644]=H[62640];H[62646]=H[62640];H[62648]=H[62640];H[62650]=H[62640];H[62652]=H[62640];H[62654]=H[62640];H[62658]=H[62656];H[62660]=H[62656];H[62662]=H[62656];H[62664]=H[62656];H[62666]=H[62656];H[62668]=H[62656];H[62670]=H[62656];H[62674]=H[62672];H[62676]=H[62672];H[62678]=H[62672];H[62680]=H[62672];H[62682]=H[62672];H[62684]=H[62672];H[62686]=H[62672]; -H[62690]=H[62688];H[62692]=H[62688];H[62694]=H[62688];H[62696]=H[62688];H[62698]=H[62688];H[62700]=H[62688];H[62702]=H[62688];H[62706]=H[62704];H[62708]=H[62704];H[62710]=H[62704];H[62712]=H[62704];H[62714]=H[62704];H[62716]=H[62704];H[62718]=H[62704];H[65410]=H[65408];H[65412]=H[65408];H[65414]=H[65408];H[65416]=H[65408];H[65418]=H[65408];H[65420]=H[65408];H[65422]=H[65408];H[65426]=H[65424];H[65428]=H[65424];H[65430]=H[65424];H[65432]=H[65424];H[65434]=H[65424];H[65436]=H[65424];H[65438]=H[65424]; -H[65442]=H[65440];H[65444]=H[65440];H[65446]=H[65440];H[65448]=H[65440];H[65450]=H[65440];H[65452]=H[65440];H[65454]=H[65440];H[65458]=H[65456];H[65460]=H[65456];H[65462]=H[65456];H[65464]=H[65456];H[65466]=H[65456];H[65468]=H[65456];H[65470]=H[65456];H[65506]=H[65504];H[65508]=H[65504];H[65510]=H[65504];H[65512]=H[65504];H[65514]=H[65504];H[65516]=H[65504];H[65518]=H[65504]; -u(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.c,0,d>>2),pb(this,lb?qb:rb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},aa:function(a){a&1&&F(this.b,4);var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},ea:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ma=!0},G:function(a,b){return this.H(a, -b)},S:function(a,b){return this.Y(a,b)},ca:function(a,b,c){this.h||this.Ab(a,b,c)},ja:function(a,b,c){this.h||this.ka(a,b,c)},D:function(a){return this.g[a]},J:function(a){return this.g[a]},O:function(a){a&1&&F(this.b,4);return this.m.getUint16(a,!0)},$:function(a){a&1&&F(this.b,4);return this.o[a>>1]},ba:function(a,b){this.g[a]=b;this.ma=!0},da:function(a,b){this.g[a]=b;this.ma=!0},ia:function(a,b){a&1&&F(this.b,4);this.m.setUint16(a,b,!0);this.ma=!0},ta:function(a,b){a&1&&F(this.b,4);this.o[a>> -1]=b;this.ma=!0}};function Ra(a,b,c){a.I=b;a.w=a.l=0;c&&((a.w=c.w)&&tb(a,ub,!1),(a.l=c.l)&&vb(a,ub,!1))}function vb(a,b,c){c&&a.l||(a.Qa=!a.h&&b[1]||a.B,a.Sc=!a.h&&b[3]||a.A);if(c||void 0===c)a.Ab=b[1]||a.B,a.ka=b[3]||a.A}function tb(a,b,c){c&&a.w||(a.Ya=b[0]||a.s,a.oc=b[2]||a.u);if(c||void 0===c)a.H=b[0]||a.s,a.Y=b[2]||a.u}function pb(a,b){b||(b=wb);tb(a,b,void 0);vb(a,b,void 0)} -var wb=[],sb=[E.prototype.N,E.prototype.ea,E.prototype.aa,E.prototype.ua],ub=[E.prototype.G,E.prototype.ca,E.prototype.S,E.prototype.ja];if(Ja)var rb=[E.prototype.D,E.prototype.ba,E.prototype.O,E.prototype.ia],qb=[E.prototype.J,E.prototype.da,E.prototype.$,E.prototype.ta]; -function xb(a,b){v.call(this,"CPU",a,xb);var c=a.multiplier||1;this.Ja=a.cycles||b;this.da=c;this.Va=Math.round(this.Ja/1E4)/100;this.ia=this.Va*this.da;this.i.V=!1;this.i.xb=!1;this.i.Aa=a.autoStart;this.i.cb=!1;this.i.La=!1;this.Ca=this.ja=0;this.Ia=a.csStart;this.ta=a.csInterval;this.ua=a.csStop;this.J=[];this.mb=this.sc.bind(this);D(this)}x(xb);var yb=["power","reset"];g=xb.prototype; -g.oa=function(a,b,c,d){this.B=a;this.m=b;this.I=d;for(b=0;b>=3;d=""+e}else d=h(c,d);else d="--------".substr(0,d||4);a.w[b].textContent!=d&&(a.w[b].textContent=d)}} -g.R=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.i.L)a=!0;else{var b=null,c,m=y(a.id);for(c=0;ca.aa/a.ia&&(b=1),a.da=b,b=a.Va*a.da,a.ia!=b)){a.ia=b;b=a.ia.toFixed(2)+"Mhz";var c=a.w.setSpeed;c&&(c.textContent=b);a.M("target speed: "+b)}Fb(a,a.Y);a.Y=0;a.S=ja();a.ba=0;Gb(a)}function cb(a,b){var c=a.J.length;a.J.push([-1,b]);return c}function eb(a,b,c){0<=b&&ba.J[b][0]&&(c*=a.Ja*a.da/1E3,a.J[b][0]=c)} -g.sc=function(){if(this.i.V){this.Xa>=this.Ja&&Gb(this,!0);this.ya=0;this.Ha=ja();if(this.ba){var a=this.Ha-this.ba;a>this.kb&&(this.S+=a,this.S>this.Ha&&(this.S=this.Ha))}try{do{for(var b,c=this.i.La?1:this.Ka,d=this.J.length-1;0<=d;d--){var e=this.J[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.yb(b)}catch(q){if("number"!=typeof q)throw q;}for(var f=this.ca-this.a,a=f,k=this.J.length-1;0<=k;k--){var m=this.J[k];0>m[0]||(m[0]-=a,0>=m[0]&&(m[0]=-1,m[1]()))}this.ya+=f;this.Y+=f;Fb(this,0,!0);a=f;if(this.i.La){var n= -!1;this.Ca=this.Ca+this.fb()|0;this.ja-=a;0>=this.ja&&(this.ja+=this.ta,n=!0);0<=this.ua&&this.ua<=Hb(this)&&(this.ta=this.ua=-1,Bb(this),L(this),n=!0);n&&this.M(Hb(this)+" cycles: checksum="+h(this.Ca))}this.xa-=f;if(0>=this.xa){this.xa+=this.Ka;15<=++this.lb&&(this.B&&this.B.wa(),this.lb=0);break}}while(this.i.V)}catch(q){L(this);Cb(this);this.B&&this.B.stop(ja(),Hb(this));b=q.stack||q.message;this.i.error=!0;this.K(b);return}if(this.i.V){b=setTimeout;c=this.mb;this.ba=ja();d=this.kb;this.ya&&(d= -Math.round(d*this.ya/this.Ka));d-=this.ba-this.Ha;if(e=this.ba-this.S)this.aa=Math.round(this.Y/(10*e))/100,864E5<=e&&(this.ea=0,Eb(this));if(0>d||this.aad&&(this.S-=d),d=0;this.Xa+=this.ya;this.ba+=d;b(c,d)}}};function Db(a){var b;a.i.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.i.V)a.M(a.toString()+" busy");else{Eb(a);a.i.V=!0;a.i.xb=!0;if(b=a.w.run)b.textContent="Halt";a.B&&a.B.start(a.S,Hb(a));Cb(a,!0);setTimeout(a.mb,0)}}g.yb=function(){return 0}; -function L(a){if(a.i.V){a.ca-=a.a;a.a=0;Fb(a,a.Y);a.Y=0;a.i.V=!1;var b=a.w.run;b&&(b.textContent="Run");a.B&&a.B.stop(ja(),Hb(a));Cb(a)}a.i.complete=void 0}function Cb(a,b){a.B&&a.B.wa(b)} -function Ib(a){this.Mb=+a.model||1170;this.Ob=a.resetAddr||0;xb.call(this,a,6666667);this.gb=0;this.decode=Jb.bind(this);this.o=65536;this.h=32768;this.l=65535;this.s=32768;this.v=15;this.f=[0,0,0,0,0,0,0,this.Ob];this.va=[0,0,0,0,0,0];this.Z=[0,0,0,0];this.Fa=this.A=0;this.Lb=[4,2,0,1];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.P=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.tc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.wb=[0,0,0,0,0,0,0,0];this.g=this.c=this.Ta=this.G=this.H=this.j=this.vb=0;this.ka=-1;Kb(this);this.i.complete=this.i.Hb=!1}x(Ib,xb);g=Ib.prototype;g.hb=function(){fb(this)};g.reset=function(){this.i.V&&L(this);Kb(this);Ab(this);this.i.error=!1;this.parent.reset.call(this)}; -function Kb(a){a.sa=255;a.F=0;a.ab=0;a.D=0;a.qa=0;a.$a=0;a.ra=0;a.Oa=0;a.Ea=0;a.Wa=262143;a.Ga=253952;a.u=[];a.j|=2;a.m&&fb(a)}function fb(a){a.Oa?(a.$=65536,a.N=a.Kb,a.O=a.ub,a.nb=a.Uc,Sa(a.m,a.ra&16?22:18)):(a.$=0,a.N=a.Jb,a.O=a.pc,a.nb=a.Tc,Sa(a.m,16))}g.fb=function(){return 0};g.save=function(){var a=new M(this);a.set(0,[]);a.set(1,[this.ea,this.da]);a.set(2,$a(this.m));return a.data()}; -g.restore=function(a){var b=a[1];this.ea=b[1];Eb(this,b[3]);a:{b=this.m;a=a[2];var c;for(c=0;cb){a.u[f].fa-=b;break}b-=a.u[f].fa}a.u.splice(f+1,0,{fa:b,ob:c<<5&224,zb:d,Ra:e})}a.j|=2}function hb(a){return a.v=a.v&63728|a.na()|(a.l&65535?0:4)|(a.h&32768?2:0)|N(a)} -function ib(a,b){a.s=b<<12;a.l=~b&4;a.h=b<<14;a.o=b<<16;if((b^a.v)&2048)for(var c=a.va.length;0<=--c;){var d=a.f[c];a.f[c]=a.va[c];a.va[c]=d}a.A=b>>14&3;c=a.v>>14&3;a.A!=c&&(a.Z[c]=a.f[6],a.f[6]=a.Z[a.A]);a.j|=2;a.v=b}function O(a,b){a.j&128||(a.s=a.l=b,a.h=0)}function P(a,b,c){a.j&128||(a.s=a.l=a.o=b,a.h=c||0)}function Mb(a,b,c,d){a.j&128||(a.s=a.l=a.o=b,a.h=(c^b)&(d^b))}function Q(a,b){a.j&128||(a.s=a.l=a.o=b,a.h=a.s^a.o>>1)}function Nb(a,b,c,d){a.j&128||(a.s=a.l=a.o=b,a.h=(c^d)&(d^b))} -function F(a,b){var c=!1;0>a.ka?a.ka=hb(a):a.A||(b=4,c=!0);a.D&57344||(a.qa=63222,a.$a=b);a.A=0;var d=a.O(b|a.$),e=a.O(b+2&65535|a.$);ib(a,e&-12289|a.ka>>2&12288);c&&(a.F|=4,a.f[6]=4);Ob(a,a.ka);Ob(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.ka=-1;throw b;}function Pb(a){var b=Qb(a),c=Qb(a)&-1793;a.v&49152&&(c=c&-225|a.v&63712);a.f[7]=b&65535;ib(a,c);a.j&=-17} -function Rb(a,b,c){var d,e,f,k=0;d=b>>13;a.ra&a.Lb[a.A]||(d&=7);e=a.C[a.A][d];f=(a.P[a.A][d]<<6)+(b&8191)&a.Wa;if(ff){if(3932160<=f){f&=262143;var m=f>>13&31;31>m?a.ra&32&&(f=a.tc[m]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Ga&&4186112>f&&(a.F|=32,F(a,4))}switch(e&7){case 1:k=4096;case 2:e|=128;c&4&&(k=8192);break;case 4:k=4096;case 5:c&4&&(k=4096);case 6:e|=c&4?192:128;break; -default:k=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(k|=16384):(b&8128)>(e>>2&8128)&&(k|=16384));a.C[a.A][d]=e;if(4194170!==f||a.A)a.Ea=a.A,a.Fa=d;k&&(k&57344&&(0<=a.ka&&(k|=128),a.D&57344||(a.D=a.D|k|a.Ea<<5|a.Fa<<1),F(a,168)),a.D&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=k);e=a.O(e);e|=k;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=k);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=k);e=a.O(e)|k;a.a-=8;break; -case 6:return e=Lb(a),e=e+a.f[c]&65535|k,a.a-=6,e;case 7:return e=Lb(a),e=e+a.f[c]&65535,e=a.O(e|a.$)|k,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!k||a.D&57344||(a.qa=a.qa<<8|f<<3&248|c);6==c&&!a.A&&d&4&&0>=f&&(a.f[6]<=a.sa||65534<=a.f[6])&&(a.f[6]<=a.sa-32?(a.F|=4,a.f[6]=4,F(a,4)):(a.F|=8,a.j|=64));return e}g.Jb=function(a,b,c){return Sb(this,a,b,c)};g.Kb=function(a,b,c){return Rb(this,Sb(this,a,b,c),c)};g.pc=function(a){return Ya(this.m,a)};g.ub=function(a){return Ya(this.m,Rb(this,a,2))}; -g.Tc=function(a,b){Za(this.m,a,b&65535)};g.Uc=function(a,b){Za(this.m,Rb(this,a,4),b)};function Tb(a,b,c){var d=a.c=b&7;(b=a.g=(b&56)>>3)?(d=Sb(a,b,d,2),c&65536||61440!==(a.v&61440)&&(d&=65535),a.A=a.v>>12&3,c=a.O(d|c&a.$),a.A=a.v>>14&3):c=6!=d||(a.v>>2&12288)===(a.v&12288)?a.f[d]:a.Z[a.v>>12&3];return c} -function Ub(a,b,c,d){a.D&57344||(a.qa=22);var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=Sb(a,b,e,4),c&65536||(e&=65535),a.A=a.v>>12&3,e=Rb(a,e|c&65536,4),a.A=a.v>>14&3,Za(a.m,e,d)):6!=e||(a.v>>2&12288)===(a.v&12288)?a.f[e]=d:a.Z[a.v>>12&3]=d}function Vb(a,b){b>>=6;var c=a.H=b&7;(b=a.G=(b&56)>>3)?(c=a.N(b,c,3),a=Xa(a.m,c)):a=a.f[c]&255;return a}function R(a,b){b>>=6;var c=a.H=b&7;return(b=a.G=(b&56)>>3)?Ya(a.m,a.N(b,c,2)):a.f[c]}function Wb(a,b){var c=a.c=b&7;b=a.g=(b&56)>>3;return Sb(a,b,c,8)} -function Xb(a,b){var c=a.c=b&7;(b=a.g=(b&56)>>3)?(c=a.N(b,c,3),a=Xa(a.m,c)):a=a.f[c]&255;return a}function S(a,b){var c=a.c=b&7;return(b=a.g=(b&56)>>3)?Ya(a.m,a.N(b,c,2)):a.f[c]}function T(a,b,c,d){var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=a.Ta=a.N(b,e,7),c=d.call(a,c,Xa(a.m,e)),e&1&&a.a--,a=a.m,a.a[(e&a.h)>>>a.c].Qa(e&a.m,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function U(a,b,c,d){var e=a.c=b&7;(b=a.g=(b&56)>>3)?(e=a.N(b,e,6),Za(a.m,e,d.call(a,c,Ya(a.m,e)))):a.f[e]=d.call(a,c,a.f[e])} -function Yb(a,b,c,d){var e=a.c=b&7;(b=a.g=(b&56)>>3)?(d=a.N(b,e,5),d&1&&a.a--,a=a.m,a.a[(d&a.h)>>>a.c].Qa(d&a.m,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function Zb(a,b,c){var d=a.c=b&7;(b=a.g=(b&56)>>3)?Za(a.m,a.N(b,d,4),c):a.f[d]=c&65535;return c}function V(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} -g.yb=function(a){this.i.complete=!0;this.i.Hb=!1;this.i.xb=!1;this.ca=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?F(this,168):this.j&64?F(this,4):this.j&16&&F(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.ab&224,c=this.u.length;0<=--c;){if(0b&&(b=this.u[c].ob,a=this.u[c],this.u.splice(c,1))}b>(this.v&224)&&(this.j&4&&(this.f[7]= -this.f[7]+2&65535,this.j&=-5),a?F(this,a.zb):F(this,160))}else this.j&1&&this.j++;this.D&57344||(this.qa=0,this.$a=this.f[7]);this.j=this.j&7|this.v&16;this.decode(Lb(this))}while(0>1|b<<16;Q(this,a);return a&65535}function ec(a,b){a=b&2048|b>>1|b<<8;Q(this,a<<8);return a&255}function fc(a,b){a=b&~a;O(this,a);return a}function gc(a,b){a=b&~a;O(this,a<<8);return a}function hc(a,b){a|=b;O(this,a);return a}function ic(a,b){a|=b;O(this,a<<8);return a}function jc(a,b){a=~b|65536;P(this,a);return a&65535} -function kc(a,b){a=~b|256;P(this,a<<8);return a&255}function lc(a,b){a=b-a;this.j&128||(this.s=this.l=a,this.h=b&(b^a));return a&65535}function mc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.s=this.l=c,this.h=b&(b^c));return a&255}function nc(a,b){a=b+a;this.j&128||(this.s=this.l=a,this.h=a&(b^a));return a&65535}function oc(a,b){a=b+a;var c=a<<8;this.j&128||(this.s=this.l=c,this.h=c&(b<<8^c));return a&255}function pc(a,b){a=-b;P(this,a,a&b&32768);return a&65535} -function qc(a,b){a=-b;P(this,a<<8,(a&b&128)<<8);return a&255}function rc(a,b){a=b<<1|this.o>>16&1;Q(this,a);return a&65535}function sc(a,b){a=b<<1|this.o>>16&1;Q(this,a<<8);return a&255}function tc(a,b){a=(this.o&65536|b)>>1|b<<16;Q(this,a);return a&65535}function uc(a,b){a=((this.o&65536)>>8|b)>>1|b<<8;Q(this,a<<8);return a&255}function vc(a,b){var c=b-a;Nb(this,c,a,b);return c&65535}function wc(a,b){var c=b-a;Nb(this,c<<8,a<<8,b<<8);return c&255} -function xc(a,b){this.j&128||(this.s=this.l=b&65280,this.h=this.o=0);return(b<<8|b>>8)&65535}function yc(a,b){a^=b;O(this,a);return a&65535}function zc(a){var b=S(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.o=this.h=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.h=32768)}this.f[a]=c&65535;this.s=this.l=c;this.a-=(this.g?6:7)+b} -function Ac(a){var b=S(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.o=this.h=0;b&=63;if(b&32){b=64-b;32>b-1;this.o=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.s=d>>16;this.l=d>>16|d;this.a-=(this.g?6:7)+b}function W(a){a&1&&(this.o=0);a&2&&(this.h=0);a&4&&(this.l=1);a&8&&(this.s=0);this.a-=5} -function Bc(a){var b=S(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.o=this.h=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.l=d>>16|d,this.s=d>>16):(this.h=32768,this.l=d>>15|d,this.s=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.l=this.s=0,this.h=32768,this.o=65536,this.a-=7}var Cc=[0,7,7,10,7,11,9,13];function Dc(a){var b=this.a;a=Wb(this,a);this.f[7]=a&65535;this.a=b-Cc[this.g]} -var Ec=[0,14,14,17,14,18,16,20];function Fc(a){var b=this.a,c=Wb(this,a);a=a>>6&7;Ob(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Ec[this.g]}var Gc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Hc=[7,13,13,17,14,18,17,21];function Ic(a){var b=S(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.s=b>>16,this.l=this.s|b,this.h=0,this.o=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Lc(a){U(this,a,0,xc);this.a-=this.g?9:3+(7==this.c?2:0)}function Mc(a){U(this,a,R(this,a),yc);this.a-=this.g?9:3+(7==this.c?2:0)}function Y(){F(this,8)}function Jb(a){Nc[a>>12].call(this,a)} -var Nc=[function(a){Oc[a>>8&15].call(this,a)},function(a){var b=R(this,a),c=this.a;O(this,Zb(this,a,b));this.a=c-Gc[(this.G?8:0)+this.g]+(7!=this.c||this.g?0:2)},function(a){var b=R(this,a);a=S(this,a);Nb(this,b-a,a,b);this.a-=this.g?4+(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){O(this,R(this,a)&S(this,a));this.a-=this.g?4+(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){U(this,a,R(this,a),fc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c? -2:0)},function(a){U(this,a,R(this,a),hc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){U(this,a,R(this,a),$b);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){Pc[a>>8&15].call(this,a)},function(a){Qc[a>>8&15].call(this,a)},function(a){var b=Vb(this,a);O(this,Yb(this,a,b,1)<<8);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){var b=Vb(this,a)<<8;a=Xb(this,a)<<8;Nb(this,b-a,a,b);this.a-=this.g?4+ -(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){O(this,(Vb(this,a)&Xb(this,a))<<8);this.a-=this.g?4+(this.H&&6<=this.c?1:0):(this.G?4:3)+(7==this.c?2:0)},function(a){T(this,a,Vb(this,a),gc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){T(this,a,Vb(this,a),ic);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},function(a){U(this,a,R(this,a),vc);this.a-=this.g?9+(this.H&&6<=this.c?1:0):(this.G?5:3)+(7==this.c?2:0)},Y],Oc=[function(a){Rc[a>> -4&15].call(this,a)},function(a){V(this,a,!0)},function(a){V(this,a,!!(this.l&65535))},function(a){V(this,a,this.l&65535?0:4)},function(a){V(this,a,!this.na()==!(this.h&32768))},function(a){V(this,a,!this.na()!=!(this.h&32768))},function(a){V(this,a,!!(this.l&65535)&&!this.na()==!(this.h&32768))},function(a){V(this,a,(this.l&65535?0:4)||!this.na()!=!(this.h&32768))},Fc,Fc,function(a){Sc[a>>6&3].call(this,a)},function(a){Tc[a>>6&3].call(this,a)},function(a){Uc[a>>6&3].call(this,a)},function(a){Vc[a>> -6&3].call(this,a)},Y,Y],Sc=[function(a){P(this,Zb(this,a,0));this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,jc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,1,nc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,1,lc);this.a-=this.g?9:3+(7==this.c?2:0)}],Tc=[function(a){U(this,a,0,pc);this.a-=this.g?11:6},function(a){U(this,a,N(this)?1:0,$b);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,N(this)?1:0,vc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){a=S(this, -a);P(this,a);this.a-=this.g?4:3+(7==this.c?2:0)}],Uc=[function(a){U(this,a,0,tc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,rc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,dc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){U(this,a,0,bc);this.a-=this.g?9:3+(7==this.c?2:0)}],Vc=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.ub(a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Tb(this,a,0);Ob(this,a);O(this,a);this.a-= -11},function(a){var b=Qb(this),c=this.a;Ub(this,a,0,b);O(this,b);this.a=c-Hc[this.g]},function(a){O(this,Zb(this,a,this.na?65535:0));this.a-=this.g?9:3+(7==this.c?2:0)}],Rc=[function(a){Wc[a&15].call(this,a)},Y,Y,Y,Dc,Dc,Dc,Dc,function(a){if(a&8)F(this,8);else{var b=Qb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.v&49152||(this.v=this.v&-2017|(a&7)<<5,this.j|=1),this.a-=5):F(this,8)},function(a){Xc[a&15].call(this,a)},function(a){Yc[a&15].call(this,a)},Lc,Lc, -Lc,Lc],Wc=[function(){this.v&49152?(this.F|=128,F(this,4)):L(this);this.a-=7},function(){this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Pb(this);this.j|=this.v&16;this.a-=13},function(){F(this,12);this.a-=5},function(){F(this,16);this.a-=25},function(){this.v&49152||(Kb(this),this.m.reset());this.a-=667},function(){Pb(this);this.a-=13},Y,Y,Y,Y,Y,Y,Y,Y,Y],Xc=[Jc,function(){this.o=0;this.a-=5},function(){this.h=0;this.a-=5},W,function(){this.l=1;this.a-=5},W,W,W,function(){this.s=0;this.a-= -5},W,W,W,W,W,W,W],Yc=[Jc,function(){this.o=65536;this.a-=5},function(){this.h=32768;this.a-=5},X,function(){this.l=0;this.a-=5},X,X,X,function(){this.s=32768;this.a-=5},X,X,X,X,X,X,X],Pc=[Ic,Ic,Bc,Bc,zc,zc,Ac,Ac,Mc,Mc,Y,Y,Y,Y,Kc,Kc],Qc=[function(a){V(this,a,!this.na())},function(a){V(this,a,this.na())},function(a){V(this,a,!N(this)&&!!(this.l&65535))},function(a){V(this,a,N(this)||(this.l&65535?0:4))},function(a){V(this,a,!(this.h&32768))},function(a){V(this,a,this.h&32768?2:0)},function(a){V(this, -a,!N(this))},function(a){V(this,a,N(this))},function(){F(this,24);this.a-=25},function(){F(this,28);this.a-=5},function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>>6&3].call(this,a)},function(a){ad[a>>6&3].call(this,a)},function(a){bd[a>>6&3].call(this,a)},Y,Y],Zc=[function(a){P(this,Yb(this,a,0));this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,0,kc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,1,oc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,1,mc);this.a-=this.g? -9:3+(7==this.c?2:0)}],$c=[function(a){T(this,a,0,qc);this.a-=this.g?11:6},function(a){T(this,a,N(this)?1:0,ac);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,N(this)?1:0,wc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){a=Xb(this,a);P(this,a<<8);this.a-=this.g?4:3+(7==this.c?2:0)}],ad=[function(a){T(this,a,0,uc);this.a-=this.g?9+(this.Ta&1):3+(7==this.c?2:0)},function(a){T(this,a,0,sc);this.a-=this.g?9:3+(7==this.c?2:0)},function(a){T(this,a,0,ec);this.a-=this.g?9+(this.Ta&1):3+(7==this.c? -2:0)},function(a){T(this,a,0,cc);this.a-=this.g?9:3+(7==this.c?2:0)}],bd=[Y,function(a){a=Tb(this,a,65536);Ob(this,a);O(this,a);this.a-=11},function(a){var b=Qb(this),c=this.a;Ub(this,a,65536,b);O(this,b);this.a=c-Hc[this.g]},Y]; -function cd(a){v.call(this,"ROM",a,cd);this.a=null;this.o=a.addr;this.c=a.size;this.s=a.writable;this.g=a.alias;this.h=a.file;this.u=ba(this.h);if(this.h){a=this.h;var b=ca(this.u);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.h+"&format=bytes&decimal=true");var c=this;l(a,null,!0,function(a,b,f){dd(c,a,b,f)})}}x(cd);cd.prototype.oa=function(a,b,c,d){this.m=b;this.b=c;this.I=d;ed(this)};cd.prototype.ha=function(){this.l&&(this.I&&this.I.a(this.id,this.o,this.c,this.l),delete this.l);return!0}; -cd.prototype.ga=function(){return!0}; -function dd(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ua,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,k,m=eval("("+c+")");if(f=m.bytes)a.a=f;else if(f=m.words)for(a.a=Array(2*f.length),k=e=0;e>8&255;else if(f=m.data)for(a.a=Array(4*f.length),k=e=0;e>8&255,a.a[k++]=f[e]>>16&255,a.a[k++]=f[e]>>24&255;else a.a=m;a.l=m.symbols;if(!a.a.length){p("Empty ROM: "+b); -return}if(1==a.a.length){p(a.a[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.a=Array(b.length),e=0;e>>d.c].Ab(e&d.m,a.a[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c>>e.c;0>>=e.c;0=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ha(b[0]);if(c!=this.Da)return;b=ha(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.u=d.receiveData){this.status(this.Ua+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ha=function(a,b){if(!b)if(this.ib(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; -g.ga=function(a){return a?this.save():!0};g.reset=function(){jd(this)};g.save=function(){var a=new M(this);a.set(0,[]);return a.data()};g.restore=function(){return jd(this)};function jd(a){a.G=0;a.a=0;a.c=128;a.h=[];return!0}g.Za=function(a){if("number"==typeof a)this.h.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.A&&!this.o&&c&&(b=String.fromCharCode(this.A)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.l){if(10==a||1024<=this.l.length)this.M(this.l), -this.l="";10!=a&&(this.l+=String.fromCharCode(a))}this.c&=-129;db(this.b,100,4,52,this.D)}};var kd={},id=(kd[65392]=[null,null,Z.prototype.dc,Z.prototype.Hc,"RCSR"],kd[65394]=[null,null,Z.prototype.cc,Z.prototype.Gc,"RBUF"],kd[65396]=[null,null,Z.prototype.rc,Z.prototype.Wc,"XCSR"],kd[65398]=[null,null,Z.prototype.qc,Z.prototype.Vc,"XBUF"],kd);u(function(){for(var a=C(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.M("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bnd){if(pd(d,this.u)){this.l=new M(this,"1.30.1","failsafe");pd(this.l)&&(ud(this,d),a=2,vd(this.l));this.l.set("timestamp",ka());wd(this.l);var e=this.a&&!this.o;if(1==a||la("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=td(d)){var f=d.get("code"),k=d.get("data");f&&("ok"==f?pd(d,k):("error"== -f&&"no machine state"!=k?(this.K("Error: "+k),"unable to verify user"==k&&(pa("user",""),this.c=null)):this.M(f+": "+k),vd(d),pd(d)?(c=td(d),e=!0):c=!1))}e&&sd(this,c?d:null)}else 2==a&&d.clear()}else sd(this);delete this.u;delete this.B}e=y(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.i.L=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.b&&(xd(this,this.b,b,c,a),this.b.Aa());this.G&&(ud(this,b),b.clear());!c&&this.l&&(this.l.clear(),delete this.l);this.g=0}; -function ud(a,b){if(la("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.O;d.user=c;d.type="bug";d.data=b;l("http://www.pcjs.org/api/v1/report",d,!0)}} -function yd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new M(a,"1.30.1"),k=new M(a,"1.30.1","validate"),m=ka();k.set("timestamp",m);f.set("timestamp",m);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.b&&a.b.ga&&(c&&L(a.b),d=a.b.ga(b,c),"object"===typeof d&&f.set(a.b.id,d),c&&(a.b.i.L=!1,!1===d&&(e=null)));for(var m=y(a.id),n=0;n>1)+2;10>this.c&&(this.c=10);15>2;this.g=this.l-1;this.A=this.D/this.l|0;this.ga=[];this.o=0;this.s=[];this.xb=[Na,Oa,Pa,Qa];a=new E(this);Ra(a,this.I);this.b=Array(this.A);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);return 0<=c?c:c=Sa(d)}function Oa(a,b,c){var d=!1,e=this.controller,f=e.ga[a];if(f)if(f[1])f[1](b,c),d=!0;else{if(f[3]){a=f[2]?f[2](c):0;if(c&1)f[3](a&255|b<<8,c&-2);else f[3](a&-256|b,c);d=!0}}else c&1&&(f=e.ga[a&-2])&&f[3]&&(c&=-2,a=f[2]?f[2](c):0,f[3](a&255|b<<8,c),d=!0);d||Sa(e)} +function Pa(a,b){var c=-1,d=this.controller;(a=d.ga[a])&&(a[2]?c=a[2](b):a[0]&&(c=a[0](b)|a[0](b+1)<<8));return 0<=c?c:c=Sa(d)}function Qa(a,b,c){var d=!1,e=this.controller;if(a=e.ga[a])a[3]?(a[3](b,c),d=!0):a[1]&&(a[1](b&255,c),a[1](b>>8,c+1),d=!0);d||Sa(e)}function Ta(a,b){if(b!=a.m){var c;a.m&&(c=(1<>>a.c;0h&&(u=h);if(!e&&n&&n.size){if(n.type==d){if(f+h<=n.ya)return n.Oa+=n.ya-f,n.ya=f,!0;if(f>=n.ya+n.Oa){u=n.size-(f-p);u>h&&(u=h);n.Oa=f-n.ya+u;f=p+a.l;h-=u;l++;continue}}return Ya(1,f,h)}f=new E(a,f,u,a.l,d,e);Ra(f,a.I,n);a.b[l++]=f;f=p+a.l;h-=u}return 0>=h?(a.status(Math.floor(c/1024)+"Kb "+Za[d]+" at "+k(b,8,!0)),!0):Ya(2,b,c)} +function Va(a,b,c){var d=[];for(b>>>=a.c;0>>=a.c;0>>a.c].Xa(b&a.g,b)}function ab(a,b){return a.b[(b&a.i)>>>a.c].jc(b&a.g,b)}function bb(a,b,c){a.b[(b&a.i)>>>a.c].Rc(b&a.g,c&65535,b)} +function cb(a){for(var b=0,c=[],d=0;da.a.Db)){var h=f[0]?f[0].bind(b):null,l=f[1]?f[1].bind(b):null,n=f[2]?f[2].bind(b):null,p=f[3]?f[3].bind(b):null;e&1&&(!h&&n&&(h=function(a){return function(b){return a(b)&255}.bind(b)}(n)),!l&&p&&n&&(l=function(a,c){return function(b,d){return a(c(d)&-256|b,d)}.bind(b)}(p,n)));db(a,e,e,h,l,n,p,f[4])}}}function fb(a,b){a.s.push(b)}function G(a){a.o||F(a.a,4)} +function Ya(a,b,c){q("Memory block error ("+a+": "+k(b)+","+k(c)+")");return!1}function H(a){v.call(this,"Device",a,H);this.c={data:0,Wc:0,Ma:20,$c:0};this.b={Zc:0,ab:-1}}x(H);g=H.prototype;g.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;var e=this;this.b.ab=gb(this.a,function(){e.b.ka|=128;e.b.ka&64&&(hb(e.a,0,6,64),ib(e.a,e.b.ab,1E3/60))});eb(b,this,I);fb(b,this.reset.bind(this));D(this)};g.Mb=function(){var a=this.b.ka;this.b.ka&=-129;return a}; +g.vc=function(a){this.b.ka=a;a&64&&ib(this.a,this.b.ab,1E3/60);this.b.ka=a&-129};g.Ob=function(){var a=this.a;return a.B&62337|a.Da<<5|a.Ea<<1};g.xc=function(a){var b=this.a;a&=62337;if(b.B!=a){b.B=a;b.Da=a>>5&3;b.Ea=a>>1&15;var c=0;a&257&&(c=4,a&1&&(c|=2));b.Na!=c&&(b.Na=c,jb(b))}kb(this)};g.Pb=function(){var a=this.a.la;a&65280&&(a=(a<<8|a>>8)&65535);return a};g.Qb=function(){return this.a.Za};g.Rb=function(){return this.a.ma}; +g.yc=function(a){var b=this.a;b.ma!=a&&(b.ma=a,a&16?(b.Va=4194303,b.Fa=3915776):(b.Va=262143,b.Fa=253952),jb(b));kb(this)};function kb(a){a.c.Ma=a.c.Ma&-8|(a.a.Na?a.a.ma&16?1:2:4)}g.cc=function(a){return this.a.C[1][a>>1&7]};g.Kc=function(a,b){this.a.C[1][b>>1&7]=a&65295};g.ac=function(a){return this.a.C[1][(a>>1&7)+8]};g.Ic=function(a,b){this.a.C[1][(b>>1&7)+8]=a&65295};g.bc=function(a){return this.a.O[1][a>>1&7]};g.Jc=function(a,b){b=b>>1&7;this.a.O[1][b]=a;this.a.C[1][b]&=65295}; +g.$b=function(a){return this.a.O[1][(a>>1&7)+8]};g.Hc=function(a,b){b=(b>>1&7)+8;this.a.O[1][b]=a;this.a.C[1][b]&=65295};g.Lb=function(a){return this.a.C[0][a>>1&7]};g.uc=function(a,b){this.a.C[0][b>>1&7]=a&65295};g.Jb=function(a){return this.a.C[0][(a>>1&7)+8]};g.sc=function(a,b){this.a.C[0][(b>>1&7)+8]=a&65295};g.Kb=function(a){return this.a.O[0][a>>1&7]};g.tc=function(a,b){b=b>>1&7;this.a.O[0][b]=a;this.a.C[0][b]&=65295};g.Ib=function(a){return this.a.O[0][(a>>1&7)+8]}; +g.rc=function(a,b){b=(b>>1&7)+8;this.a.O[0][b]=a;this.a.C[0][b]&=65295};g.ic=function(a){return this.a.C[3][a>>1&7]};g.Qc=function(a,b){this.a.C[3][b>>1&7]=a&65295};g.gc=function(a){return this.a.C[3][(a>>1&7)+8]};g.Oc=function(a,b){this.a.C[3][(b>>1&7)+8]=a&65295};g.hc=function(a){return this.a.O[3][a>>1&7]};g.Pc=function(a,b){b=b>>1&7;this.a.O[3][b]=a;this.a.C[3][b]&=65295};g.fc=function(a){return this.a.O[3][(a>>1&7)+8]};g.Nc=function(a,b){b=(b>>1&7)+8;this.a.O[3][b]=a;this.a.C[3][b]&=65295}; +g.sa=function(a){a&=7;return this.a.u&2048?this.a.ra[a]:this.a.f[a]};g.va=function(a,b){b&=7;this.a.u&2048?this.a.ra[b]=a:this.a.f[b]=a};g.Ub=function(){return this.a.u&49152?this.a.U[0]:this.a.f[6]};g.Bc=function(a){this.a.u&49152?this.a.U[0]=a:this.a.f[6]=a};g.Xb=function(){return this.a.f[7]};g.Ec=function(a){this.a.f[7]=a};g.ta=function(a){a&=7;return this.a.u&2048?this.a.f[a]:this.a.ra[a]};g.wa=function(a,b){b&=7;this.a.u&2048?this.a.f[b]=a:this.a.ra[b]=a}; +g.Vb=function(){return 1==(this.a.u&49152)>>14?this.a.f[6]:this.a.U[1]};g.Cc=function(a){1==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.U[1]=a};g.Wb=function(){return 3==(this.a.u&49152)>>14?this.a.f[6]:this.a.U[3]};g.Dc=function(a){3==(this.a.u&49152)>>14?this.a.f[6]=a:this.a.U[3]=a};g.Hb=function(a){return this.a.qb[a-65504>>1]};g.qc=function(a,b){this.a.qb[b-65504>>1]=a};g.nb=function(a){return 65520==a?61183:0};g.wb=function(){};g.ec=function(){return 1};g.Mc=function(){};g.Gb=function(){return this.a.G}; +g.pc=function(){this.a.G=0};g.Nb=function(){return this.a.pb};g.wc=function(a,b){b&1||(a&=255);this.a.pb=a};g.Sb=function(){return this.a.$a};g.zc=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.$a=a;b.j|=2};g.dc=function(){return this.a.na&65280};g.Lc=function(a){this.a.na=a|255};g.Tb=function(){return lb(this.a)};g.Ac=function(a){mb(this.a,a&-1809|lb(this.a)&1808);this.a.j|=128};g.vb=function(){};g.reset=function(){this.c.Ma=this.c.Ma&-120|20;this.b.ka=0}; +var J={},I=(J[62592]=[null,null,H.prototype.cc,H.prototype.Kc,"SISDR"],J[62608]=[null,null,H.prototype.ac,H.prototype.Ic,"SDSDR"],J[62624]=[null,null,H.prototype.bc,H.prototype.Jc,"SISAR"],J[62640]=[null,null,H.prototype.$b,H.prototype.Hc,"SDSAR"],J[62656]=[null,null,H.prototype.Lb,H.prototype.uc,"KISDR"],J[62672]=[null,null,H.prototype.Jb,H.prototype.sc,"KDSDR"],J[62688]=[null,null,H.prototype.Kb,H.prototype.tc,"KISAR"],J[62704]=[null,null,H.prototype.Ib,H.prototype.rc,"KDSAR"],J[62798]=[null,null, +H.prototype.Rb,H.prototype.yc,"MMR3"],J[65382]=[null,null,H.prototype.Mb,H.prototype.vc,"LKS"],J[65402]=[null,null,H.prototype.Ob,H.prototype.xc,"MMR0"],J[65404]=[null,null,H.prototype.Pb,H.prototype.vb,"MMR1"],J[65406]=[null,null,H.prototype.Qb,H.prototype.vb,"MMR2"],J[65408]=[null,null,H.prototype.ic,H.prototype.Qc,"UISDR"],J[65424]=[null,null,H.prototype.gc,H.prototype.Oc,"UDSDR"],J[65440]=[null,null,H.prototype.hc,H.prototype.Pc,"UISAR"],J[65456]=[null,null,H.prototype.fc,H.prototype.Nc,"UDSAR"], +J[65472]=[null,null,H.prototype.sa,H.prototype.va,"R0SET0"],J[65473]=[null,null,H.prototype.sa,H.prototype.va,"R1SET0"],J[65474]=[null,null,H.prototype.sa,H.prototype.va,"R2SET0"],J[65475]=[null,null,H.prototype.sa,H.prototype.va,"R3SET0"],J[65476]=[null,null,H.prototype.sa,H.prototype.va,"R4SET0"],J[65477]=[null,null,H.prototype.sa,H.prototype.va,"R5SET0"],J[65478]=[null,null,H.prototype.Ub,H.prototype.Bc,"R6KERNEL"],J[65479]=[null,null,H.prototype.Xb,H.prototype.Ec,"R7KERNEL"],J[65480]=[null,null, +H.prototype.ta,H.prototype.wa,"R0SET1"],J[65481]=[null,null,H.prototype.ta,H.prototype.wa,"R1SET1"],J[65482]=[null,null,H.prototype.ta,H.prototype.wa,"R2SET1"],J[65483]=[null,null,H.prototype.ta,H.prototype.wa,"R3SET1"],J[65484]=[null,null,H.prototype.ta,H.prototype.wa,"R4SET1"],J[65485]=[null,null,H.prototype.ta,H.prototype.wa,"R5SET1"],J[65486]=[null,null,H.prototype.Vb,H.prototype.Cc,"R6SUPER"],J[65487]=[null,null,H.prototype.Wb,H.prototype.Dc,"R6USER"],J[65504]=[null,null,H.prototype.Hb,H.prototype.qc, +"CTRL",1170],J[65520]=[null,null,H.prototype.nb,H.prototype.wb,"LSIZE",1170],J[65522]=[null,null,H.prototype.nb,H.prototype.wb,"HSIZE",1170],J[65524]=[null,null,H.prototype.ec,H.prototype.Mc,"SYSID",1170],J[65526]=[null,null,H.prototype.Gb,H.prototype.pc,"CPUERR",1170],J[65528]=[null,null,H.prototype.Nb,H.prototype.wc,"MB",1170],J[65530]=[null,null,H.prototype.Sb,H.prototype.zc,"PIR"],J[65532]=[null,null,H.prototype.dc,H.prototype.Lc,"SL"],J[65534]=[null,null,H.prototype.Tb,H.prototype.Ac,"PSW"], +J);I[62594]=I[62592];I[62596]=I[62592];I[62598]=I[62592];I[62600]=I[62592];I[62602]=I[62592];I[62604]=I[62592];I[62606]=I[62592];I[62610]=I[62608];I[62612]=I[62608];I[62614]=I[62608];I[62616]=I[62608];I[62618]=I[62608];I[62620]=I[62608];I[62622]=I[62608];I[62626]=I[62624];I[62628]=I[62624];I[62630]=I[62624];I[62632]=I[62624];I[62634]=I[62624];I[62636]=I[62624];I[62638]=I[62624];I[62642]=I[62640];I[62644]=I[62640];I[62646]=I[62640];I[62648]=I[62640];I[62650]=I[62640];I[62652]=I[62640];I[62654]=I[62640]; +I[62658]=I[62656];I[62660]=I[62656];I[62662]=I[62656];I[62664]=I[62656];I[62666]=I[62656];I[62668]=I[62656];I[62670]=I[62656];I[62674]=I[62672];I[62676]=I[62672];I[62678]=I[62672];I[62680]=I[62672];I[62682]=I[62672];I[62684]=I[62672];I[62686]=I[62672];I[62690]=I[62688];I[62692]=I[62688];I[62694]=I[62688];I[62696]=I[62688];I[62698]=I[62688];I[62700]=I[62688];I[62702]=I[62688];I[62706]=I[62704];I[62708]=I[62704];I[62710]=I[62704];I[62712]=I[62704];I[62714]=I[62704];I[62716]=I[62704];I[62718]=I[62704]; +I[65410]=I[65408];I[65412]=I[65408];I[65414]=I[65408];I[65416]=I[65408];I[65418]=I[65408];I[65420]=I[65408];I[65422]=I[65408];I[65426]=I[65424];I[65428]=I[65424];I[65430]=I[65424];I[65432]=I[65424];I[65434]=I[65424];I[65436]=I[65424];I[65438]=I[65424];I[65442]=I[65440];I[65444]=I[65440];I[65446]=I[65440];I[65448]=I[65440];I[65450]=I[65440];I[65452]=I[65440];I[65454]=I[65440];I[65458]=I[65456];I[65460]=I[65456];I[65462]=I[65456];I[65464]=I[65456];I[65466]=I[65456];I[65468]=I[65456];I[65470]=I[65456]; +I[65506]=I[65504];I[65508]=I[65504];I[65510]=I[65504];I[65512]=I[65504];I[65514]=I[65504];I[65516]=I[65504];I[65518]=I[65504];t(function(){for(var a=C(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,d>>2),tb(this,pb?ub:vb);else{this.a=Array(d>>2);for(a=0;a>2),b=0;b>8,c)},N:function(a){return this.a[a>>2]>>>((a&3)<<3)&255},X:function(a){a&1&&G(this.l);var b=a>>2;a=(a&3)<<3;var c=this.a[b]>>a;return 24>a?c&65535:c&255|(this.a[b+1]&255)<<8},da:function(a,b){var c=a>>2;a=(a&3)<<3;this.a[c]=this.a[c]&~(255<>2;a=(a&3)<<3;24>a?this.a[c]=this.a[c]&~(65535<>8);this.ha=!0},F:function(a,b){return this.H(a,b)}, +S:function(a,b){return this.V(a,b)},Z:function(a,b,c){this.w||this.ub(a,b,c)},fa:function(a,b,c){this.w||this.oa(a,b,c)},D:function(a){return this.c[a]},J:function(a){return this.c[a]},R:function(a){a&1&&G(this.l);return this.g.getUint16(a,!0)},W:function(a){a&1&&G(this.l);return this.o[a>>1]},Y:function(a,b){this.c[a]=b;this.ha=!0},$:function(a,b){this.c[a]=b;this.ha=!0},ea:function(a,b){a&1&&G(this.l);this.g.setUint16(a,b,!0);this.ha=!0},pa:function(a,b){a&1&&G(this.l);this.o[a>>1]=b;this.ha=!0}}; +function Ra(a,b,c){a.I=b;a.i=a.m=0;c&&((a.i=c.i)&&xb(a,yb,!1),(a.m=c.m)&&zb(a,yb,!1))}function zb(a,b,c){c&&a.m||(a.Pa=!a.w&&b[1]||a.v,a.Rc=!a.w&&b[3]||a.B);if(c||void 0===c)a.ub=b[1]||a.v,a.oa=b[3]||a.B}function xb(a,b,c){c&&a.i||(a.Xa=b[0]||a.s,a.jc=b[2]||a.A);if(c||void 0===c)a.H=b[0]||a.s,a.V=b[2]||a.A}function tb(a,b){b||(b=Ab);xb(a,b,void 0);zb(a,b,void 0)}var Ab=[],wb=[E.prototype.N,E.prototype.da,E.prototype.X,E.prototype.qa],yb=[E.prototype.F,E.prototype.Z,E.prototype.S,E.prototype.fa]; +if(Ja)var vb=[E.prototype.D,E.prototype.Y,E.prototype.R,E.prototype.ea],ub=[E.prototype.J,E.prototype.$,E.prototype.W,E.prototype.pa];function Bb(a,b){v.call(this,"CPU",a,Bb);var c=a.multiplier||1;this.Ia=a.cycles||b;this.Z=c;this.Ua=Math.round(this.Ia/1E4)/100;this.da=this.Ua*this.Z;this.h.T=!1;this.h.rb=!1;this.h.za=a.autoStart;this.h.bb=!1;this.h.Ka=!1;this.Ba=this.ea=0;this.Ha=a.csStart;this.oa=a.csInterval;this.pa=a.csStop;this.H=[];this.kb=this.nc.bind(this);D(this)}x(Bb);var Cb=["power","reset"]; +g=Bb.prototype;g.ja=function(a,b,c,d){this.A=a;this.l=b;this.I=d;for(b=0;b>=3;d=""+e}else d=k(c,d);else d="--------".substr(0,d||4);a.w[b].textContent!=d&&(a.w[b].textContent=d)}} +g.P=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.w[b]=c;a=!0;break;case "run":this.w[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.h.L)a=!0;else{var b=null,c,l=y(a.id);for(c=0;ca.W/a.da&&(b=1),a.Z=b,b=a.Ua*a.Z,a.da!=b)){a.da=b;b=a.da.toFixed(2)+"Mhz";var c=a.w.setSpeed;c&&(c.textContent=b);a.M("target speed: "+b)}Kb(a,a.S);a.S=0;a.R=ka();a.X=0;Lb(a)}function gb(a,b){var c=a.H.length;a.H.push([-1,b]);return c}function ib(a,b,c){0<=b&&ba.H[b][0]&&(c*=a.Ia*a.Z/1E3,a.H[b][0]=c)} +g.nc=function(){if(this.h.T){this.Wa>=this.Ia&&Lb(this,!0);this.xa=0;this.Ga=ka();if(this.X){var a=this.Ga-this.X;a>this.ib&&(this.R+=a,this.R>this.Ga&&(this.R=this.Ga))}try{do{for(var b,c=this.h.Ka?1:this.Ja,d=this.H.length-1;0<=d;d--){var e=this.H[d];0>e[0]||c>e[0]&&(c=e[0])}b=c;try{this.sb(b)}catch(p){if("number"!=typeof p)throw p;}for(var f=this.Y-this.a,a=f,h=this.H.length-1;0<=h;h--){var l=this.H[h];0>l[0]||(l[0]-=a,0>=l[0]&&(l[0]=-1,l[1]()))}this.xa+=f;this.S+=f;Kb(this,0,!0);a=f;if(this.h.Ka){var n= +!1;this.Ba=this.Ba+this.eb()|0;this.ea-=a;0>=this.ea&&(this.ea+=this.oa,n=!0);0<=this.pa&&this.pa<=Mb(this)&&(this.oa=this.pa=-1,Fb(this),K(this),n=!0);n&&this.M(Mb(this)+" cycles: checksum="+k(this.Ba))}this.qa-=f;if(0>=this.qa){this.qa+=this.Ja;15<=++this.jb&&(this.A&&this.A.ua(),this.jb=0);break}}while(this.h.T)}catch(p){K(this);Gb(this);this.A&&this.A.stop(ka(),Mb(this));b=p.stack||p.message;this.h.error=!0;this.K(b);return}if(this.h.T){b=setTimeout;c=this.kb;this.X=ka();d=this.ib;this.xa&&(d= +Math.round(d*this.xa/this.Ja));d-=this.X-this.Ga;if(e=this.X-this.R)this.W=Math.round(this.S/(10*e))/100,864E5<=e&&(this.$=0,Jb(this));if(0>d||this.Wd&&(this.R-=d),d=0;this.Wa+=this.xa;this.X+=d;b(c,d)}}};function Hb(a){var b;a.h.error?(a.M(a.toString()+" error"),b=!0):b=!1;if(!b)if(a.h.T)a.M(a.toString()+" busy");else{Jb(a);a.h.T=!0;a.h.rb=!0;if(b=a.w.run)b.textContent="Halt";a.A&&a.A.start(a.R,Mb(a));Gb(a,!0);setTimeout(a.kb,0)}}g.sb=function(){return 0}; +function K(a){if(a.h.T){a.Y-=a.a;a.a=0;Kb(a,a.S);a.S=0;a.h.T=!1;var b=a.w.run;b&&(b.textContent="Run");a.A&&a.A.stop(ka(),Mb(a));Gb(a)}a.h.complete=void 0}function Gb(a,b){a.A&&a.A.ua(b)} +function Nb(a){this.Db=+a.model||1170;this.Fb=a.resetAddr||0;Bb.call(this,a,6666667);this.fb=0;this.decode=Ob.bind(this);this.m=65536;this.g=32768;this.i=65535;this.o=32768;this.u=15;this.f=[0,0,0,0,0,0,0,this.Fb];this.ra=[0,0,0,0,0,0];this.U=[0,0,0,0];this.Ea=this.v=0;this.Cb=[4,2,0,1];this.C=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[65535,65535,65535,65535,65535,65535,65535,65535],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.O=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];this.oc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.qb=[0,0,0,0,0,0,0,0];this.c=this.b=this.Sa=this.D=this.F=this.j=this.pb=0;this.fa=-1;Pb(this);this.h.complete=this.h.yb=!1}x(Nb,Bb);g=Nb.prototype;g.reset=function(){this.h.T&&K(this);Pb(this);Eb(this);this.h.error=!1;this.parent.reset.call(this)}; +function Pb(a){a.na=255;a.G=0;a.$a=0;a.B=0;a.la=0;a.Za=0;a.ma=0;a.Na=0;a.Da=0;a.Va=262143;a.Fa=253952;a.s=[];a.j|=2;a.l&&jb(a)}function jb(a){a.Na?(a.V=65536,a.J=a.Bb,a.N=a.ob,a.lb=a.Tc,Ta(a.l,a.ma&16?22:18)):(a.V=0,a.J=a.Ab,a.N=a.kc,a.lb=a.Sc,Ta(a.l,16))}g.eb=function(){return 0};g.save=function(){var a=new L(this);a.set(0,[]);a.set(1,[this.$,this.Z]);a.set(2,cb(this.l));return a.data()}; +g.restore=function(a){var b=a[1];this.$=b[1];Jb(this,b[3]);a:{b=this.l;a=a[2];var c;for(c=0;cb){a.s[f].aa-=b;break}b-=a.s[f].aa}a.s.splice(f+1,0,{aa:b,mb:c<<5&224,tb:d,Qa:e})}a.j|=2}function lb(a){return a.u=a.u&63728|a.ia()|(a.i&65535?0:4)|(a.g&32768?2:0)|M(a)} +function mb(a,b){a.o=b<<12;a.i=~b&4;a.g=b<<14;a.m=b<<16;if((b^a.u)&2048)for(var c=a.ra.length;0<=--c;){var d=a.f[c];a.f[c]=a.ra[c];a.ra[c]=d}a.v=b>>14&3;c=a.u>>14&3;a.v!=c&&(a.U[c]=a.f[6],a.f[6]=a.U[a.v]);a.j|=2;a.u=b}function N(a,b){a.j&128||(a.o=a.i=b,a.g=0)}function O(a,b,c){a.j&128||(a.o=a.i=a.m=b,a.g=c||0)}function Rb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^b)&(d^b))}function P(a,b){a.j&128||(a.o=a.i=a.m=b,a.g=a.o^a.m>>1)}function Sb(a,b,c,d){a.j&128||(a.o=a.i=a.m=b,a.g=(c^d)&(d^b))} +function F(a,b){var c=!1;0>a.fa?a.fa=lb(a):a.v||(b=4,c=!0);a.B&57344||(a.la=63222,a.Za=b);a.v=0;var d=a.N(b|a.V),e=a.N(b+2&65535|a.V);mb(a,e&-12289|a.fa>>2&12288);c&&(a.G|=4,a.f[6]=4);Tb(a,a.fa);Tb(a,a.f[7]);a.f[7]=d&65535;a.j&=-113;a.fa=-1;throw b;}function Ub(a){var b=Vb(a),c=Vb(a)&-1793;a.u&49152&&(c=c&-225|a.u&63712);a.f[7]=b&65535;mb(a,c);a.j&=-17} +function Wb(a,b,c){var d,e,f,h=0;d=b>>13;a.ma&a.Cb[a.v]||(d&=7);e=a.C[a.v][d];f=(a.O[a.v][d]<<6)+(b&8191)&a.Va;if(ff){if(3932160<=f){f&=262143;var l=f>>13&31;31>l?a.ma&32&&(f=a.oc[l]+(f&8190)&4194302,3932160<=f&&4186112>f&&console.log("panic(898)")):f|=4186112}f>=a.Fa&&4186112>f&&(a.G|=32,F(a,4))}switch(e&7){case 1:h=4096;case 2:e|=128;c&4&&(h=8192);break;case 4:h=4096;case 5:c&4&&(h=4096);case 6:e|=c&4?192:128;break; +default:h=32768}32512!==(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(h|=16384):(b&8128)>(e>>2&8128)&&(h|=16384));a.C[a.v][d]=e;if(4194170!==f||a.v)a.Da=a.v,a.Ea=d;h&&(h&57344&&(0<=a.fa&&(h|=128),a.B&57344||(a.B=a.B|h|a.Da<<5|a.Ea<<1),F(a,168)),a.B&61440||!(4191360>f||4194239c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!==c&&(e|=h);e=a.N(e);e|=h;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!==c&&(e|=h);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!==c&&(e|=h);e=a.N(e)|h;a.a-=8;break; +case 6:return e=Qb(a),e=e+a.f[c]&65535|h,a.a-=6,e;case 7:return e=Qb(a),e=e+a.f[c]&65535,e=a.N(e|a.V)|h,a.a-=10,e}a.f[c]=a.f[c]+f&65535;!h||a.B&57344||(a.la=a.la<<8|f<<3&248|c);6==c&&!a.v&&d&4&&0>=f&&(a.f[6]<=a.na||65534<=a.f[6])&&(a.f[6]<=a.na-32?(a.G|=4,a.f[6]=4,F(a,4)):(a.G|=8,a.j|=64));return e}g.Ab=function(a,b,c){return Xb(this,a,b,c)};g.Bb=function(a,b,c){return Wb(this,Xb(this,a,b,c),c)};g.kc=function(a){return ab(this.l,a)};g.ob=function(a){return ab(this.l,Wb(this,a,2))}; +g.Sc=function(a,b){bb(this.l,a,b&65535)};g.Tc=function(a,b){bb(this.l,Wb(this,a,4),b)};function Yb(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Xb(a,b,d,2),c&65536||61440!==(a.u&61440)&&(d&=65535),a.v=a.u>>12&3,c=a.N(d|c&a.V),a.v=a.u>>14&3):c=6!=d||(a.u>>2&12288)===(a.u&12288)?a.f[d]:a.U[a.u>>12&3];return c} +function Zb(a,b,c,d){a.B&57344||(a.la=22);var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Xb(a,b,e,4),c&65536||(e&=65535),a.v=a.u>>12&3,e=Wb(a,e|c&65536,4),a.v=a.u>>14&3,bb(a.l,e,d)):6!=e||(a.u>>2&12288)===(a.u&12288)?a.f[e]=d:a.U[a.u>>12&3]=d}function $b(a,b){b>>=6;var c=a.F=b&7;(b=a.D=(b&56)>>3)?(c=a.J(b,c,3),a=$a(a.l,c)):a=a.f[c]&255;return a}function Q(a,b){b>>=6;var c=a.F=b&7;return(b=a.D=(b&56)>>3)?ab(a.l,a.J(b,c,2)):a.f[c]}function ac(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Xb(a,b,c,8)} +function bc(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.J(b,c,3),a=$a(a.l,c)):a=a.f[c]&255;return a}function R(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?ab(a.l,a.J(b,c,2)):a.f[c]}function S(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.Sa=a.J(b,e,7),c=d.call(a,c,$a(a.l,e)),e&1&&a.a--,a=a.l,a.b[(e&a.i)>>>a.c].Pa(e&a.g,c&255,e)):a.f[e]=a.f[e]&65280|d.call(a,c,a.f[e])}function T(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=a.J(b,e,6),bb(a.l,e,d.call(a,c,ab(a.l,e)))):a.f[e]=d.call(a,c,a.f[e])} +function cc(a,b,c,d){var e=a.b=b&7;(b=a.c=(b&56)>>3)?(d=a.J(b,e,5),d&1&&a.a--,a=a.l,a.b[(d&a.i)>>>a.c].Pa(d&a.g,c&255,d)):a.f[e]=c?d&1?c<<24>>24&65535:a.f[e]&-256|c&255:a.f[e]&-256;return c}function dc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?bb(a.l,a.J(b,d,4),c):a.f[d]=c&65535;return c}function U(a,b,c){c&&(a.f[7]=a.f[7]+(b<<24>>23)&65535,a.a-=2);a.a-=3} +g.sb=function(a){this.h.complete=!0;this.h.yb=!1;this.h.rb=!1;this.Y=this.a=a;do{if(this.j&&(this.j&112&&(this.j&32?F(this,168):this.j&64?F(this,4):this.j&16&&F(this,12),this.j&=-113),this.j&7))if(this.j&2){this.j&=-3;a=null;for(var b=this.$a&224,c=this.s.length;0<=--c;){if(0b&&(b=this.s[c].mb,a=this.s[c],this.s.splice(c,1))}b>(this.u&224)&&(this.j&4&&(this.f[7]= +this.f[7]+2&65535,this.j&=-5),a?F(this,a.tb):F(this,160))}else this.j&1&&this.j++;this.B&57344||(this.la=0,this.Za=this.f[7]);this.j=this.j&7|this.u&16;this.decode(Qb(this))}while(0>1|b<<16;P(this,a);return a&65535}function jc(a,b){a=b&2048|b>>1|b<<8;P(this,a<<8);return a&255}function kc(a,b){a=b&~a;N(this,a);return a}function lc(a,b){a=b&~a;N(this,a<<8);return a}function mc(a,b){a|=b;N(this,a);return a}function nc(a,b){a|=b;N(this,a<<8);return a}function oc(a,b){a=~b|65536;O(this,a);return a&65535} +function pc(a,b){a=~b|256;O(this,a<<8);return a&255}function qc(a,b){a=b-a;this.j&128||(this.o=this.i=a,this.g=b&(b^a));return a&65535}function rc(a,b){a=b-a;var c=a<<8;b<<=8;this.j&128||(this.o=this.i=c,this.g=b&(b^c));return a&255}function sc(a,b){a=b+a;this.j&128||(this.o=this.i=a,this.g=a&(b^a));return a&65535}function tc(a,b){a=b+a;var c=a<<8;this.j&128||(this.o=this.i=c,this.g=c&(b<<8^c));return a&255}function uc(a,b){a=-b;O(this,a,a&b&32768);return a&65535} +function vc(a,b){a=-b;O(this,a<<8,(a&b&128)<<8);return a&255}function wc(a,b){a=b<<1|this.m>>16&1;P(this,a);return a&65535}function xc(a,b){a=b<<1|this.m>>16&1;P(this,a<<8);return a&255}function yc(a,b){a=(this.m&65536|b)>>1|b<<16;P(this,a);return a&65535}function zc(a,b){a=((this.m&65536)>>8|b)>>1|b<<8;P(this,a<<8);return a&255}function Ac(a,b){var c=b-a;Sb(this,c,a,b);return c&65535}function Bc(a,b){var c=b-a;Sb(this,c<<8,a<<8,b<<8);return c&255} +function Cc(a,b){this.j&128||(this.o=this.i=b&65280,this.g=this.m=0);return(b<<8|b>>8)&65535}function Dc(a,b){a^=b;N(this,a);return a&65535}function Ec(a){var b=R(this,a);a=a>>6&7;var c=this.f[a];c&32768&&(c|=4294901760);this.m=this.g=0;b&=63;if(b&32)b=64-b,16>=b;else if(b)if(16>15&65535;d&&65535!==d&&(this.g=32768)}this.f[a]=c&65535;this.o=this.i=c;this.a-=(this.c?6:7)+b} +function Fc(a){var b=R(this,a);a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&=63;if(b&32){b=64-b;32>b-1;this.m=d<<16;d>>=1;c&2147483648&&(d|=4294967295<<32-b)}else b?(d=c<>15,d<<=1,32>=32-b)&&4294967295!==(c|4294967295<>16&65535;this.f[a|1]=d&65535;this.o=d>>16;this.i=d>>16|d;this.a-=(this.c?6:7)+b}function V(a){a&1&&(this.m=0);a&2&&(this.g=0);a&4&&(this.i=1);a&8&&(this.o=0);this.a-=5} +function Hc(a){var b=R(this,a);if(b){a=a>>6&7;var c=this.f[a]<<16|this.f[a|1];this.m=this.g=0;b&32768&&(b|=-65536);var d=~~(c/b);-32768<=d&&32767>=d?(this.f[a]=d&65535,this.f[a|1]=c-d*b&65535,this.i=d>>16|d,this.o=d>>16):(this.g=32768,this.i=d>>15|d,this.o=c>>16,-1===b&&65534===this.f[a]&&(this.f[a]=this.f[a|1]=1));this.a-=53}else this.i=this.o=0,this.g=32768,this.m=65536,this.a-=7}var Ic=[0,7,7,10,7,11,9,13];function Jc(a){var b=this.a;a=ac(this,a);this.f[7]=a&65535;this.a=b-Ic[this.c]} +var Kc=[0,14,14,17,14,18,16,20];function Lc(a){var b=this.a,c=ac(this,a);a=a>>6&7;Tb(this,this.f[a]);this.f[a]=this.f[7];this.f[7]=c&65535;this.a=b-Kc[this.c]}var Mc=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17],Nc=[7,13,13,17,14,18,17,21];function Oc(a){var b=R(this,a);a=a>>6&7;b&32768&&(b|=-65536);var c=this.f[a];c&32768&&(c|=-65536);b=~~(b*c);this.f[a]=b>>16&65535;this.f[a|1]=b&65535;this.j&128||(this.o=b>>16,this.i=this.o|b,this.g=0,this.m=-32768>b||32767>6;if(this.f[b]=this.f[b]-1&65535)this.f[7]=this.f[7]-((a&63)<<1)&65535,this.a+=1;this.a-=6}function Rc(a){T(this,a,0,Cc);this.a-=this.c?9:3+(7==this.b?2:0)}function Sc(a){T(this,a,Q(this,a),Dc);this.a-=this.c?9:3+(7==this.b?2:0)}function X(){F(this,8)}function Ob(a){Tc[a>>12].call(this,a)} +var Tc=[function(a){Uc[a>>8&15].call(this,a)},function(a){var b=Q(this,a),c=this.a;N(this,dc(this,a,b));this.a=c-Mc[(this.D?8:0)+this.c]+(7!=this.b||this.c?0:2)},function(a){var b=Q(this,a);a=R(this,a);Sb(this,b-a,a,b);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){N(this,Q(this,a)&R(this,a));this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),kc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b? +2:0)},function(a){T(this,a,Q(this,a),mc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),ec);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){Vc[a>>8&15].call(this,a)},function(a){Wc[a>>8&15].call(this,a)},function(a){var b=$b(this,a);N(this,cc(this,a,b,1)<<8);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){var b=$b(this,a)<<8;a=bc(this,a)<<8;Sb(this,b-a,a,b);this.a-=this.c?4+ +(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){N(this,($b(this,a)&bc(this,a))<<8);this.a-=this.c?4+(this.F&&6<=this.b?1:0):(this.D?4:3)+(7==this.b?2:0)},function(a){S(this,a,$b(this,a),lc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){S(this,a,$b(this,a),nc);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},function(a){T(this,a,Q(this,a),Ac);this.a-=this.c?9+(this.F&&6<=this.b?1:0):(this.D?5:3)+(7==this.b?2:0)},X],Uc=[function(a){Xc[a>> +4&15].call(this,a)},function(a){U(this,a,!0)},function(a){U(this,a,!!(this.i&65535))},function(a){U(this,a,this.i&65535?0:4)},function(a){U(this,a,!this.ia()==!(this.g&32768))},function(a){U(this,a,!this.ia()!=!(this.g&32768))},function(a){U(this,a,!!(this.i&65535)&&!this.ia()==!(this.g&32768))},function(a){U(this,a,(this.i&65535?0:4)||!this.ia()!=!(this.g&32768))},Lc,Lc,function(a){Yc[a>>6&3].call(this,a)},function(a){Zc[a>>6&3].call(this,a)},function(a){$c[a>>6&3].call(this,a)},function(a){ad[a>> +6&3].call(this,a)},X,X],Yc=[function(a){O(this,dc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,oc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,sc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,1,qc);this.a-=this.c?9:3+(7==this.b?2:0)}],Zc=[function(a){T(this,a,0,uc);this.a-=this.c?11:6},function(a){T(this,a,M(this)?1:0,ec);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,M(this)?1:0,Ac);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=R(this, +a);O(this,a);this.a-=this.c?4:3+(7==this.b?2:0)}],$c=[function(a){T(this,a,0,yc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,wc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,ic);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){T(this,a,0,gc);this.a-=this.c?9:3+(7==this.b?2:0)}],ad=[function(a){a=this.f[7]+((a&63)<<1)&65535;var b=this.ob(a|65536);this.f[7]=this.f[5]&65535;this.f[6]=a+2&65535;this.f[5]=b;this.a-=8},function(a){a=Yb(this,a,0);Tb(this,a);N(this,a);this.a-= +11},function(a){var b=Vb(this),c=this.a;Zb(this,a,0,b);N(this,b);this.a=c-Nc[this.c]},function(a){N(this,dc(this,a,this.ia?65535:0));this.a-=this.c?9:3+(7==this.b?2:0)}],Xc=[function(a){bd[a&15].call(this,a)},X,X,X,Jc,Jc,Jc,Jc,function(a){if(a&8)F(this,8);else{var b=Vb(this);a&=7;this.f[7]=this.f[a]&65535;this.f[a]=b;this.a-=9}},function(a){a&8?(this.u&49152||(this.u=this.u&-2017|(a&7)<<5,this.j|=1),this.a-=5):F(this,8)},function(a){cd[a&15].call(this,a)},function(a){dd[a&15].call(this,a)},Rc,Rc, +Rc,Rc],bd=[function(){this.u&49152?(this.G|=128,F(this,4)):K(this);this.a-=7},function(){this.j|=4;this.f[7]=this.f[7]+-2&65535;this.a-=3},function(){Ub(this);this.j|=this.u&16;this.a-=13},function(){F(this,12);this.a-=5},function(){F(this,16);this.a-=25},function(){this.u&49152||(Pb(this),this.l.reset());this.a-=667},function(){Ub(this);this.a-=13},X,X,X,X,X,X,X,X,X],cd=[Pc,function(){this.m=0;this.a-=5},function(){this.g=0;this.a-=5},V,function(){this.i=1;this.a-=5},V,V,V,function(){this.o=0;this.a-= +5},V,V,V,V,V,V,V],dd=[Pc,function(){this.m=65536;this.a-=5},function(){this.g=32768;this.a-=5},W,function(){this.i=0;this.a-=5},W,W,W,function(){this.o=32768;this.a-=5},W,W,W,W,W,W,W],Vc=[Oc,Oc,Hc,Hc,Ec,Ec,Fc,Fc,Sc,Sc,X,X,X,X,Qc,Qc],Wc=[function(a){U(this,a,!this.ia())},function(a){U(this,a,this.ia())},function(a){U(this,a,!M(this)&&!!(this.i&65535))},function(a){U(this,a,M(this)||(this.i&65535?0:4))},function(a){U(this,a,!(this.g&32768))},function(a){U(this,a,this.g&32768?2:0)},function(a){U(this, +a,!M(this))},function(a){U(this,a,M(this))},function(){F(this,24);this.a-=25},function(){F(this,28);this.a-=5},function(a){ed[a>>6&3].call(this,a)},function(a){fd[a>>6&3].call(this,a)},function(a){gd[a>>6&3].call(this,a)},function(a){hd[a>>6&3].call(this,a)},X,X],ed=[function(a){O(this,cc(this,a,0));this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,pc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,tc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,1,rc);this.a-=this.c? +9:3+(7==this.b?2:0)}],fd=[function(a){S(this,a,0,vc);this.a-=this.c?11:6},function(a){S(this,a,M(this)?1:0,fc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,M(this)?1:0,Bc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){a=bc(this,a);O(this,a<<8);this.a-=this.c?4:3+(7==this.b?2:0)}],gd=[function(a){S(this,a,0,zc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b?2:0)},function(a){S(this,a,0,xc);this.a-=this.c?9:3+(7==this.b?2:0)},function(a){S(this,a,0,jc);this.a-=this.c?9+(this.Sa&1):3+(7==this.b? +2:0)},function(a){S(this,a,0,hc);this.a-=this.c?9:3+(7==this.b?2:0)}],hd=[X,function(a){a=Yb(this,a,65536);Tb(this,a);N(this,a);this.a-=11},function(a){var b=Vb(this),c=this.a;Zb(this,a,65536,b);N(this,b);this.a=c-Nc[this.c]},X]; +function id(a){v.call(this,"ROM",a,id);this.b=null;this.o=a.addr;this.c=a.size;this.s=a.writable;this.g=a.alias;this.i=a.file;this.A=ba(this.i);if(this.i){a=this.i;var b=ca(this.A);"json"!=b&&"hex"!=b&&(a=ea()+"/api/v1/dump?file="+this.i+"&format=bytes&decimal=true");var c=this;m(a,null,!0,function(a,b,f){jd(c,a,b,f)})}}x(id);id.prototype.ja=function(a,b,c,d){this.l=b;this.a=c;this.I=d;kd(this)};id.prototype.ca=function(){this.m&&(this.I&&this.I.a(this.id,this.o,this.c,this.m),delete this.m);return!0}; +id.prototype.ba=function(){return!0}; +function jd(a,b,c,d){if(d)a.K("Unable to load system ROM (error "+d+": "+b+")");else{Ga(a.Ta,b,c);var e;if("["==c.charAt(0)||"{"==c.charAt(0))try{var f,h,l=eval("("+c+")");if(f=l.bytes)a.b=f;else if(f=l.words)for(a.b=Array(2*f.length),h=e=0;e>8&255;else if(f=l.data)for(a.b=Array(4*f.length),h=e=0;e>8&255,a.b[h++]=f[e]>>16&255,a.b[h++]=f[e]>>24&255;else a.b=l;a.m=l.symbols;if(!a.b.length){q("Empty ROM: "+b); +return}if(1==a.b.length){q(a.b[0]);return}}catch(n){a.K("ROM data error: "+n.message);return}else for(b=c.replace(/\n/gm," ").replace(/ +$/,"").split(" "),a.b=Array(b.length),e=0;e>>d.c].ub(e&d.g,f&255,e);d.o--}b=!0}else b=!1;if(b){b=[];"number"==typeof a.g?b.push(a.g):null!=a.g&&a.g.length&&(b=a.g);for(c=0;c=b)a.preventDefault&&a.preventDefault(),64");if(2==b.length){var c=ia(b[0]);if(c!=this.Ca)return;b=ia(b[1]);if(this.s=Ha(b)){var d=this.s.exports;if(d){var e=d.connect;e&&e.call(this.s);if(this.v=d.receiveData){this.status(this.Ta+"."+c+" connected to "+b);return}}}}this.status("Unable to establish connection: "+a)}}};g.ca=function(a,b){if(!b)if(this.gb(),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0}; +g.ba=function(a){return a?this.save():!0};g.reset=function(){od(this)};g.save=function(){var a=new L(this);a.set(0,[]);return a.data()};g.restore=function(){return od(this)};function od(a){a.F=0;a.b=0;a.c=128;a.i=[];return!0}g.Ya=function(a){if("number"==typeof a)this.i.push(a);else if("string"==typeof a)for(var b=0;b":String.fromCharCode(a);var c=b.length;32>a&&1==c&&(c=0);9==a&&(a=this.H||8,c=a-this.o%a,this.H&&(b=" ".slice(0,c)));this.B&&!this.o&&c&&(b=String.fromCharCode(this.B)+b);this.g.value+=b;this.g.scrollTop=this.g.scrollHeight;this.o+=c}else if(null!=this.m){if(10==a||1024<=this.m.length)this.M(this.m), +this.m="";10!=a&&(this.m+=String.fromCharCode(a))}this.c&=-129;hb(this.a,100,4,52,this.D)}};var pd={},nd=(pd[65392]=[null,null,Z.prototype.Zb,Z.prototype.Gc,"RCSR"],pd[65394]=[null,null,Z.prototype.Yb,Z.prototype.Fc,"RBUF"],pd[65396]=[null,null,Z.prototype.mc,Z.prototype.Vc,"XCSR"],pd[65398]=[null,null,Z.prototype.lc,Z.prototype.Uc,"XBUF"],pd);t(function(){for(var a=C(document,"pdp11","serial"),b=0;b\nLicense: GPL version 3 or later ");this.M("Portions adapted from the PDP-11/70 Emulator v1.3 by Paul Nankervis ");for(b=0;bsd){if(ud(d,this.A)){this.m=new L(this,"1.30.1","failsafe");ud(this.m)&&(zd(this,d),a=2,Ad(this.m));this.m.set("timestamp",la());Bd(this.m);var e=this.b&&!this.o;if(1==a||ma("Click OK to restore the previous PDPjs machine state, or CANCEL to reset the machine.")){if(c=yd(d)){var f=d.get("code"),h=d.get("data");f&&("ok"==f?ud(d,h):("error"== +f&&"no machine state"!=h?(this.K("Error: "+h),"unable to verify user"==h&&(qa("user",""),this.c=null)):this.M(f+": "+h),Ad(d),ud(d)?(c=yd(d),e=!0):c=!1))}e&&xd(this,c?d:null)}else 2==a&&d.clear()}else xd(this);delete this.A;delete this.v}e=y(this.id);for(f=0;fa[1];a=a[2];this.S=!0;this.h.L=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.a&&(Cd(this,this.a,b,c,a),this.a.za());this.F&&(zd(this,b),b.clear());!c&&this.m&&(this.m.clear(),delete this.m);this.g=0}; +function zd(a,b){if(ma("There may be a problem with your PDPjs machine.\n\nTo help us diagnose it, click OK to send this PDPjs machine state to http://www.pcjs.org.")){var c=a.c||"";b=b.toString();var d={app:"PDPjs",ver:"1.30.1"};d.url=a.R;d.user=c;d.type="bug";d.data=b;m("http://www.pcjs.org/api/v1/report",d,!0)}} +function Dd(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new L(a,"1.30.1"),h=new L(a,"1.30.1","validate"),l=la();h.set("timestamp",l);f.set("timestamp",l);f.set("version","1.30.1");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.a&&a.a.ba&&(c&&K(a.a),d=a.a.ba(b,c),"object"===typeof d&&f.set(a.a.id,d),c&&(a.a.h.L=!1,!1===d&&(e=null)));for(var l=y(a.id),n=0;nf.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), -a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(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+"...");l(e,null,!0,function(f,k,m){if(m||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+m+")");else{if(f=d[3])if(m=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=m[0],q,t=/( [a-z]+=)(['"])(.*?)\2/g;q=t.exec(f);)n=0>n.indexOf(q[1])?n.replace(">",q[0]+">"):n.replace(new RegExp(q[1]+"(['\"])(.*?)\\1"),q[0]);m[0]!=n&&(k=k.replace(m[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, -"");a=a.replace(d[0],k);Fd(a,b,c)}})}else c(a,null)} -function Gd(a,b,c,d){function e(a){if(void 0===m){var b=k&&C(k,"machine-warning");m=b&&b[0]||k}m&&(m.innerHTML=ga(a))}function f(a){e("Error: "+a);n&&(--Cd||wa(!0));n=!1}var k,m,n=!0;Cd++;Fa[a]={};try{if(k=document.getElementById(a)){var q;if("object"==typeof resources&&(q=resources.css)){var t=document.head||document.getElementsByTagName("head")[0],J=document.createElement("style");J.type="text/css";J.styleSheet?J.styleSheet.cssText=q:J.appendChild(document.createTextNode(q));t.appendChild(J)}c|| -(c="/versions/pdp11/1.30.1/components.xsl");q=function(d,m){m?Dd(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=m.transformNode(n))?(k.outerHTML=n,--Cd||wa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(m,document))?k.parentNode?(k.parentNode.replaceChild(n,k),--Cd||wa(!0)):f("invalid machine element: "+ -a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Dd(b,a,d,!0,e,q):Ed(b,null,a,d,!1,e,q)}else f("missing machine element: "+a)}catch(Ba){f(Ba.message)}return n}window.embedPDP11=function(a,b,c,d){wa(!1);return Gd(a,b,c,d)};window.enableEvents=wa;window.sendEvent=xa;})(); +g.P=function(a,b,c){var d=this;switch(b){case "power":return this.w[b]=c,c.onclick=function(){d.g||(d.h.L?Dd(d,!1,!0):wd(d,d.Aa))},!0;case "reset":return this.w[b]=c,c.onclick=function(){if(d.h.L&&!d.g)if(d.b&&!d.s){var a=ma("Click OK to save changes to this PDPjs machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");Dd(d,a,!0);!a&&d.D?window&&window.location.reload():d.Aa(sd)}else d.reset(),d.a&&d.a.za()},!0;case "save":if(da())c.parentNode.removeChild(c);else return this.w[b]= +c,c.onclick=function(){var a=td(d,!0);if(a){var b=!!(d.b&&!d.s||d.D),c=Dd(d,b);b?Ed(d,a,c):d.K("Resume disabled, machine state not saved")}},!0}return!1}; +function td(a,b){var c=a.c;c||((c=pa("user"),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=Fd(a,c))||a.K("The user ID is invalid.")):b&&a.K("Browser local storage is not available"));return c} +function Fd(a,b){a.c=null;b=m(ea()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(qa("user",b.data),a.c=b.data)}catch(d){q(d.message+" ("+c+")")}return a.c}function vd(a){var b=null;a.c&&(b=ea()+"/api/v1/user?req=load&user="+a.c+"&state="+Gd(a,"1.30.1"));return b} +function Ed(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=Gd(a,"1.30.1");d.data=c;b=m(ea()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0f.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(f=window.location.pathname+f),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(f?' url="'+f+'"':"")));e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1PDPjs$2"), +a=a.replace(/().*?(<\/xsl:variable>)/,"$1pdp11$2"));f=null;if("<"==a.charAt(0))try{e||(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(u){f=null,a=u.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");m(e,null,!0,function(f,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(f=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var n=l[0],p,u=/( [a-z]+=)(['"])(.*?)\2/g;p=u.exec(f);)n=0>n.indexOf(p[1])?n.replace(">",p[0]+">"):n.replace(new RegExp(p[1]+"(['\"])(.*?)\\1"),p[0]);l[0]!=n&&(h=h.replace(l[0],n))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],h);Kd(a,b,c)}})}else c(a,null)} +function Ld(a,b,c,d){function e(a){if(void 0===l){var b=h&&C(h,"machine-warning");l=b&&b[0]||h}l&&(l.innerHTML=ha(a))}function f(a){e("Error: "+a);n&&(--Hd||xa(!0));n=!1}var h,l,n=!0;Hd++;Fa[a]={};try{if(h=document.getElementById(a)){var p;if("object"==typeof resources&&(p=resources.css)){var u=document.head||document.getElementsByTagName("head")[0],ga=document.createElement("style");ga.type="text/css";ga.styleSheet?ga.styleSheet.cssText=p:ga.appendChild(document.createTextNode(p));u.appendChild(ga)}c|| +(c="/versions/pdp11/1.30.1/components.xsl");p=function(d,l){l?Id(c,null,null,!1,e,function(d,n){n?(Ga(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window?(n=l.transformNode(n))?(h.outerHTML=n,--Hd||xa(!0)):f("transformNodeToObject failed"):document.implementation&&document.implementation.createDocument?(d=new XSLTProcessor,d.importStylesheet(n),(n=d.transformToFragment(l,document))?h.parentNode?(h.parentNode.replaceChild(n,h),--Hd||xa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser")):f(d)}):f(d)};"<"!=b.charAt(0)?Id(b,a,d,!0,e,p):Jd(b,null,a,d,!1,e,p)}else f("missing machine element: "+a)}catch(Gc){f(Gc.message)}return n}window.embedPDP11=function(a,b,c,d){xa(!1);return Ld(a,b,c,d)};window.enableEvents=xa;window.sendEvent=ya;})();