The Museum of HP Calculators

HP Articles Forum

[Return to the Index ]
[ Previous | Next ]


41C to 50g Migration

Posted by Egan Ford on 1 Mar 2008, 4:48 a.m.

Abstract

Busted, lost, stolen, etc... Words that describe the fate of many beloved 41Cs. However, life after the 41C is possible. This article describes how to run your favorite 41C programs on your relatively cheap, replaceable, and handsome 50g.

NOTE: the following article also applies to the 48 and 49 series.

41C Emulators for the 50g

HrastProgrammer has developed a complete line of 41C emulators that include support for a number of popular plug-in modules. These emulators are available for the 48/49 series and the 50g. This article focuses on the freely available HP-41E. The commercial version (HP-41X) offers enhanced features not available with HP-41E.

HP-41E is an HP-41CV emulator that comes in eight different flavors. This article is based on the HP-41EA flavor. A complete description of each flavor can be obtained here: http://hrastprogrammer.com/hp41e/index.htm.

Installing HP-41E

The follow instructions assume that you have an SD card with at least 350 KB free.
  1. Power off your 50g and remove the SD card.
  2. Insert the SD card in to your desktop/laptop SD card reader.
  3. Create an HP41E directory.
  4. Download http://hrastprogrammer.com/hp41e/hp41e50.zip and extract into the HP41E directory on the SD card.
  5. Put the SD card back into the 50g.
  6. Create an HP41E folder in the 50g HOME directory.
  7. Create an HP41 program in the HP41E folder with the following contents:
    << 3: "HP41E/HP41EA" EVAL >>
    
Alternatively you can just drop HP41EA into any 50g directory and run it from there. This will save you the hassle of creating a RM41 file, but it will take up to 75 KB of RAM, whereas RM41 requires less than 7 KB of memory.

If you are just browsing and want to take a test drive first, then fire up Debug4x (EMU48 with 50g support), drag-and-drop HP41EA onto the virtual LCD (first level stack element should be 'Code'), then type 'HP41' ENTER STO.

Running HP-41E

From your 50g HOME/HP41E directory run the newly created HP41 program. You'll be greeted with a MEMORY LOST message:

Try not to get too excited, we still have a bit of work to get done. Ok, go ahead and add a few numbers together, get it out of your system. When you are done playing around use ON-F to exit. Now run HP41 again. Doh! MEMORY LOST message again. No problem, you just need to enable memory saving. To do this press ON-STO. Now add a few numbers together, then ON-F. You'll notice a new file in your 50g HOME/HP41E directory: RM41. This is the persistent HP-41E storage. If you remove that file you lose your memory.

If you want to keep your RM41 file on SD, first copy it to SD:

'RM41' RCL
:3:"HP41E/RM41" STO
'RM41' PURGE
then change the HP41 launch program to:
%%HP: T(3)A(R)F(.);
\<<
  :3:"HP41E/RM41"
  RCL 'RM41' STO
  :3:"HP41E/HP41EA" EVAL
  'RM41' DUP RCL
  :3:"HP41E/RM41"
  DUP PURGE
  STO PURGE
\>>
This is also useful for desktop to 50g shuttle transfers.

As you experiment with HP-41E, you'll notice that there is not a 41C to 50g key for key equivalent. Until you memorize the differences, print out this keymap, laminate it, and put in your wallet:

The labels in brackets ([]) are the replacement for the label on the key. The unbracketed labels are the shifted function.

Programming HP-41E

Programming HP-41E is no different than a real HP-41CV except that its harder until you memorize the keymap. Alternately there is an easier way. Using a couple of freely available tools you can compile your 41C listing in to a RAW file and then use the RAW41 utility to insert them into your RM41 file.

Big picture process:

  1. Create a working directory on your desktop/laptop. E.g. C:\WKDIR.
  2. Copy RM41 from your 50g and place in working directory.
  3. Place 41C programs as text files in working directory.
  4. Use HP41UC to compile text source files into RAW files.
  5. Use RAW41 to insert RAW programs into RM41 file.
  6. Copy RM41 to 50g.
RAW41 can be obtained from: http://hrastprogrammer.com/hp41e/raw41.zip, and HP41UC from: http://www.hpmuseum.org/software/41uc.htm.

TIP: I store my RM41 file on my SD card in the HP41E directory. HP41UC, RAW41, and my source files are in that directory as well. When I need to manage my RM41 file, I just put the SD card in my laptop and change to the SD HP41E directory and do all my work there. Makes it easy.

NOTE: HP41UC is a DOS program and can be run from any DOS emulator (e.g. DOSBox). However RAW41 is a Windows executable. For RAW41, Mac/Linux users will need Windows installed in a virtual machine. I recommend VMware Fusion for the Mac and VMware Workstation 6.5 for Linux.

Wine (Windows Emulator) is also an option. An example Wine session from a Linux workstation:

$ wine RAW41.EXE \? RM41
HP-41E Program Manager
Copyright (C) 1998-2000 by HrastProgrammer
LOAD RM41 ...
CALC=HPHP49-C
REGS=320 SIZE=273 R00=0EF BOTTOM=040 TOP=3EF 
FIRST=0C0 .END.=0C8.2 PRGM=0D4.6 LINE=FFF
PROGRAMS:
  0C8.2 C80C20 .END.
  0D4.6 C600F7 LBL "SORTEM"
  0D5.2 C80500 END
  0DA.6 C600F7 LBL "SAVAGE"
  0DB.2 C80800 END
  0E3.6 C600F2 LBL "S"
  0E4.2 C80900 END
  0ED.6 C600F5 LBL "NQ41"
  0EE.2 C00000 END
A few things to consider with Wine and Linux or OS/X:
  1. Names are case aware AND case sensitive (Windows is just case aware).
  2. ? is a meta character, to safely pass ? to RAW41.EXE, use \?. If you do not you run the risk of ? being expanded to the first filename in your working directory that is one character long. Granted its low risk, but still a risk.
Wine can be obtained from: http://www.winehq.org/.

Compiling Programs with HP41UC

For example create the program COOL.41C with your favorite text editor (Word is NOT a text editor, try notepad):
;my cool program
LBL "COOL"    ;always comment your code
"HP-41E IS"   ;put string in alpha register
>" SO COOL"   ;put more string in alpha register
AVIEW         ;show the string
END           ;end of program
Compile with HP41UC:
C:\WKDIR>DEL COOL.RAW
C:\WKDIR>HP41UC /t=COOL.41C /r=COOL.RAW
Output:
txt[ C:\WKDIR\COOL.41C ] => raw[ C:\WKDIR\COOL.RAW ]
.END. found on line 6.
 type[ E080 ]
 size[ 0020 ]  ( 32 bytes )
 implementation[ 00200020 ]
256 bytes written.
For more information on HP41UC read the documentation: http://www.hpmuseum.org/software/41uc.htm.

Inserting Programs into HP-41E Memory

First list programs:
C:\WKDIR>./RAW41 ? RM41
Output:
HP-41E Program Manager
Copyright (C) 1998-2000 by HrastProgrammer
LOAD RM41 ...
CALC=HPHP49-W
REGS=320 SIZE=273 R00=0EF BOTTOM=040 TOP=3EF 
FIRST=0C0 .END.=0EE.2 PRGM=0EF.0 LINE=000
PROGRAMS:
  0EE.2 C00020 .END.

Empty. No programs. Load program:

C:\WKDIR>RAW41 COOL.RAW RM41
Output:
HP-41E Program Manager
Copyright (C) 1998-2000 by HrastProgrammer
LOAD RM41 ...
RAW=COOL.RAW CALC=HPHP49-W
REGS=320 SIZE=273 R00=0EF BOTTOM=040 TOP=3EF 
FIRST=0C0 .END.=0EE.2 PRGM=0EF.0 LINE=000
PROGRAMS:
  0EE.2 C00020 .END.
LOADING FROM RM41 TO RM41 (CHECKSUM=D8 FREE=322 RAW=32) ... 
CALC=HPHP49-W
REGS=320 SIZE=273 R00=0EF BOTTOM=040 TOP=3EF 
FIRST=0C0 .END.=0E9.2 PRGM=0ED.6 LINE=FFF
PROGRAMS:
  0E9.2 C80420 .END.
  0ED.6 C600F5 LBL "COOL"
  0EE.2 C00000 END

Cool program loaded. You can verify again with:

C:\WKDIR>RAW41 ? RM41
Output:
HP-41E Program Manager
Copyright (C) 1998-2000 by HrastProgrammer
LOAD RM41 ...
CALC=HPHP49-W
REGS=320 SIZE=273 R00=0EF BOTTOM=040 TOP=3EF 
FIRST=0C0 .END.=0E9.2 PRGM=0ED.6 LINE=FFF
PROGRAMS:
  0E9.2 C80420 .END.
  0ED.6 C600F5 LBL "COOL"
  0EE.2 C00000 END
For more details on RAW41 read the documentation: http://hrastprogrammer.com/hp41e/raw41.htm.

Running HP-41E Programs

After you have copied RM41 from your desktop/laptop back to your 50g, then run HP41, and type:
EVAL ALPHA C O O L ALPHA
Easy!

Summary

There is an abundance of 41C programs available. It is easy to download, compile, and load into HP-41E without actually having to type in the programs. As for your own programs, well at least you can type them in your desktop/laptop first, compile, then load.

Your 41C programs live on. Enjoy!

References

Edited: 10 Apr 2008, 4:00 p.m.

Password:

[ Return to the Message Index ]

Go back to the main exhibit hall