embedded systems developers tools, cross compilers
  Home  |   SwiftX Archive  |   SwiftForth Archive  |

Re: Making HCELL With -?

From: Dennis W. Bulgrien <dbulgrien_at_vcsd.com>
Date: Wed, 21 Mar 2001 15:58:58 -0600

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!
Received on Wed Mar 21 2001 - 14:00:59 PST

This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:22 PST