Toddy Forth - a new ZX81 forth implementation

Discussion about ZX80 / ZX81 Software
Moggy
Posts: 1798
Joined: Wed Jun 18, 2008 2:00 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by Moggy » Sun Apr 24, 2016 4:04 pm

mrtinb wrote:
Moggy wrote:ZX81 fig forth.
I found this to be SLOOOOW , no faster than basic, a tiresome tape loading of editor screens(one only at any one time) which I could never get to work etc mean a pass on this for me.
Sounds like Artic Computing Forth. I've tried it and can't load the editor either. (I've tried both with EightyOne, ZXsp and ZesaruX.)

I'm thinking about typing (or load to RAM) the editor from Artic Computing into Toddy Forth (which misses an editor).

(And I think I need to find an implementation of the keyword SEE, which is missing as well.)
I converted the program you mention above to tape load on real zeddy while the main application loads fine I couldn't get the editor screens to load this way either, suggesting a fault in the P files.

I don't think you will find a ZX81 version of the primitive SEE, as such a decompiler word would by design take up a lot of valuable ram/rom space on a very limited memory computer plus I wouldn't see a great need for something to decompile words you have already created and therefore already know their meaning.

If it is to understand words created by others then perhaps the following may be of more value..
Attachments
TFORTH12.rar
(201.23 KiB) Downloaded 99 times
thinking-forth.rar
(3.92 MiB) Downloaded 118 times

User avatar
mrtinb
Posts: 987
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by mrtinb » Sun Jul 03, 2016 7:43 pm

Hi :)

Apart from
  • Toddy Forth
  • ZX81 Fig Forth
  • H4th
  • Artic Computing Forth
There seems to be a Dominique Contant's Forth. Unfortunately it seems to be made specifically for use in an emulator. This is just like Toddy Forth.

Does anyone know if Dominique Contant's Forth can work without the emulators forth editor? Looking in the document included with Vb81: Forth_Changes.txt, it states: “A Forth Editor written in Forth, beginning at h8000, were included”. If is was to work on a real ZX81, it would need some sort of storage as well. There seems to be these words defined, that might handle storage: SRC/DISK and LOAD.

Looking at the file which contains the program (Forth.Z81), it configures the emulator to have 64K of RAM. This will also limit to a few real ZX81.

Has anyone used Dominique Contant's Forth?
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
XavSnap
Posts: 645
Joined: Sat May 10, 2008 4:23 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by XavSnap » Sun Jul 03, 2016 8:43 pm

Hi Martin,
Dominique is registered on the French forum:
http://forum.system-cfg.com/memberlist. ... file&u=428
PSEDO: "Dominique"

His web site : http://forthretro.new.fr
[EDIT] this link is Brocken ... - >>> http://forth-retro.pagesperso-orange.fr/index-en.htm[EDIT]
Does anyone know if Dominique Contant's Forth can work without the emulators forth editor?
:mrgreen:
No... , Vb81 had been code around the ZX81 codes, but can run in standalone on a true ZX81.
The emulator just send or retrieve ZX81 memory blocs to avoid to type it on the ZX81 Forth's editor.
The Z81 format is used to get a clear 32k release, and run it easily.
We had to contact Dominique to get the last release, and get his standalone loader... to save a file in "p" file to run a compiled code.

But, Dominique code on several computers... and the ZX81 project steel in standby.
...Vb81 too...
:oops:

User avatar
mrtinb
Posts: 987
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by mrtinb » Mon Jul 04, 2016 6:44 am

XavSnap wrote: The Z81 format is used to get a clear 32k release, and run it easily.
We had to contact Dominique to get the last release, and get his standalone loader... to save a file in "p" file to run a compiled code.
Thanks for your quick reply.

Do you have a tool to convert back and forth between .Z81 and .P?
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
XavSnap
Posts: 645
Joined: Sat May 10, 2008 4:23 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by XavSnap » Tue Jul 05, 2016 5:41 am

Hi Martin,

No, it's not just a Basic program!

There's 2 datas blocs :
-$4FFE to $5EE0 (3811b)
-$7FD4 to $8955 (2434b)

I tried to save both blocs in a A$ variable, but the data bloc is too long, and crash the basic monitor.

TODO:

Code: Select all

    10 DIM A$(6245)
    20 SAVE "LOADEr"
    25 STOP 
    30  REM [HEX:\
01,06,00,2A,10,40,09,11,\
F1,70,01,65,18,ED,B0,C9,\
21,F1,70,11,FE,4F,01,E3,\
0E,ED,B0,21,F0,70,11,F1,\
70,01,E3,0E,ED,B0,C9, ]
    40 RAND USR 16554
    50 CLEAR 
    60 RAND USR 16570
    70 RAND USR 21033
RUN it in the emulator.
PUT DATA MEMORY BLOC in A$, Bloc1 and Bloc2 =6245 b. (extracted from emulator)
LOAD IT, "9/25" it stop.
The A$ chain is ready (don't RUN it again, it will erase the A$ variable)

Line 30: (BLOCs transfers: LDIRs)

Code: Select all

#include "ZX81.sym" ; Load the symbol file.
; Move big bloc (6245b)
	LD BC,6
	LD HL,(RAM_VARS)
	ADD HL,BC
	LD DE,$70F1
	LD BC,6245
	LDIR
	RET
;Move first bloc from $70F1 TO $4FFE.(3811b)
	LD HL,$70F1
	LD DE,$4FFE
	LD BC,3811
	LDIR
;erase temp bloc (3811b)
	LD HL,$70F0
	LD DE,$70F1
	LD BC,3811
	LDIR
	RET
.end
Line 40 save A$ to $70F1
Line 50 release rooms to copy the first bloc to $4FFE (D_File and Basic variables)
Line 60 copy bloc1 to the lower location...
Line 70 launch the Forth program.

I can't reserve the RAM_TOP, due to the A$ length, it exceed the $4FFE memory offset!
...but something's wrong.
:mrgreen:
LOADER.P
(7.18 KiB) Downloaded 82 times

User avatar
mrtinb
Posts: 987
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by mrtinb » Wed Jul 06, 2016 10:33 am

XavSnap wrote:No, it's not just a Basic program!
Thank you for your description. I havn't tried it yet.

Thank you for your contact to Dominique, we are e-mailing about the source of the Forth implementation.

Great to see this software on my ZX81 one day. I think my ZX81's limitation of 16K RAM Pack is the show stopper now. :(

When the ZXblast is released this will no longer be the problem.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
mrtinb
Posts: 987
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by mrtinb » Sat Aug 20, 2016 5:16 pm

Hi :-)

I've loaded Toddy Forth 1.0, and typing the code below.

It freezes when entering the last line! Why? It can't be that I only have 16K. It says 10K free.

Code: Select all

HEX
: MIN OVER OVER > IF SWAP THEN DROP ;
: MAX OVER OVER < IF SWAP THEN DROP ;
5101 CONSTANT S0
5107 CONSTANT R0
E000 S0 [' ] (shift 1 graphics upper-left)
FFF0 R0 [' ] (shift 1 graphics upper-left)
80 CONSTANT B/LIN
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Moggy
Posts: 1798
Joined: Wed Jun 18, 2008 2:00 pm

Re: Toddy Forth - a new ZX81 forth implementation

Post by Moggy » Sat Aug 20, 2016 5:47 pm

mrtinb wrote:Hi :-)

I've loaded Toddy Forth 1.0, and typing the code below.

It freezes when entering the last line! Why? It can't be that I only have 16K. It says 10K free.

Code: Select all

HEX
: MIN OVER OVER > IF SWAP THEN DROP ;
: MAX OVER OVER < IF SWAP THEN DROP ;
5101 CONSTANT S0
5107 CONSTANT R0
E000 S0 [' ] (shift 1 graphics upper-left)
FFF0 R0 [' ] (shift 1 graphics upper-left)
80 CONSTANT B/LIN
I tried this on SZ-81 emulator typed ok no freeze and my toddy has only 6k free due to the compilation I use. The rest of your program is obviously missing what is it you are trying to achieve and what emulator are you running it on?

Also Toddy as far as I can recall only recognises 16k anyway so bigger mem packs not really useful but I will stand to be corrected on that.

User avatar
mrtinb
Posts: 987
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by mrtinb » Sat Aug 20, 2016 5:58 pm

I've tried it again in an emulator, with the same result.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
mrtinb
Posts: 987
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Toddy Forth - a new ZX81 forth implementation

Post by mrtinb » Sat Aug 20, 2016 6:06 pm

Moggy wrote:I tried this on SZ-81 emulator typed ok no freeze and my toddy has only 6k free due to the compilation I use. The rest of your program is obviously missing what is it you are trying to achieve and what emulator are you running it on?
It's a source editor I received from Dominique Contant. Toddy Forth does not include an editor.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply