The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Forth on a 41-CX
Message #1 Posted by Giusepe Marullo on 10 Mar 2004, 8:03 a.m.

Hi, I "found" the ROM images of Forth, but nothing else on the subject.

I have a beginner's experience with Forth, just curious to gather some information on its implementation on the HP-41.

Is there a manual available somewhere?

TIA,

Giuseppe Marullo

      
Re: Forth on a 41-CX
Message #2 Posted by bill duncan on 10 Mar 2004, 11:33 a.m.,
in response to message #1 by Giusepe Marullo

As far as I know, forth was only available for the hp-71 as an option. All the RPM machines (including the hp-41cx) as well as the newer RPL machines (starting with hp-28, hp-48 etc.) use a forth-like postfix and stack architecture. You could even say that their languages were somewhat "threaded" like forth.

Hope this helps. Cheers.

            
Re: Forth on a 41-CX
Message #3 Posted by GE (France) on 11 Mar 2004, 5:42 p.m.,
in response to message #2 by bill duncan

Forth was available on the HP75 on cards, also a version could be loaded into the PMS.

I think there was no other language available (apart from assembler of course). Anyone willing to differ ?

      
Re: Forth on a 41-CX
Message #4 Posted by Garth Wilson on 10 Mar 2004, 2:07 p.m.,
in response to message #1 by Giusepe Marullo

I have the FORTH5.TXT file (the listing) too, but again no doc.s. I'd be interested in seeing them. I can't imagine the 41 would be very well suited for Forth, with the slowness of its text editor and all.

I have the HP Forth/assembler ROM in my HP-71, which is where I got started on the language that finally made me quit "shopping" for languages (even though that particular implementation was pretty poor). Now Forth is virtually the only high-level language I use in my workbench control and product development work.

      
Re: Forth on a 41-CX
Message #5 Posted by Angel Martin on 10 Mar 2004, 3:09 p.m.,
in response to message #1 by Giusepe Marullo

As far as I know the FORTH ROM was developed by the Toulouse chapter od PPC.

It is actually an 8k rom, which sits on addresses 4 and 5, thus it's a take-over ROM, incompatible with the time module.

I've tried it but not very thoroughly. No speed problem whatsoever to speak of... just another wonderful aplication of the 41 platform!

Best, AM

            
Re: Forth on a 41-CX
Message #6 Posted by Diego Diaz on 10 Mar 2004, 6:11 p.m.,
in response to message #5 by Angel Martin

Hi all,

If you agree in sharing this image, I'll prepare a Clonix loadable version on pages 4 & 5 (according to Angel comments) and place the corresponding .HEX file at the Clonix site for anyone interested in it.

Best wishes.

Diego.

            
Re: Forth on a 41-CX
Message #7 Posted by Garth Wilson on 11 Mar 2004, 1:58 a.m.,
in response to message #5 by Angel Martin

> It is actually an 8k rom, which sits on addresses 4 and > 5, thus it's a take-over ROM, incompatible with the time module.

Is that to say that you could never use it on a 41cx (which is what I have)? The time module is an integral part of the cx.

                  
Re: Forth on a 41-CX
Message #8 Posted by Ángel Martin on 11 Mar 2004, 4:59 a.m.,
in response to message #7 by Garth Wilson

From what I gather the FORTH ROM(s) were developed *before* the advent of the Time Module, and by extension the CX. As it was never a commercial product (that I know of, I might be wrong here) no updates were made after those were introduced.

So your images (Clonix-based?) won't run on a CX, but they should on a C/CV, or on Emu41, V41, etc.

                        
Re: Forth on a 41-CX
Message #9 Posted by Diego Diaz on 11 Mar 2004, 11:53 a.m.,
in response to message #8 by Ángel Martin

Hi,

You're rigth Angel (as usual... ;-) Only CV's or C's with one or more memory modules can run FORTH 41.

I've burnt the images you sent me into a Clonix module and they now run OK. (Well, at least they show "OK_" in the display, I can't say much more without a manual... BTW, Does anyone have a "shareable" copy?? :-)

You need to have at least 80 free program register (i.e. size=239 on a clean CV) for you to get FORTH working, (XEQ FORTH) otherwise you'll find "TRY AGAIN" in the display. Once FORTH is running it remains in memory even after OFF/ON cycling.

The correspondig FORTH41.HEX file (to burn directly into Clonix flash ROM via IC-PROG) will be placed on-line during the weekend.

Best regards.

Diego

Edited: 11 Mar 2004, 3:29 p.m.

                              
Re: Forth on a 41-CX
Message #10 Posted by Giuseppe Marullo on 11 Mar 2004, 6:32 p.m.,
in response to message #9 by Diego Diaz

Ouch, so I got the best model (CX) and because of this I could not run FORTH? Very nice. I will play with EMU41, sigh...

I know it may sound naif but...isn't possible to "relocate" a rom?

                                    
Re: Forth on a 41-CX
Message #11 Posted by Raymond Del Tondo on 11 Mar 2004, 7:47 p.m.,
in response to message #10 by Giuseppe Marullo

Theoretically it would be possible to leave the TakeOver part of FTH41 at address 4xxx, and move the second part to a page between 8xxx and Fxxx . But in reality it depends on how the programmers realized inter-page jumps, in other words: jumps from part 1 to part 2 and vice versa. If they made it like the CCD module then part 2 always has to be at the next page following part 1.

There are different methods for ML code to locate and remember another specific block of code (it's address) inside the HP-41 address range, but I doubt any of these mechanics were used in the FTH41.

Raymond

                                          
Re: Forth on a 41-CX
Message #12 Posted by Ángel Martin on 12 Mar 2004, 3:35 a.m.,
in response to message #11 by Raymond Del Tondo

Raymond is absolutely right, I'd bet that the "second" page will have to be next to the first, i.e. must be #5. Still worth trying though, thanks to the wonderfull versatility that Clonix' allows!

I also remember reading something about page 5 in old HP pubs that referred to it as "part of the extension of the OS" that was later abandoned. Allegedly it was reserved to some kind of special usage... for instance, never wondered why on a CX (without CCD module) the Extended Functions sections come the *last* in CAT 2, despite being located into the *lowest* addresses??

Or was that about page #3?

                                                
Re: Forth on a 41-CX
Message #13 Posted by DavidY on 12 Mar 2004, 4:43 p.m.,
in response to message #12 by Ángel Martin

I've de-compiled the Forth ROM images and sorry to say the machine code calls into page 5 and back are not "page independent."

Since page independent call actually involve jumps into fixed OS ROM locations, involve stack and CPU register consideration one would probably need to re-write the entire 8K of code. I guess the CX users will just need to use an emulator.

BTW, the version of FORTH isn't bad. Using the v41 emulator (and ev41 on a Dell Axim PDA) I actually was able to write a little Forth code. Unfortunately, its been 15+ years since I coded in Forth (for Astronomical hardware)so it didn't see worth much effort other than an curiosity. Actually, 41 machine code is much more fun once you get a bit up the learning curve.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall