karl@sugar.uu.net (Karl Lehenbauer) (01/20/89)
I have made Peter Appleman's public domain Forth for the Amiga, A4TH, available on uunet for downloading via anonymous ftp (/amiga-sources) and uucp (~/amiga-sources). The filenames are a4th.readme, a4th.zoo.uu1, a4th.zoo.uu2, a4th.zoo.uu3, a4th.zoo.uu4, a4th.zoo.uu5 and a4th.zoo.uu6. I think it needs some work before it will be ready for distribution via comp.sources.amiga, and I describe what I think is required in a4th.readme, a document containing other useful information as well, which is reproduced below... README file for Amiga Forth - karl's version 0, uunet ftp upload 1/19/89 ------------------------------------------------------------------------- The following files are a uuencoded zoo of Peter Appleman's public domain forth for the Amiga, A4TH, with some bug fixes by me plus a vi-like screen editor written by Peter da Silva and myself. A4TH is very similar to F83, a PD Forth for MS-DOS on the PC. (However, it is *not* F83.) It includes a metacompiler and all the source required to recompile and reassemble itself and produce an executable Amiga binary. It runs well on the Amiga, and has support for much of the ROM kernel, including windows, menus, graphics, gadgets, DOS, and the multitasking exec. A couple of example applications are included as well. It also includes two screen editors, a line editor, a 68000 assembler, C-style structures including datatype-sensitive store and fetch words ('s@' and 's!'), a decompiler, print utility, string management, text file loader, include files for many of the structures and routines of the system, and much more...*good stuff*. People who know F83 will come up to speed very quickly. I think there is a good deal more documentation with F83, and much or most of it would apply, although F83's redistribution criteria may be more restrictive than A4TH's, which is wide-open. I'll be checking on this. This version was specifically created for uunet and is available for download by ftp or uucp by relatively hardcore Forth/Amiga hacks. I do not feel that it is ready for release to comp.sources.amiga at this time for reasons that I detail below, mainly bugs and very sparse documentation. A4th is stored on uunet as a uuencoded zoo separated into multiple files. To unpack a4th, collect all six files, named a4th.zoo.uu1 through 6, delete any superfluous stuff at either end of each, then cat them together, in order, and uudecode the result. This will be a zoo archive, which can be dearchived by changing directory to the directory you want to dearchive into (on your Amiga at this point, probably) and doing a: zoo e// a4th.zoo Summary of my changes --------------------- My fixes addressed a bug in Amiga text file including in which, if there was an error in the Forth source being included, Forth would effectively hang. This mainly involved creating a new word for the deferred word '?error' called 't?error' which in addition to the normal stuff '(?error)' does, restores '(source)' into the deferred word 'source'. Another bug involved automatic entry to the editor after an error occurred when loading Forth code from disk. It would print the name of the offending word, take you into the editor without a pause, then print the 'abort"' text after you exited the error. Fixing this involved a minor kernel change ('(where)' in Akernel.blk) and minor changes in vi and 'edit', the default screen editor. Now, using either editor, forth will print the word name and 'abort"' text and "...edit? " to give you a chance to see the message and choose what you want to do. If you enter 'y' or 'Y' you will be placed in the A4TH screen editor with the cursor on the word following the word in error. If you have loaded vi ("from kutil.blk 1 load"), entering 'y' or 'Y' will put you in vi with the cursor *on* the offending word. I also made changes to utilities.blk to make the printer go to 'prt:' rather than 'ser:'. To print, "open file.blk listing" It will try to print 132 columns wide by default, screens next to their shadow (documentation) screens. This works great with compressed print on my Epson clone. vi-like screen editor --------------------- Consult vi.doc for a list of commands vi knows. Beware that vi was just ported over from the PC and it has a few bugs, the big one I'm aware of being that 'dw' deletes not just the next word but the following line as well. Metacompiling ------------- Go into Forth. Do an "open meta.blk ok" then an "open akernel.blk ok" and follow the instructions it displays when it's finished. Multitasking ------------ A4th works fine under the multitasking exec. But wait, there's more. A4th implements the familiar polyForth-style 'task:', 'activate', etc, multitasking words, but unlike other systems which implement a polled task switcher, A4th subtasks are actually Amiga exec tasks -- no polling is required. This makes Amiga exec tasks spawned by Forth into lightweight processes to forth, as the tasks execute the same address space and the usual forth words, plus some new ones like 'priority' (which a lot of realtime forth guys on 'other' machines would kill for). Miscellaneous Notes ------------------- A4th's case sensitive. Almost all the words you know and love, dup rot swap and friends, are lower case. It's nonstandard, but I like it. Almost as a joke I set up a makefile. I'm so used to typing 'make' I figured I'd "make" it work. So if you have Aztec 'make', or I suppose most others, a "make" will get you into forth and load everything. Do a "make default" to not load our vi screen editor. Super-minimal notes on how to get around ---------------------------------------- To open a block file for perusal, 'open name.blk' as in 'open utilities.blk'. You can then list screen numbers, starting with zero, up to the size of the file. Note that most of the files were created using the "shadow screen" concept, whereby the first half of the file is source and the second half is documentation and there is a one-to-one correlation between source and doc screens. To peruse with vi, open utilities.blk 1 vi Note that once you've 'open'ed a file, you can just type the filename to establish it as context (forth creates the filename as a word that does just this). You can then hit 'n' to go forward, 'p' to go back, type numbers in the dark for a number of screens to go forward or backward, 's' to go directly to a screen, as in '10s' to go to screen 10. 'q' quits. If you screw something up, 'u' is undo (empty-buffers). If you get in a weird mode, like insert or replace mode, escape takes you out (all good vi hacks know that). A4th Deficiencies ----------------- 1. The documentation is extremely sparse. Although the documentation for the code in the shadow screens and such is OK, there aren't user manuals for anything nor is there a glossary. If you do any work in this area, please forward it to me. 2. There is no ability to send a command to a CLI from inside Forth. This would be really nice, like to have a defining word from inside forth that lets one define words that pass a command and the rest of the terminal input buffer to a CLI, so from within forth one could do "emacs foobar" "dir" and such. A more basic word would be 'cli' or something, so one could do "cli iconed" and such from within forth. 3. Library support is hot (take a look at it), but incomplete. 4. More example code and demos are needed. Epilogue -------- Please forward any bug fixes to me. Also, it would be nice if you'd upload them to the East Coast Forth Board, which is where this came from (and the place to get a pristine, but buggier, copy of A4th). East Coast Forth Board info: 703-442-8695, 300/1200/2400 24 hrs Regards, Karl Lehenbauer, Hackercorp usenet: ..!uunet!sugar!karl Internet: karl@sugar.uu.net BIX: kelehen (rarely) US Mail: 3918 Panorama; Missouri City, TX 77459 -- -- uunet!sugar!karl | "We've been following your progress with considerable -- karl@sugar.uu.net | interest, not to say contempt." -- Zaphod Beeblebrox IV -- Usenet BBS (713) 438-5018