Page 1 of 1

T2P.EXE

Posted: Thu Apr 01, 2021 4:08 pm
by Math123
I made T2P.EXE which is a new version of the ZXtext2P.EXE program.
It lets you write ZX81 Basic files with a text editor on your PC and translate it to a P-file.
This new version has a lot of corrections and a number of surprising additions.

First of all there is no need to select lable-mode or number-mode any more. This is done automaticly.
You can write line numbers or leave it. And you can have labels as well. You can reference a label then
as its line number or as its address in memory.

The second big thing is that you can write your source Basic-program as a batch file that will
call T2P.EXE itself when startet. So write the text as batch. Just start it. It will translate and even start
EightyOne (or any other program) with the created P-file. (The simple text file mode is still available)

Just an example of such a batch file:

Code: Select all

@echo off
t2p %0
if errorlevel 1 echo &pause&goto END
start %~n0.p
:END
exit

#AUTOSTART=1

@Start:
        print "demo2"

100     for x=1 to 3
          print x
        next x

        goto @Start
The lines above "exit" are for the batch. The lines after "exit" are for T2P.EXE.
Here we have a label "@Start" and later a line number "100". And some lines without any of them.

All this can be found on my site http://www.swatosch.de/zx81 with downloadable demos and documentation in German and English and a video showing how to start with T2P.EXE.

enjoy
Matthias

Re: T2P.EXE

Posted: Thu Apr 01, 2021 7:33 pm
by zx81ultra
Hello,

Really great, I saw the video, Thank You.

Just curious, in which language is T2P written ?

Re: T2P.EXE

Posted: Thu Apr 01, 2021 8:11 pm
by Math123
Like the old version http://freestuff.grok.co.uk/zxtext2p/index.html written in C.

Re: T2P.EXE

Posted: Fri Apr 02, 2021 6:03 am
by XavSnap
Win32 DOS original/old release (recompiled) by Chris Cowley for W10 compatibility:
zxtext2p.zip
(36.33 KiB) Downloaded 201 times

Re: T2P.EXE

Posted: Mon Apr 05, 2021 5:51 pm
by zx81ultra
Do you think it can be recompiled for OSX ?

Re: T2P.EXE

Posted: Mon Apr 05, 2021 6:48 pm
by Math123
Sure. Just try the original sources.
I will publish my source file shortly. Just need to do some errorfixing...

Re: T2P.EXE

Posted: Sat Jul 17, 2021 6:57 pm
by zx81ultra
Hello,

I tried the following code with T2P:

10 LET A$="COS 1"
20 LET B=VAL A$
30 PRINT B

I get a 2/20 error code when run. If I type the program with the ZX81 keyboard it runs OK. Is there a way to tell T2P that the COS text has to be treated as a function ?

best regards

Re: T2P.EXE

Posted: Mon Jul 19, 2021 7:04 am
by Math123
In Strings and Rem-Lines t2p pretends to interpret any text as simple letters. Using the hexvalue of the wanted token is the clue.

As the ZX81 manual tells the code of COS is C8.
So this should work:
10 LET A$="\c8 1"

Re: T2P.EXE

Posted: Mon Jul 19, 2021 5:54 pm
by zx81ultra
Excellent, thank you !

Re: T2P.EXE

Posted: Wed Jul 21, 2021 4:35 pm
by Math123
On the other hand if you would like to have a variable with name COS or any other keyword-like name then you can use the "Ghost"- character "|" to prevent t2p from detecting the keyword.

To get:
10 LET COS = 33
20 PRINT COS COS

enter:
10 LET C|OS = 33
20 PRINT COS CO|S

t2p ignores the "|" in the translation.