33S: new programming strategy


For all of us who have learned programming, be it computer or calculator programming, the two most important keys to writing good programs are (1) to maximize program running speed; and (2) to minimize program space. With the introduction of HP 33S, a totally new strategy comes up where nobody have never meet: to minimize the use of label while not worrying too much about program space. For instance, in the past, when you want to write a program to loop several times, you'd write something like:
Lbl L
1.07 STO Z
Lbl M
Xeq A
Gto M

And now, you'd rather save one label by writing something like:
Lbl L
Xeq A
Xeq A
Xeq A
Xeq A
(Of course, whether it should be changed depends on how many times it loops and how long is the program code in between the loop)

When I got the HP32SII, I looked at the manual, and found out that most example programs in the manual already occupied most of the memory. Now I've acquired the 33S, and look at the manual, and found out most of the programs use up a lot of labels! So limitations are still there, though they are different.
I wonder if there would come up in this forum, or new books about techniques that could minimize the use of labels for programming 33S.



This doesn't apply to the 33s per se.

For many of us HLL programmers, the most succinct and unambiguous expression of an algorithm is in the HLL with which we are most conversant. Sometimes this is laziness; oftentimes it's because we've solved that class of problem before and we know that our coded solution works. (As an aside, cut and paste remains the dominant method of code reuse IMO).

If you attempt to hand-convert an algorithm expressed in a HLL to low-level code for an assembler, you will find that you end up with a *lot* of labels. I encounter this often as I go from Java or C++ to H8 ASM. So, to optimise for memory footprint, you *have* to re-implement the algorithm for the target platform (calculator, ucontroller or PIC).

Perhaps the writers who created the 33s examples simply re-implemented them from existing HLL code.


HLL - high-level language


Some have definitely already though about this, and their ideas have been posted here on this forum (some stuff at comp.sys.hp48 too but more here!)

Go to the latest archives, and search for 33s and you will find many threads.



Also search in the current forum, and you will find more.


One idea is to use equations as space-holder labels for programs that are being "stored" but not actively run. The can describe what follows. Of course The line-numbering is strange when you do this----but it can work---thoug hyou really need a little notebook to keep track (which the 33s slipcase is great for carrying with the calc--along with a pencil!).

There are definitely at least one post which directly discusses how to turn subroutines into one program.

Good luck in your search!






Possibly Related Threads...
Thread Author Replies Views Last Post
  HP's chief strategy officer to retire next month, won't have a successor designnut 2 811 10-23-2011, 08:46 AM
Last Post: Thomas Radtke
  Meg Whitman announces stunning strategy shift at HP Howard Owen 16 3,046 09-23-2011, 06:42 AM
Last Post: Todd Garabedian
  33s - programming question Frank Rottgardt 4 1,133 05-15-2008, 08:27 PM
Last Post: Don Shepherd
  HP 33S programming Antonio Maschio (Italy) 10 1,963 04-07-2006, 10:35 PM
Last Post: James M. Prange (Michigan)
  Help with Programming a HP 33S Eric 5 1,098 04-07-2006, 10:48 AM
Last Post: Vense Phonesouphan
  Integration Times "Old" 33s vs "New" 33s John Smitherman 21 3,662 12-14-2005, 12:04 AM
Last Post: Karl Schneider
  A Worthwhile Strategy? I, Claudius 6 1,321 10-25-2005, 12:35 PM
Last Post: Howard Owen
  HP 33s programming Alexander Thorp 16 2,652 03-04-2005, 03:14 AM
Last Post: Tizedes Csaba [Hungary]
  Custom Programming vs. Pre-packaged programming Eddie Shore 3 1,065 01-24-2005, 03:42 AM
Last Post: Karl Schneider
  HP and their strategy on RPN Mvdn 15 2,497 01-08-2005, 03:51 PM
Last Post: Scuba Diver

Forum Jump: