[Coco] BAS binary format

William Astle lost at l-w.ca
Wed Nov 6 17:52:26 EST 2013


On 2013-11-06 15:48, Johann Klasek wrote:
> To my surprise - although MS based Basic interpreters I know of do not -
> you are right. The reason could be that Color BASIC does not allow to
> generate characters of code >= 128. I could verify this by poking the
> token code into the Basic program which is expanded by LIST later on.

The detokenization routine is very simple. Since it's impossible to 
introduce non ascii characters into the program without messing about 
with POKE or other nonsense, there was no need to handle that case.
> A comment which is introduced with a tick (') is represented in binary
> by $3A $83. The tokenizer implicitly inserts a ":" before the '-Token
> and LIST suppresses this ":" ...
> However, the output is not wrong if "'" would be shown as ":'". The
> Basic code remains valid, but successive conversions back and forth
> would lead to a growth of ":". ;)

Same thing applies for ELSE as well. It has a : added before it which 
should be suppressed on output.





More information about the Coco mailing list