The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

How to transfer a HP 41 program to an emulator
Message #1 Posted by Marcus von Cube on 26 Apr 2005, 2:12 a.m.

Hi!

I'd like to test my S&SMC#8 program for the HP 41 on one or more of the available emulators. What is the easiest way to do it?

I do have:

NoVRAM - Can I store the program there and read it with the PIC programmer into the PC?

HP-IL - In what way can I use Christoph Klug's HP-IL card to transfer a program in a suitable form?

Which emulator is the fastest? Since the program can run on a HP 42, too (that's how I wrote it!), the HP 42 emulators should be considered in addition to the 41 emulators.

Marcus

      
Re: How to transfer a HP 41 program to an emulator
Message #2 Posted by Mike (Stgt) on 26 Apr 2005, 3:19 a.m.,
in response to message #1 by Marcus von Cube

Well, if you have Christoph's IL-PC card I would try OUTP to store the program on disk in HEX. Then convert it to RAW like this:

 09:09   26.04
 01 LBL "OUP2RAW"
 02 "DOSLINK"
 03 FINDID
 04 SELECT
 05 XEQ 00
 06 STO 00
 07 256
 08 *
 09 STO 01
 10 XEQ 00
 11 ST+ 00
 12 ST+ 01
 13 GTO 01
 14 LBL 00
 15 2
 16 INAN
 17 ATOX
 18 XROM "D"   /* hex in Alpha to dec in X */
 19 RTN
 20 LBL 01
 21 XEQ 00
 22 OUTXB
 23 ST+ 00
 24 DSE 01
 25 GTO 01
 26 XEQ 00
 27 RCL 00
 28 256
 29 MOD
 30 "CHKSM ERR"
 31 XY?         /* X.ne.Y */
 32 AVIEW
 33 END

That's just how I would do it - probably there are more sophisticated solutions.

Ciao.....Mike

            
XEQ "OUTP" -> NONEXISTENT
Message #3 Posted by Marcus von Cube on 26 Apr 2005, 3:58 a.m.,
in response to message #2 by Mike (Stgt)

Mike,

where do I get OUTP from?

BTW, why creating HEX2RAW on the HP if the file is on the PC? Wouldn't it be much easier to let the PC do it (in C or BASIC or whatever?) Or is the file stored in a LIF container file which is not easily accessed from PC programs?

I hadn't much time to play around with the HP-IL card: it's plugged into an ancient DOS machine with limited network access. The fun playing with this computer is limited...

                  
Re: XEQ "OUTP" -> NONEXISTENT
Message #4 Posted by Mike (Stgt) on 26 Apr 2005, 8:45 a.m.,
in response to message #3 by Marcus von Cube

EXTENDED I/O contains XROM 23,40 OUTP

With JF Garnier's Emu41 I do have an HP-41 on the PC with access to the PC's disk. So why should I learn C or BASIC?

BTW, how do you distinguish work and fun?

Ciao.....Mike

                        
BTW, how do you distinguish work and fun?
Message #5 Posted by Marcus von Cube on 27 Apr 2005, 2:37 p.m.,
in response to message #4 by Mike (Stgt)

Almost never!

            
Re: How to transfer a HP 41 program to an emulator
Message #6 Posted by Christoph Klug on 26 Apr 2005, 6:07 a.m.,
in response to message #2 by Mike (Stgt)

Dear Mike,

please give more details about the commands (or the needed plug in modules) of your program lines

18 XROM "D"

22 OUTXB

31 X?Y?

Exist a reversal solution for converting from RAW to program ?

Thanks - Christoph Klug

                  
Re: How to transfer a HP 41 program to an emulator
Message #7 Posted by Tony Duell on 26 Apr 2005, 6:23 a.m.,
in response to message #6 by Christoph Klug

To go from RAW (i.e. a binary HP41 program) to a listing, you can use the prog41 program in my LIF utilities for Linux. It should handle most synthetics correctly, and it lets you load files of names for XROM commands, rather than just displaying them as XROM nn,ff (but it does that if you haven't specified a name).

IIRC one of the other programs in the LIF utilities for Linux distribution will make a suitable file of names from an HP41 ROM module dump if you don't want to make the file by hand.

                  
Re: How to transfer a HP 41 program to an emulator
Message #8 Posted by Mike (Stgt) on 26 Apr 2005, 8:40 a.m.,
in response to message #6 by Christoph Klug

EXTENDED I/O contains XROM 23,39 OUTXB

X?Y? is "X # Y?", content of register X not equal content of register Y?

XROM "D" is following:

 01 LBL "D"
 02 CODE      /* an MCode routine */
 03 CLA
 04 X<> [     /* M */
 05 256
 06 ALENG
 07 CHS
 08 LBL 13
 09 RDN
 10 ST* Y
 11 R^
 12 X0?      /*  X .ne. Zero? */
 13 ATOXX
 14 ST+ Z
 15 X<> L
 16 ISG X
 17 ""        /* this is a NOP */
 18 X<0?
 19 GTO 13
 20 R^
 21 R^
 22 AOFF
 23 RTN

The MCode routine CODE is from "MCode made easy" IIRC.

Ciao.....Mike

                        
errata
Message #9 Posted by Mike (Stgt) on 26 Apr 2005, 8:51 a.m.,
in response to message #8 by Mike (Stgt)

Sorry, CODE is from ZenRom (XROM 05,03) -- M.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall