1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-04-09 15:17:53 +00:00

1. Commit emulator files at the point where the Mark XIII MCP completely finishes initialization and is able to interact through the SPO.

2. Commit improvements to SyllableDebugger for Silent Running and fixed-column register displays.
This commit is contained in:
paul.kimpel@digm.com
2013-03-20 05:58:20 +00:00
parent 1c3c8ae307
commit 1b6a91c574
3 changed files with 66 additions and 14 deletions

View File

@@ -544,7 +544,7 @@ B5500CentralControl.prototype.tock = function tock() {
*************************************/
}
interval = (that.nextTimeStamp += B5500CentralControl.rtcTick) - thisTime;
that.timer = setTimeout(function() {that.tock()}, (interval < 0 ? 1 : interval));
that.timer = setTimeout(that.tock, (interval < 0 ? 1 : interval));
};
/**************************************/

View File

@@ -2590,7 +2590,7 @@ B5500Processor.prototype.applyRCW = function(word, inline) {
this.V = f = word % 8; // [7:3], V
word = (word-f)/8;
this.H = word % 8; // [4:3], H
word = (word - word % 0x10)/0x10;
word = (word - word % 16)/16;
return word % 2; // [2:1], DESC bit
};
@@ -2634,9 +2634,8 @@ B5500Processor.prototype.enterSubroutine = function(descriptorCall) {
/* Enters a subroutine via the present Program Descriptor in A as part
of an OPDC or DESC syllable. Also handles accidental entry */
var aw = this.A; // local copy of word in A reg
var bw; // local copy of word in B reg
var arg = this.cc.bit(aw, 5); // descriptor argument bit
var mode = this.cc.bit(aw, 4); // descriptor mode bit (1-char mode)
var mode = this.cc.bit(aw, 4); // descriptor mode bit (1=char mode)
if (arg && !this.MSFF) {
; // just leave the Program Descriptor on TOS
@@ -2650,6 +2649,7 @@ B5500Processor.prototype.enterSubroutine = function(descriptorCall) {
this.B = this.buildMSCW();
this.BROF = 1;
this.adjustBEmpty();
this.F = this.S;
}
// Push a RCW
@@ -2705,7 +2705,7 @@ B5500Processor.prototype.exitSubroutine = function(inline) {
}
} else { // flag bit is set
result = this.applyRCW(this.B, inline);
this.X = this.B % 0x8000000000; // save F setting from MSCW to restore S at end
this.X = this.B % 0x8000000000; // save F setting from RCW to restore S at end
this.S = this.F;
this.loadBviaS(); // B = [S], fetch the MSCW
@@ -4496,6 +4496,7 @@ B5500Processor.prototype.run = function() {
/***************************************************************
* SECL: Syllable Execution Complete Level *
***************************************************************/
if ((this === this.cc.P1 ? this.cc.IAR : this.I) && this.NCSF) {
// there's an interrupt and we're in normal state
this.T = 0x0609; // inject 3011=SFI into T

View File

@@ -19,9 +19,12 @@
<script>
"use strict";
const timerCycles = 1000; // Number of instructions per pseudo-timer interrupt
var cc;
var injected = false; // true if syllable manually injected into T
var memAddr = 0x40; // @100
var runSilently = false; // true if system state is not to be refreshed after each step
var stopAddress = 0; // run-until-address stop point
var accessor = { // Memory access control block
@@ -465,7 +468,7 @@ function displayNumber(id, value) {
if (e) {
setText(id, (Math.pow(8, e)*(s ? -m : m)).toPrecision(12));
} else {
setText(id, m.toString());
setText(id, (s ? -m : m).toString());
}
}
@@ -686,26 +689,49 @@ function runIt(ev) {
/* Steps through instructions continuously until the C register matches the
StopAddr address. StopAddr can be changed while running. Setting it to zero
(or blank) will halt the continuous stepping */
var count = timerCycles;
var runBtn = $$("RunBtn");
var saveStopAddress = stopAddress;
var stopAddr = $$("StopAddr");
function syllabicate() {
if (stopAddress && cc.P1.C != stopAddress) {
do {
cc.P1.step();
displaySystemState();
if (isNaN(stopAddress)) {
stopAddress = 0; // bad address
stopAddr.style.backgroundColor = "red";
runBtn.value = "Run";
} else {
setTimeout(syllabicate, 0);
if (cc.P1.S > 0x7FFF) {
alert("P1.S out of range");
stopAddress = 0;
}
/***************************
if (cc.P1.R != 0) {
alert("P1.R not zero");
stopAddress = 0;
}
***************************/
if (--count <= 0) {
count = timerCycles;
cc.CCI03F = 1; // set timer interrupt
cc.signalInterrupt();
break; // exit loop to pick up events
}
} while (runSilently && stopAddress && cc.P1.C != stopAddress);
if (stopAddress && cc.P1.C != stopAddress) {
setTimeout(syllabicate, 0);
if (!runSilently) {
displaySystemState();
}
} else if (isNaN(stopAddress)) {
stopAddress = 0; // bad address
stopAddr.style.backgroundColor = "red";
runBtn.value = "Run";
} else {
stopAddress = saveStopAddress;
stopAddr.style.backgroundColor = "";
stopAddr.value = padOctal(stopAddress, stopAddr.maxLength);
runBtn.value = "Run";
if (runSilently) {
displaySystemState();
}
}
}
@@ -788,6 +814,12 @@ function tos_onChange(ev, bicID, valueID, origID) {
return value;
}
function runSilently_onClick(ev) {
/* Handle the onchange event for the RunSilently checkbox */
runSilently = ev.target.checked;
}
function fileLoader_onLoad(ev) {
/* Handle the onload event for an ArrayBuffer FileReader */
var addr = 0; // starting B5500 memory address
@@ -996,6 +1028,7 @@ function initialize() {
$$("GoBtn").addEventListener("click", goIt, false);
$$("StepBtn").addEventListener("click", stepIt, false);
$$("RunBtn").addEventListener("click", runIt, false);
$$("RunSilently").addEventListener("click", runSilently_onClick, false);
cc = new B5500CentralControl();
cc.powerOn();
@@ -1014,6 +1047,7 @@ function initialize() {
displaySystemState();
displayOctal("StopAddr", stopAddress, 5);
$$("RunSilently").checked = runSilently;
}
window.onload = function() {
@@ -1040,6 +1074,11 @@ window.onload = function() {
</p>
<table id=RegisterBank1 class="normal border">
<colgroup>
<col span=4>
<col style="width:12em">
<col>
</colgroup>
<thead>
<tr>
<th>Reg
@@ -1232,6 +1271,14 @@ window.onload = function() {
</table>
<table id=RegisterBank2 class="normal border">
<colgroup>
<col style="width:2em">
<col style="width:10em">
<col style="width:2em">
<col style="width:7em">
<col style="width:2em">
<col style="width:7em">
</colgroup>
<tbody>
<tr>
<td class=center>X
@@ -1327,6 +1374,10 @@ window.onload = function() {
<input id=StopAddr name=StopAddr type=text class=number size=5 maxlength=5>
&nbsp;
<input id=RunBtn name=RunBtn type=button value="Run" accesskey=R>
<tr>
<td colspan=6 class=rj>
<label for=RunSilently>Run Silently</label>
<input id=RunSilently name=RunSilently type=checkbox value=1>
</table>
<table id=CentralControl>