Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!decwrl!adobe!hawley From: hawley@adobe.COM (Steve Hawley) Newsgroups: comp.lang.forth Subject: Re: Selecting a Public Domain Kernel Message-ID: <5403@adobe.UUCP> Date: 10 Aug 90 18:11:12 GMT References: <1487.UUL1.3#5129@willett.pgh.pa.us> Reply-To: hawley@adobe.UUCP (Steve Hawley) Organization: Adobe Systems Incorporated, Mountain View Lines: 75 In article <1487.UUL1.3#5129@willett.pgh.pa.us> ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) writes: > > Date: 08-08-90 (11:29) Number: 624 (Echo) > To: ALL Refer#: NONE > From: ROB STEELE Read: (N/A) > Subj: FORTH FOR 68K BOARD Status: PUBLIC MESSAGE > > Would someone point me to a Forth I could put on a homebrew 68k board? > Thanks. > sn Yes. I have a Beta Release version of FORTH that I did about 9 months ago that should be available via anonymous ftp from flash.bellcore.com (sorry, I don't know the numbers), in the directory pub/steveforth. There is one file called steveforth.hqx which is a Macintosh BinHex file of a Stuffit archive. The archive contains SteveFORTH, documentation in MS Word format (version 3.0 & 4.0), and source code. SteveForth runs on a Macintosh, but the kernel is 68000 portable. To port it, you must do a few things: write some bootstrapping code to allocate space for the operand stack and the dictionary, copy the kernel dictionary into RAM (it won't run in ROM without some heavy mods), install some vectors set up some registers and jump to a boot vector. write some system calls that are needed. These do some memory management stuff, keyboard & file IO, and other goodies. In particular, I didn't use # and #s in the kernal (in fact, they're not implemented). I added general stream i/o to the language, which I thought was a nifty thing to do. The kernel dictionary is 4k of assembly language, and if you wish, you can lift it straight out of the Mac executable by copying the DICT resource with ResEdit. In theory, by just implementing the system call protocol and the bootstrap code you need to do no more work. Good news: this FORTH compiles to 68000 assembly language (ie, it's JSR threaded), so it runs like a bat out of hell. It allows macro exansion. The dictionary is fully relocatable. Implements stream IO. It's free. Bad news: Dictionary addressing is done by using the positive half of a 16 bit displacement from a base register. This means only 16K for the dictionary. If you have total control over your address space, you could make the addressing work from a fixed address and use a 32 bit index into your code. This changes a LOT of things. You could also redo this in a multiple dictionary model. The reason I modelled the code this way was to fit into the Macintosh architecture. I wrote the "operating system" for the language in C, and treated the dictionary and stack as relocatable objects, so they could be moved at will. The power of this is that I could load or unload the FORTH environment anytime I needed. This is really convenient for things like a user extensible spread sheet or word processor, because you can provide the user with a means of defining whatever functionality they need with low overhead in code size and execution time, and when it isn't being used, it gets treated like any other Macintosh relocatable memory object. The final bit of bad news is that I do not provide source for the the IO libraries (I wrote my own version of stdio for this, and am very reluctant to part with it), although there is source for the "operating system" and bootstrap code. Use it if you like it. If you keep it, drop me a note so I know that you're using it (I want to keep track in case I ever have the time to revamp it). If you really MUST give it away, have the receiver send me a note as well. I've had several things I've written get handed out ad nauseum, and had my name somehow magically disappear from the distribution. I'm not too keen on this. Steve Hawley hawley@adobe.com -- "Break out the cameras that reshape my face and get someone to carve up my head" -Alcatraz, "God Blessed Video"