diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index 4f05e514c..b70022215 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -1356,7 +1356,7 @@ BusPDP11.prototype.addIOTable = function(component, table) for (var iReg = 0; iReg < nRegs; iReg++, addr += 2) { if (sReg && nRegs > 1) sReg = afn[4] + iReg; - if (!this.addIOHandlers(addr, addr, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, component.bitsMessage || MessagesPDP11.BUS, sReg || component.idComponent)) { + if (!this.addIOHandlers(addr, addr, fnReadByte, fnWriteByte, fnReadWord, fnWriteWord, afn[7] || component.bitsMessage || MessagesPDP11.BUS, sReg || component.idComponent)) { return false; } } diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 0e70fc06f..92ffd26c2 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -1577,7 +1577,7 @@ CPUStatePDP11.prototype.mapVirtualToPhysical = function(virtualAddress, accessFl /* falls through */ case PDP11.PDR.ACF.RW: // 0x6: read/write, no system trap/abort action - pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? 0xc0 : 0x80); + pdr |= ((accessFlags & PDP11.ACCESS.WRITE) ? (PDP11.PDR.ACCESSED | PDP11.PDR.MODIFIED) : PDP11.PDR.ACCESSED); break; default: // 0x0 (non-resident, abort all accesses) or 0x3 or 0x7 (unused, abort all accesses) diff --git a/modules/pdp11/lib/debugger.js b/modules/pdp11/lib/debugger.js index 077be096c..3bc0b216f 100644 --- a/modules/pdp11/lib/debugger.js +++ b/modules/pdp11/lib/debugger.js @@ -1270,9 +1270,10 @@ if (DEBUGGER) { if (this.sMessagePrev && sMessage == this.sMessagePrev) return; this.sMessagePrev = sMessage; - if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && this.cpu.isRunning() || this.isBusy(true)) { + var fRunning = false; + if ((this.bitsMessage & MessagesPDP11.HALT) && this.cpu && (fRunning = this.cpu.isRunning()) || this.isBusy(true)) { this.stopCPU(); - sMessage += " (cpu halted)"; + if (fRunning) sMessage += " (cpu halted)"; } this.println(sMessage); // + " (" + this.cpu.getCycles() + " cycles)" diff --git a/modules/pdp11/lib/defines.js b/modules/pdp11/lib/defines.js index 3a2b271b0..fac1d490e 100644 --- a/modules/pdp11/lib/defines.js +++ b/modules/pdp11/lib/defines.js @@ -330,21 +330,21 @@ var PDP11 = { MMR0: { // 177572 ENABLED: 0x0001, // 000001 address relocation enabled PAGE_NUM: 0x000E, // 000016 page number of last fault - PAGE_D: 0x0010, // 000020 last fault occurred in D space + PAGE_D: 0x0010, // 000020 last fault occurred in D space (11/44 and 11/70 only) PAGE: 0x001E, // 000176 (all of the PAGE bits) MODE: 0x0060, // 000140 processor mode as of last fault - COMPLETED: 0x0080, // 000200 last instruction completed (R/O) + COMPLETED: 0x0080, // 000200 last instruction completed (R/O) (11/70 only) DSTMODE: 0x0100, // 000400 only destination mode references will be relocated (aka MAINT bit) - MMU_TRAPS: 0x0200, // 001000 enable MMU traps + MMU_TRAPS: 0x0200, // 001000 enable MMU traps (11/70 only) UNUSED: 0x0C00, // 006000 - TRAP_MMU: 0x1000, // 010000 trap: MMU + TRAP_MMU: 0x1000, // 010000 trap: MMU (11/70 only) ABORT_RO: 0x2000, // 020000 abort: read-only ABORT_PL: 0x4000, // 040000 abort: page length ABORT_NR: 0x8000, // 100000 abort: non-resident ABORT: 0xE000, // 160000 (all of the ABORT bits) - UPDATE: 0xF0FE // Includes all of: ABORT, TRAP, COMPLETED, MODE, and PAGE bits + UPDATE: 0xE0FE // Includes all of: ABORT, COMPLETED, MODE, and PAGE bits }, - MMR1: { // 177574: general purpose auto-inc/auto-dec register + MMR1: { // 177574: general purpose auto-inc/auto-dec register (11/44 and 11/70 only) REG1_NUM: 0x0007, // REG1_DELTA: 0x00F8, // REG2_NUM: 0x0700, // @@ -352,7 +352,7 @@ var PDP11 = { }, MMR2: { // 177576: virtual program counter register }, - MMR3: { // 172516: mapping register + MMR3: { // 172516: mapping register (11/44 and 11/70 only) USER_D: 0x0001, SUPER_D: 0x0002, KERNEL_D: 0x0004, diff --git a/modules/pdp11/lib/device.js b/modules/pdp11/lib/device.js index c1c808337..334e36c90 100644 --- a/modules/pdp11/lib/device.js +++ b/modules/pdp11/lib/device.js @@ -1130,23 +1130,23 @@ DevicePDP11.prototype.writeIgnored = function(data, addr) */ DevicePDP11.UNIBUS_IOTABLE = { [PDP11.UNIBUS.UNIMAP]: /* 170200 */ [null, null, DevicePDP11.prototype.readUNIMAP, DevicePDP11.prototype.writeUNIMAP, "UNIMAP", 64, PDP11.MODEL_1170], - [PDP11.UNIBUS.SIPDR0]: /* 172200 */ [null, null, DevicePDP11.prototype.readSIPDR, DevicePDP11.prototype.writeSIPDR, "SIPDR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.SDPDR0]: /* 172220 */ [null, null, DevicePDP11.prototype.readSDPDR, DevicePDP11.prototype.writeSDPDR, "SDPDR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.SIPAR0]: /* 172240 */ [null, null, DevicePDP11.prototype.readSIPAR, DevicePDP11.prototype.writeSIPAR, "SIPAR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.SDPAR0]: /* 172260 */ [null, null, DevicePDP11.prototype.readSDPAR, DevicePDP11.prototype.writeSDPAR, "SDPAR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.KIPDR0]: /* 172300 */ [null, null, DevicePDP11.prototype.readKIPDR, DevicePDP11.prototype.writeKIPDR, "KIPDR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.KDPDR0]: /* 172320 */ [null, null, DevicePDP11.prototype.readKDPDR, DevicePDP11.prototype.writeKDPDR, "KDPDR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.KIPAR0]: /* 172340 */ [null, null, DevicePDP11.prototype.readKIPAR, DevicePDP11.prototype.writeKIPAR, "KIPAR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.KDPAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDPAR, DevicePDP11.prototype.writeKDPAR, "KDPAR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3", 1, PDP11.MODEL_1145], + [PDP11.UNIBUS.SIPDR0]: /* 172200 */ [null, null, DevicePDP11.prototype.readSIPDR, DevicePDP11.prototype.writeSIPDR, "SIPDR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.SDPDR0]: /* 172220 */ [null, null, DevicePDP11.prototype.readSDPDR, DevicePDP11.prototype.writeSDPDR, "SDPDR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.SIPAR0]: /* 172240 */ [null, null, DevicePDP11.prototype.readSIPAR, DevicePDP11.prototype.writeSIPAR, "SIPAR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.SDPAR0]: /* 172260 */ [null, null, DevicePDP11.prototype.readSDPAR, DevicePDP11.prototype.writeSDPAR, "SDPAR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.KIPDR0]: /* 172300 */ [null, null, DevicePDP11.prototype.readKIPDR, DevicePDP11.prototype.writeKIPDR, "KIPDR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.KDPDR0]: /* 172320 */ [null, null, DevicePDP11.prototype.readKDPDR, DevicePDP11.prototype.writeKDPDR, "KDPDR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.KIPAR0]: /* 172340 */ [null, null, DevicePDP11.prototype.readKIPAR, DevicePDP11.prototype.writeKIPAR, "KIPAR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.KDPAR0]: /* 172360 */ [null, null, DevicePDP11.prototype.readKDPAR, DevicePDP11.prototype.writeKDPAR, "KDPAR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.MMR3]: /* 172516 */ [null, null, DevicePDP11.prototype.readMMR3, DevicePDP11.prototype.writeMMR3, "MMR3", 1, PDP11.MODEL_1145, MessagesPDP11.MMU], [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", 1, PDP11.MODEL_1145], - [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1", 1, PDP11.MODEL_1145], - [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2", 1, PDP11.MODEL_1145], - [PDP11.UNIBUS.UIPDR0]: /* 177600 */ [null, null, DevicePDP11.prototype.readUIPDR, DevicePDP11.prototype.writeUIPDR, "UIPDR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.UDPDR0]: /* 177620 */ [null, null, DevicePDP11.prototype.readUDPDR, DevicePDP11.prototype.writeUDPDR, "UDPDR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.UIPAR0]: /* 177640 */ [null, null, DevicePDP11.prototype.readUIPAR, DevicePDP11.prototype.writeUIPAR, "UIPAR", 8, PDP11.MODEL_1145], - [PDP11.UNIBUS.UDPAR0]: /* 177660 */ [null, null, DevicePDP11.prototype.readUDPAR, DevicePDP11.prototype.writeUDPAR, "UDPAR", 8, PDP11.MODEL_1145], + [PDP11.UNIBUS.MMR0]: /* 177572 */ [null, null, DevicePDP11.prototype.readMMR0, DevicePDP11.prototype.writeMMR0, "MMR0", 1, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.MMR1]: /* 177574 */ [null, null, DevicePDP11.prototype.readMMR1, DevicePDP11.prototype.writeIgnored, "MMR1", 1, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.MMR2]: /* 177576 */ [null, null, DevicePDP11.prototype.readMMR2, DevicePDP11.prototype.writeIgnored, "MMR2", 1, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.UIPDR0]: /* 177600 */ [null, null, DevicePDP11.prototype.readUIPDR, DevicePDP11.prototype.writeUIPDR, "UIPDR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.UDPDR0]: /* 177620 */ [null, null, DevicePDP11.prototype.readUDPDR, DevicePDP11.prototype.writeUDPDR, "UDPDR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.UIPAR0]: /* 177640 */ [null, null, DevicePDP11.prototype.readUIPAR, DevicePDP11.prototype.writeUIPAR, "UIPAR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], + [PDP11.UNIBUS.UDPAR0]: /* 177660 */ [null, null, DevicePDP11.prototype.readUDPAR, DevicePDP11.prototype.writeUDPAR, "UDPAR", 8, PDP11.MODEL_1145, MessagesPDP11.MMU], [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"], diff --git a/versions/pdpjs/1.30.3/pdp11-dbg.js b/versions/pdpjs/1.30.3/pdp11-dbg.js index d812dd99c..a6a887507 100644 --- a/versions/pdpjs/1.30.3/pdp11-dbg.js +++ b/versions/pdpjs/1.30.3/pdp11-dbg.js @@ -78,7 +78,7 @@ function yc(a,b,c){var d=[];for(b>>>=a.ka;0>>this.ka].sa(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Ec(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ka;this.f=!1;this.na++;a=this.Y[c].mc(b,a);this.na--;return a};k.Eb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.f=!1;this.na++;this.Y[(a&this.Qa)>>>this.ka].dc(a&this.v,b&255,a);this.na--}; k.ib=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].Ub(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Ec(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ka;this.f=!1;this.na++;this.Y[d].pc(c,b&65535,a);this.na--}; function Fc(a){for(var b=0,c=[],d=0;da.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;ra.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;rb.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+J(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Nb=128;Kc(this.b,this.f.oc,1E3/60,!0)};k.vd=function(){return this.f.Nb};k.pe=function(a){this.f.Nb=a&192};k.xd=function(){return Wc(this.b)};k.re=function(a){Xc(this.b,a&-129|this.b.Da&128)};k.yd=function(){return Yc(this.b)}; @@ -89,13 +89,13 @@ k.Re=function(a,b){b=b>>1&7;this.b.ha[3][b]=a;this.b.P[3][b]&=65295};k.Xd=functi k.Ae=function(a){this.b.u[7]=a};k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]}; k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Cc){case Cc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ua};k.ie=function(){this.b.ua=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a,b){return b?0:this.b.Rb};k.te=function(a){ad(this.b,a)};k.Vd=function(a,b){return b?0:this.b.sb&65280};k.Ne=function(a){this.b.sb=a|255}; k.Ed=function(){return bd(this.b)};k.we=function(a){cd(this.b,a&-1793|bd(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)}; -var M={},Uc=(M[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.td, -K.prototype.ne,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],M[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],M[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],M[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Yd, -K.prototype.Qe,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],M[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],M[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],M[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],M[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],M[65477]=[null,null,K.prototype.Cb,K.prototype.Gb, -"R5SET0"],M[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],M[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Db, -K.prototype.Hb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],M[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],M[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],M[65528]= -[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],M[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],M[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],M[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],M);$a(function(){for(var a=D(document,"pdp11","device"),b=0;b>1),this.b=new Int32Array(this.B,0,this.size>>2),kd(this,gd?ld:md);else{a=this.b=Array(this.size>> 2);for(f=0;f>2),b=0;b>1)}function qe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^d)&(d^b))}k.wa=function(a,b,c){if(!this.M){0>this.Aa?this.Aa=bd(this):this.B||(a=4,this.ua|=4,this.u[6]=4,c=-3);this.pa=a;this.B=0;var d=this.sa(a|this.S),e=this.sa(a+2&65535|this.S);cd(this,e&-12289|this.Aa>>2&12288);re(this,this.Aa);re(this,this.u[7]);Q(this,d);this.J&=~(b|18);this.J|=9;this.Aa=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}}; function se(a){var b=te(a),c=te(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);Q(a,b);cd(a,c);a.J&=-17}function Ec(a,b){var c=b>>13&31;31>c&&(b=a.Ta&32?a.Sb[c]+(b&8190)&4194302:b&-3932161);return b} function ue(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.P[a.B][d];f=(a.ha[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.Da&57344|| -(g|=a.bb<<5|a.mb<<1,Xc(a,a.Da&-61695|g),a.wa(168,64,-1))),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function ve(a,b){return a.v.Yb(b)}function te(a){var b=a.sa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function re(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.pa=a.pa&65535|(a.pa&-65536)<<8|16121856;we(a,0,c);a.Ub(c,b)}function we(a,b,c){!a.B&&c<=a.sb&&(b||4(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function ve(a,b){return a.v.Yb(b)}function te(a){var b=a.sa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function re(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.pa=a.pa&65535|(a.pa&-65536)<<8|16121856;we(a,0,c);a.Ub(c,b)}function we(a,b,c){!a.B&&c<=a.sb&&(b||4c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.sa(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.sa(e)|g;a.b-=8;break;case 6:return e=a.sa(Qd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Qd(a,2)),e=e+ a.u[c]&65535,e=a.sa(e|a.S)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.pa=a.pa&65535|(a.pa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&we(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=ve(this,ue(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(ue(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=ue(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)}; k.Fb=function(a,b){this.L?(this.M++,this.Oc(ue(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return xe(this,a,b,c)};k.Yc=function(a,b,c){return ue(this,xe(this,a,b,c),c)};k.Hc=function(a){return this.v.ma(this.Mb=a)};k.be=function(a){return this.v.ma(this.Mb=ue(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Mb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Mb=ue(this,a,4),b)}; @@ -251,7 +251,7 @@ function ni(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=$h(a,b);"%"==b.c function gi(a,b){a.j=a;a.la=a.Tc=536870912;a.ja=null;a.za=[];b=Xh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Cb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;db||7a?"R"+a:6==a?"SP":"PC"} k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=bd(this.b);break;case 21:b=c.Rb;break;case 22:b=c.ua;break;case 23:b=c.sb;break;case 24:b=Wc(c);break;case 25:b=Yc(c);break;case 26:b=Zc(c);break;case 27:b=c.Ta;break;case 28:d&&(b=d.ta);break;case 29:d&&(b=d.rb);break;case 30:d&&mc(d)&&(b=d.Ya)}}return b}; -k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.pa&65535).F));if(this.la&1073741824)this.za.push(a);else if(!this.ja||a!=this.ja){this.ja=a;if(this.la&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.i(a);this.b&&(a=this.b,Ed(a),a.za=0,a.qa())}}; +k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.pa&65535).F));if(this.la&1073741824)this.za.push(a);else if(!this.ja||a!=this.ja){this.ja=a;b=!1;if(this.la&-2147483648&&this.b&&(b=this.b.A.W)||wb(this,!0))this.da(),b&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ed(a),a.za=0,a.qa())}}; function fi(a){var b;if(!He(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b>8;a.i("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.O?ui(a):vi(a)}}function ti(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ia?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0}; diff --git a/versions/pdpjs/1.30.3/pdp11.js b/versions/pdpjs/1.30.3/pdp11.js index aea886e10..09a54c6de 100644 --- a/versions/pdpjs/1.30.3/pdp11.js +++ b/versions/pdpjs/1.30.3/pdp11.js @@ -72,7 +72,7 @@ function Fb(a,b,c,d,e){for(var f=b,g=c,k=f>>>a.c;0>>=a.c;0>>=a.c;0>>a.c].Fb(b&a.l,b)}function Mb(a,b){3932160<=b&&(b=Lb(a.a,b));return a.h[(b&a.oa)>>>a.c].V(b&a.l,b)}h.mb=function(a){3932160<=a&&(a=Lb(this.a,a));var b=a&this.l,c=(a&this.oa)>>>this.c;this.m=!1;this.g++;a=this.h[c].Xb(b,a);this.g--;return a}; function Nb(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].Jb(b&a.l,c&255,b)}h.$a=function(a,b){3932160<=a&&(a=Lb(this.a,a));this.m=!1;this.g++;this.h[(a&this.oa)>>>this.c].Kb(a&this.l,b&255,a);this.g--};function Ob(a,b,c){3932160<=b&&(b=Lb(a.a,b));a.h[(b&a.oa)>>>a.c].sb(b&a.l,c&65535,b)}h.pb=function(a,b){3932160<=a&&(a=Lb(this.a,a));var c=a&this.l,d=(a&this.oa)>>>this.c;this.m=!1;this.g++;this.h[d].ec(c,b&65535,a);this.g--}; function Pb(a){for(var b=0,c=[],d=0;da.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;wa.a.Ea)){var g=f[0]?f[0].bind(b):null,k=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,n=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!k&&n&&(k=function(a){return function(b,c){return a(b,c)}.bind(b)}(n)));for(var p=f[4],u=f[5]||1,w=0;w>16&65535);a=a.Db;a&65280&&(a=(a<<8|a>>8)&65535);return a};h.Jc=function(){var a=this.a;a.Z&57344||(a.Eb=a.A&65535);return a.Eb};h.Kc=function(){return this.a.Ba}; h.Gd=function(a){var b=this.a;1170>b.Ea&&(a&=-49);b.Ba!=a&&(b.Ba=a,b.Ra=a&16?4194303:262143,Yb(b))};h.ld=function(a){a=a>>1&63;var b=this.a.ab[a>>1];return a&1?b>>16:b&65535};h.ge=function(a,b){b=b>>1&63;var c=b>>1;this.a.ab[c]=b&1?this.a.ab[c]&65535|(a&63)<<16:this.a.ab[c]&-65536|a&65534};h.dd=function(a){return this.a.H[1][a>>1&7]};h.$d=function(a,b){this.a.H[1][b>>1&7]=a&65295};h.bd=function(a){return this.a.H[1][(a>>1&7)+8]};h.Yd=function(a,b){this.a.H[1][(b>>1&7)+8]=a&65295}; @@ -82,13 +82,13 @@ h.gd=function(a){return this.a.X[3][(a>>1&7)+8]};h.ce=function(a,b){b=(b>>1&7)+8 h.Na=function(a){a&=7;return this.a.C&2048?this.a.f[a]:this.a.Fa[a]};h.Pa=function(a,b){b&=7;this.a.C&2048?this.a.f[b]=a:this.a.Fa[b]=a};h.Qc=function(){return 1==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[1]};h.Md=function(a){1==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[1]=a};h.Rc=function(){return 3==(this.a.C&49152)>>14?this.a.f[6]:this.a.pa[3]};h.Nd=function(a){3==(this.a.C&49152)>>14?this.a.f[6]=a:this.a.pa[3]=a};h.zc=function(a){return this.a.$b[a-65504>>1]}; h.xd=function(a,b){this.a.$b[b-65504>>1]=a};h.Wb=function(a){if(65520==a){a=0;switch(Ib){case Ib:a=this.h.ub}a=(a>>6)-1}else a=0;return a};h.dc=function(){};h.fd=function(){return 1};h.be=function(){};h.yc=function(){return this.a.fa};h.wd=function(){this.a.fa=0};h.Gc=function(){return this.a.Zb};h.Ed=function(a,b){b&1||(a&=255);this.a.Zb=a};h.Lc=function(a,b){return b?0:this.a.Gb};h.Hd=function(a){var b=this.a;if(a&=65024){var c=a>>9;do a+=34;while(c>>=1)}b.Gb=a;b.u|=2}; h.ed=function(a,b){return b?0:this.a.ob&65280};h.ae=function(a){this.a.ob=a|255};h.Oc=function(){return Zb(this.a)};h.Kd=function(a){$b(this.a,a&-1793|Zb(this.a)&1792);this.a.u|=128};h.cc=function(){}; -var M={},Wb=(M[61568]=[null,null,L.prototype.ld,L.prototype.ge,"UNIMAP",64,1170],M[62592]=[null,null,L.prototype.dd,L.prototype.$d,"SIPDR",8,1145],M[62608]=[null,null,L.prototype.bd,L.prototype.Yd,"SDPDR",8,1145],M[62624]=[null,null,L.prototype.cd,L.prototype.Zd,"SIPAR",8,1145],M[62640]=[null,null,L.prototype.ad,L.prototype.Xd,"SDPAR",8,1145],M[62656]=[null,null,L.prototype.Ec,L.prototype.Cd,"KIPDR",8,1145],M[62672]=[null,null,L.prototype.Cc,L.prototype.Ad,"KDPDR",8,1145],M[62688]=[null,null,L.prototype.Dc, -L.prototype.Bd,"KIPAR",8,1145],M[62704]=[null,null,L.prototype.Bc,L.prototype.zd,"KDPAR",8,1145],M[62798]=[null,null,L.prototype.Kc,L.prototype.Gd,"MMR3",1,1145],M[65382]=[null,null,L.prototype.Fc,L.prototype.Dd,"LKS"],M[65402]=[null,null,L.prototype.Hc,L.prototype.Fd,"MMR0",1,1145],M[65404]=[null,null,L.prototype.Ic,L.prototype.cc,"MMR1",1,1145],M[65406]=[null,null,L.prototype.Jc,L.prototype.cc,"MMR2",1,1145],M[65408]=[null,null,L.prototype.kd,L.prototype.fe,"UIPDR",8,1145],M[65424]=[null,null,L.prototype.hd, -L.prototype.de,"UDPDR",8,1145],M[65440]=[null,null,L.prototype.jd,L.prototype.ee,"UIPAR",8,1145],M[65456]=[null,null,L.prototype.gd,L.prototype.ce,"UDPAR",8,1145],M[65472]=[null,null,L.prototype.Ma,L.prototype.Oa,"R0SET0"],M[65473]=[null,null,L.prototype.Ma,L.prototype.Oa,"R1SET0"],M[65474]=[null,null,L.prototype.Ma,L.prototype.Oa,"R2SET0"],M[65475]=[null,null,L.prototype.Ma,L.prototype.Oa,"R3SET0"],M[65476]=[null,null,L.prototype.Ma,L.prototype.Oa,"R4SET0"],M[65477]=[null,null,L.prototype.Ma,L.prototype.Oa, -"R5SET0"],M[65478]=[null,null,L.prototype.Pc,L.prototype.Ld,"R6KERNEL"],M[65479]=[null,null,L.prototype.Sc,L.prototype.Od,"R7KERNEL"],M[65480]=[null,null,L.prototype.Na,L.prototype.Pa,"R0SET1",1,1145],M[65481]=[null,null,L.prototype.Na,L.prototype.Pa,"R1SET1",1,1145],M[65482]=[null,null,L.prototype.Na,L.prototype.Pa,"R2SET1",1,1145],M[65483]=[null,null,L.prototype.Na,L.prototype.Pa,"R3SET1",1,1145],M[65484]=[null,null,L.prototype.Na,L.prototype.Pa,"R4SET1",1,1145],M[65485]=[null,null,L.prototype.Na, -L.prototype.Pa,"R5SET1",1,1145],M[65486]=[null,null,L.prototype.Qc,L.prototype.Md,"R6SUPER",1,1145],M[65487]=[null,null,L.prototype.Rc,L.prototype.Nd,"R6USER",1,1145],M[65504]=[null,null,L.prototype.zc,L.prototype.xd,"CTRL",8,1170],M[65520]=[null,null,L.prototype.Wb,L.prototype.dc,"LSIZE",1,1170],M[65522]=[null,null,L.prototype.Wb,L.prototype.dc,"HSIZE",1,1170],M[65524]=[null,null,L.prototype.fd,L.prototype.be,"SYSID",1,1170],M[65526]=[null,null,L.prototype.yc,L.prototype.wd,"CPUERR",1,1170],M[65528]= -[null,null,L.prototype.Gc,L.prototype.Ed,"MB",1,1170],M[65530]=[null,null,L.prototype.Lc,L.prototype.Hd,"PIR"],M[65532]=[null,null,L.prototype.ed,L.prototype.ae,"SL"],M[65534]=[null,null,L.prototype.Oc,L.prototype.Kd,"PSW"],M);Ga(function(){for(var a=E(document,"pdp11","device"),b=0;b>1),this.a=new Int32Array(this.b,0,this.size>>2),hc(this,dc?ic:jc);else{a=this.a=Array(this.size>> 2);for(f=0;f>2),b=0;b>1)}function Nc(a,b,c,d){a.u&128||(a.s=a.i=a.m=b,a.g=(c^d)&(d^b))}function K(a,b,c,d){if(!a.ua){0>a.Ja?a.Ja=Zb(a):a.v||(b=4,a.fa|=4,a.f[6]=4,d=-3);a.A=b;a.v=0;var e=a.V(b|a.R),f=a.V(b+2&65535|a.R);$b(a,f&-12289|a.Ja>>2&12288);Oc(a,a.Ja);Oc(a,a.f[7]);Q(a,e);a.u&=~(c|18);a.u|=9;a.Ja=-1;if(-3<=d)throw b;}}function Pc(a){var b=Qc(a),c=Qc(a)&-1793;a.C&49152&&(c=c&-225|a.C&63712);Q(a,b);$b(a,c);a.u&=-17} function Lb(a,b){var c=b>>13&31;31>c&&(b=a.Ba&32?a.ab[c]+(b&8190)&4194302:b&-3932161);return b} function Rc(a,b,c){var d,e,f;if(!(c&a.aa))return f=b&65535,57344<=f&&(f|=a.Rb),f;d=b>>13;a.Ba&a.sd[a.v]||(d&=7);e=a.H[a.v][d];f=(a.X[a.v][d]<<6)+(b&8191)&a.Ra;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.H[a.v][d]=e;if(f!=(4194170&a.Ra)||a.v)a.bb=a.v,a.cb=d;g&&(g&57344&&(0<=a.Ja&&(g|=128),a.Z&57344|| -(g|=a.bb<<5|a.cb<<1,Xb(a,a.Z&-61695|g),K(a,168,64,-1))),a.Z&61440||!(f<(4191360&a.Ra)||f>(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4(4194239&a.Ra))||(a.Z|=4096,a.Z&512&&(a.u|=64)));return f}function Qc(a){var b=a.V(a.f[6]|a.R);a.f[6]=a.f[6]+2&65535;return b}function Oc(a,b){var c=a.f[6]-2&65535;a.f[6]=c;a.A=a.A&65535|(a.A&-65536)<<8|16121856;Sc(a,0,c);a.sb(c,b)}function Sc(a,b,c){!a.v&&c<=a.ob&&(b||4c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.V(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.V(e)|g;a.a-=8;break;case 6:return e=a.V(Hc(a,2)),e=e+a.f[c]&65535|g,a.a-=6,e;case 7:return e=a.V(Hc(a,2)),e=e+a.f[c]& 65535,e=a.V(e|a.R)|g,a.a-=10,e}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&Sc(a,b,a.f[6]);return e}h.mb=function(a){if(!this.aa)return this.h.mb(a);this.ua++;a=this.Yb(Rc(this,a,2));this.ua--;return a};h.$a=function(a,b){this.aa?(this.ua++,a=Rc(this,a,5),a&1&&this.a--,Nb(this.h,a,b),this.ua--):this.h.$a(a,b)};h.pb=function(a,b){this.aa?(this.ua++,this.fc(Rc(this,a,4),b),this.ua--):this.h.pb(a,b)};h.mc=function(a,b,c){return Tc(this,a,b,c)}; h.nc=function(a,b,c){return Rc(this,Tc(this,a,b,c),c)};h.Yb=function(a){return Mb(this.h,this.Xa=a)};h.md=function(a){return Mb(this.h,this.Xa=Rc(this,a,2))};h.fc=function(a,b){Ob(this.h,this.Xa=a,b&65535)};h.he=function(a,b){Ob(this.h,this.Xa=Rc(this,a,4),b)};function Uc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Tc(a,b,d,2),c&65536||61440!==(a.C&61440)&&(d&=65535),a.v=a.C>>12&3,c=a.V(d|c&a.R),a.v=a.C>>14&3):c=6!=d||(a.C>>2&12288)===(a.C&12288)?a.f[d]:a.pa[a.C>>12&3];return c}