Login
Back to forumReply to this topicGo to last reply

Posted By

Luca
on 2017-01-31
04:19:51
 [BASIC] Maximum characters per line

Few days ago, Davide Fichera (Naufr4g0) has twitted a C64 screenshot displaying his quite nice BASIC Tenliners 2017 attempt to the classic GORILLA.BAS game. Of course, I haven't been able to hold me from trying it on Plus/4 too.
Ok, I typed it in and it perfectly worked, but I've been forced to split the very long line 7 in two lines, 'coz it was 130 characters long. 130! Even with all the abbreviations you can use, it's absolutely impossible to achieve a 130 characters long BASIC line on a real C64, due to the interpreter's limitations!



Davide has explained it this way:"If you use a cross-development IDE you can write up to about 254 bytes per line. (a command takes up only 1 byte)". Of course, this forces both C64 (80 chars per line) and Plus/4 (88 chars per line) limitations. But hey, once the line is in, the machine runs it flawlessly, so the real limit seems to be just the code designated to insert the single lines. Am I right on all this, or there's something I'm missing here?

EDIT: after some give&take on Twitter, Davide got success in confusing me with this double twit:
"emulators and the Real hardware make no difference. Let's try a windows IDE for cross develop like CBMPrgStudio to bypass limit".
Mh, so a limit on the real hardware does exist, in the very end...

Posted By

siz
on 2017-01-31
05:43:59
 Re: [BASIC] Maximum characters per line

It's the limitation of the keyboard buffer, not BASIC itself. So if you enter a BASIC line in memory (as Davide wrote) you can run it. But you can't enter it from the standard BASIC editor input.

Posted By

Litwr
on 2017-01-31
05:51:30
 Re: [BASIC] Maximum characters per line

I am using a plain text editor and then PETCAT utility from VICE emulator. It allows to avoid the problems.

Posted By

Luca
on 2017-01-31
06:05:35
 Re: [BASIC] Maximum characters per line

Yes, of course I realized it in the end. The thing that puzzled me is: you' would never have been able to do that with the real hardware alone, am I right? By this point of view, "emulators" (includes crosscoding in general, generically using external editors) and real hardware make difference. Very fruitful case study indeed, now the competition categories make sense to me too :)

Posted By

Csabo
on 2017-01-31
08:21:03
 Re: [BASIC] Maximum characters per line

"You would never have been table to do that..." By "that" you mean create a BASIC line that is longer than what the keyboard buffer allows? This can definitely be done on the real hardware as well. It's just a lot more work, since you must link the BASIC line pointers yourself, and edit some of the BASIC tokens, all in monitor.

Posted By

Luca
on 2017-01-31
08:43:16
 Re: [BASIC] Maximum characters per line

Just trying to do that right now, only to see if that's possible, and it's exactly like you said: a lot more work.

Posted By

SVS
on 2017-01-31
10:29:55
 Re: [BASIC] Maximum characters per line

Just to complete the info. CBM-prg-Studio, in +4 setting, does allow Basic lines more than 255 characters long. Me too I'm coding a source with these features. Austrospeed compiler has no problem with them because it read the lines from disk, byte by byte.

The point is: Despite this, is the interpreter able to parse a so long line? Actually there are some limitations in the Basic syntax, and more in the math formulae (parenthesis levels). This one is the real limit.

Posted By

Gaia
on 2017-01-31
13:35:37
 Re: [BASIC] Maximum characters per line

There was a magazine article somewhere with some code that allowed bypassing the stupid input buffer character limit and have actually 256 byte long BASIC lines even in the old days.

Posted By

JamesC
on 2017-01-31
14:11:03
 Re: [BASIC] Maximum characters per line

The BASIC interpreter in the Plus/4 (as well as the 64 and 128) can handle tokenized line lengths up to 255 bytes. The 256th byte is $00, the end-of-line marker.

On a 128, string together a bunch of ?: commands to reach 160 characters (the size of the 128's keyboard buffer). Save it to disk, move it to the Plus/4, run it. It WILL run, you can even LIST it. You simply can't edit the line, because it's longer than the keyboard buffer.

Posted By

Luca
on 2017-02-02
02:24:25
 Re: [BASIC] Maximum characters per line

RĂ¼diger added Graphic Show into the archive, let's list the BASIC code into it: Ingo Sabel maximized the line buffer for sure wink



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024