Fixed the Debugger's arithmetic truncation function (truncate())
This commit is contained in:
parent
46ed7c77e8
commit
75b9a9c2ba
9 changed files with 84 additions and 149 deletions
|
|
@ -290,7 +290,7 @@ h.ci=function(a){switch(this.j){case V.cd:this.b&W.cb&&(this.b&=~W.cb,this.w[thi
|
|||
F(this,this.type+".writeSector("+f+":0:"+g+")",!0,!0),d=e.seek(f,0,g,!0))for(b&&(d.Ff=!0),b=0,f=this.w.length;b<f;){if(!e.write(d,b,this.w[b]&255)){c=rj.qd;break}b++}else c=rj.rd;else c=d?rj.hd:rj.gd;qj(this,c)}}}this.C=a};var W=Pb.lf,sj=Pb.pf,tj=Pb.nf,uj=Pb.mf,V=Pb.xa,rj=Pb.ERROR,vj="FILL EMPTY WRITE READ UNUSED RDSTAT WRDEL RDERR".split(" "),wj={},oj=(wj[65144]=[null,null,Fd.prototype.Lg,Fd.prototype.bi,"RXCS"],wj[65146]=[null,null,Fd.prototype.Mg,Fd.prototype.ci,"RXDB"],wj);
|
||||
function xj(a){x.call(this,"Debugger",a);this.W=+a.base||16;this.qb=null;this.O=["{","}"];this.ka=["[","]"];this.w=0;this.R=!1;this.u=-1;this.j=[];this.L={}}p(xj,x);xj.prototype.se=function(){return-1};xj.prototype.Cd=function(){};
|
||||
function yj(a,b,c,d){if(c)if(b){0>a.u&&a.j.length&&(a.u=0);if(0>a.u||b!=a.j[a.u])a.j.splice(0,0,b),a.u=0;a.u--}else a.R?b="end":b=a.j[a.u+1];a=[];if(b){b=b.replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var g=b.charAt(f);if('"'==g||"'"==g)e?g==e&&(e=null):e=g;else if(g==d&&!e||!g)a.push(za(b.substring(c,f))),c=f+1}}return a}
|
||||
function zj(a,b,c){var d=a;b=b||32;if(c)if(32==b)d=a>>>0;else if(32>b)d=a&(1<<b)-1;else{if(b=Math.pow(2,b),0>a||a>=b)d=a%b,0>d&&(d+=b)}else 32>=b?d=a|0:(b=Math.pow(2,b-1),a<-b?(a<2*-b&&(d=a%(2*b)),d+=2*b):d>=b&&(a>=2*b&&(d=a%(2*b)),d-=2*b));a!=d&&(a=d);return a}
|
||||
function zj(a,b,c){var d=a;b=b||32;if(c)if(32==b)d=a>>>0;else if(32>b)d=a&(1<<b)-1;else{if(b=Math.pow(2,b),0>a||a>=b)d=a%b,0>d&&(d+=b)}else 32>=b?d=a<<32-b>>32-b:(b=Math.pow(2,b-1),a>=b?(d=a%b,(a/b|0)&1&&(d-=b)):a<-b&&(d=a%b,((-a-1)/b|0)&1?d&&(d+=b):d||(d-=b)));a!=d&&(a=d);return a}
|
||||
function Aj(a,b,c){for(c=void 0===c?-1:c;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e,f=a.pop();e=a.pop();switch(d){case "*":e*=f;break;case "/":if(!f)return!1;e=Math.trunc(e/f);break;case "^/":if(!f)return!1;e%=f;break;case "+":e+=f;break;case "-":e-=f;break;case "<<":e<<=f;break;case ">>":e>>=f;break;case ">>>":e>>>=f;break;case "<":e=e<f?1:0;break;case "<=":e=e<=f?1:0;break;case ">":e=e>f?1:0;break;case ">=":e=e>=f?1:0;break;case "==":e=e==f?1:0;break;case "!=":e=e!=f?1:0;break;case "&":e&=
|
||||
f;break;case "!":case "|":e|=f;break;case "^!":e|=f;break;case "&&":e=e&&f?1:0;break;case "||":e=e||f?1:0;break;case "_":case "^_":"^_"==d&&(f=35-(f&255));f&&(e=zj(e,0,!0),e=0<f?e*Math.pow(2,f):Math.trunc(e/Math.pow(2,-f)));break;default:return!1}a.push(zj(e))}return!0}
|
||||
function Bj(a,b,c,d,e,f){var g,k,l,m=!1,n=0,q=[],t=[],r=a.W;for(a.W=e;c<d;){k=b[c++].trim();l=c<d?b[c++]:"";if(k)n=Cj(a,k,null,f,n);else if("{"==l){k=1;for(n=c;c<d;)if(c++,l=c<b.length?b[c++]:"","{"==l)k++;else if("}"==l&&!--k)break;n=Bj(a,b,n,c-1,a.W,f);k=c<d?b[c++].trim():"";l=c<d?b[c++]:""}else{if(" "==l)continue;if("^B"==l){a.W=2;continue}if("^O"==l){a.W=8;continue}if("^D"==l){a.W=10;continue}if(!(n&-1073741824)){if("+"==l)continue;if("-"==l){n=n<<2|1;continue}if("~"==l||"^-"==l){n=n<<2|2;continue}if("^L"==
|
||||
|
|
|
|||
Loading…
Reference in a new issue