Yet another alpha release of CASMSIM, 0.16. This one uses KML files (language developed for Emu48, with a few minor extenions) tell the simulator what ROM and graphic images to use, where the display and keys are positioned within the image, and the keycodes generated by the keys. This moves it a bit closer to being a general HP calculator simulator. And it’s a lot nicer to use now with the scanned photos from the HP Museum web site, so I hope more people will find it useful (or at least fun).
In addition to the HP-35, the HP-45 and HP-55 simulations are working again. I typed in the HP-80 ROM source code from a U.S. patent last night, and it partially works, but I’m pretty sure there are typos that need to be fixed.
These are all “first-generation” (Classic) HP handheld calculators, using essentially the same chipset. The HP-65 and HP-70 also use this chipset, though the HP-65 adds a card reader controller and a program memory chip. I don’t have ROM listings or dumps for the 65 or 70 yet. The first half of the HP-65 ROM listing is in a patent.
In the future I want to simulate the next three generations of HP calculators. Briefly described:
Second generation: Woodstock and Topcat models. Best-known are the HP-25 and HP-67/97. (The HP-67 looks like a Classic, but electrically is a 2nd gen.)
Third generation: Spice/Spike models such as the HP-33E and HP-38C.
Fourth generation: LCD display models using the “Nut” processor. H\
P-41C/CV/CX, HP-10C, HP-11C, HP-12C, HP-15C, HP-16C.
Later generations also use an LCD, of course, but they’ve switched to the “Saturn” processor. There are already good Saturn simulators out there, such as Emu48, though a Linux port of Emu48 would be really welcome.
I already have written a similar 41C/CV simulator (NSIM), but I want to integrate it with CASMSIM and add support for the 10/11/12/15/16C.
I have no substantive documentation on the architecture of the second and third generation models. There was an HP Journal article describing the improvements in the 2nd gen chip set in very general terms, but I will have to get most of the info I need by reverse engineering. Fortunately there’s no copy protection involved, so I don’t have to worry about the DMCA.
I think the third-generation CPU is quite similar to the 4th gen, but I don’t know for sure.
Then there is the HP-01 watch. It is closest to the second generation architecture, but with a 48-bit word rather than 56-bit. It is unlikely that I can dump the ROM from an HP-01 without destroying it, and I probably won’t try. There is a U.S. patent with a ROM listing, but it is definitely not the final code because it needs more ROM chips than are in a production HP-01.
Anyhow, adding support for all these other models should be a good way to consume a whole lot of spare time.
Adding the KML file support got me some more experience with Flex and Bison. I’d already used Flex and Bison in the microassembler, but I haven’t messed with that very much since I got it working back in 1995, so it was fun to get back up to speed with it and learn a few new Bison techniques. Although it’s not strictly necessary for the simulator, I wanted to use the Bison %pure_parser option, but the released versions of Flex do not support it.