[comp.lang.forth] 32-Bit FORTH

hgw@pcsbst.UUCP (hgw) (06/23/89)

This week I received CFORTH, a forth written in C, from
Mark Seiffert (thank you!).

It turned out, that CFORTH is a 16-bit forth, i.e. integers
ar 16 bit wide and characters are stored one per word,
leaving one character per word free.

Now, I want to port it to an environment where integers and
addresses are 32 bit wide (since I want to address all of the
memory in the machine).

Since I am not familiar with 32-bit FORTHS, I have some
questions:

o  Does a 32-bit FORTH imply that a 16-bit data type is not
   available?

o  How are 16-bit loads & stores implemented?
   (perhaps S! and S@ ?!)

o  How are character strings stored in memory?
   (4 characters per word, or 1 character and 3 chars free)


o  Is there any standard for 32-bit FORTHS out there?

So long
--
H.-G. Willers           PCS-Mail: hgw
DOMAIN:  hgw@rht32.pcs.de   (EUR) or  hgw@rht32.pcs.com    (US)
BANG:    ..unido!pcsbst!hgw (EUR) or  ..pyramid!pcsbst!hgw (US)

jax@well.UUCP (Jack J. Woehr) (06/26/89)

In article <865@pcsbst.UUCP> rht32!hgw@pcsbst.UUCP () writes:

... stuf ...

>It turned out, that CFORTH is a 16-bit forth, i.e. integers
>ar 16 bit wide and characters are stored one per word,
>leaving one character per word free.

	This must be Pratt's CFORTH, no?

... stuff ... author wants 32-banger Forth ...

>o  Does a 32-bit FORTH imply that a 16-bit data type is not
>   available?
>

	Not really, what most people have done is make @ and !
do 32-bits, make the stack 32 bits, and add words like W@ and W!
for 16-bits, on the analogy of C@ and C!. It depends on your architecture.

>o  How are 16-bit loads & stores implemented?
>   (perhaps S! and S@ ?!)
>
	see above.

>o  How are character strings stored in memory?
>   (4 characters per word, or 1 character and 3 chars free)
>

	again, depends on your architecture. Usually 4 chars per 32 bits.
of course, 8-bits-per-char in general is becoming passee, since *REAL*
computer systems had better be able to handle japanese 16-bit chars.

>
>o  Is there any standard for 32-bit FORTHS out there?
>

	No. The 83-STANDARD was 16-bit. Generally 32-bit Forths
try to stick as close to the 83-STANDARD as possible while anticipating
the coming ANSI Standard, which will be divorced from cell size.

	Why not get the shareware CForth83 from Mitch Bradley, for
Unix machines of all sizes? Bradley Forthware is P.O. Box 4444,
Mountain View, CA 94040, USA or wmb@sun.com

	If you have an Amiga, try JForth, a JSR-Threaded 32-bit Forth.

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}                                                                        {}
{} jax@well     ." Sysop, Realtime Control and Forth Board"      FIG      {}
{} jax@chariot  ." (303) 278-0364 3/12/2400 8-n-1 24 hrs."     Chapter    {}
{} JAX on GEnie       ." Tell them JAX sent you!"             Coordinator {}
{}                                                                        {}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}

pmy@vivaldi.acc.Virginia.EDU (Pete Yadlowsky) (06/26/89)

In article <12396@well.UUCP> jax@well.UUCP (Jack J. Woehr) writes:

[ in response to someone asking about 32-bit forths ]

>	again, depends on your architecture. Usually 4 chars per 32 bits.
>of course, 8-bits-per-char in general is becoming passee, since *REAL*
>computer systems had better be able to handle japanese 16-bit chars.

Interesting. I wasn't aware that recognition of the Japanese character
set (kanji, I assume) was becoming an important issue in computerdom (yet),
outside Japan, that is. Can you say more about this?

>If you have an Amiga, try JForth, a JSR-Threaded 32-bit Forth.

Absolutely. You can't beat JForth with the proverbial stick.


Peter M. Yadlowsky		| "Pay no attention to that man
Academic Computing Center	|	behind the curtain!"
University of Virginia		|
pmy@Virginia.EDU		|

toma@tekgvs.LABS.TEK.COM (Tom Almy) (06/26/89)

In article <865@pcsbst.UUCP> rht32!hgw@pcsbst.UUCP () writes:
>Now, I want to port it to an environment where integers and
>addresses are 32 bit wide (since I want to address all of the
>memory in the machine).

>Since I am not familiar with 32-bit FORTHS, I have some
>questions:

I am familiar with two Forths from Laboratory Microsystems, Inc, 
PC/Forth+ (which is a 32 bit Forth that runs in a 16bit 8086 
environment, linearizing the !@#$ segment addresses) and UR/Forth 386,
which is a 80386 protected mode Forth.  

>o  Does a 32-bit FORTH imply that a 16-bit data type is not
>   available?

By no means!  You need them for accessing data files written by 16
bit programs, and (at least for MS/DOS) to communicate with the OS.

>o  How are 16-bit loads & stores implemented?
>   (perhaps S! and S@ ?!)

We are entering the world of non-standards  here.  LMI uses W@ W! and
UW@, because in Intel nomenclature, 16 bit data is Word data.  Note that
W@ does a sign extension, while UW@ is unsigned.

>o  How are character strings stored in memory?
>   (4 characters per word, or 1 character and 3 chars free)

4 characters per word.  C@ and C! work just like in their 16 bit Forth
counterparts.

>o  Is there any standard for 32-bit FORTHS out there?

Not yet.  But the new ANSI Forth Standards Team is addressing the issue.

Tom Almy
toma@tekgvs.labs.tek.com
(Claimer: I do have a financial connection with LMI, but I'm not getting rich)

kevinbe@microsoft.UUCP (Kevin Berg) (06/27/89)

In article <865@pcsbst.UUCP>, hgw@pcsbst.UUCP (hgw) writes:
[re: CFORTH 16 to 32 bit mods ...]
> Since I am not familiar with 32-bit FORTHS, I have some
> questions:
> 
> o  Does a 32-bit FORTH imply that a 16-bit data type is not
>    available?
> 
> o  How are 16-bit loads & stores implemented?
>    (perhaps S! and S@ ?!)

	Answers here may vary a bit, but W! W@ and W, are fairly common.
	You might check out the latest ZEN Forth by Martin Tracy, which
	is a working model (not endorsed) of the ANS X3J14 Forth std.
	It uses "CELL" in a number of instances (CELL+, CELLS). I did not
	see mention of how 1/2 CELLS are handled (say if CELL was 32 bits),
	but perhaps I'm reading it wrong.

> 
> o  How are character strings stored in memory?
>    (4 characters per word, or 1 character and 3 chars free)

	MACH2 uses 4 characters per word. This becomes handy when interfacing
	to the Mac routines which use Str255 (Pascal type) strings.

> 
> 
> o  Is there any standard for 32-bit FORTHS out there?
> 

	Dare I answer this? I like and use MACH2 on the Mac. JForth for the
	Amiga sounds excellent. If you're on a Sun Mitch Bradly's Forth sounds
	like the best solution. From what I know, each of these has special
	ways of dealing with the host environment and this usually bleeds over
	into the Forth implementation. I think the Forth community is working
	on the standards bit, and perhaps your input could help shape the
	very things you ask about. 


Chow. - k

jax@well.UUCP (Jack J. Woehr) (06/28/89)

In article <1674@hudson.acc.virginia.edu> pmy@vivaldi.acc.Virginia.EDU.acc.Virginia.EDU (Pete Yadlowsky) writes:
>In article <12396@well.UUCP> jax@well.UUCP (Jack J. Woehr) writes:
>
>[ in response to someone asking about 32-bit forths ]
>
>>	again, depends on your architecture. Usually 4 chars per 32 bits.
>>of course, 8-bits-per-char in general is becoming passee, since *REAL*
>>computer systems had better be able to handle japanese 16-bit chars.
>
>Interesting. I wasn't aware that recognition of the Japanese character
>set (kanji, I assume) was becoming an important issue in computerdom (yet),
>outside Japan, that is. Can you say more about this?

	Yeah. Try to buy an LCD that *doesn't* do japanese.

	While here in America our big software firms are busy suing
each other, in Japan they are pioneering novel and sound projects
such as TRON.

	These people are going to rule the world, to say nothing of
computerdom.

	Anyway, them and that tiny nation to the west of them, China,
use 16 bits to represent their languages. That's over 1/4 of humanity,
chief. 16-bit chars, here we come!

{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{} 
{}                                                                        {}
{} jax@well     ." Sysop, Realtime Control and Forth Board"      FIG      {}
{} jax@chariot  ." (303) 278-0364 3/12/2400 8-n-1 24 hrs."     Chapter    {}
{} JAX on GEnie       ." Tell them JAX sent you!"             Coordinator {}
{}                                                                        {}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}