[Coco] BASIC irony

John R. Hogerhuis jhoger at pobox.com
Thu Aug 12 19:07:05 EDT 2004


On the Model 100, ' is actually 3 bytes not two: $3A$8E$FF

Apparently it's different for Coco though?

Another bit of strangeness is ELSE which always gets a separator $3A in
front of it as well.

I am writing a Tandy Portable Disk Drive emulator for the Palm to be
used with Model 100 laptops ( http://bitchin100.com/dlpilot ). As a
convenience, it converts .BA files and .DO files to editable PalmDoc
.pdb files, and back again.

Have you started on the tokenizer? I haven't written that portion yet. I
guess an inefficient algorithm is simple, for each character, loop
through the token table and compare characters; if get a match then put
the token instead of just text. Otherwise just put the character as-is.

The exceptions are of course for :else and ' and ignore-to-EOLN handing
for REM.

Other strangeness in LIST comes with hidden high-numbered lines.

-- John.

On Thu, 2004-08-12 at 10:02, tim lindner wrote:
> I am in the process of writing a tokenizer/de-tokenizer for Boisy's CoCo
> Tools project and I have run accross something interesting.
> 
> Everyone knows that the apostrophe is a short cut for the REM keyword.
> The the irony is that the apostrophe is tokenized as two bytes where the
> REM keyword is tokenized as one.
> 
> BASIC changes the apostrophe to a colon-apostrophe. I would guess the
> interrupter can only handle an apostrophe at the beggining of a new
> statement.
> 
> During a LIST command BASIC drops the initial colon, so it is never
> displayed.
> 
> -- 
> tim lindner
> tlindner at ix.netcom.com




More information about the Coco mailing list