1
0
mirror of https://github.com/pkimpel/retro-220.git synced 2026-04-18 00:47:46 +00:00

Checkpoint BALGOL GEN-Assembler development to date; commit miscellaneous typo corrections to BALGOL transcriptions.

This commit is contained in:
Paul Kimpel
2017-12-12 09:33:25 -08:00
parent 6c51a5803b
commit 332a0bed91
6 changed files with 5021 additions and 67 deletions

View File

@@ -16,4 +16,4 @@ The contents of this project are licensed under the [MIT License](http://www.ope
| Burroughs 205/220 blog | http://datatron.blogspot.com |
| Datatron 205 site | http://www.phkimpel.us/ElectroData-205/ |
| Documents at bitsavers | http://bitsavers.org/pdf/burroughs/electrodata/220/ |
| BALGOL compiler listing | http://archive.computerhistory.org/resources/text/Knuth_Don_X4100/PDF_index/k-1-pdf/k-1-u2196-balgol220compiler.pdf |

View File

@@ -177,7 +177,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
171 0119 1 0000 10 1778 -CAD INPUT
172 0120 0 0000 42 0133 LDB SCNCT.1
173 0121 0 0160 21 0126 DBB 40F,160
174 0122 1 0000 49 0002 -SLA 2
174 0122 1 0000 49 0002 -SLA 2
175 0123 0 0000 17 2270 EXT =11=
176 0124 0 0000 36 0117 BZA 3B
177 0125 0 0000 30 0125 CHARACTER BUN CHARACTER
@@ -351,7 +351,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
333 0260 0 0001 26 0265 IFL THEPUNCHLIBRARYBIT/00,1
334 0261 0 0000 44 0350 DO BASICNUMSCAN
0262 0 0000 30 0337
335 0263 0 0000 40 3505 STA 3500+(NUMBEROFWORDS//100)(02)
335 0263 0 0000 40 3505 STA 3500+(NUMBERWORDS//100)(02)
336 0264 0 0000 30 0134 BUN COMMENT
337 THEPUNCHLIBRARYBIT
338 0265 0 0000 00 0000 (0)
@@ -401,7 +401,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
0301 0 0000 30 0376
379 0302 0 0000 30 0134 BUN COMMENT
380 0303 0 0000 00 0004 1 (4)
381 0304 0 0000 17 0045 ((HDNG/100)(04)+(HDNG//100)(64)
381 0304 0 0000 17 0045 ((HDNG/100)(04)+(HDNG//100)(64))
382 0305 0 0000 67 4517 HPI HDNG
383 0306 0 0000 22 0045 (((HDNG+5)/100)(04)+((HDNG+5)//100)(64))
384 0307 4 4523 30 9898 4BUN 9898,(HDNG+6)(44)
@@ -817,7 +817,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
778
779
780 0943 0 0001 45 0000 99 CLA
781 0944 1 0000 12 1677 -AD IA
781 0944 1 0000 12 1677 -ADD IA
782 0945 1 0000 40 1677 -STA IA
783 0946 0 0000 30 0931 BUN 98B
784
@@ -894,7 +894,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
855 1006 0 0000 44 1448 DO W
1007 0 0000 30 1424
856 1008 0 0000 32 1004 BRP $-4
857 1009 0 0000 44 1192 RDSTP RDEX
857 1009 0 0000 44 1192 RD STP RDEX
858 1010 0 0000 30 1184 BUN RDE
859 1011 0 0002 33 1015 BSA RDP,2
860 1012 0 0040 09 2331 SPO R'MISSING NAME CARD'II
@@ -964,7 +964,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
924 1073 0 0103 27 1826 2 DFL RR3/01,3
925
926
927 1074 0 6400 28 1795 NAME2 L/64
927 1074 0 6400 28 1795 NAME2 DLB L/64
928 1075 1 0000 46 0000 -CLL 0
929 1076 0 0000 10 1825 CAD RR2
930 1077 1 2110 40 0000 -STA 0/21
@@ -1035,7 +1035,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
995 1137 0 0000 35 1142 BCE 4F
996 1138 0 0000 34 1142 BCH 4F
997 1139 0 0030 09 2319 SPO R'SEQUENCE ERROR'
998 1140 1 1370 00 7310 HLT 7310,1370(44)
998 1140 0 1370 00 7310 HLT 7310,1370(44)
999 1141 0 0000 30 1140 BUN $-1
1000 1142 0 4400 28 1815 4 DLB READ+8/44
1001 1143 1 0000 10 1816 -CAD READ+9
@@ -1066,7 +1066,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
1026 1166 0 6291 36 1152 BFA 7B/62,91
1027 1167 0 6201 36 1149 BFA 0B/62,01
1028 1168 0 6202 36 1149 BFA 0B/62,02
1029 1169 0 6203 36 1149 BFA 0B/62/03
1029 1169 0 6203 36 1149 BFA 0B/62,03
1030 1170 0 6204 36 1149 BFA 0B/62,04
1031 1171 0 0040 09 2361 SPO R'IMPROPER PSEUDO-OP'I
1032 1172 0 1370 00 7310 HLT 7310,1370(44)
@@ -1455,7 +1455,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
1412 1826 0 0000 00 0000 RR3 (0)
1413 1827 0 1000 00 0000 SCRATCHML (1)(11)
1414 SCRATCHDUMP
1415 1828 0 1010 00 0000 (101)(33)
1415 1828 0 1010 00 0000 (101)(33)
1416
1417
1418 1829 0 0000 00 0000 SYMBOL FILL 0,10
@@ -1474,7 +1474,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
1431 2206 0 9816 77 1776 FILL 98(23)+IA(64)+(IA+99)(04),1
1432 2207 0 9816 77 1777 FILL 98(23)+IA(64)+(IA+100)(04),2
1433 2209 0 9916 77 1777 FILL 99(23)+IA(64)+(IA+100)(04),31
1434 2240 0 9916 77 1776 FILL 98(23)+IA(64)+(IA+99)(04),1
1434 2240 0 9816 77 1776 FILL 98(23)+IA(64)+(IA+99)(04),1
1435
1436 2241 2 4649 67 0000 PRTABLE 'FIX'
1437 2242 0 0042 22 0000 (SCRTB+106)(64)
@@ -1824,7 +1824,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
1581 1109 3609 0 0004 33 1120 BSA PSDO,4
1582 1110 3610 0 0000 46 1127 CLL CNST
1583 1111 3611 0 0000 41 1004 LDR WC
1584 1112 3612 0 0111 18 1005 CFR NUMBEROFWORDS/01
1584 1112 3612 0 0111 18 1005 CFR NUMBERWORDS/01
1585 1113 3613 0 0000 35 1117 BCE 9F
1586 1114 3614 0 0000 44 1131 DO GET.1
1115 3615 0 0000 30 1128
@@ -1890,7 +1890,7 @@ SEQ PLAC ADDR WORD LABEL OPCODE OPERAND ' IS A 4
1641 1167 3667 0 3100 36 1164 BFA 1B/31,0
1642 1168 3668 0 0000 49 0002 SLA 2
1643 1169 3669 0 8810 40 1012 STA BUFAREA+2/88
1644 1170 3670 0 0000 10 1005 CAD NUMBEROFWORDS
1644 1170 3670 0 0000 10 1005 CAD NUMBERWORDS
1645 1171 3671 0 0000 49 0006 SLA 6
1646 1172 3672 0 4210 40 1173 STA 1F/42
1647 1173 3673 0 4400 26 1007 1 IFL RLOC/44,0

File diff suppressed because it is too large Load Diff

View File

@@ -42,7 +42,7 @@
01 39 0 0007 LBC *+1
01 40 0 0008 NOP LOD1-100
01 41 0 0009 MOW 4 0,OT,4
01 42 0 0010 MRD 4 100,OT,BMOD
01 42 0 0010 MRD 4 100,OT,3,BMOD
01 43 0 0011 BUN 100
01 44 0 0012 A HLT
01 45 0 0013 B HLT MSIZE+1

View File

@@ -10,7 +10,7 @@
* Licensed under the MIT License, see
* http://www.opensource.org/licenses/mit-license.php
************************************************************************
* Cross-Assembler for the Burroughs 220 Algebraic Compiler (BALGOL)
* Cross-Assembler for the Burroughs 220 Algebraic Compiler (BALGOL).
*
* Assembles source for 220 machine language programs as used in the
* BALGOL compiler. Source is read from an emulated card deck -- a text
@@ -18,13 +18,13 @@
*
* col 1 Cardatron format band selection digit. Can be anything,
* but is typically 1.
* col 5-9 symbolic label or point label (*label)
* col 11-14 symbolic op code (standard 220 mnemonics)
* col 15 override sign (0-9, +, -), blank => 0
* col 17... operands (terminated by first free space)
* col 73-80 sequence and identification
* col 5-9 symbolic label or point label (*label).
* col 11-14 symbolic op code (standard 220 mnemonics).
* col 15 override sign (0-9, +, -), blank => 0.
* col 17... operands (terminated by first free space).
* col 73-80 sequence and identification.
*
* all other columns are ignored by this assembler.
* All other columns are ignored by this assembler.
*
* Output is a simulated line printer listing in the <iframe> of the web
* page from which the assembler is run. The output of Pass 1 is designed
@@ -160,15 +160,15 @@ window.addEventListener("load", function() {
text: ""}
// Token.type values
var tokEmpty = 0 // empty primary
var tokLocation = 1 // *, the current location counter
var tokInteger = 2 // integer constant
var tokLabel = 3 // regular label
var tokBackwardPoint = 4 // backward point label (without the leading * or the trailing -)
var tokForwardPoint = 5 // forward point label (ditto, without the trailing +)
var tokConstant = 6; // pool constant, 1-11 digit number with a leading + or -)
var tokIncompleteString = 7; // unterminated $-delimited string constant (probably continued on next card)
var tokString = 8; // $-delimited string constant
var tokEmpty = 0; // empty primary
var tokLocation = 1; // *, the current location counter
var tokInteger = 2; // integer literal
var tokLabel = 3; // regular label
var tokBackwardPoint = 4; // backward point label (without the leading * or the trailing -)
var tokForwardPoint = 5; // forward point label (ditto, without the trailing +)
var tokLiteral = 6; // pool literal, 1-11 digit number with a leading + or -)
var tokIncompleteString = 7; // unterminated $-delimited string literal (probably continued on next card)
var tokString = 8; // $-delimited string literal
// token structure for operand parsing
var token = {
@@ -184,7 +184,7 @@ window.addEventListener("load", function() {
var errorTank = []; // holding area for errors on current line
var location = 0; // current instruction address
var pointTab = {}; // Point-label table: holds the current sequence number for each point label
var poolTab = {}; // Pool constant table: holds address of the constant word
var poolTab = {}; // Pool literal table: holds address of the literal word
var symTab = {}; // Symbol table: holds the address value for each label
var p10 = [ 1, // powers of 10 table
@@ -228,7 +228,7 @@ window.addEventListener("load", function() {
* Opcode table:
* Each 220 assembler op code is defined by an array with a variable number
* of elements. The first element is the operation code, including any variant
* digit in (41) and is always required. The variant digit may be overlayed by
* digit in (41) and is always required. The variant digit may be overlaid by
* other fields in the instruction. If the code is negative, it indicates a
* pseudo-operator or other special handling.
*
@@ -380,13 +380,13 @@ window.addEventListener("load", function() {
19, -1],
"LOCN": [pseudoLOCN, // set location counter
19, -1],
"CNST": [pseudoCNST], // assemble list of constant values
"CNST": [pseudoCNST], // assemble list of literal values
"F244": [pseudoF244, // assemble word from 22-64-04 fields
7, 0, 12, 0, 1, 0],
"F424": [pseudoF424, // assemble word from 44-62-04 fields
3, 0, 11, 0, 1, 0],
"FBGR": [pseudoFBGR], // assemble Cardatron format band
"FINI": [pseudoFINI, // finish assembly, output constant pool
"FINI": [pseudoFINI, // finish assembly, output literal pool
1, 0]
};
@@ -586,7 +586,7 @@ window.addEventListener("load", function() {
labelID = label + padLeft(pointNr, 5-label.length, ".");
if (labelID in symTab) {
printError("DUPLICATE POINT LABEL -- IMPOSSIBLE")
printError("DUPLICATE POINT LABEL -- IMPOSSIBLE: " + labelID);
} else {
symTab[labelID] = location;
}
@@ -644,7 +644,7 @@ window.addEventListener("load", function() {
}
if (raw.length > 11) {
printError("NUMERIC CONSTANT LONGER THAN 11 DIGITS: " + raw);
printError("NUMERIC LITERAL LONGER THAN 11 DIGITS: " + raw);
raw = raw.substring(raw.length-11);
} else if (raw.length < 11) {
raw = sign.toString() + padLeft(raw, 10, "0");
@@ -761,7 +761,7 @@ window.addEventListener("load", function() {
var c; // current parse character
var length = text.length; // length of operand text
var raw = ""; // raw text of parsed token
var val = 0; // temp used with numeric pool constants
var val = 0; // temp used with numeric pool literals
var x = token.offset; // current offset into operand string
if (x >= length) { // empty primary
@@ -777,11 +777,11 @@ window.addEventListener("load", function() {
token.newOffset = x+1;
break;
case (c >= "0" && c <= "9"): // parse integer constant
case (c >= "0" && c <= "9"): // parse integer literal
val = parseNumber(text, token, 0);
token.type = tokInteger;
if (val > 9999) {
printError("INTEGER CONSTANT LONGER THAN 4 DIGITS: " + token.text);
printError("INTEGER LITERAL LONGER THAN 4 DIGITS: " + token.text);
}
break;
@@ -829,11 +829,11 @@ window.addEventListener("load", function() {
token.newOffset = x;
break;
case (c == "+"): // parse pool numeric constant
case (c == "+"): // parse pool numeric literal
case (c == "-"):
raw = c;
if (++x >= length) {
printError("INVALID POOL CONSTANT SYNTAX");
printError("INVALID POOL LITERAL SYNTAX");
token.newOffset = x;
} else {
token.offset = x;
@@ -841,11 +841,11 @@ window.addEventListener("load", function() {
if (c >= "0" && c <= "9") {
parseNumber(text, token, "");
if (token.text.length > 10) {
printError("POOL CONSTANT LONGER THAN 10 DIGITS: " + token.text);
printError("POOL LITERAL LONGER THAN 10 DIGITS: " + token.text);
}
token.text = raw + padLeft(token.text, 10, "0");
} else if (c == " " || c == ",") {
printError("EMPTY POOL CONSTANT");
printError("EMPTY POOL LITERAL");
} else {
val = evaluateAddress(text, token, resolved);
if (val >= 0) { // a resolved address
@@ -856,13 +856,13 @@ window.addEventListener("load", function() {
}
}
token.type = tokConstant;
token.type = tokLiteral;
break;
case (c == "$"): // parse pool string constant
case (c == "$"): // parse pool string literal
parseString(text, token, true, false);
token.text = "$" + token.text.substring(0, 5);
token.type = tokConstant;
token.type = tokLiteral;
break;
case (c == " "): // empty primary
@@ -905,7 +905,7 @@ window.addEventListener("load", function() {
case tokLocation: // *, current location counter
val = location;
break;
case tokInteger: // integer constant
case tokInteger: // integer literal
val = parseInt(token.text, 10);
break;
case tokLabel: // regular label
@@ -922,13 +922,13 @@ window.addEventListener("load", function() {
case tokBackwardPoint: // backward point label
case tokForwardPoint: // forward point label
label = "*" + token.text;
val = fetchPointLabel(label, token.type == 5);
val = fetchPointLabel(label, token.type == tokForwardPoint);
if (val < 0) {
val = -1;
unresolvable = true;
}
break;
case tokConstant: // pool constant
case tokLiteral: // pool literal
if (token.text in poolTab) {
val = poolTab[token.text];
if (val < 0) {
@@ -1689,7 +1689,7 @@ window.addEventListener("load", function() {
poolTab = {};
symTab = {};
symTab["RLO"] = 1; // kludge for CWR reload-lockout field
symTab["BMOD"] = 1; // kludge for MTR B-modify address field
symTab["BMOD"] = 1; // kludge for MRD B-modify address field
clearPanel();
startPass1();
@@ -1719,7 +1719,7 @@ window.addEventListener("load", function() {
break;
default:
done = true;
setTimeout(assemblePass1, 100);
Promise.resolve().then(assemblePass1);
break;
}
}
@@ -1749,7 +1749,7 @@ window.addEventListener("load", function() {
/**************************************/
function buildPoolPass1() {
/* Builds the initial constant pool from symbols encountered in Pass 1 */
/* Builds the initial literal pool from symbols encountered in Pass 1 */
var label;
var text;
@@ -1907,7 +1907,7 @@ window.addEventListener("load", function() {
} while (!done);
if (!finito) {
setTimeout(assemblePass1, 100);
Promise.resolve().then(assemblePass1);
} else {
// Wrap up Pass 1 and check for undefined symbols.
// Oddly, undefined symbols appear to have been implicitly defined at the end,
@@ -1930,7 +1930,7 @@ window.addEventListener("load", function() {
}
if (errorCount == 0) { // advance to Pass 2
setTimeout(initializePass2, 100);
Promise.resolve().then(initializePass2);
} else { // we're done -- remove the spinner image
$$("TextDiv").removeChild($$("Spinner"));
}
@@ -1976,7 +1976,7 @@ window.addEventListener("load", function() {
break;
default:
done = true;
setTimeout(assemblePass2, 100);
Promise.resolve().then(assemblePass2);
break;
}
}
@@ -2026,7 +2026,7 @@ window.addEventListener("load", function() {
/**************************************/
function buildPoolPass2() {
/* Builds the final constant pool */
/* Builds the final literal pool */
var keys; // addresses for pool words
var label; // pool entry ID
var text; // scratch string
@@ -2037,11 +2037,11 @@ window.addEventListener("load", function() {
// First, extract all the viable pool entries for sorting
for (label in poolTab) {
if (!(label in symTab)) {
printError("POOL CONSTANT NOT IN SYMBOL TABLE: " + label);
printError("POOL LITERAL NOT IN SYMBOL TABLE: " + label);
} else {
location = symTab[label];
if (location < 0) {
printError("POOL CONSTANT LOCATION NOT ASSIGNED: " + label);
printError("POOL LITERAL LOCATION NOT ASSIGNED: " + label);
} else {
text = padLeft(location, 4, "0");
xref[text] = label;
@@ -2067,7 +2067,7 @@ window.addEventListener("load", function() {
printPass2("", null, location, values[0], "", "", "", label);
emitWord(location, values[0]);
} // for x
}
}
/**************************************/
function assemblePass2() {
@@ -2229,7 +2229,7 @@ window.addEventListener("load", function() {
} while (!done);
if (!finito) {
setTimeout(assemblePass2, 100);
Promise.resolve().then(assemblePass2);
} else {
// dump the auto-defined symbols
for (label in autoSymTab) {
@@ -2258,18 +2258,19 @@ window.addEventListener("load", function() {
/* Checks whether this browser can support the necessary stuff */
var missing = "";
if (!window.File) {missing += ", File"}
if (!window.FileReader) {missing += ", FileReader"}
if (!window.FileList) {missing += ", FileList"}
if (!window.File ) {missing += ", File"}
if (!window.FileReader ) {missing += ", FileReader"}
if (!window.FileList ) {missing += ", FileList"}
if (!window.DOMTokenList) {missing += ", DOMTokenList"}
if (!window.ArrayBuffer) {missing += ", ArrayBuffer"}
if (!window.DataView) {missing += ", DataView"}
if (!(window.performance && "now" in performance)) {missing += ", performance.now"}
if (!window.ArrayBuffer ) {missing += ", ArrayBuffer"}
if (!window.DataView ) {missing += ", DataView"}
if (!window.Promise ) {missing += ", Promise"}
if (missing.length == 0) {
return false;
} else {
alert("No can do... your browser does not support the following features:\n" + missing.substring(2));
alert("No can do... your browser does not\n" +
"support the following features:\n" + missing.substring(2));
return true;
}
}

File diff suppressed because it is too large Load Diff