mirror of
https://github.com/pkimpel/retro-b5500.git
synced 2026-02-11 10:55:09 +00:00
Commit DCMCP transcription as of 2012-12-13; add BCLANSI translation in B5500IOUnit and improve group-mark processing.
This commit is contained in:
@@ -17403,3 +17403,117 @@ M[OPTN INX 5]~M[OPTN INX 2].[6:42]; M[OPTN INX 2]~M[OPTN INX 6]~0; 20511550
|
||||
$ SET OMIT = PACKETS 20511729
|
||||
EXYT: 20511800
|
||||
END SECURITYMAINT; 20511810
|
||||
COMMENT THE PRT CELL "SHEET" GIVES DISK ADDRESS OF 1ST SHEET ENTRY 20512000
|
||||
*** ENTRIES IN THE SHEET ARE AS FOLLOWS: 20512400
|
||||
S[ 0] = 1ST NAME (7 CHRS) 20512800
|
||||
.[ 2:1 ] = "CANDE" JOB (TSS ONLY) 20513200
|
||||
S[ 1] = 2ND NAME (7 CHRS) 20513600
|
||||
S[ 2].[ 1: 2] = 0 NORMAL 20514000
|
||||
2 JOB HAS BEEN XS-ED (FORCED RUN) 20514400
|
||||
3 JOB HAS BEEN ES-ED (FORCED RUN AND DS) 20514800
|
||||
S[ 3].[ 4:1 ] = SUPPRESS BOJ/EOJ MESSAGES FOR SYSTEM JOBS 20515200
|
||||
S[ 2].[ 5:3 ] = 0 NORMAL, 1 LIBMAIN, 3 LDCNTRL, 5 PRNPBT 20515400
|
||||
S[ 2].[ 8:10] = 0 GO JOB (FROM COMPILE & GO) 20515600
|
||||
= 1 COMPILER (FOR COMPILE & GO) 20516000
|
||||
= 2 EXECUTE JOB 20516400
|
||||
= 3 COMPILER (FOR SYNTAX CHECK)(SET TO 2 LATER) 20516800
|
||||
= 4 COMPILER (FOR COMPILE TO LIBRARY) 20517200
|
||||
= 5 RUN JOB 20517600
|
||||
S[ 2].[18:15] = SKELETONS DISK ADDRESS (IF S[2].[8:10] = 1,2,4 20518000
|
||||
S[ 2].[33:15] = PRIORITY, SAME AS S[18] 20518400
|
||||
S[ 3].[ 1:1 ] = SET BY SELECTRUN WHEN "SCHEDULED" MESSAGE 20518800
|
||||
IS SENT (IF SCHEDULED) 20519200
|
||||
S[ 3].[ 2: 1] = 1 RESTART JOB 20519600
|
||||
S[ 3].[ 8:10] = SCHEDULE-ID FOR THIS JOB 20520000
|
||||
S[ 5] = STARTING TIME FOR LOG 20520400
|
||||
S[ 6] = LOCATION OF LAST PART OF LOG 20520800
|
||||
S[ 7] = CORE ADDRESS OF SEGMENT ZERO (WHEN THE 20521200
|
||||
SHEET IS PASSED TO SELECTRUN AS A PARAMETER) 20521600
|
||||
S[13] = DISK ADDRESS OF LABEL EQUATION ENTRIES 20522000
|
||||
APPLICABLE TO THIS EXECUTION ONLY (SEE BELOW) 20522400
|
||||
S[14] = ACTUAL MFID OF JOB (TSS ONLY). THIS MAY BE 20522800
|
||||
BE DIFFERENT FROM S[0] FOR SOME JOBS 20523200
|
||||
WHICH ARE STARTED BY CANDE. 20523600
|
||||
S[15] = DISK ADDRESS OF LABEL EQUATION ENTRIES 20524000
|
||||
PRESENTED WHEN PROGRAM WAS COMPILED AND 20524400
|
||||
APPLICABLE TO ALL EXECUTIONS 20524800
|
||||
S[16] = ESTIMATED PROCESSOR TIME 20525200
|
||||
S[17] = ESTIMATED I/O TIME 20525600
|
||||
S[18] = PRIORITY 20526000
|
||||
S[19] = COMMON VALUE 20526400
|
||||
S[20] = ESTIMATED CORE REQUIREMENTS 20526800
|
||||
S[20].[ 2:1 ] = "CAN-T EXPAND" BIT (TSS) 20527200
|
||||
.[33:15] = ESTIMATED CORE REQUIREMENT 20527600
|
||||
S[21] = STACK SIZE 20528000
|
||||
S[22] = SAVE FACTOR FOR OBJECT FILE (COMPILATIONS) 20528400
|
||||
S[23].[2:6] = UNITNO OF CARD/PSEUDO READER IN CONTROLCARD. 20528800
|
||||
S[23].[9:9] = REMOTE STATION ADDRESS, ELSE 0 20529200
|
||||
S[23].[24:24] = TIME JOB PUT IN SHEET(FOR TS MSG) 20529600
|
||||
S[24] = USER CODE 20530000
|
||||
S[25] = DISK ADDRESS OF FILE HEADER FOR THE JOB 20530400
|
||||
S[26] = LOGLINE (TSS) 20530800
|
||||
S[27] = FID FOR COMPILES,TAPE NAME FOR LIBMAIN. 20531200
|
||||
S[29] = DISK ADDRESS OF NEXT SHEET ENTRY (=0 IF LAST) 20531600
|
||||
*** ENTRIES FOR LABEL EQAT. ARE AS FOLLOWS: 20532000
|
||||
F[0] = MULTI-FILE ID (7 CHRS) 20532400
|
||||
F[1] = FILE ID (7 CHRS) 20532800
|
||||
F[2].[0:18] = REEL NO (3 CHRS) 20533200
|
||||
F[2].[18:30] = CREATION DATE (5 CHRS) 20533600
|
||||
F[3].[0:6] = CYCLE (1 CHR) 20534000
|
||||
F[3].[15:8] = NUM COPIES OF PBD OR PUD FILE 20534400
|
||||
F[3].[23:1] = 1, IF "FREEF" PDB PACKET FILE 20534800
|
||||
F[3].[42:1] = 1 FOR FORMS REQUIRED 20535200
|
||||
F[3].[43:5] = 0 FOR CP (FILE TYPES ) 20535600
|
||||
1 FOR LP 20536000
|
||||
2 FOR MT 20536400
|
||||
3 FOR SPECIFIC UNIT 20536800
|
||||
4 FOR LP (MAY BACKUP) 20537200
|
||||
5 FOR SPECIFIC (UNLABELED) 20537600
|
||||
6 FOR LP (MUST BACKUP) 20538000
|
||||
7 FOR PT 20538400
|
||||
8 FOR PT (UNLABELED) 20538800
|
||||
9 FOR MT (UNLABELED) 20539200
|
||||
10 FOR DISK 20539600
|
||||
F[4].[0:6] = NO OF CHARS IN INTERNAL NAME 20540000
|
||||
F[4].[6:42] = INTERNAL NAME (MAY CONTINUE TO F[11]) 20540400
|
||||
F[12].[15:1] = "SENSITIVE" BIT 20540800
|
||||
F[12].[16:2] = DISK SPEED 20541200
|
||||
F[12].[18:5] = EU NUMBER + 1 20541600
|
||||
F[14]- F[25] SAME AS ABOVE FOR NEXT FILE (F[14]=14 IF NO NEXT)20542000
|
||||
F[29] = DISK ADRS.OF NXT.LBL.EQUAT.ENTRY(=0 IF NONE) 20542400
|
||||
**** ALSO SEE PROCEDURE "SELECTRUN1" (SEQ.NO.20055600) FOR 20542800
|
||||
**** FURTHER INFORMATION ON LABEL EQUATION AND THE FILE 20543200
|
||||
**** PARAMETER BLOCK. 20543600
|
||||
20544000
|
||||
**** CONTENTS OF THE JAR: 20544400
|
||||
JAR[0].[ 1:1 ] = COMPILE JOB 20544800
|
||||
.[ 2:1 ] = "CANDE" JOB (TSS ONLY) 20545200
|
||||
.[ 6:42] = MFID OF THE JOB 20545600
|
||||
JAR[1].[ 1:1 ] = JOB IS BEING DS-ED 20546000
|
||||
.[ 2:1 ] = JOB IS BEING ES-ED 20546400
|
||||
.[ 6:42] = FID OF THE JOB 20546800
|
||||
JAR[2].[ 1:1 ] = COBOL JOB 20547200
|
||||
.[ 2:1 ] = DECLARED SOFTWARD INTERRUPTS 20547600
|
||||
.[ 3:1 ] = JOB HAS MAINTENANCE LOG ENTRY 20548000
|
||||
.[ 4:1 ] = NOT USED 20548400
|
||||
.[ 5:1 ] = DECLARED SOFTWARE INTERRUPTS 20548800
|
||||
.[ 6:1 ] = INVOKED OR INVOKING IPC PROG.FILE 20549200
|
||||
.[ 7:1 ] = INVOKED IPC PROGRAM FILE 20549600
|
||||
.[ 6:10] = SAME AS S[2].[8:10] ABOVE 20550000
|
||||
.[18:15] = DISK ADDRESS FOR THE SKELETON SHEET (COMPILATIONS20550400
|
||||
.[33:15] = PRIORITY 20550800
|
||||
JAR[3] = PROCESS TIME LIMIT 20551200
|
||||
JAR[4] = IO TIME LIMIT 20551600
|
||||
JAR[5].[ 1:23] = STARTING DATE (OCTAL) 20552000
|
||||
.[24:24] = STARTING TIME (OCTAL) 20552400
|
||||
JAR[6].[ 1:1 ] = JOB IS SD-ED 20552800
|
||||
.[ 2:4 ] = PSEUDO-READER NUMBER 20553200
|
||||
.[18:15] = SIZE OF LOG INFORMATION (BATCH) 20553600
|
||||
.[33:15] = DISK ADDRESS OF FIRST RECORD FOR THE LOG 20554000
|
||||
JAR[7] = IDLETIME ENTRY (BATCH) 20554400
|
||||
JAR[7] = MFID OF JOB (TSS ONLY). THIS MAY BE DIFFERENT 20554800
|
||||
FROM JAR[0] FOR SOME JOBS STARTED BY CANDE. 20555200
|
||||
JAR[8] = LENGTH OF CODE FILE ROW 20555600
|
||||
JAR[9].[ 1:1 ] = REEL CHANGE IN PROGRESS DUE TO "RC" MESSAGE 20556000
|
||||
.[ 2:1 ] = SUPPRESS PRINTING OF BOJ/EOJ MESSAGES 20556400
|
||||
.[ 3:1 ] = JOB HAS BEEN "STOPPED" (WORKSET ON BATCH) 20556410
|
||||
|
||||
@@ -79,6 +79,16 @@ B5500IOUnit.BICtoANSI = [ // Index by 6-bit BIC to get 8-bit ANSI
|
||||
"Q", "R", "$", "*", "-", ")", ";", "{", // 28-2F, @50-57
|
||||
" ", "/", "S", "T", "U", "V", "W", "X", // 30-37, @60-67
|
||||
"Y", "Z", ",", "%", "!", "=", "]", "\""]; // 38-3F, @70-77
|
||||
|
||||
B5500IOUnit.BICtoBCLANSI = [ // Index by 6-bit BIC to get 8-bit BCL-as-ANSI code
|
||||
"#", "1", "2", "3", "4", "5", "6", "7", // 00-07, @00-07
|
||||
"8", "9", "@", "?", "0", ":", ">", "}", // 08-1F, @10-17
|
||||
",", "/", "S", "T", "U", "V", "W", "X", // 10-17, @20-27
|
||||
"Y", "Z", "%", "!", " ", "=", "]", "\"", // 18-1F, @30-37
|
||||
"$", "J", "K", "L", "M", "N", "O", "P", // 20-27, @40-47
|
||||
"Q", "R", "*", "-", "|", ")", ";", "{", // 28-2F, @50-57
|
||||
"+", "A", "B", "C", "D", "E", "F", "G", // 30-37, @60-67
|
||||
"H", "I", "[", "&", ".", "(", "<", "~"]; // 38-3F, @70-77
|
||||
|
||||
B5500IOUnit.ANSItoBIC = [ // Index by 8-bit ANSI to get 6-bit BIC (upcased, invalid=>"?")
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 00-0F
|
||||
@@ -97,6 +107,24 @@ B5500IOUnit.ANSItoBIC = [ // Index by 8-bit ANSI to get 6-bit BIC
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // D0-DF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // E0-EF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C]; // F0-FF
|
||||
|
||||
B5500IOUnit.BCLANSItoBIC = [ // Index by 8-bit BCL-as-ANSI to get 6-bit BIC (upcased, invalid=>"?")
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 00-0F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 10-1F
|
||||
0x1C,0x1B,0x1F,0x00,0x20,0x1A,0x3B,0x0C,0x3D,0x2D,0x2A,0x30,0x10,0x2B,0x3C,0x11, // 20-2F
|
||||
0x0C,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0D,0x2E,0x3E,0x1D,0x0E,0x0B, // 30-3F
|
||||
0x0A,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x21,0x22,0x23,0x24,0x25,0x26, // 40-4F
|
||||
0x27,0x28,0x29,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x3A,0x0C,0x1E,0x0C,0x0C, // 50-5F
|
||||
0x0C,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x21,0x22,0x23,0x24,0x25,0x26, // 60-6F
|
||||
0x27,0x28,0x29,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x2F,0x2C,0x0F,0x3F,0x0C, // 70-7F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 80-8F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 90-9F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // A0-AF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // B0-BF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // C0-CF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // D0-DF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // E0-EF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C]; // F0-FF
|
||||
|
||||
/**************************************/
|
||||
B5500IOUnit.prototype.clear = function() {
|
||||
@@ -187,8 +215,10 @@ B5500IOUnit.prototype.fetch = function(addr) {
|
||||
|
||||
this.cycleCount += B5500IOUnit.memCycles;
|
||||
if (acc.MAED) {
|
||||
this.D26F = 1; // set memory address error
|
||||
return 1;
|
||||
} else if (acc.MPED) {
|
||||
this.D29F = 1; // set memory parity error on data transfer
|
||||
return 1;
|
||||
} else {
|
||||
return 0; // no error
|
||||
@@ -207,6 +237,7 @@ B5500IOUnit.prototype.store = function(addr) {
|
||||
|
||||
this.cycleCount += B5500IOUnit.memCycles;
|
||||
if (acc.MAED) {
|
||||
this.D26F = 1; // set memory address error
|
||||
return 1;
|
||||
} else {
|
||||
return 0; // no error
|
||||
@@ -216,9 +247,8 @@ B5500IOUnit.prototype.store = function(addr) {
|
||||
/**************************************/
|
||||
B5500IOUnit.prototype.fetchBuffer = function(mode, words) {
|
||||
/* Fetches words from memory starting at this.Daddress and coverts the
|
||||
BIC characters to ANSI in this.buffer. "mode": 0=alpha, 1=binary;
|
||||
"words": maximum number of words to transfer. In alpha mode, the transfer
|
||||
can be terminated by a group-mark code in memory. At exit, updates this.Daddress
|
||||
BIC characters to ANSI or BCLANSI in this.buffer. "mode": 0=BCLANSI, 1=ANSI;
|
||||
"words": maximum number of words to transfer. At exit, updates this.Daddress
|
||||
with the final transfer address+1. If this.D23F, updates this.wordCount
|
||||
with any remaining count.
|
||||
Returns the number of characters fetched into the buffer */
|
||||
@@ -229,6 +259,7 @@ B5500IOUnit.prototype.fetchBuffer = function(mode, words) {
|
||||
var done = false; // loop control
|
||||
var overflow = false; // memory address overflowed max
|
||||
var s; // character shift counter
|
||||
var table = (mode ? B5500IOUnit.BICtoANSI : B5500IOUnit.BICtoBCLANSI);
|
||||
var w; // local copy of this.W
|
||||
|
||||
do { // loop through the words
|
||||
@@ -237,26 +268,70 @@ B5500IOUnit.prototype.fetchBuffer = function(mode, words) {
|
||||
} else {
|
||||
words--;
|
||||
if (overflow) {
|
||||
this.AOFF = 1; // for display onlly
|
||||
this.AOFF = 1; // for display only
|
||||
this.D26F = 1; // address overflow: set invalid address error
|
||||
done = true;
|
||||
} else if (this.fetch(addr)) { // fetch the next word from memory
|
||||
if (this.accessor.MAED) {
|
||||
this.D26F = 1; // set invalid address error
|
||||
}
|
||||
if (this.accessor.MPED) {
|
||||
this.D29F = 1; // set memory parity error
|
||||
}
|
||||
} else { // fill the buffer with this word's characters
|
||||
w = this.W;
|
||||
} else if (!this.fetch(addr)) { // fetch the next word from memory
|
||||
w = this.W; // fill the buffer with this word's characters
|
||||
for (s=0; s<8; s++) {
|
||||
c = (w - (w %= 0x40000000000))/0x40000000000;
|
||||
if (mode || c != 0x1F) { // if binary mode or not a group-mark
|
||||
buf[count++] = B5500IOUnit.BICtoANSI[c];
|
||||
w *= 64; // shift word left 6 bits
|
||||
} else {
|
||||
done = true; // group-mark detected in alpha mode
|
||||
buf[count++] = table[c];
|
||||
w *= 64; // shift word left 6 bits
|
||||
} // for s
|
||||
}
|
||||
if (addr < 0x7FFF) {
|
||||
addr++;
|
||||
} else {
|
||||
overflow = true;
|
||||
}
|
||||
}
|
||||
} while (!done);
|
||||
|
||||
this.Daddress = addr;
|
||||
if (this.D23F) {
|
||||
this.DwordCount = words % 0x1FF;
|
||||
}
|
||||
return count;
|
||||
};
|
||||
|
||||
/**************************************/
|
||||
B5500IOUnit.prototype.fetchBufferWithGM = function(mode, words) {
|
||||
/* Fetches words from memory starting at this.Daddress and coverts the
|
||||
BIC characters to ANSI or BCLANSI in this.buffer. "mode": 0=BCLANSI, 1=ANSI;
|
||||
"words": maximum number of words to transfer. The transfer can be terminated
|
||||
by a group-mark code in memory. At exit, updates this.Daddress with the
|
||||
final transfer address+1. If this.D23F, updates this.wordCount
|
||||
with any remaining count.
|
||||
Returns the number of characters fetched into the buffer */
|
||||
var addr = this.Daddress; // local copy of memory address
|
||||
var buf = this.buffer; // local pointer to buffer
|
||||
var c; // current character code
|
||||
var count = 0; // number of characters fetched
|
||||
var done = false; // loop control
|
||||
var overflow = false; // memory address overflowed max
|
||||
var s; // character shift counter
|
||||
var table = (mode ? B5500IOUnit.BICtoANSI : B5500IOUnit.BICtoBCLANSI);
|
||||
var w; // local copy of this.W
|
||||
|
||||
do { // loop through the words
|
||||
if (words <= 0) {
|
||||
done = true;
|
||||
} else {
|
||||
words--;
|
||||
if (overflow) {
|
||||
this.AOFF = 1; // for display only
|
||||
this.D26F = 1; // address overflow: set invalid address error
|
||||
done = true;
|
||||
} else if (!this.fetch(addr)) { // fetch the next word from memory
|
||||
w = this.W; // fill the buffer with this word's characters
|
||||
for (s=0; s<8; s++) {
|
||||
c = (w - (w %= 0x40000000000))/0x40000000000;
|
||||
if (c == 0x1F) {
|
||||
done = true; // group-mark detected
|
||||
break;
|
||||
} else {
|
||||
buf[count++] = table[c];
|
||||
w *= 64; // shift word left 6 bits
|
||||
}
|
||||
} // for s
|
||||
}
|
||||
@@ -277,13 +352,11 @@ B5500IOUnit.prototype.fetchBuffer = function(mode, words) {
|
||||
|
||||
/**************************************/
|
||||
B5500IOUnit.prototype.storeBuffer = function(chars, offset, mode, words) {
|
||||
/* Converts characters in this.buffer from ANSI to BIC, assembles them into
|
||||
words, and stores the words into memory starting at this.Daddress.
|
||||
BIC characters to ANSI in this.buffer. "chars": the number of characters to
|
||||
stort, starting at "offset" in the buffer; "mode": 0=alpha, 1=binary;
|
||||
"words": maximum number of words to transfer. In alpha mode, the final character
|
||||
stored from the buffer is followed by a group-mark, assuming the word count is
|
||||
not exhausted. At exit, updates this.Daddress with the final transfer address+1.
|
||||
/* Converts characters in this.buffer from ANSI or BCLANSI to BIC, assembles
|
||||
them into words, and stores the words into memory starting at this.Daddress.
|
||||
"chars": the number of characters to store, starting at "offset" in the buffer;
|
||||
"mode": 0=BCLANSI, 1=ANSI; "words": maximum number of words to transfer.
|
||||
At exit, updates this.Daddress with the final transfer address+1.
|
||||
If this.D23F, updates this.wordCount with any remaining count.
|
||||
Returns the number of characters stored into memory from the buffer */
|
||||
var addr = this.Daddress; // local copy of memory address
|
||||
@@ -293,33 +366,107 @@ B5500IOUnit.prototype.storeBuffer = function(chars, offset, mode, words) {
|
||||
var done = (words > 0); // loop control
|
||||
var overflow = false; // memory address overflowed max
|
||||
var power = 0x40000000000; // factor for character shifting into a word
|
||||
var s = 8; // character shift counter
|
||||
var s = 0; // character shift counter
|
||||
var table = (mode ? B5500IOUnit.BICtoANSI : B5500IOUnit.BICtoBCLANSI);
|
||||
var w = 0; // local copy of this.W
|
||||
|
||||
while (!done) { // loop through the words
|
||||
while (!done) { // loop through the words
|
||||
if (count >= chars) {
|
||||
done = true;
|
||||
} else {
|
||||
c = B5500IOUnit.ANSItoBIC[buf[offset+(count++)]];
|
||||
c = table[buf[offset+(count++)]];
|
||||
w += c*power;
|
||||
power /= 64;
|
||||
if (--s <= 0) {
|
||||
if (++s > 7) {
|
||||
this.W = w;
|
||||
if (overflow) {
|
||||
this.AOFF = 1; // for display only
|
||||
this.D26F = 1; // address overflow: set invalid address error
|
||||
done = true;
|
||||
} else if (this.store(addr)) { // store the word in memory
|
||||
if (this.accessor.MAED) {
|
||||
this.D26F = 1; // set invalid address error
|
||||
}
|
||||
} else {
|
||||
this.store(addr); // store the word in memory
|
||||
}
|
||||
if (addr < 0x7FFF) {
|
||||
addr++;
|
||||
} else {
|
||||
overflow = true;
|
||||
}
|
||||
s = 8;
|
||||
w = 0;
|
||||
w = s = 0;
|
||||
power = 0x40000000000;
|
||||
if (--words <= 0) {
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // while !done
|
||||
|
||||
if (s > 0 && words > 0) { // partial word left to be stored
|
||||
this.W = w;
|
||||
if (overflow) {
|
||||
this.AOFF = 1; // for display only
|
||||
this.D26F = 1; // address overflow: set invalid address error
|
||||
done = true;
|
||||
} else {
|
||||
this.store(addr); // store the word in memory
|
||||
}
|
||||
words--;
|
||||
if (addr < 0x7FFF) {
|
||||
addr++;
|
||||
}
|
||||
}
|
||||
|
||||
this.Daddress = addr;
|
||||
if (this.D23F) {
|
||||
this.DwordCount = words % 0x1FF;
|
||||
}
|
||||
return count;
|
||||
};
|
||||
|
||||
/**************************************/
|
||||
B5500IOUnit.prototype.storeBufferWithGM = function(chars, offset, mode, words) {
|
||||
/* Converts characters in this.buffer from ANSI to BIC, assembles them into
|
||||
words, and stores the words into memory starting at this.Daddress.
|
||||
"chars": the number of characters to store, starting at "offset" in the buffer;
|
||||
"mode": 0=BCLANSI, 1=ANSI; "words": maximum number of words to transfer.
|
||||
The final character stored from the buffer is followed in memory by a group-mark,
|
||||
assuming the word count is not exhausted. At exit, updates this.Daddress with the
|
||||
final transfer address+1.
|
||||
If this.D23F, updates this.wordCount with any remaining count.
|
||||
Returns the number of characters stored into memory from the buffer, plus one
|
||||
for the group-mark */
|
||||
var addr = this.Daddress; // local copy of memory address
|
||||
var buf = this.buffer; // local pointer to buffer
|
||||
var c; // current character code
|
||||
var count = 0; // number of characters fetched
|
||||
var done = (words > 0); // loop control
|
||||
var overflow = false; // memory address overflowed max
|
||||
var power = 0x40000000000; // factor for character shifting into a word
|
||||
var s = 0; // character shift counter
|
||||
var table = (mode ? B5500IOUnit.BICtoANSI : B5500IOUnit.BICtoBCLANSI);
|
||||
var w = 0; // local copy of this.W
|
||||
|
||||
while (!done) { // loop through the words
|
||||
if (count >= chars) {
|
||||
done = true;
|
||||
} else {
|
||||
c = table[buf[offset+(count++)]];
|
||||
w += c*power;
|
||||
power /= 64;
|
||||
if (++s > 7) {
|
||||
this.W = w;
|
||||
if (overflow) {
|
||||
this.AOFF = 1; // for display only
|
||||
this.D26F = 1; // address overflow: set invalid address error
|
||||
done = true;
|
||||
} else {
|
||||
this.store(addr); // store the word in memory
|
||||
}
|
||||
if (addr < 0x7FFF) {
|
||||
addr++;
|
||||
} else {
|
||||
overflow = true;
|
||||
}
|
||||
w = s = 0;
|
||||
power = 0x40000000000;
|
||||
if (--words <= 0) {
|
||||
done = true;
|
||||
@@ -330,18 +477,17 @@ B5500IOUnit.prototype.storeBuffer = function(chars, offset, mode, words) {
|
||||
|
||||
if (!mode) { // alpha transfer terminates with a group-mark
|
||||
w += 0x1F*power; // set group mark in register
|
||||
s--;
|
||||
s++;
|
||||
count++;
|
||||
}
|
||||
if (s < 8 && words > 0) { // partial word left to be stored
|
||||
if (s > 0 && words > 0) { // partial word left to be stored
|
||||
this.W = w;
|
||||
if (overflow) {
|
||||
this.AOFF = 1; // for display only
|
||||
this.D26F = 1; // address overflow: set invalid address error
|
||||
done = true;
|
||||
} else if (this.store(addr)) { // store the word in memory
|
||||
if (this.accessor.MAED) {
|
||||
this.D26F = 1; // set invalid address error
|
||||
}
|
||||
} else {
|
||||
this.store(addr); // store the word in memory
|
||||
}
|
||||
words--;
|
||||
if (addr < 0x7FFF) {
|
||||
|
||||
@@ -6,7 +6,7 @@ var d;
|
||||
var x;
|
||||
var y;
|
||||
|
||||
var BICtoANSI = [ // Index by 6-bit BIC to get 8-bit ANSI code
|
||||
BICtoANSI = [ // Index by 6-bit BIC to get 8-bit ANSI code
|
||||
"0", "1", "2", "3", "4", "5", "6", "7", // 00-07, @00-07
|
||||
"8", "9", "#", "@", "?", ":", ">", "}", // 08-1F, @10-17
|
||||
"+", "A", "B", "C", "D", "E", "F", "G", // 10-17, @20-27
|
||||
@@ -15,8 +15,18 @@ var BICtoANSI = [ // Index by 6-bit BIC to get 8-bit ANSI code
|
||||
"Q", "R", "$", "*", "-", ")", ";", "{", // 28-2F, @50-57
|
||||
" ", "/", "S", "T", "U", "V", "W", "X", // 30-37, @60-67
|
||||
"Y", "Z", ",", "%", "!", "=", "]", "\""]; // 38-3F, @70-77
|
||||
|
||||
BICtoBCLANSI = [ // Index by 6-bit BIC to get 8-bit BCL-as-ANSI code
|
||||
"#", "1", "2", "3", "4", "5", "6", "7", // 00-07, @00-07
|
||||
"8", "9", "@", "?", "0", ":", ">", "}", // 08-1F, @10-17
|
||||
",", "/", "S", "T", "U", "V", "W", "X", // 10-17, @20-27
|
||||
"Y", "Z", "%", "!", " ", "=", "]", "\"", // 18-1F, @30-37
|
||||
"$", "J", "K", "L", "M", "N", "O", "P", // 20-27, @40-47
|
||||
"Q", "R", "*", "-", "|", ")", ";", "{", // 28-2F, @50-57
|
||||
"+", "A", "B", "C", "D", "E", "F", "G", // 30-37, @60-67
|
||||
"H", "I", "[", "&", ".", "(", "<", "~"]; // 38-3F, @70-77
|
||||
|
||||
var ANSItoBIC = [ // Index by 8-bit ANSI to get 6-bit BIC (upcased, invalid=>"?")
|
||||
ANSItoBIC = [ // Index by 8-bit ANSI to get 6-bit BIC (upcased, invalid=>"?")
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 00-0F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 10-1F
|
||||
0x30,0x3C,0x3F,0x0A,0x2A,0x3B,0x1C,0x0C,0x1D,0x2D,0x2B,0x10,0x3A,0x2C,0x1A,0x31, // 20-2F
|
||||
@@ -34,6 +44,24 @@ var ANSItoBIC = [ // Index by 8-bit ANSI to get 6-bit BIC (upcased
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // E0-EF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C]; // F0-FF
|
||||
|
||||
BCLANSItoBIC = [ // Index by 8-bit BCL-as-ANSI to get 6-bit BIC (upcased, invalid=>"?")
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 00-0F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 10-1F
|
||||
0x1C,0x1B,0x1F,0x00,0x20,0x1A,0x3B,0x0C,0x3D,0x2D,0x2A,0x30,0x10,0x2B,0x3C,0x11, // 20-2F
|
||||
0x0C,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0D,0x2E,0x3E,0x1D,0x0E,0x0B, // 30-3F
|
||||
0x0A,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x21,0x22,0x23,0x24,0x25,0x26, // 40-4F
|
||||
0x27,0x28,0x29,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x3A,0x0C,0x1E,0x0C,0x0C, // 50-5F
|
||||
0x0C,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x21,0x22,0x23,0x24,0x25,0x26, // 60-6F
|
||||
0x27,0x28,0x29,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x2F,0x2C,0x0F,0x3F,0x0C, // 70-7F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 80-8F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // 90-9F
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // A0-AF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // B0-BF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // C0-CF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // D0-DF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C, // E0-EF
|
||||
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C]; // F0-FF
|
||||
|
||||
function html(c) {
|
||||
switch(c) {
|
||||
case "<": return("<");
|
||||
@@ -68,6 +96,30 @@ for (x=0; x<256; x++) {
|
||||
}
|
||||
}
|
||||
|
||||
document.write("<h3>Test BIC to BCLANSI</h3>");
|
||||
|
||||
for (x=0; x<64; x++) {
|
||||
c = BICtoBCLANSI[x];
|
||||
y = BCLANSItoBIC[c.charCodeAt(0)];
|
||||
document.write("[" + x + "=" + y + "] = " + html(c) + "<br>");
|
||||
if (x != y) {
|
||||
alert("BICtoBCLANSI mismatch: " + x + "!=" + y + ", " + html(c));
|
||||
}
|
||||
}
|
||||
|
||||
document.write("<h3>Test BCLANSI to BIC</h3>");
|
||||
|
||||
for (x=0; x<256; x++) {
|
||||
y = BCLANSItoBIC[x];
|
||||
d = String.fromCharCode(x);
|
||||
c = BICtoBCLANSI[y];
|
||||
y = c.charCodeAt(0);
|
||||
document.write("[" + x + "=" + y + "] : " + html(c) + "=" + html(d) + "<br>");
|
||||
if (y != 63 && c != d.toUpperCase()) {
|
||||
alert("BCLANSItoBIC mismatch: " + x + "!=" + y + ", " + html(c));
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user