Re: Pointer at the start of a BASIC line: what good is it?

From: ruud_at_Baltissen.org
Date: Sun, 31 Oct 2021 15:19:11 +0100
Message-ID: <617EA5DF.14472.1E90A5DD_at_ruud.Baltissen.org>
Hallo Olaf,


> The text on the screen is first copied into the input buffer,...

Very well that you mentioned the buffer: if accepting larger lines, 
I have to increase the size of these as well.



Hallo patryk,

> So unless Ruud wants to build also a BASIC "screen editor"
> mimicking the C64 one's behaviour, I see no point/problem with
> lines longer than 80 chars. That is, until...

I have one that does mimick the behaviour of the C64: the moment the 
enter key is pressed the screen memory is read into a buffer and 
interpreted. Having a 80 char line means I don't have to deal with 
other lines.

> > There is probably a limit of 255 bytes somewhere though.
>
> ... which I can neither confirm nor deny as I simply don't
> remember whether I even tried to get over 255/256 bytes per
> BASIC line.

The pointer at the start of every base line doesn't limit the size. 
But IMHO one has to be practical. Using a Commodore I could use the 
screen memory directly as input for processing the line. 
Using a PC I first copy it to memory because so I can skip the 
attribute bytes. The longer the lines can be, the bigger buffer I 
need. I could skip that buffer by altering my "line-to-code" routine 
by reading directly from the screen: it just means skipping every 
other byte.
The encoded line has to placed in a buffer as well and its length 
certainly depends on the size of the BASIC line. 
Then another practicality: yesterday had this idea idea when to 
rebuild a loaded BASIC program: if the page of the pointer to the 
second line / EOP is not the same as the page where the program has 
been loaded, a rebuild is needed. So after loading a CBM program 
into memory ($0801 in my case), the progam will see a pointer like 
$04xx and therefore knows the program has to be rebuild. Having 
lines longer than 254 bytes means I will have pointers to the next 
page. I could adjust my routine but I prefer it to keep it simple 
for the moment: max 250 bytes. Let version 2 or 3 take care of even 
longer lines.
And even then there is this idea: load a CBM program from $0401 on 
and run it from there.

Anybody, question: what are the address for the VIC-20? IIRC it even 
depends on the memory configuration. Had a look for it but too many 
files to go through. TIA!


Hallo Marc,

> I think there is such a limit. ...

Good remark. But I'm using the SI register of the 8088 and that one 
is 16 bits: 64 KB is quite a lot :) 


Something else regarding the pointers: at this moment I limit a 
program to one segment, just to keep it simple for the moment. Using 
more segments means that a pointer can start counting from $00xx 
again, with the risk that a line starts at exactly $0000 by chance 
and thus having an unwanted end-of-program. Using the length-of-line 
bytes doesn't suffer this problem. But it isn't compatible with the 
original Commodore structure. One idea is using my own structure 
(again) for multiple-segment programs. Ideas are welcome!


--
   
Kind regards / Met vriendelijke groet, Ruud Baltissen
www.Baltissen.org
Received on 2021-10-31 16:00:03

Archive generated by hypermail 2.3.0.