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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ function vg(a,b){if(a.b){if(1==a.b){var c=b.indexOf("<");0<=c?(a.b++,b=b.substr(
|
|||
b),!1;b=c[1];d=c[2].toUpperCase();c=c[3].trim();if(b){var e=b.slice(-1);b=b.slice(0,-1);":"==e?yg(a,b,a.J,!0):(c=d+c,d=e)}a.F=d;c=c.trim();switch(d){case "=":d=Je(a.u,c);void 0===d?a.error("parseExpression("+c+")"):yg(a,b,d);break;case zg:case Ag:case Bg:xg(a,c);break;case Cg:case Dg:case Eg:a:{b=d;var f;if(b==Cg){d=c.match(/([A-Z$%.][0-9A-Z$%.]*)\s*(\([^)]*\)|)\s*(<|)(.*)/i);if(!d){a.error("unrecognized "+b+" definition: "+c);break a}b=d[1];c=d[2].match(/[A-Z$%.][0-9A-Z$%.]*/g);e=-1;f=3}else{for(var d=
|
||||
c,e=null,g=f=0;g<d.length;g++){var h=d[g];if(","==h&&!f){e=d.substr(0,g);break}if("<"==h)f++;else if(">"==h&&0>--f){a.error("missing angle bracket(s): "+d);break}}if(!e){a.error("missing "+b+" expression: "+c);break a}c=c.substr(e.length+1);e=e.trim();d=c.match(/\s*(<|)(.*)/i);b="@"+b;c=[];e=Je(a.u,e);f=1}a.b=1;a.v=b;g="";d[f]&&(a.b=2,g=d[f+1],">"==g.slice(-1)&&(a.b=0,g=g.slice(0,-1)));a.H[b]={name:b,Zc:c,yb:e,Wa:g};a.b||wg(a)}}return 330<=a.w?(Oe(a.u),a.error("temporary line limit reached"),!1):
|
||||
!0}function wg(a){if(a.v){var b=a.H[a.v];switch("@"==a.v[0]?a.v.substr(1):a.F){case Dg:b.yb||Fg(a,b.Wa);break;case Eg:for(;0<b.yb--;)Fg(a,b.Wa)}}}function Fg(a,b){b=b.split(/\r?\n/);for(var c=0;c<b.length&&vg(a,b[c]+"\r\n");c++);}ng.prototype.error=function(a){throw Error("error"+(this.w?" at line "+va(this.w):"")+": "+a);};
|
||||
function xg(a,b){var c=b;null==a.i&&(a.i=a.C="",b&&(a.i=b[0],c=b=b.substr(1)));if(a.i){var d=b.indexOf(a.i);0>d?c="":(c=b.substr(d+1),b=b.substr(0,d),a.i=null);a.C+=b}if(null==a.i){var e=0;b=0;var f,g,d=a.C.length;a.F==Ag&&d++;for(var h=0;h<d;h++)e||(b=0,g=29,f=7,a.F==Bg&&(f--,g++)),b+=(a.C.charCodeAt(h)&127)*Math.pow(2,g),g-=f,e++,0>g&&(e=b,a.B[a.J++]=e,e=0);e&&(a.B[a.J++]=b)}return c}
|
||||
function xg(a,b){var c=b;null==a.i&&(a.i=a.C="",b&&(a.i=b[0],c=b=b.substr(1)));if(a.i){var d=b.indexOf(a.i);0>d?c="":(c=b.substr(d+1),b=b.substr(0,d),a.i=null);a.C+=b}if(null==a.i){var e=0;b=0;var f,g,d=a.C.length;a.F==Ag&&d++;for(var h=0;h<d;h++){e||(b=0,g=29,f=7,a.F==Bg&&(f--,g++));var k=a.C.charCodeAt(h)&127;6==f&&(97<=k&&122>=k&&(k-=32),k=k+32&63);b+=k*Math.pow(2,g);g-=f;e++;0>g&&(e=b,a.B[a.J++]=e,e=0)}e&&(a.B[a.J++]=b)}return c}
|
||||
function yg(a,b,c,d){var e,f;d=void 0===d?!1:d;e=void 0===e?!1:e;f=void 0===f?!1:f;b=b.toUpperCase().substr(0,6);d&&void 0!==a.I[b]?a.error("label "+b+" redefined"):(a.I[b]={name:b,value:c,dd:d,cd:e,ed:f},a.u.K[b]=c)}var zg="ASCII",Ag="ASCIZ",Bg="SIXBIT",Cg="DEFINE",Dg="IFE",Eg="REPEAT";
|
||||
function Gg(a,b,c){r.call(this,"Computer",a,33554432);this.A.V=!1;this.R=null;Hg(this,b);this.O=Yc(this,"autoPower",a,6);this.w=0;this.aa=+a.busWidth||+a.buswidth;this.M=this.G=this.N=null;this.K=this.T=!1;this.I=this.B=null;this.S=this.P=!1;this.ba=Yc(this,"url")||"";(Math.random()+.1).toString(36);this.i=Ig(this);if(this.v=rb("CPU",this.id)){this.C=rb("Debugger",this.id);this.H=new Bc({id:this.Qa+".bus",busWidth:this.aa},this.v,this.C);var d,e=pb(this.id);if((this.u=rb("Panel",this.id))&&this.u.ta)for(b=
|
||||
0;b<e.length;b++)d=e[b],d.da=this.u.da,d.j=this.u.j,d.ta=this.u.ta;this.j(Pb+" v1.34.2\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>\nLicense: GPL version 3 or later <http://gnu.org/licenses/gpl.html>");for(b=0;b<e.length;b++)d=e[b],d.Da&&d.Da(this,this.H,this.v,this.C);b=null;d=Yc(this,"resume",a);void 0!==d&&(1<d.length?b=this.G=d:this.b=parseInt(d,10));var f;if(a=Yc(this,"state")||(f=!0,a.state))this.N=b=a,f||(this.K=!0,this.b=Jg),this.b&&(this.I=new F(this,"1.34.2"),Kg(this.I)?b=null:
|
||||
|
|
|
|||
Loading…
Reference in a new issue