[Coco] Tokenized Basic

William Astle lost at l-w.ca
Thu Mar 16 10:33:46 EDT 2017


On 2017-03-16 04:39 AM, farna at amc-mag.com wrote:
> My (maybe flawed) understanding was that those worked as shortcuts BECAUSE
> they were the tokens used by DECB. Maybe I'm wrong though... don't know
> any others and never tried to write code using the tokens themselves.
> Really no need, would need a cheat sheet to refer to or a lot to remember
> -- and BASIC will tokenize when saved anyway, so why go to the effort to
> remember them all? No real purpose for using tokens when writing code, the
> REM token/shortcut saves a little typing, but the others aren't used as
> much and would waste time remembering/refering to a sheet.

Your understanding is flawed. *All* tokens in DECB are non-typable (and 
technically non-printable) characters in the range of 128-255. Even if 
you were somehow able to type them, the "line input" routine in the ROM 
masks off bit 7 so those characters would not come through anyway. Thus, 
there is no possible way to enter tokens directly.

? is an explicit shortcut for PRINT and has special handling in the 
tokenization routine. ' is a variation on REM but is NOT a shortcut for 
it. As I noted in a previous message, it has slightly different 
semantics. (It carries an invisible colon and, thus, encodes to two 
bytes instead of one byte for REM and also does not need a preceding 
colon when used at the end of a line.)

' has its own token which is distinct from REM. ? is an actual shortcut 
for typing PRINT.


More information about the Coco mailing list