6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 5:03 am

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon May 23, 2022 10:03 pm 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
Hi,

Have just completed an RC6502 SBC build (standard 6502 processor, 1MHz) and am looking to implement Forth on it.
Has anyone done this before?

The SBC currently has a single 64Kb EEPROM with Wozmon/Krusader/Basic. I could possibly replace it with Forth on another
64Kb and boot directly into Forth or perhaps use a 256Kb and manually page it via the A13/A14 jumpers to boot (if possible).
I guess the correct way is to add a ROM board for Forth somewhere above $8000; that keeps Wozmon etc and can run from there.
I have ordered a motherboard and will be on the lookout for a ROM or perhaps RAM/ROM board.

More importantly I guess is the flavour of Forth and since I have never done this will be the big issue for me. It's like chosing a Linux Distro :shock:
Looking at the FIG Forth for 6502 on the source page here for starters unless someone points me elsewhere.

Reg


Top
 Profile  
Reply with quote  
PostPosted: Mon May 23, 2022 11:21 pm 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Do you mean Kb (kilobit), or KB (kilobyte)? 265Kb is 32KB, enough to fit both the BASIC and the Forth on it at the same time. Fig-Forth seems to have been where Forth started for the 6502, although it wasn't a particularly good Forth. It's available at http://6502.org/source/forth65.zip, for the Apple II I believe, and should be pretty easy to adapt for other systems. Note that it has the UM/MOD division bug, the UM* multiplication bug, and the D< double-precision signed less-than comparison bug.


I have more Forth links on my links page at http://wilsonminesco.com/links.html#Forth .

_________________
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 May 24, 2022 1:25 am 
Offline

Joined: Thu Jan 21, 2016 7:33 pm
Posts: 282
Location: Placerville, CA
Tali Forth v.2 is very simple to get up and running on a new platform - I did it for floobydust's SBC in about an hour and a half, most of which was in setting up the build environment and reading through the relevant documentation.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 8:16 am 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
GARTHWILSON wrote:
Do you mean Kb (kilobit), or KB (kilobyte)? 265Kb is 32KB, enough to fit both the BASIC and the Forth on it at the same time. Fig-Forth seems to have been where Forth started for the 6502, although it wasn't a particularly good Forth. It's available at http://6502.org/source/forth65.zip, for the Apple II I believe, and should be pretty easy to adapt for other systems.
I think I got the units correct but it is confusing (me?) - use Kb, KB or chip ID?? Board currently has a 28C64 which is full with Basic etc. Swapping for a 28C256 would give room to add Forth but my understanding is that the SBC can only address a single 8KB block at any one time. I could swap the A13/A14 jumpers and boot into Forth but would have to sort out the boot vectors etc... I think I will go the motherboard/ROM card route.
Thanks for heads-up on bugs.

commodorejohn wrote:
Tali Forth v.2 is very simple to get up and running on a new platform - I did it for floobydust's SBC in about an hour and a half, most of which was in setting up the build environment and reading through the relevant documentation.
Thanks for that; I will look into it.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 9:05 am 
Offline

Joined: Mon Sep 14, 2015 8:50 pm
Posts: 112
Location: Virginia USA
Historically speaking, there was Rockwell’s RSC FORTH:
viewtopic.php?f=3&t=5226&hilit=Rsc+forth

Cheers,
Andy


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 9:42 am 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
commodorejohn wrote:
Tali Forth v.2 is very simple to get up and running on a new platform - I did it for floobydust's SBC in about an hour and a half, most of which was in setting up the build environment and reading through the relevant documentation.
Loks like Tali Forth only runs on the 65C02 and my SBC will only accept the 6502. To my shame, I didn't look on here first as I believe there are other good SBC designs which probably support 65C02 :oops:

handyandy wrote:
Historically speaking, there was Rockwell’s RSC FORTH:
Great thread and the RSC manual is a goldmine. Sadly it runs on a Rockwell Forth specific 65*** but it looks a handy beast for a dedicated Forth system.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 12:15 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Hi Reg,

A 65C02 will work fine on the Rev H board.

This is the RAM/ROM board you want:

https://www.pcbway.com/project/shareproject/RC6502_RAM_Board_82dc9da1.html

Sorry I don't have the options configured as nicely as TEBL does, but I'm still a relative newb at PCBWay.

If you put a 28C256 in it, you can configure it with a jumper to appear in the top 32k (for ROM generally) or bottom 32k (for RAM). Within that space you can enable / disable individual 4k blocks. (On mine, I have $9000 - $9FFF disabled for I/O space.)

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 12:52 pm 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
Paganini wrote:
A 65C02 will work fine on the Rev H board.
Took the words straight out of my mouth 8) Thanks. I was just going to double check that. There are some (older?) comments on TEBL that the SBC only supports the 6502 whilst I just noticed that the latest CPU board does have 65C02 on it. Will get one in the next order.
Have a ROM and RAM board on the way :D


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 8:54 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Fig Forth is pretty easy to get running. I ported it to the Ophis assembler and got it running on Py65mon without much of an issue. Well I had some issues but the forum helped me resolve them. Here's a link to my source if it helps you:

https://github.com/Martin-H1/6502/tree/master/FigForth

I also brought up volks forth on an SBC and it was pretty easy. See:

https://fossil.forth-ev.de/volksforth/wiki?name=gen6502

I've been meaning to try Tali Forth 2 as it's more modern than some of the others. I would think that removing the 65c02 instructions shows not be that hard.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 24, 2022 11:51 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
RegH wrote:
Paganini wrote:
A 65C02 will work fine on the Rev H board.
Took the words straight out of my mouth 8) Thanks. I was just going to double check that. There are some (older?) comments on TEBL that the SBC only supports the 6502 whilst I just noticed that the latest CPU board does have 65C02 on it. Will get one in the next order.
Have a ROM and RAM board on the way :D


:D

Just FYI, in case you want to build a CPU board to plug into your backplane once you get one, the CPU board does *not* support the WDC65C02 by default, but can be easily modified to do so by putting a 3k3 resister between the Bus Enable pin and VCC. Other 65C02s don't have the BE feature, and so should work fine (my CMD one does, anyway). I discovered this the hard way. :)

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 7:12 am 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
Has anyone managed to get Tali Forth 2 running on the RC6502 Apple 1 Replica (or as mine now is, an RC65C02)??

commodorejohn wrote:
Tali Forth v.2 is very simple to get up and running on a new platform - I did it for floobydust's SBC in about an hour and a half, most of which was in setting up the build environment and reading through the relevant documentation.
I have finally got an R65C02 up and running in the RC6502 and have a ROM board (capable of taking a 28C256) so have begun to look at implementing Tali Forth 2.

However, it seems that the Tali Forth ROM inplementation nominally occupies 24KB ($8000-$DFFF) with the Kernel, I/O, vectors etc. expected to reside in the remaining 8KB ($E000-$FFFF).
The RC6502 is a reasonable Apple 1 replica (uses a 6821 PIA) and the registers are still mapped to $D010-$D013 (WozMon compatibility). It looks like address decoding enables [CS_PIA] for the entire block $D000-$DFFF (i.e. there is no ROM mapped in this range).

I am just wondering if it is going to be possible to use Tali without moving the PIA addresses? I am not keen to do this.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 8:41 am 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
RegH wrote:
I am just wondering if it is going to be possible to use Tali without moving the PIA addresses? I am not keen to do this.

Tali Forth 2 is fairly modular. I got it running on a build with only 16k ROM, I believe by leaving out the assembler, disassembler and editor. You can customize it for your build. See examples in the platform folder.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 10:04 am 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
Good point, thanks.
Yes, one of the reasons that I am trying Tali is that it is very well structured and understandable but I did particularly want an assembler and the line editor would be useful too.
I have found the "includes" for them in taliforth.asm rather than the platform file and will try some builds now and check sizes.

The current firmware (in 8KB 28C64) has Basic starting at $E000, the Krusader assembler at $F000 with WozMon at $FF00. I certainly will not require Basic so have a free 4KB at $E000-$EFFF. It should be possible to split Tali and locate some/all of the extras in $E000??? I need to get to grips with the Ophis assemble.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 14, 2022 3:34 pm 
Offline

Joined: Thu May 19, 2022 2:54 pm
Posts: 19
Location: Felixstowe, UK
tmr4 wrote:
Tali Forth 2 is fairly modular. I got it running on a build with only 16k ROM, I believe by leaving out the assembler, disassembler and editor. You can customize it for your build. See examples in the platform folder.
It took quite a lot of jiggling but I finally managed to get Tali Forth 2 running :D Mind you, I had 32KB ROM (minus the 4k gap where the PIA sits - right in the middle).

I am not sure how you managed to leave out the assembler, disassembler and editor; simply commenting out the .require stopped it assembling. I reasoned that with more ROM, it would be worth leaving them in.
I also managed to crowbar in the Krusader assembler and used WozMon as per usual.

Thanks again all.
Just got to go and learn Forth now 8)


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 14, 2022 6:14 pm 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
RegH wrote:
I am not sure how you managed to leave out the assembler, disassembler and editor; simply commenting out the .require stopped it assembling.

Unfortunately, I don't have the initial version of Tali Forth 2 that I got running on my build with 16k ROM. Looking back at the last version I played with I see that in addition to removing the assembler, disassembler and editor, I restructured the native_word file into separate source files according to their Standard groupings. It looks like at this point I left out some of these groupings that weren't needed to support other words. This got the build down to a little over 11k, including my own I/O routines. I think I was trying to free up ROM to store Forth programs as I didn't have file storage at the time. I recall getting Conway's Game of Life running.

It was about this time that I realized that Forth provided all of the features I'd been adding to my monitor program so I ditched that effort to focus solely on Forth as an operating system. I started with a token threaded version to keep the size as small as possible. I found that a bit restrictive after a while and switched it to a direct threaded version. I'm working on a 65816 build now and found that a subroutine threaded version, similar to the threading used in Tali Forth 2, works better for my needs.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: