Jump to content
IGNORED

Geneve FORTH


GDMike

Recommended Posts

3 minutes ago, TheBF said:

Yes these are used to search the dictionary.  (FIND) is probably written in Assembler.  -FIND is the programmers "API".

It's important to remember that Forth is a pyramid of sub-routines.

 

Here is a my definition for tick.

 


: '        ( -- xt) BL WORD FIND 0= ?ERR ;

Notice is uses FIND  (ANS version of -FIND) 

BUT... FIND in turn uses (FIND)  which is the real code that sifts through the dictionary looking for a specific word.

 

Very cool. Ok..it was an early day for me today, so with that.. have a FORTH night.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, GDMike said:

So... dictionaries are searched versus vocabularies...

The dictionary is the entire thing.  It 'can' also contain vocabularies.

 

Notice that for -FIND  the two input arguments are ( addr addr --  

The first one is the address of string you are trying to find.

The second address is where you want to start searching in the memory. This is normally the address of the last word of a vocabulary.  Tada! 

That's how it works.

 

The address of the vocabulary that is going to search is held a variable call CONTEXT.

So here is how Camel Forth defines FIND:

 


: FIND  ( caddr --  caddr  0  if not found)   CONTEXT @ (FIND) ;
\                    CFA    1  if immediate,
\                    CFA   -1  if "normal"
              

Forth+ will be a little different but the ideas are the same.

You can see how everything call everything else until it gets to some real code to do the work.

 

  • Like 1
Link to comment
Share on other sites

Ok. I've finally able to call words from one library from another. Geees..it took me some time.

But, if you place these lines at boot-up which is screen 3 of SCREENS, then switch disks, as in my case, you won't need to reload libraries from another disk over and over to get words to execute that belong in another lib.

See, I was loading the editor because I needed it to make changes to my DSK2.PLUS block files, but the editor has to load from a file. But I don't have anything on DSK2 except for PLUS blocks.

And if I wanted a sound, for example, I needed to load the graphics library which provides words for graphics and sounds, speech.. it also needed to be on DSK2.

Now I can run this early then switch to my PLUS work disk and call any word from 4 libraries without having to switch back to the library's disk.

Btw I'm only showing 3 libs in this example because I had them memorized, and so I left out the forth one. But now that this seems to function, I'll add it in. Ok. No, I didn't call it a night like I said I was...

Hmmm funny how that happens..

IMG_20210507_001334069.jpg

Edited by GDMike
Link to comment
Share on other sites

8 hours ago, GDMike said:

So...VSBW and I suppose VSBR work..

Well I thought I was going to ask you how this is supposed to work why isn't the address and the VDP not being where I thought it would be...

Because I tried it earlier and I wasn't getting this result it was hitting the top of the screen and jumping off but I was putting higher numbers as the address so the asterix should not have been jumping off the top of the screen it should have been somewhere in the middle and it may be a flaky command

Just a FYI, there is a Video XOP command that will give you the addresses of all the tables.  I think there are something like 8 pages of text mode 80 screens.  They likely all start from page 0, but depending upon what you have done, that could have changed.  Also keep in mind I suspect Forth is using the TTYOUT Vid XOP opcode (>0027) for much of the screen display.  That opcode has the ability with a control sequence to specify a row/line if you want to print a character or string to a specific location.

  • Like 2
Link to comment
Share on other sites

8 hours ago, GDMike said:

Ok. I've finally able to call words from one library from another. Geees..it took me some time.

But, if you place these lines at boot-up which is screen 3 of SCREENS, then switch disks, as in my case, you won't need to reload libraries from another disk over and over to get words to execute that belong in another lib.

See, I was loading the editor because I needed it to make changes to my DSK2.PLUS block files, but the editor has to load from a file. But I don't have anything on DSK2 except for PLUS blocks.

And if I wanted a sound, for example, I needed to load the graphics library which provides words for graphics and sounds, speech.. it also needed to be on DSK2.

Now I can run this early then switch to my PLUS work disk and call any word from 4 libraries without having to switch back to the library's disk.

Btw I'm only showing 3 libs in this example because I had them memorized, and so I left out the forth one. But now that this seems to function, I'll add it in. Ok. No, I didn't call it a night like I said I was...

Hmmm funny how that happens..

IMG_20210507_001334069.jpg

From what I can see here it looks like the libraries are in their own vocabularies so you don't need to define a new command like GOE. Just use ED/ASM. (Maybe this was your testing word)

So I think you just use the library name before your code to bring those words into the dictionary search. (??)

  • Like 2
Link to comment
Share on other sites

2 hours ago, 9640News said:

Just a FYI, there is a Video XOP command that will give you the addresses of all the tables.  I think there are something like 8 pages of text mode 80 screens.  They likely all start from page 0, but depending upon what you have done, that could have changed.  Also keep in mind I suspect Forth is using the TTYOUT Vid XOP opcode (>0027) for much of the screen display.  That opcode has the ability with a control sequence to specify a row/line if you want to print a character or string to a specific location.

Just for reference to Forth, unless you are programming in Forth assembler these XOPs and all system calls, would typically be given a Forth name by the implementer, so you just call them by name in the interpreter or compiler.

So the command AT-XY , or whatever it's called in FORTH+ , would just call the XOP you are referring to.

  • Like 2
Link to comment
Share on other sites

Yes Brian, that's correct regarding calling the library name. My most frustrating part of this was figuring to call and load each library consecutively AND then calling the library name.

I mean, looking back it makes sense, but I was under the impression that after loading a Lib that it was dumped when loading another. So I never called an old Lib, instead, I call the Declaration, then path and filename followed by Lib name. And it always did a fresh READ from disk.

Well .. that's my story on Libs. Live and Load.. ?

Edited by GDMike
  • Like 3
Link to comment
Share on other sites

3 hours ago, 9640News said:

They likely all start from page 0, but depending upon what you have done, that could have changed. 

Ahh, yes correct. Well, in my TEXT80 word that is true.

Yes, VSBR, VSBW all work fine.

In my previous test I had the address reversed from the character number when calling my VSBW and that was a mistake.

(oh, btw, I've added a NEW word for ease, it's now V! For VSBW and V@ For VSBR and GXY is my new GOTOXY.

 

Edited by GDMike
Link to comment
Share on other sites

15 hours ago, GDMike said:

: EXIST -FIND ROT ROT DROP DROP
   DUP 0 = IF ." Not anywhere" ELSE
    1 = IF ." It exists!!" THEN THEN ;

 

First, IF tests for zero (FALSE) or non-zero (TRUE). Second, in your definition of EXIST , you do not need to use IF twice on the same flag unless you are looking for two or more specific values (not the case here). You should test the flag for TRUE (non-zero) and use ELSE for the alternative (FALSE), without further testing. Third, that first line will pollute your stack if the word is not found. The stack effects for -FIND are

-FIND  ( -- FALSE|pfa len TRUE )  ( IS:<word> )  \ <--- "|" is "or" and "IS:" is "Input Stream:"

which means that you get only one cell on the stack if the word is not found. If you DROP two cells at that point, you will underflow the stack twice!

 

Furthermore, the flags are left on top of the stack and ought to be used first—that is, after all, why they are on top. The following version of EXIST tests the flag and only drops two cells if they are actually there (current stack contents shown as "S:")—

: EXIST  ( -- )  ( IS:<word> )
   -FIND                \ S:FALSE|pfa len TRUE
   \ if flag is TRUE......S:pfa len TRUE
   IF                   \ S:pfa len
      \ drop 2 cells we don't need
      DROP DROP         \ S:
      ." It exists!!"
   \ if flag is FALSE.....S:FALSE
   ELSE                 \ S:
      \ nothing to drop
      ." Not anywhere"
   THEN ;

...lee

  • Like 1
Link to comment
Share on other sites

3 hours ago, TheBF said:

Just for reference to Forth, unless you are programming in Forth assembler these XOPs and all system calls, would typically be given a Forth name by the implementer, so you just call them by name in the interpreter or compiler.

So the command AT-XY , or whatever it's called in FORTH+ , would just call the XOP you are referring to.

I don't know how Forth calls the routine itself, but yes, you should be able to.  This all assumes you are running Forth from MDOS mode, not from an 80 column GPL version.  As the topic is Geneve Forth, I am assuming this is from MDOS mode.

  • Like 1
Link to comment
Share on other sites

34 minutes ago, 9640News said:

I don't know how Forth calls the routine itself, but yes, you should be able to.  This all assumes you are running Forth from MDOS mode, not from an 80 column GPL version.  As the topic is Geneve Forth, I am assuming this is from MDOS mode.

Hi Beery, I just finished reading all the Geneve FORTH posts of May 6, 2021.  Some of it is disturbing, to say the least.  First off, yes it's all in Geneve mode, and the XOP's are only used in the graphic modes, as TEXT and TEXT80 are both fig Forth implementations.  Of course, a lot of the difficulty is due to the diskettes provided are DSDD 5.25" and DSDD 80 track 3.5", so not accessible by Mike's TI FDC; provided they are still good after 30 years!

Not to mention that I'm packing up EVERYTHING to ship where ever or to move else where locally, so very busy.  I appreciate all those who are trying to help Mike with these difficulties, and I do want to remind everyone involved, that Forth+ was designed and intended for those with hard drives or very large capacity floppy diskettes.  In fact, the only reason that two 5.25" diskettes were part of the "package" was due to my one and only beta tester, John Carver, only having DSDD diskette capacity for his 9640 Geneve, as the HELP file must be accommodated on one DSDD 80 track/DSHD diskette or hard disk file.  I will try to reply to some of the more serious concerns in other posts, as I have time.

 

RetroBill (fdos)

  • Like 3
Link to comment
Share on other sites

3 hours ago, Lee Stewart said:

You should test the flag for TRUE (non-zero) and use ELSE for the alternative (FALSE), without further testing.

I tried doing that and only received a true once.  my compare value looking for zero never hit even though I had a zero on the stack. So I went this route..I'll try again and show what I'm talking about later on after other thanks around the house are done.

 

Edited by GDMike
Link to comment
Share on other sites

1 hour ago, GDMike said:

I tried doing that and only received a true once.  my compare value looking for zero never hit even though I had a zero on the stack. So I went this route..I'll try again

 

Please, re-read my post. You only need to test it once.

 

...lee

  • Like 1
Link to comment
Share on other sites

4 hours ago, GDMike said:

Yes Brian, that's correct regarding calling the library name. My most frustrating part of this was figuring to call and load each library consecutively AND then calling the library name.

I mean, looking back it makes sense, but I was under the impression that after loading a Lib that it was dumped when loading another. So I never called an old Lib, instead, I call the Declaration, then path and filename followed by Lib name. And it always did a fresh READ from disk.

Well .. that's my story on Libs. Live and Load.. ?

0 DECLARE MMSLIB4L (I suppose I should have named it MMSLIB) MMSLIB4L (actual library does not require any stack parameters as they are embedded, but versatile libraries you create might, as future plan was for the System Configuration Tool to do so allowing each USER to configure all FORTH+ provided (not USER) libraries with actual hardware capabilities).  Currently, once a library is DECLARED, it can be ACTIVATED by it's name only!

  • Thanks 1
Link to comment
Share on other sites

4 hours ago, GDMike said:

Ahh, yes correct. Well, in my TEXT80 word that is true.

Yes, VSBR, VSBW all work fine.

In my previous test I had the address reversed from the character number when calling my VSBW and that was a mistake.

(oh, btw, I've added a NEW word for ease, it's now V! For VSBW and V@ For VSBR and GXY is my new GOTOXY.

 

It's true for both TEXT and TEXT80 as both are fig forth implementations, not XOP.

Link to comment
Share on other sites

16 hours ago, GDMike said:

I just want the record to show, I really love FORTH... sometimes it hates me though.

?

Don't mistreat forth and it'll love you back.  PROOF: I just mailed the X4th99 document with reference to Forth+ upgrades to you, and now I found THE document with the Forth+ upgrades, and only a few pages are marked for additional changes.  I just don't know if you would really want them, as it seems you would rather make your own fixes and upgrades.  BEST of LUCK, and may the FORTH be with you.

 

RetroBill (fdos)

  • Thanks 1
Link to comment
Share on other sites

5 minutes ago, HOME AUTOMATION said:

images.jpg.6d41fefbc8a54b0abd8c2978362ccb5b.jpg

No. But I did get the car on the road.

I also got my geneve working.

I also received a tipi. But haven't had time to install.

I got FORTH+ working with no more lockups.

I cleaned up where those Hogs tore up a section of my yard before I could mow today.

And. .I'll be a little quiet on here for the next couple days because of life issues going on, but I think Monday will be FORTH+ day again and I can show Lee what my situation was with my new word. Can't remember what that was, but it's in a previous post..

Have a great weekend everyone!!

I'm so thrilled my geneve works and FORTH+ works, absolutely thrilled!

  • Like 3
  • Confused 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...