6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Nov 05, 2024 6:14 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jan 19, 2016 7:22 pm 
Offline

Joined: Thu Jan 14, 2016 5:24 pm
Posts: 27
I've been working for a while on my own implementation of Forth. I first used Forth in the '80s on my VIC-20, using a HES cartridge that was based on figFORTH. Coming back to 8-bit micros a year or two ago I wanted to build a more modern version that was better integrated with the Commodore KERNAL.

I started with the 6502 reference implementation which worked fine but the higher level words were defined in .WOR assembler statements. I experimented with using gForth to build a cross-compiler but it was rather messy keeping track of the different dictionaries, data sizes etc.

The next approach was to write a cross-compiler in Python. This proved far more straight-forward, I created abstractions for dictionaries, stacks etc that make debugging easy.

I've now got a fairly complete Forth-83 implementation that fits into 8K. It has words for file I/O, I've omitted the traditional block words. They made sense at the time but using editor words on a 22 x 23 display isn't very productive, in my opinion.

If anyone is interested the code and build tools are here

http://eden.mose.org.uk/vforth.git

I can attach snapshots if anyone doesn't want to build it themselves. I'd love to hear about other people's ideas or any feedback on my attempt.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 19, 2016 8:06 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8538
Location: Southern California
Is there any source code? I wandered around http://eden.mose.org.uk/vforth.git and didn't find any, except I don't know how to open the files in the folders under "objects" although if they're object code then I don't expect to really get anything meaningful from them. I was particularly interested in the file operations, since I've never implemented them in my Forths for the workbench computer, as the host PC keeps the source code for them and that's where the editing is done, and every time any code is loaded, it comes from the PC as source code and the workbench computer compiles or assembles on the fly as it's receiving the source code from the PC via RS-232.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 19, 2016 8:16 pm 
Offline

Joined: Thu Jan 14, 2016 5:24 pm
Posts: 27
Sorry for not explaining, it's a git URL so you use

Code:
git clone http://eden.mose.org.uk/vforth.git


to get a local copy. I've attached a copy of my current work directory.


Attachments:
vforth.zip [52.25 KiB]
Downloaded 128 times
Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 19, 2016 8:19 pm 
Offline

Joined: Thu Jan 14, 2016 5:24 pm
Posts: 27
The file I/O words are defined in system.fs. They consist of a set of low-level words that interface with the standard Commodore KERNAL subroutines and a set of words that vaguely resemble ANS Forth.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 20, 2016 2:09 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Interesting. I cloned a copy and will take a look. I have a 6502 machine that has an IEC port and SD2IEC flash reader. It would be interesting to see if this is compatible.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 20, 2016 7:43 pm 
Offline

Joined: Thu Jan 14, 2016 5:24 pm
Posts: 27
I've run V-Forth on my FE3, it works well with SD2IEC.

The code uses normal KERNAL entrypoints where possible. There's some direct read/write of zero page, it should port to the C64 ok, not sure about others.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 10, 2016 9:57 pm 
Offline

Joined: Thu Jan 14, 2016 5:24 pm
Posts: 27
I've been making improvements to V-Forth, here's that latest version.


Attachments:
vforth.zip [74.32 KiB]
Downloaded 123 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: