HP-42X: HP-42S MicroCode Emulator for HP-48GX (Preliminary Info)


After many months of research and development I have a fully functional and working beta version of HP-42S Micro Code Emulator. Currently it is running on HP-48GX with two 128K memory cards but it will be ported to HP-49G in the future.

On my homepage (http://hrastprogrammer.tripod.com) there are few pictures captured from the emulator running on Emu48 under Windows.

The emulator is based on the original HP-42S ROM (revision C) so it behaves *exactly* like the real calculator. The screen looks the same and the HP-48 keyboard is accomodated to look like the HP-42S keyboard. It is very easy and joy to use the emulator on HP-48. Showing function name after pressing a key is suported. NULL is suported as well. Available memory is increased to 96K (MEM show '97089 Bytes' after 'Memory Clear'). It is now the largest memory capacity in any of the available HP-41 based calculator/emulator. Even the HP-41X maintains less memory with it's 4096 registers and 8*4096 HEPAX RAM words = approx. 61440 bytes in total. Theoretically, the maximum memory limit which can be supported is 224K (by destroying the whole 128K of calculator memory) !!! Both the main HP-42S ROM and the additional emulator ROM occupies 64K each with the plenty of room left in the second ROM for extensions which can be implemented in the future.

Things which must be implemented are annunciator, tone and printer support. In the current state the emulator isn't suitable for the public distribution so there is a lot of work left in this area. And, of course, a lot of testing, testing and testing ...

I am now going on a 10-day vacation to Dubrovnik. In the meantime I would like to know what do you all think about this project ...

Best regards.


W O W !


This is absolutely great! And it may be a reason for me to buy a 48 as long as they're available...

Pascal (42S user as well)


Saving to the flash memory of the RPN program and loading function.

I want HP-41X to increase saving of the RPN program and a loading function.
The peripheral device of HP-IL is necessary to save a program with HP-41C.
The peripheral device of HP-IL is big and inconvenient for carrying.
HP-42S can't save a program, either.
HP-48GX and HP-49G can add a flash memory.
Moreover, it can obtain a cheap flash memory manufactured by the third party even now.
(ex. KLOTZ electronic 128KB =25EURO,1MB =40EURO,2MB =70EURO and 4MB =250EURO)
It is very convenient if a RPN program can be saved after No.2 of the port of the flash memory.
As for the format of the file,
I want it to prepare for two of the binary form and the text form.
A binary form is necessary to download the RPN program debugged with HP-41X into HP-41C.
A text form is necessary to edit the RPN program of HP-41X on the text editor.


Actually, the plug-in cards for the 48SX and 48GX are battery-backed SRAM. In many ways this is more convenient than flash memory, but the card requires its own battery to retain memory at all times except when it's in the calculator and the calculator is turned on.

The 49G doesn't have the option of plug-in memory cards of any kind, but has built-in flash memory. The flash memory has the advantage of being non-volatile; you don't need any battery at all for it to retain memory. It has the disadvantages that it takes more power and time to write to, and the calculator can't actually "erase" just one object from flash memory, it has to clear an entire bank at one time. What the system does when you "purge" an object from flash is add a marker to it to tell the system to ignore it. Eventually, I'm sure, it's necessary to copy any valid objects from the bank and clear the entire bank so that it can be used for new objects. I don't know the details of how that works. And of course, on the 49G you can't remove a memory card for storage off-calculator. If you want to back up something off-calculator, you have to transfer it to a different device (a PC, for example).

But on a 48 series, there's the problem of the card battery going dead, so it's a good idea to use the PC for backups anyway.




If I have understood your message correctly, you want to load programs to (and save programs from) the HP-41X. Although I haven't found it useful for me, maybe I will include the possibility to load RAW files into the emulator. You can convert various other formats to RAW by programs like HP41UC.EXE (User-Code File Converter/Compiler/De-compiler by Leo Duran).


I hear that HP-41X supports an infrared rays printer, and I am very much expecting it.
I want HP-41X to increase a log file formation function, too, in addition to this.
Data to transmit to the infrared rays printer are accumulated in the flash memory.
It can be reconfirmed on the liquid crystal screen of HP-48GX if a result of a calculation can be left by the file.


Yes, HP-41X printer output can be sent to the HP-48/49 display as well as to the HP-82240 IR printer. This is described on my homepage.

I don't understand the rest of your message. What is the 'log file formation function'? What do you mean by 'Data to transmit to the infrared rays printer are accumulated in the flash memory'? What 'can be reconfirmed on the liquid crystal screen of HP-48GX if a result of a calculation can be left by the file'?


Would you please try to make it fit in a 48G+ (128 K RAM, no RAM slots)? It would be wonderful!!


There is no way to fit the HP-42X into 128K of RAM (HP-48G+ or HP-48GX without memory cards). It requires 64K (HP-42 ROM) + 64K (Emulator ROM) + 32K (Emulator RAM) + 96K (HP-42 RAM) = 256K.

I heard that some guys from Germany are working on a HP-42 emulator which will be integrated into HP-48/49 POL system. Maybe it will fit into HP-48G+.


Understood. So 256K is an absolute minimum. As I don't have a clear understanding about the "ports" issues, I would like to know if your emulator would work in a "expanded" 48G+, upgraded to 256K by means of internal chip soldering, so to speak. Thank you, I think your simulators are great, at least from what I saw in your web page.

PS: Would it work in a WindowsCE PC PDA with Emu48?


As soon as you see Ports :1: and :2: (at least) in the PORTS menu it can be installed. It means that you must have the HP-48G+ upgraded to at least 128+256=384K. It would be possible to run the emulator with just a 256K (only port :1: is present) but in this case the 128K of the main RAM has to be used and will be destroyed. I don't think that would be a clever idea :-(

I will try to see if an lite version of the emulator can be developed which could be used with just port 1 ...

And yes, it works fine under Emu48.


Just an addition to the Emu48 topic. At the moment the Emu48 Win32 version is at v1.30, v1.31 is coming soon. There are only minor improvements of the emulator in the last time, so v1.31 fixes an adress wrapping bug at the following code sequence:

D0=(5)	#FFFFF

and fixes bugs in the keyboard handler, when timer2 is off. Truely I don't know any programs that use these features/modes, but I think that especially emulators, running on a calculator, are programmed very close to the calculator hardware. So these sorts of programs might have problems running on an emulator.

When we are now looking on the latest Emu48 version for WinCE, the lastest revision is v1.23. May bugfixes have been done since then. Another point is that nobody guarantees the Win32 and the WinCE version 1.23 are functional equal. I don't know how the author of the WinCE version synchronizes his sources to the Win32 version, but that must be hard work. So telling that it's running on Emu48 Win32 version don't mean automatically that it's also running on the lastest WinCE version or vice versa. Nearly all programs will do, but not all.


this sounds like a great idea, i'll probably buy a copy when it's done. even though i have never run your program yet i have one suggestion. when everything else is finished and debugged you might think of writing an option that gives the softkey labels AND both lines of display, or even three lines of display. i used the d'zign surveying software in my first 42 and it was perfect except that i often wanted to see northing, easting, and elevation or azimuth, horizontal distance, & elevation difference or station, offset, & cut/fill all at one time. the screen is there taking up space - you might as well use it.


Three lines left over are used for debugging.

HP-42S can be indicated only two lines.
HP-48GX can be indicated five lines.
What will I only have to use three lines left over for?
I propose using it for the debugging information.

5:The line number that it is carried out at present, and a command are indicated.
4:An optional register, a flag, a stack Z, a stack T and LASTX are indicated.
3:A command input area for debugging. (Query?)
2:The stack Y of HP-42S.
1:The stack X of HP-42S.

Indication example.
5:10 STO+ 02

A stack isn't destroyed even if a command for debugging is inputted.
Not only value is referred to for the command for debugging but also it can be set up.

Command example.
3:Query?TRACE On
3:Query?TRACE off
3:Query?SHOW R02
3:Query?4.567 STO 02



I think Hiroshi's idea - using "unused" levels 3, 4 and 5 (meaning status area) to show on-line hidden information - would help a lot debugging programs for the HP42.

If it is easy to implement, these features would allow even actual 42's users to develop and debug programs. Even if they are no exactly what Hiroshi proposed, using them this way would be better than, say, showing Z- and T-registers' contents. At least I believe so, because we do not have this T- and Z-registers view in the actual HP42. I know we do not have the information requested, but this is somewhat new fashion: a query, an optional register and running program line.

Well, I do not know how does Hrast see these requests. He has already done so much... (hey, Hrast, will you transform all of your development in a BOOK so we all can buy it and understand the process? Will you open the Pandora's Box while we observe you? I know you will sale the emulator, but a book is also a source of good money...)

Best regards.


Well, I am perfectly satisfied with the way HP-42S display is organized and don't see any need for the additional display information (something must be kept in the programmer's head, too). Usually, I use unused display lines for the printer output (as I have done with HP-41X). Maybe I will do the same with HP-42X, I don't know.

I heard that some guys from Germany are working on a HP-42 emulator which will be integrated into HP-48/49 POL system. Maybe it will have the possibility to show additional stack levels. HP-42X doesn't integrate - it is a standalone program which takes the total control of the calculator (including the interrupt system and everything else). When you start the HP-42X (as well as HP-41X) the HP-48/49 operating system is disabled. That's the way I like it ...

As for the book - I don't plan to release the internals of the emulators. This is something I want to keep just for me. I am professional programer and I own a little software bussiness so this is my source of the money. Emulators are my hobby. I have released HP-41E as a freeware somewhere in the 1999. but then I decided to sale the HP-41X (and HP-42X, HP-71X, ...) because I was frustrated by the people who are ready to pay 200$+ or 300$+ for the used calculators and are expecting to get the emulator for free. I have even seen the guy who's asking 350$ for the second hand HP-42S on eBay !!! If you had the buy everything what is built-in (and come with) the HP-41X then you had to have more than 1000$ in your pocket ... and you won't come even close to the all features of HP-41X (huge memory capacity, 16-characters LCD, increased speed, 8-ports, printer emulation, flexibility, etc, etc.) because the real calculators don't have them.



I did not see this way. You are right. 100%.

About the book, I thought about it with the readers' view in mind, not the writers'. I thought about making some money NOT EXACTLY by depicting the HP42SX emulator, but showing some basic guidelines on how to create emulators in the HP48/HP49. I do not have any idea if there is a way to do it differently, I just thought about it.

My development area is basically HW. I am still collecting data about available microcontrollers, and I intend building a hardware emulator for the HP calculator's platform. I need some more info about the Saturn internal structure (special registers, F.P. instructions, and the like); is there some other source of info beyond the ones normally mentioned in here?

Congratulations, Hrast; this is the kind of professionalism I admire and encourage.

Best regards.


A 42S emulator for the 48GX is something that I have hoped you would develop. Others have made many suggestions of features to include. It would be great to display the x and y registers with a soft menu up, or to perhaps display x, y, z and t (with or without the softmenu), but just having an emulator that exactly duplicates the 42S will be good enough. The only thing I would ask is that if possible, it should be able to run on a 48GX with no memory cards (which would also make it able to run on a 48G+ as was requested above). However, if this is not possible, that will just give me an excuse to buy a RAM card. I assume a 1 or 2 meg card (as available at very reasonable prices from Klotz Electronic) would do, correct?

On a related note, is anyone familiar with making/using keyboard overlays for the 48 series? The keyboard has the slots in it which I have always assumed were there to accept overlays, but I do not recall ever seeing any overlays. Since the 42S has only one shift key, it has only two functions per key. Therefore, it seems like an overlay that had the two functions printed above each 48 key (except the numeric, math functions, back-arrow and ENTER keys that match on the two machines) could be produced that would make it very easy to use the 42X emulator on the 48G.


HP did market keyboard overlays for the 48SX at one time. The package came with three opaque light grey (or maybe beige describes them better), three (nearly) transparent, and one transparent with the Left/Right shifted Alpha keyboard characters printed in orange/blue on the bottom surface. All have a matte finish on the top surface. The transparent ones are about .010" thick and the opaque ones about .011" thick, and each has six tabs extending out about .06" (maybe 1/16"?) to fit in the slots at the sides of the keyboard. The slots on the calculators can take a thicker material, up to maybe .035", or I suppose that you could store a couple of overlays under the one currently in use (assuming that you're using opaque overlays). Offhand, I don't know the part number, or whether HP ever marketed a set for the 48G series. I'm almost certain that some "third-party" applications came with custom printed overlays.

I expect that the HP overlays would be very hard to find now, and I doubt that it would be profitable for anyone to tool up to mass-produce them. It does occur to me that it might be possible to make them with a CNC cutting laser, similar to that used for some prototyping systems, or perhaps with a CNC mechanical cutter, or maybe just score the material deeply enough so that it could be finished by hand. I suppose that someone with a lot of patience and a steady hand could make a usable overlay himself.





the HP part number is 82220A Overlay Kit for the HP-48 SX.

The IMHO nicest of these overlays is the transparent one with special alpha chars.

A drawback is that your keyboard legends become somewhat cluttered because of those many symbols around the keys;-)

That reminds me of the 20S or worse, the 32SII...

But the best overlay, all in all, is that from the HP-41CV Emulator Card;-)




Some other keys like STO, Shift, Up, Down are matching and others are very easy to remember: RCL (EVAL), XEQ ('), R/S (SPC). Keys A..F are used as a menu keys and NXT can be used as a Down key, too. Of course, overlay would be very useful for shifted keys.


Welcome back from your vacation! Hopefully you had a good time and are now refreshed and ready to put the finishing touches on the 42X emulator.
I gather from your response regarding key assignments that you have re-mapped some of the 42S keys to different keys on the 48GX, i.e. to different physical row and column locations on the keyboard. That probably makes sense for keys that have the exact same primary key label but are in different locations, like STO, SIN, COS, TAN, +/-, EEX (just E on the 42S, but the same as EEX). However, this brings up a bit of a philosophical question: would it be easier for an experienced 42S user to have the functions in the same locations on the keyboard, or re-mapped to keys with the same/similar labels and/or easily remembered names? May I suggest or request that you give 42X users the option to either go with the key function re-mapping that you were already planning, or having the 42S functions mapped to the same row/column locations on the 48GX keyboard? (Of course it makes perfect sense to have keys A Through F be the menu keys in either case.) The 42X is to me the "Holy Grail" that I have been searching for. As soon as you make it available, I plan to get it and start using it. In the meantime, I'll start pursuing fabrication of an overlay. In case anybody was wondering, the part number for the SX overlay given in a previous post is no longer available from HP. I think having an HP manufactured overlay to use as a starting point would greatly simplify the fabrication process. Does anybody have any suggestions for where to get one? I don't think I have ever seen one come up on eBay.


You're right about the keyboard mapping: with the overlay it would be better to have keys on their physical locations. I will take this into consideration ...

Best regards.



I was the one who mentioned the 82220A,
and yes, I got the set through eBay for a few bucks;-)

But I have to admit that they don't seem to be very common.


See ya later emulator;-)


I saw here many requests for a HP42S emulator running on a HP48 or HP49. But for what?

IMHO the HP48 is a great machine, mostly everything (except executing HP42S code) I could do with a HP42S I also could do with a HP48, mostly even better. I personally have a HP42S and the best thing on this machine is it has a very small size for the amount of functions and is mostly a little bit faster than the HP48 at normal calculation.

But the main topic for me is the calculator size and weight. A HP48 is IMHO too big and too "heavy" to carry it in a jacket pocket, so this could be no reason for the HP42S emulation.

One point could be the software compatibility with HP42 (for HP41 exist emulators) programs. But which important programs exist only for the HP42S and not for the HP48? There was a reason for a HP41 emulator in the early 90'ties, because the wasn't many applications and more important no specific software for the HP48, but today?

So is there really a need for a HP42S emulator on a HP48/49 or is it just "nice to have". But who is willing to spend a lot of bucks for a "nice to have product"? Perhaps the same people who spend over US $200 for a real HP42S?

And finally, what a shame, I have a HP42S and don't use it. In office or at home I use my HP48 (SX) or more times Emu48 on the PC. And in my jacket pocket I have a HP32SII (the cheapest RPN calculator today) for the easy calculations at the places where I don't have a HP48 handy. :) The only reason, why I bought the HP42S was, I needed a legal way to get a ROM image, a HP42S faceplate, and a real machine to discover some secrets of the Lewis chip and some other internals (display, keyboard, MMU, ...). And that only just for fun.


You are perfectly right - we really don't need an HP-42S emulator on HP-48/49.

Thanks for explaining me such a obvious fact. Maybe I have been stuck in the past because I use HP-41X every day and I will use HP-42X on my HP-48GX. IMHO the HP-48GX (with memory cards, of course) is the best calculator ever produced by HP. It is soooo good that it is able to emulate other calculators in the HP family. What is wrong with this?

Maybe the reason for writing the emulator is just to show that it could be done. Before I have started working on a HP-41E in 1998. people said that it would be impossible, that HP-48 isn't powerful enough, that emulator will be very slow, etc, etc. But I have done it and (at the end) it was much faster and more powerful than a real HP-41.

I have (almost) done an HP-42S emulator, too. It will be very useful for me (as well as other emulators I am planning to write) and if it will be useful for someone else that's even better ...


TNX for your comments. It's like why to climb on a mountain -- because it's there.

BTW, really good work, I personally would have no idea how to capture the I/O access to the hardware without having methods like page access faults.


I enjoy climbing on the mountain, too ;-)

Best regards.


Well, some of us don't especially like the 48 programming language, and much prefer the keystroke programming of the 41/42 models...

Personally, I prefer an actual, physical 41CX to anything else, but the 42X running on a 48GX looks very tempting.


The key stroke programming is a good objection. I never thought that somebody would like the key stroke programming more than the RPL one. My first HP calculator was an HP15C (with key stroke programming) and I really don't liked it (perhaps also because of the very very slooow program running speed). One year later I bought a HP28S and IMHO this was a big step forward -> structured programming on a calc and much faster than the HP15C. So after over 14 year of RPL programming, mostly on a HP48SX, key stroke programming is complete out of my mind.


I don't like keystroke programming more than RPL (or System RPL, or ML) but in many cases it is just simpler to write a keystroke oriented programs. That's why it is nice to have an HP-41/42 emulator by hand on the HP-48/49 :-)

Best regards.


I don't think we need a discussion of the merits of the 42S vs. 48G, etc. To each his own! If you prefer the 48 Christoph, more power to you. Hrast, the first line of your response to Christoph scared me a little (“You are perfectly right - we really don't need an HP-42S emulator on HP-48/49”). I thought maybe you had decided to abandon the 42X project. However, the last line provided comfort that you do plan to continue. Rest assured that you are correct, it will be useful for someone else, actually many others I suspect.
I had one question which I poorly stated in my original post in this thread. That is, does the 42X require a 128k Ram card in each slot to work for some reason, or will a single 1 Meg, 2 Meg or 4 Meg card suffice?


There is no reason to abandon the HP-42X :-) My first line was just a little sarcastic. I don't like comments like 'X is better than Y' or 'we don't need Y because we have X' etc.

Regarding the memory cards - there must be a 128K card in slot 1 but you can have anything >=128K in slot 2 ... On the HP-49G the whole Port1 will be used.

Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime Emulator download John Colvin 2 843 12-14-2013, 05:54 PM
Last Post: John Colvin
  HP-48GX & 50G Question Matt Agajanian 2 818 12-08-2013, 10:17 PM
Last Post: Matt Agajanian
  HP-42S celebrates its 25th anniversary today!!! Yriarte 7 1,183 10-31-2013, 05:56 PM
Last Post: Massimo Gnerucci (Italy)
  HP-42S ESD self-test Yriarte 2 685 10-24-2013, 09:08 AM
Last Post: Yriarte
  HP 50g info Jan 7 1,307 10-21-2013, 09:09 PM
Last Post: Mike Morrow
  Storing HP-42S without batteries Yriarte 4 834 10-19-2013, 08:32 PM
Last Post: walter b
  Prime 'CONTENT' section not retaining info text Geoff Quickfall 2 679 10-17-2013, 05:24 PM
Last Post: Geoff Quickfall
  HP-42S repair of unresponsive keyboard Tom Grydeland 1 506 10-08-2013, 07:04 PM
Last Post: aj04062
  BATTERIES' SWAP ON HP 48GX aurelio 7 1,213 10-06-2013, 07:50 PM
Last Post: aurelio
  Portable HP Prime Emulator bluesun08 7 1,161 10-03-2013, 01:37 PM
Last Post: fhub

Forum Jump: