Dear Moderator, The following FORTH source code comes from the Amiga FORTH Newsletter, volume 1, number 2. If anyone is interested in joining the newsletter they can send a message to me: Richard Thomson thomson@cs.utah.edu I have compressed the files and put them into a shell archive (with a copy if this introductory notice) to reduce on space consumed. You may wish to package them differently and should feel free to do so. Note that the fully expanded ASCII version is 157K! Marcus Gabriel has offered to provide the document describing the Forth-83 standard, as well as the files included in this posting. Enjoy... Rich Thomson ----- Forth-83.Txt (Offered but not included, 200114 bytes) FStrings Package Files: FStrings.Txt (56796 bytes) FStrings.Scr (26432 bytes) FSTest.Scr (28543 bytes) MFStrings.Scr (27381 bytes) GStrings Proposal File: GStrings.Pro (10981 bytes) WARNING CONCERNING THE MULTI-FORTH ASSEMBLER AND MFSTRINGS.SCR Sources: marcus@newton.physics.purdue.edu (Marcus D. Gabriel) East Coast Forth Board (ECFB) (703-442-8695)(SYSOP: Jerry Shifrin, nice PCBoard) ___________________________________________________________________________ Subject: FStrings Package by George T. Hawkins From: marcus@newton.physics.purdue.edu (Marcus D. Gabriel) To One and All: Allow me to begin by explaining the one offered file which is not included here. The file Forth-83.Txt is the 89 page "FORTH-83 STANDARD," a publication of the FORTH STANDARDS TEAM, and it is reproducible in whole or in part. Their address is FORTH STANDARDS TEAM P.O. BOX 4545 MOUNTAIN VIEW, CA 94040 USA If you would like this document, please e-mail a note to this effect to marcus@newton.physics.purdue.edu (Marcus D. Gabriel), and I will respond either by sending it to you e-mail, or if there is sufficient response and when Richard Thomson has time to create a completed mailing list, I will propagate it to the group. Last January I downloaded from the ECFB George T. Hawkins' FSTRINGS package, adapted it to Multi-Forth in January, and put some more work into it in late February. The file MFStrings.Scr is the result, more on this file later. The file FStrings.Txt is George Hawkins' original narrative on his FSTRINGS package, and this file is highly recommended reading. The File FStrings.Scr is George Hawkins' original source file (FORTH-83 Standard) for the implementation of the abstract string operators of FSTRINGS, although I have converted it from a block file to a stream file. This file is included for three reasons: i) George Hawkins' code is enjoyable and, I believe, instructive to read. ii) For those with JFORTH or MVP Forth, this will give additional aid in adapting FSTRINGS. iii) You may wish to adapt this package differently than myself, and thus you have the original source. The file FSTest.Scr is George Hawkins' Test/Validation file for FStrings.Scr or, in this case, for MFStrings.Scr also. It has been minimally modified in order to compile under Multi-Forth, and you should have no difficulty in seeing where I have made my changes, there documented or obvious. This file will help if you are adapting or re-adapting FSTRINGS. The file MFStrings.Scr is my adaptation of FSTRINGS to Multi-Forth. I have coded all of the words that George Hawkins recommened and many others besides these. I have defined two words for "dynamically" allocating a temporary string storage buffer, eliminated some internal words through the use of local variables, factored some words of generic interest beyond this package, etc. If you do not like the way I did something, please feel free to change it or bring it up for discussion. I must admit that upon review, in some instances, but not all, I may have gotten carried away with the use of local variables. In these cases, I believe I was trying to make myself understand each and every word without skimming over them by simply reworking them, even to excess. C'est la vie :-). If you have questions or problems, you can e-mail me a note if you do not think it is of generic interest to the Amiga FORTH Newsletter, otherwise please feel free to participate. The file GStrings.Pro (I gather the pun was intended) was posted to the ECFB by Rj Brown, and it is a proposed incremental improvement over FSTRINGS. The abstract string operators would stay the same, it is the implementation of these that would change. In essence, at the ECFB, they are discussing lists and list processing as applied to strings. See THE ART OF COMPUTER PROGRAMMING, FUNDAMENTAL ALGORIHMS, by Donald Knuth. I am sure that Richard Thomson or others of the Amiga FORTH Newsletter could supply additional or better references. I include this file as an example of where we might take this discussion of strings, as a group, if we wished, although it is not necessarily specific to the Amiga. On the other hand, one does use strings with the Amiga. WARNING AND SOLUTION -------------------- The Multi-Forth Assembler has an interesting "feature." On page 43 of Chapter 21, see CMPM Aa Ab size CMPM, test:<(Ab)-(Aa)> whereas in fact the test <(Aa)-(Ab)> is performed, opposite of CMP, , CMPA, , or the Motorola convention. However note that on page 35 of Chapter 21, -TEXT is coded correctly, that is, given that CMPM, functions oppositely from the documentation. Note that I am refering to an old manuel, but after calling CSI, I gather that the new manuel has the same discrepency. At least they, and you, have been notified. Find CMPM, in the the Multi-Forth Assembler and change the original CMPM, : CMPM, ( Aa\Ab\sz -- MEMORY MEMORY COMPARE) B108 ,OP 3 AND !SIZE 6 SCALE SWAP ?AREG OR SWAP ?AREG SWAP 9 SCALE OR R 2SWAP R> B108 ,OP 3 AND !SIZE 6 SCALE SWAP ?AREG OR SWAP ?AREG SWAP 9 SCALE OR