Added some PDP-11 documentation
This commit is contained in:
parent
94fd473b0a
commit
fac5c3c57d
3 changed files with 75 additions and 4 deletions
|
|
@ -490,6 +490,33 @@ PDP11.opADCB = function(opCode)
|
|||
/**
|
||||
* opADD(opCode)
|
||||
*
|
||||
* From the PDP-11/20 Processor HandBook (1971), p. 61:
|
||||
*
|
||||
* Add src,dst (06SSDD)
|
||||
*
|
||||
* Operation:
|
||||
* (dst) = (src) + (dst)
|
||||
*
|
||||
* Condition Codes:
|
||||
* N: set if result < 0; cleared otherwise
|
||||
* Z: set if result = 0; cleared otherwise
|
||||
* V: set if there was arithmetic overflow as a result of the operation, that is both operands
|
||||
* were of the same sign and the result was of the opposite sign; cleared otherwise
|
||||
* C: set if there was a carry from the most significant bit of the result; cleared otherwise
|
||||
*
|
||||
* Description:
|
||||
* Adds the source operand to the destination operand and stores the result at the destination address.
|
||||
* The original contents of the destination are lost. The contents of the source are not affected.
|
||||
* Two's complement addition is performed.
|
||||
*
|
||||
* Examples:
|
||||
* Add to register: ADD 20,R0
|
||||
* Add to memory: ADD R1,XXX
|
||||
* Add register to register: ADD R1,R2
|
||||
* Add memory to memory: ADD @#17750,XXX
|
||||
*
|
||||
* XXX is a programmer-defined mnemonic for a memory location.
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} opCode
|
||||
*/
|
||||
|
|
@ -1325,6 +1352,7 @@ PDP11.opMFPI = function(opCode)
|
|||
*/
|
||||
PDP11.opMFPS = function(opCode)
|
||||
{
|
||||
//noinspection JSUnresolvedFunction
|
||||
PDP11.opUndefined.call(this, opCode);
|
||||
};
|
||||
|
||||
|
|
@ -1347,6 +1375,7 @@ PDP11.opMFPS = function(opCode)
|
|||
*/
|
||||
PDP11.opMFPT = function(opCode)
|
||||
{
|
||||
//noinspection JSUnresolvedFunction
|
||||
PDP11.opUndefined.call(this, opCode);
|
||||
};
|
||||
|
||||
|
|
@ -1442,6 +1471,7 @@ PDP11.opMTPI = function(opCode)
|
|||
*/
|
||||
PDP11.opMTPS = function(opCode)
|
||||
{
|
||||
//noinspection JSUnresolvedFunction
|
||||
PDP11.opUndefined.call(this, opCode);
|
||||
};
|
||||
|
||||
|
|
@ -1539,8 +1569,20 @@ PDP11.opRESET = function(opCode)
|
|||
* that the last CNSW.writeWord(177570) was for 000101, not 166667. So I'm guessing that the RESET
|
||||
* instruction is supposed to propagate R0 to the console's DISPLAY register.
|
||||
*
|
||||
* This is similar to what we do for the HALT instruction on the PDP-11/20. None of these Console features
|
||||
* seem to be very well documented (assuming they exist).
|
||||
* This is similar to what we do for the HALT instruction (but only if this.model == PDP11.MODEL_1120).
|
||||
* These Console features do not seem to be very well documented, assuming they exist.
|
||||
*
|
||||
* UPDATE: This behavior appears to be confirmed by remarks in the PDP-11/20 Processor Handbook (1971),
|
||||
* p. 141:
|
||||
*
|
||||
* HALT - displays processor register R0 when bus control is transferred to console during a HALT
|
||||
* instruction.
|
||||
*
|
||||
* RESET - displays register R0 for during [duration?] of RESET (70 msec).
|
||||
*
|
||||
* I haven't found similar remarks in the PDP-11/70 Processor Handbooks, so I'm not sure if that's an
|
||||
* oversight or if 11/70 panels are slightly different in this regard. It's also not clear what they meant
|
||||
* by "for duration of RESET". Is something supposed to happen to the DATA lights after the RESET is done?
|
||||
*/
|
||||
this.panel.setData(this.regsGen[0], true);
|
||||
}
|
||||
|
|
@ -1786,6 +1828,35 @@ PDP11.opSPL = function(opCode)
|
|||
/**
|
||||
* opSUB(opCode)
|
||||
*
|
||||
* From the PDP-11/20 Processor HandBook (1971), p. 62:
|
||||
*
|
||||
* Subtract src,dst (16SSDD)
|
||||
*
|
||||
* Operation:
|
||||
* (dst) = (dst) - (src) [in detail, (dst) + ~(src) + 1 (dst)]
|
||||
*
|
||||
* Condition Codes:
|
||||
* N: set if result < 0; cleared otherwise
|
||||
* Z: set if result = 0; cleared otherwise
|
||||
* V: set if there was arithmetic overflow as a result of the operation, that is if operands were of
|
||||
* opposite signs and the sign of the source was the same as the sign of the result; cleared otherwise
|
||||
* C: cleared if there was a carry from the most significant bit of the result; set otherwise
|
||||
*
|
||||
* Description:
|
||||
* Subtracts the source operand from the destination operand and leaves the result at the destination address.
|
||||
* The orignial [sic] contents of the destination are lost. The contents of the source are not affected.
|
||||
* In double-precision arithmetic the C-bit, when set, indicates a "borrow".
|
||||
*
|
||||
* Example:
|
||||
* SUB R1,R2
|
||||
*
|
||||
* BEFORE AFTER
|
||||
* (R1) = 011111 (R2) = 012345
|
||||
* (R1) = 011111 (R2) = 001234
|
||||
*
|
||||
* NZVC NZVC
|
||||
* 1111 0001
|
||||
*
|
||||
* @this {CPUStatePDP11}
|
||||
* @param {number} opCode
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -601,7 +601,7 @@ function uo(a){a.N&&a.C&&(a.Df&16&&!(a.Yb&64)?jg(a.N,a.C):ig(a.N,a.C))}var ro={0
|
|||
function vo(a){this.Ca=a.adapter;switch(this.Ca){case 1:this.va=1016;this.ia=4;break;case 2:this.va=760;this.ia=3;break;default:w("Unrecognized serial adapter #"+this.Ca);return}this.V=this.W=null;this.Ga=a.tabSize;this.Ea=a.charBOL;this.ea=0;this.Ja=wo|xo;this.pa=!0;db.call(this,"SerialPort",a,vo,8388608);a=a.binding;"console"==a?this.W="":ob(this,a,yo);this.L=this.ua=this.Cc=null;this.exports={connect:this.zj,receiveData:this.hg,receiveStatus:this.ll}}gb(vo);var yo="buffer",wo=16,xo=32;l=vo.prototype;
|
||||
l.bj=function(a,b,c){var d=null;a!=this.xd||this.L||(this.L=b,this.Cc=c,this.pa=!1,d=this);return d};l.Pb=function(a,b,c){var d=this;switch(b){case yo:return this.qa[b]=this.V=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.hg(b);return!0},c.onkeypress=function(a){a=a||window.event;d.hg(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
l.Jc=function(a,b,c,d){this.X=a;this.ga=b;this.F=c;this.ha=d;this.N=Gb(a,"ChipSet");nc(b,this,zo,this.va);rc(b,this,Ao,this.va);ub(this)};
|
||||
l.zj=function(a){if(!this.L){var b=Vc(this.X,"connection");if(b){var c=b.split("->");if(2==c.length){var d=qa(c[0]);if(d!=this.xd)return;c=qa(c[1]);if(this.L=lb(c)){var e=this.L.exports;if(e){var f=e.connect;f&&f.call(this.L,this.pa);if(this.ua=e.receiveData){this.pa=a;this.Cc=e.receiveStatus;this.status(this.ce+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
l.zj=function(a){if(!this.L){var b=Vc(this.X,"connection");if(b){var c=b.split("->");if(2==c.length){var d=qa(c[0]);if(d!=this.xd)return;c=qa(c[1]);if(this.L=lb(c)){var e=this.L.exports;if(e){var f=e.connect;f&&f.call(this.L,this.pa);if(this.ua=e.receiveData){this.pa=a;this.Cc=e.receiveStatus;this.status("Connected "+this.ce+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
l.hc=function(a,b){if(!b)if(this.zj(this.pa),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.gc=function(a){return a?this.save():!0};l.reset=function(){Bo(this)};l.save=function(){var a=new nf(this),b=0,c=[];c[b++]=this.ya;c[b++]=this.Da;c[b++]=this.fa;c[b++]=this.ka;c[b++]=this.U;c[b++]=this.C;c[b++]=this.ra;c[b++]=this.B;c[b++]=this.A;c[b]=this.aa;a.set(0,c);return a.data()};l.restore=function(a){return Bo(this,a[0])};
|
||||
function Bo(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.Ja,[]]);a.ya=b[c++];a.Da=b[c++];a.fa=b[c++];a.ka=b[c++];a.U=b[c++];a.C=b[c++];a.ra=b[c++];a.B=b[c++];a.A=b[c++];a.aa=b[c];return!0}l.hg=function(a){if("number"==typeof a)this.aa.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.aa.push(a.charCodeAt(b));else this.aa=this.aa.concat(a);Co(this);return!0};l.ll=function(a){var b=this.A;this.A&=~(wo|xo);a&32&&(this.A=this.A|wo|1);a&64&&(this.A=this.A|xo|2);b!=this.A&&Do(this)};
|
||||
function Co(a){0<a.aa.length&&!(a.B&1)&&(a.ya=a.aa.shift(),a.B|=1);Do(a)}l.Em=function(a,b){var c=this.C&128?this.fa&255:this.ya;x(this,a,null,b,this.C&128?"DLL":"RBR",c);this.B&=-2;Co(this);return c};l.qm=function(a,b){var c=this.C&128?this.fa>>8:this.ka;x(this,a,null,b,this.C&128?"DLM":"IER",c);return c};l.rm=function(a,b){var c=this.U;x(this,a,null,b,"IIR",c);return c};l.sm=function(a,b){var c=this.C;x(this,a,null,b,"LCR",c);return c};l.um=function(a,b){var c=this.ra;x(this,a,null,b,"MCR",c);return c};
|
||||
|
|
|
|||
|
|
@ -562,7 +562,7 @@ l.gm=function(a,b){this.Me=b;Ml(this)};function Ml(a){a.S&&a.D&&(a.Me&16&&!(a.Db
|
|||
function Nl(a){this.oa=a.adapter;switch(this.oa){case 1:this.ka=1016;this.W=4;break;case 2:this.ka=760;this.W=3;break;default:r("Unrecognized serial adapter #"+this.oa);return}this.G=this.I=null;this.ra=a.tabSize;this.qa=a.charBOL;this.R=0;this.sa=Ol|Pl;this.Z=!0;Ma.call(this,"SerialPort",a,Nl);a=a.binding;"console"==a?this.I="":Xa(this,a,Ql);this.D=this.ga=this.Rc=null;this.exports={connect:this.wi,receiveData:this.jf,receiveStatus:this.$j}}Pa(Nl);var Ql="buffer",Ol=16,Pl=32;l=Nl.prototype;
|
||||
l.fi=function(a,b,c){var d=null;a!=this.Td||this.D||(this.D=b,this.Rc=c,this.Z=!1,d=this);return d};l.zb=function(a,b,c){var d=this;switch(b){case Ql:return this.la[b]=this.G=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;if(8===b||a.ctrlKey&&65<=b&&90>=b)a.preventDefault&&a.preventDefault(),64<b&&(b-=64),d.jf(b);return!0},c.onkeypress=function(a){a=a||window.event;d.jf(a.which||a.keyCode);a.preventDefault&&a.preventDefault();return!0},c.removeAttribute("readonly"),!0}return!1};
|
||||
l.pc=function(a,b,c,d){this.ba=a;this.ia=b;this.A=c;this.Ia=d;this.S=jb(a,"ChipSet");Pb(b,this,Rl,this.ka);Rb(b,this,Sl,this.ka);t(this)};
|
||||
l.wi=function(a){if(!this.D){var b=kc(this.ba,"connection");if(b){var c=b.split("->");if(2==c.length){var d=la(c[0]);if(d!=this.Td)return;c=la(c[1]);if(this.D=Ua(c)){var e=this.D.exports;if(e){var f=e.connect;f&&f.call(this.D,this.Z);if(this.ga=e.receiveData){this.Z=a;this.Rc=e.receiveStatus;this.status(this.Fe+"."+d+" connected to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
l.wi=function(a){if(!this.D){var b=kc(this.ba,"connection");if(b){var c=b.split("->");if(2==c.length){var d=la(c[0]);if(d!=this.Td)return;c=la(c[1]);if(this.D=Ua(c)){var e=this.D.exports;if(e){var f=e.connect;f&&f.call(this.D,this.Z);if(this.ga=e.receiveData){this.Z=a;this.Rc=e.receiveStatus;this.status("Connected "+this.Fe+"."+d+" to "+c);return}}}}this.status("Unable to establish connection: "+b)}}};
|
||||
l.Ub=function(a,b){if(!b)if(this.wi(this.Z),!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};l.Tb=function(a){return a?this.save():!0};l.reset=function(){Tl(this)};l.save=function(){var a=new ae(this),b=0,c=[];c[b++]=this.ma;c[b++]=this.pa;c[b++]=this.P;c[b++]=this.Y;c[b++]=this.H;c[b++]=this.L;c[b++]=this.da;c[b++]=this.C;c[b++]=this.B;c[b]=this.K;a.set(0,c);return a.data()};l.restore=function(a){return Tl(this,a[0])};
|
||||
function Tl(a,b){var c=0;b||(b=[0,0,384,0,1,0,0,96,a.sa,[]]);a.ma=b[c++];a.pa=b[c++];a.P=b[c++];a.Y=b[c++];a.H=b[c++];a.L=b[c++];a.da=b[c++];a.C=b[c++];a.B=b[c++];a.K=b[c];return!0}l.jf=function(a){if("number"==typeof a)this.K.push(a);else if("string"==typeof a)for(var b=0;b<a.length;b++)this.K.push(a.charCodeAt(b));else this.K=this.K.concat(a);Ul(this);return!0};l.$j=function(a){var b=this.B;this.B&=~(Ol|Pl);a&32&&(this.B=this.B|Ol|1);a&64&&(this.B=this.B|Pl|2);b!=this.B&&Vl(this)};
|
||||
function Ul(a){0<a.K.length&&!(a.C&1)&&(a.ma=a.K.shift(),a.C|=1);Vl(a)}l.pl=function(){var a=this.L&128?this.P&255:this.ma;this.C&=-2;Ul(this);return a};l.bl=function(){return this.L&128?this.P>>8:this.Y};l.cl=function(){return this.H};l.dl=function(){return this.L};l.fl=function(){return this.da};l.el=function(){return this.C};l.kl=function(){var a=this.B;this.B&=-4;return a};
|
||||
|
|
|
|||
Loading…
Reference in a new issue