Re: Making HCELL With -?

From: Elizabeth D. Rather <erather_at_forth.com>
Date: Wed, 21 Mar 2001 13:24:47 -0800

Because the purpose of EQU is to make a definition that will be used in
constructing target definitions. Therefore, a word defined by EQU isn't
available in the HOST scope, only in INTERPRETER, COMPILER, TARGET, and
ASSEMBLER.

Cheers,
Elizabeth

At 03:11 PM 3/21/01 -0600, Dennis W. Bulgrien wrote:

>Does somebody mind teaching me why the following gives me HCELL ?
>
>SwiftX ColdFire 2.51.3
>HOST ok
>CELL 2/ EQU HCELL ok
>: HCELLS HCELL * ; HCELL ?
>
>-----Original Message-----
>From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On Behalf
>Of Elizabeth D. Rather
>Sent: Wednesday, March 21, 2001 2:07 PM
>To: swiftx_at_forth.com; swiftx_at_forth.com
>Subject: [swiftx] Re: Making HCELL With -?
>
>
>
>At 01:23 PM 3/21/01 -0600, Dennis W. Bulgrien wrote:
>
> > >From what's left over, "CELL CONSTANT CELL", what is the left CELL, an
> > EQU (either 2 or 4)?
> >
> >If so, then will doing "CELL 2 / CONSTANT HCELL" access the EQU CELL or
> >the CONSTANT CELL (as if it matters)?
>
>The purpose of CELL CONSTANT CELL is to re-define CELL in a different
>scope. The first CELL is executed, like all Forth words encountered
>interpretively. It returns a value, which may have been defined as a
>CONSTANT or an EQU.
>
>The purpose of defining CELL is to make accessing a cell portable, that is,
>if you want to know your cell size regardless of implementation (16-bit
>systems have CELL=2, 32-bit systems return 4, 64-bit systems such as the
>SPARC return 8). How you define HCELL depends on what kind and level of
>portability you want to achieve. The definition CELL 2/ will always
>compute half a cell, which may be 1, 2, or 4 in the above cases. If you
>want it to always return 2, you should define 2 CONSTANT HCELL or 2 EQU
>HCELL, rather than create a dependency on CELL being 4.
>
>As to whether you use CONSTANT or EQU, the difference is that CONSTANT
>(assuming you're in TARGET scope) will define a data object in the target
>and references to it will execute it. An EQU's definition exists only on
>the host; references in TARGET definitions compile it as a literal.
>
>Cheers,
>Elizabeth
>
> >-----Original Message-----
> >From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On Behalf
> >Of Rick VanNorman
> >Sent: Wednesday, March 21, 2001 11:09 AM
> >To: swiftx_at_forth.com
> >Subject: [swiftx] Re: Making HCELL With -?
> >
> ><snip>
> >-? is an over-ride for the non-unique test.
> ><snip>
> >
> >On 3/21/2001 at 10:56 AM Dennis W. Bulgrien wrote:
> >
> ><snip>
> > >systems, instead of just 2 EQU HCELL. I looked up CELL in
> > >core.f and found:
> > > -? CELL CONSTANT CELL
> ><snip>
> >----------------------------------------------------------------------
> >swiftx_at_forth.com The SwiftX programming discussion email list
> >To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
> >For help with listar commands, send subject "help" to listar_at_forth.com
> >Archives are located at http://www.forth.com/swiftx -- check them out!
>
>================================================
>Elizabeth D. Rather (US & Canada) 800-55-FORTH
>FORTH Inc. +1 310-491-3356
>5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
>Los Angeles, CA 90250
>http://www.forth.com
>
>"Forth-based products and Services for real-time
>applications since 1973."
>================================================
>
>----------------------------------------------------------------------
>swiftx_at_forth.com The SwiftX programming discussion email list
>To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
>For help with listar commands, send subject "help" to listar_at_forth.com
>Archives are located at http://www.forth.com/swiftx -- check them out!
>----------------------------------------------------------------------
>swiftx_at_forth.com The SwiftX programming discussion email list
>To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
>For help with listar commands, send subject "help" to listar_at_forth.com
>Archives are located at http://www.forth.com/swiftx -- check them out!

================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
================================================

----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/swiftx -- check them out!
Received on Wed Mar 21 2001 - 13:28:02 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.