[Coco] Re: DECB USRn function

Arthur Flexser flexser at fiu.edu
Mon Jul 24 16:56:45 EDT 2006


On Mon, 24 Jul 2006, Ries, Rich [S&FS] wrote:

> 
> It's been more than a few decades, but I think I remember a BASIC/ML
> comm program that used a string to hold parameters: A$ = "112358", and
> then used VAR(A$)* to get the address of A$, which was POKEd into the ML
> routine, which was loaded via POKEs from BASIC. Convoluted, but it may
> help. (And if I am too terse, let me know, and I'll try to explain it
> more.)
> 
> 
> --Rich
> 
> *I think this is the command -- I'm at work, and as I said, it's been
> quite a while back.

This is a good approach, I think.  The function you are referring to is VARPTR,
which gives the address of the 5-byte string specifier for the string that is
the argument of VARPTR, as in Y=VARPTR(A$).  I'm going from memory here, but I
think the first of the 5 bytes is the string length and the 3rd and 4th bytes
are the address of the string.  (The other 2 bytes are unused.)  You can replace
these bytes with your own values by poking, once the string has been referenced
by BASIC, so that the string can be relocated to anywhere you find convenient
for access from ML.

Art




More information about the Coco mailing list