The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

WP-34S: Bug with STOS command
Message #1 Posted by Marcel Samek on 6 July 2013, 5:12 p.m.

I have a stack size of 8. I create a function and allocate 8 local registers in it. When I do a STOS to those local registers, the function will not return. For example the following code does not work. It goes into an infinite loop in BBB. If I change the LocR from 8 to 9 then everything works OK.

LBL'AAA'
    SSIZE8
    XEQ'BBB'
    4
    STO 00
    RTN
END

LBL'BBB' LocR 008 STOS .00 RTN END

      
Re: WP-34S: Bug with STOS command
Message #2 Posted by Walter B on 6 July 2013, 5:43 p.m.,
in response to message #1 by Marcel Samek

Looks like a bug. Thanks for reporting. We'll look into it.

d:-)

      
Re: WP-34S: Bug with STOS command
Message #3 Posted by fhub on 7 July 2013, 4:36 a.m.,
in response to message #1 by Marcel Samek

Yes, the same bug for SSIZE4 and LocR 004.

It seems that the STOS command destroys the program stack pointer if the number of local registers equals the stacksize.
Single-stepping through the program shows that the RTN command in the 'BBB' subroutine resets the program stack pointer to zero (BEG in the display), so the program 'AAA' restarts again.

Franz

            
Re: WP-34S: Bug with STOS command
Message #4 Posted by Marcus von Cube, Germany on 7 July 2013, 6:06 a.m.,
in response to message #3 by fhub

Thanks for the analysis so far. I'll check it out. Since this happens in the emulator too it should be easy to debug.

      
Re: WP-34S: Bug with STOS command
Message #5 Posted by Marcus von Cube, Germany on 7 July 2013, 8:30 a.m.,
in response to message #1 by Marcel Samek

The issue should be fixed now. It was a single vs double precision bug in STOS and RCLS. It was not specifically related to local registers.

            
Re: WP-34S: Bug with STOS command
Message #6 Posted by fhub on 7 July 2013, 8:44 a.m.,
in response to message #5 by Marcus von Cube, Germany

Yes, it's working again - thanks for the quick fix!

Franz


[ Return to Index | Top of Index ]

Go back to the main exhibit hall