Added support for address-specific message categories in I/O tables

This commit is contained in:
Jeff 2016-11-17 17:47:57 -08:00 • committed by Jeff Parsons
commit 861d78e6d2
7 changed files with 47 additions and 46 deletions

View file

@ -78,7 +78,7 @@ function yc(a,b,c){var d=[];for(b>>>=a.ka;0<c&&b<a.Y.length;)d.push(a.Y[b++]),c-
k.ma=function(a){3932160<=a&&(a=Ec(this.b,a));return this.Y[(a&this.Qa)>>>this.ka].sa(a&this.v,a)};k.fb=function(a){3932160<=a&&(a=Ec(this.b,a));var b=a&this.v,c=(a&this.Qa)>>>this.ka;this.f=!1;this.na++;a=this.Y[c].mc(b,a);this.na--;return a};k.Eb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].cc(a&this.v,b&255,a)};k.tb=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.f=!1;this.na++;this.Y[(a&this.Qa)>>>this.ka].dc(a&this.v,b&255,a);this.na--};
k.ib=function(a,b){3932160<=a&&(a=Ec(this.b,a));this.Y[(a&this.Qa)>>>this.ka].Ub(a&this.v,b&65535,a)};k.Fb=function(a,b){3932160<=a&&(a=Ec(this.b,a));var c=a&this.v,d=(a&this.Qa)>>>this.ka;this.f=!1;this.na++;this.Y[d].pc(c,b&65535,a);this.na--};
function Fc(a){for(var b=0,c=[],d=0;d<a.D;d++){var e=a.Y[d];if(e.Wa||e.Vc){c[b++]=d;var f=b++;if(e=e.save()){for(var g=0,h=0,l=[];g<e.length;){for(var m=e[g],n=g+1;n<e.length&&e[n]===m;)n++;l[h++]=n-g;l[h++]=m;g=n}l.length<e.length&&(e=l)}c[f]=e}}return c}function Gc(a,b,c,d,e,f,g,h,l){for(;b<=c;b+=2){var m=b&vc;if(void 0!==a.cb[m])return q("I/O address already registered: "+p(b,8,!0)),!1;a.cb[m]=[d,e,f,g,l||"unknown",h,!1]}return!0}
function Ib(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Gc(a,e,e,g,h,l,m,b.la||64,n||b.ab))return!1}}return!0}function Kb(a,b){a.B.push(b)}
function Ib(a,b,c){for(var d in c){var e=+d,f=c[d];if(!(f[6]&&f[6]>a.b.Xa)){var g=f[0]?f[0].bind(b):null,h=f[1]?f[1].bind(b):null,l=f[2]?f[2].bind(b):null,m=f[3]?f[3].bind(b):null;65472<=e&&65487>=e&&(!g&&l&&(g=function(a){return function(b){return a(b)&255}.bind(b)}(l)),!h&&m&&(h=function(a){return function(b,c){return a(b,c)}.bind(b)}(m)));for(var n=f[4],v=f[5]||1,r=0;r<v;r++,e+=2)if(n&&1<v&&(n=f[4]+r),!Gc(a,e,e,g,h,l,m,f[7]||b.la||64,n||b.ab))return!1}}return!0}function Kb(a,b){a.B.push(b)}
k.Ha=function(a,b,c){this.f=!0;this.na||(this.j&&F(this.j,32)&&E(this.j,"memory fault ("+c+") on "+J(this.j,a),!0,!0),b&&(this.b.ua|=b),this.b.wa(4,0,a))};function Hc(a){var b=a.f;a.f=!1;return b}function Bc(a,b,c){q("Memory block error ("+a+": "+p(b)+","+p(c)+")");return!1}function K(a){t.call(this,"Device",a,K,1024);this.f={fa:0,oc:-1}}z(K);k=K.prototype;
k.Ia=function(a,b,c,d){this.v=b;this.C=a;this.b=c;this.j=d;var e=this;this.f.oc=Ic(c,function(){e.f.Nb|=128;e.f.Nb&64&&Jc(e.b,e.f.fe);e.C&&e.C.qa(1);Kc(e.b,e.f.oc,1E3/60)});this.f.fe=Tc(64,6);Ib(b,this,Uc);Kb(b,this.reset.bind(this));d&&Vc(d,256,function(a){var b=e.b;L(e,"KIPDR",b.P[0],0,a[0]);L(e,"KDPDR",b.P[0],8,a[0]);L(e,"KIPAR",b.ha[0],0,a[0]);L(e,"KDPAR",b.ha[0],8,a[0],!0);L(e,"SIPDR",b.P[1],0,a[0]);L(e,"SDPDR",b.P[1],8,a[0]);L(e,"SIPAR",b.ha[1],0,a[0]);L(e,"SDPAR",b.ha[1],8,a[0],!0);L(e,"UIPDR",
b.P[3],0,a[0]);L(e,"UDPDR",b.P[3],8,a[0]);L(e,"UIPAR",b.ha[3],0,a[0]);L(e,"UDPAR",b.ha[3],8,a[0],!0)});H(this)};function L(a,b,c,d,e,f){a=a.j;if(!(e&&0>b.indexOf(e.toUpperCase()))){b+=":";for(e=0;8>e;e++)b+=" "+J(a,c[d+e]);a.i(b+(f?"\n":""))}}k.reset=function(){this.f.Nb=128;Kc(this.b,this.f.oc,1E3/60,!0)};k.vd=function(){return this.f.Nb};k.pe=function(a){this.f.Nb=a&192};k.xd=function(){return Wc(this.b)};k.re=function(a){Xc(this.b,a&-129|this.b.Da&128)};k.yd=function(){return Yc(this.b)};
@ -89,13 +89,13 @@ k.Re=function(a,b){b=b>>1&7;this.b.ha[3][b]=a;this.b.P[3][b]&=65295};k.Xd=functi
k.Ae=function(a){this.b.u[7]=a};k.Db=function(a){a&=7;return this.b.N&2048?this.b.u[a]:this.b.Za[a]};k.Hb=function(a,b){b&=7;this.b.N&2048?this.b.u[b]=a:this.b.Za[b]=a};k.Gd=function(){return 1==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[1]};k.ye=function(a){1==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[1]=a};k.Hd=function(){return 3==(this.b.N&49152)>>14?this.b.u[6]:this.b.La[3]};k.ze=function(a){3==(this.b.N&49152)>>14?this.b.u[6]=a:this.b.La[3]=a};k.pd=function(a){return this.b.Jc[a-65504>>1]};
k.je=function(a,b){this.b.Jc[b-65504>>1]=a};k.Gc=function(a){if(65520==a){a=0;switch(Cc){case Cc:a=this.v.gc}a=(a>>6)-1}else a=0;return a};k.Nc=function(){};k.Wd=function(){return 1};k.Oe=function(){};k.od=function(){return this.b.ua};k.ie=function(){this.b.ua=0};k.wd=function(){return this.b.Ic};k.qe=function(a,b){b&1||(a&=255);this.b.Ic=a};k.Bd=function(a,b){return b?0:this.b.Rb};k.te=function(a){ad(this.b,a)};k.Vd=function(a,b){return b?0:this.b.sb&65280};k.Ne=function(a){this.b.sb=a|255};
k.Ed=function(){return bd(this.b)};k.we=function(a){cd(this.b,a&-1793|bd(this.b)&1792);this.b.J|=128};k.Mc=function(a,b){F(this)&&E(this,"writeIgnored("+na(b)+"): "+na(a),!0,!0)};
var M={},Uc=(M[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145],M[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145],M[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145],M[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145],M[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145],M[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145],M[62688]=[null,null,K.prototype.td,
K.prototype.ne,"KIPAR",8,1145],M[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145],M[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145],M[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],M[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145],M[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145],M[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145],M[65408]=[null,null,K.prototype.$d,K.prototype.Se,"UIPDR",8,1145],M[65424]=[null,null,K.prototype.Yd,
K.prototype.Qe,"UDPDR",8,1145],M[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145],M[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145],M[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],M[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],M[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],M[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],M[65476]=[null,null,K.prototype.Cb,K.prototype.Gb,"R4SET0"],M[65477]=[null,null,K.prototype.Cb,K.prototype.Gb,
"R5SET0"],M[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],M[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],M[65484]=[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Db,
K.prototype.Hb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],M[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,"SYSID",1,1170],M[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],M[65528]=
[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],M[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],M[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],M[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],M);$a(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new dd(c);B(c,d);break;case "rl11":c=new N(c),B(c,d)}}});var ed;
if(Ab){var fd=new ArrayBuffer(2);(new DataView(fd)).setUint16(0,256,!0);ed=256===(new Uint16Array(fd))[0]}else ed=!1;var gd=ed;
var M={},Uc=(M[61568]=[null,null,K.prototype.ae,K.prototype.Te,"UNIMAP",64,1170],M[62592]=[null,null,K.prototype.Ud,K.prototype.Me,"SIPDR",8,1145,256],M[62608]=[null,null,K.prototype.Sd,K.prototype.Ke,"SDPDR",8,1145,256],M[62624]=[null,null,K.prototype.Td,K.prototype.Le,"SIPAR",8,1145,256],M[62640]=[null,null,K.prototype.Rd,K.prototype.Je,"SDPAR",8,1145,256],M[62656]=[null,null,K.prototype.ud,K.prototype.oe,"KIPDR",8,1145,256],M[62672]=[null,null,K.prototype.sd,K.prototype.me,"KDPDR",8,1145,256],
M[62688]=[null,null,K.prototype.td,K.prototype.ne,"KIPAR",8,1145,256],M[62704]=[null,null,K.prototype.rd,K.prototype.le,"KDPAR",8,1145,256],M[62798]=[null,null,K.prototype.Ad,K.prototype.se,"MMR3",1,1145,256],M[65382]=[null,null,K.prototype.vd,K.prototype.pe,"LKS"],M[65402]=[null,null,K.prototype.xd,K.prototype.re,"MMR0",1,1145,256],M[65404]=[null,null,K.prototype.yd,K.prototype.Mc,"MMR1",1,1145,256],M[65406]=[null,null,K.prototype.zd,K.prototype.Mc,"MMR2",1,1145,256],M[65408]=[null,null,K.prototype.$d,
K.prototype.Se,"UIPDR",8,1145,256],M[65424]=[null,null,K.prototype.Yd,K.prototype.Qe,"UDPDR",8,1145,256],M[65440]=[null,null,K.prototype.Zd,K.prototype.Re,"UIPAR",8,1145,256],M[65456]=[null,null,K.prototype.Xd,K.prototype.Pe,"UDPAR",8,1145,256],M[65472]=[null,null,K.prototype.Cb,K.prototype.Gb,"R0SET0"],M[65473]=[null,null,K.prototype.Cb,K.prototype.Gb,"R1SET0"],M[65474]=[null,null,K.prototype.Cb,K.prototype.Gb,"R2SET0"],M[65475]=[null,null,K.prototype.Cb,K.prototype.Gb,"R3SET0"],M[65476]=[null,null,
K.prototype.Cb,K.prototype.Gb,"R4SET0"],M[65477]=[null,null,K.prototype.Cb,K.prototype.Gb,"R5SET0"],M[65478]=[null,null,K.prototype.Fd,K.prototype.xe,"R6KERNEL"],M[65479]=[null,null,K.prototype.Id,K.prototype.Ae,"R7KERNEL"],M[65480]=[null,null,K.prototype.Db,K.prototype.Hb,"R0SET1",1,1145],M[65481]=[null,null,K.prototype.Db,K.prototype.Hb,"R1SET1",1,1145],M[65482]=[null,null,K.prototype.Db,K.prototype.Hb,"R2SET1",1,1145],M[65483]=[null,null,K.prototype.Db,K.prototype.Hb,"R3SET1",1,1145],M[65484]=
[null,null,K.prototype.Db,K.prototype.Hb,"R4SET1",1,1145],M[65485]=[null,null,K.prototype.Db,K.prototype.Hb,"R5SET1",1,1145],M[65486]=[null,null,K.prototype.Gd,K.prototype.ye,"R6SUPER",1,1145],M[65487]=[null,null,K.prototype.Hd,K.prototype.ze,"R6USER",1,1145],M[65504]=[null,null,K.prototype.pd,K.prototype.je,"CTRL",8,1170],M[65520]=[null,null,K.prototype.Gc,K.prototype.Nc,"LSIZE",1,1170],M[65522]=[null,null,K.prototype.Gc,K.prototype.Nc,"HSIZE",1,1170],M[65524]=[null,null,K.prototype.Wd,K.prototype.Oe,
"SYSID",1,1170],M[65526]=[null,null,K.prototype.od,K.prototype.ie,"CPUERR",1,1170],M[65528]=[null,null,K.prototype.wd,K.prototype.qe,"MB",1,1170],M[65530]=[null,null,K.prototype.Bd,K.prototype.te,"PIR"],M[65532]=[null,null,K.prototype.Vd,K.prototype.Ne,"SL"],M[65534]=[null,null,K.prototype.Ed,K.prototype.we,"PSW"],M);
$a(function(){for(var a=D(document,"pdp11","device"),b=0;b<a.length;b++){var c,d=a[b];c=A(d);switch(c.type){case "default":c=new K(c);B(c,d);break;case "pc11":c=new dd(c);B(c,d);break;case "rl11":c=new N(c),B(c,d)}}});var ed;if(Ab){var fd=new ArrayBuffer(2);(new DataView(fd)).setUint16(0,256,!0);ed=256===(new Uint16Array(fd))[0]}else ed=!1;var gd=ed;
function I(a,b,c,d,e,f){this.v=a;this.id=hd+=2;this.b=null;this.F=b;this.Tb=c;this.size=d||0;this.type=e||id;this.f=e==jd;this.controller=null;uc(this);this.Wa=this.Vc=!1;if(this.size)if(f)this.controller=f,a=[null,0],this.b=a[0],kd(this,f.Qc);else if(Ab)this.B=new ArrayBuffer(this.size),this.D=new DataView(this.B,0,this.size),this.G=new Uint8Array(this.B,0,this.size),this.I=new Uint16Array(this.B,0,this.size>>1),this.b=new Int32Array(this.B,0,this.size>>2),kd(this,gd?ld:md);else{a=this.b=Array(this.size>>
2);for(f=0;f<a.length;f++)a[f]=0;kd(this,nd)}else kd(this)}var id=0,Cc=1,jd=2,Ac=4,Dc=["NONE","RAM","ROM","VID","H/W"],hd=0;
I.prototype={constructor:I,parent:null,save:function(){var a,b;if(this.controller)a=null;else if(Ab)for(a=Array(this.size>>2),b=0;b<a.length;b++)a[b]=this.D.getInt32(b<<2,!0);else a=this.b;return a},restore:function(a){if(this.controller)return!a;if(a&&this.size==a.length<<2){var b;if(Ab)for(b=0;b<a.length;b++)this.D.setInt32(b<<2,a[b],!0);else this.b=a;return this.Wa=!0}return!1},ob:function(a,b){b?this.C++||od(this,pd,!1):this.g++||qd(this,pd,!1)},K:function(a,b){this.j&&F(this.j,128)&&E(this.j,
@ -127,7 +127,7 @@ function cd(a,b){a.Z=b<<12;a.$=~b&4;a.V=b<<14;a.U=b<<16;if((b^a.N)&2048)for(var
function pe(a,b){a.J&128||(a.Z=a.$=a.U=b,a.V=a.Z^a.U>>1)}function qe(a,b,c,d){a.J&128||(a.Z=a.$=a.U=b,a.V=(c^d)&(d^b))}k.wa=function(a,b,c){if(!this.M){0>this.Aa?this.Aa=bd(this):this.B||(a=4,this.ua|=4,this.u[6]=4,c=-3);this.pa=a;this.B=0;var d=this.sa(a|this.S),e=this.sa(a+2&65535|this.S);cd(this,e&-12289|this.Aa>>2&12288);re(this,this.Aa);re(this,this.u[7]);Q(this,d);this.J&=~(b|18);this.J|=9;this.Aa=-1;this.md=a;this.ld=c;if(-3<=c)throw a;}};
function se(a){var b=te(a),c=te(a)&-1793;a.N&49152&&(c=c&-225|a.N&63712);Q(a,b);cd(a,c);a.J&=-17}function Ec(a,b){var c=b>>13&31;31>c&&(b=a.Ta&32?a.Sb[c]+(b&8190)&4194302:b&-3932161);return b}
function ue(a,b,c){var d,e,f;if(!(c&a.L))return f=b&65535,57344<=f&&(f|=a.yc),f;d=b>>13;a.Ta&a.$c[a.B]||(d&=7);e=a.P[a.B][d];f=(a.ha[a.B][d]<<6)+(b&8191)&a.Ea;var g=0;switch(e&7){case 1:g=4096;case 2:e|=128;c&4&&(g=8192);break;case 4:g=4096;case 5:c&4&&(g=4096);case 6:e|=c&4?192:128;break;default:g=32768}32512!=(e&32520)&&(e&8?e&32512&&(b&8128)<(e>>2&8128)&&(g|=16384):(b&8128)>(e>>2&8128)&&(g|=16384));a.P[a.B][d]=e;if(f!=(4194170&a.Ea)||a.B)a.bb=a.B,a.mb=d;g&&(g&57344&&(0<=a.Aa&&(g|=128),a.Da&57344||
(g|=a.bb<<5|a.mb<<1,Xc(a,a.Da&-61695|g),a.wa(168,64,-1))),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function ve(a,b){return a.v.Yb(b)}function te(a){var b=a.sa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function re(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.pa=a.pa&65535|(a.pa&-65536)<<8|16121856;we(a,0,c);a.Ub(c,b)}function we(a,b,c){!a.B&&c<=a.sb&&(b||4<c)&&(1145<=a.Xa&&c<=a.sb-32?(a.ua|=4,a.u[6]=4,a.wa(4,0,-3)):(a.ua|=8,a.J|=32))}
(g|=a.bb<<5|a.mb<<1,Xc(a,a.Da&-57599|g),a.wa(168,64,-1))),a.Da&61440||!(f<(4191360&a.Ea)||f>(4194239&a.Ea))||(a.Da|=4096,a.Da&512&&(a.J|=64)));return f}function ve(a,b){return a.v.Yb(b)}function te(a){var b=a.sa(a.u[6]|a.S);a.u[6]=a.u[6]+2&65535;return b}function re(a,b){var c=a.u[6]-2&65535;a.u[6]=c;a.pa=a.pa&65535|(a.pa&-65536)<<8|16121856;we(a,0,c);a.Ub(c,b)}function we(a,b,c){!a.B&&c<=a.sb&&(b||4<c)&&(1145<=a.Xa&&c<=a.sb-32?(a.ua|=4,a.u[6]=4,a.wa(4,0,-3)):(a.ua|=8,a.J|=32))}
function xe(a,b,c,d){var e,f,g=d&8?0:a.S;switch(b){case 0:return a.wa(4,0,-2),0;case 1:return 6==c&&d&4&&we(a,b,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];7!=c&&(e|=g,6>c&&d&1&&(f=1));a.b-=3;break;case 3:f=2;e=a.u[c];7!=c&&(e|=g);e=a.sa(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.sa(e)|g;a.b-=8;break;case 6:return e=a.sa(Qd(a,2)),e=e+a.u[c]&65535|g,a.b-=6,e;case 7:return e=a.sa(Qd(a,2)),e=e+
a.u[c]&65535,e=a.sa(e|a.S)|g,a.b-=10,e}a.u[c]=a.u[c]+f&65535;a.pa=a.pa&65535|(a.pa&-65536)<<8|(f<<3&248|c)<<16;6==c&&0>f&&we(a,b,a.u[6]);return e}k.Zb=function(a){if(!this.L)return this.v.Zb(a);this.M++;a=ve(this,ue(this,a,3));this.M--;return a};k.fb=function(a){if(!this.L)return this.v.fb(a);this.M++;a=this.Hc(ue(this,a,2));this.M--;return a};k.tb=function(a,b){this.L?(this.M++,a=ue(this,a,5),a&1&&this.b--,this.v.Eb(a,b),this.M--):this.v.tb(a,b)};
k.Fb=function(a,b){this.L?(this.M++,this.Oc(ue(this,a,4),b),this.M--):this.v.Fb(a,b)};k.Xc=function(a,b,c){return xe(this,a,b,c)};k.Yc=function(a,b,c){return ue(this,xe(this,a,b,c),c)};k.Hc=function(a){return this.v.ma(this.Mb=a)};k.be=function(a){return this.v.ma(this.Mb=ue(this,a,2))};k.Oc=function(a,b){this.v.ib(this.Mb=a,b&65535)};k.Ue=function(a,b){this.v.ib(this.Mb=ue(this,a,4),b)};
@ -251,7 +251,7 @@ function ni(a,b,c){var d,e=(c?a.L:a.mb).F;c=!1;if(void 0!==b){b=$h(a,b);"%"==b.c
function gi(a,b){a.j=a;a.la=a.Tc=536870912;a.ja=null;a.za=[];b=Xh(a,b.replace("keys","key").replace("kbd","keyboard"),!1,"|");if(b.length)for(var c in Cb){var d;a:if(d=void 0,Array.prototype.indexOf)d=b.indexOf(c,d);else{d=d||0;0>d&&(d+=b.length);0>d&&(d=0);for(var e=b.length;d<e;d++)if(d in b&&b[d]===c)break a;d=-1}0<=d&&(a.la|=Cb[c],a.i(c+" messages enabled"))}}function Vc(a,b,c){for(var d in Cb)if(b==Cb[d]){a.Ma[d]=c;break}}
k.wc=function(a){a=a.toUpperCase();var b=ji[a];null==b&&(b=-1,"R"==a.charAt(0)&&(b=+a.charAt(1),0>b||7<b))&&(b=-1);return b};function si(a){return 6>a?"R"+a:6==a?"SP":"PC"}
k.xc=function(a){var b;if(0<=a)if(8>a)b=this.b.u[a];else if(16>a)b=this.b.Za[a-8];else if(20>a)b=this.b.La[a-16];else{var c=this.b,d=this.w;switch(a){case 20:b=bd(this.b);break;case 21:b=c.Rb;break;case 22:b=c.ua;break;case 23:b=c.sb;break;case 24:b=Wc(c);break;case 25:b=Yc(c);break;case 26:b=Zc(c);break;case 27:b=c.Ta;break;case 28:d&&(b=d.ta);break;case 29:d&&(b=d.rb);break;case 30:d&&mc(d)&&(b=d.Ya)}}return b};
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.pa&65535).F));if(this.la&1073741824)this.za.push(a);else if(!this.ja||a!=this.ja){this.ja=a;if(this.la&-2147483648&&this.b&&this.b.A.W||wb(this,!0))this.da(),a+=" (cpu halted)";this.i(a);this.b&&(a=this.b,Ed(a),a.za=0,a.qa())}};
k.message=function(a,b){b&&(a+=" @"+J(this,Y(this.b.pa&65535).F));if(this.la&1073741824)this.za.push(a);else if(!this.ja||a!=this.ja){this.ja=a;b=!1;if(this.la&-2147483648&&this.b&&(b=this.b.A.W)||wb(this,!0))this.da(),b&&(a+=" (cpu halted)");this.i(a);this.b&&(a=this.b,Ed(a),a.za=0,a.qa())}};
function fi(a){var b;if(!He(a))a.H&&a.H.length&&a.i("instruction history buffer freed"),a.ba=0,a.H=[];else if(!a.H||!a.H.length){a.H=Array(1E3);for(b=0;b<a.H.length;b++)a.H[b]=Y();a.ba=0;a.i("instruction history buffer allocated")}}k.jb=function(a,b){if(!ti(this,b))return!1;this.b.jb(a);return!0};
k.kb=function(a,b,c){if(!ti(this))return!1;null===b&&(b=!this.yb||"tr"==this.yb);this.K=0;a||He(this)&&Ie(this,this.b.u[7],0);try{a=Fd(this.b,a);var d=this.b.kb(a);0<d&&(Sb(this.b,d),this.K+=d,Tb(this.b,d,!0),Ub(this.b,d),this.Aa++)}catch(e){"number"!=typeof e&&(this.K=0,zb(this.b,e.stack||e.message))}!1!==c&&(this.w&&this.w.stop&&this.w.stop(),this.C.qa(-1));zd(this,b||!1);return 0<this.K};k.da=function(a){this.b&&this.b.da(a)};
function zd(a,b){if(a.lb){void 0===b&&(b=!0);var c;c=a.b;if(c=c.J&8?c.md|c.ld<<8:0){var d=c>>8;a.i("trapped to "+J(a,c&255,1)+" ("+(0>d?Bb[-d]:J(a,d))+")")}a.L=Y(a.b.u[7]);b&&1!=a.O?ui(a):vi(a)}}function ti(a,b){var c;(c=!a.b||!xb(a.b))||(c=a.b,c.A.ia?c=!0:(c.i(c.toString()+" not powered"),c=!1),c=!c);return c||a.b.A.W?(b||a.i("cpu busy or unavailable, command ignored"),!1):!yb(a.b)}k.Ka=function(a,b){return!b&&(this.reset(!0),a&&this.restore&&!this.restore(a))?!1:!0};