[WP34S] Stack size impact on speed? SSIZE4.


Do the built-in functions ever benefit from a stack size of 8?

I need some more data registers in addition to the R00-R99, like the A thru D and don't mind calling the SSIZE4.

Thanks in advance.


SSIZE4 is the default. You don't have to call anything unless SSIZE8 was set by you or a program.

Keep in mind that besides the 112 dedicated registers (00-99, XYZT, A-D, I-L), you can access even more registers by indirection (and the first 16 of them directly) by allocating them via the LocR command. You are restricted to 256 registers in total (global numbered, stack, lettered, locally declared), but this is often less if RAM is used by program lines, stats registers if a stats summation has begun and the dedicated registers have not been deallocated by CLSigma, you have DBLON set, etc.

This is discussed in Appendix B and at page 20 of the most recent manual. There is even a formula to compute memory usage according to one's needs.

I would suggest that if you need to maximize your register usage, you store and run your program from the flash library, where there is gobs of program memory (over 6000 words at present), delete it and all programs from RAM so that you can access all of the registers in RAM that you can. In my opinion, it wise to learn how to assemble flash libraries from code listing for testing in the emulator before you move things onto the calculator. I would find it really frustrating to recall code to RAM for editing, save it back to flash, delete the RAM copy, retest, etc. I would sooner edit my text listing, rebuild wp34s-lib.dat, test in the emulator, and when ready concatenate the wp34s-lib.dat file to calc.bin before flashing over to the calculator. This is actually what I do with every firmware upgrade. I don't have any important programs in RAM.

Not sure what you means by "do the built-in functions benefit".



You are restricted to 256 registers in total (global numbered, stack, lettered, locally declared),...

You can bypass this limit too -- nested functions can each have their own local variables and, although not all will be visible at the same time, you will have more than 256 in total.

- Pauli



Thanks for your highly detailed response. I overlooked your msg. at first as there were several responses. Please look at my response adjacent to your message. I apologize for not addressing it to your name as well. Your entry is of significant help to me.

People like you helping out beginners and contributing to this great 34S project are fantastic!




Benefit from? No. All built in functions can exist in a four level stack. You, the user, benefit from the extra stack levels.

If you need more registers, local registers are most likely the way forward.

- Pauli


Depends. If you are doing complex stuff (mathematically ;-) ) then 8 stack levels are very beneficial. I guess that financial guessing won't need 8 levels but you will know better.


The speed difference between SSIZE 4 and SSIZE 8 will be unnoticeable. The CPU in the 34S is sufficient fast that copying small amount of memory around takes essentially zero time. In fact, copying large amounts of memory takes close enough to zero time too.

In other words, I very much doubt you'll notice a performance difference between a four level and an eight level stack.

- Pauli


Thanks Les, Paul, and Walter,

I greatly appreciate your responses. I apologize for asking these beginner's questions but I'm so excited about the 34S I just can't let it go.

After reading your responses I have studied the LocR concept and tried to PSTO my LBL A1 to Flash LIB.

Question 1: The Lib shows A1 and I ran it from there. But there is no way I can figure out how to later delete A1 from the Lib? (I searced for words in the PDF manual but I can't find any delete function for Lib prgms. Where is it, please?) Absolutely, the LocR is definitely the way to double my data regs!

Question 2: Due to my inexperience I occasionally quasi lock up the calculator and it shows "D" in the top left corner and I am unable to run any program like LBL A (button A) - it says Lbl A does not exist, but it is in there. I have to reset the 34S and lose my Lib A1 in the process. This has happened 4 or 5 times.

I desparately need more data storage for my Monte Carlo runs, the accuracy greatly increases with more regs. Unlike in physics and in mathematical modeling of human behavior where I needed 10,000 runs in MC, stock and option strike prices are happy with a few hundred runs for my use. So getting the extra 127 or so LocR regs by indirect calling is a significant increase in predictability. That's why the 34S is also the world's best business calculator by far! Good job you guys!

Again, thanks for your detailed response, now I need to follow through. Question 2, however, is a source of concern as I lose large programs entirely.


Edited: 12 May 2012, 1:56 p.m.


A few remarks:

D indicates double precision mode. Use the CPX h P.FCN catalogue to find DBLOFF to return to normal mode.

If you want to run a program in RAM with hot keys enabled and you cannot seemingly start it than the reason normally is that the program counter simply does not point to a program line in your program. Press h P/R to check this. In order to force the program counter within a specific program, use h CAT and position to the program in question (with ENTER). If it's in RAM, a simple g RTN will do instead.

With CAT you can easily delete programs from the library by pressing f CLP while CAT is active and you are positioned on the program to be deleted.

I hope this helps.

Edited: 12 May 2012, 3:42 p.m.



Thanks for your excellent response. I follow most of you 34S developers on the HHC YouTube videos by hpcalc.org, as well as in this forum reading the interesting development cycle discussions you conduct. I am honored to hear from you all one by one.

I most certainly will try your suggestions. I am getting frustrated by losing my 150 lines of code due to my own ignorance. I thought it may have something to do with flags so I tried cfall etc., and some other things. But not the things you now suggest.

Thanks, and your HHC videos are most informative.




Somehow a small test program Lbl A1 ended up in the bup memory. When I hCAT to it and do fClp Sure? do fENTER Y it says it is write protected.



The backup is just a 1:1 copy of RAM which is created by executing SAVE or hitting ON+STO (the latter needs to be pressed twice). To change something in the backup you need to make the changes to RAM and then create a new backup.



you wrote above:

With CAT you can easily delete programs from the library by pressing f CLP while CAT is active and you are positioned on the program to be deleted.

That was easy to be misunderstood, as you see now.


Marcus & Walter,

I thus now figured it out. To clear the bup CAT entry one has to clear RAM, then do a SAVE or ON+STO+STO.

That worked.



Possibly Related Threads...
Thread Author Replies Views Last Post
  HP 50g - select characters on the stack, copy/paste Sean Freeman 7 788 11-20-2013, 07:11 AM
Last Post: Sean Freeman
  Prime: Placing more than 1 item on the RPN stack in a single program? John Colvin 4 588 11-19-2013, 08:59 AM
Last Post: Miguel Toro
  Prime: Program size limited to 64K? Erwin Ried 4 546 11-17-2013, 11:42 PM
Last Post: Joseph Ec
  48G vs 49G+ User RPL Speed Comparison John Colvin 7 688 11-16-2013, 10:07 PM
Last Post: Han
  emu48 - copy stack doesn't work (as expected) Thomas Radtke 2 596 11-11-2013, 02:19 PM
Last Post: Thomas Radtke
  HP Prime Stack operations from within a program John Colvin 1 410 11-08-2013, 09:45 PM
Last Post: Helge Gabert
  Prime: size display bug when editing large programs BruceH 2 385 10-31-2013, 05:30 PM
Last Post: BruceH
  Prime: Anyway to refresh stack? kris223 5 601 10-16-2013, 05:09 PM
Last Post: kris223
  hp prime - sending program results to the stack giancarlo 6 706 10-15-2013, 02:00 AM
Last Post: Giancarlo
  HP Prime - RPN stack access from programs? Mike Mander (Canada) 10 786 09-30-2013, 11:20 AM
Last Post: steindid

Forum Jump: