From ee3ffb9f86903dab3f908f9016b1366f7d7809a4 Mon Sep 17 00:00:00 2001 From: Paul Kimpel Date: Sun, 4 Sep 2016 16:38:24 -0700 Subject: [PATCH] Commit version 1.04. --- emulator/B5500CentralControl.js | 6 +++--- emulator/B5500Processor.js | 24 ++++++++++++++++++------ webUI/B5500MagTapeDrive.js | 1 - webUI/B5500Manifest.appcache | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/emulator/B5500CentralControl.js b/emulator/B5500CentralControl.js index 48187d4..bcf2f34 100644 --- a/emulator/B5500CentralControl.js +++ b/emulator/B5500CentralControl.js @@ -61,10 +61,10 @@ function B5500CentralControl(global) { /**************************************/ /* Global constants */ -B5500CentralControl.version = "1.03e"; +B5500CentralControl.version = "1.04"; -B5500CentralControl.memReadCycles = 2; // assume 2 µs memory read cycle time (the other option was 3 µs) -B5500CentralControl.memWriteCycles = 4; // assume 4 µs memory write cycle time (the other option was 6 µs) +B5500CentralControl.memReadCycles = 2; // assume 2 µs memory read cycle time (the other option was 3 µs) +B5500CentralControl.memWriteCycles = 4; // assume 4 µs memory write cycle time (the other option was 6 µs) B5500CentralControl.rtcTick = 1000/60; // Real-time clock period, milliseconds B5500CentralControl.pow2 = [ // powers of 2 from 0 to 52 diff --git a/emulator/B5500Processor.js b/emulator/B5500Processor.js index a67c6aa..9dd7b3c 100644 --- a/emulator/B5500Processor.js +++ b/emulator/B5500Processor.js @@ -1693,9 +1693,12 @@ B5500Processor.prototype.singlePrecisionAdd = function singlePrecisionAdd(adding the smaller exponent is scaled to the right, with overflow going into the X register. The alignment process results in either the exponents becoming equal or one of the mantissas going to zero. + Rewritten 2016-03-12: this version attempts to follow the flows closely, implementing most of the J-count state logic as described in the Flow Chart - and Training Manual documents. + and Training Manual documents. This runs considerably slower (in terms of + number of emulated clocks) than the original version, e.g., the + YUSPAR-RETRO-DECK.card test runs about 7% slower with this version. During development of this version of SP add/subtract we learned that the flows can be subtle, and some things are not as they appear on the surface. @@ -3564,16 +3567,25 @@ B5500Processor.prototype.integerStore = function integerStore(conditional, destr be = (bt ? -(be & 0x3F) : (be & 0x3F)); if (be != 0) { // is B non-integer? - if (be < 0) { // B exponent is negative + if (bm == 0) { // B mantissa is zero -- clear B sign + bs = 0; + } else if (be < 0) { // B exponent is negative, scale right do { ++this.cycleCount; - bo = bm % 8; - bm = (bm - bo)/8; + if (bm == 0) { // B mantissa has become zero, quit and do not round + bo = 0; + break; + } else { // scale right + bo = bm % 8; + bm = (bm - bo)/8; + } } while (++be < 0); if (bs ? bo > 4 : bo >= 4) { ++bm; // round the B mantissa + } else if (bm == 0) { + bs = 0; // B mantissa has become zero, clear B sign } - } else { // B exponent is positive and not zero + } else { // B exponent is positive, normalize left do { ++this.cycleCount; if (bm < 0x1000000000) { @@ -5570,7 +5582,7 @@ B5500Processor.prototype.run = function run() { * SECL: Syllable Execution Complete Level * ***************************************************************/ - if ((this.isP1 ? cc.IAR : (this.I || cc.HP2F)) && this.NCSF) { + if ((this.isP1 ? (cc.IAR && this.NCSF) : (this.I || cc.HP2F))) { // there's an interrupt and we're in Normal State // reset Q09F (R-relative adder mode) and set Q07F (hardware-induced SFI) (for display only) this.Q = (this.Q & 0xFFFEFF) | 0x40; diff --git a/webUI/B5500MagTapeDrive.js b/webUI/B5500MagTapeDrive.js index 4d07f41..ec6a3c6 100644 --- a/webUI/B5500MagTapeDrive.js +++ b/webUI/B5500MagTapeDrive.js @@ -254,7 +254,6 @@ B5500MagTapeDrive.prototype.setAtBOT = function setAtBOT(atBOT) { B5500Util.addClass(this.$$("MTAtBOTLight"), "annunciatorLit"); this.reelBar.value = this.imgMaxInches; this.reelIcon.style.transform = "none"; - this.reelIcon.style["-webkit-transform"] = "none"; // temp for Chrome } } }; diff --git a/webUI/B5500Manifest.appcache b/webUI/B5500Manifest.appcache index 97d0dde..7bce98d 100644 --- a/webUI/B5500Manifest.appcache +++ b/webUI/B5500Manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# retro-B5500 emulator 1.03e, 2016-06-02 06:00 +# retro-B5500 emulator 1.04, 2016-09-03 16:25 CACHE: ../emulator/B5500CentralControl.js