[Coco] VARPTR not what expected.

Allen Huffman alsplace at pobox.com
Sun Jul 3 16:05:32 EDT 2022


> On Jul 3, 2022, at 2:54 PM, coco--- via Coco <coco at maltedmedia.com> wrote:
> 
> I Wrote the following program to try to understand how the VARPTR in Color Computer 3
> Disk Extended Color Basic 2.1 works.


VARPTR returns the address of the 5-bytes of data that represent a variable. If it’s a number, it’s the number itself. If it’s a string, that 5 bytes then points to where the string data is.

Bytes 3 and 4 give you the address of the string data.

I dove in to it in part 3 of my writeup of interfacing BASIC and assembly:

https://subethasoftware.com/2017/02/07/interfacing-assembly-with-basic-via-defusr-part-3/ <https://subethasoftware.com/2017/02/07/interfacing-assembly-with-basic-via-defusr-part-3/>

--
Allen Huffman - PO Box 7634 - Urbandale IA 50323 - 515-999-0227 (vmail/TXT only)
http://www.subethasoftware.com - https://www.facebook.com/subethasoftware




More information about the Coco mailing list