Richard Stals Beginner's Step by step ZX Spectrum Coding Course

Post Reply
rinwaldmolly
Posts: 16
Joined: Mon Jul 22, 2024 7:29 pm

Richard Stals Beginner's Step by step ZX Spectrum Coding Course

Post by rinwaldmolly »

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
Attachments
IMG_1915.JPG
IMG_1914.JPG
IMG_1913.JPG
User avatar
1024MAK
Posts: 5526
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

Post by 1024MAK »

Hello Jason

Welcome :D

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...
rinwaldmolly
Posts: 16
Joined: Mon Jul 22, 2024 7:29 pm

Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course

Post by rinwaldmolly »

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 353 times
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course

Post by XavSnap »

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:
zmakebas-1.1.zip
(236.51 KiB) Downloaded 368 times
The "invaders" BASIC text : ("Zmakebas" old release w32 -TZX not supported)
Invaders.zip
(35.83 KiB) Downloaded 361 times
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
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.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
1024MAK
Posts: 5526
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

Post by 1024MAK »

Err, RUN does a RESTORE 0 ...

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...
rinwaldmolly
Posts: 16
Joined: Mon Jul 22, 2024 7:29 pm

Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course

Post by rinwaldmolly »

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
User avatar
XavSnap
Posts: 2193
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.
Contact:

Re: Richard Stals Beginner's Step by step ZX Spectrum Coding Course

Post by XavSnap »

What 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.
from :https://wiki.specnext.dev/FAQ

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)
Post Reply