Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Dec 1998 02:37:36 -0800
From:      Mike Smith <mike@smith.net.au>
To:        "Daniel C. Sobral" <dcs@newsguy.com>
Cc:        mike@smith.net.au, current@FreeBSD.ORG
Subject:   Re: BootFORTH - demo floppy 
Message-ID:  <199812211037.CAA00452@dingo.cdrom.com>
In-Reply-To: Your message of "Mon, 21 Dec 1998 02:32:03 PST." <199812211032.CAA11540@newsguy.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> At Mon, 21 Dec 1998 01:08:54 -0800, you wrote
> 
> >Commonsense suggests the two major problems:
> 
> [This is really irrelevant; in particular, my "experience" disagree with the
> "common sense" of the second statement; but the first statement must be
> correct for the sake of correct use of FICL. IMHO, anyway]
> 
> > - the count is usually too small (in the ANS Forth case, it's one byte)
> 
> Most string words in Forth take their count from the stack, so it's one cell,
> not byte. I suppose FICL uses 32 bits integers as cells, right?

/*
** Strings in FICL are stored in Pascal style - with a count
** preceding the text. We'll also NULL-terminate them so that 
** they work with the usual C lib string functions. (Belt &
** suspenders? You decide.)
** STRINGINFO hides the implementation with a couple of
** macros for use in internal routines.
*/

typedef unsigned char FICL_COUNT;
#define FICL_STRING_MAX UCHAR_MAX
typedef struct _ficl_string
{
    FICL_COUNT count;
    char text[1];
} FICL_STRING;


I *think* that Ficl will have to move to using 64-bit cells, at least 
on the Alpha (since it stores pointers in them).

> So, Unicode Forths would have 65535-sized counted strings. Indeed, some Forths
> use 32 bits characters.

This is definitely something to take up with John Sadler.  The whole 
reason that it's an issue from my perspective is that there are some 
cases where I can see it being desirable to be able to handle strings 
longer than 255 bytes with the bootloader, and that means that the 
scripting language has to be able to deal with them.

Thanks for the clarification.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812211037.CAA00452>