Github repository w/ ZX81 BASIC-programs

Discussion about ZX80 / ZX81 Software
Post Reply
MOB-i-L
Posts: 43
Joined: Mon Apr 19, 2010 12:13 am
Location: Lund, Skåne/Scania, Sweden
Contact:

Github repository w/ ZX81 BASIC-programs

Post by MOB-i-L »

I have made a Github-repository for my ZX81-programs:
https://github.com/mobluse/zx81-mob

Since Github prefers text-files I converted them to ZXText2P-format using a modified version of p2txt that is also in the same repository. There are also some ported programs from More BASIC Computer Games edited by David H. Ahl, published 1979.

More programs and p-files are here:
http://www.df.lth.se.orbin.se/~mikaelb/sinclair/zx81/

I was thinking of improving p2txt further by showing not used characters as hex-codes and use hex-codes for the **-operator and all keywords and functions in REM-statements, e.g. \C4 is CODE in a REM-statement. Then I first have to change ZXText2P so that it can handle this. This would make it possible to convert more programs from bas- to p-files. Any opinions about this?

olofsen
Posts: 172
Joined: Wed Jan 08, 2014 12:29 pm

Re: Github repository w/ ZX81 BASIC-programs

Post by olofsen »

Has a "zxml" format been suggested before perhaps? With entities such as &input; and hex codes preceded as usual with hash, so something around

Code: Select all

<sysvars>
...
</sysvars>
<program>
<lineno>10</lineno><statement>&rem;#c9/statement>
<lineno>20</lineno><statement>&rand;&usr;#4082</statement>
</program>
<display>
...
</display>
<vars>
...
</vars>

sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Github repository w/ ZX81 BASIC-programs

Post by sirmorris »

Perhaps you could routinely encode all REM statements which contain non-alphanumerics as hex streams. It would be neater, maybe.

Forget XML. Just my 2€ worth.

MOB-i-L
Posts: 43
Joined: Mon Apr 19, 2010 12:13 am
Location: Lund, Skåne/Scania, Sweden
Contact:

Re: Github repository w/ ZX81 BASIC-programs

Post by MOB-i-L »

sirmorris wrote:Perhaps you could routinely encode all REM statements which contain non-alphanumerics as hex streams. It would be neater, maybe.

Forget XML. Just my 2€ worth.
I agree to that XML would not be very suitable for Github since one wants the files in an easily editable text-format. One could have REM:s with hex-streams e.g.:
1 REM \*2A0C40C9
1 REM [HEX: 2A,0C,40,C9]
(The second notation comes from ZxToken.zip.)

If one wants to mix hex and ordinary code:
1 REM \2A\0C\40\C9 LD HL,(D_FILE);RET
1 REM \*2A0C40C9*\ LD HL,(D_FILE);RET
1 REM [HEX: 2A,0C,40,C9] LD HL,(D_FILE);RET

The system variables are constructed by ZXText2P. If one has a program that has non-typical system-variables one could in a future version of ZXText2P load the content of REM-statements to those addresses using negative line numbers and have the address after @, e.g.
-10 REM @403C \*2A0C40C9
-10 REM @403C [HEX: 2A,0C,40,C9]
or
-10 REM @403C \2A\0C\40\C9

If one wanted to add to the display or variables area one could add REM-statements after the BASIC-program using line numbers with plus:
+10000 REM @D_FILE \*2A0C40C9
+10000 REM @D_FILE [HEX: 2A,0C,40,C9]
+10010 REM @VARS \*2A0C40C9
+10010 REM @VARS [HEX: 2A,0C,40,C9]
+10020 REM @VARS+5*4 \*2A0C40C9
+10020 REM @VARS+5*4 [HEX: 2A,0C,40,C9]

Post Reply