The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

HPGCC questions
Message #1 Posted by Steve Fennell on 29 Sept 2011, 5:07 p.m.

I'm interested in learning to use C/C++ on the 50g and porting some small programs I've written over the years. Both HPGCC 2.0SP2 and HPGCC3 are available. Which one should I start with? Are there any advantages and disadvantages to using one version over the other? They seem to have different origins, or at least HPGCC3 is a rewrite with a revised license if I understood correctly.

      
Re: HPGCC questions
Message #2 Posted by David Hayden on 29 Sept 2011, 9:53 p.m.,
in response to message #1 by Steve Fennell

I believe that HPGCC3 creates stand-alone programs, which is an improvement over HPGCC 2.0 which requires a library on the 50g. The lib can convert the program to stand-alone, or it can launch the program itself.

I think I also heard that HPGCC3 has a more extensive library.

On the plus side for HPGCC 2.0, it's been around longer so it may be more stable. Also, to make a shameless plug, my HPObjects library currently only works with HPGCC 1.1 and 2.0. The library lets you easily access and convert HP calculator objects (numbers, integers, lists, strings etc) into C equivalents, and back again. The library that comes with HPGCC 2.0 comes with some of this functionality, but the interfaces are inconsistent and only a few objects are supported.

Here are some handy links:

Egan Ford's excellent HPGCC 2 tutorial.

My HPObjects library

Good luck! I think you'll find it quite rewarding. HPGCC programs typically run 100 times faster than User RPL programs. On the other hand, they are typically about 100 times larger. On the third hand, you can always copy the actual program to an SD card, and replace it on the calculator with a small stub program that recalls it from the card and runs it. This saves you the space in HOME, but it still takes a large amount of RAM to run.

Feel free to contact me for help with HPGCC 2 programming.

Dave

            
Re: HPGCC questions
Message #3 Posted by Egan Ford on 29 Sept 2011, 10:07 p.m.,
in response to message #2 by David Hayden

Quote:
I believe that HPGCC3 creates stand-alone programs, which is an improvement over HPGCC 2.0 which requires a library on the 50g. The lib can convert the program to stand-alone, or it can launch the program itself.
HPGCC 3 requires a custom ROM on the 50g. This is not a problem unless you plan to redistribute your code. At that is not a problem if all target machines have the custom ROM. Whereas HPGCC 2 will run on unmodified machines.

HPGCC 3 is faster, or at least the beta versions were that I tested a while ago. I wrote some pretty fast factorization programs with HPGCC 3. I could overclock the processor to 192 MHz.

I'd start with HPGCC 3 since that is the current supported version from the developers and fallback to HPGCC 2 if you want to leave your 50g with the HP blessed ROM.

P.S. I've had the HPGCC 3 ROMs on my 50g for years without any issues and I could still run HPGCC 2 code.

Edited: 29 Sept 2011, 10:09 p.m.

                  
Re: HPGCC questions
Message #4 Posted by Steve Fennell on 2 Oct 2011, 6:42 p.m.,
in response to message #3 by Egan Ford

Thanks for both responses. I decided to give HPGCC3 a whirl and was able to get it compiled into the 2.15 ROM and loaded this weekend. The tutorial on hpgcc3.org was helpful as well.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall