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

From: ruud_at_baltissen.org
Date: Wed, 27 Oct 2021 21:21:10 +0200
Message-ID: <d9763b0b9c622db4cd73d3d4e5679fa7_at_baltissen.org>
Hallo allemaal,


Still busy writing my own BASIC that should run on my Commodore 
PC20-III, I stumbled in something strange, again. I was sure that the 
first two bytes of a BASIC line were the length of it. That worked fine 
for a long time until I loaded a real C64 program and tried to edit it. 
Seeing the values and checking on Internet I learned it were pointers to 
the next line. Or better (IMHO worse), it points to the zero end byte at 
the end of the line. Why is this all?

Using only the length and having to delete or insert a line, I only had 
to move a block of bytes and that was it. Now I have to correct the 
pointer in every line after every move as well. The C64 does do it: see 
the routine at $A533.
And why pointing to the zero end byte, why not to the start of the next 
line? Now I have to read this pointer and add one to it before I can use 
it.

So my question: what good is it? Or can I only blame mr. Bill Gates for 
this behaviour?


Met vriendelijke groet / kind regards, Ruud Baltissen
Received on 2021-10-27 22:00:02

Archive generated by hypermail 2.3.0.