Forth TX16 - new Forth interpreter for Commander X16

All aspects of programming on the Commander X16.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: Forth TX16 - new Forth interpreter for Commander X16

Post by funkheld »

For the x16 I would like to be able to include inline code.

greeting
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: Forth TX16 - new Forth interpreter for Commander X16

Post by funkheld »

hello, good day.

is the forth no longer being developed?

thanks.
greetings
vasyl
Posts: 12
Joined: Sat Sep 02, 2023 11:43 pm

Re: Forth TX16 - new Forth interpreter for Commander X16

Post by vasyl »

Well, RL intervened, as it often happens. But I am getting back to the project now.

Currently working on fixing the I/O to work on C64 as well - there seems to be a number of differences. The final goal there is to get an 8K cartridge image for C64. For the X16 the idea is to move it to one of the high memory blocks. Once that is done, I will start working on the tools and utilities disk.

As for your question about the inline assembly, this would probably come as part of the tools disk - there is simply no space left in 8K. I would not go inventing my own, rather adapt the one from Dr. Dobb's Toolbook of Forth. It is not that difficult to write, Forth allows creating in-line assemblers easily, but this particular one is quite known, and it created certain syntax and conventions that were used in many places.

In case if you don't know about Dr. Dobb's Toolbook of Forth, there are two volumes filled with articles from the magazine and some extra stuff. Probably the most useful books on Forth out there. A bit difficult to find in paper form these days, but there are PDFs out there.

So, the project continues, and there should be some news soon.
funkheld
Posts: 322
Joined: Mon Feb 26, 2024 11:11 am

Re: Forth TX16 - new Forth interpreter for Commander X16

Post by funkheld »

Hello thanks for Info.

greeting.
vasyl
Posts: 12
Joined: Sat Sep 02, 2023 11:43 pm

Re: Forth TX16 - new Forth interpreter for Commander X16

Post by vasyl »

New version is up. Massive rewrite of file I/O - most of the issues were caused by my lack of knowledge of actual C64, a couple of evenings with 1541 User's Guide fixed that. I think it is about as correct as it can be given the platform limitations. Most importantly, the code works identically on both X16 and C64 now! You can run the entire test suite on C64, it may take a long time, but finishes without errors.
Fixes in file system took some memory, so I had to do another round of size optimizations. That was successful as well, the binary size is still under 8K - more than that, there are about 25 bytes left for cartridge entry code. Pretty sure I can find a few more tricks if I need more byte.
So, the core is quite solid now. I will continue testing it, fixing whatever I find. Beside that the plans are:
  • Prepare a cartridge version for C64.
  • Figure out the best memory config for X16.
  • Start working on the tools disk.
  • Write some documentation, write better comments, and other housekeeping.
I have X16 hardware on pre-order, so should be able to test my stuff on it in a few months. I also got all parts for simple C64 carts, so planning to do real metal test there as well.
vasyl
Posts: 12
Joined: Sat Sep 02, 2023 11:43 pm

Re: Forth TX16 - new Forth interpreter for Commander X16

Post by vasyl »

Updated - a few more touch ups and the process to build a C64 cartridge. The last part may be of less interest to the Commander X16 community, but it is still very cool. This version is very solid, everything I wanted to implement is there, so now it's time for cleanups, documentation, tools, and the rest of housekeeping. Ordered the hardware as well, so might be able to test it on the real thing in a few weeks.
Post Reply