[Coco] MEMSIZ - PEEK(39)*256+PEEK(40)

Arthur Flexser flexser at fiu.edu
Thu Jul 14 00:34:31 EDT 2022


Allen, I believe you're wrong about Microsoft having made a one-byte memory
mistake that Microware corrected for the CoCo 3.  My memory is a little
vague on this, but I have a recollection that the CoCo 1/2 actually needs
that extra byte, but the CoCo 3 doesn't because Basic is running out of RAM
on the CoCo 3.

I recollect that some function, maybe VAL or HEX$, uses 2 bytes of RAM at
the top of memory as scratch storage for its calculations.  If you raise
the top of memory by 1 byte on a CoCo 1/2, this function misbehaves in that
it thinks that the byte at $8000, containing the Ascii for the letter E at
the start of Extended Basic (which starts with "EX") is RAM and uses the
hex value of "E" (decimal 14) in the calculations instead of the value that
the function has temporarily poked into that byte.

Wish I could be more specific, but that's what I remember.  Perhaps someone
here can fill in the particulars.

Art

On Wed, Jul 13, 2022 at 11:06 PM Allen Huffman via Coco <
coco at maltedmedia.com> wrote:

> PEEK(39)*256+PEEK(40) is called “MEMSIZ” in Color BASIC Unraveled. It’s
> the highest point in memory a BASIC program can grow to.
>
> That could be 4094 on a 4K CoCo, 16382 on 16K CoCo, 32766 on a 32K CoCo,
> 32766 on a 64K CoCo.
>
> …and these bytes are all by 1 from the actual last byte of memory. I only
> recently learned this while working on a new article for Vintage is the New
> Old.
>
> But, to my surprise, the BASIC in the CoCo 3 reports it as 32767… Someone
> at Microware must have noticed it was off by one and fixed it.
>
> So when we said, for all those years, “on a CoCO 3 with 128K, you don’t
> get any more memory for BASIC" we were wrong.
>
> You get one more byte.
>
> --
> Allen Huffman - PO Box 7634 - Urbandale IA 50323 - 515-999-0227 (vmail/TXT
> only)
> http://www.subethasoftware.com - https://www.facebook.com/subethasoftware
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list