Re: [colorforth] arrays in source
- Subject: Re: [colorforth] arrays in source
- From: Mark Slicker <maslicke@xxxxxxxxxxx>
- Date: Sat, 27 Dec 2003 12:57:36 -0500 (EST)
On Fri, 26 Dec 2003, Samuel A. Falvo II wrote:
> On Friday 26 December 2003 10:16 am, Mark Slicker wrote:
> > 5 bits of the first 32-bit word denotes the color of the number and
> > the type of display. The second word is the actual number.
> >
> > To generalize this, let the remaining 27 bits of the first word denote
> > a count, and let there be a corresponding number of 32-bit words which
> > folow the first word.
>
> I like this idea. The only caveat I can think of is that you need to
> remember to keep the array sized so that it fits entirely within one
> block. E.g., an array can hold no more than 254 elements at most
> (otherwise you overflow the block).
>
> > For count > 1 place the address in source on the data stack, otherwise
> > place the actual number.
>
> I thought variables always placed their address on the stack?
Yes this is mildly confusing. This rule comes from using tags 2 and 5 for
the dual purposes of large numbers and arrays. The thought might be if
you need array is usually contains more than one element. At this point
it is only hypothetical.
Mark
>
> --
> Samuel A. Falvo II
>
---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com