Post Reply 
Major bug on G2
03-06-2019, 12:47 PM (This post was last modified: 03-06-2019 02:28 PM by Oulan.)
Post: #1
Major bug on G2
When making some test to optimize some code I got a very nasty bug

Program leads to "reboot screen"
"Your HP Prime had a
problem and will
will reboot in 3 seconds" ...

got the trouble even after CFO,reset finally the problem disappear ... then reappears

AFTER CFO-ON, format C:, reset
mem INFO gives Memory 246.86MB, Storage 461.68MB
next one, reset
mem INFO gives Memory 246.93MB, Storage 461.59MB
next one with format C:, reset
mem INFO gives Memory 246.88MB, Storage 461.68MB

So it seems that I definitely lost 256MB of ram Sad
--EDIT--
Or I was misreading the info at first, I think that I saw Memory about 400MB but
as it seems that the G2 only got a 256MB ram chip so I was certainly misreading ...
So ram seems ok
--EDIT--

CFO screen
=======================================
Besta V1.0 EA656 DIAGNOSTIC
DATA: V14181 OS(4M):2.1
ONLY RECH: 4.25V BOOT V2.060.650
SLC 512MB SLC
---------------------------------------
1.L/B TEST 8.TP FW Refresh
2.M/B TEST 9.RESET
3.F/A TEST A.Version Info
4.FLS Utility B.DEEP MODE
5.Evaluation C.POWER OFF MODE
6.RELIABILITY
7.USB TEST
---------------------------------------
SERIAL NO: NAANNNNNAN
=======================================
EA656 Version Info
DATA Version : V14181
OS Version : 2.1
PCB Version : D
Touch IC FW Ver :GT5688-516
=======================================
EVALUATION/SRAM/SRAM TEST
5.FULL TEST : OK
=======================================

All tests seems ok

First run after CFO format reset was ok, then the pb re-appear (running prog with calc connected on USB)

Nexts runs leads to reboot too even with calc disconnected from USB

Program follows as source (sorry for the size)
=============================================
Code:

#pragma mode(separator(.,;) integer(h16))

LOCAL rA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
LOCAL rB=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
LOCAL rC=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
LOCAL rM=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
LOCAL rN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
LOCAL rZ=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
LOCAL rT=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];

LOCAL first=0;
LOCAL last=0;
LOCAL ptr=0;
LOCAL pp=2;
LOCAL pq=12;
LOCAL base=10;
LOCAL cy=0;
LOCAL p_cy=0;
LOCAL opcode=#0:16h;
LOCAL code=#0:16h;

LOCAL regZero(dest)
BEGIN
 FOR I FROM first TO last DO
  0▶dest(I);
 END;
 RETURN dest;
END;

LOCAL regCopy(src,dest) BEGIN
 FOR I FROM first TO last DO
  src(I)▶dest(I);
 END;
 RETURN dest;
END;

LOCAL regAdd(src1,src2,dest) BEGIN
 FOR I FROM first TO last DO
  src1(I)+src2(I)+cy▶dest(I); 
  IF dest(I)>=base THEN
   dest(I)-base▶dest(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
 RETURN dest;
END;

LOCAL regSub(src1,src2,dest) BEGIN
 FOR I FROM first TO last DO
  src1(I)-src2(I)-cy▶dest(I); 
  IF dest(I)<0 THEN
   dest(I)+base▶dest(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
 RETURN dest;
END;

LOCAL regTestNE(src1,src2) BEGIN
 FOR I FROM first TO last DO
  IF src1(I)≠src2(I) THEN 1▶cy;BREAK; END;
 END; 
END;

LOCAL regShiftR(dest) BEGIN
 FOR I FROM first TO last DO
  IF I=last THEN 0▶dest(I);
  ELSE dest(I+1)▶dest(I);
  END;
 END;
 RETURN dest;
END;

LOCAL regShiftL(dest) BEGIN
 FOR I FROM last DOWNTO first DO
  IF I=first THEN 0▶dest(I);
  ELSE dest(I-1)▶dest(I);
  END;
 END;
 RETURN dest;
END;

LOCAL opArith2() BEGIN
 IF code(2) THEN   // 1xx
  IF code(1) THEN  // 11x
   IF code(0) THEN // 7 s
    14▶F; 14▶L; 
   ELSE            // 6 m
    4▶F; 13▶L; 
   END;
  ELSE             // 10x
   IF code(0) THEN // 5 xs
    3▶F; 3▶L; 
   ELSE            // 4 pq
    pp+1▶F;pq+1▶L; 
    IF F>L THEN 14▶L; END;
    IF F>14 THEN 1▶F; END;
    IF L>14 THEN 1▶L; END;
   END;
  END;
 ELSE              // 0xx
  IF code(1) THEN  // 01x
   IF code(0) THEN // 3 w
    1▶F;14▶L; 
   ELSE            // 2 wpt
    1▶F;IFTE(ptr,pp,pq)+1▶L;
    IF L>14 THEN 1▶L; END;
   END;
  ELSE             // 00x
   IF code(0) THEN // 1 x
    1▶F; 3▶L; 
   ELSE            // 0 pt
    IFTE(ptr,pp,pq)+1▶F;F▶L;
    IF F>14 THEN 1▶F; END;
    IF L>14 THEN 1▶L; END;
   END;
  END;
 END;

 IF code(3) THEN     // 1xxxx
  IF code(4) THEN    //  11xxx
   IF code(5) THEN   //   111xx
    IF code(6) THEN  //    1111x
     IF code(7) THEN //     31 ASL
//       regShiftL(rA)▶rA;
 FOR I FROM L DOWNTO F DO
  IF I=F THEN 0▶rA(I);
  ELSE rA(I-1)▶rA(I);
  END;
 END;
     ELSE            //     30 CSR
//       regShiftR(rC)▶rC;
 FOR I FROM F TO L DO
  IF I=L THEN 0▶rC(I);
  ELSE rC(I+1)▶rC(I);
  END;
 END;
     END;
    ELSE             //    1110x 
     IF code(7) THEN //     29 BSR
//       regShiftR(rB)▶rB;
 FOR I FROM F TO L DO
  IF I=L THEN 0▶rB(I);
  ELSE rB(I+1)▶rB(I);
  END;
 END;
     ELSE            //     28 ASR
//      regShiftR(rA)▶rA;
 FOR I FROM F TO L DO
  IF I=L THEN 0▶rA(I);
  ELSE rA(I+1)▶rA(I);
  END;
 END;
     END;
    END;
   ELSE              //   110xx
    IF code(6) THEN  //    1101x
     IF code(7) THEN //     27 ?A#C
//      regTestNE(rA,rC);
 FOR I FROM F TO L DO
  IF rA(I)≠rC(I) THEN 1▶cy;BREAK; END;
 END; 
     ELSE            //     26 ?A#0
//      regTestNE(rA,rZ);
 FOR I FROM F TO L DO
  IF rA(I)≠0 THEN 1▶cy;BREAK; END;
 END; 
     END;
    ELSE             //    1100x 
     IF code(7) THEN //     25 ?A<B
//      regSub(rA,rB,rT);
 FOR I FROM F TO L DO
  rA(I)-rB(I)-cy▶T; 
  IF T<0 THEN
   1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     24 ?A<C
//      regSub(rA,rC,rT);
 FOR I FROM F TO L DO
  rA(I)-rC(I)-cy▶T; 
  IF T<0 THEN
   1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    END;
   END;
  ELSE               //  10xxx
   IF code(5) THEN   //   101xx
    IF code(6) THEN  //    1011x
     IF code(7) THEN //     23 ?C#0
//      regTestNE(rC,rZ);
 FOR I FROM F TO L DO
  IF rC(I)≠0 THEN 1▶cy;BREAK; END;
 END; 
     ELSE            //     22 ?B#0
//      regTestNE(rB,rZ);
 FOR I FROM F TO L DO
  IF rB(I)≠0 THEN 1▶cy;BREAK; END;
 END; 
     END;
    ELSE             //    1010x 
     IF code(7) THEN //     21 C=-C-1
//      1▶cy;regSub(rZ,rC,rC)▶rC;
 1▶cy;
 FOR I FROM F TO L DO
  -rC(I)-cy▶rC(I); 
  IF rC(I)<0 THEN
   rC(I)+base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     20 C=-C
//      regSub(rZ,rC,rC)▶rC;
 FOR I FROM F TO L DO
  -rC(I)▶rC(I); 
  IF rC(I)<0 THEN
   rC(I)+base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    END;
   ELSE              //   100xx
    IF code(6) THEN  //    1001x
     IF code(7) THEN //     19 C=C-1
//      1▶cy;regSub(rC,rZ,rC)▶rC;
 1▶cy;
 FOR I FROM F TO L DO
  rC(I)-cy▶rC(I); 
  IF rC(I)<0 THEN
   rC(I)+base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     18 C=A-C
//      regSub(rA,rC,rC)▶rC;
 FOR I FROM F TO L DO
  rA(I)-rC(I)-cy▶rC(I); 
  IF rC(I)<0 THEN
   rC(I)+base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    ELSE             //    1000x 
     IF code(7) THEN //     17 C=C+1
//      1▶cy;regAdd(rC,rZ,rC)▶rC;
 1▶cy;
 FOR I FROM F TO L DO
  rC(I)+cy▶rC(I); 
  IF rC(I)>=base THEN
   rC(I)-base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     16 C=A+C
//      regAdd(rA,rC,rC)▶rC;
 FOR I FROM F TO L DO
  rA(I)+rC(I)+cy▶rC(I); 
  IF rC(I)>=base THEN
   rC(I)-base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    END;
   END;
  END;
 ELSE                // 0xxxx 
  IF code(4) THEN    //  01xxx
   IF code(5) THEN   //   011xx
    IF code(6) THEN  //    0111x
     IF code(7) THEN //     15 C=C+C
//      regAdd(rC,rC,rC)▶rC;
 FOR I FROM F TO L DO
  rC(I)+rC(I)+cy▶rC(I); 
  IF rC(I)>=base THEN
   rC(I)-base▶rC(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     14 A=A-C
//      regSub(rA,rC,rA)▶rA;
 FOR I FROM F TO L DO
  rA(I)-rC(I)-cy▶rA(I); 
  IF rA(I)<0 THEN
   rA(I)+base▶rA(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    ELSE             //    0110x 
     IF code(7) THEN //     13 A=A-1
//      1▶cy;regSub(rA,rZ,rA)▶rA;
 1▶cy;
 FOR I FROM F TO L DO
  rA(I)-cy▶rA(I); 
  IF rA(I)<0 THEN
   rA(I)+base▶rA(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     12 A=A-B
//      regSub(rA,rB,rA)▶rA;
 FOR I FROM F TO L DO
  rA(I)-rB(I)-cy▶rA(I); 
  IF rA(I)<0 THEN
   rA(I)+base▶rA(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    END;
   ELSE              //   010xx
    IF code(6) THEN  //    0101x
     IF code(7) THEN //     11 A=A+1 
//      1▶cy;regAdd(rA,rZ,rA)▶rA;
 1▶cy;
 FOR I FROM F TO L DO
  rA(I)+cy▶rA(I); 
  IF rA(I)>=base THEN
   rA(I)-base▶rA(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //     10 A=A+C
//      regAdd(rA,rC,rA)▶rA;
 FOR I FROM F TO L DO
  rA(I)+rC(I)+cy▶rA(I); 
  IF rA(I)>=base THEN
   rA(I)-base▶rA(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     END;
    ELSE             //    0100x 
     IF code(7) THEN //      9 A=A+B
//      regAdd(rA,rB,rA)▶rA;
 FOR I FROM F TO L DO
  rA(I)+rB(I)+cy▶rA(I); 
  IF rA(I)>=base THEN
   rA(I)-base▶rA(I); 1▶cy;
  ELSE 
   0▶cy;
  END;
 END;
     ELSE            //      8  A=C
//      regCopy(rC,rA)▶rA;
 FOR I FROM F TO L DO
  rC(I)▶rA(I); 
 END;
     END;
    END;
   END;
  ELSE               //  00xxx
   IF code(5) THEN   //   001xx
    IF code(6) THEN  //    0011x
     IF code(7) THEN //      7 BC EX
//      rB▶rT; regCopy(rC,rB)▶rB; regCopy(rT,rC)▶rC;
 FOR I FROM F TO L DO
  rC(I)▶T;rB(I)▶rC(I);T▶rB(I); 
 END;
     ELSE            //      6 C=B 
//      regCopy(rB,rC)▶rC;
 FOR I FROM F TO L DO
  rB(I)▶rC(I); 
 END;
     END;
    ELSE             //    0010x 
     IF code(7) THEN //      5  AC EX 
//      rA▶rT; regCopy(rC,rA)▶rA; regCopy(rT,rC)▶rC;
 FOR I FROM F TO L DO
  rC(I)▶T;rA(I)▶rC(I);T▶rA(I); 
 END;
     ELSE            //      4 B=A
//      regCopy(rA,rB)▶rB;
 FOR I FROM F TO L DO
  rA(I)▶rB(I); 
 END;
     END;
    END;
   ELSE              //   000xx
    IF code(6) THEN  //    0001x
     IF code(7) THEN //      3  AB EX
//      rA▶rT; regCopy(rB,rA)▶rA; regCopy(rT,rB)▶rB;
 FOR I FROM F TO L DO
  rB(I)▶T;rA(I)▶rB(I);T▶rA(I); 
 END;
     ELSE            //      2 C=0
//      regZero(rC)▶rC;
 FOR I FROM F TO L DO
  0▶rC(I); 
 END;
     END;
    ELSE             //    0000x 
     IF code(7) THEN //      1 B=0
//      regZero(rB)▶rB;
 FOR I FROM F TO L DO
  0▶rB(I); 
 END;
     ELSE            //      0 A=0
//      regZero(rA)▶rA;
 FOR I FROM F TO L DO
  0▶rA(I); 
 END;
     END;
    END;
   END;
  END;
 END;
END;
 
LOCAL opArith3() BEGIN
 code(0,3)▶J;
 CASE
  IF J=0 THEN  // pt
   IFTE(ptr,pp,pq)+1▶F;F▶L;
   IF F>14 THEN 1▶F; END;
   IF L>14 THEN 1▶L; END;
  END;
  IF J=1 THEN  // x
   1▶F; 3▶L; 
  END;
  IF J=2 THEN  // wpt
   1▶F;IFTE(ptr,pp,pq)+1▶L;
   IF L>14 THEN 1▶L; END;
  END;
  IF J=3 THEN  // w
   1▶F;14▶L; 
  END;
  IF J=4 THEN  // pq 
   pp+1▶first;pq+1▶L; 
   IF F>L THEN 14▶L; END;
   IF F>14 THEN 1▶F; END;
   IF L>14 THEN 1▶L; END;
  END;
  IF J=5 THEN  // xs
   3▶F; 3▶L; 
  END;
  IF J=6 THEN  // m
   4▶F; 13▶L; 
  END;
  DEFAULT      // s
   14▶F; 14▶L; 
 END;
 code(3,5)▶H;
 CASE
  IF H=0 THEN  // A=0
   FOR I FROM F TO L DO
    0▶rA(I); 
   END;
  END;
  IF H=1 THEN  // B=0
   FOR I FROM F TO L DO
    0▶rB(I); 
   END;
  END;
  IF H=2 THEN  // C=0
   FOR I FROM F TO L DO
    0▶rC(I); 
   END;
  END;
  IF H=3 THEN  // AB EX
   FOR I FROM F TO L DO
    rA(I)▶T;rB(I)▶rA(I);T▶rB(I); 
   END;
  END;
  IF H=4 THEN  // B=A
   FOR I FROM F TO L DO
    rA(I)▶rB(I); 
   END;
  END;
  IF H=5 THEN  // AC EX 
   FOR I FROM F TO L DO
    rA(I)▶T;rC(I)▶rA(I);T▶rC(I); 
   END;
  END;
  IF H=6 THEN  // C=B 
   FOR I FROM F TO L DO
    rB(I)▶rC(I); 
   END;
  END;
  IF H=7 THEN  // BC EX
   FOR I FROM F TO L DO
    rC(I)▶T;rB(I)▶rC(I);T▶rB(I); 
   END;
  END;
  IF H=8 THEN  // A=C
   FOR I FROM F TO L DO
    rC(I)▶rA(I); 
   END;
  END;
  IF H=9 THEN  // A=A+B
   FOR I FROM F TO L DO
    rA(I)+rB(I)+cy▶rA(I); 
    IF rA(I)>=base THEN
     rA(I)-base▶rA(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=10 THEN // A=A+C
   FOR I FROM F TO L DO
    rA(I)+rC(I)+cy▶rA(I); 
    IF rA(I)>=base THEN
     rA(I)-base▶rA(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=11 THEN // A=A+1 
   1▶cy;
   FOR I FROM F TO L DO
    rA(I)+cy▶rA(I); 
    IF rA(I)>=base THEN
     rA(I)-base▶rA(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=12 THEN // A=A-B
   FOR I FROM F TO L DO
    rA(I)-rB(I)-cy▶rA(I); 
    IF rA(I)<0 THEN
     rA(I)+base▶rA(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=13 THEN // A=A-1
   1▶cy;
   FOR I FROM F TO L DO
    rA(I)-cy▶rA(I); 
    IF rA(I)<0 THEN
     rA(I)+base▶rA(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=14 THEN // A=A-C
   FOR I FROM F TO L DO
    rA(I)-rC(I)-cy▶rA(I); 
    IF rA(I)<0 THEN
     rA(I)+base▶rA(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=15 THEN // C=C+C
   FOR I FROM F TO L DO
    rC(I)+rC(I)+cy▶rC(I); 
    IF rC(I)>=base THEN
     rC(I)-base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=16 THEN // C=A+C
   FOR I FROM F TO L DO
    rA(I)+rC(I)+cy▶rC(I); 
    IF rC(I)>=base THEN
     rC(I)-base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=17 THEN // C=C+1
   1▶cy;
   FOR I FROM F TO L DO
    rC(I)+cy▶rC(I); 
    IF rC(I)>=base THEN
     rC(I)-base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=18 THEN // C=A-C
   FOR I FROM F TO L DO
    rA(I)-rC(I)-cy▶rC(I); 
    IF rC(I)<0 THEN
     rC(I)+base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=19 THEN // C=C-1
   1▶cy;
   FOR I FROM F TO L DO
    rC(I)-cy▶rC(I); 
    IF rC(I)<0 THEN
     rC(I)+base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=20 THEN // C=-C
   FOR I FROM F TO L DO
    -rC(I)-cy▶rC(I); 
    IF rC(I)<0 THEN
     rC(I)+base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=21 THEN // C=-C-1
   1▶cy;
   FOR I FROM F TO L DO
    -rC(I)-cy▶rC(I); 
    IF rC(I)<0 THEN
     rC(I)+base▶rC(I); 1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=22 THEN // ?B#0
   FOR I FROM F TO L DO
    IF rB(I)≠0 THEN 1▶cy;BREAK; END;
   END;
  END; 
  IF H=23 THEN // ?C#0
   FOR I FROM F TO L DO
    IF rC(I)≠0 THEN 1▶cy;BREAK; END;
   END;
  END; 
  IF H=24 THEN // ?A<C
   FOR I FROM F TO L DO
    rA(I)-rC(I)-cy▶T; 
    IF T<0 THEN
     1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=25 THEN // ?A<B
   FOR I FROM F TO L DO
    rA(I)-rB(I)-cy▶T; 
    IF T<0 THEN
     1▶cy;
    ELSE 
     0▶cy;
    END;
   END;
  END;
  IF H=26 THEN // ?A#0
   FOR I FROM F TO L DO
    IF rA(I)≠0 THEN 1▶cy;BREAK; END;
   END;
  END; 
  IF H=27 THEN // ?A#C
   FOR I FROM F TO L DO
    IF rA(I)≠rC(I) THEN 1▶cy;BREAK; END;
   END;
  END; 
  IF H=28 THEN // ASR
   FOR I FROM F TO L DO
    IF I=L THEN 0▶rA(I);
    ELSE rA(I+1)▶rA(I);
    END;
   END;
  END;
  IF H=29 THEN // BSR
   FOR I FROM F TO L DO
    IF I=L THEN 0▶rB(I);
    ELSE rB(I+1)▶rB(I);
    END;
   END;
  END;
  IF H=30 THEN // CSR
   FOR I FROM F TO L DO
    IF I=L THEN 0▶rC(I);
    ELSE rC(I+1)▶rC(I);
    END;
   END;
  END;
  DEFAULT      // ASL
   FOR I FROM L DOWNTO F DO
    IF I=F THEN 0▶rA(I);
    ELSE rA(I-1)▶rA(I);
    END;
   END;
 END;
END;


LOCAL opArith() BEGIN
 code(0,3)▶J;
 CASE
  IF J=0 THEN  // pt
   IFTE(ptr,pp,pq)+1▶first;first▶last;
   IF first>14 THEN 1▶first; END;
   IF last>14 THEN 1▶last; END;
  END;
  IF J=1 THEN  // x
   1▶first; 3▶last; 
  END;
  IF J=2 THEN  // wpt
   1▶first;IFTE(ptr,pp,pq)+1▶last;
   IF last>14 THEN 1▶last; END;
  END;
  IF J=3 THEN  // w
   1▶first;14▶last; 
  END;
  IF J=4 THEN  // pq 
   pp+1▶first;pq+1▶last; 
   IF first>last THEN 14▶last; END;
   IF first>14 THEN 1▶first; END;
   IF last>14 THEN 1▶last; END;
  END;
  IF J=5 THEN  // xs
   3▶first; 3▶last; 
  END;
  IF J=6 THEN  // m
   4▶first; 13▶last; 
  END;
  DEFAULT      // s
   14▶first; 14▶last; 
 END;
 code(3,5)▶H;
 CASE
  IF H=0 THEN  // A=0
   regZero(rA)▶rA; END;
  IF H=1 THEN  // B=0
   regZero(rB)▶rB; END;
  IF H=2 THEN  // C=0
   regZero(rC)▶rC; END;
  IF H=3 THEN  // AB EX
   rA▶rT; regCopy(rB,rA)▶rA; regCopy(rT,rB)▶rB; END;
  IF H=4 THEN  // B=A
   regCopy(rA,rB)▶rB; END;
  IF H=5 THEN  // AC EX 
   rA▶rT; regCopy(rC,rA)▶rA; regCopy(rT,rC)▶rC; END;
  IF H=6 THEN  // C=B 
   regCopy(rB,rC)▶rC; END;
  IF H=7 THEN  // BC EX
   rB▶rT; regCopy(rC,rB)▶rB; regCopy(rT,rC)▶rC; END;
  IF H=8 THEN  // A=C
   regCopy(rC,rA)▶rA; END;
  IF H=9 THEN  // A=A+B
   regAdd(rA,rB,rA)▶rA; END;
  IF H=10 THEN // A=A+C
   regAdd(rA,rC,rA)▶rA; END;
  IF H=11 THEN // A=A+1 
   1▶cy;regAdd(rA,rZ,rA)▶rA; END;
  IF H=12 THEN // A=A-B
   regSub(rA,rB,rA)▶rA; END;
  IF H=13 THEN // A=A-1
   1▶cy;regSub(rA,rZ,rA)▶rA; END;
  IF H=14 THEN // A=A-C
   regSub(rA,rC,rA)▶rA; END;
  IF H=15 THEN // C=C+C
   regAdd(rC,rC,rC)▶rC; END;
  IF H=16 THEN // C=A+C
   regAdd(rA,rC,rC)▶rC; END;
  IF H=17 THEN // C=C+1
   1▶cy;regAdd(rC,rZ,rC)▶rC; END;
  IF H=18 THEN // C=A-C
   regSub(rA,rC,rC)▶rC; END;
  IF H=19 THEN // C=C-1
   1▶cy;regSub(rC,rZ,rC)▶rC; END;
  IF H=20 THEN // C=-C
   regSub(rZ,rC,rC)▶rC; END;
  IF H=21 THEN // C=-C-1
   1▶cy;regSub(rZ,rC,rC)▶rC; END;
  IF H=22 THEN // ?B#0
   regTestNE(rB,rZ); END;
  IF H=23 THEN // ?C#0
   regTestNE(rC,rZ); END;
  IF H=24 THEN // ?A<C
   regSub(rA,rC,rT); END;
  IF H=25 THEN // ?A<B
   regSub(rA,rB,rT); END;
  IF H=26 THEN // ?A#0
   regTestNE(rA,rZ); END;
  IF H=27 THEN // ?A#C
   regTestNE(rA,rC); END;
  IF H=28 THEN // ASR
   regShiftR(rA)▶rA; END;
  IF H=29 THEN // BSR
   regShiftR(rB)▶rB; END;
  IF H=30 THEN // CSR
   regShiftR(rC)▶rC; END;
  DEFAULT      // ASL
   regShiftL(rA)▶rA;
 END;
END;

LOCAL rst() BEGIN
 rA:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
 rB:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
 rC:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
 rM:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
 rN:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
 rZ:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];
 rT:=[0,0,0,0,0,0,0,0,0,0,0,0,0,0];

 first:=0;
 last:=0;
 ptr:=0;
 pp:=2;
 pq:=12;
 base:=10;
 cy:=0;
END;

LOCAL test1() BEGIN
 rst();
 FOR Z FROM 1 TO 10000 DO
  R→B(Z MOD 256,8)▶code;
  opArith();
 END;
END;

LOCAL test2() BEGIN
 rst();
 FOR Z FROM 1 TO 10000 DO
  R→B(Z MOD 256,8)▶code;
  opArith2();
 END;
END;

LOCAL test3() BEGIN
 rst();
 FOR Z FROM 1 TO 10000 DO
  R→B(Z MOD 256,8)▶code;
  opArith3();
 END;
END;

EXPORT test42() BEGIN  
 PRINT();
 PRINT(TEVAL(test1));
 PRINT(TEVAL(test1));
 PRINT(TEVAL(test1));
 PRINT(TEVAL(test2));
 PRINT(TEVAL(test2));
 PRINT(TEVAL(test2));
 PRINT(TEVAL(test3));
 PRINT(TEVAL(test3));
 PRINT(TEVAL(test3));
END;
=============================================
Binary at bug at end of page, test42-bug.zip, reboot picture there too

On a windows 10 Virtual Prime Build 2.1.14181, no problem at all

Re-flashing the firmware does not change anything.
Find all posts by this user
Quote this message in a reply
05-13-2019, 08:45 PM
Post: #2
RE: Major bug on G2
It looks like the BREAK; command in a program, is the cause of this issue.
Go to HELP, and search for BREAK.
The example gives you a program Demo_BREAK.
When running this program, the Prime reboots.

I have had to patch several programs, not to use BREAK; and instead of that,
construct some other condition to leave a loop.

Is there a chance to get that fixed in the next firmware release?

Thanks in advance.

Martin
Find all posts by this user
Quote this message in a reply
05-17-2019, 07:38 PM
Post: #3
RE: Major bug on G2
(05-13-2019 08:45 PM)Martin Wrote:  It looks like the BREAK; command in a program, is the cause of this issue.
Go to HELP, and search for BREAK.
The example gives you a program Demo_BREAK.
When running this program, the Prime reboots.

I have had to patch several programs, not to use BREAK; and instead of that,
construct some other condition to leave a loop.

Is there a chance to get that fixed in the next firmware release?

Thanks in advance.

Martin

I tried this (Demo_BREAK) again with a clean (Format C) Prime G2.
=> Same behavior => Calculator resets.

Can anybody confirm this issue, or does my Prime G2 hava a hardware issue?

Thanks in advance

Martin
Find all posts by this user
Quote this message in a reply
05-18-2019, 02:44 AM
Post: #4
RE: Major bug on G2
(05-17-2019 07:38 PM)Martin Wrote:  I tried this (Demo_BREAK) again with a clean (Format C) Prime G2.
=> Same behavior => Calculator resets.

Can anybody confirm this issue, or does my Prime G2 hava a hardware issue?

Thanks in advance

Martin

Confirmed, paperclip reset required after.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2019, 01:02 PM
Post: #5
RE: Major bug on G2
Confirmed!
Paperclip reset was not necessary.
Reboots after some time.

— Dirk Hartland
Find all posts by this user
Quote this message in a reply
05-18-2019, 07:08 PM
Post: #6
RE: Major bug on G2
(05-17-2019 07:38 PM)Martin Wrote:  
(05-13-2019 08:45 PM)Martin Wrote:  It looks like the BREAK; command in a program, is the cause of this issue.
Go to HELP, and search for BREAK.
The example gives you a program Demo_BREAK.
When running this program, the Prime reboots.

I have had to patch several programs, not to use BREAK; and instead of that,
construct some other condition to leave a loop.

Is there a chance to get that fixed in the next firmware release?

Thanks in advance.

Martin

I tried this (Demo_BREAK) again with a clean (Format C) Prime G2.
=> Same behavior => Calculator resets.

Can anybody confirm this issue, or does my Prime G2 hava a hardware issue?

Thanks in advance

Martin

My G2 does the same thing. It takes a while but it resets itself with no paperclip needed.

Tom L

I never knew my mother was such an animal lover. When the doctor told her the rabbit died, she went into shock!
Find all posts by this user
Quote this message in a reply
05-18-2019, 07:35 PM
Post: #7
RE: Major bug on G2
Confirmed.
Resets itself, but no paperclip needed.

Esben
28s, 35s, 49G+, 50G, Prime G1 HW A, Prime G2 HW D, SwissMicros DM42
Elektronika MK-52 & MK-61
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)