From 2ce661e141869234029064e8d6bc536641ceeb7a Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Sat, 15 Oct 2016 13:34:02 -0700 Subject: [PATCH] Refer to all 11/45+ instructions as 11/45, rather than 11/70, since the 11/70 doesn't appear to have added any instructions to the 11/45's set --- modules/pdp11/lib/bus.js | 2 +- modules/pdp11/lib/cpuops.js | 80 +++++++++++++++--------------- modules/pdp11/lib/cpustate.js | 2 +- versions/pdpjs/1.30.1/pdp11-dbg.js | 12 ++--- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/modules/pdp11/lib/bus.js b/modules/pdp11/lib/bus.js index ee9b65755..f1435a2a9 100644 --- a/modules/pdp11/lib/bus.js +++ b/modules/pdp11/lib/bus.js @@ -107,7 +107,7 @@ function BusPDP11(parmsBus, cpu, dbg) /* * WARNING: Instead of dynamically calculating nBlockShift based on nBusWidth, as described above, we - * now force nBlockSize to IOPAGE_LENGTH, because that's what our IOController functions currently require. + * now force nBlockSize to IOPAGE_LENGTH, because that's what our IOController functions currently assume. * * this.nBlockShift = (this.nBusWidth >> 1) + 2; * if (this.nBlockShift < 10) this.nBlockShift = 10; diff --git a/modules/pdp11/lib/cpuops.js b/modules/pdp11/lib/cpuops.js index af581d571..c2c739862 100644 --- a/modules/pdp11/lib/cpuops.js +++ b/modules/pdp11/lib/cpuops.js @@ -37,7 +37,7 @@ if (NODE) { } /* - * Decoding starts at the bottom of this file, in op1120() and op1170(). + * Decoding starts at the bottom of this file, in op1120() and op1145(). * * The basic decoding approach is to dispatch on the top 4 bits of the opcode, and if further * decoding is required, the dispatched function will dispatch on the next 4 bits, and so on @@ -2088,103 +2088,103 @@ PDP11.aOp8CXn_1120 = [ ]; /** - * op1170(opCode) + * op1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op1170 = function(opCode) +PDP11.op1145 = function(opCode) { - PDP11.aOpXnnn_1170[opCode >> 12].call(this, opCode); + PDP11.aOpXnnn_1145[opCode >> 12].call(this, opCode); }; /** - * op0Xnn_1170(opCode) + * op0Xnn_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op0Xnn_1170 = function(opCode) +PDP11.op0Xnn_1145 = function(opCode) { - PDP11.aOp0Xnn_1170[(opCode >> 8) & 0xf].call(this, opCode); + PDP11.aOp0Xnn_1145[(opCode >> 8) & 0xf].call(this, opCode); }; /** - * op0DXn_1170(opCode) + * op0DXn_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op0DXn_1170 = function(opCode) +PDP11.op0DXn_1145 = function(opCode) { - PDP11.aOp0DXn_1170[(opCode >> 6) & 0x3].call(this, opCode); + PDP11.aOp0DXn_1145[(opCode >> 6) & 0x3].call(this, opCode); }; /** - * op00Xn_1170(opCode) + * op00Xn_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op00Xn_1170 = function(opCode) +PDP11.op00Xn_1145 = function(opCode) { - PDP11.aOp00Xn_1170[(opCode >> 4) & 0xf].call(this, opCode); + PDP11.aOp00Xn_1145[(opCode >> 4) & 0xf].call(this, opCode); }; /** - * op000X_1170(opCode) + * op000X_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op000X_1170 = function(opCode) +PDP11.op000X_1145 = function(opCode) { - PDP11.aOp000X_1170[opCode & 0xf].call(this, opCode); + PDP11.aOp000X_1145[opCode & 0xf].call(this, opCode); }; /** - * op7Xnn_1170(opCode) + * op7Xnn_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op7Xnn_1170 = function(opCode) +PDP11.op7Xnn_1145 = function(opCode) { - PDP11.aOp7Xnn_1170[(opCode >> 8) & 0xf].call(this, opCode); + PDP11.aOp7Xnn_1145[(opCode >> 8) & 0xf].call(this, opCode); }; /** - * op8Xnn_1170(opCode) + * op8Xnn_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op8Xnn_1170 = function(opCode) +PDP11.op8Xnn_1145 = function(opCode) { - PDP11.aOp8Xnn_1170[(opCode >> 8) & 0xf].call(this, opCode); + PDP11.aOp8Xnn_1145[(opCode >> 8) & 0xf].call(this, opCode); }; /** - * op8DXn_1170(opCode) + * op8DXn_1145(opCode) * * @this {CPUStatePDP11} * @param {number} opCode */ -PDP11.op8DXn_1170 = function(opCode) +PDP11.op8DXn_1145 = function(opCode) { - PDP11.aOp8DXn_1170[(opCode >> 6) & 0x3].call(this, opCode); + PDP11.aOp8DXn_1145[(opCode >> 6) & 0x3].call(this, opCode); }; -PDP11.aOpXnnn_1170 = [ - PDP11.op0Xnn_1170, // 0x0nnn +PDP11.aOpXnnn_1145 = [ + PDP11.op0Xnn_1145, // 0x0nnn PDP11.opMOV, // 0x1nnn 01SSDD 11/20+ 2.3 PDP11.opCMP, // 0x2nnn 02SSDD 11/20+ 2.3* PDP11.opBIT, // 0x3nnn 03SSDD 11/20+ 2.9* PDP11.opBIC, // 0x4nnn 04SSDD 11/20+ 2.9 PDP11.opBIS, // 0x5nnn 05SSDD 11/20+ 2.3 PDP11.opADD, // 0x6nnn 06SSDD 11/20+ 2.3 - PDP11.op7Xnn_1170, // 0x7nnn - PDP11.op8Xnn_1170, // 0x8nnn + PDP11.op7Xnn_1145, // 0x7nnn + PDP11.op8Xnn_1145, // 0x8nnn PDP11.opMOVB, // 0x9nnn 11SSDD 11/20+ 2.3 PDP11.opCMPB, // 0xAnnn 12SSDD 11/20+ 2.3 PDP11.opBITB, // 0xBnnn 13SSDD 11/20+ 2.9 @@ -2194,8 +2194,8 @@ PDP11.aOpXnnn_1170 = [ PDP11.opUndefined // 0xFnnn ]; -PDP11.aOp0Xnn_1170 = [ - PDP11.op00Xn_1170, // 0x00nn +PDP11.aOp0Xnn_1145 = [ + PDP11.op00Xn_1145, // 0x00nn PDP11.opBR, // 0x01nn 0004XX 11/20+ 2.6 PDP11.opBNE, // 0x02nn 0010XX 11/20+ 2.6** PDP11.opBEQ, // 0x03nn 0014XX 11/20+ 2.6** @@ -2208,20 +2208,20 @@ PDP11.aOp0Xnn_1170 = [ PDP11.op0AXn_1120, // 0x0Ann PDP11.op0BXn_1120, // 0x0Bnn PDP11.op0CXn_1120, // 0x0Cnn - PDP11.op0DXn_1170, // 0x0Dnn + PDP11.op0DXn_1145, // 0x0Dnn PDP11.opUndefined, // 0x0Enn PDP11.opUndefined // 0x0Fnn ]; -PDP11.aOp0DXn_1170 = [ +PDP11.aOp0DXn_1145 = [ PDP11.opMARK, // 0x0D0n 11/45+ PDP11.opMFPI, // 0x0D4n 11/45+ PDP11.opMTPI, // 0x0D8n 11/45+ PDP11.opSXT // 0x0DCn 11/45+ ]; -PDP11.aOp00Xn_1170 = [ - PDP11.op000X_1170, // 0x000n 000000-000017 +PDP11.aOp00Xn_1145 = [ + PDP11.op000X_1145, // 0x000n 000000-000017 PDP11.opUndefined, // 0x001n 000020-000037 PDP11.opUndefined, // 0x002n 000040-000057 PDP11.opUndefined, // 0x003n 000060-000077 @@ -2239,7 +2239,7 @@ PDP11.aOp00Xn_1170 = [ PDP11.opSWAB // 0x00Fn 0003DD 11/20+ 2.3 ]; -PDP11.aOp000X_1170 = [ +PDP11.aOp000X_1145 = [ PDP11.opHALT, // 0x0000 000000 11/20+ 1.8 PDP11.opWAIT, // 0x0001 000001 11/20+ 1.8 PDP11.opRTI, // 0x0002 000002 11/20+ 4.8 @@ -2258,7 +2258,7 @@ PDP11.aOp000X_1170 = [ PDP11.opUndefined // 0x000F ]; -PDP11.aOp7Xnn_1170 = [ +PDP11.aOp7Xnn_1145 = [ PDP11.opMUL, // 0x70nn 11/45+ PDP11.opMUL, // 0x71nn 11/45+ PDP11.opDIV, // 0x72nn 11/45+ @@ -2277,7 +2277,7 @@ PDP11.aOp7Xnn_1170 = [ PDP11.opSOB // 0x7Fnn 11/45+ ]; -PDP11.aOp8Xnn_1170 = [ +PDP11.aOp8Xnn_1145 = [ PDP11.opBPL, // 0x80nn 1000XX 11/20+ 2.6** PDP11.opBMI, // 0x81nn 1004XX 11/20+ 2.6** PDP11.opBHI, // 0x82nn 1010XX 11/20+ 2.6** @@ -2291,12 +2291,12 @@ PDP11.aOp8Xnn_1170 = [ PDP11.op8AXn_1120, // 0x8Ann PDP11.op8BXn_1120, // 0x8Bnn PDP11.op8CXn_1120, // 0x8Cnn - PDP11.op8DXn_1170, // 0x8Dnn + PDP11.op8DXn_1145, // 0x8Dnn PDP11.opUndefined, // 0x8Enn PDP11.opUndefined // 0x8Fnn ]; -PDP11.aOp8DXn_1170 = [ +PDP11.aOp8DXn_1145 = [ PDP11.opUndefined, // 0x8D0n PDP11.opMFPD, // 0x8D4n 11/45+ PDP11.opMTPD, // 0x8D8n 11/45+ diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 24de601ea..3076be152 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -126,7 +126,7 @@ CPUStatePDP11.prototype.initProcessor = function() if (this.model == PDP11.MODEL_1120) { this.decode = PDP11.op1120.bind(this); } else { - this.decode = PDP11.op1170.bind(this); + this.decode = PDP11.op1145.bind(this); } this.initRegs(); diff --git a/versions/pdpjs/1.30.1/pdp11-dbg.js b/versions/pdpjs/1.30.1/pdp11-dbg.js index dc38c5fe6..7828be6d7 100644 --- a/versions/pdpjs/1.30.1/pdp11-dbg.js +++ b/versions/pdpjs/1.30.1/pdp11-dbg.js @@ -56,11 +56,11 @@ h.ra=function(a,b,c,d){if(this.B&&this.B.ra(a,b,c,d)||this.b&&this.b.ra(a,b,c,d) function Jb(a,b,c,d){if(a.J[b]){void 0===c&&(Fb(a,"Value for "+b+" is invalid"),a.b.da());var e=a.i&&a.i.ja||8;c=!a.b.v.ca||a.v.Sb?8==e?oa(c,d):k(c,d):"--------".substr(0,d||4);a.J[b].textContent!=c&&(a.J[b].textContent=c)}}function Kb(a,b,c,d){for(var e=0;e>2;this.A=this.sa-1;this.D=this.H/this.sa|0;this.Ga=[];this.C=0;this.B=[];this.ic=[Ob,Pb,Qb,Rb];a=new I(this);Sb(a,this.i);this.W=Array(this.D);for(b=0;b>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&E(this.i,64)&&B(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,-1,!0);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Pb(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](0):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](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&E(this.i,64)&&B(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,b,!0),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Qb(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));if(0<=c)return this.i&&E(this.i,64)&&B(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,-1);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} -function Rb(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?this.i&&E(this.i,64)&&B(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,b),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} -function Vb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>8:e[2](b)&255):b&1&&(e=d.Ga[a&-2])&&e[2]&&(c=e[2](b&-2)>>8);if(0<=c)return this.i&&E(this.i,64)&&B(this.i,e[4]+".readByte("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!0);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to byte @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function Pb(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](0):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](0):0,f[3](a&255|b<<8,c),d=!0);d?this.i&&E(this.i,64)&&B(this.i,f[4]+".writeByte("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!0,b),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to byte @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function Qb(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));if(0<=c)return this.i&&E(this.i,64)&&B(this.i,a[4]+".readWord("+J(this.i,b)+"): "+J(this.i,c),!0,!0),c;c=Ub(d,b,!1);this.i&&E(this.i,64)&&B(this.i,"warning: unconverted read access to word @"+J(this.i,b)+": "+J(this.i,c),!0,!0);return c} +function Rb(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?this.i&&E(this.i,64)&&B(this.i,a[4]+".writeWord("+J(this.i,c)+","+J(this.i,b)+")",!0,!0):(Ub(e,c,!1,b),this.i&&E(this.i,64)&&B(this.i,"warning: unconverted write access to word @"+J(this.i,c)+": "+J(this.i,b),!0,!0))} +function Vb(a,b){if(b!=a.j){var c;a.j&&(c=(1<>>a.ga;0g&&(q=g);if(!e&&m&&m.size){if(m.type==d){if(f+g<=m.w)return m.tb+=m.w-f,m.w=f,!0;if(f>=m.w+m.tb){q=m.size-(f-p);q>g&&(q=g);m.tb=f-m.w+q;f=p+a.sa;g-=q;l++;continue}}return ac(1,f,g)}f=new I(a,f,q,a.sa,d,e);Sb(f,a.i,m);a.W[l++]=f;f=p+a.sa;g-=q}if(0>=g){c/=1024;var v;e="";v?10>>=a.ga;0>>=a.ga;0>>this.ga].Bb(a&this.A,a)};h.zb=function(a){this.C++;a=this.W[(a&this.f)>>>this.ga].Ib(a&this.A,a);this.C--;return a};h.ka=function(a){return this.W[(a&this.f)>>>this.ga].qa(a&this.A,a)}; h.lb=function(a){var b=a&this.A,c=(a&this.f)>>>this.ga;this.C++;a=this.W[c].Jb(b,a);this.C--;return a};h.Cb=function(a,b){this.W[(a&this.f)>>>this.ga].Eb(a&this.A,b&255,a)};h.rb=function(a,b){this.C++;this.W[(a&this.f)>>>this.ga].Ob(a&this.A,b&255,a);this.C--};h.Sa=function(a,b){this.W[(a&this.f)>>>this.ga].ub(a&this.A,b&65535,a)};h.Db=function(a,b){var c=a&this.A,d=(a&this.f)>>>this.ga;this.C++;this.W[d].Pb(c,b&65535,a);this.C--}; @@ -138,7 +138,7 @@ function Xe(a){var b=Sd(this,a);if(b){a=a>>6&7;var c=this.u[a]<<16|this.u[a|1];t function $e(){this.ea(16,4);this.b-=25}var af=[0,7,7,10,7,11,9,13];function bf(a){var b=this.b;Ad(this,Qd(this,a));this.b=b-af[this.j]}var cf=[0,14,14,17,14,18,16,20];function df(a){var b=this.b,c=Qd(this,a);a=a>>6&7;Fd(this,this.u[a]);this.u[a]=this.u[7];Ad(this,c);this.b=b-cf[this.j]}var ef=[3,9,9,13,10,14,12,16,4,9,9,13,10,14,13,17];function ff(a){var b=Pd(this,a),c=this.b;P(this,Ud(this,a,b));this.b=c-ef[(this.H?8:0)+this.j]+(7!=this.f||this.j?0:2)} function gf(a){var b=Od(this,a);P(this,Td(this,a,b,1)<<8);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)}var hf=[7,13,13,17,14,18,17,21];function jf(a){var b=Sd(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.F&128||(this.S=b>>16,this.X=this.S|b,this.O=0,this.N=-32768>b||32767>6;if(this.u[b]=this.u[b]-1&65535)Ad(this,this.u[7]-((a&63)<<1)),this.b+=1;this.b-=6}function pf(a){R(this,a,Pd(this,a),se);this.b-=this.j?9+(this.I&&6<=this.f?1:0):(this.H?5:3)+(7==this.f?2:0)} -function qf(a){R(this,a,0,ue);this.b-=this.j?9:3+(7==this.f?2:0)}function rf(){this.ea(28,5);this.b-=5}function sf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function tf(a){R(this,a,Pd(this,a),ve);this.b-=this.j?9:3+(7==this.f?2:0)}function V(a){if(this.i){var b=this.i;B(b,"undefined opcode "+J(b,a),!0,!0);$b(b)}this.ea(8,6)}function td(a){uf[a>>12].call(this,a)}function vf(a){wf[a>>6&3].call(this,a)}function xf(a){yf[a>>6&3].call(this,a)} +function qf(a){R(this,a,0,ue);this.b-=this.j?9:3+(7==this.f?2:0)}function rf(){this.ea(28,5);this.b-=5}function sf(){this.F&4||this.B.$();this.F|=4;this.u[7]=this.u[7]+-2&65535;this.b-=3}function tf(a){R(this,a,Pd(this,a),ve);this.b-=this.j?9:3+(7==this.f?2:0)}function V(a){var b;if(b=this.i)b=this.i,B(b,"undefined opcode "+J(b,a),!0,!0),b=$b(b);b||this.ea(8,6)}function td(a){uf[a>>12].call(this,a)}function vf(a){wf[a>>6&3].call(this,a)}function xf(a){yf[a>>6&3].call(this,a)} function zf(a){Af[a>>6&3].call(this,a)}function Uf(a){Vf[a&15].call(this,a)}function Wf(a){Xf[a&15].call(this,a)}function Yf(a){Zf[a>>6&3].call(this,a)}function $f(a){ag[a>>6&3].call(this,a)}function bg(a){cg[a>>6&3].call(this,a)} var uf=[function(a){dg[a>>8&15].call(this,a)},ff,Ve,Fe,Be,De,we,V,function(a){eg[a>>8&15].call(this,a)},gf,We,Ge,Ce,Ee,pf,V],dg=[function(a){fg[a>>4&15].call(this,a)},Se,Pe,He,Ie,Ne,Je,Le,df,df,vf,xf,zf,V,V,V],wf=[function(a){Bd(this,Ud(this,a,0));this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ge);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ke);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,1,ie);this.b-=this.j?9:3+(7==this.f?2:0)}],yf=[function(a){R(this,a,0, me);this.b-=this.j?11:6},function(a){R(this,a,O(this)?1:0,Xd);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,O(this)?1:0,se);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){a=Sd(this,a);Bd(this,a);this.b-=this.j?4:3+(7==this.f?2:0)}],Af=[function(a){R(this,a,0,qe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,oe);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,ae);this.b-=this.j?9:3+(7==this.f?2:0)},function(a){R(this,a,0,Zd);this.b-=this.j?9:3+(7==this.f?2:0)}],