~ ~~~ ~~~~~~ ~~ ~-

FORTH INTEREST GROUP Volume II P.O. Box 1105 Number 1 San Carlos, CA 94070 Price $2.00

1 General Information

Publisher's Column

3 FORTH for the 6809

6 Recursion - The Eight Queens Problem

7 A 'TINY' Pseudo-Code

9 FORTH in Literature

10 News & FIG Doings

12 New Products

15 Letters Published by Fath Interest Qoup June 8-13 -icm Ckmical Society

Mime I1 ND. 1 Itay/June 1980 Junc 21 So. Cal. FIG Meeting, MSI Data Corp., 300 Fi&r Ave., Costa ksa, C4. "I. FUbliSher by C. Martens June 28 FIG Monthly Meeting, 1:OO pm, at Liberty Mitaial Review Board W, Hapad, CA. Cane to the FOWL Wk- sbp at 1o:oo dm and stay on. Bill Ragsdale Dave Bculton Kim Harris John James -9e Claverick

!XRlW DIWICFLS solicits editorial mterial, COrmentS and letters. Eb responsibility is assured for accvacy of ilklterlal SUbnltted. 4LL MAERL4L PUBLISHED BY THE FCRIl4 IHPEREST GWP IS IN THE PUBLIC DOMAIN. InfOrmdtiOn in FatTH DIllZLJSICNS my be reproduced with credit given to PUBLISHER'S COLUMN the autha and the Fath Interest Qoup.

SUbScriptiOn to FORI'H DI-IW is hee with nenbershlp in the Fath Interest Qoup at $12.00 per Far ($15.00 . m't let yw membership in FIG crash. &new today! merseas). Fcr membership, change of adhess and/a to It's easy. Just send in yw check for $12.00 ($15.00 =hut material, the address is: ovecse~)and p'11 be all set fa the next s1x issues of pu(n DLIIPISICS and the FIG mtices. If you are in dwbt Fath Interest Qoup as to whether your membership is up, just look at the P.O. Box 1105 address label. If it reads "Renew March 1980' then its San Caclos, CA 94070 tiae to get that check off. D3 it today. The next issue of FORTH DIMENSIONS is going to be super. It will be a teclnical issue with all tk. entries subnitted in the Case Cmtest. We sure that you receive this inpatant issue, renew yw nertership in FIG today.

HISTORICAL PERSPECTIVE This my sound like a hard pitch for your membership hut PIG needs you. lte cnly way that we can keep m plblishirq Pccrm DWENSICS and qeading the FORRf wcrd is by having 'yar a;lppcrt. In fact, haw about getting others to sign KRlli ws created by W. Charles H. nace in 1969 at ehc rp. Matiara1 -10 AstroMmy Observatay, ~lott,eSVllle, VA. It was created out of dissatisfaction with available poqramurg tools, especially for cbervatxxy wtcamtion. rpu -tens It. nDQe and several associates famed m, Inc. in 1973 fa the purpose of lic~~ingand suppot-t of thc CORM Oprating System and Frogranaing Language, and to wly awlication pqranming to meet c(~lb311cTs unique require- mts . KIM HARRIS COURSE

Ik Path Interest Qorq, is antered UI Natharn Cali- falUAr alVPuqh Ouc errhipOf 1100 iS eld-dd.. It A five day interuive mwse m gzqranming with FtXlW was fadin 1978 by PDRTH poqranrecs to enowage ua d will be held July 21-25 at Hurabolt State University in tb language by the interchange of ideas Urough dnrr Arcata, California. "he course will cover thc PORTH ud prhlications. rlp~roadr to wcducing canplter applications includiq: (1) ~yulyzinqth requirennts of a woblm, (2) &signing a logical aolution, and (3) impleaenting and testing the mluticn. lbpics will include the uaagt, extenion, ad internal8 of the FORTH language, compiler, assembler, virtual mine, wltirasking cperating wtem, mass stam IMPORTANT DATES virtual EY manager, and file system. Colprters will be available for demonstrations and class exercises. The CoULse will be taught by Kim Harris, and Humbolt State ryXil 26 PIG Monthly Meeting, 1:00 pm, at Liberty fhiversity will give 4 units of -edit though the offie of b&?e, Hapard, CA. to th loAlL Wak- Cartinuing mtion. Nition fa the cxxrse is 9112 per shop at 1o:w &a and stay on. stant. ?he wxt will be "Using FORlW: ropics will be available at the cars fa $25 each. Harsing is available hY20 National FIG Meeting, Disneyland Hotel, in very nice dcrmimy room8 fa $9 per person per night a .Anaheim, CA at the NCC Personal Caputing at several =by notels. Cafeteria meals may be prr* Festival. Dimin the evening and technical individually a at $10.25 per day. Ftc me informtim acssions all day. Contlrt: Jim Plarnry, and regisPation mtecials vrite, befae Jvle 23: (408) 779-0848. Rof. mldWmit May 24 FIG Monthly Meeting, 1:00 pm, at Liberty Physics Departwent Hcuae, Hapard, CA. Caa to th? RIIlLWak- nubolt State University shop at 1o:w dm and stay al. Arata, California 95521

Page 1 Fo#IH DIMENSIOESS II/1 FORML NEWS Camittee -ka&r netapoRIH - Nucleue kwrd -a TI7 Inc. 555 Rl Ry A=. Suuryvale, CA 94086 (408) 735-8080

FOWL (FORTH Modification Laboratory) 1s d research Ccnctrrency, Multitasking, mry Ilolma TOY,madinating individual effmts on the technical Executive Ccranication 808 Colemn, 121 ewlution of m. Waksbp mectlngs Be held the forrth synckon i zat ion knlo Pgk, CA 94025 Saturday of each mth at 1O:OO a.m. at the Liberty House, Hayuacd, UI. (Hake a day of it by staying Em the FIG seings John -saay meeting in the afternoon.) Working groups determine 11 HiramDnte R3ad and docunent: the ob]ectives (hat pxblems need to br &in&, CA 94563 solved), status of topic (what has already becn &re), (415) 254-2398 tk challenges (hat has to be done), the mpthods (th appropriate approach), the list (detailed topics and -tat ion Jotm S. J-8 problems), the specifications (requirements of valld P. 0. Ba 348 so1utim.s). You can input directly to the technical Berkeley, CA 94701 aamittees cr to FIG Chaicmn Kim Harris (see Files -1. (415) 526-8815 We wittees ad leaders are: CYaphics Hanard Fecarlmttm 1055 Ctegcm Ave. cam1t tee Pal0 Alto, CA 94303 (415) 8S644M Nmeric Extensions L bFXK StuKt Floating mint P.O. Box 1418 Piles OBllS Kim Win Sunnyvale, CA 94088 1055 Oregon Ave. (408) 296-6236 Pal0 Alto, CA 94303 (415) 85644%

FaRML needs your help. Cane to the next meeting1

THIS IS THE BEGINNING! THE BEGINNING OF FIG TWO! THE BEGINNING OF FORTH DIMENSIONS 111 IT’S TIMTO RENEW! RENEW YOUR+1YIYI)ERSHIPIN FIG! RENEW YOUR SUBSCRIPTION TO FORTH DIMENSIONS! DO IT ALL FOR ONLY $12.001 00 IT TODAY! W.8 M8.W CHECK THE LAIaL IOR RENEW DATE! IF IT READS “Renew Mar. 1980” SEND A CHECK!

SEND IT TO: FIG, P.O. Box 1105, San Carlos, CA 94070 RENEW NOW!

FORTH DIneSSIONS II/1 Page 2 FORTH, for the Inside a word, one may use X and D without bothering to save their values on entry. If one wants a second (very handy for =me- thing like (EIOVE), then one or mre of Raymond J. Talbt, Jr . Y, S, or 0 registers may be swed in 7209 Stella Link, Suite 112 memory (or on one of the stacks). Houston, Texas 77025 Before listing the code which makes the FORTH machine, let me describe the 68'FORTH is an implementation of notation used to make dictionary fig-EWUH for the 6809 . entries with the TSC assembler P4KXO It is available on 5" disk configured facili ty: for an SWTPC SS-50 Buss system with Swrpc MF-68 dual 5" disks and the TSC FLEX 9.0 disk , but it is easily modifiable for other systems (write author for information).

The 6809 is a greatly improved version of the 8-bit microprocessor. It is almost like having a 16-bit micropocessor, since there are several 16-bit instructions. It has two 16-bit index registers X and Y, and a 16-bit register D A-I0 which may also be used as two 8-bit The &n quantities refer to parameter registers A and B. There are many to the MACRO. E.g., addressing modes , including indirect, autodecrement, and autoincrement. MACRO 4,BAS,E The two hardware stack registers will assemble as make it ideal for F'€)RTM - it is almost a FORTH machine in silicon. I have 84 42 41 53 C5 LI NK implemented FORTH by the following register assignments : Where LI NK is the link address to the previous entry. This macro coupled The FoIiTH variable with assembly of addresses allows one Stack - u to write code that is essentially just colon definitions, The EDRTH return e.g., the macro definition of COLON Stack - S stack register itself below. The EDR!Ili in- Here is the assembly language str uction listing for the portion of the code pointer (IP) - Y index register which defines the 6809 FoR!IFl machine: The FORTH register W (which points to the machine code being exe- cuted) is never stored (to save an instruction which is usually unnecessary) , however , upon entry to a word's machine code, that address is in the -- X index regis ter

A-11 Sane arbitrarily chosen examples of be read or written in lieu of the the great economy achieved by this use termiml. (The wurd READ switches KEY of the stack registers is given by some to read a text file, similarly WRITE words shown here (note: depending m switches EMIT to write a text file). location, some of the BRA have to be Consequently, it is possible to com- the long branch instruction LBRA). municate data between FORTH and other FLEX pxograms (Horrors - BASIC even!!). 7, LXDI3r.E '.2 '.2 X Another feature of 68' FORTH is Krn something which should be part of any l..' ..: FORTH system which operates under a D host Do5 - It has a mrd (underscore .v on some terminals, 1eFt arrow on Krr others) which is followed by a text 2.1.. *+2 string (delimited by carriage return or .ti 'I double quote). The text string is Rm) I..( passed to the COS mnmand processor. -2 ',a1 While in 68'lW!"H one can do any FLEX Rm) I,.! e.2 command, e .g., C.\T (catalog of FLEX 1.0 files), DELETE, etc., by, X.D RENAME, .x e.g. Krr 2.,.R s.2 D plll Cop Item hm vx. atMk - CAT l.F (carriage return) D plsh Onto ret. sack bExT to get a catalog of all files on drive These various fragments of 6809 1 with name starting with F. This type code can be compared with the cor- of facility is extremly useful for the responding 6800 code in the FIG 6800 exchange of data with other types of ASSEMBLY SOURCE LISTING. Specifically, programs and for using FORTH in time- the 6809 NEXT routine takes 14 machine sharing systems where other pople use cycles whereas the 6800 NEXT routine other languages. For example, at Rice takes 38 cycles. we operate a PDP-11/55 with the UNIX operating system and FOR?H functions as The 68'FOR"Y implementation for the just one time-shared process along with 6809 is essentially identical with the many others. As yet our PDP-11 €T3RTH 6800 fig version except for the machine does not have this word, but I plan code for the mds defined that way. to include it in oraer to take advan- Many wwds which me coded (like PLUS) tage of the many extremely useful are shorter in 6809 code because of utility programs which exist in UNIX. the 16-bit math. For all of the In particular, in that environment, we colon-definition-like-words in 6800 want to be able to transfer data fig-FORTH, I just used my WRDd MACRD; between tapes and disks as background that keeps the source file short. jobs while we are wurking with files interactively with FURTH. Also, for 68'FORTH implements the full nufilber crunching work, other languages fig-FO#M vocabulary as given by the are more convenient and faster than May 1979 6800 ASSEMBLY SWXE LISTING FWt"H, so te plan to implement certain and the fig-FORTH Installation manual. tasks in other languages to be done as In addition, particular installation background jobs supervised by UNIX dependent code for EMIT, KEY, and disk while we use FORTH for just those read and mite are given for a 6809 interactive tasks for which it is system with all disk 1/0 being done ideal. via the disk sector read/write routines of the TSC FLEX 9.0 disk operating My main reason for pointing out system. FLEX formatted text files may these FORTH mnnections to another Dos

POKIH DIMENSIONS II/l Page 4' is to encourage the FORTH standards team to think about standard vocabulary wads far these links. FORTH grew up and still largely exists as a stand alone operating system. However, already it is used in some places as simply one language in a multi-language time shared system. I know of two places -- here at Rice where we have begun a rudimentary connection between FORTH and UNIX, and at Kitt Peak Na t iona 1 Obser va tor y where the ir CIX 6400 has very elaborate inconnections between FORTH and CDc's SCOPE.

Editors Note -- This is an excellent example of conversion of a FIG assembly listing to another processor. However one me change is in order. NEXT on the 6809 is only 4 long and the code jump to NEXT takes 3 bytes. On processors this powerful, the code far NEXT is repeated, in-line, wherever needed. This costs one but saves 3 clock cycles on each interpretive cycle. The time overhead of indirect threaded code is then 12 cycles. Similarly, PUTD should k expanded in line. Recursion - 2he Pan Queen Problem at hand finds the board KOw and ClOlUar locations on The Eight Queens Problem llJhich eight &ss queens would be safe from mutual attack. This example Jerry kVan doesn't check for board rotations 011 Dept. of Math Science reflections, so more answers are Eastern Kentucky University Finted than necessary. Richmond, KY 40475 The output gives the calculation nLrmber on which the answer was found The Eight Queens problem has been and a list of the eight row nuntms, often used as a textbook problem in aolunn by colunn on which the queens pxgrming, particularly to illustrate are located. Now it's your turn to recusion. I present here a solution in DO-IT. mm.

Recusion is the technique of 8a I 57 0 ( 8 qwans by Jerry kVan UIR-7)DLcOZ ) allowing a procedure (a FORTH word I : 1. W? + ; ( double s velue ) 2 definition) to call itself. This 3 : UTSLL? ( allw a word to call itself. by rscurslon ) 6 UTIST WA CFA , ; Imamti is normally blocked during FORTH 5 ampilation, to allow a old word nane 6 : IABlAY ( ukas an array of 1's. ss given by lnput ) 7 <8UIu)S 0 Do I , LOOP to be used in a new definition of the 8 DOES> SUA? 2. + : ( leave sddresa rirhln artmy ) 9 same name. For example: LO 8 I*u*T A ( these form uorkspece for the solutions ) I1 16 IANAY 8 I? 16 UIMT C :HEW CR CR HELP CR ; I3 8 IAlMT X ( [him COntaiM trl.1 solutions 1 CR lb -> 15 The new definition of HELP will execute a previous definition, but with two carriage returns before and H1 I 5a after. This is a necessary and camm 0 ( mre 8 queau vII-790Lc02 ) capabi 1i ty . 1:SAn z syu ovp om ovm OVER 3 -7+C@>R b +B@H How then to have a word call itaelf, 5. DIor A @ u I> ; 6:"K if not by name? The answer is MYSELF. 7 syu oyp OVLI ovm om This word will compile a call to 8 -7+c OSUA?! the 9 +IOsyuI word in which it is located: LO MO?AONuI; 11 : pI(Iu 12 sw om om oyp ovm 13 -7+CISU?I : DEMO 1b +8IsyUI 15 MO?AIWUl;->

IF MYSELF EISE - -: In this example, if the test is true at IF, at MYSELF a call to Daro will occlnr. This is acamplished by defining MYSELF as IMMEDIATE. At compile time, MYSELF executes and compiles the execution (code field) address of the mst recent (actually incarplete) definition in the CUFWNT vocabulary. The fig-- definition is :

: MYSELF IATGST PFA CFA , ; pMEDI#pE A 'TINY' Pseudo-Code

Bill Powell Sawbr idgewor th, Her ts England

There are some interesting speed/ nucleus OODE routine. This is done by memory trade-offs which depend on the a look-up table which m6ts two bytes pseudo-code adopted in implementing per entry just as the Code Address FORTH. The discussion by David Skag rrormally does. We can suppat up to (11 for the PDP-11 shows 17Iy: to be both 64 CODE routines this way. Despite faster and more compact, but less the time taken for bit testing this flexible (?) than ITC which is the structure works out quite fast because de facto standard. But 6502 FORTH only one byte has to be fetched. Of (Program Consultants) appears to use murse we could arrange for methan the JSR/RTS structure. This is 64 03DE entries by defining one that faster, but must lead to a lot of code gives acoess to a three byte structure, since it now takes 3 instead of 2 bytes but 64 should be enough. to reference each low level (CODE) routine in a high level (COLON) The effect of these one byte definition. instructions is to make the body of COLON definitions much smaller. On my 6502, an 8 bit machine, it Literals require 1, 2 or 3 bytes seems attractive to call the most instead of 2, 3 or 4 bytes. On the frequently used FORTH words with a other hand ~ISTA"~and V.4RIABLES will single byte. My 'TINY' code reads the usually require 3 instead of 2 bytes first byte and then shifts it left to since in TINY they are compiled write bits 6 and 7 into the sign and like Literals. But these words are carry flags. For codes $80 thru $FF infrequent in FORTH because pataneters (carry set) a branch is taken to a 2 are passed on the stack. byte COLON instruction. The even vale we 1l0w have is used for the b byte for the Instruction Counter (IC). The Hi byte is read by the original IC before being saved on the return stack. This is still a two byte pcode which allows us a vast number of Colon definitions. But we no longer need the Code .Wess, saving 2 bytes. But we must start these entries at even addresses which will cost 1/2 byte on average.

Next the sign bit is tested. If clear, a txanch is taken to a routine for low Literals which pushes the numbers 0 thru $3F on the stack. Then this routine drops back into the 'TINY' interpreter. These low literals (0-63) thus compile into fast single byte pcodes. Frequently used Variables can be stored at these memory addresses making this doubly useful, e.g.8 user klf Variables . For codes $40 thru $7F the above branches fail and we drop into a

Page 7 Fo#RI DMEHSI- fI/r The table above analyses three fams An impartant aspect of is the of overhead: acoess it gives the user to the struc- ture of the language. Therefore I 1. Time overhead in cycles would still like to gee rpc remain the weferred farm because of its elegence 2. Dictionary building and flexibility. But TINY has Rlllch to overhead d .bytes offer on -11 8 bit systems. 3 P-code required each (11 Skag, D: “IYlC v/s rIC far FOmm time the entry is KRI9 D-1- Wl- 1, Eb. 3, called pabytes NOV. 1978 Sections 1, 2 and 3 analyse EOKEi words of type OE, COLON, COFSTNW, and Section 4 analyses Literals. In Section 5 we find the time over head to execute a line assumed to contain 6 CODE, 1 Literal, and 2 Storage (CONSTANT) words, as well as the space far its pde. Sane of the num?rals have been assumed low. Section 6 is like Section 5 except RENEW NOW! that 3 of the CODE words have been replaced by 3 COIDN wocds of the type in Section 5. At this level we can get a good idea of comparative speeds of RENEW NOW! execution.

Section 7 gives the storage required RENEW NOW! fa a program of 35 CODE, 20 stacage, and 60 COLON words (drawing equally from Sections 5 and 6). This does not include the space for actual data ntx fa the machine code of the nucleus, but does include all p-code and dictionary overheads apart from the haders. Taking XTC as 100% we see that the performane becomes: -TINY JSR/RlS an: Time Overhead 78% 66% 89% Space €&@red 66% 103% 104% The benchmarks are for the 6502, but similar ranking seem likely fa other 8 bit micros. Clearly, longer pqrams will favor TINY even more. On the other hand JSR/RTS may execute even faster than indicated because the nucleus can lMke freer use of the cpu registers . FORTH in Literature

At the E'ORTH Convention, October, operator indicating his interest and 1979, Dan Slater gave a shart report on approval by operating any terminal key an experiment on communication with at the REST after each stanza. killer whales. By use of a touch sensitive plate, the orca could learn to physically equate touching a posi- tion with a concept or object. Interest was expressed in using the syntax of FORTH to define new items. sca I I08 0 ( The Tbry that Jack bullt yR-))DECI5 ) By this method a man/whale vocabulary I ( From The Space Child's Mother booe. Irdrlck Ylluor ) 2 : ICCITE I10 LO? pU1: ; ( say this pou ) can be built. 3 : TUC . the ; 4 : THAT W .* nat " ; 5 : TUlS CI .* Thl. 1. " rn i The evening Charles Moore read a 6 : JACK ." Jack built" ; ? : sumany .*Suury" ; FORTH poem by Ned Conklin. It is 8:W .* Flau" ; based 9 : lRlllluI .' Ihl.rry" ; loosely on a classic of English LO : K ." hutant K" ; literature. 11 : WE ." Lrudlta Verbal Yaae" ; 12 : ttIlAsL .* Turn of ?leuslble Chrad' ; 13 : BLUFF .' Chaotic ConfuDion and Bluff" ; Cybermtics :9)K; 14 : SMF ." and Stuff" ; : my boty JACK ; --> SIxPEIlcE ! IS ." BEGIN WE @ poCI(ET +! rruLL 24 o ID BUCIBIRD I + e PIE +I w FAPZ BCGIN X3OPDIED SIX MIMY-DISH KItC ! SURPRISE ;

A-21

Bill Ragsdale has submitted two me. This is a familiar quotation, with apologies to Browning:

: LOVE CR .*I How do I love thee?" CR ." Let me count the ways." 1 BEGIN CR WP . 1+AGRIN

: RHYME JXK DUP NIMBLE BE W QUICK BE CWLE-STICK OVER JUMP ; Finally here is an actual, full poem. It is taken from "The Space Childs Mother Goose" by Frederick Winscx, Simon and Schuster, 1958. It consists of eleven stanzas and is almst recursive. The first two screens compile the primitives from which the poem is recited, by loading of the last screen. The ' s recitation occurs stanza by stanza with the

Page 9 FORTH, Inc. News Virginia - Call Joel Shpentz (703) 437-9218 or Paul van der Eijk (703) 354-7443 Texas - In Houston, call Jeff A series of free seminars and paid Lewis (713) 729-3320, ($100-125) wurkshqps is being offered; in Dallas, call John plyFORTH will be presented. The Earls (214) 661-2928 and schedule is: Palo Alto, May 8 & 9; in Denton, call Dean Rxhester, NY, May 13: Boston, May 14 & Vieau (313) 493-5105 15; New York, June 10; Cherry Hill, June 11; Washington-Baltimore, June 12 Arizona - Call Dick Wilson (602) & 13; Houston, June 16 & 17; New York, 277-6611 ext. 3257 June 18; Palo Alto, June 24 & 25. For mxe information and/or to regis- Wegon - Call Ed Kamnerer (503) ter: Call Kris at FDRTH, Inc. (213) 644-2688 372-8493. NewY-k - Write Tom Jung, 704 166th St., Whitestone, NY FIG DOINGS Michigan - Call Dwayne Gustaus ~ (817) 387-6976 Intensive Short Course

The American Chemical Society is offering a nlnrber of five day, hands- on, in-depth lab courses on micro- PUBLICATICM processors and . The participants will have access to a PDP-11 netwmk running KR'IIl. Sessions are June 8-13, September 7-12 and Dick Miller has sent the first issue December 14-19 at VPI, Blacksburg, of the M HR"H Newsletter. It's jam VI at a cost of $485 for JCS members packed with news, tips and updates fa and $550 for non-members. For more mS EOKRI users an the TRS-80. infamation contact ACS Short Coaxes, 1155 Sixteenth St., N.W., Washinglmn, It's a service to registered awners, M= 20036. and Dick would be glad to send a sample copy to prospective users. write Miller Microcomputer Services, 61 Lake Shore Road, Natick, MA 091760. * * FIG GKIUPS OR FORMING Thanks to Fig member Frank Dougherty (325 Beacon Street, Belvedere, IL San Diego - Call Guy Kelly (714) 61008) far the miteup in the Blackhawk 268-3100 ext 4784 01: Itxu Bit Burners Newsletter. Frank dis- Boyle (714) 571-7711 cussed the language and ocp: efforts, as well as the dialect STOIC. Seattle - Call Dwight Vardenbvg (206) 542-8370 a Terry FURl'fl for Micr-ers by John S. Dettman (206) 821-5832 James originally published in Dr -Dobbs Number 25 May 1978 has be= Mass. - mird Wednesday at 7:OO repinted first in ACH SIBIAN NXICES, pm in Cochituate, MA. Oct. 1978 and naw in an IEEE Tutorial: Call Dick Miller (617) 653-6136 SUPPOEZT, IMSONG LEE, EDImR, IEE cat solution. Topics will include the No. EHO 140-4 to quote from this usage, extension, and internah of the publication "James gives a compact, but FORTH language, canpiler, assenbler, not necessarily easy, introduction to a virtual machine, multitasking operating stack oriented, interactive pxqramning system, mass storage virtual memory language called FORTH. A better manager, and file system. Canputers tutorial presentation may be found in will be available for demnstrations the manual, PKXRAM FORTH, A PRIMER, by and class exercises. The ccurse will Gregg Howe, Steward Observatory, be taught by Kim Harris, and Humbolt University of Arizona, 1973." The State University will give 4 units of current availability of this document credit though the office of Continuing is unknown. Education. Tuition for the course is $112 per student. The text will be "Using lXRIfiA; copies will be available at the course for $25 each. Housing is available in very nice dormitory rooms More on STOIC-I1 for $9 per person per night or at several nearby motels. Cafeteria meals Technical Report TR-001 may be purchased individually or at $10.25 per day. For mre information "EDIT79, A STOIC-I1 Programming and registration materials write, Example" (63 pages) $7.00 before June 23:

This report represents and example Prof. Rxmld Zammit of a non-trivial program written Physics Department entirely in STOIC-11. The program, Humbolt State University a text editor, was cross-ampiled to .Arcata, California 95521 produce a stand-alone object program, thus facilitating benchmark cwnparisons with the CP/M editor which it closely resembles. Included in the report are the benchmark results, a txief user's guide, and source code for the editar along with extensive cements.

Contact: Jeff Zurkaw Avocet Systems 804 South State Street Dover, DE 19901

RENEW NOW!

KIM HARRIS COURSE

A five day intensive course on programming with FOWH will be held July 21-25 at Hlrmbolt State University in .&cata, California. The course will cover the FORTH approach to producing ccmplter applications including: (1) analyzing the requirements of a prob- lem, (2) designing a logical solution,

Page 11 EolzTH DYMEISIOkS II/1 NEW PRODUCTS

Heath H89 and H8 FORTH for the Heath 89 and 8 is possible with the fig-FORTH 8080, t iny-FOKlX Version 1.1 (as demonstrated by Jim Flourmy at the January FIG meeting). A version of fig-FORTH tailored to Walter Harris implemented and bought the TRS-80, Level I1 with 16K bytes of up the code on his dual disc H8 and lnemory minimum. I/O devices supported reassembled it for the H89. For me are : keyboard, display and cassette information, contact: mR!RI PakFer, P.O. tape recorder. New words can be Box 2455, San Rafael, CA 94902. defined to control other devices. The editor is identical to the fig-mr?IFl editor and the output format is modi- fied slightly to fit the TRS-80 display. Documentation includes : introduction, editor, graphics, assembler, advanced tiny-FORTH and Source Data Systems announces a applications. The style is tutorial language for non-programmer data with hundreds of examples that teach definition, transaction definition, tiny-€YIRTH in a hands-on mde. $29.95 file definition and report generation for tiny-FORTH cassette and full far Honeywell Level 6 Minis. Designed documentation for the Level 11, 16K for infarmation management and retre- TRS-80 plus $1.50 for shipping and vial when used together is SE's Soure handling ($5.00 outside the US). The Data Entry package. Far mre informa- Software Farm, P.O. Box 2304, Restan, tion, contact: Source Data System, 208 VA 22090. 2nd Avenue, S.E. I Cedar Rapids, IA 52406.

KIM-1 FORTH AMD 2901 FOKIH PIlDcESSOR This version was written fran the FIG model by Ralph Mane of Vancower, Rnctional Automation unleashes the Canada. It contains a complete 1/0 thing, a FORTH based front end programing system which has an inter- processor far its AMD 2901 based 64 bit preter/-iler as well as an assembler wide microprogranmd mnputing engine. and editor. All terminal 1/0 is The system pqramning language is FASL funnelled through a jump table near the (Functional Automation System Language) beginning of the software and can which is available users. For more easily be changed to jump to user- information, contact: Functional written 1/0 drivers. 6502 FORTH Automation Inc., 3 Graham Drive, resides in 8K of RAM starting at $2000 Nashw, NH 03060. and anoperate with as little as 4K of additional mtiguous RAM. $94.00 for 6502 FORTH system on KIM cassette. $16.50 for 6502 FORTH user manual. Eric C. Rehnke, 540 S. Ranch View m1c Circle, 161, Anaheim Hills, CA 92087. mIC, essentially an extension of m, is a general purpose interactive

EOR!lTl DIMENSIUG II/l Page 12 pogram, assembler, debugger, loader and basic tutorial for FORTH language. and operating system within a single Information is available for recon- consistant architecture. With core figuring to interface with other disk efficiency and high running speeds, -ratings systems. the language is extremely flexible permitting the user to develop a FLEX 9.0 format 5" disk pius working vocabulary of documentation: $39.95. tailored to specific applications. Talbot Microsystems The entire package, including a 7209 Stella Link, Suite 112 library of predefined subroutines, Nouston, TX 77025 is copyrighted but available to educational users, STOIC requires three discs, two are SlOIC itself and the third contains a bootstrap that permits the entry of STOIC through CP/M P~~ RELEASE and the mtinued use of CP/M disc 1/0 under STOIC. For more information, contact: Steven Burns, Massachusetts 8080 Assembler Available Institute of Technology, Room 20-119, Cambridge, MA 02139. John Cassady, who did the original fig-FORTH 8080 listing, has now re- leased an 8080 FORTH assembler. John's assembler handled all mnemonics and can easily lx altered to zilog, as it is published as source code. It 68'FOEITH FOR 6809 handles structured assembly condi- tionals IF, ELSE, THEN, BEGIN, UNTIL, WHILE, and REPEAT. It is integrated with the FIG security package to verify 68'FiIR"H is a 6809 implementation axrect structuring of conditionals, of the EQR"H Interest Group standard during assembly. John provides for vocabulary of this powerful language. named subroutines as well as CODE definitions. 68'FORTH consists of full FORTH Interest Group standard (May 1979) Send $3.25 (includes postage) to vocabulary with names to 31 characters, John Cassady, 339 15th Street, Oakland, 16 and 32 bit integer math, compiler CA 94612. error checking, and source text editor. System is supplied with additional vocabulary to simulate disk in memory (useful far modifying to wark with other disk systems or enabling polyFORTH-CP/M is FORTH Inc.'s cassette-only operation), to use disk polyFoIiTH, interfaced to run on nearly fat virtual memy (allows large data any 32K a larger CP/h based system. sets to be used in small memmy), to When loaded, polyFoRTH-CP/M finds and interface with FLEX 9.0 text files for links-up to the CP/M 1/0 drivers, input and output, and to perform initializes itself, and responds "up" standard FORTH disk block read and on the system console. At this point, write. System is supplied on 5" floppy true plyFORTH is running, that is, disk configured for SWTPC MF-68. FORTH structured ( screen oriented ) Minirmnr memay requirement is 8k ftx diskettes must be used. It is impr- FLEX plus 12K of user space. Docu- tant to realize that polyFORTH-CP/M mentation contains description of all does not run under CP/M, it runs in vocabulary words, information on place of CP/M, utilizing only the CP/M configuring for individual system, I/"o drivers. The pOlyFORTH-CP/M System, as 8080 fig-FO#IH supplied by MhB DESIGN, is a Value- sapcae Listing ...... 10.00 added system. Inc.'s canplete 8080 polyl3XTH system- is supplied, plus Installation Manual an additional diskette and manual (F.I.G. Hoael) ...... 10.00 containing interface material. Also provided, is a CP/h utility that allows (CA residents add 6% tax) transferring polyFORTli blocks (screens) to a CP/h file, and transferring a CP/M file to p0lyE'ORTH blocks. Saace is Write: Jeff Fox (415) 843-0385 supplied for the entire plyFORTH 2223 Byron system, the polyFORl!H-CP/M mmponents, Berkeley, CA 94702 and the transfer utility. polyEWTH-CP/h is available directly from M&B DESIGN for $4,000 on a wide variety of diskette formats. Contact:

ANCON provides a wide variety of M&B DESIGN FORTH products, including: Hobby 820 Sweetbay I2. versions; TRS-80 Cassette, $29.95; Sunnyvale, CA 94086 Heath H8489, $49.94; 8080 CP/M 8in, (408) 243-0834 $49.95: 6809 5" Flex, $49.94.

Personel sys tems ; TRS-80 Tape 8 $45.95; Disc, $65.95; 8080 CP/M 8" $125.00; pdpll, $140.00; NarthStar, FQRTH for Foly-88 Wcropolis. Commercial/Industrial/Scientific versions available for specific fig-FORTH for the 8080 as imple- requirements. Jim Flournoy, ANCON, mented by John Cassady and modified by 17370 Hawkins Lane, Morgan Hill, CA Kim Harris is now available for the 95037, (408) 779-0848. miy-88.

This version uses cassette and ram simulation of disc, and includes full use of upper and lower case characters as well as the Greek character set, as well as high speed graphics. .9n editor and an assenbler are included.

The amplete RENEW NOW! system price is ...... $50.00 FOKTH on cassette (needs 8K RAM 2000-4000H) . 25.00 Poly-88 Fath User's~~ide...... 10.00 LETTERS -- the limitations of the traditional approaches. LYON'S DEN March 14, 1970 [Editors note - George Lyons has ax;esponded on FWTH topics over the full life of FORTH DIMENSIONS. He George B. Lyons addresses technical and philosophical 280 Henderson Street topics. We're formalizing his con- Jersey City, N.J. 07302 tributions into a bylined column. Welame to the Lyon's Den.]

I suspect that a paramount issue in decisions on whether to use FOR!L'H or Rogrm was nice enough to supply another language is a tradeoff between me with a reassembled version of their language convenience and compiler Apple-FORTW Kernel plus screens of the cnnvenience. By implementing a complex dictionary entries fur my KIM-1. This syntax a PASC-U mmpiler, say, auto- was all entered by hand, painfully mates part of the programing task at debugged, editor programs written (in the expense of a time-consuming source their FORTH), etc. I then tried to entry and processing operation. duplicate the "PI" routine in the Ik.

Standard ~~ seem to be at the other Dobbs Journal, only to find that extreme, leaving me explicit details Rogram~didn't carry extra bits of to be coded by the programer, for the intermediate accuracy in the multiply gain of easier processing with an routine. Then another week of spare interactive resident compiler. time (midnight oil) work to rewrite the math routines to allow "*/hOD" to work The polarization of FORTH and its properly. It finally worked. alternatives on this scale may only be due to the absence of standard FORTH I'm not bitter tbugh. "hrough all vocabularies to provide the same degree of this I learned enough of FOFU?H-liks of automation traditional languages programming to be more enthusiastic supply. I wonder if a quantum jump in than ever, but disappointed that the EORTH's popularity would result fran example programs I've received from supplying compilers for traditional you are not usable by the Programma languages implemented in FORTH. version. I am therefore eagerly Possibly, transparently obvious FORTH awaiting the availability of the 6502 language features could be provided version of fig-FORTH for my KIM-1. achieving the same results. areas where the greatest inrpact might ame are PASCAL data structures, ALGOL J33ard J. Bechtel, M.D. procedure argument passing and dynamic Newpat Beach, CA local storage allocation, and APL matrix alge&a.

If techniques for these operations in FOKIli were widely known no one would Should you have any books, manuals make the mistake of referring to RXI'Ii cc other documents pertaining to FDKIY as a species of mamo assembler. By which are available by special cxder, I demmstrating that traditional language would like to have a list. There seems convenience is available in KRTH users to be a real need for textbooks or might be motivated to take advantage of tutaials which will carry a user fran the extensibility of F"H to go beyond the most simple FORTH constructions to the very elaborate ones like (BUILDS and DOES>. (See x1 below.) For your information, I am working Fditn.. . with the mnsFoRTH implementation from Miller Microcomputing Services. I am "k nhrs left on the stack after quite satisfied with the system to an error are the block number and date, and look forward to other exten- character offset. See ERROR. This sions. I have distributed several allows WHERE (Scr88) to display the "H programs to MMS which they may of fending text . use in their newsletter. Should the FORTH Interest Group have a program exchange or plblish programs, I will submit these programs to you also. (See #2 and #3 below.) Thanks to John James and FIG, I've upgraded my sub-FoKtfl to what I now call 2650-FoURT€i. To date, except Andrew W. Watson for the disk 1/0 verbs, my FORTH mre Vinton, VA a: less mtches Mr. James' FORTH with the exception that I've incorporated an Editor.. . assembler, it's fully KIM based and it has a few more primitives. I do #I - Use the Mail Order page and see support a cassette IF but can't use Information and New Products the full power of the fast virtual sections of FD. storage. I will release a copy of my 2650-FORTH to FIG as well as any #2 - Send programs to FD! application work that I've done. #3 - Address for Miller Micro- computing Services, 61 Lake Myself being broadly classified Shore IZDad, Natick, MA 01760. as a computer architect or computer designer, I have a very keen interest in turning out a FORTH engine (to borrow a phrase from Western Digital), and will attempt the implementation. I I want to tell you how iqressed I am will potably use the 2900 series bit at the quality of the Installation slices since I have all the developnent Manual and the 6800 Assembly Source tools. Is there saneone in this vein Listing ! that I could contact?

The 6800 listing provided everything I needed to build an identical source Edwrd J. Murray file. The Symbol Table and hex dump Pretoria, mion of South Africa were especially useful in tracking down the last small typos. (I used the check sums for the 'Sl' dump to locate Editor... typos such as INS instead of INX.) Tb get FORTH running on my system, all I Look forward to receiving your did was to modify the KIA address and 2650-FORTH. Adckess for John S. James, delete the coding for Tram. P.O. Box 348, Berkeley, CA 94701. I notice a peculiar behavior regarding the stack. If I type . when the stack is empty, I get an error message, as expected. But after the I was sanewhat disconcerted when I error message, there are two numbers on read the article by Mr. David J. Sirag, the stack. Is this normal? "DTC Versus ITC for FORTH on the the PDP-ll", EORTM Dimensions, Volume 1, No. 3. The author has, I believe, Gordon Stallings misunderstood the intent of the article Bar tlesville, OK byMr. Dewar. In Mr. Dewar's ariticls, the definitions of direct threaded code reveals that their techniques are (MC) and indirect threaded code (IW) logically identical to Dewar's 1°C. are : They have simply, through clever programming, taken advantage of a "DTC involves the generation particular instruction set and archi- of code consisting of a linear tecture. It is beyond the scope of list of address of a linear list this letter b prove this equivalence, of address of routines to be or to suport the FIG desire to have a excuted .'I mmn implemntation structure for all versions of FIG FORTH. "ITC.. .I' ( involves the generation of code consisting)"... of a Please note that I am -not quiblinq linear list of addresses of wards over semantics with Mr. Sirag. A11 which contain addresses of definitions are arbituary. (Hawever , routines to be executed. " the value of a definition lies in its consistency, precision, and use- As applied to the FORTH type of ability. I find Mr. Sirag's definition hierarchial structure (hierarchial of MC and ITC to be inconsistent with indirect threaded code?), I would the environment in which he operates, extend Mr. Dewar's definition to FORTH, and thus quite useless.) My be: intent is two fold: (1) I am a self- appointed defender of the excellent "ITC involves the generation of work of Mr. Dewar, and (2) I want to code consisting of a linear list cancect any misconceptions concerning of addresses of words which this issue for readers of this news- contain addresses of routines to letter who did not have access to be executed. These routines may &war's (better) definition of MT and themselves be ITC structures. " m. However, Mr. Sirag based his axclu- sions on the following loose defini- Jon F. Spencer tion : Sherman oaks, CA "The distinction between DTC and rrC as applied to FORTH is that in IYTC executable machine code is expected as the first word Many thanks to John Cassady for after the definition name; while, writing an excellent 8080 FORTH and in ITC the address of the to Kim Harris for implementing the machine code is expected." necessary mods. I received 8080 fig-FORTH Ver. 1.1 on 2 October Obviously, the two men are not 1979 and within a few days had the referring to the same things. I&. assembly langlrage source typed in and Dewar is referring to the list of assembled. A day or two later the addresses which define the RlRTH word, editor with a suitable patch for while Mr. Sirag is referring to the the M4TCH code was up and running implementation of the FORTH inter- along with the disk based long error preter. If indeed Mr. Sirag's state- messages. I[ have been learning and ment were true (which it is not) that gaining experience with f ig-FoRTH ever their "analysis contradicts the since. findings of mar", then they should have implemented a II1'c language rather After more than a year of using than the ITC language of FORTH! SrOIC from volume 123 of the CP/M Users Indeed, a careful examination of what Woup it is really nice to be using a is actually occuring in LABFORTH true ~~ that is consistant with the examples in the EORTH Inc. manuals and the several articles that have appeared With help from the Plodel I have now on ~ofi~~.I cannot over-emphasize how got to grips with the outer interpreter well documented the fig-FORTH system is and virtual memy system, and will be and how easy the system was to king getting together with Bill -11 and up. No bugs or errors have been other FORTH fanciers over here on an uncovered in nearly six months of cooperative implementation effort. use. Many thanks for your effort and The only thing missing from this creativity, which are not unapprecia- otherwise nearly perfect package is ted! the assembler vocabulary. Is an 8080/2-80 assembler vocabulary avail- able from the FORTH Interest Group or Bill Stoddart if not is any planned? If an 8080 15 Croftdown Fmad assembler is available or is planned a lmdon NW5, England short note OK a word about future plans in the next issue of FDRTH DIMENSIONS would be sufficient. Editor's note -- Bill had a marginal note to this letter: "certainly grows In any case I hope I get to see on you. This really is 'Computer some of you at NCC in Miiy so that I can Liberation.' BASIC was just a red personally thank you for making FORTH herring ." available to me.. . Sincere1 y ,

Do yw have a 280 version of fig- M. Paul Farr FDR"H3 It is not listed on your mder 2250 Ninth Street sheet but reading the text I got the Olivenhain, C4 92024 mession that you do. By the way, I have a tutorial paper Editor - discussing assembly programming in FORTH environment for both 8080 and Yes! An 8080 assembler is now 280. It is available, including source available in source code to canplement listing written in fig-FORTH, from 8080 fig-^^. Send $3.25 (includes KALTH microsystems. The price is postage) to John Cassady, 11 Miramnte $5.-G for 8080/85 version, $7.-uS for Road, Ckinda, CA 94563. 280 version or $10.-for both (add 15% in Canadian funds).

.Usof I am working on the assembler for the /88. If I knew that Many thanks for the fig-FORTH there are also other people interested installation manual glossary and lQm in it, that would motivate me getting Model, which have been difficult but it complete sooner. (It is a cross- enjoyable items of study since they assenbler that can be run on any FDm arrived a couple of weeks ago. based system.)

Like many of your mertlbers I became yours truly, interested in FORTH without having access to a EWI'H system, and gained my first wactical familiarity by using Kalman Fejes the lQm low level interpreter style K4LTH microsystems of linkage on machine code programs. P.0. Box 5457, Station "F" Ottawa, Ont., Canada Edi >r - accessing and manipulating data. Indirection, however, is only a Fig doesn't have a plan a 2-80 navagation technique for constructing version of fig-FORTH. We would be the address required by the hardware to pleased to publish a contributed implement OUT desired opration. When version, if as complete as the 8080 at the end of our circuitous logic, are Version 1.1 we then to complain "What can I do about this address".

Let's face it, @ and ! are perfect operators. .4s a participant in the Forth Inter- national Standards Team, I cast a yeah I value TD and its lmpllcations in vote for the inclusion of "TO" and its system structure. The procedures requisite definition of VARIABLE written using "10" are mre readable (though I prefer the name FIELD). than standard Forth, and result in Uthough I was first exposed to this fewer visits to NEXT as they are definition on Catalina Island, it executed. "To" will be included in any has many similarities to my own system I generate, together with other implementation of FIELD and RECORD. essential mds, which include @ and !. In its simplest form, as outlined by Paul Bar tholdi, FORTH DIMENSIONS As a Forth fanatic and a FORTH 1/4, integer variables of predetermined DIMENSIOS fan I sincerely hope that precision are defined to behave as the newsletter will continue. If there bidirectional constants. Normal is some assistance I can render please behavior is to push their stored value advise. onto the stack. A momentary, alternate behavior is to pop the stack value into their confines. This temporary Williams S. wry behavior occurs only when referenced 2700 Peterson Place, 153D after the word "TO", which sets a Costa Mesa, CA 92626 direction f lipflop. Thus

VARIABLE .A VARIABLE B Editor -- 10 'I0 A A'POB You're doing it! By thoughtful will place 10 into A and B without correspondence and participation in using the @ (fetch) and ! (store) group events people such as Bill are opera tors . multiplying OUT efforts. Each of us, who has implemented a version of 'TO"? encounters some exasperation in dealing with the addresses appearing on the stack. STRucrURED vARL9BLEs Since, in the prior illustration, neither A nor B supplied its address for TO'S execution we ponder the shortcomings of this newly offered FYom time to time at the Fig meet- definition and reluctantly sprinkle our ings the question of structured pocedures with @ and !. variables arises. This is a proposal for how they might be handled. FORTH is an elaboration on the indirect threaded list program archi- The December 1978 issue of com- tecture. As programers we are free to munications of the .4CM contained a add indirection to our methods of paper by John Backus on "Functional Programning" (also called variable free K"fi IN THE PUBLIC VIEW programning). I believe a variation of his ideas could be implemented in FO~.suppose we are given a pair of queues with bases at opposite ends of After the survey article in March available memory pointing toward each 15, 1979 Electronics, Mr. Robert other. Then enter an array into one of Gaebler wrote the usual letter to the them and begin processing it. Let the editor critiquing FORTH's postfix results go to the other queue as they notation. We are reprinting a well are developed. Multiple steps would stated rebuttal to this letter which alternate between the queues until a also appeared in Electronics. final result is obtained. These alternating queues can give some of the To the Editor: effects of functional programning (1) large state changes, (2) limited menury I want to reply to Robert Gaebler 's of past states, (3) no concern with letter on expression format in the garbage collection, 4) variables mt FORTH language [Electronics, July 5, named or declared. 1979, p. 61. Backus placed operators within the Gaebler notes, and I agree, that data. This could be done or not, as compilers can do the translation fran experience dictates. 'Ihese queues are infix to postfix notation and thus save not to replace the stack which FYXlTH the programer both work and the risk already has. ?he stack could be used of errors. Unfortunately, these to hold what I would call operator advantages are not available without variables m nrodifiers. sane penalty for extensible languages such as FORTH. If the canpiler is to Let us look at a couple of simple translate, it must know how to parse examples. Suppose we wanted to trans- expressions. The parsing rules for pose an array. 1 2 3 nimitive operators are supplied with 456 the compiler, but those for the added Enter it into one queue. (1 2 3 4 5 operators must be supplied by the 61. "Ype in the transpose curanand. 2 pogramner at mpile time, which makes 1 Tp. The 2 and the 1 go on the stack the parser much more complicated. so the transpose function knows what kind of a transpose is desired. The Examination of almost any program result will come out on the other will reveal that the majority of queue: 1425361 program statements are nonalgebraic OT can easily be converted to a non- Should we wanted to sum a vector. algekaic farm. Thus the advantages [l 2 3 4 5 61. Type in a reduction of infix notation, when present, OOlRILand. I + RD. The 'Tick' put the apply only to a fraction of the address of 'Plus' on the stack so the program statements. Far most function reduction function knows what kind of definitions, the prefix notation of reduction to perform. The other queue sukoutine or macro calls is required, receives the result: 21J and this can be replaced by postfix notation with little or no loss of clarity. W. H. Dailey 47436 Mantes Street Use of postfix notation l?aves E'remont, CA 94538 the parsing of all expessions in the hands of the prcgrananer . It means that arguments for an operator may be

I mFttT4 DIMiBlSI~II/1 Page 20 I -ed uslng the full pawer of the Fograring language, without any restrictions being imposed by the ~3.piler. With this freedom comes the xssibility of error, and argument $epxation is one of the mst error- xme portions of programming in a lalguage such as FORTH. If effort is -2 be spent on improving the ease of programing, it should be spent on 5 i~plif y ing argument prepar a t ion 2nd stack manipulation. Postfix rutation, with the applicative style of xograrrrning that it pduces, has so mny advantages that it should not be sacrificed to an algebraic notation that is rmt “natural,” but only some- thing we all learned in school.

THIS IS THE END! THE END @FVOLUME II #I! THE END OF YOUR MEMBERSHIP? DON’T LET IT HAPPEN! RENEW TODAY! CHECK THE LABEL FOR RENEWAL DATE! SEND A CHECK TO FIG TODAY! MAKE THIS YOUR BEGINNING! RENEW NOW!

a

MAKE A COPY FOR A FRIEND! POST COPY ON YOUR BULLETIN BOARD!