I must have been the confused one. I'm just using W2K (CELL= 4) and the ColdFire (CELL = 4). I see your point about the danger
(trouble) of defining half a target cell per the host's cell. Thank you for setting me straight on that issue. However, my
question about the best way to define something in only one place still holds for a machine-independent factor, like DOZEN. Now,
if I need a bakers dozen, 13, I just have to change one number in one place rather than several as in the other examples.
HOST
12 CONSTANT DOZEN
DOZEN EQU DOZEN
: DOZENS ( n1 -- n2 ) DOZEN * ;
INTERPRETER
: DOZENS ( n1 -- n2 ) DOZEN * ;
TARGET
: DOZENS ( n1 -- n2 ) DOZEN * ;
As far as making HOST definitions in SwiftX, we do. We use it some during compile for scripting. We also have a HOST program that
tests the TARGET memory using C!(B) and C@(B). It obviously isn't for the end product, but definitely helpful in development.
-----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 4:52 PM
To: swiftx_at_forth.com
Subject: [swiftx] Re: Making HCELL With -?
Confused. What computer are you programming? Host's cell size and
target's aren't necessarily the same, nor do they have anything to do with
each other. In what circumstance do you care at all about the host's cell
size? I don't understand why you're making any HOST definitions here at
all. Depending on how you're using this, you may need only INTERPRETER,
possibly TARGET as well, but probably not HOST. That's only causing
trouble. One rarely needs to make HOST definitions in SwiftX.
Cheers,
Elizabeth
At 03:58 PM 3/21/01 -0600, you wrote:
>Would code excerp (3) be the best solution to prevent possible bugs from
>duplicating the same definition two places, or does
>somebody else have a better idea?
>
>(1) HOST's HCELLS is vulnerable since EQU HCELL is not available in HOST:
>--------------------------------
>HOST
>CELL 2/ EQU HCELL \ NOTE: Change HOST HCELLS as well.
>: HCELLS ( n1 -- n2 ) CELL 2/ * ;
>INTERPRETER
>: HCELLS ( n1 -- n2 ) HCELL * ;
>TARGET
>: HCELLS ( n1 -- n2 ) HCELL * ;
>
>
>(2) TARGET's HCELLS is vulnerable since CONSTANT HCELL is not available in
>TARGET:
>--------------------------------
>HOST
>CELL 2/ CONSTANT HCELL \ NOTE: Change TARGET HCELLS as well.
>HOST
>: HCELLS ( n1 -- n2 ) HCELL * ;
>INTERPRETER
>: HCELLS ( n1 -- n2 ) HCELL * ;
>TARGET
>: HCELLS ( n1 -- n2 ) CELL 2/ * ;
>
>(3)
>--------------------------------
>HOST
>CELL 2/ CONSTANT HCELL
>HCELL EQU HCELL
>: HCELLS ( n1 -- n2 ) HCELL * ;
>INTERPRETER
>: HCELLS ( n1 -- n2 ) HCELL * ;
>TARGET
>: HCELLS ( n1 -- n2 ) 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 3:25 PM
>To: swiftx_at_forth.com; swiftx_at_forth.com
>Subject: [swiftx] Re: Making HCELL With -?
>
>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 ?
>
>----------------------------------------------------------------------
>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!
----------------------------------------------------------------------
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 - 15:24:45 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.