Perform the documented encoding of SIXBIT character data for MACRO-10
This commit is contained in:
parent
05e09699dd
commit
9ac0ffe679
11 changed files with 20 additions and 12 deletions
|
|
@ -610,7 +610,7 @@ Bus.prototype.removeMemBreak = function(addr, fWrite)
|
|||
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
|
||||
*
|
||||
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
|
||||
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
|
||||
* integer (because they are formed using bitwise operator rather than floating-point math operators), so don't be
|
||||
* surprised to see negative numbers in the data.
|
||||
*
|
||||
* The above example assumes "uncompressed" data arrays. If we choose to use "compressed" data arrays, the data arrays
|
||||
|
|
|
|||
|
|
@ -606,7 +606,7 @@ class Bus8080 extends Component {
|
|||
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
|
||||
*
|
||||
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
|
||||
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
|
||||
* integer (because they are formed using bitwise operator rather than floating-point math operators), so don't be
|
||||
* surprised to see negative numbers in the data.
|
||||
*
|
||||
* The above example assumes "uncompressed" data arrays. If we choose to use "compressed" data arrays, the data arrays
|
||||
|
|
|
|||
|
|
@ -1103,7 +1103,7 @@ class Bus extends Component {
|
|||
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
|
||||
*
|
||||
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
|
||||
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
|
||||
* integer (because they are formed using bitwise operator rather than floating-point math operators), so don't be
|
||||
* surprised to see negative numbers in the data.
|
||||
*
|
||||
* The above example assumes "uncompressed" data arrays. If we choose to use "compressed" data arrays, the data arrays
|
||||
|
|
|
|||
|
|
@ -1530,7 +1530,7 @@ class X86FPU extends Component {
|
|||
* might exist. That test code can be resurrected from the repo; this code is being retained for future tests.
|
||||
*
|
||||
* NOTE: If either min or max is a value containing 32 or more significant bits AND bit 31 is set AND it has passed
|
||||
* through some bit-wise operation(s), then that value may end up being negative, so you may end up with an inverted
|
||||
* through some bitwise operation(s), then that value may end up being negative, so you may end up with an inverted
|
||||
* range, or a range that's smaller or larger than intended.
|
||||
*
|
||||
* @this {X86FPU}
|
||||
|
|
|
|||
|
|
@ -678,7 +678,7 @@ X86.fnDIVw = function(dst, src)
|
|||
* Detect too-small divisor (quotient overflow)
|
||||
*
|
||||
* WARNING: We CANNOT simply do "src = (this.regEDX << 16) | this.regEAX", because if bit 15 of DX
|
||||
* is set, JavaScript will create a negative 32-bit number. So we instead use non-bit-wise operators
|
||||
* is set, JavaScript will create a negative 32-bit number. So we instead use non-bitwise operators
|
||||
* to force JavaScript to create a floating-point value that won't suffer from 32-bit-math side-effects.
|
||||
*/
|
||||
src = (this.regEDX & 0xffff) * 0x10000 + (this.regEAX & 0xffff);
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ class BusPDP10 extends Component {
|
|||
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
|
||||
*
|
||||
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
|
||||
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
|
||||
* integer (because they are formed using bitwise operator rather than floating-point math operators), so don't be
|
||||
* surprised to see negative numbers in the data.
|
||||
*
|
||||
* The above example assumes "uncompressed" data arrays. If we choose to use "compressed" data arrays, the data arrays
|
||||
|
|
|
|||
|
|
@ -6132,7 +6132,7 @@ PDP10.doDIV = function(dst, ext, src)
|
|||
* "early out" if the dividend gets "exhausted" first.
|
||||
*
|
||||
* Note that each element of these double arrays is a 36-bit value, so it's rarely a good idea
|
||||
* to use bit-wise operators on them, because those would operate on only the low 32 bits.
|
||||
* to use bitwise operators on them, because those would operate on only the low 32 bits.
|
||||
* Stick with the double worker functions I've created, and trust your JavaScript engine to
|
||||
* inline/optimize the code.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ class Macro10 {
|
|||
/**
|
||||
* genASCII()
|
||||
*
|
||||
* Based on the last operator, generate the appropriate ASCII data.
|
||||
* Based on the last operator, generate the appropriate ASCII/ASCIZ/SIXBIT data.
|
||||
*
|
||||
* @this {Macro10}
|
||||
*/
|
||||
|
|
@ -588,6 +588,14 @@ class Macro10 {
|
|||
* get zero, so it's all good.
|
||||
*/
|
||||
var c = this.sASCII.charCodeAt(i) & 0o177;
|
||||
/*
|
||||
* If we're doing 6-bit encoding, then perform the conversion of lower-case to upper-case,
|
||||
* and then adjust/mask.
|
||||
*/
|
||||
if (bits == 6) {
|
||||
if (c >= 0x61 && c <= 0x7A) c -= 0x20;
|
||||
c = (c + 0o40) & 0o77;
|
||||
}
|
||||
w += c * Math.pow(2, shift);
|
||||
shift -= bits;
|
||||
n++;
|
||||
|
|
|
|||
|
|
@ -853,7 +853,7 @@ class BusPDP11 extends Component {
|
|||
* [iBlock0, [dw0, dw1, ...], iBlock1, [dw0, dw1, ...], ...]
|
||||
*
|
||||
* In a normal 4Kb block, there will be 1K DWORD values in the data array. Remember that each DWORD is a signed 32-bit
|
||||
* integer (because they are formed using bit-wise operator rather than floating-point math operators), so don't be
|
||||
* integer (because they are formed using bitwise operator rather than floating-point math operators), so don't be
|
||||
* surprised to see negative numbers in the data.
|
||||
*
|
||||
* The above example assumes "uncompressed" data arrays. If we choose to use "compressed" data arrays, the data arrays
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ class Int36 {
|
|||
* Calculating V, R, O, and E as described above is somewhat tedious, because bits
|
||||
* above bit 31 cannot be accessed directly; we shift all the sign bits down to bit 0
|
||||
* using division first. We don't need to truncate the results, because the subsequent
|
||||
* bit-wise operations perform truncation automatically.
|
||||
* bitwise operations perform truncation automatically.
|
||||
*/
|
||||
var e = 0;
|
||||
if (DEBUG) {
|
||||
|
|
@ -622,7 +622,7 @@ class Int36 {
|
|||
* "early out" if the dividend gets "exhausted" first.
|
||||
*
|
||||
* Note that each element of these double arrays is a 36-bit value, so it's rarely a good idea
|
||||
* to use bit-wise operators on them, because those would operate on only the low 32 bits.
|
||||
* to use bitwise operators on them, because those would operate on only the low 32 bits.
|
||||
* Stick with the double worker functions I've created, and trust your JavaScript engine to
|
||||
* inline/optimize the code.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue