[comp.lang.forth] Addressability of data space

Mitch.Bradley@ENG.SUN.COM (05/02/91)

> The troublesome clause from BASIS13 is from section 5.3.2.  It clearly
> states:
>
> "...it is an exception if a Standard Program addresses memory other
>  than:
>  in dictionary space regions:
>    from the address provided by a CREATEd word or HERE to the end of
>    the region generated by consecutive allocations ( , C, ALLOT
>    ALIGN ) made without intervening definitions or deallocations
>    ( FORGET );
>  [rest of this section is about non-dictionary space]"
>
> This means that if you build a defined word with CREATE (or a word like
> DEFER which uses CREATE), say  CREATE FOO  , you can use the address
> returned by FOO.  Period.  Nowhere does it say you can tick FOO for its
> parameter field address, and this clause is carefully worded such that
> anything not explicitly
> permitted is forbidden.
>
> Has this clause been fixed in the latest BASIS?

Basis 15 says pretty much the same thing (it's now section 5.4).

I believe that this text is logically correct.  The text says that memory
at that address is addressable.  It does not, and indeed cannot, enumerate
all the possible ways of putting that address on the stack.  For example,
one could do the following:

        CREATE FOO  1 C,  2 C,  3 C,  4 C,  5 C,  HERE
        CONSTANT XYZZY
        7 XYZZY 5 - C!

The point is, section 5.4 says that the memory address provided by a
CREATEd word and by HERE is addressable, and that other memory addresses
are not addressable.  It does NOT say that executing the CREATEd word
is the only way of calculating that same address.

However, since this section has already been misunderstood, I would
like to hear suggestions for how to improve the wording.  I find that
writing extremely precise English text is a very challenging task.


By the way, here's what Basis 15 says about >BODY :

8.1.0550  >BODY                 "to-body"               CORE
        ( w -- a-addr )

        a-addr is the data field address corresponding to the execution
        token w of a word defined via CREATE .

        See also: 5.4 Addressable Memory

The rationale box says:

        a-addr is the address that HERE would have returned had it been
        executed immediately after the execution of the CREATE that
        defined w.


Mitch.Bradley@Eng.Sun.COM

wbrown@beva.bev.lbl.gov (Bill Brown) (05/02/91)

Seems I recall hearing somewhere that somebody offers, or at least once
upon a time offered, an 8052 with a version of Forth in on-board ROM.
Does anybody know if it's still available, and if it is who sells it
and for how much. I was sure that I had the details somewhere, however
if I do I must have put it in a _REALLY SAFE PLACE_!

My interest is triggered by an article in the May '91 issue of
_Elektor Electronics USA_ which has to do with an 8032/8052
single board computer project.  It mentions using an 8052 with BASIC
in ROM, and at first glance it looks like it would make a neat
Forth gadget, assumming that the Forth version of the 8052 is available.

Disclaimer:  These opinions are my own and have	    |
    nothing to do with the official policy or the   |  -bill
    management of L.B.L, who probably couldn't      |   wlbrown@lbl.gov
    care less about employees who play with trains. |