[Coco] (No subject)

William Astle lost at l-w.ca
Thu Jul 14 14:28:21 EDT 2022


On 2022-07-14 11:57, Allen Huffman via Coco wrote:
> Intereresting. This means on the CoCo 3, it’s temporarily overwriting the first byte in "ROM" at $8000 (32768) and then fixes it back. That's the "EX" bytes you mentioned.
> 
> Interesting, since it already knows the length of the string, but uses LBD12 to "convert an ASCII string to floating point." Somewhere there is that NUL check, but I haven’t gotten that far yet.

The generic parser will stop when it gets to something it doesn't 
understand. However, if the entire string is something it does 
understand, it needs something to make it stop to avoid mysterious 
results. (Like the string stored after also starting with digits or 
something.) A NUL would do that.

The reason: program lines end with a NUL. That's how the interpreter 
knows to go to the next line. The interpreter doesn't work off "pointer 
+ length" for program code interpretation; it's just a bag of bytes in 
sequence.


More information about the Coco mailing list