Is there any use for CONT (or CONTINUE for ZX Spectrum) inside a BASIC program?
CONT inside programs works different in e.g. ZX81/ZX Spectrum vs VIC20/C64.
I know that CONT is useful on the command line.
CONT
Suppose p/q was the last report with a non-zero. Then CONT has
the effect GOTO q if p <> 9, GOTO q+1 if p = 9 (STOP statement)
(Vickers 1981)
CONT or CONTINUE in BASIC programs
CONT or CONTINUE in BASIC programs
Started w/ BASIC on ABC80 & ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://www.youtube.com/user/MOBiL4u/ https://twitter.com/mobluse/
Re: CONT or CONTINUE in BASIC programs
Hi MOB-i-L,
The CONT can't be used to store machine code, but can be followed by a zero bloc.
CONT in a programme is like a REM
CONT don't use the NXT_LINE BASIC variable.
CONT don't use the ADD_CHAR variable.
I tried to use CONT to jump to a line, but i haven't found the good process.
It should retrieve the last stack used in the BASIC ROM, but it can't be use with the BASIC monitor...
The CONT can't be used to store machine code, but can be followed by a zero bloc.
CONT in a programme is like a REM
CONT don't use the NXT_LINE BASIC variable.
CONT don't use the ADD_CHAR variable.
I tried to use CONT to jump to a line, but i haven't found the good process.
It should retrieve the last stack used in the BASIC ROM, but it can't be use with the BASIC monitor...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: CONT or CONTINUE in BASIC programs
I don't agree to that because CONT is like GOTO last executed line unless STOP because then GOTO last executed line +1.CONT in a programme is like a REM
In this program you RUN and then press CONT and then SPACE/BREAK key, then CONT again and BREAK etc. You can also try RUN 75 and then press CONT for an infinite loop.
Code: Select all
5 STOP
10 PRINT "1";
20 PRINT "2";
30 PRINT "3";
40 PRINT "4";
50 PRINT "5";
60 PRINT "6";
70 CONT
75 STOP
80 CONT
100 FOR I=1 TO 24
110 SCROLL
120 NEXT I
130 SAVE "DICE"
140 RUN
- Attachments
-
- dice.p
- (364 Bytes) Downloaded 104 times
Started w/ BASIC on ABC80 & ZX81 then Forth, Z80… http://scratch.mit.edu/users/mobluse/ https://www.youtube.com/user/MOBiL4u/ https://twitter.com/mobluse/
Re: CONT or CONTINUE in BASIC programs
Hi MOB-i-L,
Yes, it's a weird behavior...
It loops to the last error or break point.
Or...
Loop drived with the ERR_SP value...
Yes, it's a weird behavior...
It loops to the last error or break point.
Or...
Code: Select all
1 POKE 16384,08
2 POKE 16391,20
10 PRINT "1";
20 PRINT "2";
30 PRINT "3";
40 PRINT "4";
50 PRINT "5";
60 PRINT "6";
70 CONT
Code: Select all
10 PRINT "1";
20 PRINT "2";
25 POKE 16384,8
30 PRINT "3";
40 PRINT "4";
50 PRINT "5";
60 PRINT "6";
80 CONT
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: CONT or CONTINUE in BASIC programs
If anyone's still interested, this is something I asked towards the end of last year's CSSCGC, and Andy Jenkinson came up with the goods.
High/Low Continue showed how CONTINUE, in combination with poking a couple of system variables, can be used to jump to a specific statement in a multi-statement line on the Spectrum. Andy's program made sure that the entire "game" was packed into a single line of BASIC with a double-digit number of colons.
This obviously limits its use on the ZX81, but I wrote my own conversion of the program anyway, so that poking the one required system variable followed by CONTINUE will execute a GOTO, in a rather roundabout way.
High/Low Continue showed how CONTINUE, in combination with poking a couple of system variables, can be used to jump to a specific statement in a multi-statement line on the Spectrum. Andy's program made sure that the entire "game" was packed into a single line of BASIC with a double-digit number of colons.
This obviously limits its use on the ZX81, but I wrote my own conversion of the program anyway, so that poking the one required system variable followed by CONTINUE will execute a GOTO, in a rather roundabout way.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!