From 7f48221bca533af449632baa1fd159c39b0dad42 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 24 Nov 2016 09:14:01 -0800 Subject: [PATCH] Fixed TEST 40 in diagnostic EKBBF0 by including address 177776 in the RED stack overflow range --- disks/dec/rl02k/xxdp/ekbad0/README.md | 10 ++ disks/dec/rl02k/xxdp/ekbbf0/README.md | 131 ++++++++++++++++++++++++-- modules/pdp11/lib/cpustate.js | 15 +++ versions/pdpjs/1.30.4/pdp11-dbg.js | 2 +- versions/pdpjs/1.30.4/pdp11.js | 2 +- 5 files changed, 149 insertions(+), 11 deletions(-) diff --git a/disks/dec/rl02k/xxdp/ekbad0/README.md b/disks/dec/rl02k/xxdp/ekbad0/README.md index cee94fc6d..04d365dc3 100644 --- a/disks/dec/rl02k/xxdp/ekbad0/README.md +++ b/disks/dec/rl02k/xxdp/ekbad0/README.md @@ -42,3 +42,13 @@ p. 1-6: SW05 = 1 skip bus request 5 test SW04 = 1 skip bus request 4 test SW00 = 1 skip operator intervention testing + +The closest we have to a source code listing of the EKBAD0 diagnostic comes from some +[scanned microfiche](http://archive.pcjs.org/pubs/dec/pdp11/diags/AH-7963D-MC_CEKBAD0_1170_CPU_1_May80.pdf) +on [bitsavers.org](http://bitsavers.trailing-edge.com/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/) for: + + PRODUCT CODE: AC-7962D-MC + PRODUCT NAME: CEKBAD0 11/70 CPU #1 + DATE CREATED: MAY, 1980 + MAINTAINER: DIAGNOSTIC ENGINEERING + diff --git a/disks/dec/rl02k/xxdp/ekbbf0/README.md b/disks/dec/rl02k/xxdp/ekbbf0/README.md index 330185148..70d5601a3 100644 --- a/disks/dec/rl02k/xxdp/ekbbf0/README.md +++ b/disks/dec/rl02k/xxdp/ekbbf0/README.md @@ -11,7 +11,7 @@ From the [PDP-11 Diagnostic Handbook (1988)](http://archive.pcjs.org/pubs/dec/pdp11/diags/PDP11_DiagnosticHandbook_1988.pdf), p. 1-7: - 11/70 CPU DIAGNOSTIC PART 1 + 11/70 CPU DIAGNOSTIC PART 2 ABSTRACT: @@ -44,10 +44,7 @@ p. 1-7: SW01 = 1 test selector (with switch 8) SW00 = 1 skip operator intervention testing -At the moment, PDPjs is failing a couple of tests within this diagnostic: - - .R EKBBF0 - EKBBF0.BIC +When I first ran this diagnostic in PDPjs, it failed a few tests: CEKBBF0 11/70 CPU #2 A @@ -55,11 +52,127 @@ At the moment, PDPjs is failing a couple of tests within this diagnostic: NOT GETTING TO TMCD E31 OR E31 BAD ERRORPC TEST NUMBER 020646 000040 - - - CPU UNDER TEST FOUND TO BE A KB11-B/C OR KB11-CM - + + + CPU UNDER TEST FOUND TO BE A KB11-B/C OR KB11-CM + TMCA E67(8) NOT GETTING TO E76(13) OR E76 IS BAD ERRORPC TEST NUMBER 026030 000063 + +After setting a breakpoint at 020646 and then dumping the instruction history buffer when it was hit: + >> bp 020646 + bp 020646 set + >> g + bp 020646 hit + stopped (18110643 instructions, 86218232 cycles, 12936 ms, 6664984 hz) + R0=177777 R1=032435 R2=152110 R3=000024 R4=153352 R5=001164 + SP=001076 PC=020646 PS=000000 IR=000000 SL=000377 T0 N0 Z0 V0 C0 + 020646: 104241 EMT 241 + >> dh 22 22 + 020404: 012767 021136 160656 MOV #21136,001270 ;history=22 + 020412: 012767 020450 160466 MOV #20450,001106 ;history=21 + 020420: 013767 177776 160542 MOV @#177776,001170 ;history=20 + 020426: 032737 000020 177776 BIT #20,@#177776 ;history=19 + 020434: 001405 BEQ 020450 ;history=18 + 020450: 012737 000340 000006 MOV #340,@#6 ;history=17 + 020456: 012767 020472 160424 MOV #20472,001110 ;history=16 + 020464: 012737 020530 000024 MOV #20530,@#24 ;history=15 + 020472: 012737 020546 000004 MOV #20546,@#4 ;history=14 + 020500: 012706 000336 MOV #336,SP ;history=13 + 020504: 012700 177777 MOV #177777,R0 ;history=12 + 020510: 010016 MOV R0,@SP ;history=11 + 020546: 023727 000000 020512 CMP @#0,#20512 ;history=10 + 020554: 001407 BEQ 020574 ;history=9 + 020574: 022737 177777 000336 CMP #177777,@#336 ;history=8 + 020602: 001003 BNE 020612 ;history=7 + 020612: 012767 020620 160270 MOV #20620,001110 ;history=6 + 020620: 012737 020650 000004 MOV #20650,@#4 ;history=5 + 020626: 012706 177776 MOV #177776,SP ;history=4 + 020632: 005016 CLR @SP ;history=3 + 020634: 012706 001076 MOV #1076,SP ;history=2 + 020640: 012737 032636 000004 MOV #32636,@#4 ;history=1 + 020646: 104241 EMT 241 + +The closest we have to a source code listing of the EKBBF0 diagnostic comes from some +[scanned microfiche](http://archive.pcjs.org/pubs/dec/pdp11/diags/AH-7968F-MC_CEKBBF0_1170_CPU_2_May80.pdf) +on [bitsavers.org](http://bitsavers.trailing-edge.com/pdf/dec/pdp11/microfiche/ftp.j-hoppe.de/bw/gh/) for: + + PRODUCT CODE: AC-7966F-MC + PRODUCT NAME: CEKBBF0 11/70 CPU #2 + DATE CREATED: MAY, 1980 + MAINTAINER: DIAGNOSTIC ENGINEERING + +The source code listing for TEST 40 appears to match the code above: + + ;;*************************************************************** + ;*TEST 40 RED ZONE TRAP + ;* + ;* A RED ZONE TRAP IS FIRST ATTEMPTED WITH THE SP AT 336. + ;* IF BEN13 FAILS EXECUTION WILL GO TO EITHER BRK.80 OR BRK.20 + ;* OR PUP.00. + ;* BRK.80 WILL CAUSE THE OLD PSW AND PC TO BE STACKED ON THE + ;* OLD STACK INSTEAD OF LOCATIONS 2 AND 0. + ;* BRK.20 WILL MAKE IT LOOK LIKE THE RED ZONE FAILED. + ;* PUP.00 WILL CAUSE A TRAP TO LOCATION 24. + ;* + ;* IF THE PROCESSOR FAILS TO TRAP EITHER TMCD SL RED IS + ;* NOT GOING LOW OR TMCC ABORT IS NOT GOING LOW. + ;* + ;* IF UBCB ABOTR RESTART FAILS TO GO LOW OR E10(13) + ;* IS BAD THE PROCESSOR WILL HANG IN THE PAUSE STATE. + ;;*************************************************************** + TST40: SCOPE + MOV #TST41,NEXTTST ;SAVE ADDRESS OF NEXT TEST + MOV #14$,$LPADR ;SETUP LOOP ADR + MOV @#PSW,$TMP3 ;SAVE PSW + BIT #BIT4,@#PSW ;IS T BIT ON? + BEQ 14$ ;BRANCH IF NO + MOV #PR7,-(SP) ;PUT NEW PSW ON STACK + MOV #14$,-(SP) ;PUT RETURN ADR ON STACK + RTT ;TURN T BIT OFF + 14$: MOV #PR7,@#ERRVEC+2 ;RESTORE ERRVEC PSW + MOV #64$,$LPERR ;SETUP ERROR LOOP + MOV #3$,@#PWRVEC ;SETUP LOCATION 24 + 64$: MOV #1$,@#ERRVEC ;SETUP ERRVEC + MOV #336,SP ;SET THE SP TO RED ZONE + MOV #-1,R0 ;SETUP R0 + MOV R0,(SP) ;EXECUTE THE TRAP INSTRUCTION + 6$: MOV #STACK,SP ;RESET THE SP + MOV #CPUSPUR,@#ERRVEC ;RESTORE ERRVEC + ERROR 235 ;RED ZONE REFERENCE FAILED TO TRAP + BR 8$ + 3$: MOV #STACK,SP ;RESET THE SP + MOV #CPUSPUR,@#ERRVEC ;RESTORE LOCATION 4 + ERROR 237 ;BEN 13 FAILED TO PUP.00 + BR 8$ + 1$: CMP @#0,#6$ ;DID BEN 13 FAIL? + BEQ 7$ ;BRANCH IF NO + MOV #STACK,SP ;RESET THE SP + MOV #CPUSPUR,@#ERRVEC ;RESTORE ERRVEC + ERROR 240 ;BEN 13 FAILED TO BRK.80 + BR 8$ + 7$: CMP #-1,@#336 ;;DID YEL ZONE OCCUR? + BNE 8$ ;BRANCH IF NO + CLR @#336 ;SETUP FOR LOOPING + ERROR 251 ;YEL ZONE IN RED REGION + ; + ;TEST TO ENSURE PSW REFERENCE VIA THE SP CAUSES A RED ZONE TRAP + 8$: MOV #63$,$LPERR ;SETUP ERROR LOOP + 63$: MOV #4$,@#ERRVEC ;SETUP ERRVEC + MOV #PSW,SP ;PUT ADDRESS OF PSW IN SP + CLR (SP) ;EXECUTE THE TRAP CAUSING INSTRUCTION + MOV #1076,SP ;RESET THE SP + MOV #CPUSPUR,@#ERRVEC ;RESTORE ERRVEC + ERROR 241 ;NO RED ZONE ON STACK OVERFLOW + +PDPjs was failing to trigger a RED stack violation on this instruction: + + R0=177777 R1=032435 R2=152110 R3=000024 R4=153352 R5=001164 + SP=177776 PC=020632 PS=000350 IR=000000 SL=000377 T0 N1 Z0 V0 C0 + 020632: 005016 CLR @SP ;cycles=7 + +so execution fell into `ERROR 241`. This was resolved by updating the *checkStackLimit1145()* function +in [cpustate.js](/modules/pdp11/lib/cpustate.js) to include stack addresses >= 177776 in the RED stack +overflow range test. diff --git a/modules/pdp11/lib/cpustate.js b/modules/pdp11/lib/cpustate.js index 8e8fd3695..3e57e8317 100644 --- a/modules/pdp11/lib/cpustate.js +++ b/modules/pdp11/lib/cpustate.js @@ -1980,8 +1980,23 @@ CPUStatePDP11.prototype.checkStackLimit1145 = function(access, step, addr) /* * NOTE: The 11/70 CPU Instruction Exerciser does NOT expect reads to trigger a stack overflow, * so we check the access parameter. + * + * Moreover, TEST 40 of diagnostic EKBBF0 executes this instruction: + * + * R0=177777 R1=032435 R2=152110 R3=000024 R4=153352 R5=001164 + * SP=177776 PC=020632 PS=000350 IR=000000 SL=000377 T0 N1 Z0 V0 C0 + * 020632: 005016 CLR @SP ;cycles=7 + * + * expecting a RED stack overflow trap. Yes, using *any* addresses in the IOPAGE for the stack isn't + * a good idea, but who said it was illegal? For now, we're going to restrict overflows to the highest + * address tested by the diagnostic (0xFFFE, aka the PSW), by making that address negative. */ + if (addr >= 0xFFFE) addr |= ~0xFFFF; if ((access & PDP11.ACCESS.WRITE) && addr <= this.regSL) { + /* + * regSL can never fall below 0xFF, so this subtraction can never go negative, so this comparison + * is always safe. + */ if (addr <= this.regSL - 32) { this.trap(PDP11.TRAP.BUS, 0, PDP11.REASON.RED); } else { diff --git a/versions/pdpjs/1.30.4/pdp11-dbg.js b/versions/pdpjs/1.30.4/pdp11-dbg.js index f306c3175..5e25f44df 100644 --- a/versions/pdpjs/1.30.4/pdp11-dbg.js +++ b/versions/pdpjs/1.30.4/pdp11-dbg.js @@ -133,7 +133,7 @@ function Zd(a){var b=ue(a),c=ue(a)&-1793;a.P&49152&&(c=c&-225|a.P&63712);T(a,b); function ve(a,b,c){var d,e,f;if(!(c&a.O))return f=b&65535,57344<=f&&(f|=a.zc),f;d=b>>13;a.Xa&a.gd[a.A]||(d&=7);e=a.S[a.A][d];f=(a.ka[a.A][d]<<6)+(b&8191)&a.Pa;if(a.J)return f;f&1&&!(c&1)&&(a.Ba|=64,a.va(4,0,f));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.S[a.A][d]=e;if(f!=(4194170&a.Pa)||a.A)a.qb= a.A,a.rb=d;g&&(g&57344&&(0<=a.Ga&&(g|=128),a.Ca&57344||(g|=a.Ca&4096|a.qb<<5|a.rb<<1,Qc(a,a.Ca&-61695|g&61694)),a.va(168,64,-1)),a.Ca&61440||!(f<(4191360&a.Pa)||f>(4194239&a.Pa))||(a.Ca|=4096,a.Ca&512&&(a.K|=64)));return f}function we(a,b){return a.v.cc(b)}function ue(a){var b=a.za(a.u[6]|a.T);a.u[6]=a.u[6]+2&65535;return b}function Yd(a,b,c){var d=a.u[6]-2&65535;a.u[6]=d;a.ta=a.ta&65535|(a.ta&-65536)<<8|16121856;c||a.xa(4,-2,d);a.Zb(d,b)} function xe(a,b,c,d){var e,f,g=d&8?0:a.T;switch(b){case 0:return a.va(4,0,-2),0;case 1:return 6==c&&a.xa(d,0,a.u[6]),a.b-=3,7==c?a.u[c]:a.u[c]|g;case 2:f=2;e=a.u[c];6==c&&a.xa(d,f,e);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.za(e);e|=g;a.b-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.u[c]+f&65535;6==c&&a.xa(d,f,e);7!=c&&(e|=g);a.b-=4;break;case 5:f=-2;e=a.u[c]-2&65535;7!=c&&(e|=g);e=a.za(e)|g;a.b-=8;break;case 6:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,6==c&&a.xa(d, -0,e),a.b-=6,e|g;case 7:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,e=a.za(e|a.T),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ta=a.ta&65535|(a.ta&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.lb&&(this.K|=32)};k.sd=function(a,b,c){!this.A&&a&4&&c<=this.lb&&(c<=this.lb-32?this.va(4,0,-3):(this.Ba|=8,this.K|=32))};k.dc=function(a){if(!this.O)return this.v.dc(a);this.J++;a=we(this,ve(this,a,3));this.J--;return a}; +0,e),a.b-=6,e|g;case 7:return e=a.za(Rd(a,2)),e=e+a.u[c]&65535,e=a.za(e|a.T),a.b-=10,e|g}a.u[c]=a.u[c]+f&65535;a.ta=a.ta&65535|(a.ta&-65536)<<8|(f<<3&248|c)<<16;return e}k.rd=function(a,b,c){!this.A&&0>=b&&c<=this.lb&&(this.K|=32)};k.sd=function(a,b,c){this.A||(65534<=c&&(c|=-65536),a&4&&c<=this.lb&&(c<=this.lb-32?this.va(4,0,-3):(this.Ba|=8,this.K|=32)))};k.dc=function(a){if(!this.O)return this.v.dc(a);this.J++;a=we(this,ve(this,a,3));this.J--;return a}; k.Va=function(a){if(!this.O)return this.v.Va(a);this.J++;a=this.Pc(ve(this,a,2));this.J--;return a};k.Cb=function(a,b){this.O?(this.J++,a=ve(this,a,5),a&1&&this.b--,this.v.Kb(a,b),this.J--):this.v.Cb(a,b)};k.nb=function(a,b){this.O?(this.J++,this.Vc(ve(this,a,4),b),this.J--):this.v.nb(a,b)};k.ud=function(a,b,c){return xe(this,a,b,c)};k.vd=function(a,b,c){return ve(this,xe(this,a,b,c),c)};k.Pc=function(a){return this.v.sa(this.Rb=a)};k.Be=function(a){return this.v.sa(this.Rb=ve(this,a,2))}; k.Vc=function(a,b){this.v.Db(this.Rb=a,b&65535)};k.Bf=function(a,b){this.v.Db(this.Rb=ve(this,a,4),b)};function ye(a,b,c){var d=a.f=b&7;(b=a.g=(b&56)>>3)?(d=xe(a,b,d,2),c&65536||61440!==(a.P&61440)&&(d&=65535),a.A=a.P>>12&3,c=a.za(d|c&a.T),a.A=a.P>>14&3):c=6!=d||(a.P>>2&12288)===(a.P&12288)?a.u[d]:a.Oa[a.P>>12&3];return c} function ze(a,b,c,d){a.ta=a.ta&65535|1441792;var e=a.f=b&7;(b=a.g=(b&56)>>3)?(e=xe(a,b,e,4),c&65536||(e&=65535),a.A=a.P>>12&3,e=ve(a,e|c&65536,4),a.A=a.P>>14&3,a.v.Db(e,d)):6!=e||(a.P>>2&12288)===(a.P&12288)?a.u[e]=d:a.Oa[a.P>>12&3]=d}function Ae(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?we(a,a.da(b,c,3)):a.u[c+a.vb]&a.Cc}function Be(a,b){b>>=6;var c=a.H=b&7;return(b=a.F=(b&56)>>3)?a.v.sa(a.da(b,c,2)):a.u[c+a.vb]}function Ce(a,b){var c=a.f=b&7;b=a.g=(b&56)>>3;return xe(a,b,c,8)} diff --git a/versions/pdpjs/1.30.4/pdp11.js b/versions/pdpjs/1.30.4/pdp11.js index e4a050143..9fa2df0a4 100644 --- a/versions/pdpjs/1.30.4/pdp11.js +++ b/versions/pdpjs/1.30.4/pdp11.js @@ -122,7 +122,7 @@ function Sc(a){var b=Tc(a),c=Tc(a)&-1793;a.F&49152&&(c=c&-225|a.F&63712);Q(a,b); function Uc(a,b,c){var d,e,f;if(!(c&a.ka))return f=b&65535,57344<=f&&(f|=a.Ub),f;d=b>>13;a.Ea&a.Ic[a.u]||(d&=7);e=a.I[a.u][d];f=(a.ca[a.u][d]<<6)+(b&8191)&a.Ya;if(a.sa)return f;f&1&&!(c&1)&&(a.ja|=64,J(a,4,0,f));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.I[a.u][d]=e;if(f!=(4194170&a.Ya)||a.u)a.lb= a.u,a.mb=d;g&&(g&57344&&(0<=a.Oa&&(g|=128),a.Z&57344||(g|=a.Z&4096|a.lb<<5|a.mb<<1,$b(a,a.Z&-61695|g&61694)),J(a,168,64,-1)),a.Z&61440||!(f<(4191360&a.Ya)||f>(4194239&a.Ya))||(a.Z|=4096,a.Z&512&&(a.v|=64)));return f}function Tc(a){var b=a.Y(a.f[6]|a.V);a.f[6]=a.f[6]+2&65535;return b}function Rc(a,b,c){var d=a.f[6]-2&65535;a.f[6]=d;a.A=a.A&65535|(a.A&-65536)<<8|16121856;c||a.Ka(4,-2,d);a.zb(d,b)} function Vc(a,b,c,d){var e,f,g=d&8?0:a.V;switch(b){case 0:return J(a,4,0,-2),0;case 1:return 6==c&&a.Ka(d,0,a.f[6]),a.a-=3,7==c?a.f[c]:a.f[c]|g;case 2:f=2;e=a.f[c];6==c&&a.Ka(d,f,e);7!=c&&(e|=g,6>c&&d&1&&(f=1));a.a-=3;break;case 3:f=2;e=a.f[c];7!=c&&(e|=g);e=a.Y(e);e|=g;a.a-=7;break;case 4:f=-2;6>c&&d&1&&(f=-1);e=a.f[c]+f&65535;6==c&&a.Ka(d,f,e);7!=c&&(e|=g);a.a-=4;break;case 5:f=-2;e=a.f[c]-2&65535;7!=c&&(e|=g);e=a.Y(e)|g;a.a-=8;break;case 6:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,6==c&&a.Ka(d,0, -e),a.a-=6,e|g;case 7:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,e=a.Y(e|a.V),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Bc=function(a,b,c){!this.u&&0>=b&&c<=this.ib&&(this.v|=32)};h.Cc=function(a,b,c){!this.u&&a&4&&c<=this.ib&&(c<=this.ib-32?J(this,4,0,-3):(this.ja|=8,this.v|=32))};h.Qa=function(a){if(!this.ka)return this.g.Qa(a);this.sa++;a=this.fc(Uc(this,a,2));this.sa--;return a}; +e),a.a-=6,e|g;case 7:return e=a.Y(Kc(a,2)),e=e+a.f[c]&65535,e=a.Y(e|a.V),a.a-=10,e|g}a.f[c]=a.f[c]+f&65535;a.A=a.A&65535|(a.A&-65536)<<8|(f<<3&248|c)<<16;return e}h.Bc=function(a,b,c){!this.u&&0>=b&&c<=this.ib&&(this.v|=32)};h.Cc=function(a,b,c){this.u||(65534<=c&&(c|=-65536),a&4&&c<=this.ib&&(c<=this.ib-32?J(this,4,0,-3):(this.ja|=8,this.v|=32)))};h.Qa=function(a){if(!this.ka)return this.g.Qa(a);this.sa++;a=this.fc(Uc(this,a,2));this.sa--;return a}; h.jb=function(a,b){this.ka?(this.sa++,a=Uc(this,a,5),a&1&&this.a--,Qb(this.g,a,b),this.sa--):this.g.jb(a,b)};h.Va=function(a,b){this.ka?(this.sa++,this.lc(Uc(this,a,4),b),this.sa--):this.g.Va(a,b)};h.Ec=function(a,b,c){return Vc(this,a,b,c)};h.Fc=function(a,b,c){return Uc(this,Vc(this,a,b,c),c)};h.fc=function(a){return Pb(this.g,this.fb=a)};h.Od=function(a){return Pb(this.g,this.fb=Uc(this,a,2))};h.lc=function(a,b){Rb(this.g,this.fb=a,b&65535)};h.Ne=function(a,b){Rb(this.g,this.fb=Uc(this,a,4),b)}; function Wc(a,b,c){var d=a.b=b&7;(b=a.c=(b&56)>>3)?(d=Vc(a,b,d,2),c&65536||61440!==(a.F&61440)&&(d&=65535),a.u=a.F>>12&3,c=a.Y(d|c&a.V),a.u=a.F>>14&3):c=6!=d||(a.F>>2&12288)===(a.F&12288)?a.f[d]:a.ra[a.F>>12&3];return c}function Xc(a,b,c,d){a.A=a.A&65535|1441792;var e=a.b=b&7;(b=a.c=(b&56)>>3)?(e=Vc(a,b,e,4),c&65536||(e&=65535),a.u=a.F>>12&3,e=Uc(a,e|c&65536,4),a.u=a.F>>14&3,Rb(a.g,e,d)):6!=e||(a.F>>2&12288)===(a.F&12288)?a.f[e]=d:a.ra[a.F>>12&3]=d} function Yc(a,b){b>>=6;var c=a.G=b&7;(b=a.D=(b&56)>>3)?(c=a.P(b,c,3),a=Nb(a.g,c)):a=a.f[c+a.sb]&a.Yb;return a}function Zc(a,b){b>>=6;var c=a.G=b&7;return(b=a.D=(b&56)>>3)?Pb(a.g,a.P(b,c,2)):a.f[c+a.sb]}function $c(a,b){var c=a.b=b&7;b=a.c=(b&56)>>3;return Vc(a,b,c,8)}function ad(a,b){var c=a.b=b&7;(b=a.c=(b&56)>>3)?(c=a.P(b,c,3),a=Nb(a.g,c)):a=a.f[c]&255;return a}function bd(a,b){var c=a.b=b&7;return(b=a.c=(b&56)>>3)?Pb(a.g,a.P(b,c,2)):a.f[c]}