1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-04-27 20:49:07 +00:00

Commit DCMCP transcription as of 2012-07-07; integrate Nigel's

Processor module work to date; revert B5500Console.html back to r47 
(removing the test harness stuff) and link ProcessorPanel window to 
Power On button click.
This commit is contained in:
paul
2012-07-07 16:01:29 +00:00
parent 7a25b2cfc6
commit 25c20235d2
3 changed files with 195 additions and 39 deletions

View File

@@ -5947,3 +5947,82 @@ DS:=CHR; %890-07003900
SI:=SRCE)); %890-07003910
DI:=TABLE; DI:=DI+3; %POINT TO QMRK %890-07003920
END CONVERT; %890-07003950
PROCEDURE COM23;% 07004000
BEGIN% 07005000
REAL INBUFF,% ADDRESS OF THE INPUT BUFFER. 07006000
OUTBUFF,% " " " OUTPUT BUFFER. 07006010
FIRSTCARD,% " " " CARD IMAGE OF THE FIRST CARD 07006020
OUTBUFFOLD,% " " " LAST OUTPUT BUFFER. 07006030
RESERVE,% " " 30 WDS OF CORE USED TO BUILD THE 07006040
T,T1,T2,% TEMPORARY VARIABLES. 07006050
R,L,N,% " " USED TO COUNT CARD IMAG 07006060
Q,% USUALLY INDICATES COL 1 HAS A QUESTION MARK 07006070
IU,% UNIT NUMBER OF THE INPUT UNIT. 07006080
OU,% " " " " OUTPUT UNIT. 07006090
FIRST,% TRUE IF THE FIRST CARD OF A DECK. 07006100
S,% USED AS A TEMPROARY VARIABLE IN SUBROUTINE 07006140
% AND TO HAND THE UNIT NUMBER TO SUBROUTINE S 07006150
D;% USED AS A MASK TO SLEEP UNTIL DISK OPERATIO 07006160
% ARE COMPLETED. 07006161
$ SET OMIT = NOT(PACKETS) 07006169
REAL VERYFIRST, %TRUE IF THE FIRST CARD OF THE FIRST DECK 07006172
%IN SINCE LOAD CONTROL WAS EXECUTED. 07006174
FIRSTORSEC, %TRUE IF THE FIRST OR SEC. CARD OF NEW DECK 07006176
PTYPE,% CONTAINS THE RESULT OF REAL SUBROUTINE 07006180
% PACKETCARD.SAVING SOME NEEDLESS EXTRA 07006190
% CALLS ON IT TO CHECK THE TYPE OF A CARD. 07006200
% THE VALUE OF PTYPE IS AS FOLLOWS: 07006210
% 0 = NOT A PACKET CONTROL CARD 07006220
% 1 = "PACKEND"CARD, (USED BY THE 07006230
% OPERATORS TO END A GROUP 07006240
% OF PACKETS BEING LOADED TO 07006250
% DISK) 07006260
% 3 = "PACKET" CARD,(FIRST CARD 07006270
% OF A PACKET) 07006280
% 5 = "END PACKETS" CARD, (USED BY 07006290
% THE OPERATORS TO BOTH END 07006300
% A GROUP OF PACKETS AND 07006310
% SIMULTANEOUSLY DISCONTINUE 07006320
% LOAD CONTROL). 07006330
PLUGGED;% TRUE IF THE LAST "PACKET" CARD(I.E., 07006340
% PTYPE=3), WAS BOTH THE START OF A NEW 07006350
% PACKET AND WAS USED TO "PLUG" THE END 07006360
% OF THE LAST PACKET WITH AN ARTIFICIAL 07006370
% "-QUESTION MARK- PACKET." CARD; 07007000
$ POP OMIT 07007001
BOOLEAN CDONLY; 07007100
INTEGER A,I;% 07008000
$ SET OMIT = NOT(PACKETS) 07008199
REAL CONTINUE,DISKCHAIN,ADECK; LABEL OK; 07008200
$ POP OMIT 07008251
LABEL AGAIN,INL,ERROR,SUPER,BOMB,SKIPIT,EXIT; 07009000
LABEL INPUTL; 07009100
BOOLEAN EBCDIC; REAL EBTABLEADR; %890-07009200
ARRAY FPB[*],H[*];% 07010000
SUBROUTINE STOP;% 07011000
BEGIN IF S ! 18 THEN% 07012000
BEGIN READY ~ NOT(Q ~ TWO(S)) AND READY;% 07013000
RRRMECH ~ NOT Q AND RRRMECH OR Q AND SAVEWORD;% 07014000
LABELTABLE[S] ~ @114;% 07015000
RDCTABLE[S] ~ MULTITABLE[S] ~ 0% 07016000
END;% 07017000
FPB[T+1]~ *P(DUP)+CLOCK+P(RTR);% 07018000
FPB[T].[24:12] ~ TINU[S].[18:12];% 07019000
TINU[S].[18:12]:=0; 07020000
END;% 07021000
$ SET OMIT = PACKETS 07021999
$ SET OMIT = NOT(PACKETS) 07022099
SUBROUTINE FORGETONE; 07022100
$ POP OMIT 07022101
BEGIN T1 ~ H[9]+9;% 07023000
FOR T2 ~ 10 STEP 1 UNTIL T1 DO% 07024000
FORGETUSERDISK(H[T2],-H[8]); 07025000
END;% 07026000
$ SET OMIT = NOT(PACKETS) 07026099
SUBROUTINE FORGETIT; 07026100
BEGIN FORGETONE; 07026200
WHILE DISKCHAIN NEQ 0 DO 07026300
BEGIN DISKWAIT(-(H INX 0),30,DISKCHAIN); 07026400
DISKCHAIN:=H[6].[FF]; 07026500
FORGETONE; 07026600
END; 07026700

View File

@@ -8,6 +8,7 @@
* Instance variables in all caps generally refer to register or flip-flop (FF)
* entities in the processor hardware. See the Burroughs B5500 Reference Manual
* (1021326, May 1967) for details.
* http://bitsavers.org/pdf/burroughs/B5000_5500_5700/1021326_B5500_RefMan_May67.pdf
*
* B5500 word format: 48 bits plus (hidden) parity.
* Bit 0 is high-order, bit 47 is low-order, big-endian character ordering.
@@ -917,6 +918,9 @@ B5500Processor.prototype.run = function() {
var t1;
var t2;
var variant;
var flagBit; // bit 0 indicates operand(off) or control word/descriptor(on).
var aLo,aHi,bLo,bHi; // upper/lower pieces of a word for bitwise operators.
var w32 = B5500CentralControl.pow2[32]; // 32-bit boundary constant for bitwise operators.
do {
this.Q = 0;
@@ -968,6 +972,8 @@ B5500Processor.prototype.run = function() {
case 0x11: // XX11: control state ops
switch (variant) {
case 0x14: // 2411: ZPI=Conditional Halt
// TODO: this needs to test for the STOP OPERATOR switch
// TODO: on the maintenance panel otherwise it is a NOP.
break;
case 0x18: // 3011: SFI=Store for Interrupt
@@ -1278,21 +1284,60 @@ B5500Processor.prototype.run = function() {
case 0x0D: // XX15: logical (bitmask) ops
switch (variant) {
case 0x01: // 0115: LNG=logical negate
// assert(this.AROF == 1);
flagBit = cc.bit(this.A, 0); // save flag bit
aHi = this.A / w32;
aLo = this.A % w32;
this.A = (~aHi) * w32 + (~aLo); // negate as two chunks
this.A = cc.fieldInsert(this.A, 0, 1, flagBit); // restore flag bit
this.AROF == 1;
break;
case 0x02: // 0215: LOR=logical OR
case 0x02: // 0215: LOR=logical OR
// assert(this.AROF == 1 && this.BROF == 1);
flagBit = cc.bit(this.B, 0); // save B flag bit
aHi = this.A / w32;
aLo = this.A % w32;
bHi = this.B / w32;
bLo = this.B % w32;
this.A = (aHi | bHi) * w32 + (aLo | bLo);
this.A = cc.fieldInsert(this.A, 0, 1, flagBit); // restore flag bit to A
this.AROF = 1;
this.BROF = 0;
break;
case 0x04: // 0415: LND=logical AND
// assert(this.AROF == 1 && this.BROF == 1);
flagBit = cc.bit(this.B, 0); // save flag bit
aHi = this.A / w32;
aLo = this.A % w32;
bHi = this.B / w32;
bLo = this.B % w32;
this.A = (aHi & bHi) * w32 + (aLo & bLo);
this.A = cc.fieldInsert(this.A, 0, 1, flagBit); // restore flag bit to A
this.AROF = 1;
this.BROF = 0;
break;
case 0x08: // 1015: LQV=logical EQV
// assert(this.AROF == 1 && this.BROF == 1);
flagBit = cc.bit(this.B, 0); // save B flag bit
aHi = this.A / w32;
aLo = this.A % w32;
bHi = this.B / w32;
bLo = this.B % w32;
this.B = (~(aHi ^ bHi)) * w32 + (~(aLo ^ bLo));
this.B = cc.fieldInsert(this.B, 0, 1, flagBit); // restore B flag bit
this.AROF = 0;
this.BROF = 1;
break;
case 0x10: // 2015: MOP=reset flag bit (make operand)
this.A = cc.fieldInsert(this.A, 0, 1, 0);
break;
case 0x20: // 4015: MDS=set flag bit (make descriptor)
this.A = cc.fieldInsert(this.A, 0, 1, 1);
break;
}
break;
@@ -1311,6 +1356,13 @@ B5500Processor.prototype.run = function() {
case 0x08: // 1021: SND=Store nondestructive
break;
case 0x09: // 0431: SSN=Set Sign Bit
// the sign-bit is bit 1
// assert(this.AROF == 1);
this.A = cc.fieldInsert(this.A, 1, 1, 1);
this.AROF = 1;
break;
case 0x10: // 2021: LOD=Load operand
break;
@@ -1331,6 +1383,11 @@ B5500Processor.prototype.run = function() {
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;
break;
case 0x08: // 1025: XCH=exchange TOS words
@@ -1351,12 +1408,27 @@ B5500Processor.prototype.run = function() {
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;
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;
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;
break;
case 0x2C: // 5425: CTC=core field to C field
@@ -1376,12 +1448,29 @@ B5500Processor.prototype.run = function() {
break;
case 0x04: // 0431: SSN=set sign bit (set negative)
// assert(this.AROF == 1);
this.A = cc.fieldInsert(this.A, 1, 1, 1);
this.AROF = 1;
break;
case 0x08: // 1031: CHS=change sign bit
// the sign-bit is bit 1
// assert(this.AROF == 1);
if (cc.bit(this.A, 1)) {
this.A = cc.fieldInsert(this.A, 1, 1, 0);
} else {
this.A = cc.fieldInsert(this.A, 1, 1, 1);
}
this.AROF = 1;
break;
case 0x10: // 2031: TOP=test flag bit (test for operand)
if (cc.bit(this.B, 1)) {
this.A = 0;
} else {
this.A = 1;
}
this.AROF = 1;
break;
case 0x11: // 2131: LBC=branch backward word conditional
@@ -1400,6 +1489,10 @@ B5500Processor.prototype.run = function() {
break;
case 0x24: // 4431: SSP=reset sign bit (set positive)
// the sign-bit is bit 1
// assert(this.AROF == 1);
this.A = cc.fieldInsert(this.A, 1, 1, 0);
this.AROF = 1;
break;
case 0x31: // 6131: LBU=branch backward word unconditional
@@ -1412,6 +1505,20 @@ B5500Processor.prototype.run = function() {
break;
case 0x38: // 7031: FBS=stack search for flag
// Handbook (bit numbers not reversed!):
// M + 1, Load A @ M; // why is this incrementing here?
// A48 & A46 <- 1
// A47 <- 0, A[45=>16] <- 0;
// A[15=>1] <- M
// RefMan:
// stack pop? // described as "Pushup into A occurs if necessary..."
// isolate lowest 15-bits of TOS // is this A?
// loop
// examine word at this base address
// if flag bit(0) is true, place address in A, present bit(2) is set, exit loop
// else increment address
// end loop
this.AROF = 1;
break;
}
break;

View File

@@ -6,44 +6,12 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<link id=defaultStyleSheet rel=stylesheet type="text/css" href="B5500DistributionAndDisplay.css">
<script src="../emulator/B5500SystemConfiguration.js"></script>
<script src="../emulator/B5500CentralControl.js"></script>
<script src="../emulator/B5500Processor.js"></script>
<script>
"use strict";
var cc;
function stackIt(e) {
/* Simple test driver for the Processor module */
cc.powerOn();
cc.clear();
e.style.backgroundColor = "white"; // a kludge, for now
cc.MemMod[0][0x10] = 0x00400C215415;// LITC 1, LITC 3, XCH, DUP
cc.P1.S = 0x100; // stack at @400
cc.P1.R = 0x005; // PRT at @500 (R has addr div 64)
cc.P1.C = 0x10; // execute from address @20
cc.P1.access(0x30); // P = [C]
cc.P1.T = cc.fieldIsolate(cc.P1.P, 0, 12);
cc.P1.TROF = 1;
cc.P1.L = 1; // point to the next instruction
cc.P1.step();
cc.P1.step();
cc.P1.step();
cc.P1.step();
}
window.onload = function() {
cc = new B5500CentralControl();
// window.open("B5500ProcessorPanel.html", "PAPanel", "resizable=yes,scrollbars=yes");
}
PowerOnBtn_Click = function() {
document.getElementById("PowerOnBtn").style.backgroundColor = "white";
window.open("B5500ProcessorPanel.html", "PAPanel", "resizable=yes,scrollbars=yes");
return true;
};
</script>
</head>
@@ -81,7 +49,7 @@ window.onload = function() {
<span class=buttonCaption>B CONTROL</span>
</div>
<div id=PowerOnBtn class=whiteButton style="right:300px" onclick="stackIt(this)">
<div id=PowerOnBtn class=whiteButton style="right:300px" onclick="return PowerOnBtn_Click()">
<span class=buttonCaption>POWER ON</span>
</div>
<div id=PowerOffBtn class=blackButton style="right:225px">
@@ -95,5 +63,7 @@ window.onload = function() {
</div>
<p>(Click the Power On button)</p>
</body>
</html>