BASIC listing..

From: silverdr_at_wfmh.org.pl
Date: Fri, 7 Jun 2013 01:21:58 +0200
Message-Id: <04EC84EC-F16D-466B-AAB0-518784B6CFB4@wfmh.org.pl>
Normally CBM BASIC program consists of lines, which are represented as something like (pseudocode):

struct basicline
{
	int nextLinePointer;
	int lineNumber;
	unsigned char lineContent[];
	unsigned char eolMarker = \0;
}

When listing a program next lines are fetched until nextLinePointer points to 0x0000. Meaning there should be three consecutive \0s (one for the EOL marker and two to make BASIC stop looking further). One could argue whether this is efficient but it seems that some programs can actually use those two bytes for themselves. Example:

http://dl.dropboxusercontent.com/u/58002657/cbm/c64/nuvieplayer-v1.0.prg

where the nextLinePointer points directly to the starting address of ML code (LDY #$00) but BASIC still lists the stub properly. Does anyone (out of head) know why this works without confusing BASIC?

-- 
SD!
       Message was sent through the cbm-hackers mailing list
Received on 2013-06-07 00:00:09

Archive generated by hypermail 2.2.0.