Re: Newbie in Forth needs help...
- From: stephenXXX@xxxxxxxxxxxx (Stephen Pelc)
- Date: Fri, 03 Mar 2006 13:54:35 GMT
On Fri, 3 Mar 2006 13:07:41 +0100, "Maki" <XYZveselic@xxxxxxxx> wrote:
vocabulary target \ Create vocabulary
forth definitions \ All the word for a cross assembly goes to main
dict.
...
words for cross assembly ( if, then, while, )
...
target definitions \ Now begin assembly and gradually build an
image
.... \ assembly
L: test \ But how to prevent to create constant in
current dictionary which is target?
You have two choices:
Choice 1
========
only forth definitions
vocabulary *target
also *target definitions \ will search *TARGET before FORTH
l: test \ searches FORTH to find L:
\ TEST is in *TARGET
Choice 2
========
: L: \ -- ; L: <name>
also *target definitions
here(t) constant
previous definitions
;
This creates TEST in *TARGET regardless of the defined search
order. If you use an ANS Forth host, you will have more control
than using a Forth-83 host.
If you want to generate a Forth cross compiler as well, read
Brad Rodriguez series of articles on "Moving Forth". If you
are doing this for work rather than entertainment, buy a
commercial compiler with source code from MPE or Forth Inc.
We've been doing this stuff for a long time, the chassis is
rock solid, and you'll get all the tools you need. Forth
cross compilers are conceptually easy, but are very difficult
to implement well - the devil's in the detail and there's
a lot of detail. Yes, I'm biased. We sell cross-compilers
but even at very low wage rates, the cost of a commercial
compiler is very low compared to that of the time it will
take to write a good tool from scratch.
Stephen
--
Stephen Pelc, stephenXXX@xxxxxxxxxxxx
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
.
- Follow-Ups:
- Re: Newbie in Forth needs help...
- From: Maki
- Re: Newbie in Forth needs help...
- References:
- Newbie in Forth needs help...
- From: Maki
- Re: Newbie in Forth needs help...
- From: Stephen Pelc
- Re: Newbie in Forth needs help...
- From: Maki
- Newbie in Forth needs help...
- Prev by Date: Re: Newbie in Forth needs help...
- Next by Date: Re: Newbie in Forth needs help...
- Previous by thread: Re: Newbie in Forth needs help...
- Next by thread: Re: Newbie in Forth needs help...
- Index(es):
Relevant Pages
|
Loading