Page 2 of 5

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sat Jan 08, 2011 2:02 am
by RWAP
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.

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sat Jan 08, 2011 1:08 pm
by kmurta
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

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sat Jan 08, 2011 6:17 pm
by kmurta
I updates the page with more informations, take a look:

http://zx81.eu5.org/toddysofte.html

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sat Jan 08, 2011 6:23 pm
by XavSnap
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

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sun Jan 09, 2011 4:35 pm
by Moggy
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

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sun Jan 09, 2011 6:58 pm
by Moggy
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 :(

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Sun Jan 09, 2011 8:50 pm
by kmurta
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 ;

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Tue Jan 11, 2011 5:23 pm
by Moggy
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

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Tue Jan 11, 2011 10:53 pm
by kmurta
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.

Re: Toddy Forth - a new ZX81 forth implementation

Posted: Wed Jan 12, 2011 1:14 am
by Moggy
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