Blitz (7/193)

From:Tony Rolfe
Date:3 Aug 2000 at 01:15:34
Subject:Re: String Constants

On Wed, 02 Aug 2000 12:42:14 +0000 David McMinn said:
> Tony Rolfe's head burst.
> All we could scrape off the wall was Re: String Constants.
>
> > I was just looking at my initialization code (where I define a couple
> > of hundred string variables) and discovered that a simple a$ = "a"
> > type command takes 10 lines of ASM including 2 JSR instructions.
> > Seemed like a pretty huge overhead so I was trying to eliminate it.
>
> What that does though is frees the memory for the previous string, allocates
> some new memory and copies the string into the memory for the variable.

I understand what it is doing (now that you've explained it), but it
still seems a pretty inefficient way of doing things. I discovered
that you can set up a string constant

Fred dc.b "A Constant",0

and then reference it with Peek.s(?Fred), but it doesn't seem
worthwhile.

Pity Blitz doesn't use null terminated strings directly. How about

DEFTYPE.0 Fred ; zero defines a null-terminated string

or DEFTYPE.15 Fred2 ; non-zero number defines a fixed-length string

An idea for Pure Basic Fred??



Tony Rolfe
Amiga 2000, 68030/25, 1+8Mb
www.shoalhaven.net.au/edgewater
ICQ #51271965

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie