Page 1 of 2

CONTINUE command

Posted: Sat May 13, 2017 4:17 pm
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.

Re: CONTINUE command

Posted: Sat May 13, 2017 5:10 pm
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!

Re: CONTINUE command

Posted: Sat May 13, 2017 5:46 pm
by PokeMon
I use mostly just RUN.

Code: Select all

1 PRINT "+";
2 RUN

Re: CONTINUE command

Posted: Sat May 13, 2017 10:52 pm
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.

Re: CONTINUE command

Posted: Sat May 13, 2017 11:09 pm
by Paul
What do you think about GOTO A?
A single character variable is shortest possible.

Re: CONTINUE command

Posted: Sun May 14, 2017 12:21 am
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

Re: CONTINUE command

Posted: Sun May 14, 2017 2:16 am
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 ???

Re: CONTINUE command

Posted: Sun May 14, 2017 6:51 am
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

Re: CONTINUE command

Posted: Sun May 14, 2017 12:17 pm
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.

Re: CONTINUE command

Posted: Sun May 14, 2017 2:06 pm
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