Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!dlyons From: dlyons@Apple.COM (David Lyons) Newsgroups: comp.lang.forth Subject: Re: Forth Implementation Question Keywords: Forth, 68000 Message-ID: <34738@apple.Apple.COM> Date: 14 Sep 89 23:13:40 GMT References: <1715@thumper.bellcore.com> <7972@medusa.cs.purdue.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 36 In article <7972@medusa.cs.purdue.edu> bouma@cs.purdue.EDU (William J. Bouma) writes: > [...] are there any other advantages of your dynamic code movement? > less error prone than the scheme you have presented. This may not be directly related to the original posting, but in environments such as the Macintosh and Apple IIgs, there is a Memory Manager that you have to request memory from--there's no guarantee that you can get the *same* memory from one execution of your program to the next, so a traditional Forth architecture (with lots of pointers) is a problem. Even if the processor provides some kind of "base register" & you use offsets rather than absolute pointers, there are still problems. For example, how do you "grow" the block of memory allocated for your dictionary? You have to allocate all the space you want in the beginning, *or* you have to be prepared to *not* be able to grow your block, even if the amount of memory you want is available (probably split up into several pieces). The closest the 65816 comes to providing a base register is to limit the main Forth memory area to 64K and allocate a memory block of up to 64K, starting at a 64K boundary--at least one commercial GS Forth, called GS16Forth, uses this approach. It works, and it has the advantage (?) that things are still 16 bits long. (I'd rather have 24- or 32-bit pointers/offsets, but not necessarily 24- or 32-bit integers, by default. I suspect this would break a lot of existing Forth code.) Has anybody seen Forth systems using this sort of approach? -- --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.