CONTINUE command

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

CONTINUE command

Post by Shaun_B » Sat May 13, 2017 3:17 pm

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.

User avatar
sirmorris
Posts: 2667
Joined: Thu May 08, 2008 4:45 pm
Location: oxon, uk

Re: CONTINUE command

Post by sirmorris » Sat May 13, 2017 4:10 pm

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!
--=== ZXpand+ ... A more moderner all-in-one upgrade solution for ZX81 ===--
* SD/MMC storage * 32K Hires-capable RAM * AY sound chip * Joystick port * Serial *
* BASIC enhancements - plug & play * Reset button * Auto-boot facility *

User avatar
PokeMon
Posts: 2137
Joined: Sat Sep 17, 2011 5:48 pm

Re: CONTINUE command

Post by PokeMon » Sat May 13, 2017 4:46 pm

I use mostly just RUN.

Code: Select all

1 PRINT "+";
2 RUN

Shaun_B
Posts: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: CONTINUE command

Post by Shaun_B » Sat May 13, 2017 9:52 pm

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: 860
Joined: Thu May 27, 2010 7:15 am
Location: Germanys west end

Re: CONTINUE command

Post by Paul » Sat May 13, 2017 10:09 pm

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: 34
Joined: Sun May 11, 2008 10:14 pm
Location: Germany Wuppertal
Contact:

Re: CONTINUE command

Post by Math123 » Sat May 13, 2017 11:21 pm

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: 2137
Joined: Sat Sep 17, 2011 5:48 pm

Re: CONTINUE command

Post by PokeMon » Sun May 14, 2017 1:16 am

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: 860
Joined: Thu May 27, 2010 7:15 am
Location: Germanys west end

Re: CONTINUE command

Post by Paul » Sun May 14, 2017 5:51 am

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: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: CONTINUE command

Post by Shaun_B » Sun May 14, 2017 11:17 am

Paul wrote:
Sat May 13, 2017 10: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: 2137
Joined: Sat Sep 17, 2011 5:48 pm

Re: CONTINUE command

Post by PokeMon » Sun May 14, 2017 1:06 pm

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

Who is online

Users browsing this forum: No registered users and 1 guest