1
0
mirror of https://github.com/pkimpel/retro-b5500.git synced 2026-04-25 20:01:52 +00:00
Files
pkimpel.retro-b5500/tools/BIC-ANSI-xlateTest.html
paul.kimpel@digm.com 2260803c51 Release emulator version 0.15:
1. Initial implementation of a datacom terminal.
2. Initial implementation (read-only) of magnetic tape drives.
3. Further work towards getting P2 to function (but not working yet).
4. Allow device driver classes to be optionally included in the global UI script.
5. Fix callback arguments handling in SetCallback.
6. Decrease width of SPO window slightly.
7. Improve trapping and printing of SPO keystrokes, based on datacom implementation.
8. Minor performance tuning improvements.
9. Dump raw header words in octal in tools/B5500DiskDirList.html script.
10. New wiki pages and several updates to existing ones.
2013-11-15 05:33:58 +00:00

129 lines
6.4 KiB
HTML

<html>
<head>
<title>Test BIC to ANSI Translation</title>
</head>
<body>
<script>
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
"H", "I", ".", "[", "&", "(", "<", "~", // 18-1F, @30-37
"|", "J", "K", "L", "M", "N", "O", "P", // 20-27, @40-47
"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
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
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0D,0x2E,0x1E,0x3D,0x0E,0x0C, // 30-3F
0x0B,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x21,0x22,0x23,0x24,0x25,0x26, // 40-4F
0x27,0x28,0x29,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x1B,0x0C,0x3E,0x0C,0x0C, // 50-5F
0x0C,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x21,0x22,0x23,0x24,0x25,0x26, // 60-6F
0x27,0x28,0x29,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x2F,0x20,0x0F,0x1F,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
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("&lt;");
case ">": return("&gt;");
case '"': return("&quot;");
case "&": return("&amp;");
default: return c;
}
}
var c;
var d;
var x;
var y;
document.write("<h3>Test BIC to ANSI Translation</h3>");
for (x=0; x<64; x++) {
c = BICtoANSI[x];
y = ANSItoBIC[c.charCodeAt(0)];
document.write("[" + x + "=" + y + "] = " + html(c) + "<br>");
if (x != y) {
alert("BICtoANSI mismatch: " + x + "!=" + y + ", " + html(c));
}
}
document.write("<h3>Test ANSI to BIC</h3>");
for (x=0; x<256; x++) {
y = ANSItoBIC[x];
d = String.fromCharCode(x);
c = BICtoANSI[y];
y = c.charCodeAt(0);
document.write("[" + x + "=" + y + "] : " + html(c) + "=" + html(d) + "<br>");
if (y != 63 && c != d.toUpperCase()) {
alert("ANSItoBIC mismatch: " + x + "!=" + y + ", " + html(c));
}
}
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>