Added "lsh" and "rot" commands to the Int36 command-line tool to mimic the PDP-10 opcodes and test their logic

This commit is contained in:
Jeff 2017-03-05 10:04:18 -08:00 committed by Jeff Parsons
commit 234e8871ba
6 changed files with 308 additions and 45 deletions

View file

@ -1402,7 +1402,7 @@ PDP10.opASH = function(op, acc)
/*
* Convert the unsigned 18-bit value in regEA to a signed 8-bit value (+/-255).
*/
var s = (this.regEA << 14) >> 24;
var s = ((this.regEA << 14) >> 14) % 256;
if (s) {
var w = this.readWord(acc), bitsShifted;
/*
@ -1474,7 +1474,7 @@ PDP10.opROT = function(op, acc)
/*
* Convert the unsigned 18-bit value in regEA to a signed 8-bit value, modulo 36 (+/-35).
*/
var s = ((this.regEA << 14) >> 24) % 36;
var s = ((this.regEA << 14) >> 14) % 36;
if (s) {
var w = this.readWord(acc);
/*
@ -1523,7 +1523,7 @@ PDP10.opLSH = function(op, acc)
/*
* Convert the unsigned 18-bit value in regEA to a signed 8-bit value (+/-255).
*/
var s = (this.regEA << 14) >> 24;
var s = ((this.regEA << 14) >> 14) % 256;
if (s) {
var w = this.readWord(acc);
if (s > 0) {
@ -1598,7 +1598,7 @@ PDP10.opROTC = function(op, acc)
/*
* Convert the unsigned 18-bit value in regEA to a signed 8-bit value, modulo 72 (+/-71).
*/
var s = ((this.regEA << 14) >> 24) % 72;
var s = ((this.regEA << 14) >> 14) % 72;
if (s) {
var wLeft = this.readWord(acc);
var wRight = this.readWord((acc + 1) & 0o17);
@ -1638,7 +1638,7 @@ PDP10.opLSHC = function(op, acc)
/*
* Convert the unsigned 18-bit value in regEA to a signed 8-bit value (+/-255).
*/
var s = (this.regEA << 14) >> 24;
var s = ((this.regEA << 14) >> 14) % 256;
if (s) {
var wLeft = this.readWord(acc);
var wRight = this.readWord((acc + 1) & 0o17);

View file

@ -84,7 +84,7 @@ var PDP10 = {
MODEL_KA10: 1001,
/*
* This constant is used to mark points in the code where the physical address being returned
* ADDR_INVALID is used to mark points in the code where the physical address being returned
* is invalid and should not be used.
*
* In a 32-bit CPU, -1 (ie, 0xffffffff) could actually be a valid address, so consider changing