loading FORTH via HP-IL to 71B
|
09-26-2022, 03:23 PM
Post: #1
|
|||
|
|||
loading FORTH via HP-IL to 71B
I have some Forth code in a text file and am trying to work out how to load it into the 71B Forth module.
Do I add the Forth code as a text file to a LIF and then load that into the 71B and then load into Forth and if so, how exactly? I know I need to use loadf from Forth and I can see mention of a FORTH LIF file type but I can't see any utilities to create this (lifutils) and am unsure if this is a binary file or just the Forth code in ASCII. Is it also possible to save Forth code from the 71B externally? Any advice or tips appreciated. Thanks, dmh Calculator Clique on YouTube |
|||
09-26-2022, 07:11 PM
Post: #2
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B
Sounds like you need to read the manual.
https://literature.hpcalc.org/community/...-om-en.pdf pyILPER can be helpful for getting text files to a LIF disc image. * Install lifutils * Select a Drive tab * Uncheck the Device enabled box You can now use pyILPER as a frontend for lifutils. Right-click on a file to perform file functions like Purge or View. Click on Import to copy a text file w/ conversion to a LIF disc image. Dave |
|||
09-26-2022, 10:18 PM
Post: #3
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B
Thanks but I have been wading through all the manuals and the dots haven’t connected for me yet :-)
I have a text file including my Forth code in a LIF attached as mass storage and can copy to the device but am still unclear as to whether it needs to be a Forth file type and how exactly to get it into Forth. Thanks (09-26-2022 07:11 PM)Dave Frederickson Wrote: Sounds like you need to read the manual. Calculator Clique on YouTube |
|||
09-26-2022, 11:24 PM
(This post was last modified: 09-27-2022 12:10 AM by Sylvain Cote.)
Post: #4
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B
I am using the following: 71B, FORTH/Assembler module, IL module, IL cables, PILbox, pyILPER and LIF utilities.
From the command line:
|
|||
09-27-2022, 03:45 AM
Post: #5
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B
A less precise, but maybe more easily conceptually grasped reply than Sylvain's usual masterpiece is this:
71B Forth does not use the 'read a screen' metaphor common in most Forth implementations. Instead one 'reads' a 71B text file, containing your Forth word definitions using the LOADF command. As the words are processed, they are added into the current vocabulary, and thereafter can be used immediately. So with all your content in the text file MYWORDS in main RAM of the 71B, just use: " MYWORDS" LOADF and it will read and process the content into your FORTH system (maintained in the FORTHRAM:MAIN file in RAM). Also note that if you read this file in again, it will add the new words above the old words (i.e. it will not replace them, they are simply added at the end) and use up valuable RAM. Use the Forth command: " BLAH" FORGET to remove all the words in your dictionary from the word BLAH to the end. hth --Bob Prosperi |
|||
09-27-2022, 10:37 AM
(This post was last modified: 09-27-2022 11:32 AM by Stefan_Titan2944A.)
Post: #6
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B
So,
the FORTH code TEXT file is in a LIF volume on a mass storage. It should already be an HP ASCII text, in LlF Type 1 format. (Is it possible to write a non-HP ASCII TEXT file to a LIF volume, without adding EXTFILES first?. Hm ...) 1. RESTORE IO in BASIC 2. " [text_file_name]:MASSMEM" LOADF in FORTH N.B. The file is not "loaded into the 71B Forth module", but COMPILED into the CURRENT VOCABULARY of the FORTHRAM file. CORRECTION: The TEXT file is streamed as an input (like keyboard inputs) and parsed - WORD definitions ( : ; ) are COMPILED, all other stuff is executed as IMMEDIATE. Given the way FORTH works (in general), even ( : ; ) is executed IMMEDIATE, with a COMPILED result. :-) |
|||
09-27-2022, 11:05 AM
Post: #7
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B
Thanks Sylvain, Bob and Stefan - exactly what I was looking for - I wasn't far off and all working now :-)
I understand about the compiling into a vocabulary so excuse my generic terms ;-) Regards, dmh Calculator Clique on YouTube |
|||
09-27-2022, 11:21 AM
Post: #8
|
|||
|
|||
RE: loading FORTH via HP-IL to 71B | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)