The Museum of HP Calculators

HP Forum Archive 10

[ Return to Index | Top of Index ]

41->71 Translator and the FTH41ROM LEX file
Message #1 Posted by andy on 26 Feb 2003, 9:59 a.m.

On this site's ftp swap disc archive, there's a file called LEXF1.LIF which contains over 600 LEX files for the 71b.

One of them, FTH41ROM, is identical in size to the FTH41ROM file found on the 41->71 translator rom.

I have downloaded the FTH41ROM file to my 71b (to both main ram and independent ram), but when I type "hp41" or "forth" I usually get a memory loss. I've even tried keeping the FTH41RAM file in place thinking that might be needed.

Do any of the 71b wise-ones know if its possible to run the translator or forth from this lex file, and if so, how?

Thanks,

Andy

      
Re: 41->71 Translator and the FTH41ROM LEX file
Message #2 Posted by Ex-PPC member on 26 Feb 2003, 10:42 a.m.,
in response to message #1 by andy

Both the Forth/Assembler ROM (which creates a FORTHRAM file) and the 41CTranslator/Forth ROM (which creates a FTH41RAM file) are hard-configured to a fixed address, and expected to reside precisely there.

They can't be soft-configured in RAM at all, so loading these ROM images in RAM will never work, regrettably, unless some extremely clever assembly programming tricks are used.

            
Re: 41->71 Translator and the FTH41ROM LEX file
Message #3 Posted by Gene on 26 Feb 2003, 12:56 p.m.,
in response to message #2 by Ex-PPC member

Do I detect that you may KNOW how to run the Forth / 41 translator in RAM on the HP-71B?

You say that it would take "assembly" techniques. Do you have any ideas or have you been able to do this?

:-)

Gene

                  
Re: 41->71 Translator and the FTH41ROM LEX file
Message #4 Posted by Raymond Del Tondo (Germany) on 26 Feb 2003, 5:54 p.m.,
in response to message #3 by Gene

Since the sources were available, I think you could modify the F/A ROM config code to match your needs (e.g. another address range).

As far as I remember, the F/A ROM consisted of at least *two* functional libraries, one of them a floating ROMPart, and the other banned t a fixed address, I think in the #E**** range.

I don't know if they used address block dependent code there, in which case it would be more work to get it running at other addresses.

However, with enough energy and the suitable knowledge it should be possible to run the FORTH system from other than the default locations;-)

Raymond

BTW: I may have used ROMPart, library, and LEX file interchangeably, since they're nearly the same, at least from the functional side.

                  
Re: 41->71 Translator and the FTH41ROM LEX file
Message #5 Posted by Ex-PPC member on 27 Feb 2003, 4:59 a.m.,
in response to message #3 by Gene

Gene wrote:

"You say that it would take "assembly" techniques. Do you have any ideas or have you been able to do this?"

Nothing is impossible using the right techniques and given sufficient time and effort, but regrettably I think making the Forth ROM run in RAM in exceedingly difficult.

The problem is this: the Forth ROM consists actually of two parts, a soft-configured ROM, that holds the Text Editor, the supporting LEX keywords for the editor and other ancillary LEX files, and a hard-configured ROM that holds the FORTH system and the Assembler.

For efficiency sake, FORTH needs to have its basic dictionary words at fixed addresses, while simultaneously trying to coexist with the native 71B operating system, that uses to configure everything at variable addresses. The FORTH development team solved the problem by convincing the BASIC developers to include some extra coding to help them achive their goals, namely that whenever the system starts, if it detects a hard-configured ROM at E0000, it reserves 64 Kbytes (from E0000 to EFFFF) for its use, avoiding configuring anything else in that address range.

FORTH is thus written and configured to always run from E0000 onwards. Further, it must ensure that the user words also start at fixed addresses, and it does this by forcing the FORTHRAM file to be the first one in the file chain, and intercepting the configuration poll to compute the size of the variable-length system buffers which precede it, in order to pad them with enough bytes to always make FORTHRAM start at a fixed address as well.

What are we to do then, in order to run FORTH from RAM ? Well, for once we would need to place it exactly at E0000. This is next to impossible to do, as you would need to have so much RAM allocated, and you would need to 'soft-configure' that address space yourself, because the operating system will be done with the configuration by the time your LEX file can take control, and may have allocated those addresses for RAM, ROM, or other purposes.

The other remaining possibility would be to write a 'relocator' LEX file or program that would change all addresses in the FORTH system to their new values, based on where in the address space resides the FORTH ROM file. But this is unworkable, because you would need a listing of the many hundreds or thousands of fixed addresses that need retouching, plus many of them might be calculated on the fly, so you would need to change the code to recompute them as well. This would be extremely hard work, would require a very detailed, commented listing of the whole FORTH system, and a single mistake or omission would mean disaster.

Also, even if you would do it, the FORTH ROM file would not be the first file in RAM (that will always be the FORTHRAM file), so as the FORTHRAM file grows or shrinks, the FORTH ROM file is bound to move in memory, and the 'relocator' LEX file would need to answer the appropriate POLL to relocate everything again 'on the fly'. Needless to say, this would slow the system to the point of absolute unusability, thus negating the main advantage of FORTH over BASIC, i.e.: speed. The only way to solve this would be for the FORTH system to reside in some suitable IRAM, so that its address would be more easily computable.

There may be other ways, but the mere fact that any LEX file or procedure you could write will only get control after the main system configuration has run and allocated everything makes the task next to insurmountable.

                        
Re: Soft-addressed based FORTH
Message #6 Posted by J-F Garnier (France) on 27 Feb 2003, 6:55 a.m.,
in response to message #5 by Ex-PPC member

Hi all,

There was a soft-addressed based Forth version made by HP. This was intenting for professional developers in order to develop Forth applications without the Forth (expensive) module. It was possible to put it (with the application) in standard 32k/64k ROM or EPROM modules.

Does someone ever use it for applications? I don't know.

Best regards.

J-F

                              
Re: Soft-addressed based FORTH
Message #7 Posted by andy on 27 Feb 2003, 9:43 a.m.,
in response to message #6 by J-F Garnier (France)

If utilizing FTH41ROM and FORTHROM LEX files are next to impossible, why did someone bother to extract them from the ROMS and preserve them?

Does the potential for making these two lex files work increase if one were to consider burning them to a CMT eprom?

Which brings up another question which probably deserves its own thread: Does anyone out there own a CMT 71b eprom burner? If so, would they be willing to burn images to eproms if I send them eproms?

Andy

                                    
Re: Soft-addressed based FORTH
Message #8 Posted by HrastProgrammer on 28 Feb 2003, 2:29 a.m.,
in response to message #7 by andy

FORTHROM is part of the 16K soft configured Forth ROM. This is just a LEX file which calls addresses from hard configured Forth ROM (E0000..EFFFF) and that's why it crashes. It doesn't contain 32K hard configured ROM ...

Burning just a FORTHROM into an EPROM will do nothing except a crash.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall