Toddy Forth - a new ZX81 forth implementation

Discussion about ZX80 / ZX81 Software
RWAP
Site Admin
Posts: 1235
Joined: Thu May 08, 2008 7:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by RWAP » Sat Jan 08, 2011 1:02 am

I have uploaded details of all this software now onto my page at: http://www.rwapsoftware.co.uk/zx81/zx81_software.html

I have probably made some errors about the hardware requirements - please let me know and I will correct them.

User avatar
kmurta
Posts: 123
Joined: Tue Sep 01, 2009 4:04 am
Location: Belo Horizonte - BR
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by kmurta » Sat Jan 08, 2011 12:08 pm

RWAP wrote:I can see that I need to update the page on the forums listing all the programs which use hi-res graphics

Can you clarify which scheme your software adaptations support please - see the definitions at the start of that topic.
Ok, follow the list:

Airport HR - UDG card mapped at 3000h
HiRes Galaxian - UDG card mapped at 3000h
HR PICTURES - this pack has two groups of programs.Those named HRLPTR*.p are intended to zx printer. The others (NU*.p) use the WRX scheme and needs a modified RAM pack.
Cartoons - use the WRX scheme and needs a modified RAM pack.
ZX81 Music Interpreter - standard zx81 (sound generated by sync pulses)
Clock - standard zx81
Pink Panther - zonx81 compatible sound board
Dancing Demon - zonx81 compatible sound board
QuickSilva games - UDG card with chr$128 scheme mapped at 3000h and zonx81 compatible sound board
Panic HR - UDG card with chr$128 scheme mapped at 3000h
Poker HR - UDG card mapped at 3000h
ZX81 Toddy Forth (and the others forths at page) - UDG card mapped at 3000h

Programs included in the Toddy Forth package:
tforth10-std - Toddy Forth for use with standard zx81, without UDG card
3DMAZE - UDG card with chr$128 scheme mapped at 3000h and zonx81 compatible sound board
Acemines - UDG card mapped at 3000h and zonx81 compatible sound board
Breakout - UDG card mapped at 3000h and zonx81 compatible sound board
Breakout-std - zonx81 compatible sound board
Calendar - standard zx81
Divn - standard zx81
Dump - standard zx81
Factorial - standard zx81
Hanoi - standard zx81
Mancala - standard zx81
Millipede - UDG card mapped at 3000h and zonx81 compatible sound board
Plot-test - standard zx81
Rotsom - standard zx81 (sound generated by sync pulses)
Sokoban - UDG card mapped at 3000h and zonx81 compatible sound board
Sudoku - UDG card mapped at 3000h and zonx81 compatible sound board
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org

User avatar
kmurta
Posts: 123
Joined: Tue Sep 01, 2009 4:04 am
Location: Belo Horizonte - BR
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by kmurta » Sat Jan 08, 2011 5:17 pm

I updates the page with more informations, take a look:

http://zx81.eu5.org/toddysofte.html
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org

User avatar
XavSnap
Posts: 462
Joined: Sat May 10, 2008 3:23 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by XavSnap » Sat Jan 08, 2011 5:23 pm

Hi,

the Artic Forth and the french book :
"Introduction au ZX Forth" de Marc Petreman et Michel Rousseau
are also available on http://zx81.ordi5.free.fr/k7/

Docs:
http://zx81.ordi5.free.fr/k7/download/Z ... anual.djvu
http://zx81.ordi5.free.fr/k7/download/Z ... anual.djvu

H4th rom docs.
http://zx81.ordi5.free.fr/dominique/dow ... h-h4th.pdf

Forth site :http://forthretro.new.fr

Moggy
Posts: 1513
Joined: Wed Jun 18, 2008 1:00 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by Moggy » Sun Jan 09, 2011 3:35 pm

kmurta wrote:I updates the page with more informations, take a look:

http://zx81.eu5.org/toddysofte.html
Brilliant work Kmurta!!

Especially the maths routines as that is where my interest lies.
If You ever write a prime number routine please please publish as I am only just getting to grips with this language.
XavSnap wrote:Hi,

the Artic Forth and the french book :
"Introduction au ZX Forth" de Marc Petreman et Michel Rousseau
are also available on http://zx81.ordi5.free.fr/k7/

Docs:
http://zx81.ordi5.free.fr/k7/download/Z ... anual.djvu
http://zx81.ordi5.free.fr/k7/download/Z ... anual.djvu

H4th rom docs.
http://zx81.ordi5.free.fr/dominique/dow ... h-h4th.pdf

Forth site :http://forthretro.new.fr
Hi Zavsnap

The Artic Forth on Your site seems to be missing the editor screens, I tried the ones on zx81stuff.org but they don't work. is there a workaround for this?

Regards Moggy

Moggy
Posts: 1513
Joined: Wed Jun 18, 2008 1:00 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by Moggy » Sun Jan 09, 2011 5:58 pm

Hi Kmurta

The two programs I am really interested in DIVN and FACTORALS have a FTH extention not p how do You load these into Eighty One??

Regards Moggy


EDIT TO POST

Sorry Kmurta just opened My eyes and seen the light I get it now!!!

A very dumb Moggy :(

User avatar
kmurta
Posts: 123
Joined: Tue Sep 01, 2009 4:04 am
Location: Belo Horizonte - BR
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by kmurta » Sun Jan 09, 2011 7:50 pm

Moggy wrote: If You ever write a prime number routine please please publish as I am only just getting to grips with this language.
Take a look at this code: http://rosettacode.org/wiki/Sieve_of_Eratosthenes#Forth

To test it in the Toddy Forth, define the word ERASE:

Code: Select all

: ERASE  ( addr n -- )
  ?DUP IF OVER + SWAP
          DO 0 I C! LOOP
       ELSE DROP
       THEN
;
EDITED:

Oh, theres a problem with this code on Toddy Forth: the sieve table conflict with the PAD, so the prime number 67 isn't listed on output. To correct this, change the word HERE by PAD or, if you has more than 32K (not a problem with Eightyone), by 32768.

The changed code is:

Code: Select all

\ Sieve of Eratosthenes
\ Roseta Code - http://rosettacode.org/wiki/Sieve_of_Eratosthenes#Forth

: ERASE  ( addr n -- )
  ?DUP IF OVER + SWAP
          DO 0 I C! LOOP
       ELSE DROP
       THEN
;

: PRIME? ( N -- ? ) PAD + C@ 0= ;
: COMPOSITE! ( N -- ) PAD + 1 SWAP C! ;

: SIEVE ( N -- )
  PAD OVER ERASE
  2
  BEGIN
    2DUP DUP * >
  WHILE
    DUP PRIME? IF
      2DUP DUP * DO
        I COMPOSITE!
      DUP +LOOP
    THEN
    1+
  REPEAT
  DROP
  ." PRIMES: " 2 DO I PRIME? IF I . THEN LOOP ;
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org

Moggy
Posts: 1513
Joined: Wed Jun 18, 2008 1:00 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by Moggy » Tue Jan 11, 2011 4:23 pm

Hi Kmurta

Compiler , prime number and maths routines converted to run on real 81 :D
This is really great work Kmurta and a very fast version of forth, just two questions though, 1) will a screen editor ever be written?
2) Is there a way to alter keyboard repeat rate? On a real 81 a single keypress produces 4 or 5 repeats of same character and a lot of time is spent deleting.

Many thanks in advance.

Regards Moggy

User avatar
kmurta
Posts: 123
Joined: Tue Sep 01, 2009 4:04 am
Location: Belo Horizonte - BR
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by kmurta » Tue Jan 11, 2011 9:53 pm

Moggy wrote:Hi Kmurta

Compiler , prime number and maths routines converted to run on real 81 :D
Great! I'm glad to know that you are able to use it on real the ZX81
This is really great work Kmurta and a very fast version of forth
Yes, I believe that it is the fastest forth for zx81, thanks to the DTC threading technique used. But this has a price: you can not define words beyond 32K, unles you have a ZX81 with M1NOT circuit.
just two questions though, 1) will a screen editor ever be written?
I have not thought about writing a screen editor because I think more convenient to edit and compile the software with the PC and Eightyone emulator.
2) Is there a way to alter keyboard repeat rate? On a real 81 a single keypress produces 4 or 5 repeats of same character and a lot of time is spent deleting.
Of course! Change the 16 bits value at address 17710, where the default is 768.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org

Moggy
Posts: 1513
Joined: Wed Jun 18, 2008 1:00 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by Moggy » Wed Jan 12, 2011 12:14 am

Hi Kmurta

Thanks for quick reply,

I get Your point about editor ( do the work and compilation in EO then port the finished work to real 81,so much easier).
I altered key repeat rate by compiling the 2@ and 2! words from the library file and using them to alter then check address 17710 ,so simple an answer and the end result works great. :D

Thanks again Kmurta for Your time and effort it is much appreciated.

Regards
Moggy

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest