FORTH Beginner Question.
|
09-06-2020, 06:49 PM
Post: #1
|
|||
|
|||
FORTH Beginner Question.
Forgive me if this has already been answered. I did attempt to search the forum but got no results.
I am just beginning to try to learn Forth on EMU71 for windows. I have a bare bones real 71B but actual ROMs are made of unobtanium! I have loaded the HP-41 Translator Pac and it seems to work fine. I am able to switch between BASIC, FORTH, and HP-41 Modes. I am trying to work through the examples in the "Starting-FORTH" Book. I can execute built-in FORTH words but if i try to define a new word I get: FTH ERR:Dictionary Full The FTH41RAM file exists. The "GROW" word seems to have no effect on the FTH41RAM File size (Should it?) I am probably overlooking something very basic. Thanks in advance for any assistance. |
|||
09-06-2020, 06:56 PM
Post: #2
|
|||
|
|||
RE: FORTH Beginner Question.
(09-06-2020 06:49 PM)twoweims Wrote: Forgive me if this has already been answered. I did attempt to search the forum but got no results. I think you should use HP-71B Forth/Assembler ROM (HP 82441A). But since I am no expert on the 71 I'll leave this to others. This thread could be of interest. Greetings, Massimo -+×÷ ↔ left is right and right is wrong |
|||
09-06-2020, 07:10 PM
Post: #3
|
|||
|
|||
RE: FORTH Beginner Question.
Are you giving GROW the quantity parameter on the stack? I don't have that module but rather the other Forth module (HP82441A), and it works fine.
The HP82441A was my entry into Forth as well, and I had the book "Starting Forth" which I bought from EduCalc. The manual for the Forth module assumed you already spoke Forth and only needed to know the particulars about how it works on this systems with a 4-bit data bus and a 20-bit address bus and word length of five nybbles, and the book assumed you had something to practice on; so they were left pointing at each other. I did eventually get going though. The Forth provided by HP was not a very good one; but since it's Forth, I was able to expand and improve it a lot. I timed and re-wrote a lot of the built-in words, achieving, in the extreme case (of CHR$), a 14x improvement in speed, without resorting to assembly language. http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, at http://wilsonminesco.com/links.html#hp41 ) |
|||
09-06-2020, 07:59 PM
Post: #4
|
|||
|
|||
RE: FORTH Beginner Question.
Yes. It helps to push the number onto the stack first. DOH!
My dictionary has GROWn. Thanks! |
|||
09-06-2020, 08:12 PM
(This post was last modified: 09-06-2020 08:13 PM by Sylvain Cote.)
Post: #5
|
|||
|
|||
RE: FORTH Beginner Question.
Try this:
Start FORTH and get dictionary free space Code: FORTH [ENTER] // display: HP-71 FORTH 2A Grow the stack Code: 1000 [ENTER] // display: OK { 1 } // enter 1000 on the stack Create a new word Code: ROOM . [ENTER] // display: 1000 OK { 0 } // show dictionary free space before MYDUP creation Leave FORTH Code: BYE [ENTER] // display: > |
|||
09-06-2020, 09:31 PM
Post: #6
|
|||
|
|||
RE: FORTH Beginner Question.
Good answers already listed above, but keep in mind you need to set the proper numeric base (DECIMAL, HEX) before entering the amount to GROW, or you may grow by more (or less!) then you expected.
Not knowing the default base (you can always get it using "BASE @ .") can lead to confusion and unexpected results when first learning FORTH, and you should probably get in the habit of always specifying the base your code needs right at the top of the word definition source files. Another common technique is to preserve/restore the already existing default, by surrounding the word definitions in your source file as in: : NEWNAME ( stack diagram ) ( comments ) BASE @ ( Save the prior default base ) HEX ( or DECIMAL as you desire for use in your code ) CODE CODE CODE BASE ! ; ( Restore the prior default ) You can change the base as often as you like to make your code easier for the reader (or you, months later) to understand what you're doing. --Bob Prosperi |
|||
09-07-2020, 02:09 AM
Post: #7
|
|||
|
|||
RE: FORTH Beginner Question.
Thanks for the tips.
I was entering something like Code: GROW 1000 rather than Code: 1000 GROW The first case does not cause an error, it just pushes 1000 on the stack after growing by zero. I have a lot to learn, but my employer is making me stand-by at home for the remainder of the year due to the virus so I am grateful to have something wholesome to stimulate my imagination... |
|||
09-07-2020, 02:46 AM
Post: #8
|
|||
|
|||
RE: FORTH Beginner Question.
Common beginner mistake.
Most function parameters are taken from the data stack and most return values are pushed back to the data stack. |
|||
09-07-2020, 02:50 AM
Post: #9
|
|||
|
|||
RE: FORTH Beginner Question.
Even for hardened RPN users, learning Forth takes a lot of time and patience, so it's a good fit for your situation. Sure, it's just another language, but I find that it really is a very different paradigm, and you really do have to think differently to learn and utilize it well, but maybe I simply haven't been exposed to enough odd languages.
--Bob Prosperi |
|||
09-08-2020, 02:26 AM
Post: #10
|
|||
|
|||
RE: FORTH Beginner Question.
Having used FORTH on a New Micros Inc. Rockwell 65F12 based single board computer to create the engine monitoring system for the Voyager aircraft, I was pleased to get a bumper sticker that said "FORTH (heart) IF HONK THEN" where "(heart)" was a big red heart. I was also surprised, years later, to discover that much of the diagnostic software used by Versatron (later Wescam Sonoma) to debug their high-end stabilized camera systems (as used on the Predator and such) was written in FORTH. Amazing where it turns up...
So many signals, so little bandwidth! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: