HP Forums

Full Version: WP-34S: Bug with STOS command
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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

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

d:-)

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

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

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.

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

Franz