33S: new programming strategy



#2

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
ISG Z
Gto M
RTN

And now, you'd rather save one label by writing something like:
Lbl L
Xeq A
Xeq A
Xeq A
.
.
Xeq A
RTN
(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.

KC


#3

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.

Cameron

HLL - high-level language

#4

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.


http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv014.cgi?reconfigure


http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv013.cgi?reconfigure


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


http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi?reconfigure


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!


Regards,


Bill


#5

ANOTHER LINK

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv013.cgi?read=47779


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 140 10-23-2011, 08:46 AM
Last Post: Thomas Radtke
  Meg Whitman announces stunning strategy shift at HP Howard Owen 16 563 09-23-2011, 06:42 AM
Last Post: Todd Garabedian
  33s - programming question Frank Rottgardt 4 209 05-15-2008, 08:27 PM
Last Post: Don Shepherd
  HP 33S programming Antonio Maschio (Italy) 10 375 04-07-2006, 10:35 PM
Last Post: James M. Prange (Michigan)
  Help with Programming a HP 33S Eric 5 203 04-07-2006, 10:48 AM
Last Post: Vense Phonesouphan
  Integration Times "Old" 33s vs "New" 33s John Smitherman 21 789 12-14-2005, 12:04 AM
Last Post: Karl Schneider
  A Worthwhile Strategy? I, Claudius 6 267 10-25-2005, 12:35 PM
Last Post: Howard Owen
  HP 33s programming Alexander Thorp 16 493 03-04-2005, 03:14 AM
Last Post: Tizedes Csaba [Hungary]
  Custom Programming vs. Pre-packaged programming Eddie Shore 3 215 01-24-2005, 03:42 AM
Last Post: Karl Schneider
  HP and their strategy on RPN Mvdn 15 428 01-08-2005, 03:51 PM
Last Post: Scuba Diver

Forum Jump: