Hello,
First post here and new to coding in ZX BASIC (using a ZX NEXT KS2).
I've worked through Rich(ard) Stals 'Beginner's Step by step ZX Spectrum Coding Course' and barring the odd typo everything has worked.
I've entered the final full program, 'invaders' and checked through the code twice for type-in errors but when running the program I get the following error message after the instruction screen:
E Out of DATA, 8530: 1 (see attached)
I cannot see any errors in this line and have tried the code independently from the main program and the graphics appear without error.
Attaching the code if anyone can help trouble-shoot.•••cannot attach z80 file?
Next up Gary Plowman's 'ZX Spectrum Games Code Club'!
Best,
Jason
Richard Stals Beginner's Step by step ZX Spectrum Coding Course
-
- Posts: 16
- Joined: Mon Jul 22, 2024 7:29 pm
- 1024MAK
- Posts: 5527
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course
Hello Jason
Welcome
I’ve moved your first post to this (ZX Spectrum BASIC) section of the forum.
To attach a Z80 snapshot file, you will have to compress it into a zip file. Then attach that.
As to the error, are there any READ keywords elsewhere in the program? The error report is saying that it cannot find any more data, this can occur if some of the data in the program snippet you posted has already been read by a READ earlier.
Or a RESTORE keyword has been left out or used incorrectly elsewhere.
Mark
Welcome

I’ve moved your first post to this (ZX Spectrum BASIC) section of the forum.
To attach a Z80 snapshot file, you will have to compress it into a zip file. Then attach that.
As to the error, are there any READ keywords elsewhere in the program? The error report is saying that it cannot find any more data, this can occur if some of the data in the program snippet you posted has already been read by a READ earlier.
Or a RESTORE keyword has been left out or used incorrectly elsewhere.
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...
-
- Posts: 16
- Joined: Mon Jul 22, 2024 7:29 pm
Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course
Thanks Mark for the speedy reply. Will check the listing for another read command but have zipped and attached the code as suggested!
- Attachments
-
- INVADERS.z80.zip
- (5.78 KiB) Downloaded 354 times
Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course
Hi Jason,
Better to type-ins the listing in text, to copy/paste the code...
Reload the Tap/TZX file to debugg it.
Include, my updated "Zmakebas" win32/64: The "invaders" BASIC text : ("Zmakebas" old release w32 -TZX not supported) BASIC codes extracted from EO>BASIC LISTING>SAVE.
Have a look to the 1120 PLAY "" line... something's wrong
Is better.
The DATA pointer is set to the "RESTORE 0" if the program is loaded.
But if you had to restart the program, this counter point to the last DATA value (end of DATA offset).
The READ value is out of the DATA rang.
You had to reload the program to reset the DATA pointer, or use "RESTORE 0"/"RESTORE (first DATA line)" to reinit this pointer.
Have fun.
Better to type-ins the listing in text, to copy/paste the code...
Reload the Tap/TZX file to debugg it.
Include, my updated "Zmakebas" win32/64: The "invaders" BASIC text : ("Zmakebas" old release w32 -TZX not supported) BASIC codes extracted from EO>BASIC LISTING>SAVE.
Have a look to the 1120 PLAY "" line... something's wrong
Code: Select all
8520 RESTORE 8560:FOR n=0 TO 39:READ c:POKE s+n,c:NEXT n
The DATA pointer is set to the "RESTORE 0" if the program is loaded.
But if you had to restart the program, this counter point to the last DATA value (end of DATA offset).
The READ value is out of the DATA rang.
You had to reload the program to reset the DATA pointer, or use "RESTORE 0"/"RESTORE (first DATA line)" to reinit this pointer.
Have fun.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
- 1024MAK
- Posts: 5527
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course
Err, RUN does a RESTORE 0 ...
Mark
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...
-
- Posts: 16
- Joined: Mon Jul 22, 2024 7:29 pm
Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course
I'm working on the Next so not sure how to copy and paste the text from there which is why I included the z80 file of the listing.
Still learnt quite a lot from all the sub routines so might just move onto my next listing!
Thanks all
Still learnt quite a lot from all the sub routines so might just move onto my next listing!
Thanks all
Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course
from :https://wiki.specnext.dev/FAQWhat classic files can I load on my Next?
The Next supports NEXs, TAPs (preferred for classic software), SNAs, DSKs, Z80s, SNXs which can be loaded from the browser menu by selecting them with the cursor keys and ENTER (or a joystick and Fire) -OR- by using the SPECTRUM command. (See Chapter 20 in the manual for details). Place the files on your SD card and pick from the Browser.
Change the text file, compile it in a TAP file, then load it on the SDcard as a TAP file.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)