ZX81 Toddy Forth-79

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

ZX81 Toddy Forth-79

Post by kmurta »

Toddy Forth-79.png
Toddy Forth-79.png (5.4 KiB) Viewed 2174 times


When I released the first version of Toddy Forth about 10 years ago, my main motivation was to learn more about this curious and fascinating programming language, whose first contact dates back to 1987, through a basic compiler published in the Brazilian magazine Micro Sistemas . Another motivation was to come up with a system complete and robust enough to meet the main needs of a Forth enthusiast who wanted to use the language on their ZX81, without having to rely on an external PC for screen editing.

With the development of the various versions of TF I ended up reaching some of these goals, but something was still missing, as the system was suffering from an identity crisis, it was a mixture of various flavors of Forth with some parts that go back to Micro Systemas's Forth, others from FigForth and also from Camel Forth. For the next step it would then be necessary to adopt a unique identity, a defined pattern.

Among the options I considered were Camel Forth (ANS Forth), Forth-83 and Forth-79. In the beginning I was quite inclined to go for the Forth-83 but I ended up choosing the Forth-79 because: 1- it was the existing standard when the ZX81 was released; 2- The Forth-83 was not very well received by the market at the time; 3- It was the standard adopted in Jupiter Ace; 4- There is a lot of literature available on the net about F79. (As for Camel Forth, it's still in the plans and if it becomes a reality then we'll have an old school Forth and a more modern one for the ZX81, as per the ANS standard).

And so, after a long period of development (carried out in my few spare time) I bring to anyone who might be interested, my version for the ZX81 of a Forth system that almost entirely meets the specifications of the Forth-79 standard. Minimum hardware requirements are a ZX81 equipped with a ZXpand or ZXpand+ (tape is not supported). The TF79 also supports the Chroma81 and ZON-X81 interfaces, with specific words to activate the features available on these devices.

The keyboard routine features auto-repeat and audible feedback (via ZON-X81) and gives keyboard access to all ASCII characters, including lowercase letters (requires Chroma81 or an UDG4ZXpand).

For handling screens the same RAM disk concept found in Lennart Benschop's ZX Spectrum Forth-83 was adopted. I take this opportunity to register my thanks to Lennart for granting permission to embed his extensions package into the TF79. At the moment only the Screen Editor has been ported, but soon we will have the other extensions such as Assembler, Floating Point, multitask, and others.

I also leave my thanks to Moggy who has been using the TF79 and made valuable remarks.

The Toddy Forth-79 comes in two versions, one conventional (NOUDG) for systems without character redefinition capability and the other (UDG) for equipment connected to a Chroma81 or a UDG4ZXpand, which allow this redefinition. Following the download link, see the DOCS folder for use instructions and other useful information.

TF79_113.png
TF79_113.png (3.29 KiB) Viewed 2176 times



(03/03/2024) New release: 1.14
TF79-114.zip
(1.89 MiB) Downloaded 24 times

Fixes for this version:
- INKEY word with inconsistent behavior
- WAIT word with inconsistent behavior with argument 0
- Unification of both UDG and NOUDG versions
- Fixed a problem with the BREAK key (SHIFT+SPACE), thanks to Moggy for alerting me to the problem

(09/10/2022) New release: 1.13
TF79-113.zip
(1.65 MiB) Downloaded 163 times

*(27/11/2022) Get updates for EDITOR and HGR extensions here: viewtopic.php?p=49367#p49367


(11/06/2022) New release: 1.03 (Obsolete, see the latest release above)
TF79-103.zip
(109.31 KiB) Downloaded 132 times
Fixes for this version:
- Fixed the word PAUSE that was incomplete
- Fix in the keyboard reading driver, there was a bug that prevented the KEY word from working
- Replacement of . by U. in 79-STANDARD setting to print the free memory
- Documentation redone and updated

Of these bugs, the only really impacting one was the keyboard routine, impressed that no one noticed it.

Note: If you find any error or inconsistency while using the TF79, please let me know here, thank you.

Demonstration of Chroma 81 support:

https://youtu.be/QkMpZ2v7vw4


---

TFORTH79-101.zip
(102.36 KiB) Downloaded 246 times
(Obsolete, see the latest release above)

Edit (08/07/2021): Identified an error in the definition of the word UNTIL in the Assembler vocabulary, the following package fixes the error. (Edit at 09/07/2021: This error was just for me, it is not present in TFORTH-101.ZIP. Sorry for the false alarm)

Edit (04/09/2021): Fixed Floating Point Extension words F< , F. and F.R . Download the new file below:
Last edited by kmurta on Mon Mar 04, 2024 11:05 pm, edited 19 times in total.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

It has been a pleasure to test this most excellent Forth79 for the ZX81 and thanks to Roganjosh too for his equally excellent version of Forth79 which I have had the pleasure of testing, we now have 2 versions of this languages dialect. Both have been approached from a different angle and have their individual characteristics yet remain faithful to Forth79 and are totally usable with with any standard works on the subject.

A great achievement by both concerned and my grateful thanks to you both.


Moggy.
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

New release, see the first post.

This release brings some minor tweaks to the TF79 and the inclusion of the Assembler and Double Words Extension Set.

Also included is the NOKREP folder with versions without key repeat and key beep. These versions are primarily intended for those who use external Memotech type keyboards and prefer typing speed over these features.

Documentation for the new extensions is in the DOCS folder as usual.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Excellent Kelly many thanks for all hard work on this. :D
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Assembler and Double Extension Words load demonstration:

https://youtu.be/qtyxE1boAOk
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

I believe that the TF79 is already mature enough to have a 1.0 version, so I'm making it available, just go to the first post in this topic.

This release fixes a bug in the .R word, includes the -ROT word and changes the naming of the ?NEGATE and ?DNEGATE words to +- and D+- respectively. Also included is the word SAVE to save a copy of the user's vocabulary, read the documentation for usage instructions.

Several small internal changes were made to improve performance and prepare the system to support the ZX Printer.

In the Assembler extension, the words BEGIN-UNTIL-WHILE-REPEAT and begin-until-while-repeat were defined incorrectly and are now properly corrected. The words ?PAIRS !CSP and ?CSP were also included for improve security in defining control structures in Assembler.

Have been added the extensions FLOATING.BLK and TRANSCEN.BLK for floating point math operations (from ZX Spectrum Forth-83 compiler, by Lennart Benschop) .

Added the PRINTER.BLK extension that allows redirecting print output to the ZX Printer. The following is a demonstration of using this extension (click on the image if the animation doesn't run):

printer.gif


Now I'm going to focus on improving the system documentation and creating the high-resolution graphics extension
Last edited by kmurta on Mon Jun 28, 2021 2:42 pm, edited 1 time in total.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

Excellent Kelly.

I did notice that BEGIN UNTIL loops weren't behaving as expected so look forward to trying this.

FLOATING POINT!! This sounds fantastic and I'll fun with this also and after that will give the printer a run out too!


Many thanks for this.

Regards.

Moggy.
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

It was not a good idea to have different names for the UDG and NOUDG versions, it ended up making it impossible for programs saved in one to be loaded into the other.

So I decided to reorganize the files and keep the Forth words addresses the same across all versions. Thus, a program saved in one version of the TF79 can be loaded in the other, as long as they have the same version number.

The bad thing is that the different TF79.BIN files (UDG and NOUDG) will have to be in different folders, not a big problem.

The .P files don't need to be in the same folder as the TF79.BIN files, but they need to be loaded from the folder where the appropriate TF79.BIN is located.

Exemplifying, if you save the Screen Editor in the root folder with SAVE EDITOR Forth sentence and later want to load it with the UDG version of FT79.BIN, you should go to the UDG folder and load Editor from the root folder (at BASIC prompt):

CAT ">UDG"
LOAD "/EDITOR.P"

This will load EDITOR.P from root dir and TF79.BIN from UDG folder.


Go to the first post to download the new release.

Note: This release also fixes DOUBLE.BLK file which reported "NOT FOUND" error for the word ?DNEGATE, which was replaced by D+- . Thanks to Moggy for warn me about this error.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX81 Toddy Forth-79

Post by Moggy »

The floating point and trig' functions are a nice addition to this version of Forth which make it comparable to ZX81 BASIC in function in my opinion, albeit much faster. In the past floating point Forth was unfavourably regarded due to its perceived slow operation, integer Forth with relevant scaling and number formatting being the weapon of choice. However I cannot observe any slowing down of the system with this floating point implementation, plus it has the advantage of compiling words that, redundant of of said scaling and number formatting, are now smaller thus adding a slight speed boost into the bargain.

The printer function is another nice addition with a custom font which surprisingly works with the non-UDG version too.

We have been really blessed with two excellent Forth79 versions (TF79 and FIF81)this year and to Alan(Roganjosh) and Kelly(Kmurta) I for one give my grateful thanks. :D
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: ZX81 Toddy Forth-79

Post by kmurta »

Hi Fred, I am very pleased that you are enjoying the TF79! But it's fair to point out that floating point extension and double numbers extension are not my work, they were developed for the ZX Spectrum Forth-83 by Lennart Beschop, who kindly granted me permission to include them with the TF79. The Assembler is also part of Lennart's Forth-83 and was developed by Coos Haak. Really these extensions greatly enrich the experience with the TF79 and I'm very grateful to Lennart for that.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Post Reply