Data Creator

Developer(s): Steve Gunhouse
Date: 1989
Type: Program
Platform(s): TS 2068

Turns any block of machine code in memory into a BASIC hex loader. RUN it, give the start and end addresses of the code, and a machine-code routine writes the bytes out as DATA lines of eight-byte hex strings, followed by DATA “END”; the program then DELETEs itself, leaving only the hex loader (lines 3 to 10) and the new DATA lines, ready to SAVE or MERGE with your own program. Add the line 2 CLEAR it reminds you of, with the right start address.

The original Data Creator appeared in ZX Computing, February 1986; this version was modified for the T/S 2068 by Steven V. Gunhouse, and uses the TS2068’s DELETE command. Its own machine code is carried in the same hex DATA format, in lines 9972 to 9998.

Published in Sinc-Link July-August 1989 (Data Creator from ZX Computing Modified for 2068).

Related Articles

Data Creator from the 2/86 issue of ZX Computing

Image Gallery

Source Code

1 REM Data Creator from 2/86 ZX Computing modified for T/S 2068 by Steven V. Gunhouse
2 CLEAR 64999: LET x=65000
3 CLS : PRINT AT 10,5;"Loading M/L ..."
4 LET a=10: LET b=11: LET c=12: LET d=13: LET e=14: LET f=15
5 READ a$: IF a$="END" THEN  GO TO 10
6 FOR n=1 TO 15 STEP 2: LET w=16*VAL a$(n)+VAL a$(n+1): POKE x,w: LET x=x+1: NEXT n
7 GO TO 5
10 CLEAR : REM Your program should start after this line
20 DELETE 9000,9998: REM The program will load itself, create the proper data, then delete everything not needed in the new program.
25 REM Including lines 20-100
30 INPUT "Start address? ";s
35 PRINT "Start Address: ";s
40 POKE 65000,s-256*INT (s/256): POKE 65001,INT (s/256)
50 INPUT "End address? ";e
55 PRINT '"  End Address: ";e
60 POKE 65002,e-256*INT (e/256): POKE 65003,INT (e/256)
70 RANDOMIZE USR 65004
80 PRINT ''"Remember:"'"You must add a line:"''"   2 CLEAR ";s-1;": LET X=";s
100 DELETE ,2: DELETE 20,100
9972 DATA "0000000021270F22"
9973 DATA "A7FE454CCDD61622"
9974 DATA "9FFE2AEAFDED5BE8"
9975 DATA "FDB7ED527DE60728"
9976 DATA "0E2AEAFD7DE6F86F"
9977 DATA "1108001922EAFD2A"
9978 DATA "EAFD2B22EAFDED5B"
9979 DATA "E8FDB7ED5222A1FE"
9980 DATA "21BCFE22A5FE3E08"
9981 DATA "32A3FE2AEAFD2B22"
9982 DATA "EAFD237E219EFE77"
9983 DATA "AFED6F47ED6F4FED"
9984 DATA "6F79FE0A3803C607"
9985 DATA "4F78FE0A3803C607"
9986 DATA "472AA5FE79C63077"
9987 DATA "2B78C630772B22A5"
9988 DATA "FE21A3FE3520C42A"
9989 DATA "9FFE011800CDBB12"
9990 DATA "21A7FE56235E1B73"
9991 DATA "2B72ED5B9FFE0118"
9992 DATA "00EDB02AA1FE1108"
9993 DATA "00B7ED52D225FEC9"
9994 DATA "0000000000000000"
9995 DATA "0000000000000000"
9996 DATA "001400E422000000"
9997 DATA "0000000000000000"
9998 DATA "0000000000220D00"
9999 DATA "END"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.