Finished the PDP-10 Move Magnitude opcodes, along with the Push Down and Pop Up opcodes (uncovering some SIMH weirdness along the way)

This commit is contained in:
Jeff 2017-03-02 16:38:00 -08:00 committed by Jeff Parsons
commit affaa1075c
8 changed files with 398 additions and 224 deletions

View file

@ -176,7 +176,7 @@ class CPUStatePDP10 extends CPUPDP10 {
{
this.regEA = this.regRA = this.regOP = 0;
this.regPC = this.lastPC = this.addrReset;
this.fOverflow = this.fCarry0 = this.fCarry1 = this.fNoDivide = false;
this.fOverflow = this.fCarry0 = this.fCarry1 = this.fNoDivide = this.fPDOverflow = false;
/*
* This is queried and displayed by the Panel when it's not displaying its own ADDRESS register
@ -439,11 +439,34 @@ class CPUStatePDP10 extends CPUPDP10 {
}
/**
* negate(src)
* abs(src)
*
* Used by the MOVM* (Move Magnitude) instructions.
*
* @this {CPUStatePDP10}
* @param {number} src (36-bit)
* @return {number} (negated, but as an unsigned 36-bit result)
* @return {number} (absolute value of src)
*/
abs(src)
{
if (src > PDP10.MAX_POS36) {
if (src != PDP10.MIN_NEG36) {
src = PDP10.TWO_POW36 - src;
} else {
this.fOverflow = this.fCarry1 = true;
}
}
return src;
}
/**
* negate(src)
*
* Used by the MOVN* (Move Negative) instructions.
*
* @this {CPUStatePDP10}
* @param {number} src (36-bit)
* @return {number} (src negated, but as an unsigned 36-bit result)
*/
negate(src)
{