• Please review our updated Terms and Rules here

Color Forth available for CoCo with DECB

smp

Veteran Member
Joined
Oct 4, 2011
Messages
1,723
Location
Bedford, NH, USA
All,

I have been working on a project to get the Talbot Microsystems Color Forth cartridge code assembled as a file that can be loaded and run by a TRS-80 Color Computer using Disk Extended Color Basic.

Today, I am announcing that I have achieved my goal. I have a version of Talbot Microsystems Color Forth that one can LOADM from disk and EXEC. I have eliminated the old cassette I/O and installed a rudimentary set of commands that allow the user to load Forth code screens from disk and save Forth code screens to disk. I also installed a command to see the files on disk, and finally, I installed a command to gracefully exit from Color Forth back to DECB.

The original cartridge code and the original manual are available on: http://www.colorcomputerarchive.com/

A .ZIP file containing two .DSK images (one for assembly code source files and the other for executable files) and two brief documentation files is available if requested. To make a request, please send me your private e-mail address in a PM.

Thanks very much for listening.

smp
 
Nice!, seems an interesting project. Is this Forth version somewhat compatible with CoCo3?.

The only one I know is the Microworks Forth, I'll check it the manual in the page you pointed out, I'm curious about how advanced is it :)
 
Nice!, seems an interesting project. Is this Forth version somewhat compatible with CoCo3?.

The only one I know is the Microworks Forth, I'll check it the manual in the page you pointed out, I'm curious about how advanced is it :)

Hi jltursan,

Yes, Color Forth will run on any Color Computer. I am running it on my CoCo 3.

Is far as "advanced" goes, Color Forth is fig-FORTH with some updates (if you get all the additional Forth source code in the manual listings typed in) to be compatible with Forth-79. fig-FORTH is 16 bit integer arithmetic only, as you may know, and Forth-79 is only a small step ahead. But, the way ahead is to embellish the Color Forth nucleus with as much as you like.

When you look at the manual, you will see that Talbot Microsystems published all their source listings. That's why I chose Color Forth for my project.

Thanks for listening!

smp
 
Hi smp-

During the lockdown I've been dragging out machines that I meant to get to "one of these days". Well, those days seem to have arrived and I've powered up my CoCo2 to learn more about it. It was a machine I got basically for free but was never high on my list, so it sat for years. The environment I've chosen to investigate this machine is forth, and Color Forth looks like the most interesting in that it has some nice CoCo extensions, retains much compatibility with "Starting Forth", and has the source code available in electronic form (thanks to you). I really like your work adding disk I/O to Color Forth. I did something similar for the Apple 1 with a CFFA adapter.

I haven't touched 6809 code since the '80s, but one of the attractions to the 6809 and forth was the implementation of NEXT, the code used to execute the next forth word. The 6809 has one of the cleanest, most efficient versions: LDX ,Y++ JMP [,X]. However, for some reason, the figForth implementation used a BRAL NEXT at the end of many core words. This never made sense to me. Sure, it was a byte smaller than in-lining NEXT, but it ruined (in my mind) the biggest benefit of forth on the 6809. The later Forth83 implementations seemed to in-line NEXT into the core words.

In order to fix this affront to my sensibilities, I'd like to recompile the Color Forth kernel with inlined NEXT. It should increase the size only slightly, so I'm pretty sure it won't affect the disk version you've created (and would fit in the cartridge version, too, looking at the size). I've extracted the source file you included on the disk image; thanks for that! But now I want to cross-assemble it using asm6809. I'm guessing you didn't use this assembler. I had to add ';' in front of the comment field to get it to assemble with asm6809, and the resulting binary doesn't match your binary even though there are no assembly errors. The listing file doesn't show any issues, but before I go down the rabbit hole, I was hoping you could shed a little light on your approach to assembling Color Forth.

I am very new to the CoCo scene, so sorry if I got much of this process wrong. Any help much appreciated!
 
... I'd like to recompile the Color Forth kernel with inlined NEXT. It should increase the size only slightly, so I'm pretty sure it won't affect the disk version you've created (and would fit in the cartridge version, too, looking at the size). I've extracted the source file you included on the disk image; thanks for that! But now I want to cross-assemble it using asm6809. I'm guessing you didn't use this assembler. I had to add ';' in front of the comment field to get it to assemble with asm6809, and the resulting binary doesn't match your binary even though there are no assembly errors. The listing file doesn't show any issues, but before I go down the rabbit hole, I was hoping you could shed a little light on your approach to assembling Color Forth. ...

Hi resman,

First, thanks for your interest! It's nice to see someone else into this obscure language, especially on a Color Computer!

I have not been active with my Color Computer for some years, and this project was a couple of years before that, so I am quite rusty in this area. You are correct that I did not use asm6809. I used EDTASM as extended for both 6809 and 6309 by Robert Gault, called EDTASM6309. I tried to look around a bit, but I could not find a good web site to send you to.

There is a CoCo Facebook Group, but I am not on Facebook, so I cannot help you with that. There is a CoCo e-mail List here:
http://five.pairlist.net/mailman/listinfo/coco Email: coco@maltedmedia.com

I don't want to lead you any further astray, so since I am not using this computer and software at the moment, I'll leave you to it.

My released package is available on the Color Computer Archive:
https://colorcomputerarchive.com/repo/Disks/Programming/Color Forth (Talbot Microsystems).zip

Good luck! Post back with your progress. Maybe you'll spark my interest in this again. 8-)

smp
 
I could never get into Color Forth. I played with it a little on a PC. Chuck mainly liked it because it could be used to create graphical tiles, that he used to make one of the variations of a Forth like IC. He used it to both make the silicon mask and the simulator to verify the design. Not too many people deal at that level but Chuck is an unusual person.
Dwight
 
Hi Dwight! Thanks for chiming in!

No, you are not talking about the same Color Forth. Color Forth was created as a variant of fig-FORTH by Talbot Microsystems in a cartridge for the Radio Shack / Tandy Color Computer, quite some time before Chuck created his Color Forth. It came with a built in editor, cassette input & output, and a few additional tweaks, but no real color graphics capabilities like Chuck’s eventually had. Really, just another fig-FORTH.

smp
 
Your thinking of colorForth that was the version of forth which Chuck used for designing ICs. I walked into GreenArrays one day to talk with Chuck and Greg. They were whipping out designs on their computers using that tool. A very unique environment, for sure.

However, this Color Forth predates that version by quite a few years. Color Forth for the Tandy Color Computer: based on figForth with a sprinkling of FORTH79.
 
Thanks for the info, smp. I'll give a try to update the source to use asm6809 to build a working system.
 
There are things I've liked about fig Forth, 79Forth and 83Forth. I used to take the parts I like most in each. Now days, I just play with it a little to see what NOT really does. I like -1 as a flag, I don't need an other 0= that does the same thing.
I've been playing with EForth on a STM32 chips and board for less than $2. EForth is clearly not for everyone either.
I've been looking at an old Forth that looks to predate fig Forth but around the same time frame. It is running on a PET but I don't have one to play with. Still it is fun to look at some of the design choices made.
I just spent time looking at the listing I made and figured the WHILE workd like this:
BEGIN ... cond IF ... WHILE
Different but works I guess.
One can always find a way to avoid using a WHILE like operation but it is simpler to think about doing a WHILE as an exit from the center of the loop.
The Tandy Color Computer was an under rated machine of its time. To bad Tandy was already falling apart when these were just beginning. It would have been nice to see where it was going.
Dwight
 
Thanks for the info, smp. I'll give a try to update the source to use asm6809 to build a working system.

Well, you've gone and done it! :lol: I have now unearthed my CoCo3 with its SDC and gotten it fired up again.

I dug out my Switch-A-Roo CoCo 3 RGB-to SCART video converter (that I've never tried) and I've ordered an SCART-to-HDMI converter. Hopefully, when the converter arrives I'll be able to set up a better display than my current 9 inch Panasonic color video monitor. With a good display, I'll be able to use all the available line lengths and get that assembler fired up again, as it uses the 80 column display.

I'm getting back into it again, albeit a bit slowly. Please post back your experiences. Id like to know how you make out.

smp
 
Well, you've gone and done it! :lol: I have now unearthed my CoCo3 with its SDC and gotten it fired up again.

I dug out my Switch-A-Roo CoCo 3 RGB-to SCART video converter (that I've never tried) and I've ordered an SCART-to-HDMI converter. Hopefully, when the converter arrives I'll be able to set up a better display than my current 9 inch Panasonic color video monitor. With a good display, I'll be able to use all the available line lengths and get that assembler fired up again, as it uses the 80 column display.

I'm getting back into it again, albeit a bit slowly. Please post back your experiences. Id like to know how you make out.

smp
LOL! Yeah, I ordered a 6309, composite video adapter and SDC. My "nearly free" CoCo2 has now cost me about $150! At least I'm now invested in doing something with the setup ;-)
 
LOL! Yeah, I ordered a 6309, composite video adapter and SDC. My "nearly free" CoCo2 has now cost me about $150! At least I'm now invested in doing something with the setup ;-)

I'm with you on that! Now I'm thinking about a 6309 and maybe a 512MB upgrade...

smp
 
I just received my SDC and composite video board for the CoCo2. Guess what? Turns out I have a RevF 64K CoCo1. Did I mention I'm a CoCo n00b? So no clean video for me, but the SDC works great. I bought these from Ed Snider. Don't know if he's on the forums, but he is a very upstanding guy.

Regardless, I pushed on learning the process of moving files in and out of CoCo disk images. I copied out your CC-FORTH.BIN file to use as a baseline. I decided to try two assemblers: asm6809 and lwasm. I had to make a simple change to get your source to compiler using asm6809: adding ';' before the comments in the comment field. The results were pretty interesting.

First, the source file compiled fine with both assemblers with the comments semicolon off-ed.The biggest surprise was the size difference. Here is what each version came out, size-wise:

Code:
cc-forth.bin (original) 5933 bytes
ccfa.bin (asm6809)      5718 bytes
ccfl.bin (lwasm)        5713 bytes
It's pretty tough to compare binaries, but it was pretty easy to output listing files from asm6809 and lwasm to compare their differences. The small difference between these two assemblers comes down to lwasm being more aggressive with the direct page. It assumed the DP register is zero and uses the 8 bit address instead of the full 16 bit address. I'll look into adding DP directives to convince asm6809 to generate DP addresses.

Another question is, with the size discrepancy between the original and freshly assembled versions, do they work as expected? A quick sanity test says 'yes'. My sanity test was pretty simple:
Code:
VLIST
1 1 + .
." HELLO"
I can't account for the over 200 bytes size reduction with the cross-assembled version. I suppose I could spend more time comparing the binaries, but I plan on moving ahead with updating the source for in-lined NEXT. The result will be smaller than the original with the cross-assemblers, too.

The command line assembly looked like:
Code:
asm6809 -C -lcc-fortha.lst -o ccfa.bin cc-forth.asm
wasm --decb -lcc-forthl.lst -o ccfl.bin cc-forth.asm

And now with the in-lined NEXT for all the core words. The source is cc-forthnxt.asm and assembled with lwasm to CCF-NXT.BIN (5758 bytes). It passed my overly simple sanity test. I've included the directory with with the updated disk image and source files so anyone else can check it over. Hope this is okay.
View attachment cc-forth.asm.txt
 

Attachments

  • cc-forthnxt.asm.txt
    29.8 KB · Views: 1
  • ColorForth.zip
    176.2 KB · Views: 1
Last edited:
Well, it must be pretty functional. Here it is running the editor. I had to attach to the last CRT T.V. set I own. Looks pretty darn good, too. I'm all ready with "Starting Forth" and my 6809 Assembly Language book.
IMG_1570.JPG
 

Attachments

  • IMG_1570.JPG
    IMG_1570.JPG
    100.5 KB · Views: 3
Wrapping this up, here is the code and files for the inline NEXT along with a version that switches to 6309 native mode. Seems to work fine on my 64K CoCo1. To build the 6309 native from source:

Code:
lwasm --decb -DCPU6309 -lcc-forthnxt.lst -o ccf3-nxt.bin cc-forthnxt.asm

Regular 6809 from source:
Code:
lwasm --decb -lcc-forthnxt.lst -o ccf-nxt.bin cc-forthnxt.asm

I added to the initial message to identify the new versions. My work may be done here.
 

Attachments

  • cc-forthnxt.asm.txt
    29.9 KB · Views: 3
  • ColorForth.zip
    84.6 KB · Views: 2
Wrapping this up, here is the code and files for the inline NEXT along with a version that switches to 6309 native mode. Seems to work fine on my 64K CoCo1. ... My work may be done here.

Thanks very much for all the attention and effort! Good luck on your quest with Color Forth. Post back from time to time with what you are doing with it. I find it quite tedious to try and get some significant Forth source code entered with only 8 screens at a time, and the 32 lines of 32 characters is difficult to use if you are used to 16 lines of 64 characters.

Since I just got re-started again here, I've been exploring Frank Hogg Lab E-Forth. It works well with my CoCo 3 and SDC - except it appears that after getting it all loaded in, it expects that one would remove the boot disk and replace it with another disk with your code being saved on that - BUT it has to be in Drive 0, and that is one thing that I have not been able to accomplish with the SDC. Once you have a disk image in Drive 0, and you get off and running, there seems to be no way to then change what the disk image is in Drive 0 to another image. Right now, I am scouring the manual to see if there is any way to direct E-Forth to use Drive 1. No luck so far...

smp

smp
 
Page 12 of the SDC manual talks about multiple disk image software. I haven't gotten very far with the SDC yet, but seems vey capable.
 
... I've been exploring Frank Hogg Lab E-Forth. It works well with my CoCo 3 and SDC - except it appears that after getting it all loaded in, it expects that one would remove the boot disk and replace it with another disk with your code being saved on that - BUT it has to be in Drive 0, and that is one thing that I have not been able to accomplish with the SDC. Once you have a disk image in Drive 0, and you get off and running, there seems to be no way to then change what the disk image is in Drive 0 to another image. Right now, I am scouring the manual to see if there is any way to direct E-Forth to use Drive 1. No luck so far...

Success! Looking at the E-Forth commands used in the Appendix for making a CoCo installation, as well as perusing the E-Forth vocabulary provided in the manual, I figured out a series of E-Forth commands to make Drive 1 the primary disk drive in the system after booting up E-Forth.

The CoCo 3 double speed poke command works fine for both the SDC and also stays installed for E-Forth, providing for a very fast Forth system to work with.

Now to start playing around with the E-Forth editor and saving stuff off to disk without any fear of mucking up the E-Forth boot disk! Yay!

Thanks for listening!

smp
 
Spending more time with Color Forth I found some deficiencies that needed rectifying. Made an attempt at a release 1.2 to differentiate this from smp's version. Here is the addendum:

Color Forth 1.2 User Notes Addendum - resman April 2020

The DECB updates to Color Forth is the basis to this addendum. The source code was brought over to OS/X and prepared for assembling with lwasm (from the LWTOOLS project: http://www.lwtools.ca/). By assembling with lwasm, the size of the binary was reduced over 200 bytes! It’s aggressive use of DP and multiple passes really helped drop the size. This provided some opportunity to fix some issues that were left over from the days of Color Forth being a ROM based product. Here is a breakdown of the changes:

1. In-line NEXT for core words. NEXT fetches and calls the next word pointed to by IP.

2. Remove some dead code left over from cassette I/O routines.

3. Add optional 6309 native mode set to gain slight improvement in execution speed.

4. Add FORTH-79 word PICK and ROLL to access any word on the stack.

5. Include graphics routines from manual plus addition routines for horizontal/vertical lines, boxes, and rectangles.

6. Simplified loading of source screens.


Assembling source:
Using the lwasm compiler, the source is assembled on the command line.

Code:
lwasm --decb -o cc-forth.bin cc-forth-1.2.asm

lwasm --decb -DCPU6309 -o cc-f6309.bin cc-forth-1.2.asm

The binaries can be copied to the disk image.
Code:
decb kill CCF-V12.DSK,CC-FORTH.BIN
decb copy -2 cc-forth.bin CCF-V12.DSK,CC-FORTH.BIN

decb kill CCF-V12.DSK,CC-F6309.BIN
decb copy -2 cc-f6309.bin CCF-V12.DSK,CC-F6309.BIN



Simplified code loading:
The code files have been updated for some simplified loading. The CCF-MISC file is loaded with:
Code:
LSCR <CR>CCF-MISC
1 LOAD <CR>

You will be presented with a “What?” afterwards. I’m not completely sure where it comes from, but it doesn’t affect the loaded code.

The editor can then be loaded:
Code:
LSCR<CR>CCF-ED<CR>
1 LOAD<CR>


Graphics code:
The graphics routines from the manual are included in the CCF-GFX file. The CCF-MISC file must be loaded first. Load with:
Code:
LSCR<CR>CCF-GFX<CR>
1 LOAD<CR>

You can now run the demo code in Section 7 in the manual. There are four additional routines included: VLIN, HLIN, BOX, and RECT. Their source:
Code:
: HLIN ( Y X2 X1 — )
	DO I OVER SET LOOP DROP ;
: VLIN ( Y Y2 Y1 — )
	DO DUP I SET LOOP DROP ;
: BOX ( X1 Y1 X2 Y2 )
	3 PICK 3 PICK 6 PICK HLIN
	DUP 3 PICK 6 PICK HLIN
	4 PICK OVER 5 PICK VLIN
	OVER OVER 5 PICK VLIN
	2DROP 2DROP ;
: RECT ( X1 Y1 X2 Y2 —)
	3 PICK DO
	I OVER 5 PICK HLIN
	LOOP 2DROP DROP ;

You can see where the new FORTH-79 word PICK is used to select parameters passed to the BOX and RECT words.
 

Attachments

  • ColorForth-1.2.zip
    41.3 KB · Views: 3
Back
Top