Post Reply 
(71b) HP41 module programs in HP71b
05-23-2019, 07:12 PM
Post: #1
(71b) HP41 module programs in HP71b
Hello,

I want to ask the community if there is a way to save HP41 modules (they are like *.MOD) for using them in the HP41 translator PAC on my HP71? Or can they be extracted in single programs?

I tried some unsuccessful attempts to install the modules via PIL-Box and pyILper.

Thanks in advance
Erwin
Find all posts by this user
Quote this message in a reply
05-23-2019, 08:41 PM
Post: #2
RE: (71b) HP41 module programs in HP71b
I don't know if this is useful, but you can use the MODFile program from TOS to extract the ROM images from MOD files, and you can then use the rom2raw program from the Free42 web page to convert the ROM images to *.raw files.

The rom2raw program was designed with HP-42S simulators and emulators in mind, but the raw files can be used in HP-41 simulators and emulators as well. Just be sure to run rom2raw with the -s option, telling it not to translate strings from 41 to 42S encoding.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-23-2019, 11:07 PM
Post: #3
RE: (71b) HP41 module programs in HP71b
41 Modules can't be used as-is in the 41 Translator. The translator provides a FORTH-based simulator that can run text files that are very similar, but not always identical to, FOCAL programs.

So, what you can do is use the tools Thomas mentioned above, then use one of several available RAW file translators to convert the individual RAW files to text (containing FOCAL listings), then bring those into the 71B via PIL-Box, and then you can use them in the 41Trans ROM. Some small tweaks are likely needed to get them to work, but such details are covered pretty well in the 41Trans manual.

Note however, that some ROMs have included some special non-FOCAL programs which can't be moved or used this way. When needed for performance or precision (or whatever reason) these special programs were implemented in MCODE, and sadly there is no solution for these, except possibly if you wanted to re-implement those as your own programs.

When you do a CAT-2 of the original ROM, the FOCAL program names begin with the little raised "T" in front of the program name, while MCODE programs don't have the "T", so you can quickly and easily tell by simply doing a CAT-2 of the module.

While the above is all true, many of the original HP ROMs were 100% FOCAL, so the odds are good with those (even if a lot of steps are required), however modern modules, such as most of Angel's amazing ROMs are nearly 100% MCODE.

It's an interesting topic to many folks, so please do post your results and lessons learned once you've done this.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-24-2019, 04:48 AM (This post was last modified: 05-24-2019 04:49 AM by Erwin.)
Post: #4
RE: (71b) HP41 module programs in HP71b
Many thanks to Thomas Okken and rprosperi !!! I have found these programs and will start my first attempts in the coming days. All I need is a Windows machine - I have a MAC.
The first goal is to get the HP41 navigation pac working on my HP71b, after my attempts with the HP71 navigation program HP-71B Software for navigation were only partially successful.

After implementation I'll tell the forum how it runs :-)

best regards
Erwin
Find all posts by this user
Quote this message in a reply
05-24-2019, 06:48 AM
Post: #5
RE: (71b) HP41 module programs in HP71b
(05-24-2019 04:48 AM)Erwin Wrote:  The first goal is to get the HP41 navigation pac working on my HP71b, after my attempts with the HP71 navigation program HP-71B Software for navigation were only partially successful.

You can find a text version of the HP41 navigation pac programs here . You may need to make some adjustments in order to be compatible with the instructions format needed by the HP41 translator PAC.
Find all posts by this user
Quote this message in a reply
05-24-2019, 07:33 AM
Post: #6
RE: (71b) HP41 module programs in HP71b
(05-24-2019 06:48 AM)Didier Lachieze Wrote:  
(05-24-2019 04:48 AM)Erwin Wrote:  The first goal is to get the HP41 navigation pac working on my HP71b, after my attempts with the HP71 navigation program HP-71B Software for navigation were only partially successful.

You can find a text version of the HP41 navigation pac programs here . You may need to make some adjustments in order to be compatible with the instructions format needed by the HP41 translator PAC.

Thanks a lot to all. I'll test this all ... best regards Erwin
Find all posts by this user
Quote this message in a reply
05-30-2019, 05:56 PM
Post: #7
RE: (71b) HP41 module programs in HP71b
First report,

unfortunately, I have no experience with HP41 (HP71b and HP67 only) so I can only use try and error for the data conversion.
I tried to convert the text program of the HP41 navigation program (like the proposal in the post from Didier). TRANS41 converted it without an error, but running the program ends with an error.
So I started with a small HP41 program (I named it VECTOR) to see how it is running. But this ends up with an error too.

This is the small HP41 program:
Code:
01 LBL "MV"
02 1/X
03 X<>Y
04 CHS
05 R^
06 CHS
07 R^
08 1/X
09 P-R
10 X<>Z
11 R^
12 P-R
13 RDN
14 +
15 X<>Z
16 +
17 R-P
18 1/X
19 X<>Y
20 CHS
21 X<>Y
22 END

and here the documentation of the run
Code:
>RUN TRANS41
HP41 Program File? VECTOR
Intermediate File? VEC
Translating...
 21 
 20 
 19 
 18 
 17 
 16 
 15 
 14 
 13 
 12 
 11 
 10 
 9 
 8 
 7 
 6 
 5 
 4 
 3 
 2 
 1 
 0 
 255  bytes. Load? Y
Loading...
VEC
Line 2 Data Type

This is the intermediate file:
Code:
>LIST VEC
961059 FTOI DUP EXECUTE 510 XSIZE 482 XSIZE CREATE @VEC EXECUTE ]
LBL"@VEC" LBL"VEC" 01 "MV"
021/X.
03X<>Y.
04CHS.
05R^.
06CHS.
07R^.
081/X.
09P-R.
10X<>Z.
11R^.
12P-R.
13RDN.
14+.
15X<>Z.
16+.
17R-P.
181/X.
19X<>Y.
20CHS.
21X<>Y.
22.END
END
[ BEEP

Are there any ideas what happens there?

best regards
Erwin
Find all posts by this user
Quote this message in a reply
05-30-2019, 08:40 PM
Post: #8
RE: (71b) HP41 module programs in HP71b
hmm... line 02: 1/X
did you provide something non-zero before RUNning the program?
Find all posts by this user
Quote this message in a reply
05-31-2019, 12:06 AM (This post was last modified: 05-31-2019 12:13 AM by Sylvain Cote.)
Post: #9
RE: (71b) HP41 module programs in HP71b
Hello Erwin,

You must remove the line numbers and for the case of X<>Z the command is X<> Z with a space before Z because the command is really X<>.

Sylvain

PLIST HP41MVT
Code:
LBL "MV"
1/X
X<>Y
CHS
R^
CHS
R^
1/X
P-R
X<> Z
R^
P-R
RDN
+
X<> Z
+
R-P
1/X
X<>Y
CHS
X<>Y
END

RUN TRANS41
Code:
HP41 Program File? HP41MVT
Intermediate File? HP41MV
Translating...
 20 
 19 
 18 
 17 
 16 
 15 
 14 
 13 
 12 
 11 
 10 
 9 
 8 
 7 
 6 
 5 
 4 
 3 
 2 
 1 
 0 
 89  bytes. Load? Y
Loading...
MV
Done

PLIST HP41MV:
Code:
961059 FTOI DUP EXECUTE 178 XSIZE 146 XSIZE CREATE @HP41MV EXECUTE ]
LBL"@HP41MV" LBL"MV"
1/X
X<>Y
CHS
R^
CHS
R^
1/X
P-R
X<> Z
R^
P-R
RDN
+
X<> Z
+
R-P
1/X
X<>Y
CHS
X<>Y
END
[ BEEP
Find all posts by this user
Quote this message in a reply
06-03-2019, 04:41 PM
Post: #10
RE: (71b) HP41 module programs in HP71b
(05-31-2019 12:06 AM)Sylvain Cote Wrote:  Hello Erwin,

You must remove the line numbers and for the case of X<>Z the command is X<> Z with a space before Z because the command is really X<>.

Sylvain

Hello Sylvain, that's great - thank you yes indeed that was the problem. Another one is that the ROM version has some code
Code:
XROM 14,01: user code "NA"
XROM 14,02: user code "*NA"
XROM 14,03: user code "STAR"
XROM 14,04: user code "*STAR"
XROM 14,05: user code "SUN"
XROM 14,06: user code "*SUN"
in it. And as far as I know that points to a specific address? Or I'm wrong. I'll try a snippet out of the ROM program I see how it runs. But it is not so easy I thought before, cause never owned a HP41.
I also tried to convert the ROM by myself and installed Windows in a virtual machine on my MAC but this conversion programs need some drivers ... :-( So I think this project will develop in longer story.

but thanks you all for sending me hints and solutions - I'll try my best
Erwin
Find all posts by this user
Quote this message in a reply
06-03-2019, 05:45 PM
Post: #11
RE: (71b) HP41 module programs in HP71b
(06-03-2019 04:41 PM)Erwin Wrote:  the ROM version has some code
Code:
XROM 14,01: user code "NA"
XROM 14,02: user code "*NA"
XROM 14,03: user code "STAR"
XROM 14,04: user code "*STAR"
XROM 14,05: user code "SUN"
XROM 14,06: user code "*SUN"

That's just informational output from rom2raw. Assuming you're looking at the zip file attached here, just work from the navigation.raw file, or if you want to use the navigation.txt file, just delete everything that doesn't start with a line number, i.e. everything from the start of the file until just before the line

Code:
01>LBL "NA"

Everything from that line onwards, until the end of the file, is user code, so that should be OK to convert and run. N.B. The Navication Pac is 100% user code, so you should be able to run all of it.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-03-2019, 07:07 PM (This post was last modified: 06-03-2019 07:08 PM by Erwin.)
Post: #12
RE: (71b) HP41 module programs in HP71b
(06-03-2019 05:45 PM)Thomas Okken Wrote:  That's just informational output from rom2raw. Assuming you're looking at the zip file attached here, just work from the navigation.raw file, or if you want to use the navigation.txt file, just delete everything that doesn't start with a line number, i.e. everything from the start of the file until just before the line

Code:
01>LBL "NA"

Everything from that line onwards, until the end of the file, is user code, so that should be OK to convert and run. N.B. The Navication Pac is 100% user code, so you should be able to run all of it.

Hello Thomas,

thanks for your reply - it is very helpful. But about the ">" Sign should i keep it? The other thing is, that the number start from 01 in between the code. Is this a problem or should I ignore it (delete)?
Code:
168 |-"N"
169 |-"?"
170 PROMPT
171 XEQ "*HR"
172 END

01>LBL "STAR"
02 CF 06
03 XEQ "D+T"
04 "STAR NO.=?"
And what about the "|" sign like in line 169 above? Keep it, delete it, change it? Then I'll start on the weekend again :-)

best regards
Erwin
Find all posts by this user
Quote this message in a reply
06-03-2019, 07:23 PM (This post was last modified: 06-03-2019 07:25 PM by Thomas Okken.)
Post: #13
RE: (71b) HP41 module programs in HP71b
The > before LBL can be removed, if the converter doesn't like it. It serves no function other than to highlight labels, similar to what happens in program listings made with the HP-82143A and other printers.

The |- represents the "append" character. I don't know how that's supposed to be represented for the converter to recognize it. Don't delete it! Unlike the > before LBL, the |- is not just decoration; it signifies that the following text is to be appended to the ALPHA register, rather than replacing its contents.

Regarding the line numbers restarting at 01: I don't know how the converter handles that, either. The module contains separate programs, and I think they need to be kept separate, because of local labels. Whether that means each program has to be converted separately, I can't tell you, since I'm not familiar with the process of converting HP-41 programs to run on the 71B. Someone who knows the 71B will have to answer that, and also the question about the |- character.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-03-2019, 07:37 PM
Post: #14
RE: (71b) HP41 module programs in HP71b
(06-03-2019 07:23 PM)Thomas Okken Wrote:  The > before LBL can be removed, if the converter doesn't like it. It serves no function other than to highlight labels, similar to what happens in program listings made with the HP-82143A and other printers.

The |- represents the "append" character. I don't know how that's supposed to be represented for the converter to recognize it. Don't delete it! Unlike the > before LBL, the |- is not just decoration; it signifies that the following text is to be appended to the ALPHA register, rather than replacing its contents.

Regarding the line numbers restarting at 01: I don't know how the converter handles that, either. The module contains separate programs, and I think they need to be kept separate, because of local labels. Whether that means each program has to be converted separately, I can't tell you, since I'm not familiar with the process of converting HP-41 programs to run on the 71B. Someone who knows the 71B will have to answer that, and also the question about the |- character.

Thanks for your help Thomas,

so I'll keep this two and if it ends up with a failure a remove them. So it is something with try and error. I think like you that the programs have to be kept separately (but lets see) - and so will I do and report it here on the forum.

best regards
Erwin
Find all posts by this user
Quote this message in a reply
06-04-2019, 01:25 AM
Post: #15
RE: (71b) HP41 module programs in HP71b
Here are some notes from the manual on 41 program syntax for the Trans41 ROM. The symbol that resembles ( |- ) is the 41's Alpha Append ([Shift] [K] in Alpha mode), simply called (Alpha Append) in these notes, since it's awkward to insert that symbol here too:

• HP-41 text strings in text lines or following GTO and XEQ should be enclosed in double quotes ("), as they are in HP-41 printer listings. One or more spaces between GTO or XEQ and the quoted string are optional.
Examples:
"ABCDE"
GTO"FRED"
XEQ "GEORGE"

• The (Sigma), (not equals) and (Alpha Append) characters, which are used frequently in HP-41 programs, are not available on the HP-71 keyboard. You can include these characters in your programs either by assigning HP-71 keys to these characters [ (Sigma) is CHR$(28), (not equals) is CHR$(29), and (Alpha Append) is CHR$(127) ], or by substituting standard keyboard characters:

• In conditional functions, substitute # for (not equals).

• In any HP-41 functions containing (Sigma), substitute the letter S for (Sigma). For example, (Sigma Plus) becomes S+.

• In an HP-41 text line, you can substitute the character > for the (Alpha Append) symbol immediately following the first quotes. For example, "(Alpha Append) add this" becomes ">add this".

• HP-41 emulator programs must contain at least one global alpha label so that you can access the program in the HP-41 environment. If you do not include an alpha label, TRANS41 automatically adds a label to the beginning of the translated program. The label uses the name of the intermediate file for its alpha characters.

• Parameters for two-part functions must fall in the ranges:
Registers: 0 through 9999
Numeric local labels: 0 through 9999
Local alpha labels: A through J; a through e
Display formats: 0 through 11
Tones: 0 through 9
Flags (set/clear): 0 through 29
Flags (test): 0 through 55


There are some other obscure subtleties, but the above should help with most program statements.

Regarding separating the source files, each 41 'complete program' (typically starting with a Global Label and ending with an END) should be supplied as a separate text file (either typed in to a Text file on the 71B, or imported via PIL-Box, etc. for TRANS41 to 'compile'. I find the simplest method is to create the source files on the PC and then use ILPer's DOSLINK virtual device is the easiest way, but there are several other options available.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
06-04-2019, 04:35 AM
Post: #16
RE: (71b) HP41 module programs in HP71b
(06-04-2019 01:25 AM)rprosperi Wrote:  Here are some notes from the manual on 41 program syntax for the Trans41 ROM. The symbol that resembles ( |- ) is the 41's Alpha Append ([Shift] [K] in Alpha mode), simply called (Alpha Append) in these notes, since it's awkward to insert that symbol here too:

Good morning,

thank you very much Bob,

so I have to dig deeper in the HP-41 Translator Pac. I still work with my PIL-Box and pyILper program, edit this programs on my MAC. When I look at the intermediate file I can see the words not translated during the translation process like the snippet from the intermediate file below.
Code:
961059 FTOI DUP EXECUTE 1784 XSIZE 1680 XSIZE CREATE @NAVIG1C EXECUTE ]
LBL"@NAVIG1C" LBL"NAVIG1C" LBL "NA"
XEQ "D+T"
LBL "*NA"
"SD OR HP=?"
 XBR 10
PROMPT
60
.
/
.
STO 32
CF 07
CF 08
ABS
X= 0?
 XBR 15
GTO 00

against the original text file
Code:
LBL "NA"
XEQ "D+T"
LBL "*NA"
"SD OR HP=?"
PROMPT
60
/
STO 32
CF 07
CF 08
ABS
X= 0?
GTO 00

So I go the next step to change the syntax for the HP71b

best regards Erwin
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)