Page 1 of 1

Two questions from a Forth newbie

Posted: Thu Jan 26, 2006 3:03 am
by dlenmn
I decided that it would be fun to make a 6502 based computer which runs Forth. I started learning about the 6502, and now I'm moving on to learning about Forth. At the moment, I'm reading through the 1981 edition of "Starting Forth" (I'm currently finished chapter 3). I just installed gForth and pForth on my main computer (a mac running OS X) so that I can follow along with the book. With that background out of the way, I've got two questions that hopefully some Forth guru can answer:

-I've seen the FIG Forth source on this website and I think I know how to modify it for my project. Before I do that, I'd like to consider my options. Are there other Forths available for the 6502?

-How does FIG Forth compare with the Forths on my computer, other 6502 Forths, and Forth as described in "Starting Forth"? (I've heard that Forth has gone through a number of revisions.)

Two questions from a Forth newbie

Posted: Thu Jan 26, 2006 6:14 am
by GARTHWILSON
Starting Forth is very dated, but still a great book. It does, as I remember, address FIG Forth, Forth 79, and Forth 83. Of course most of it is the same for the three. [Edit: Forth, Inc. has "Starting Forth" online for free reading at http://www.forth.com/starting-forth/index.html, somewhat modernized but with the original cartoons.]

There are indeed many Forths. The old joke says that if you've seen one Forth, well, you've seen one Forth. That's not to say there are loads of scarcely related dialects. Once you're in the door, it should take very little effort to move to a new one you haven't worked with yet. For the most part though, you'll probably settle down with one that runs on your hardware, mold it to your liking, keep extending it a lot, and use it a lot.

I wish I could tell you my '02 Forth is ready for distribution. It's a Forth '83 implementation that came with a DOS-based metacompiler we bought 15 years ago. Although the Forth source mostly came from the public-domain FIG-Forth and I augmented and modified it extensively, there are still a few parts that could get me in trouble with copyrights if I distributed it without re-writing those parts. That metacompiler is no longer available, and it had some very serious bugs too. I use Forth regularly on my workbench computer, but any new re-compiles of the kernel itself in EPROM are going to have to come from converting the source code to an assembly source so I can break free of this PC metacompiler whose limits I have exceeded. If I could put the time into it, I would like to get a complete 6502 Forth going that would be a turnkey solution, so the beginner would not be faced with the backwards situation of having to learn the innards before he can make anything at all work.

Since the book does cover FIG-Forth and the source code is on this website, that might be a good place to start. It may not be ideal, but you can go a long, long way with it. Don't be afraid to keep coming back and asking questions.

Oh, and one other thing: Replace the FIG-Forth U* code which has a bug in it with the code at http://www.6502.org/forum/viewtopic.php?t=689 , and replace the FIG-Forth U/ which also has a bug in it with the code at http://www.6502.org/source/integers/umm ... modfix.htm . I think there was a bug in FIG-Forth's D< also. See viewtopic.php?f=9&t=2631&p=27818#p27818.

Re: Two questions from a Forth newbie

Posted: Thu Jan 26, 2006 7:30 am
by kc5tja
dlenmn wrote:
How does FIG Forth compare with the Forths on my computer, other 6502 Forths, and Forth as described in "Starting Forth"? (I've heard that Forth has gone through a number of revisions.)
FIG-Forth. Wow. The Starting Forth book I have is for the Forth-79 standard. :D

gForth is an implementation of ANSI Forth, and so the sources might not correlate precisely. You can find an ANSI-ified version of Starting Forth on the web here:

http://home.iae.nl/users/mhx/sf.html

Posted: Thu Jan 26, 2006 12:56 pm
by cas
Hi,

I'm currently working on reviving the volksFORTH Project. volksFORTH was a F83 Standard Forth for 68000 CPU (Atari ST), 6502 (Commodore C64, C16, Plus4), CP/M (Z80 / 8080) and MS-DOS (8086), published by the german FIG chapter in 1984-1989 (Forth Gesellschaft e. V.).

Even on the 6502, it includes many advanced Forth features such like easy multitasking, heap memory management, headerless words.

All versions are created by a forth metacompiler, the full kernel sourceode is written in Forth.

I have the full 6502 sourcecode, and I already ported it easily to the Atari 8bit, the Apple I, the Apple II and Commodore PET. Unfortunatly native metacompilation is not working at the moment, I do a crosscompile from Atari ST (running HATARI Atari ST Emulator on MacOS X) to the 6502 binary.

The sourcecode will be published under a BSD style license (the Atari ST and MS-DOS Source is already on the project webside).

I can send you the source code and the build instructions.

The projectpage is at http://volksforth.sf.net . Unfortunatly all Handbooks for this Forth are still in german language. I'm currently scanning and OCRing the Handbooks, change them into LaTeX and translate them to english. This will take a while (month, even years).

Send me an E-Mail if you need code, or help, or both.

I also have a lot of information on 6502 Forth Systems (including source) at http://www.strotmann.de/twiki/bin/view/APG/LangForth

Best regards

Carsten Strotmann

Posted: Fri Jan 27, 2006 4:41 am
by dlenmn
Thanks for the replies, it's given me some new ideas. I'll probably have more questions as I get further along.