Load files to any memory location without ZXpand

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

Load files to any memory location without ZXpand

Post by mrtinb »

Some storage devices like ZXpand can load a binary file to any location in memory. This is convenient when you want to load above RAMTOP, or load a machine code program to memory between 8k - 16k.

With help from the online emulator JSZeddy, you can create .P files that load to any location in memory.

For this example I will use Delphic Toolkit that need to be loaded to RAM at 8192.

Your binary data file has to be renamed to a .BIN file. JSZeddy emulator will treat this file extension differently. Remember to start the emulator by pressing ‘Start’ before uploading the file. Now select to upload the file with the file upload button. (This is named differently according to your browser.)

Image

The whole file is now imported as a REM statement in line 0.

Now you will add a few lines of BASIC that create an ML-program, to be saved along the data.

Replace the content of 'BASIC Notepad' with this program, and press 'Compile'.

Code: Select all

 10 REM XXXXXXXXXXXXXXXXXXXXXXX
 20 LET S=PEEK 16426*256+PEEK 16425-76
 30 LET NEWADDRESS=8192
 40 LET L=S-16514-6
 50 LET C$="218240110000010000EDB0C9"
 60 LET E=LEN C$/2
 70 FOR D=S TO S+E-1
 80 POKE D,16*CODE C$+CODE C$(2)-476
 90 LET C$=C$(3 TO )
100 NEXT D
110 POKE S+4,NEWADDRESS-(INT (NEWADDRESS/256)*256)
120 POKE S+5,INT (NEWADDRESS/256)
130 POKE S+7,L-(INT (L/256)*256)
140 POKE S+8,INT (L/256)
Change line 30 with the address the binary should be copied to.

RUN the program. The only thing changed now is the ML-program in line 10.

Delete line 30 to 140.

Add the BASIC line:

Code: Select all

150 RAND USR S
Now save program e.g. SAVE “DELTOOL"

The emulator has saved the program in the browser's local storage, and sent a hex output of the file to 'Hex Notepad'.

To create a .P file, copy the full content of 'Hex Notepad' and paste it into 'Paste the text you wish to hex decode here' on the Convert String homepage.

Select the tab 'Download file' in the bottom half of the page on Convert String homepage. Input filename for your .P file e.g. “deltool.p", and press the button ‘Hex Decode!’.

Image

The browser will ask you where to save the .P file.

This .P file can be loaded in any emulator or a real ZX81 that just has a tape drive. When the file is loaded you RUN. Now the binary content is at the specifiled location.

In our example the binary content is copied to 8192. You can start this software with RAND USR 8192.

Good luck sharing .P files that also works without a ZXpand.
Last edited by mrtinb on Sat Sep 21, 2019 11:27 am, edited 1 time in total.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: Load files to any memory location without ZXpand

Post by olofsen »

LET LIKES=LIKES+1 :)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Load files to any memory location without ZXpand

Post by XavSnap »

Thanks Martin.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Load files to any memory location without ZXpand

Post by mrtinb »

olofsen wrote: Sat Sep 21, 2019 9:19 am LET LIKES=LIKES+1 :)
Now there’s no excuse for not using your great emulator Olofsen.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Post Reply