XUnits49 v1 – Custom unit converter for the HP49

© Luis Morales Boisset - Madrid. Spain. 2001/05/13


1. Overview

This is a library intended to make custom unit conversion. When the HP48/49 designers develop the unit features of the 48/49 they forgot the complement of UBASE. The idea of this software comes from Lutz Vieweg in the old 1991. This is only a revision of that for the 49.

2. Disclaimer

The library is distributed 'as is' and is subject to change without notice. No warranty of any kind is made with regard to the software or documentation. The author shall not be liable for any incidental error or consequential damages in connection with the software and/or the documentation.


XUnits49 can be freely distributed provided this manual is distributed with it without any modification. XUnits49 can't be used for any commercial purpose without written permission from the author. This implies the user shouldn't be charged for the use of this software.


Remember as well that I only work on RPN mode so no test is made for ALG mode. But the few times I try to deal with matrix on this mode makes me suppose it will be very complex to use in ALG mode if it will run.


English is not my native language so please excuse all my linguistic mistakes.



3. Backup

This software has been tested by me and seems to be safe but like always please backup your memory before trying it. It’s done 80% in SysRPL and 20% ML with MASD so if there is any bug I haven’t detected you could loose you data L



4. History and Credits

The idea of this software is taken from one done for the HP48sx long time ago: XUnit which is available in www.hpcalc.org . I include the Lutz Vieweg original port. This version improves a bit the algorithm and extend the ML code used.

With the 48G series comes a lot of unit converters and now in the 49 there are some as well. The better are Utools from Carsten Dominik which does a lot more than this. And SIUnit from Ruben Perez.

SIUnits uses the same base than XUNIT with an improved algorithm (It’s quicker than XUNIT) but has the units hardcoded. So I decide to make public my one.

Utools use it’s own algorithm. It’s great! It has a wonderful interface and support custom unit bases which XUNIT doesn’t support because it tries to minimize the “weight” of the units. In the other hand Utools doesn’t support a list of units which are related because it need a “Base” so the list of units I normally use gives more than one transformation for the SI units. So I press myself to finish XUNIT.


So my credit goes for:

-         Lutz Vieweg ( XUNIT in 1991 ).

5. Installation

This program is a library. Its number is 1744 which I hope is not used.  To install it you should transfer it to your HP in binary mode. Recall its contents and store it in any of your ports. Now you can purge the variable from where you download it. Then you should restart your HP.

At this point you could access to its menu in the Lib menu [LS][2] hint [NXT] if necessary. Or using 1744 MENU.


To uninstall it you should do:


:port:1744 PURGE [ENTER]


Other way of accessing and uninstalling this library is with the 49’s Filer which is pretty good in this. Look for it in the port were you stored it.


6. Command Description




This command it’s the main command of the library. It makes the unit conversion based on the information stored in UNITPAR, so prior to use it you should use Usto command.

What it does? It’s the complement of UBASE. The  49’s UBASE command allows you to convert any unit into it’s SI equivalent. But it’s very common that one use different units than the SI ones. For example the CGS system or mili-amperes and kilo-ohms in microelectronics. So this library allows you to do this conversion.


The algorithm takes the list of units stored in UNITPAR and tries to minimize the “weight” of the unit part with the selected unit list. This “weight” it the absolute value of the powers in the unit part.


So let see an example. First of all we need to provide a unit list for the conversion. This is only need once.

 pressing USto the UNITPAR data is generated.

Now we are ready to do our calculations. And any time we want to see the result in our units it we only need to press XUNIT. For example:


 à ÷ à  à XUNIT à



This command recalls the unit list stored in the UNITPAR variable. This variable could be in the current path branch not only in the current directory. So you can create it in HOME for global access and have specific one directory.



Level 1


Level 1






This command stores the list of units to use in UNITPAR. This variable is not only the list. It’s a library data with the list and the vector units precalculated for  speed. It’s stored in the current dir.

Its stack diagram looks like this:



Level 1


Level 1





7. Final Remarks

Library is ID 1744. Its size is 1000.5 bytes and its checksum is #6DEEh.

The library have done in SysRPL and ML.

It’s completely done in the HP49 with Masd, Emacs and the help of Nosy.


I really hope this will useful for you.



8. Acknowledgements

I would like to thank to:

·       Mika Heiskanen. His Entries.src discovered me the insides of my 48sx.

·       Alex Ramos. His RPL++ compiler let me start to work in SysRPL without the complexities I found with HP ones.

·       Detlef Mueller and Raymond Hellstern for RPL48

·       C.Bourgeois (BOUHP). The ‘Kernel’ stack replacement discovered me a new work and force me to do a really good job on my sx.

·       Jean Yves Avenard. StringWriter! How do you do it?

·       Bernard Parisse. The ALGB (the Erables’s father) makes me realize that the 48 could do magic.



·       ACO for the Hp49.

·       Carsten Dominik and Peter Geelhoed for Emacs

·       Jurjen N.E. Bos for Nosy.




9. Contact

As I explain in the disclaimers part this is freeware but I spent a lot of time on it so I’ll really thank any email telling me what do you think about it of if you find any bug or have any idea to extend it.

Luis Morales Boisset