Fixed 36-bit multiplication in the expression parser so that, within the PDP-10 environment, it produces the same 36-bit results that a PDP-10 would produce (important for MACRO-10 compatibility)
This commit is contained in:
parent
19761fa199
commit
1711393755
5 changed files with 99 additions and 62 deletions
|
|
@ -426,6 +426,22 @@ class Debugger extends Component
|
|||
return ((((dst / Debugger.TWO_POW32)|0) ^ ((src / Debugger.TWO_POW32)|0)) * Debugger.TWO_POW32) + ((dst ^ src) >>> 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* evalMUL(dst, src)
|
||||
*
|
||||
* I could have adapted the code from /modules/pdp10/lib/cpuops.js:PDP10.doMUL(), but it was simpler to
|
||||
* write this base method and let the PDP-10 Debugger override it with a call to the *actual* doMUL() method.
|
||||
*
|
||||
* @this {Debugger}
|
||||
* @param {number} dst
|
||||
* @param {number} src
|
||||
* @return {number} (dst * src)
|
||||
*/
|
||||
evalMUL(dst, src)
|
||||
{
|
||||
return dst * src;
|
||||
}
|
||||
|
||||
/**
|
||||
* truncate(v, nBits, fUnsigned)
|
||||
*
|
||||
|
|
@ -513,7 +529,7 @@ class Debugger extends Component
|
|||
var val1 = aVals.pop();
|
||||
switch(chOp) {
|
||||
case '*':
|
||||
valNew = val1 * val2;
|
||||
valNew = this.evalMUL(val1, val2);
|
||||
break;
|
||||
case '/':
|
||||
if (!val2) return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue