Free42 — An HP-42S Calculator Simulator

What it is

Free42 is a complete re-implementation of the HP-42S calculator and the HP-82240 printer. It was written from scratch, without using any HP code. You do not need any ROM images in order to use it, yet it is fully HP-42S compatible.
Free42 is an Open Source project; the executables and source code are released under the terms of the GNU General Public License, version 2. All third-party code used in Free42 is either in the public domain, or licensed under terms compatible with GPLv2, or used with permission of the respective authors.

Supported Platforms

With each release, I build ready-to-run executables for iPhone and iPod touch, Windows, Pocket PC, PalmOS, Mac OS X (application and Dashboard widget), and Linux (x86). There are additional versions for iPhone, iPod touch, Sharp Zaurus, and Nokia Internet Tablet, created by fellow HP-42S enthusiasts; see below for details.
Even if your favorite operating system is not in this list, you may still be able to get Free42 to work by building it from source. For most people, this is probably only an option if you want to run Free42 on some flavor of Unix; otherwise, please read the Frequently Asked Questions, below.

Project Status

The latest version is 1.4.61, released November 25, 2009.
For more information about what's been going on with Free42 in the past, see the project HISTORY; for my thoughts about future development, check my TODO list.

Donations

If you like Free42 and use it regularly, or if you simply want to sponsor the Free42 project, please make a donation!
You may donate any amount you wish. All donations, large or small, will help keep Free42 going.
Donations are processed by PayPal.

Thank you for supporting the continued development of the Free42 project!

Downloads

Free42 for iPhone and iPod touch

You can get it from the iTunes App Store by clicking this link.
Requires iPhone OS 3.0 or later.

This initial release does not yet have a functioning print-out window (but printing to files is implemented); it does not yet support import/export of programs from/to files on the device (but import/export directly from/to a PC or Mac is implemented); and it does not yet support use of the pop-upkeyboard for ALPHA mode text entry. These features will be added in following releases.

There is another port of Free42, called 42s, created by Byron Foster, that includes some very nifty enhancements including unlimited-depth stack and 5-line display. These features are all optional, so you can still have the original HP-42S functionality for programs that need it. This port is also available from the iTunes App Store, here.

Free42 for Windows

Package: Free42Windows.zip
Requires Microsoft Windows 98 or later.

Free42 for Pocket PC

Package: Free42PocketPC.zip
Requires Pocket PC 2002 (ARM) or later.

Free42 for PalmOS

Package: Free42PalmOS.zip
Requires PalmOS 3.0 or later.

This package contains 68k and ARM versions of the PalmOS application, and a HotSync conduit that allows you to transfer files between your PC and your hand-held.

The 68k version of Free42 Binary requires the MathLib floating-point library; in case you don't already have it, you can get it from Rick Huebner's MathLib page.
The ARM version of Free42 Binary, and the 68k and ARM versions of Free42 Decimal, do not require MathLib.

Free42 for Mac OS X

Package: Free42Mac.zip
Requires Mac OS X 10.5 or later, Intel or PowerPC.

This is Free42 built as a Mac OS X application.
The print-out window is not yet implemented, but otherwise it is fully functional.

Free42 for Mac OS X Dashboard

Package: Free42MacDashboard.zip
Requires Mac OS X 10.4 or later, Intel or PowerPC.

This is Free42 built as a Mac OS X Dashboard widget. It does not support skin switching, customized keyboard maps, printer emulation, and program import/export, but it is otherwise a fully functional simulation.
Contributed by D. Jeff Dionne; maintained by Thomas Okken.

Free42 for Linux (x86)

Package: Free42Linux.tgz
Runs on Fedora 6 with glibc version 2.5, libstdc++ version 4.1.2, GTK+ version 2.10.13, and LessTif version 0.95.0. It should work on any Linux (x86) with those or similar libraries.

This package contains GTK+ and Motif versions of Free42. The only difference between the two is the look and feel of the menu bar and dialog boxes; other than that, they are identical.

Free42 for Zaurus X/Qt

Runs on the Sharp Zaurus with X/Qt installed (and possibly also with the native GTK GUI (GPE), although this has not been tested), and on the Nokia 770 Internet Tablet.
Maintained by Egan Ford; more information and downloads are available on his web site at http://sense.net/zc/free42/.

Free42 for Nokia 900

Package: available at maemo.org.
Runs on the Nokia 900 Internet Tablet.
Source code, also for Nokia 770, 800, and 810, available at garage.maemo.org.
Ports by Tatu Männistö.

Free42 Source Code

Package: free42.tgz
The GTK and Motif versions require Linux, or any reasonably Unix-like environment, with X11, GTK+ or Motif/Lesstif, and the usual development tools and libraries. For the Windows version, you need either Microsoft Visual C++ 6.0 or MinGW; for the Pocket PC version, Microsoft eMbedded Visual C++ 3.0; for the PalmOS version, you need PRC-tools (with Ton van Overbeek's multi-segment debugging patches applied); for the PalmOS/Windows Conduit, you need Microsoft Visual C++ 6.0; and for the iPhone versions, you need the iPhone SDK 3.0 or later. The Mac OS X Application and Dashboard versions can be built using the development tools that come with OS X; they require OS X 10.4 (Tiger) or later for the Dashboard version, and OS X 10.5 (Leopard) or later for the Application.

Skins

Some skins to use instead of the faceplates built into Free42. Separate packages for:
Windows, Unix, and Mac, contains 19 skins, last updated December 29, 2009;
Pocket PC, contains 18 skins, last updated June 13, 2009;
PalmOS, contains 8 skins, last updated April 4, 2007;
iPhone and iPod touch, contains 2 skins, last updated April 20, 2009. Note: these iPhone skins cannot be used with Byron Foster's "42s RPN Calculator", only with my "Free42" app.
 

HP-42S/Free42 programs

A small collection of HP-42S/Free42 programs.
 

txt2raw.pl

A Perl script that converts HP-42S program listings, such as those generated by the PRP and LIST commands, to Free42/Emu42 compatible "raw" program files.
Written by Vini Matangrano; look here for documentation and the script itself.
 

rom2raw

A C program that converts HP-41 ROM images to Free42/Emu42 compatible "raw" program files.
Download rom2raw.zip; source code and Win32 console executable included.
NOTE: the source code for this program is also included with the Free42 Source Code package.

Documentation

Free42 does not come with a manual. Since it is an accurate simulation of the HP-42S, an HP-42S manual should be adequate for most purposes. The functionality specific to Free42, e.g. program import/export, printer emulation, etc. is fairly simple and should be self-explanatory.
You can obtain a copy of the original HP-42S manual, in English, German, or Portuguese, in PDF format, on CD-ROM or DVD-ROM, at The Museum of HP Calculators. Look for the CD/DVD offers here.
Alternatively, there is a new HP-42S/Free42 manual, written by José Lauro Strapasson; you can obtain it from my web site here, or get the most up-to-date version from the author's web site here.

Decimal and Binary Floating Point

Starting with release 1.4, Free42 comes in Decimal and Binary versions. The two look and behave identically; the only difference is the way they represent numbers internally. All the download packages available from this site include both the Decimal and the Binary versions; the Free42 and 42s applications in the iTunes App Store are Decimal only.

Free42 Decimal uses Hugh Steers' 7-digit base-10000 BCD20 library, which gives 25 decimal digits of precision, with exponents ranging from -10000 to +9999.

Free42 Binary uses each platform's native floating-point support. On PCs and Macs, this means the hardware FPU, while on hand-helds, it usually means FPU emulation or a floating point library. All platforms currently supported by Free42 support IEEE-754 compatible floating point, and Free42 uses double precision, which consumes 8 bytes per number, and gives an effective precision of nearly 16 decimal digits, with exponents ranging from -308 to +307 (actually, exponents can be less than -308, but such small numbers are "denormalized" and don't have the full precision of "normalized" numbers).

The binary version has the advantage of being much faster than the decimal version; also, it uses less memory. However, numbers such as 0.1 (one-tenth) cannot be represented exactly in binary, since they are repeating fractions then. This inexactness can cause some HP-42S programs to fail.

If you understand the issues surrounding binary floating point, and you do not rely on legacy software that may depend on the exactness of decimal fractions, you may use Free42 Binary and enjoy its speed advantage. If, on the other hand, you need full HP-42S compatibility, you should use Free42 Decimal.

If you don't fully understand the above, it is best to play safe and use Free42 Decimal.

Frequently Asked Questions

  1. Are you planning a BlackBerry version of Free42?
    No. The BlackBerry platform supports Java applications only, and Free42 is written in C++. Translating the 30,000+ lines of code that comprise the Free42 core would require either much better C++-to-Java translation tools than the ones that exist today, or it would require me spending hundreds of hours doing the translation by hand. Given the current state of the art, and my limited free time (this is a one-man project!), it's just not going to happen.
    If RIM were to start supporting C++ development for BlackBerry again, these objections would disappear, but... see #2, below.
  2. Are you planning Android, Symbian, Palm WebOS, or <insert your favorite platform here> versions of Free42?
    No. While I am interested in additional ports, I simply don't have enough time to learn every single OS, with its APIs, its SDKs, its quirks, its software development ecosystem, etc.
    I have created ports purely due to popular demand in the past; specifically, the Pocket PC and Linux/GTK versions, and to a lesser extent, the PalmOS/ARM and all the Decimal versions, were created because people asked me to, not because I had any great desire for them of my own.
    However, I can't commit to writing any additional ports. When I find the time and the spirit strikes me, I will, and at present, Android seems to be the most likely candidate... But I am not planning on an Android version, nor any other; I am merely hoping that I will be able to get around to it in some indeterminate future.
  3. Will you add support for the accelerometer and GPS in the iPhone version?
    Yes. This will be added to Byron Foster's 42s and to my own Free42 soon, probably sometime in the first quarter of 2010.
  4. Will you add support for the HP-41 Time Module?
    Yes, I am planning to support this in all versions of Free42, to the extent that the underlying platforms allow it. Alarms that wake up the calculator will obviously be a problem on most platforms, but I'll do what I can. This functionality will appear sometime in 2010; I can't be more precise as to when, exactly, at this point.
  5. How about implementing fractions, algebraic equations, or other extensions to the HP-42S? Any chance of that?
    No. I like the HP-42S as it is, and I have no plans to turn Free42 into anything more than that, apart from taking advantage of some of the nifty hardware features that some platforms provide — see #3 and #4, above, and also consider that Free42 allows you to create much larger matrices than the original, and runs your programs a lot more quickly.
    If you need an unlimited-depth stack, stuctured programming constructs, a larger display, or support for algebraic equations, I recommend the HP-48 series of calculators, or any of the many emulators that exist for them. You may also like Byron Foster's 42s, which is an iPhone port of Free42 with unlimited-depth stack and large display added, not to mention some other nifty UI improvements.
  6. Awww... how about a unit conversion library, at least?
    You got me there! That would be an incredibly useful addition. This is one of the few additions I don't say "no" to categorically, but I can't promise when I'll have the time to actually implement it. Apart from the fact that it's a bit of a chore to collect all the unit conversion constants, it is not an easy task to extend the HP-42S user interface to support this properly.
    I really, really want to implement this, preferably before I retire, but please don't hold your breath...
  7. Free42 and 42s for iPhone aren't free. Isn't that cheating?
    They are free if you jailbreak your iPhone, download the Free42 or 42s source, and compile and install them yourself!
    I make no apologies for charging money on the iTunes App Store; you get convenience and I get paid, that's all. Free42 is still free software, but if you want it for free as in beer, you may have to make a little effort. :-)
  8. There is a cheap iPhone app called "RPN Calc 42S", that looks a lot like Byron Foster's "42s RPN Calculator". What's the deal?
    That app is a slightly older version of Byron Foster's "42s RPN Calculator". It is 42s version 2.2 (Free42 version 1.4.53), completely unmodified except for the name change.
    Just to keep things straight... If you search the app store for "42s", you will find three items: "42s RPN Calculator", which is Byron's cool enhanced version of Free42; "Free42", which is my own, very basic (and not completely finished) iPhone port of Free42; and "RPN Calc 42S", which is an older version of Byron's code, being sold by a parasite.
    If you want to get the 42S on your iPhone on the cheap, you could get this knockoff, but be aware that none of the money you spend will go to the people who did the actual work of developing this software in the first place. You won't get any support from "Infowise" or "C A VIJAYAN", either — they're not even trying, they don't provide an email address, and the Web Site button inside the app points back to Byron's support page.

Links

The ultimate source for HP calculator enthusiasts: The Museum of HP Calculators.
Other HP-42S emulators:
Christoph Gießelink's Emu42 (for Windows and Pocket PC)
HrastProgrammer's HP-42X (for the HP-48/49/50 series calculators).

Contact

You can contact me, Thomas Okken, at .