Help using ZXTK from BugByte

Discussion about ZX80 / ZX81 Software
Post Reply
User avatar
mrtinb
Posts: 1043
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Help using ZXTK from BugByte

Post by mrtinb » Mon Feb 13, 2017 5:01 pm

The manual states:
Adding ZXTK to an existing program.
1. Load ZXTK
2. Set RAMTOP so that there is at least 2K of space above it.
3. EXTRT lines 1 to 3 above RAMTOP.
4. Load existing program.
5. RAND USR (RAMTOP = 1234). First check that this is location contains 205.

This will place lines 1 to 3 in the front of your program for normal use. Step 5 uses relocatable code in MERGE and is the only function which will operate in this position. Your existing program should not have any lines containing GOTO 1, 2 or 3.
Has anyone used ZXTK? I think there's a error in the manual in step 5. Maybe it should be RAMTOP + 1234, or RAMTOP - 1234? What ever I calculate there is not 205 in that position.

I'll look further into a memory dump, and see the places with 205=$CD=CALL.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
siggi
Posts: 882
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: Help using ZXTK from BugByte

Post by siggi » Tue Feb 14, 2017 9:24 am

If you cannot find a solution: maybe you could use TOOLKIT or TOOLK64 instead?
It runs above RAMTOP (16 k Zeddies) or in ram starting at 8K. Thus it does not need to be "merged" into basic program to be used:

http://www.zx81.de/soft/_main_d.htm

Code: Select all

ZX-TOOLKIT 
instructions in brief

                                                        http://www.zx81.de

First load TOOLKIT or TOOLK64. Both use about 2300 bytes of memory.
TOOLKIT needs a ZX81 with 16K-RAM and will be copied under RAMTOP and then 
RAMTOP will be lowered.
TOOLK64 will be copied in the region 14 - 16K. You must have RAM there.
Both programms will run under ZX81 emulator XTender on a DOS-PC.

Then load your ZX81 programm you want to work with.

Call the functions with RAND USR address or RAND USR variable

variable     address for
          16K  /  64K   version

         30506 / 14122  will define the names of the following variables

RENUM    30524 / 14140  will renumber the whole BASIC-Program
                        you are asked to enter START line and STEP, 
                        even GOSUB and GOTO line-number will be changed

DEL      31155 / 14771  deletes from START to END line number 

MEM      31850 / 15466  shows the memory available

DUMP     31532 / 15148  lists the names of all defined variables and strings (no arrays)

FIND     31233 / 14849  finds strings, to find keywords use THEN keyword, 
                        then delete THEN

REPLACE  31751 / 15367  like FIND, but cannot replace numbers

REMKILL  31062 / 14678  deletes all REM-lines

SAVE     31273 / 14889  saves the BASIC program below RAMTOP 
                        (high line-numbers!!!)

                        then LOAD the second BASIC-program (low line-numbers)

APPEND   31385 / 15001  copies the first loaded BASIC-programm just behind the second one

My ZX81 web-server: online since 2007
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
PokeMon
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: Help using ZXTK from BugByte

Post by PokeMon » Tue Feb 14, 2017 10:50 am

mrtinb wrote: Has anyone used ZXTK? I think there's a error in the manual in step 5. Maybe it should be RAMTOP + 1234, or RAMTOP - 1234? What ever I calculate there is not 205 in that position.

I'll look further into a memory dump, and see the places with 205=$CD=CALL.
I think you should just use the new RAMTOP value. 1234 should only state that a number is needed and not the word RAMTOP. Anyway it would be hard to find out a place in memory containing 205. There could be many places ...

User avatar
blittled
Posts: 177
Joined: Fri Dec 19, 2008 3:04 am
Location: Northwestern Pennsylvania, USA

Re: Help using ZXTK from BugByte

Post by blittled » Tue Feb 14, 2017 2:54 pm

I think RAMTOP=1234 is just an example. Try peeking at the RAMTOP value you set at step 2 to see if it is 205. I believe that ZXTK may generate the code it needs starting at RAMPTOP so it doesn't corrupt the current program.

OOPS... I see PokeMon said the same thing :)
2X Timex Sinclair 1000, ZX81, ZX80Core, 5X 16K Ram Pack, ZXBlast, ZX P file to Ear Input Signal Converter, Elf II

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

Re: Help using ZXTK from BugByte

Post by mrtinb » Tue Feb 14, 2017 3:13 pm

mrtinb wrote:5. RAND USR (RAMTOP = 1234). First check that this is location contains 205.
The manual should have said: 5. RAND USR (RAMTOP + 1234).

My mistake was that I forgot NEW after setting RAMTOP 2K down.

It works if I set RAMTOP to 120*256, and when the MERGE is needed you run RAND USR 120*256+1234.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply