A if B positive
+ }
+};
+
/**************************************/
B5500Processor.prototype.singlePrecisionMultiply = function() {
/* Multiplies the contents of the A register to the B register, leaving the
@@ -2821,6 +2890,7 @@ B5500Processor.prototype.run = function() {
break;
case 0x36: // XX66: OCV=Output convert
+ this.streamOutputConvert(variant);
break;
case 0x37: // XX67: ICV=Input convert
@@ -3152,18 +3222,16 @@ B5500Processor.prototype.run = function() {
case 0x15: // XX25: comparison & misc. stack ops
switch (variant) {
- case 0x01: // 0125: CEQ=compare B greater or equal to A
+ case 0x01: // 0125: GEQ=compare B greater or equal to A
+ this.B = (this.singlePrecisionCompare() >= 0 ? 1 : 0);
break;
- case 0x02: // 0225: CGR=compare B greater to A
+ case 0x02: // 0225: GTR=compare B greater to A
+ this.B = (this.singlePrecisionCompare() > 0 ? 1 : 0);
break;
case 0x04: // 0425: NEQ=compare B not equal to A
- // assert(this.AROF == 1 && this.BROF == 1);
- // TODO: should this be excluding the flag bit in the comparison?
- this.B = (this.A != this.B) ? 1 : 0;
- this.AROF = 0;
- this.BROF = 1;
+ this.B = (this.singlePrecisionCompare() != 0 ? 1 : 0);
break;
case 0x08: // 1025: XCH=exchange TOS words
@@ -3174,37 +3242,30 @@ B5500Processor.prototype.run = function() {
break;
case 0x10: // 2025: DUP=Duplicate TOS
- this.adjustAEmpty();
- this.adjustBFull();
- this.A = this.B;
- this.AROF = 1;
+ if (this.AROF) {
+ this.AdjustBEmpty();
+ this.B = this.A;
+ this.BROF = 1;
+ } else {
+ this.adjustBFull();
+ this.A = this.B;
+ this.AROF = 1;
+ }
break;
case 0x1C: // 3425: FTF=F field to F field
break;
case 0x21: // 4125: LEQ=compare B less or equal to A
- // assert(this.AROF == 1 && this.BROF == 1);
- // TODO: should this be excluding the flag bit in the comparison?
- this.B = (this.A >= this.B) ? 1 : 0;
- this.AROF = 0;
- this.BROF = 1;
+ this.B = (this.singlePrecisionCompare() <= 0 ? 1 : 0);
break;
case 0x22: // 4225: LSS=compare B less to A
- // assert(this.AROF == 1 && this.BROF == 1);
- // TODO: should this be excluding the flag bit in the comparison?
- this.B = (this.A > this.B) ? 1 : 0;
- this.AROF = 0;
- this.BROF = 1;
+ this.B = (this.singlePrecisionCompare() < 0 ? 1 : 0);
break;
case 0x24: // 4425: EQL=compare B equal to A
- // assert(this.AROF == 1 && this.BROF == 1);
- // TODO: should this be excluding the flag bit in the comparison?
- this.B = (this.A == this.B) ? 1 : 0;
- this.AROF = 0;
- this.BROF = 1;
+ this.B = (this.singlePrecisionCompare() == 0 ? 1 : 0);
break;
case 0x2C: // 5425: CTC=core field to C field
diff --git a/webUI/B5500TestArithmetics.html b/webUI/B5500TestArithmetics.html
index 35ae3b7..f3e91d4 100644
--- a/webUI/B5500TestArithmetics.html
+++ b/webUI/B5500TestArithmetics.html
@@ -44,6 +44,9 @@ function getOctal(id) {
var text = e.value; // text of element
var v; // parsed value of element text
+ if (text.search(/\S/) < 0) {
+ text = "0";
+ }
if (text.search(/[-+eE.]/) < 0) {
v = parseInt(text, 8);
} else {
@@ -123,14 +126,17 @@ function reg_onChange(ev) {
return result;
}
-function testIt(index) {
+function stepIt() {
/* Simple test driver for the Processor arithmetic ops */
var opcode = 0x02D; // NOOP (XX55) by default
+ var opList = document.getElementById("OpList")
var text;
var title;
var value;
-
- cc.P1.X = cc.P1.I = 0;
+
+ title = opList.options[opList.selectedIndex].text
+ value = opList.options[opList.selectedIndex].value;
+ opcode = parseInt(value, 8);
value = getOctal("AReg");
if (!isNaN(value)) {
@@ -143,34 +149,10 @@ function testIt(index) {
cc.P1.BROF = 1;
setText("BRegOrig", value.toString(8));
- switch(index) {
- case 1:
- title = "Add";
- opcode = 0x041; // ADD (0101)
- break;
- case 2:
- title = "Subtract";
- opcode = 0x0C1; // SUB (0301)
- break;
- case 3:
- title = "Multiply";
- opcode = 0x101; // MUL (0401)
- break;
- case 4:
- title = "Divide";
- opcode = 0x201; // DIV (1001)
- break;
- case 5:
- title = "Integer Divide";
- opcode = 0x601; // IDV (3001)
- break;
- case 6:
- title = "Remainder Divide";
- opcode = 0xE01; // RDV (7001)
- break;
- }
-
cc.P1.I = 0; // reset any interrupts
+ cc.IAR = 0;
+
+ cc.P1.X = 0;
cc.P1.T = opcode;
cc.P1.step();
@@ -259,12 +241,33 @@ window.onload = function() {
+
+
+Syllable:
+
+
+