mirror of
https://github.com/pkimpel/retro-b5500.git
synced 2026-04-26 04:08:12 +00:00
Debug word mode from single-stepping of KERNEL bootstrap program; fix errors in B5500DiskUnit; minor whitespace corrections in SYMBOL/KERNEL and SYMBOL/COOL.
This commit is contained in:
@@ -3968,6 +3968,10 @@ B5500Processor.prototype.run = function() {
|
||||
break;
|
||||
|
||||
case 0x0C: // 1425: FTC=F field to core field
|
||||
this.adjustABFull();
|
||||
t1 = (this.A % 0x40000000 - this.A % 0x8000)/0x8000;
|
||||
this.B -= this.B % 0x8000 - t1
|
||||
this.AROF = 0;
|
||||
break;
|
||||
|
||||
case 0x10: // 2025: DUP=Duplicate TOS
|
||||
@@ -3983,6 +3987,11 @@ B5500Processor.prototype.run = function() {
|
||||
break;
|
||||
|
||||
case 0x1C: // 3425: FTF=F field to F field
|
||||
this.adjustABFull();
|
||||
t1 = (this.A % 0x40000000 - this.A % 0x8000);
|
||||
t2 = (this.B % 0x40000000 - this.B % 0x8000);
|
||||
this.B -= t2 - t1
|
||||
this.AROF = 0;
|
||||
break;
|
||||
|
||||
case 0x21: // 4125: LEQ=compare B less or equal to A
|
||||
@@ -3998,9 +4007,16 @@ B5500Processor.prototype.run = function() {
|
||||
break;
|
||||
|
||||
case 0x2C: // 5425: CTC=core field to C field
|
||||
this.adjustABFull();
|
||||
this.B -= this.B % 0x8000 - this.A % 0x8000
|
||||
this.AROF = 0;
|
||||
break;
|
||||
|
||||
case 0x3C: // 7425: CTF=core field to F field
|
||||
this.adjustABFull();
|
||||
t2 = (this.B % 0x40000000 - this.B % 0x8000);
|
||||
this.B -= t2 - (this.A % 0x8000)*0x8000;
|
||||
this.AROF = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -4257,11 +4273,15 @@ B5500Processor.prototype.run = function() {
|
||||
switch (this.exitSubroutine(0)) {
|
||||
case 0:
|
||||
this.X = 0;
|
||||
operandCall();
|
||||
this.operandCall();
|
||||
break;
|
||||
case 1:
|
||||
this.Q |= 0x10; // set Q05F, for display only
|
||||
this.X = 0;
|
||||
descriptorCall();
|
||||
this.descriptorCall();
|
||||
break;
|
||||
case 2: // flag-bit interrupt occurred, do nothing
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4278,11 +4298,13 @@ B5500Processor.prototype.run = function() {
|
||||
switch (this.exitSubroutine(0)) {
|
||||
case 0:
|
||||
this.X = 0;
|
||||
operandCall();
|
||||
this.operandCall();
|
||||
break;
|
||||
case 1:
|
||||
this.Q |= 0x10; // set Q05F, for display only
|
||||
this.X = 0;
|
||||
descriptorCall();
|
||||
this.descriptorCall();
|
||||
break;
|
||||
case 2: // flag-bit interrupt occurred, do nothing
|
||||
break;
|
||||
}
|
||||
@@ -4328,6 +4350,25 @@ B5500Processor.prototype.run = function() {
|
||||
break;
|
||||
|
||||
case 0x11: // 2141: SSF=F & S register set/store
|
||||
this.adjustABFull();
|
||||
switch (this.A % 0x04) {
|
||||
case 0: // store F into B.[18:15]
|
||||
this.B -= (this.B % 0x40000000 - this.B % 0x8000) - this.F*0x8000;
|
||||
break;
|
||||
case 1: // set F from B.[18:15]
|
||||
this.F = (this.B % 0x40000000 - this.B % 0x8000)/0x8000;
|
||||
this.SALF = 1;
|
||||
this.BROF = 0;
|
||||
break;
|
||||
case 2: // store S into B.[33:15]
|
||||
this.B -= this.B % 0x8000 - this.S;
|
||||
break;
|
||||
case 3: // set S from B.[33:15]
|
||||
this.S = this.B % 0x8000;
|
||||
this.BROF = 0;
|
||||
break;
|
||||
}
|
||||
this.AROF = 0;
|
||||
break;
|
||||
|
||||
case 0x15: // 2541: LLL=link list lookup
|
||||
|
||||
@@ -229,7 +229,7 @@ B5500DiskUnit.prototype.read = function(finish, buffer, length, mode, control) {
|
||||
// A multi-segment read
|
||||
} else {
|
||||
range = window.IDBKeyRange.bound(segAddr, endAddr);
|
||||
txn = this.disk.transacation(euName);
|
||||
txn = this.disk.transaction(euName);
|
||||
|
||||
req = txn.objectStore(euName).openCursor(range);
|
||||
req.onsuccess = function(ev) {
|
||||
@@ -368,10 +368,10 @@ B5500DiskUnit.prototype.readCheck = function(finish, length, control) {
|
||||
euSize = this.config[euName];
|
||||
if (!euSize) { // EU does not exist
|
||||
finish(this.errorMask | 0x20, 0); // set D27F for EU not ready
|
||||
// do NOT clear the error mask
|
||||
// DO NOT clear the error mask
|
||||
} else if (segAddr < 0) {
|
||||
finish(this.errorMask | 0x20, 0); // set D27F for invalid starting seg address
|
||||
// do NOT clear the error mask
|
||||
// DO NOT clear the error mask
|
||||
} else {
|
||||
if (endAddr >= euSize) { // if read is past end of disk
|
||||
this.errorMask |= 0x20; // set D27F for invalid seg address
|
||||
@@ -385,7 +385,7 @@ B5500DiskUnit.prototype.readCheck = function(finish, length, control) {
|
||||
// No length specified, so just finish the I/O
|
||||
if (segs < 1) {
|
||||
finish(this.errorMask, 0);
|
||||
// do NOT clear the error mask
|
||||
// DO NOT clear the error mask -- will return it on the next interrogate
|
||||
|
||||
// A multi-segment read
|
||||
} else {
|
||||
@@ -401,7 +401,7 @@ B5500DiskUnit.prototype.readCheck = function(finish, length, control) {
|
||||
} else { // at end of range
|
||||
setTimeout(function() {
|
||||
finish(that.errorMask, length);
|
||||
// do NOT clear the error mask
|
||||
// DO NOT clear the error mask
|
||||
}, finishTime - new Date().getTime());
|
||||
}
|
||||
};
|
||||
@@ -420,6 +420,7 @@ B5500DiskUnit.prototype.readInterrogate = function(finish, control) {
|
||||
var segAddr = control % 1000000; // starting seg address
|
||||
var euNumber = (control % 10000000 - segAddr)/1000000;
|
||||
var euName = this.euPrefix + euNumber;
|
||||
var that = this;
|
||||
|
||||
this.finish = finish; // for global error handler
|
||||
euSize = this.config[euName];
|
||||
@@ -432,7 +433,7 @@ B5500DiskUnit.prototype.readInterrogate = function(finish, control) {
|
||||
}
|
||||
setTimeout(function() {
|
||||
finish(that.errorMask, length);
|
||||
this.errorMask = 0;
|
||||
that.errorMask = 0;
|
||||
}, Math.random()*this.maxLatency*1000);
|
||||
}
|
||||
};
|
||||
@@ -452,6 +453,7 @@ B5500DiskUnit.prototype.writeInterrogate = function (finish, control) {
|
||||
var segAddr = control % 1000000; // starting seg address
|
||||
var euNumber = (control % 10000000 - segAddr)/1000000;
|
||||
var euName = this.euPrefix + euNumber;
|
||||
var that = this;
|
||||
|
||||
this.finish = finish; // for global error handler
|
||||
euSize = this.config[euName];
|
||||
@@ -464,7 +466,7 @@ B5500DiskUnit.prototype.writeInterrogate = function (finish, control) {
|
||||
}
|
||||
setTimeout(function() {
|
||||
finish(that.errorMask, length);
|
||||
this.errorMask = 0;
|
||||
that.errorMask = 0;
|
||||
}, Math.random()*this.maxLatency*1000);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -318,7 +318,8 @@ function padOctal(value, octades) {
|
||||
}
|
||||
|
||||
function decodeSyllable(syllable, mode, level, msff) {
|
||||
/* Decodes the B5500 operator "syllable" and returns a string formatted with the mnemonic description of that syllable.
|
||||
/* Decodes the B5500 operator "syllable" and returns a string formatted with the
|
||||
mnemonic description of that syllable.
|
||||
"mode" indicates word (0) or character (1) mode.
|
||||
"level" indicates program (0) or subroutine (1) level.
|
||||
"msff" indicates whether MSFF is set (mark-stack pending) */
|
||||
@@ -326,26 +327,37 @@ function decodeSyllable(syllable, mode, level, msff) {
|
||||
var text = opcode + " = ";
|
||||
var v;
|
||||
|
||||
function decodeRelativeAddress(value, level, msff) {
|
||||
function decodeRelativeAddress(value, salf, msff) {
|
||||
var text;
|
||||
|
||||
if (!level) {
|
||||
if (!salf) {
|
||||
text = "R+" + padOctal(value, 4);
|
||||
} else if (value < 512) {
|
||||
text = "R+" + padOctal(value, 3);
|
||||
} else if (value%512 < 256) {
|
||||
if (msff) {
|
||||
text = "[R+7].[18:32]+" + padOctal(value%256, 3);
|
||||
} else {
|
||||
text = "F+" + padOctal(value%256, 3);
|
||||
}
|
||||
} else if (value%256 < 128) {
|
||||
text = "C+" + padOctal(value%128, 3);
|
||||
} else {
|
||||
if (msff) {
|
||||
text = "[R+7].[18:32]-" + padOctal(value%256, 3);
|
||||
} else {
|
||||
text = "F-" + padOctal(value%256, 3);
|
||||
switch ((value >>> 7) & 0x07) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
text = "R+" + padOctal(value, 3);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
if (msff) {
|
||||
text = "[R+7].[18:32]+" + padOctal(value & 0xFF, 3);
|
||||
} else {
|
||||
text = "F+" + padOctal(value & 0xFF, 3);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
text = "C+" + padOctal(value & 0x7F, 3);
|
||||
break;
|
||||
case 7:
|
||||
if (msff) {
|
||||
text = "[R+7].[18:32]-" + padOctal(value & 0x7F, 3);
|
||||
} else {
|
||||
text = "F-" + padOctal(value & 0x7F, 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return text;
|
||||
@@ -722,6 +734,8 @@ function fileLoader_onLoad(ev) {
|
||||
var buf = ev.target.result;
|
||||
var words = 0;
|
||||
|
||||
cc.clear();
|
||||
cc.P1.clear();
|
||||
try {
|
||||
words = cc.loadTest(buf, addr);
|
||||
alert("File loaded: " + buf.byteLength + " bytes, " +
|
||||
|
||||
Reference in New Issue
Block a user