Slashdot Mirror


A C Compiler For The HP49g+

Cheese Source writes "As previously mentioned on Slashdot, HP's latest and greatest calculator is the HP49g+. While it sports a very powerful (for a calculator) ARM9 cpu, it is only 3 times the speed of the 49g, running at 4MHz. This is because it has to emulate an older processor. Of course, some calculator geeks are now writing adapting a free, open-source C compiler for it. Based on GCC, you can now make programs that run natively on the CPU between 12 and 203MHz. 1000 factorial is calculated and displayed in the blink of an eye (the built in command takes 30 seconds). It will also allow for some great games."

10 of 194 comments (clear)

  1. Re:Options? by Anonymous Coward · · Score: 5, Insightful

    Because the input interface (buttons vs touchpad) and output interface (greyscale vs energy-guzzling colour screen) of a calculator are more suitable for.. calculating. Pity about the crappy 49g+ keys [repaste 100000000 posts from c.s.hp48 here].

  2. HP49g+ details by goon · · Score: 5, Informative

    for those interested in the the 49g+ in all it's gory technical details.

    --
    peterrenshaw ~ Another Scrappy Startup
    1. Re:HP49g+ details by Sexy+Bern · · Score: 5, Funny

      For those interested in the use of the apostrophe in all its gory details

  3. Re:Options? by torpor · · Score: 5, Insightful

    Also, if customers are writing their own programs with a C compiler to get speed, why not just use something like the Zaurus running Linux, and one of the many, full featured, science/math software suites for Linux?

    Ah yes, rampant Consumericanism at its finest.

    Maybe the reason 'they' 'don't just use something like a Zaurus running Linux' is because they've already got a fine working H49g+ in 'their' posession.

    Don't you get it? You're only 'countering the view' on automatic. The solution to every cool hack is not automatically "you can buy something else instead and it'll be cooler".

    (Not a Flame, not a Troll. Truly, this is Consumerican 'logic' at its finest...)

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  4. HP calculator are no more, really. by Yodalf · · Score: 5, Interesting

    A long time ago i bought an HP41C (not "V"!) and it was (still is...) a very good, small & rugged machine. No nonsense. Back then HP were making the very best calculators in the world.

    Nowadays, a certain Miss has decided to decimate the "Calculators" division of HP and it shows. THe present calculators at HP have the same look and (cheesy) feel as the TI calculators. They are bulky and large, they sport cheesy buttons and it is actually hard to find a model that supports the sooo efficient & fast RPN notation. In short: they suck. I feel like we will never ever again see really well built & designed calculators now. Too bad.

    Interestingly enough, the only calculator left in their product line that still has the feeling & quality of true HP calculators is the "Financial" HP12C... It seems Economists have it all... !

    Maybe we should petition for Agilent to start designing calculators? One can always dream...

  5. Re:GCC on TI by khuber · · Score: 5, Informative

    GCC has been available for calculators with HP's Saturn processors since 1994 (hp48xgcc). This is about using gcc as a cross-compiler for HP's new ARM-based calculator. The summary makes it sound as though someone is writing a compiler which is of course not the case. They are just writing the glue code and linker portions specific to the HP49G+.

  6. Re:30 seconds? by BarryNorton · · Score: 5, Informative

    No, the Saturn has an external word size of 4 bits, but 64 bit registers and instructions.

    At three to seven (the actual comparison) times the 4MHz 48g speed, there is far less than a gap of >>30 between the speed of the emulated processor and the physical one so I stand by (for now) my speculation that there is surely an algorithmic difference between the built-in (example?) one and the new 'native' one...

    (But what do I know, I'm just flamebait... apparently...)

  7. Anyone else... by bombshelter13 · · Score: 5, Funny

    ... think this calculator would, if nothing else be an amazing way to earn geek street cred? I mean, if programming (1 geek point) computer games (2 points) on an overclocked (3 points) calculator (4 points) using an open source (5 points) compiler isn't the pinnacle of all that is geek I don't know what is.

  8. Re:What is the point by Anonymous Coward · · Score: 5, Interesting

    Hi,

    I'm one of the people working on this. Maybe I can answer a few questions:

    Whats the point? Why Bother?

    Well, this is just an obscure hobby; no-one is spending 6 hours a day coding for this project. For me its just a way to learn a little about compilers. The main aim is to make it possible to create decent programs (mainly games) for this system. Coding for devices such as calculators has some interesting challenges to it, esp when you have to reverse engineer the hardware like we did.

    Is this a real port of GCC? I thought ARM already has a port.

    Yes it does, and its very good. We have tried to avoid modifying GCC itself to avoid extra work in the future. What we have done is write HP specific libraries and linking programs to executable may run. It works, so why not?

    1000! in half a second is slow, 10,000! takes about a second to calculate on [some platform]

    Indeed. Calculating factorials quickly is easy. Displaying the result (a massive, massive integer) is not. The factorial program trades off some calculation speed to markedly improve display speed. The "half a second" measurement comes from when the CPU is executing at 75MHz. I'm guessing running at 203MHz would speed that up a little.

    Is the calculator really running a saturn emulator?

    Yes, it is. SysRPL is an obscure language used only in these calculators. The complete Saturn CPU is being emulated, not just the SysRPL envrioment.

    Yes, it makes things very slow - but there is a decade of debugged code written in sysRPL and Saturn asm. Throwing all that away would be very expensive for HP. With calculators, having the correct answer is critical. Emulating old code means the ROM should be fairly bug-free.

    Of course an OS completely rewritten for the ARM would have been great - but its not economically feasible.

  9. Re:What is the point by Anonymous Coward · · Score: 5, Informative

    oops, some more I forgot

    Is the 49g+ RPN?

    Not by default - but you can set it to be with about 3 button pressed. Then its a proper RPN* calculator unless you set it back.

    *The RPN it uses is different from HP's early implementation. The earlier versions have a 4 level stack only. The HP48/9 series effectlvly have an unlimited stack, and you can put all kinds of objects (matrices, programs, symbolics etc) on it. Its alot more powerful then the RPN of say a HP15c, but naturally more complicated to use

    Will there be a linux/BSD/[other OS] port?

    Well, you have a 203MHz CPU, 512kb RAM, and 2MB ROM. If you can fit linux on that then go for it!