CONTINUE command

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

CONTINUE command

Post by Shaun_B »

Hi guys,

Consider this symbolic listing:

Code: Select all

1 PRINT "ZX80";
2 CONTINUE
I'm wondering if there is a way in ZX80 BASIC to manipulate the CONTINUE memory value to point always to one line number, hence having a one-byte GO TO statement?

Thanks,

Shaun.
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: CONTINUE command

Post by sirmorris »

Interesting idea but I suspect the CONT address is updated by the interpreter as it runs.Worth investigating though. An hour with EO should do it!
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: CONTINUE command

Post by PokeMon »

I use mostly just RUN.

Code: Select all

1 PRINT "+";
2 RUN
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: CONTINUE command

Post by Shaun_B »

RUN is fine if you want to go to the first line of your ZX80 program - however, what if you GO TO a particular line quite often that isn't the first line, and want to save some bytes? Could CONTINUE be used in this instance (i.e., POKE a value to some mem location and then use CONTINUE to GO TO that without using GO TO)

Thanks,

Shaun.
User avatar
Paul
Posts: 1506
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: CONTINUE command

Post by Paul »

What do you think about GOTO A?
A single character variable is shortest possible.
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
Math123
Posts: 44
Joined: Sun May 11, 2008 11:14 pm
Location: Germany Wuppertal
Contact:

Re: CONTINUE command

Post by Math123 »

As the handbook tells:
16427 OLDPPC Line number of which CONT jumps.

POKE 16427 line number lowbyte and
POKE 16428 line number high byte

then you can use CONT
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: CONTINUE command

Post by PokeMon »

Yes - but this all make no sense for a ZX80 which has no floating point values but char values only.
Keep the church in the village as we say in Germany.
GO TO 5 need same space as GOTO A while A will take additional space for its value.
So how want you POKE system variables and what would be the use if this need more space than a simple GO TO 8 ???
User avatar
Paul
Posts: 1506
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: CONTINUE command

Post by Paul »

I didn't recall that on ZX80 the value isn't stored after the value. I guessed it was two bytes instead of five.
So GOTO A or GOSUB A will save Space only if the Value of A is larger than 9. LET A = 9000 for example.
On a ZX81 it will save 5 more bytes for the floatingpoint value.
While RUN will clear all Variables. This can be hazardous.
Kind regards Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: CONTINUE command

Post by Shaun_B »

Paul wrote: Sat May 13, 2017 11:09 pm What do you think about GOTO A?
A single character variable is shortest possible.
GOTO A would be two bytes, wouldn't it? Whereas CONTINUE would be one byte.

It therefore is down to the overheads of how you manipulate the CONTINUE pointer as to a GOTO A.

Regards,

Shaun.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: CONTINUE command

Post by PokeMon »

Yes but what do you do with a saved byte only and how many bytes do you need to manipulate the CONTINUE target ?
This is all theoretical with no practice relevance and by the way, using GOTO A needs also a variable entry with 5 bytes ... :P
Post Reply