[Coco] BASIC format questions

William Astle lost at l-w.ca
Mon Mar 13 14:39:47 EDT 2017


The 1Exx bits are, indeed, the address of the next line in the program. 
However, those addresses as stored in the file are not critical 
information. They are recalculated when a program is loaded. You can 
basically ignore them unless you're messing with the Color Basic 
interpreter itself. The only restriction is that they cannot be set to 
0000 since that will be interpreted as the end of the program. Any 
non-zero value in the program file will work just fine, even if it's all 
the same value.

In case I buried the lead there, both LOADM and CLOADM recalculate those 
next line address pointers after reading the program.

The start of the program can vary substantially depending on how many 
disk files are allowed, how much random file buffer space is allocated, 
and how many PMODE graphics pages are allocated. Or even the lack of 
disk basic.

On 2017-03-13 11:37 AM, RETRO Innovations wrote:
> 10 ? "H"
>
> 20 goto 10
>
>
> translates into:
>
>
> 1E 0A   00 0A  87  22 48 22 00
>         10     ?   "  H  "  EOL
> 1E 13   00 14  81 A5  31 30 00
>         20     go to  10    EOL
> 00 00
>
>
> I understand all the rest, but not the 1E0A and 1E13.  I mean, I
> understand what they mean (address of start of next line), but I am not
> sure what it is specifically pointing to?
>
>
> If I assume the second 1E is at memory location 1E0A, then 1E13 points
> to the 00 of the end of BASIC marker.  That would imply that BASIC
> starts at 1E01.  Am I right on that point?  Does that always hold true
> (Commodore, for one, moves the start of BASIC depending on various things)?
>
> I ask because I need to shift all of the addresses for interpreting. How
> do I know where the BASIC start is given an arbitrary BASIC file?
>
> Jim
>



More information about the Coco mailing list