VOLUME I Numbers 1-6

I/ 1-6/500 ...... * * * FORTH DIMENSIONS INDEX * * VOLUME I,II,III * * *

ADDING NODULES. STRUCTURED PROGRAMMING 11,132

APPLE-4TH CASE ii,62

ARTIFICIAL LINGUISTICS 111.138

ASSEMBLER, 6502 111,143

ASSEMBLER, 8080 111,180

BALANCED TREE DELETION IN FASL 11.96

BASIC COMPILER REVISITED 111,175

BEGINNER'S STUlYBLING BLOCK 11,23

BENCHMARK, PROJECT 11.112

BOOK REVIEW, STARTING FORTH III,76

BRINGING UP 8080 III,40

:CASE 11.41

CASE AND PROD CONSTRUCTS 11,53

CASE AS A DEFINING WORD 111,189

CASE AUGMENTED 111,187

CASE CONTEST STATEMENT 11,73

CASE IMPLEMENTATION 11,60

CASE STATEMENT 11,55

CASE STATEMENT 11,81

CASE STATEMENT 11.82

CASE STATEMENT 11.84

CASE STATEMENT 11,87

FORTH DIMENSIONS Page 1 INDEX CONTINUED

CASE, SEL, AND COND STRUCTURES 11,116

CASES CONTINUED 111,187

CHARLES r400RE, Speech to a Forth Convention I,60

COMPILER SECilRITY III,15 How it works and how it doesn't

COMPLEX ANALYSIS IN FORTH 111,125

CONTROL STRUCTURES, THANSPORTABLE 111,176 With compiler Security

CORRECTIOlrlS TO METAFORTH III,41

CP/M, SKEWED SECTORS FOR 111,182

D-C HARTS I,30

DATA BASE DESIGN, ELEMENTS OF III,45

DATA STRUCTURES 111,110 in a telecommunications front end

DATA STRUCTURES, OPTIMIZED FOR HARDN.CONTROL 111,118

DECOMPILER FOR SYN-FORTH III,61

DEFINING WORDS, NEW SYNTAX FOR DEFINING 11,121

DEVELOPMENT OF A DUMP UTILITY 11,170

DIAGNOSTICS ON DISK BUFFERS 111,183

DICTIONARY SEARCHES III,57

DISCUSSION OF 'TO' II,19

DISK ACCESS SPEED INCREASE III,53

DISK BUFFERS, DIAGNOSTICS ON 111,103

DISK COPYING, CHANGING 8080 FIG III,42

DO-CASE EXT ENS IONS II,64

DO-CASE STATEMENT II,57

DTC VS. ITC ON PDP-11 I,25

DUMP UTILITY, DEVELOPMENT OF 11,170

EDITOR 11,142

EDITOR III,80 FORTH Inc., FIG, Starting FORTH

FORTH DIMENSIONS Page 2 INDEX CONTINUED

ED1TOR EXT EN S IONS 11,156

EIGHT QUEENS PROBLEM II,6

ENTRY FOR FIG CASE CONTEST II,67

ERATOSTHENES, SIEVE OF 111,181

EVOLUTION OF A FORTH FREAK It3 EXECUTION VARIABLE AND ARRAY 11,109

EXECUTION VECTORS 111,174

EXTENSIBILITY WITH FORTH I,13

FASL, BALANCED TREE DELETION 11896

FILE EDITOR 11,142

FILE NAMING SYSTEM II,29

FLOATING POINT ON TRS-80 111,184

FOR NEWCOMERS I,11

FORGET, "SMART" 11,154

FORGIVING FORGET 11,154

FORTH AND THE UNIVERSITY I 11,101

FORTH CASE STATEMENT II,78

FORTH DEFINITION I, 18

FORTH DIALECT, GERMAN, IPS 11,113

FORTH ENGINE III,78

FORTH IMPLEMENTATION PROJECT I,41

FORTH IN LASER FUSION 111,102

FORTH IN LITERATURE II,9

FORTH LEARNS GERMAN I85

FORTH LEARNS GERMAN, Part 2 I,15

FORTH POEM ' :SONG' I,63

FORTH VS. ASSEMBLY I,33

FORTH DIMENSIONS Page 3 INDEX CONTINUED

FORTH, IMPLEMENTING AT UNIV. ROCHESTER 111,105

FORTH, The last ten years & next 2 weeks i,60 Speech by Charles Moore

FORTH-85 "CASE" STATEMENT 1,50

FUNCTIONAL PROGRAMNING AND FORTH 111,137

GAME OF 31 111,154

GAME OF MASTERMIND 111,150

GAME OF REVERSE 111,152

GAME, TOWERS OF HANOI 11,32

GENERALIZED CASE STRUCTURE 111,190

GENERALIZED LOOP CONSTRUCT 11,26

GERMAN FORTH DIALECT, IPS 11,113

GERMAN REVISITED 1,15

GERMAN, FORTH LEARNS 1,5

GERMAN, FORTH LEARNS, Part 2 1,15

GLOSSARY DOCUMENTATION 1,44

GOD0 CONSTRUCT, KITT PEAK 11,89

GRAPHIC GRAPHICS I11 ,185

GRAPHICS, SIMULATED TEK. 4010 I11 ,155

GRAPHICS, TOWERS OF HANOI 11,32

GREATEST COMMON DIVISOR 11,166

HELP 1,19

HIGH SPEED DISK COPY 1,34

IMPLEMENTATION NOTES, 6809 11,3

INCREASING DISK ACCESS SPEED, FIG III,53

INPUT NUMBER WORD SET 11,129

INTERRUPT HANDLER 111,116

IPS, GERMAN FORTH DIALECT 11,113

JUST IN CASE 11t37

FORTH DIMENS IONS Page 4 , INDEX CONTINUED

KITT PEAK GOD0 CONSTRUCT ii,89

LOCAL VARIABLES, TURNING STACK INTO 111,185

LOOP, A GENERALIZED CONSTRUCT 11,26

MAPPED MEMORY MANAGEMENT 111,113

MARKETING COLUMN III,92

MASTERMIND, GAME OF 111,158

METAFORTH, CORRECTIONS TO III,41

MICRC) ASSEMBLER, MICRO-SIZE I 11,126

MODEM, TRANSFER SCREENS BY 111,162

MODEST PROPOSAL FOR DICTIONARY HEADERS 1,49

MOHE FROM GEORGE ( Pascal vs. Forth ) 1,54

MUSIC GENERATION III,54

NEW SYNTAX FOR DEFINING DEFINING WORDS 11,121

NOVA BUGS 111,172

OPTIMIZING DICTIONARY SEARCHES III,57

I PARAMETER PASSING TO DOES> III,14

PASCAL VS. FORTH ( MORE FROM GEORGE ) 1,54

PDP-11, DTC VS. ITC 1,25

POEM 11,9

PROGRAMMING HINTS 11,168

PROJECT 11,112

PROPOSED CASE STATEMENT 11,50

RECURSION AND ACKERMANN FUNCTION III,89

RECURSION, EIGHT QUEENS PROBLEM 11,6

RECURSION, ROUNTABLE ON 111,179

REVERSE, GAME OF 111,152

ROUNDTABLE ON RECURSION 111,179

SEARCH 11,165

FORTH DIMENSIONS Page 5 INDEX CONTINUED

SEPARATED HEADS 11,147 SIEVE OF ERATOSTHENES 111,181 SKEWED SECTORS FOR CP/M 111,182 SPOOLING TO DISK III,26 STACK DIAGRAM UTILITY III,23 STARTING FORTH, A BOOK REVIEW 111,76

STRING STACK 111,121 STRUCTURED PROGRAMMING BY ADDING MODULES 11,132 SYMBOL DICTIONARY AREA 11,147 TABLE LOOKUP EXAMPLES 111,151

T E L E-C 014 F ER E N C E 111~12 TELECOMMUNICATIONS 111,110 Data structures in a --- front end TEMPORAL ASPECTS OF FORTH THEORY THAT JACK BUILT THREADED CODE TINY PS UEDO-C ODE TOOLS, RANDOM NUMBER GENERATOR TOWERS OF HANOI

TRACE FOR 9900 TRACING COLOLJ DEFINITIONS TRANSFER SCREENS BY MODEM TRANSIENT DEFINITIONS TRANSPORTABLE CONTROL STRUCTURES TREE STRUCTURE, FASL TRS-80 FLOATING POINT TURNING STACK INTO LOCAL VARIABLES USERSTACK

FORTH DIMENSIONS Page 6 INDEX CONTINUED

USING 'ENCLOSE' ON 8080 III,41

USING FORTH FOR TRADEOFFS 1,4 Between hardware/firmware/software

VARIABLE AND ARRAY, EXECUTION 11,109

VIEW OR NOT TO VIEW 11,162

W, RENAME 1,16

WHAT IS THE FORTH INTEREST GROUP? 1,1

WORD SET, INPUT NUrvlBER 11,129

WORDS ABOUT WORDS 111,141

I..'.. 11,168 'ASCII ' III,72 Instead of EMIT

:CASE 11,41

'CASE', A GENERALIZED STRUCTURE 111,190

'CASE', BOCHERT/LION 11,50

'CASE' , BRECHER 11,53

'CASE', BROTHERS 11,55

'CASE', EAKER 11,37

'CASE' , EMERY 11,60

'CASE', FITTERY 11,62

'CASE', KATTENBERG 11,67 'CASE' , LYONS 11,73

'CASE', MUNSON 11,41

'CASE', PERRY 11,78

'CASE', POWELL 11,81

'CASE', SELZER 11,82

'CASE', WILSON 11,85

FORTH DIM ENSI ON S Page 7 WORDS CONTINUED

'CASE', WITT/BUSLER ii,87

'CVD', CONVERT TO DECIMAL 111,142

'DO-CASE', ELVEY ii,57

'DO-CASE' , GILES 11,64

'ENCLOSE', 6502 CORRECTION I I I ,170

'ENDWHILE' III,72

'GODO', KITT PEAK 11,89

' SEARCH ' 11,165

'TO' SOLUTION 1,38

'TO' SOLUTION CONTINUED 1,48

'VIEW' 11,164

'XEQ' 11,109

31, GAME OF 111,154

6502 'TINY' PSUEDO-CODE 11,7

6 502 , ASSEMBLER 111,143

6502, CORRECTIONS FOR 'ENCLOSE' 111,170

6800, LISTING, TREE DELETION 11,105

6809 IMPLEMENTATON NOTES 11,3

79 STANDARD 111,139

79 STANDARD - A TOOL BOX? III,74

79 STANDARD, 'FILL' III,42

79 STANDARD, 'WORD' III,73

79 STANDARD, CONTINUING DIALOG 111,5

79 STANDARD, DO, LOOP, +Loop 111,172

8080 ASSEMBLER 111,180

8080, FIG DISK COPYING III,42

FORTH DIM ENS I ON S Page 8 MISC. CONTINUED

8080, TIPS ON BRINGING UP II1,40 9900 TRACE 111,173

FORTH DIMENSIONS Page 9 INDEX CONTI NUEU

ASSEMBLER FOR 6502 111,149

ASSEMBLER FOR 8080 111~180

BASIC COMPILER FOR FIG I I I, 177

' BATCH-COPY ' III,54

'BUILDS, 'DOES' 11,128

CASE AS A DEFINING WORD 111,189

CASE AUGMENTED 111,187

'CASE', BOCHERT/LION 11,52

'CASE', BRECHER 11,54

'CASE', BROTHERS 11,55

CASES CONTINUED 111,187

'CASE', EAKER 11,38

'CASE', EMERY 11,60

'CASE', FITTERY 11,62

'CASE', FORTH-85 1,50

'CASE', GENERALIZED STRUCTURE 111,190

'CASE', KATTENBERG 11,68

'CASE', MUNSON 11,48

'CASE', PERRY 11,78

CASE, SEL, AND COND 11,117

'CASE', SELZER 11,83

'CASE', WILSON 11,85

'CASE', WITT/BUSLER 11,87

DATA BASE ELEMENTS 111845

DATA STRUCTURES 111,118

DECOMPILER FOR SYN-FORTH III,61

SCREENS Page 10 SCHEENS CONTINUED

DISK BUFFER 9IAGNOSTICS 111,183

'DO-CASE', ELVEY II,57

'DO-CASE' , GILES II,66

EDITOR III,84

EDITOR EXTENS IONS 11,157

EDITOR EXTENSIONS 11,161

EIGHT QUEENS PROBLEM II,6

EXECUTION VARIABLE 11,111

'EXPECT' III,7 with user defined backspace

FILE EDITOR 11,142

FILE NAMING SYSTEM 11'30 FORGIVING FORGET 11,155

FORTH LEARNS GERMAN It5

GAME OF 31 111,154

GAME OF MASTERMIND 111,158

GAME OF REVERSE 111,152

GLOSSARY DOCUMENTATION 1,44

GLOSSARY GENERATOR III,7

GRAPHICS (TEK 4010 SIMULATION) 111,156

GREATEST COMMON DIVISOR 11,167

HELP I,19

HIGH SPEED DISK COPY I,34

HUNT FOR CONTROL CHARS. 111,140

INPUT NUMBER WORDS 11,131

INTERRUPT HANDLER 111,117

JULIAN DATE 111,137

LOOP CONSTRUCT II,26

SCREENS Page 11 SCREENS C OlJT I NU E D

'MATCH' FOR EDITORS 11,177

MICRO ASSEMBLER 111,128

MODEM 111,162

MUSIC GENERATION III,54

OPT IMI2 ING DIC'I'I ONARY SEARCHES III,57

PROJECT BENCHMARK 11,112

RANDOM NUMBER GENERATOR II,34

' SEARCH ' II1,lO for a string over a range of screens

SECTOR SKEWING FOR CP/M 111,182

SIEVE OF ERATOSTHENES 111,181

SOFTWARE TOOLS II1,lO

STACK DIAGRAM PACKAGE III,30

STACK INTO VARIABLES 111,185

STRING STACK 111,121

SYMBOL DICTIONARY 11,150

THEORY THAT JACK BUILT II,9

'TO' SOLUTION I,40

'TO' SOLUTION CONTINUED I,48

TOWERS OF HANOI II,32

TRACE COLON WORDS II1,58

TRANSIENT DEFINITIONS 111,171

TREE DELETION IN FASL 11,103

TRS-80 FLOATING POINT 111,184

'VIEW' III,11 using 'where'

'..I.. 11,168 6502 ASSEMBLER I 11,149

8080 ASSEMBLER 111,180

SCREENS Page 12 INDEX CONTINUED

INDEX COMPILED COURTESY OF M. TASSANO 936 DELAWARE WAY LIVERMORE,CA. 94550

SCREENS Page 13 FQflTH DIMENSIONS

JUNE/JULY 1978 VOLUME 1 NO, 1

ED I TOR I AL : WHAT IS THE FORTH INTEREST GROUP?

The Forth Interest Group, which developed in the fertile ground of the computer clubs of the San Francisco Bay Area, grew in a few month8 from nothing to where we are now getting several letters a day from all over the aountry. ' With this increasing public interest we need to let people know what we are doing and why, what we would like to see happen, how others can be involved, and what we can and cannot do.

We are involved because we believe. that this language can have a m8jor effect on the usefulness of computers, espeoially small oomputers,' 8nd we want to see it put to the test. Increasingly software is becoming the oritioal, limiting factor in the computer industry. Large software proJects are especially Uifficult to develop and modify. Few are happy with prevailing operating systema, which are huge, hard to understand, inoompatible with each other, and without unity of design.

The Forth language is its own operating system and text editor. It ia interaotive, extensible (including user-defined dit8 types), structured, and recursive. Code is so compact that the entire system (mostly written in Forth) usually fits in 6K bytes, running stand-alone with no other software required, or as a task in a aonventional operating 8Y8t.m. One person can understand the entire Forth system, Oh8nge any p8rt of it, or even write a new version tram scratch. Run-time effioienoi.8 are as little as 30% slower than straight maohine oode, and even less if the system's built-in assembler is used. When the assembler la not used, programs can be almost completely transportable between m8ohines. Any large Forth program is really a special-purpose, 8Pplfo8tlOn-Oriented language, greatly facilitating maintenance and modification. We don't yet have conclusive data, but typioal program development times and costs seem to be a fraction of those required by Fortr8n or assembly. Forth is especially useful for real-time, oontrol-type' applications, for large projects, and for small machines.

The problem is aV8ilability. Users have shown an ease of learning after they have a system available. The Forth characteristics of postfix notation, struotursd conditionals, and data stacks are best understood by UIe. To eaoourage Forth programmers, we need readily available systems even of. modest performance. We hope that three levels will be available:

1. Demonstration - free ( or under $20. 1 introductory version without file struoture which compiles and executes from keyboard input.

PAGE 1 I FORTH INTEREST GROUP ***** PO. BOX 1105 **-** San Carlos, Ca. 94070 3. Professional - Commercial products for lab or industrial use and software development. ($1000. to 82500.)

Today the serious personal computer user holds the key to wider availability of the language. These users - generally engineerb, businessmen, programmers - combine Professional competence and commitment with the freedom to try new methods which may require a lot of time and tinkering with no definite guarantee of payoff. Practically everyone involved with the Forth Interest Group has both a peraonal and a professional interest in computers.

The Forth Interest Group is non-profit and non-commercial. We aren't associated with any vendor, no one is making money from it, and we are all busy with other work. We are an information clearinghouse and want to encourage distribution of all three of the previously mentioned levels of Forth. We do not have a Forth system for distribution at this time, and we don't want to get into the software or mail-order business because this is best left to OOmpanIes or individuals committed to that goal. Naturally our critical issue la how to keep going over the long haul with volunteer energy. We need cost-effective means of information exchange.

At present we are writing for professional media, putting out this simple newsletter, and holding occasional meetings in the Bay Area. Also, we are developing a major technical and implementation manual, to be published in a journal form as four installments, available by subscription. While we cannot answer all of the mail individually, we certainly read it all, to answer. it in the newsletter. While we cannot fill orders for software or literature, we will try and point you to where it is available. We weloome your Input of information or sugaestions, how YOU could help, what YOU would like to see happen, and where we should 80 from here.

Dave Bengel - Dave Boulton - Kim Harris - John James Tom Olsen - Bill Ragsdale - Dave Wyland

PAGE 2

FORTH INTEREST GROUP ***** PO. Box 1105 .*-** San Carlos, Ca. 94070 EVOLGTION OF A FaI a G a FORTH FREAK

By Tom Olsen

I have been actively Involved in the Personal computing movement since early in 1979 when I shelled out $120. for an 8008 chip. Since that time my hardware and software have evolved into a very powerful and useful system, of which FORTH is a principal component. The system consists of an l.SI-11, 28K of memory, 2 Diablo disks, an LA30 DECWRITER, a niablo HYTYPE-I printer, a VDM-1 display, and dual floppy disk drives. Obtaining an operatJng system which would effectively utilize all of this hardware initially appeared to be much too expensive for an individual to buy, and far too complex to write from scratch. This attitude changed when early in 1976 I read a technical manual describing the internal organization of a relatively unknown "language" called FORTH, Here was a programming system which included not only an editor, assembler, and file maFagement system, but the inherent capability to be rapidly expanded to perform any coaputer function I could define. The best part was the fact that the central core of this programming system was relatively small and would easily fit into 3K of memory. The large majority of the system Programming could be done in terms of high level functions which 1 would have She freedom to define.

After about three months of late nights anb pulling my hair out, I finally had a stand alone FORTH system which I could bootstrap and then use to load application vocabularies from disk. Once the basic Implementation was fully debugged my general throughput of Useful a?p:lcation software increased to a level I never would have thought posafble. I can't over-emphasize the satisfaction associated with inplementing the language from scratch, An added benefit of this approach is the flexibility derived by having a ?OO% understanding of ALL of the code your machine is executing.

Today I have application vocabularies which can do everything from playing a BACH minuet on a cdmputer controlled synthesizer to generatint?, sorting, and printing the FORTH INTEREST GROUP mailing list. It is my hope that with the continued growth of the FORTH INTEREST GROUP and the establishment of some syntactical standards, widespread exchange of applications vocabularies will greatly enhance the computing power of all users of FORTH-like languages.

PAGE 3

FORTH INTEREST GROUP **a** RO. BOX 1105 ***** San Carlos, Ca. 94070 USING FORTH FOR TRAilEOFFS BETWEEN HARDWAKE/F I RMWARE/SOFTWARE

By Dave Wyland

FnRTH provides a unique capability for changina the tradeoffs between software, firmware, and hardware. This capability derives from the method cf nested definition of operators in FORTH.

Firmware (i.e. microprogramming) can add new instructions to the instruction set of an existing machine. New hardware designs can also add instructions to 81; existing set, with the Z80 upgrede of the 8080 serving as a good example. These new instructions could significantly improve the throughput of a system in many cases: however these new instructions cannot be used with existing software without rewriting the software. This is because current software methods such a3 assembler language, BASIC interpreters, FORTRAN compilers, etc., create software programs a3 one list of instructions. To add improved instructions to a program generated by a FORTRAN compiler involves rewritin& the compiler to efficiently use the new instructions and then recompiling the program. This is not a trivia? task since decisions must typically be made a3 to when to Use a new 12StruCtlon. This is why each new machine requires a new, rewritten CORTffAIC' compiler. The fact that the job has been done many time3 before Is not very comforting.

With FORTH, however, operations are built-up of nested definitions with a common functional interface between operations. If a new instruction has been added to the computer's instruction set, it can be added to the FORTH system by changing a small number of deflnltlons, in the typical case. The method can be quite straightforward. Each new instruction does an operation which would have required Several instructions in the previous case. 0y identifying those FORTH definitions bhich could benefit from the new instructions and recoding them to include it, all software which uses the modified definitions is immediately improved. Also, very few definitions will have to be modified: Only those elenentry definitions with a high frequency of use need be modified to achieve throughput increase near the maximum possible.

Since the FORTH definitions are nested, the throughput gain of new instructions can be achieved by modifying a small amount of code, and the remain in& Structures remain unchanged. All existing application P?.ograms, translators, etc. are immediately improved without change1

PAGE 4 FORTH INTEREST GROUP .. . p. 0. Box 110 5 *.*. San Carlos, b. 94070 FORTH LEARNS GERMAN

By John James

Forth now understands German, thanks to the following redefinitions of the operations in the Decus (Caltech) Forth manual.

Many of the operations were mathematical symbols, and of course they did not have to be translated. Of the rest, the control operations (IF, THEN, ELSE, BEGIN, END, DO, LOOP, +Loop) are special, because they are "immediate operations"; that is, they are executed at compile time. Just redefining .their names would not work, because they would try to execute right in the definitions. SO their original definitions were copied, but with the German names.

Program development time for bilingual capability, two hours. Memory required, 600 bytes. Effect on run-time execution speed, zero.

BLOCK 30 1 ( GERMAN. JJ, 6/19/78) 2 : ARWFRFFN DROP ; : IIRCR OVER ; 3 : VFRT SWAP ; : SPARPN CAVE ; : IINSPAFFN UNSAVF ; 4 : VNBPDTNCT ABS ; : UND ANn : 5 : YWHST MAY ; : MINPPCT MTN : : RRST Yon ; 6 : 09ER OR ; : /RFST /MOn ; : OSRTZEN OSRT ; 7 : ISFTZEW 1SRT ; : HTFR PERF ; : VRRCESSF!N PORGPT : 8 : SCWLUSSPT, CODE ; : RESTAYDYC; CWSTAYT 9 : CAYZE TNTFGPR ; : ORDNWUC ARPAY ; : IORD~WCTARRAY ; 10 : SETZEN SET ; 11 : AUPS-LAUFBNDE UPDATE ; : AUSRADTFREN ERASE-CORE : 12 : LADEN LOAD ; : XURUCK CR ; 13 : SCHREIBEN TYPE ; : EASIS BASE ; 14 15 16 ( THE SAME: DUP, MINUS, =L, BLOCK, ;S, PI ;s

The control operation definitions (OB, DANN, SONST, BEGINNEN, ENDEN, TUN, SCHLINGE, +SCHLINGE) are not shown here; they are'all short (one line), and exact copies of the English operations. (Incidently this particular vocabulary is a rough draft; we have not seen the results of the International Forth Standards Team, which is currently at work.) The word GERMAN is defined on the load screen, SO that the Forth user can call in the German vocabulary when desired. The following session shows the entry and execution of a fibonacci

PAGE 5

FORTH INTEREST GROUP ***** PO. Box 1105 ***a* San Carlos, Ca. 94070 sequence pr mi German (until 16-bit overflow). FORTV L@AD OK GERMAN OK : PRUFUNG 0 1 30 0 TUN VERT DUP . UBER + SCALINGE ABWERPEN ABWERPEN : OK PRUFUNG 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 177, 28657 -19168 9489 -9679 -190 -9869 -10059

On a (slightly) more speculative note, why not extend this scheme to a computer assisted international language for computer conferences, elcctronic mail, and international data-base utilities? Clearly natural lanquage is too free, and computer languages like BNF arc too rcstrlctivc, to bc feasible. But a hybrid, a vocabulary of several hundred unambiyuous words (each used in one sense only), and perhaps some computer-oriented syntactical markers, should be enough for useful dialog within a particular interest area. If it works for two languages it should work as well for any number. The final test - whether international teams could collaborate, after minimal training - would take a few weeks programming at most, after the vocabularles and terminal interfaces had been determined.

FORTH MAILBAG By Dave Bengel

The Forth Interest Group developed from several people in the San Francisco- San Jose area who have been working on Forth for the last year and a half. Until about six months ago most of these users were unaware of each other. Until the publication of the article by John James in Dr. Dobb's Journal (May 1978), about 80 percent of the group was from the Homebrew Computer Club - whose publication should also be watched for news concerning the F.I.G.

We now have nearly 200 names on the mailing list, and are receiving about six letters a day. The writers' main question is how to get a version for their machine.

We don't yet have a detailed description of the versions of Forth now available, nor is there a standard form of the language available €or various CPUs. Intense work on implementations is now underway; e.9. the Forth Interest Group implementation workshop. We Will keep you informed as more documentation and systems become available.

Your answers to the questionaire in this newsletter will help US keep a mailing list for interest-specific applications, documentation, CPU versions, etc. We appreciate any information you can send U8, particularly about Forth versions or variants which are running or being developed, or any software we can publish. We need your contributions to this newsletter -(which we hope Will grow into a journal).

PAGE 6

FORTH INTEREST GROUP .**=* ~0.BOX 1105 ===*= San Carlos, Ca. 94070 FIG LEAVES

IPlPLEMENTATI ON WORKSHOP

The Forth Interest Group will hold an implementation workshop, starting sometime in July. The purpose 1s to create a uniform set of implementations for common micros. The assembly listings which result will be available through F.I.G. to those who wish to dietribute specific versions.

This will be a small group, no more than ten, with only one person for each machine. There will be approximately four all-day sessions, over six weeks. Implementers must have access to their target machine, with an assembler and editor; floppy or tape is not required. The meetings wilL be to share notes and specific guidance on implementation details. At the end of the workshop we should have uniform Forth versions for all the machines.

We now have implementers scheduled for 8080, 6502, PACE, and LSI-11. We need implementers for 6800, 280, 1802, F8, System 3 (321, 5100. etc. We also need a project librarian with Forth experience.

If you are interested write to FORTH IMPLEMENTATION PROJECT, 20956 Corsair Blvd., Hayward, Ca. 94545.

COXTRIBUTED HATER IAL

Forth Interest Group needs the following material: (1) Manuals available for distribution. We can purchase copies and distribute, or print from your authorized original. (2) Name and address of Forth implementations for inclusion in our publications. Include computer requirements, documentation, and cost. (3) Technical material for the forthcoming journal. Both expositions on internal features of Forth and application programs are needed. (4) Users who may be referenced for local demonstration to newcomers, on a regional basis. Indicate interest area (i.e. personal computing, educational, scientific, industrial, etc.). (5) Letters for publication in this newsletter.

(PAGE 8 AND 9 BUNK) PAGE 7 FORTH INTEREST GROUP ***** PO. BOX 1105 ***** San Carlos, Ca. 94070 FORTH 0IMENSII)NS AUGUST/SEPTEMBER 1978 VOLUME 1 NO, 2

CONTENTS

HISTORICAL PERSPECTIVE PAGE 11

FOR NEWCOMERS PAGE 11

EDITORIAL PAGE 12

EXTENSI BlLlTY WITH FORTH PAGE 13 KIM HARRIS

GERMAN REVISITED PAGE 15 JOHN JAMES

FORTH LEARNS GERMAN PAGE 15 W.F. RAGSDALE

THREADED CODE PAGE 17 JOHN JAMES

FORTH DEFINITION PAGE 18

HELP PAGE 19

MANUALS PAGE 20 FORTH was created by Nr. Char108 H. to give it tho terseness of APL, Its Moore in about 1969 at the ~~ti~~~l~~di~clarity and consistency result from boing Astronomy Observatory, Charlottesvllle, VA. the product Of * sin6le mind* (as wre IPL It vas created out of his dissatisfaction and PASCAL). with avaliable programming tools, especially for automation. Distribution of hi8 work to other observatories has made FORTH tho de-facto ~tandard language for observatory Although the languago specification and automation. many implemontations are in the public domain, many other implementatfona and appliaation packages 3re available as flr. Moore and several associatea Program products of commercial supPlior3. formed Forth Inc In 1973 for the DU~DOSO.. of licensing and support of the FORTH Operating Sys em and Programming Language.-- Tho FORTH Intorest Oroup is contorad in and to supply aV llcation programming to Northern California. It was formed in 1978 meet customer^ un que requirements. by looal FORTH programmers to enoourage -1.0 of the language by the interchange of idear though seminars and publications. About 300

FORTH en OY J a synergism of its members are presently Associated into A features. It has none of the elephantine loo80 national organizatioH. ('Loose' means characteristics of PL/I or FORTRAN. It ha8 that no budget eiiats to aupport my formal a density and speed far surpassing BASIC, effort.) All effort is on a Volunteer basis but retains an interactive nature during and the group is assOOi8hd with no Vendors. progr an development. Since it la extensible, special vords are easily defined ;S Y.F.R 8/20/78

L)-~~~~ FOR NEWCOMERS FORTHlistings comb of ~equmeud "wcmh" th& aearte and/a conpile. Whm yau hQV. lhrdld a glw md a few sample lirting, p sharld dovolop tho ability to udmtand tho adim of new wonk in t.nrr of tholr d4n- ition conpooenk. Fathe tima bekq, m pr& a rinp- lifid gl- of tho undefined w& in thh tare d FORTH DIMENSTONS. Far a fullr Ilsting rdfa tho F.1.G GI-.

: xxx ..... ; I:' amat- a now wad mmad ka' ad carpila th following w& (represented d ....)until ding I;'. Whon ku' is Idaud, it 0t.Cvhr tho womb rbh ol)u L noma until the ';'.

CONSTANT VARIABLE Eoch o new wad with th. following nomot which tdta its value from the ruder -@ bh. IF ELSE THEN A tost is mode at 'IF'. If hue, tho wads until th~ ' ELSE' and sklp until THEN. If f ah, Alp untllELSE md axecute until THEN.

BEGIN END At END a tost is made; if faho, uecvtlon nhrrn to 8EGIN; dm~wisocantirue dud.

DO LOOP LEAVE At 00 o limit md fin, Index cn rwd. At LOOP, tho Index is in-4; until tho llmk Is dd,r~bartlar duns to DO. LEAVE facrr eacecvtian to ai?d LOOP. DUP DROP OVER SWAP ROT + - / Thasc w& weon rumban in a stock 0 than do in a HP calolldcr. If ywlike HP, you'll ba FORTH.

>R R) X? mwas the tap stock rumba to amth R, rshsiva it back to tho original stock. PAGE 11 FOSIH INTEREST GROUP ***** RO. Box 1105 ...*=San Carlos, Ca. 94070 8 EDITORIAL 6 L FORTH DIMENSIONS is dedicated to the promotion of extensible, threaded languages, primarily FORTH. Currently we Id are seeing a proliferation of similar languages. we will .c review all such implementations, referring to sources and id 10 availability. Our policy is to use the developing "FORTH 77'' Ln International Standard as our benchmark. '8 I* Variant languages, such as STOIC, URTA, and CONVKRS, will I¶ >O be evaluated on their advantages and disadvantages relative to a FORTH. However, in evaluating languages named FORTH, we will 1) FORTH I1 note their accuracy in imolementinq all features. We 13 expect complete versions named FORTH to contain: I. 1. indirect threaded code D 2. an inner and outer interpreter 3. standard names for the 40 major primitives 4. words such as ;CODE, BLOCK, DOES>, (or ::), which allow increased performance.

. We hope to enable prospective users/purchasers to correctly select the version and performance level they wish, to foster long-range growth in the application of FORTH. W.F.R.

CONTRIBUTED MATERIAL

FORTH Int- Gmps needs the following material :

. 1. Technical mdarial for inclusion .in FORTH DIMENSIONS. Both ~RIorrron internal fdum of FORTH ond cpplicab'm program are apprecidod.

3. Manuals available for distribution. We can purchase capias and distribute, or print from yout Cuthor'ud original. 4. Lettam of geneml tntamt fa publtcatbn in this n-ldter. d. 5. &a who may be dorend for local denwddon to nawccumws. 170 PAGE 12 FORTH INTEREST GROUP ****. PO. BOX 1105 ***** San Carlos, Ca. 94070 Quantum Uechanics:

EXTENSlSlLlTY WITH FORTH

Eleatricity and Uagnetism: The purpose of any computer language (and its compiler or interpreter) 1s to brid8e the gap between the “language” the machine understands (low level) and a language people understand (high level programming language ). There are many choices for human-understandable languages: natural languages and artificial langUagOs. The choice of language should allow Matrix Algebra: Convienient, terse. and unambiguous Specification of the problem to be solved by The trace of a matrix is equal to the suu of the computer. Ordinarily only a few its eigenvalues. computer languages are available (0.g. BASIC, FORTRAN, APL). These were designed for certain classes of problems (such as mathematical equations) but are not suitable For others. The level of a language is a mea.sure of suitabillty of that language for a Particular application. The hi(rher the Knitting: level, the the progrem. By definition, pfe‘tR: highest level would allow a given problem to be solved with one K2 tog.3(5) times. *kl, p2 operator (or command) and as many operands kl. as there are input data required. P2. k1, 91. kl, P3 to$., k repeat between .’a onoe more, kl, kl, p2, k1; kZ tog. 3(5) t A natural language (e.g. Engliah) might appear to be the best choice for a human-understandable computer language, and Poe try: for some applications it may be. But natural languages suffer from throe Shakespearean sonnets are in iambic limitations: verbosity. ambiguity, and pentameter and difficulty to decipher. This is partly consist of three quatrains followed by a because the meaning of a given word la aou p 1e t . dependent on its useage in one or more sentences (called “context aenaltiven) and because they require complex and nonuniform grammar roles with many exceptiona. Specialized vocabularies and grammars permit FORTH is capable of being matched to terse and precise expression of ooncepts for each of the above relations at a high level. re tricted sets of problems. For example, Furthermore, using the FORTH concept of consider the following definition of a vocabularies, several different applications sy logisa from proposltional caloulua: oan be resident simultaneously but the scope of rererenoe of component warda can be restriated (i.e,, not global). This versatility is beoause the FORTH language is extensible. In ract the normal act of programming in FORTH (1.0.. defining new This sentence may be translated into English words in terms of exiating worda) extends as ‘Given three stateaents which are true or the language1 POP each problem programmed false, if the truth of the first implies the in FORTH, the language is nxtended as truth of the second, this implira that if required by the 89eCial needs of that the truth of the second implies the truth Of problem. The final word defined which the third, then the truth of the first solves the whole problem la both an operator implies the truth of the third.. Ambiguity within the FORTH language (which is also a is hard to avoid in most natural languages. “oommand”) and the highest level operator The English phrnse ‘pretty little girls for that problem. Further, the lower level school” (when unpunctuated) has 17 poasible words defined for this problem will interpretationsf (Try it.) [3] frequently be useable for the programming of related problems.

As for the suitability of traditional programming languages (e.g. BASIC, FORTRAN, It is true that popular computer COBOL, PASCAL, APL) for ’almost a11 languages allow new funotlons to be added technical problems”, try coding the uaing SUBROUTINES and FORTRAN-like following “sentences“ in your favorite FUNCTIONS. However these cannot be used computer language: syntsotically the same as the operators in the language. PAGE 13

FORTH INTEREST GROUP *-.-* f?O. Box 1105 ---*. San Carlos, Ca. 94070 APL f8ns will point out that all th6 POr eX8mp10, lat.8 888UH 8 BASIC above true APL also. something interpreter doem not h8ve the log1081 AWD is for For operator. To be oonsistent with simi18r, 85 8imPlO 80 'AID" there 18 little existing oper8tors one would like to Use differenoe. However, APL allows only .AND* in the following synt8x: monndic (single operand) and diadic (two oper8nd) operators; FORTH operators can be A AND B written to accept as many operands as the progr8mmer desires. (A,B ere any valid operands). FUrther8Or0, one would want this new oper8tor to h8Ve a I The previous discussion addressed the priority higher th8n "OR* and th8n lower the it 1s .NOT* so that oxtansion of FORTH language, but al~ost 8s easy to extend the FORTH new compiler oontrol structures NOT A AND 8 OR C compiler1 (0.g.. the CASE oonatruct) oan be added would mean without ohanging any of the existing compiler. Or the existing complier can , bo (HOT A) AND (B OR C) modified to do something different. To m8lnt8in COmp8tibility With the %Xisting The only way to do this is to modify one'* compiler, the modifications could be part of BASIC interpreter. Although not impossible, a user- defined nvocabularyn so that both this is usually very diffioult because Of versions would be seleotively available. the following reasons: Furthermore, one oan write an entirely new oompiler which accepts either the FORTH (1) noat BASIC's are distributed without the language or another language. (Complete interpreter source code (or not in BASIC interpreters have been written in sachine-re8d8ble form). (2) One would h8ve FORTH. 1 to learn this progr8m 8nd design 8 change. One modiffoation might be 'p8tohed in', but many probably aould not. Such a modified The choice of a computer languaRe for n interpreter might not be oomp8tibh with given 8pplication (inoluding system future releases from the manuf8oturer. development) should optimize the following Errors might be introduced into other p8rts attributes: (1 ) Be terse (1.0.. the highest of the interpreter by this modifio8tion. levd for the application) (2) Be (3) The prooess of ohanging 1s time Un8DbigUOUs (3) B6 extensible (C.g., consuming. Before one could try the new language, data types, compiler) (4) Do version, one would have to assomble, link, effioient (5) Be understandable (e.g., self load, and poasibly write 8 PROM. (How long document8tion) (6) Be correct (e.g.,testing. wauld this take on your system?) proving 8ssertions, consistency checks) (7) Be struotured (0.g.. struotured programming, Another aItorn8tive would be to use a BASIC reentrant, reoursive) (8) Be maintainable WNCTIOI to add the AND operator, but it (e.g., mOdU18TI no side effeots) would h8ve to be referenoed 8s:

AND (1,B) FORTH is 8 oarpromise among theae goals. but comes Cl08er th8n most existing programming If NOT 8nd OR wore also ?UNCTIONS, (ROT A) l8ngU8(les. AXD (B OR C) would h8Ve to be written 888 ;S KIM HARRIS AND (YOT(A), ORtB,C)) This later form la lower levol, loss Rmwencss re8dab1eI and inoonsistent with the intrinsio operators. 1 H8lstead, Maurice, Lan~uageLevel: A Hissing Concept The 8ddition of an AND operator in in Information Theory. fORTH Is 88 simple as 8ny other prosramming Performanoe Evaluation addition; it would require one lino of Review, ACM SIGMETHICS, Vol. 2 .source aode. The FORTH 88seOlbler oould be Naroh '73. used to t8ke 8dVantclge Of 8 p8PtiOU18r prooessor's inatruotion, or tho oompiler 2 nofeeman, Horning, and Yortman, A could be used, resulting in m8ohine Compiler Generator, transport8bilityI Other dlfferencas from the Prentioe-Hall, 1970. eX8mple Of modifying BASIC 8Pe: (1) nothing existing in tho FORTH aystr need8 to be 3 Brown, James Cooke. Logl8n 1: A ch8nged, 80 no le8rning is required, no LO(lC81 L8ngU8g8, errors 8re introduoed to tha exiatlng Loglmn Instltude, 2261 Soledad SY8tem, 8nd OOmp8tibility with future R8noho R08d, rela8808 la preserved. The aouroe of the San Diego, CA (714) 270-9773 FORTH kernel is not even neoosmry. (2) Tha new oparmtor oan be tried ImDediatOly after it is defined; if it is wrong it oan bo fixed before 8ny further uae is made Of it. (3) This new operator is uaed exactly tho 8.- 88 any FORTH operator. SO it m8Y be mixed with oxlatlng oper8tors in 8 tOt8lly PAGE 14 Oonsist8nt ~anner.

FnRTH INTEREST GR()l.JP *.*** PO. BOX 1105 ***** San Carlos, Ca. 94070 GERMAN REVISITED FORTH LEARNS GERMAN

In the last issue of FORTH DIMENSIONS In the laat issue of FORTH DIMENSIOWS. we featured an article on natural language we showed how to create a bi-lingual (or name conversions FORTH. This article multi-lingual) version of FORTH, and listed for a simple program (set of FORTH definitions) will adC some additional ideas on the same for doing so. In respect to translation, topic. there are three different classes of FORTH words: First, the method shown (vectoring thru (A) Those such as mathematical symbols which code) does have some run-time overhead. don't need to be translated. Also, some code definitions cannot exocute properly when vectored in this manner, for (B) Words such as DO and IF which oannot bo example: translated by a simple colon definition; the existing definitions must be. re-copied and : R> R> ; given German names. (all the definitions are short - one line - however) will pull the call of R> from the return staok and crash. Wo would ultlmatoly liko (C) Other words, which could either be to translate names with: re-copied, or re-defined by a colon definition. 1. Preoisoly correct operat,ion during exocution and compiling.

In any case. separate vocabularies oan 2. A minimum of memory cost. be used to prevent spelling olashos, no matter how many languages are spoken by one 3. A minimum of run-tima oost. FORTH system. It can be possible to change languages as much as desired, even in tho 4. A minimum of compile-time cost. middle of a line. Let us now look at thrao specific examples to further clarify some of tho trade-offs Tho article stated that there was no involved. run-time overhead. Such performance is possible, but the example given does have a EXAMPLE 1 - COMPILING UORD run-time overhead of one extra level of nesting for each use of a word translated by Let us see how UBER oan be oreatod to a colon definition. self-compile. n ex The following article by Bill Ragebale is a more advanced treatment of language : D-E >R 2+ Q (Z+ optional on some systems) translation methods. It is written at the level of the FORTH systems programmer, and STATE e IF (compiling) DUP 1) - Ce 80 < it usea a more standard FORTH version than the DECUS-supplied version whioh was used in IF 2 - , ELSK (immediate EXECUTE THEN the article which appeared in FORTH DIUENSIONS 1. ELSE EXECUTE

JOHN S. JAMES THEN : : DO ENGLISH EMPLACE D-E ' , IMMEDIATE ; IMMEDIATE : UBER DO.KNOLISH OVER : : LADEN DO.ENGLISH LOAD ; eta.

When building the translation vocabulary, the oolon ': ' creates the word UBCR and then exooutes the immediate word DO.KNGLISH. DO.EN?LISH first omplaoes the run-tima procodure D-E' and then usea " , " to emplace the pmrameter field addres8 of' the next source word ( OVER). Finally, tho new word (UBER) in ~rkedimmodiate. so that PAGE 15 it will execute whenovor later en00untOrOd.

FORTH INTEREST GROUP **-*. PO. BOX 1105 ****. San Cartos, Ca. 94070 &XAHPLC RENAME Now we see how UBER executes. When it THREE - is interpreted fron the terminal keyboard, 'D-E' will execute to fetch the emplaoed PIA This last method is the most fool-proof within the definitions of UBER (by R> 2+ C). all. will just ro-label the name After checking STATE the ELSE part Will of Ye execute from its parameter field field of eaah resident word to the German OVER apuivalent. address. : HENAME ' U - DUP CI2 CO Uhen UBER is encountered by the AND (precedence bit compiler ln a colon definition, it will 20 WOAD + execute, as do all compiling words. Again HERE C@ R> 2+ @ will fetch the PFA of OVER to the HERE CI (store into length) The check will be stack. of STATE true and nene SWAP rc HOVE ; DUP 8 - C@ will fetch the byte oontaining the precedence bit. When compared to hex ( overlay old name ) 80, a true will result for non-immediate. and 2 will complle the oode field - , RENAME UBER address. OVER RENAME LOAD LADED However, if the had been immediate word RENAME BASE BASIS ( OVER 1sn-t ) the ELSE part will cxeoute the word as in nny compiling word. This method extracts the precedence bit of the old (English) dofinition and adds it to the length count of the new (German) name. The new name is then overwritten to the old The space cost of exanple 2 1s 14 bytes name field. There is no space or time per word ( 8 bytes per header and 6 bytea in cost I I The dictlonary is now truely the parameter field). Tee 0oD)pile ti- Cost translated. is the execution of D-E. There Is no ultimate run-time cost in compiled definitions. A final caution is in order for Examples 1 and 2. Some FORTH methods may EXAHPLE TWO - still give trouble. If you should try:

Another way is to define a UBER 'BUILDS-DOES' word E>G (English to German). It is then used to build a set of you Will find the PYA of UBER which is a translation words similar to a FORTH tranalatlng definition, and not the ultimate mnemonic assembler. run-time prooedure, (which is really in OVER). This would have disasteroua results : E>G e STATE e thought was the executing procedure, and you IF (oompiling DUP 8 - CC 80 < war. really altering the compiling word. IF 2 .. , ELSE EXECUTE THEN For this reason, ,the method ,of Example 3 is ELSE EXECUTE THEN ; the only truly fool-proof method. The renaming method has the added use of E>G USER OVER allowing you to change names in your running E>G LADEN LOAD 8ystem. For OXamplO, It 1s likely that the E>G BASIS BASE ...a. etc. old R in the international standard FORTH-77. You can simply update your system by the use of the E>G is a defining word that builds enoh. word RENAHE. German word (UBEp) and emplaces the Parameter field address of tho English word ;S W.F. RAGSDALE 8/27/)8 (OVER) into the new parameter field ( of UBER ), and finally makes UBER immodiate. When UBER is encountered by tho outer interpreter, it does the DOES> part. Tho parameter of UBER, (tho PFA of OVSR will be fetched and STATE tested. Sinoe executing, the ELSE part will exeouto OVER from ita parameter fiold address ( as in the example 1 ).

When oompiling, tho DOtS paTt will bo exeouted, again similarly to D-E' an in Example 1. the spaoe oost of the BUILDS-DOES method la 10 bytes per word ( 8 in the heador, 2 in the parameter field). The oompile time is the man as in Itramplo 1 and there is no run-time oost. PAGE 16

FORTH INTEREST GROUP ***a* t? 0. BOX 1105 a**** San Carlos, Ca. 94070 Bell (1) and Dewar (2) have described By the way, virtually everything in the concepts of Threaded Code (also called Forth is part of a dictionary entry: the Direct Threaded Code, or DTC), and an compiler, the run-time routines, the improvement called Indirect Threaded Code. operating system, and your programs. In or ITC. DTC was used to implement Fortran most versions, only a few bytes of code are IV for the PDP-11, and ITC was used for a outside of the dictionary. machine- independent version of Spitbol (8 fast form of the string-processing language The code address is crucial; this is Snobol). Forth is a form of 1°C. but the 'indirect' part of ITC. Every different from the scheme presented in (2). dictionary entry contains exactly one code address. If the dictionary entry is for a In DTC, a program consists of a list of "primitive" (one of the aC1 or so operation8 addresses of routines. DTC is fast; in defined in machine language), the code fact, only a single PDP-11 instruction address points two bytes beyond itself, to execution is required to link from one the parameter field, which contains the routine to the next (the instruction is 'JMP machine-language rout lne. @(R)*', where 'R' is one of the general registers). Overall, DTC was found to be If the dictionary entry is for a Forth about three percent slower than straight higher-level operation (a colon definition), code using frequent subroutine jumps and the code address poir?ts to a special "code returns, and to require 10-2Cpercent less routine" for colon definitions. Thls short memory. But one problem is that for 5 routlne (e.9. 3 PDP-11 instructions) nests variable the compiler had to generate two one level of Forth execution, pushing the short routines to push and pop that variable current 'I' register (the Forth 'instruction on the internal run-time stack. ') onto a return-address stack, then beginning Forth execution of the In ITC, a program is a list of addross-list in the new operation's addresses of addresses of routines to he parameter field. executed. A< used in (21, each variable had pointers to push and pop routines, followed If the dictionary entry is for a by its value. The major advantage over DTC variable, then the code address points to a Is that the compiler does not have to code routine unique to that variable's type. qenerate separate push and pop routines for The parameter field of a variable may each variable; instead these were standard contain the variable's value - or pointers library routines. Tha compiler did not if re-entrant, pure-code Forth 1s desired. generate any routines, only addressos, so it was more machine independent. In practice, ITC was found to run faster than DTC despito the extra level of indirection. It a160 Resu1t6 of Forth-typo ITC include: used less memory. (A) Execution is fane, e.g. two PDP-11 Forth is a form of ITC, with additional instruction executlons to transfer between features. primitives, about ten to nest and on-nest a higher-level definition. (Because of the Forth operations are lists of addrossos pyramidal tree-structure of execution, the pointing into dictiona9 entries. Each higher-level nesting is done less often.) dictionary entry contains: Yet the language is fully interactive.

(A) Ascii operation name, length of the (8) Forth operation names (addresses) name, and precedence bit; these are used aro used exactly the same regardless of only at compile time and will not b whether thoy represent primitives or discussed further. higher-level definitions (nested to any depth). Not even the compiler knows the (B) A link pointer to the previous difforence. In case run-speed optimization dictionary entry. (Thia is used only at is desired, critical higher-level operations compile time.) (such as inner loops) can be re-coded as primitives, running at full machine speed, (C) A pointer called the code address, and nothing else need by changed. which a?-w-ay-8 pints to executable machine code. (C) Forth code is very compact. The language implements an entire operating (D) A parameter field, which can system which can run stand-alone, including contain machine instructions, or Forth the Forth compiler, optional assembler, address lists, or variablo values or editor, and run-time system, in about 6k pointers or other information depending on bytes. (Forth can also run as a task under the variable type. a conventional operating system, which sees

PAGE 17

FORTH INTEREST GROUP ***** PO. Box 1105 ***-- San Carlos, Ca. 94070 it as an ordlnary assembly-language pr~ram, and Forth can link to other langusqea this way.) Code is so compact that appllcatlon-oriented utility routines can be left in the system perranently, vhere they ace lamediately available either as keyboard commands or instructions in programs, and they are used in exactly the same way in elther case. No llnkaqe edltlnq is needed, coNTRlsuToRs KIM HARRIS and overlays are unusual. W .F.RAGSDALE REFERENCES TYPESETTING TOM OLSEN X)HN JAMES (1) Bell, James R. Threaded code. C. MY 16, 5 (June 1973), 371-373. (2) Devar, Robert R. K. Indirect threaded ARTWORK ANNE RAGSDALE code. C. ACW lA, 6 (June 1975), 33m-331. ClRCUUTlON DAVE BENGEL

DATA PROCESSING P D P -11

FORTH DEFlN I T ION NOTES

FORTH is the combination of an - Tha second meeting of the FORTH extensible programming language and Intern8tional Standards Team will oocur in interactive operating system. It forma a Loa Angels8 on Ootober 16-19. Contact FORTH consistent and complete programming Ino. for additional information. environment which is then extended for each application situation. - A partially micro-coded FORTH-like language la desoribed in "Threaded Code for Laboratory Computers" by J.6, Phillips, FORTH is structured to be interpreted U.P. Burke, and C.S. Wilson, Dept. of from indirect, threaded code. Thi8 oode Ch@ml8tryl University of Arizona, Tucson, A2 consists of sequences of machine independent U5721. The article is published in Software compiled parameters. eaoh headed by a - Prrotioe and Experience, Volume 8, pages pointer to executable maohine code. The 257-263. Implementation is on a HP2100. user cr?atea hi8 own applioation prooedurea The article also doscribes the advantages of (called words'), from any of the exlotin6 threaded languages for laboratory worda and/or machine aaaembly language. New applloations. classes of data struoturea or procedurea may be created; these have a8SOOiated - A atorma of FORTH for the Apple and PET interpretive aids defined in either maohine 6502 based computers is available from code or high level form. Programma Conaultants, 3400 Yilshire Blvd., Los Angeles, CA 90010. Ye have not used theae enough to review them for this issue The user has aocess to a comput8tion but they have been shipped and do work. For stack with reverse Polish oonventlona. more information write to Programma Another stack is available, usually for Conaultanta or watch future issues of FORTH execution control. In an interaotlve DIUEY5IOYS. environment, each word oontaina a aymbolio identifier aiding text interpretation. The - FORTH Ino. is looking for a programmer user may exeoute or 006pile souroe text from with some systems-level experience using the terminal keyboard or mass storage FORTH or similar languages. Interested device. Raaident worda are provided for persona ohould contact FORTH Inc., (I15 editing and acoeaalng the data atorad on Manhattan Avenue, Manhattan Beach, maas atorage devioeh (dink, tape). California 90266, (213) 372-8493 .

In applicationa that are to run 'at8nd-8lone', a compaot croaa-oompilad form la used. It consists of compiled words, interpretive aide, and machine oode prooedurea. It la non-axtenaibla, aa tha aymbolio identifiers are deleted from aaoh word, and little of the uaual oparating ayate8 need be inoluded.

;5 U.F.R. &/26/78 PAGE 18

FORTH tNTERES1 GROUP RO. BOX 1105 .-..*San Carlos, Ca. 94070 SCR I 6 HELP

SCR i 7

oc Hap ) ti0 1 00 CONSTANT LASfoLIIW ( IS MOO0 OH MICRO-FORTH 24 CONSTANT #/LINE t WORDS PRINTED PER LINE ) 3 4 a .(YWIE C ENTER YIfH ADDRESS OF LW6TH BYIC 1 5 DW CO 7F AND OECIHAL 3 -R SPACE I* 3 TYPE SPACE I 6 f t *CODEoADDRLSS < WJTUZ YITH ADDRESS OF LMOW ewt J 8 6 * HM 5 OR SPACE J 9 10 t .HEADER C ENTER WITH ADDRESS OF LENGTH BYTE 3 I1 DIP *NME *CObE-ADDR€SS t 12 13 t ?TERMINAL 0 I C USER'S MACH!UE DWWDOJT TmINAC BRUK 1 i4 ( RETURN '0O"FOR NO 8Rw. CLnO '08' FOR A BRW 3 15 8 LOAD JS 0127778' YFR

SCR # 8 ABOVE YE SEE AN MlYlPLE OF ?HE LOADIN0 OF THE 'HELP' FROM DISC. If T#P( IS TESTED. AWD DWPS WE DICTIONARY* YE SEE WkLISTXN6 OF *HELP' AND THE WRDS IS USES, LISfllJ6 CONTINUES INTO ?ME RESfDWT'DLCTXOWART. BOOG LUG<# YCR

MANUALS

DECUS PDP-11 FORTH by Owens Valley Radio Observatory, California Institute of Technology, Martin S. Ewing. (alias The Caltecn FORTH Manual) Available from DECUS, 129 Parker Street, PK3/E55, Maynard, Mass. 0175'J. Ordering information: Program No. 11-232, Write-up, $5.00 . YORTH systems Reference Manual W. Hichard Stevens, Sep 76. Kltt Peak National Observatory, Tucson, AZ bS72b. (NOT FOH SALE)

L A B F 0 R T H An Interactive Language for Laboratory Computing, Introductory Principles, Laboratory Software Systems, InC., 3634 Nandeville Canyon, Los Angeles, CA 90049. $8.00 .

STOIC (Stack Oriented Interactive Compiler) by MIT and Harvard Biomedical Engineering Center. Documentation and listings for 8080 from CP/M Users Group, 164 west b3rd Street, Hew York, N.Y. 10024, $4.00 membership, $6.00 per 8" floppy, 2 floppies needed.

CONVERS The Digital Group, Box 6528, Denver, CO 80226 tlanual: DOC-CONVERS $12.50 ,

UHTH (University of Rochester FORTH) , Tutorial Manual , Hardwlck Yorsloy, Laboratory for Laser Energetics, 250 E. River Rd., Rochester, NY 14621 . microFORTH Primer FORTH, Inc. 815 Manhattan AvB., Manhattan Eeach, CA 9026b (moving soon) $15.00 . (Page 21, 22 Blank) PAGE 20 FORTH INTEREST GROUP .**** RO. BOX 1105 ***** San Carlos, Ca. 94070 FORTH DIMENSIONS

OCTOBBR/IOVEMbER 1978 VOLUME 1, NO. 3

7 CONTENTS

HISTORICAL PBPSPBCTIVB Page 24

COITPIBPTED UTBPIAL Paee 24

DTC VI ITC for FORTH Page 25 David J. Sir.#

D-CHARTS Page 30 Kim Earria

?ORTH VI ASSEMBLY Page 33 Richard 1. Main

HIGH SPEED DISC COPY Page 34 Richard B. Main

SUBSCRIPTIOII OPPOPTUIIITY Page 35

FORTH INTEREST GWP ***a* RO. Box 1105 .**** San Carlos, Ca. 94070 HlSrORJCAl PERSPECTIVE to give it the tmrsanm8a It8 FORTH was oreated by Hr. Charles H. or APL. clarity and conaiatanoy rearlt from bolas noore in about 1969 at the National Radio Astronomy Observatory, Charlottesvllle, VA. the pro4uot OF a single 8lnd. (an vmrm A?% It was created out of his dissatisfaotion and PASCAL). wlth available programming tools, espeoially for automatlon. Distribution of hla work to other observatories has made FORTH tho de-facto standard language for observatory Althoufi tho language opaolfloation and automation. many lrpleoentatlons are in the publla domain, many other impleaentatlona and application packages 8m ar8ilablo 8. Mr. noore and several aaaociates program products of cormmrolal 8uppllera. formed Forth Inc. in 1973 for the purpose of llcenalng and support of the FORTH Operating System and Programming Language, The FORTH Interest Group 18 omnterad ln and to supply application prograaaing to northern California. It waa formed in !978 meet customers’ unique raquirementr. by 10081 FORTH programrerm to aocour8ga Uam of the languago by the intmrohanae of ldeam though 8emiaars and publloatlona. About 300 FORTH enjoys a synerglsm or its members are presently a88OOl8tOd ?nto a feature*. It has none of the elephantine ~oosenational organization. ( ‘Looam moans characteristics of PL/1 or FORTRAN. It has that no budget oxista to support any form1 a density and speed far surpaorlng BASIC, effort.) All effort is on a volunteer br8fa but retains an interoetive nature during and the group la asmoalatod with no vondors. program development. Sinoa it 1s extenslble, special wordo are easily defined ;3 W.?.R 8/20/78

CONTRIBUTED MATERIAL

PAGE 24 FORTH INTEREST GROUP ..*** PO. Box 1105 ---** San.W@s, Ca. 94070 DTC VERSUS ITC FOR FORTH ON THE PDP-11

By David J. Sirag Laboratory Software Systems, Inc. 3636 Mandeville Canyon Road, Loo Angeles, CA 90049

During the design of LABFORTH, the FORTH implementation by Laboratory Software Systems, the choice had to be made between direct threaded code (DTC) and indirect threaded code (ITC). A detailed analysis showed DTC to be significantly Superior to ITC in both speed and site. This analysis contradicts the findings of Dewar (ACM June 1975) which were referenced in the "Threaded Code" article in the August 1978 issue of FORTH Dimensions. Dewar compared his use of ITc with DTC as usqd for PDP-11 FORTRAN. His analysis does not apply to the implementation of FORTH on the PDP-11.

The FORTH analysis involves 3 types of definitions - low level (CODE), high tevel (COLON), and storage (variable,etc). The low level definitions will be encountered most frequently by far because of the pyramidal nature of FORTH definitions. On the other hand, storage definitions will be encountered far less frequently in FORTH than in FORTRAN because in FORTH the stack is used extensively white in FORTRAN no stack is available. Also, when storage locations are used in FORTH operators are available which minimize the number of references. For example, in FORTRAN

COUNT = COUNT + 1

involves 2 references to the variable COUNT, while in FORTH

COUNT 1+! involves only 1 reference. It should be noted that in LABFORTH, l+! 4s a primitive, but it is not in some other versions of FORTH. Another factor which reduces the references to storage locations is that in FORTH literals are placed in line and handled by a reference to the LITERAL (low level) routine.

The OTC and ITC routines for the 3 types of definitions are shown below, they are condensed to show only the relative PDP-11/40 overhead. The register notation in the routines is as follows:

Q is the cue register (R5) which points to the next address. It is called IC (instruction counter) in some literature.

S is the stack pointer (R1).

R is the return stack pointer (R6). P is the (R7).

RO is a temporary register assumed to be available.

0-> PAGE 25 FORTH INTEREST GROUP .**** PO. BOX 1105 ****. San Carlos, Ca. 94070 DTC AND ITC ROUTINES

DfC

LOW NARE LEVEL E DEFINITION LINK LINK ( CODE 1 m bCODE ADDR RACHINE MACHINE OVERHEAD CODE OVERHEAD 1 WORD 3 WORDS 2.3 USEC 4.6 USEC

, = NEXT MOV (~)+,Ro = NEXT JMP a(RO)+

H16M NARE NAME LEVEL 8 8 DEFINITION LINK LINK , NEST: (COLON) JSR a,a(P)+ = NEST CODE ADDR 4'MOV Q,-(R) MOV RO,Q AODRESSE S ADDRESSES MOV 2)+,RO JMP a(Ro)+

OVE RHEA0 OVERHEAD 2 WORDS 2 WORDS 8.0 USEC 14.0 USfC

ADR UNNEST:\

STORAGE DEf X N I ?IOU 4 Y A RA I8Cf 1

OVERHEAD OVE: R H E A 0 2 UORDS 1 WORD 5.7 USEC 4.6 USEC The distinction between DTC and ITC as applied to FORTH is that in DTC executable machine code is expected as the first word after the definition name; uhile, in ITC the address of the machine code is expected. Thus the DTC space advantage in the entry to a low level definition is obvious. The machine code of the low level definition terminates with the "NEXT" routine. In DTC NEXT is a 1 word routine while in ITC the extra level of indirection results in a 2 routine (Note: a JMP NEXT would also take 2 words).

In the high level definition the machine code of the "NEST" routine is stored in line for DTC, but since it is only 1 word, it takes no more room than the pointer to the "NEST" routine. However, the 1 instruction for DTC takes considerably less time to execute than the 4 instructions for ITC (Note: replacing the last 2 instructions with JMP NEXT would take even more time). The remaining words in the high level definition are addresses in both cases. The last address points to the UNNEST routine which again is more complex for ZTC because of the additional indirection.

r DTC VERSUS ITC OVERHEAD SUMMARY

PLC Kc QTC ADVANTAGE I Low level 1 word 3 words 2 words ( CODE 1 2.3 usec 4.6 usec 2.3 usec

High level 2 words 2 uords 0 words (COLON) 8.0 usec 14.0 usec 6.0 usec

Stor age 2 words 1 word -1 word (VARIABLE) 5.7 usec 4.6 usec -1.1 usec

The summary table shows that DTC has the overhead advantage in both low level and high level definitions; while ITC has the advantage in storage definitions. Considering the high occurrence of low level definitions and the low usage of storage definitions, one can see that a FORTH implementation with DTC has I significant speed and space --> PAGE 27 FORTH tNTEREST GROUP .**** RO. B~x1105 ***** San Carlos, Ca. 94070 si ca ba advantage over one using ITC. To make the advantage more concrete Ha weights should be assigned to the various definition types. If we di have a program containing 500 definitions (including the standard el FORTH definitions), we might expect 200 low level.. 250 high level, and 50 storage definitions. Using these numbers the size advantage of low level, high level, and storage should be weighted -4, -5, and .l respectively. During the execution of a program, ue might expect the frequency of occurrence of low level, high level, and storage to be 60%, 20%, and 20X respectively. The result of applying these weights is shown in the following table.

a 1 WEIGHTED ADVANTAGE OF DTC OVER ITC

i! SIZE ADVANTAGE SPEED ADVANTAGE I Pi

Low level 2 x -4 = -8 words 2.3 x .6 = 1.38 usec

1 High level 0 x .5 = 0 words 6.0 x -2 = 1.2 usec

Storage -1 x .1 = 0.1 words -1.1 x .Z = 0.22 usec

Weighted advantage .7 words 2.4 ustc

J

Thus using the weighted advantage for DTC we would expect to save -7 words in each of the 500 definitions which is a total of 350 words. Also each time a definition is executed the overhead would be 2.4 uscc less. This may represent a savings of 20 or 30% of the total execution time of the frequently used short definitions.

The remaining advantage that is claimed for ITC is one of machine indepeodance because no machine code appears in the code generated by the compiler. But even this advantage is illusionary since fORTH programs are transported in source form. In fact on most systems they are compiled each tine they are loaded via the LOAD command. Thus, after a FORTH system is hosted on a given computer, the machine code that is generated by the compiler is suitable for that particular machine; this includes the machine code generated for the DTC routines. If one did try to introduce the concept of FORTH portability at the object code level by restricting the ~rogramsto high level definitions and placing all machine code in a run-time Package, he would still probably have machine dependencies in byte vtrsus word addresses, floating point format, and character String representation. In any case, current FORTH Cnplentntations do not claim transportability at the object code level. --*

PAGE 28

FORTH INTEREST GROUP PO. Box 1105 =**** San Carlos, Ca. 94070 shown that when the special The ysis of DTC versus ITC has PDP-11 as opposed to FORTRAN is esented by FORTH on the s it ua t ion advantages over ITC in tse of DTC provides signif icant considere TH was implemented using DTC. and sizt, Thus LABFOR both spe colnput er, the choice may be However, t is rehosted on another and 1ed as part of the rehosting different The change would be h which would be required. effort a1 uith all the other change s ;S DJS

FORTH Interest Group LABORATORY SOFTWARE SYSTEMS, INC. 3634 MANOEVIUE CANYON ROAD 781 Old Country Road LOS ANGELES. CALIF. 90049 San Carlos, CA 94070 121 3) 472-6995

Dear Figgy,

FORTH Dimensions is just the sort of communications vehicle which is needed by the FORTH community for both users and vendors. My payment for a subscription is enclosed.

AS Or. R.F, Harper indicated in an earlier letter, we at Laboratory Software Systems have developed a version of FORTH on the PDP-11 called LABFORTH. As the name implies, LABFORTH contains features which make it particularly suitable for the scientific laboratory environment. This environment includes high speed data collection and analysis; thus particular attention is given to making LABFORTH fast. For this reason the direct versus indirect threaded code discussion in the Code article in the AugustfSeptember 1978 issue of FORTH Dimensions was of particular interest. Our analysis of DTC versus ITC was an important aspect of the effort to design LABFORTH for maximum speed. DTC proved to be faster than ITC and as a bonus required less space. An article on this analysis is enclosed for your paper. It contradicts Dewar's analysis of DTC versus ITC for DEC's FORTRAN, but his analysis cannot really be applied to FORTH. If DEC had used DTC in a more elegant manner, DTC may also have fared better in the FORTRAN case.

Hopefully the DTC advantages will persuade you to delete the requirement that FORTH be implemented with ITC. The programming techniques used in implementing FORTH ought to be left to the designer and his results should to be evaluated by benchmarks.

I look forward to your next issue of FORTH Dimensions.

Davs Sirag

Laborator? Software Systems, Inc.

PACE 29

FORM INTEREST GROUP **.=* RO. BOX 1105 **a*- San Carlos, Ca. 94070 D-CHARTS

uir Harris

An alternative style 0'f flowcharts called The only mlinesm in Drcharts are u8ed to D-charts will be descri.bed. But first the show nonsequential Control paths (e.g., purpose of flowcharting will be discussed as conditional branches, loops). In a proper well as the shortcomi ngs of traditional D-chart, no lines go up: a11 lines either go flowcharting. down OK sideways. Any need for line8 directed up can be (and should be) met with A flowchart should be a tool for the design the loop symbols. This simplifies the and analysis of sequential procedures which reading of a D-chart since it always starts make the control flow of a procedure clear. at the top of a page and ends at the bottom. With FORTH and other modern languages, flowcharts should be optimized for the It is customary to underline the entry naae top-down design of structured programs and (or FORTH definition name) at the top of a should help the understanding and debugging D-chart. of existing ones. An analogy may be made with a road map. This graphic representa- tion of data makes it easy to choose an opt imum route to some destination, but when 2-WAY BRANCH SYMBOL driving, a sequential list of .instructions is easier to use (e.g., turn right on 3rd In PORTR, this structure takes the form; street, left on Ave. F, go 3 blocks, etc.). Indentat ion of source statements to show condition IF true phrase control structures is helpful and is recom- ELSE false phralle mended, but a two dimensional graphic THEN . display of those control structures can be superior. A good flowchart notation should Another FORTH structure which is used for be easy to learn, convenient to use (e.g., conditional compilation has more mnemonic good legibility with free-hand drawn names : charts) , compact (minimizing off-page lines), adaptable to specialized notations, condition IFTRUE true phrase language, and personal style, and modifiable OTREFWISE false phrase with minimum redrawing of unchanged sec- ENDIF . t ions. The D-chart symbol has parts for each of Traditional flowcharting using ANSI standard these elements: symbols has been so unsuccessful at meeting these goals that "flowchart' has become a dirty word. This style is not Structured, is at a lower level than any higher level language (e.g., no loop symbol), requires the use'of symbol templates for legibility, and forces program statements to be crammed false phrase ttUC phrase inside these symbols like captions in a cartoon. D-charts have a simplicity and power similar I to FORTH. They are the invention of Prof. words following BNDIP (or THBN) Edsger W. Dijkstra, a champion of top-down design, structured programming, and clear, ConC1s.e notat ion. They form a context-free The "condition" im evelwted, If it lm trua, the language. D-charts are denser than ANSI "tme phrase" lr executed; othenire, tho "falme flowcharts usually allowing twice as much phrase" i~ executed. The words follouing ElP)IF program to be displayed per page. There are (or TXEN) are unconditionally executed. only two symbols in the basic languager however, like FORTH, extensions may be added €or convenience. If either phrase Is omitted, am with Sequential statements are written in free form, one below the other, and without condition IF true phrase TilltN boxes. s t is tenen t a vertical line is drawn as shown: next statement I next statement Acondition 1 true phrase

--w PACE 30 FORTH INTEREST GROUP *..** PO. Box 1105 ***** San Carlos, Ca. 94070 LOOP SYMBOL A more general case is The basic loop defining syrbol for BEGIN first phrase D-charts is properly structured. condition IF second phrase AGAIN cond i t ion which is explained better graphically than verbally: :0 ,t 1 ?r 30 first phrase !I th +- condition re ts b 1. The symbol: I second phrase w a +- indicates that when the switch is encountered, the .“condition“ (on the aide line) is evaluated. Both previous symbols may be properly 1. If the “condition. is true, then nested indefinitely. The following example the side line path is takenr if shows how these symbols may be combined. I: false, then the down line is taken This is the FORTH interpreter from the (and the loop is terminated). P.I.C. model. 2. If the side line is taken, all statements down to the dot are executed. The dot is the loop end I INTERPRET BEGIN (’) IF HERE NUMBER >r symbol and indicates that control ELSE EXECUTE LC is returned to the switch. THEN 7 STACK AGAIN ; INTERPRET 3. The “condition” is again evalua- - ted. Its outcome might have until null word executed changed during the execution of >f the loop atatement. I search dictionary far next word Repeat these steps starting with Step 1. found This symbol tests the loop conditlon before executing the loop body. However, A other loops test the condition at the convert word execute word DO end of the loop body (e.g., .. LOOP to integer I and BEGIN .. END) or in the middle of the loop body. This loop symbol nay be extended for these other cases by adding a test within the loop body. Consider the FORTH loop structure push Integer BEGIN loop body condition END . The loop body is always executed oncer and is repeated as long as condition is false. The D-chart symbol for this c,check stack structure would be: d h

condition I: F

PAGE 31

FORTH INTEREST GROUP ***** RO. Box 1105 **.*. San Carlos, Ca. 94070 The condition uoually an index which n-WAY BRANCH SYMBOL is selects one Of the cases. The rejoining A structured n-way branch (Some- of control to a single line after the symbol cases are required by structured program- times called a CASE statement) may be defined for convenience. (It is func- ming. Depending on the complexity of tionally equivalent to n nested 2-vay the cases, this symbol may be drawn differently. branches). One style for this symbol 1s : I D-charts ace efficient and useful. They are vastly superior to traditional flovchart style. first case second case .. last case ;S KIM HARRIS

P.O. Box 8045 Austin, M 78712 Wwe&er 3, 1978 Editor, mrth Dimensicns:

Thank yw for your card ard s-nt letter. SE/l was written by -rid €&search Inc. I that I did mt get yw momr with c;roup, an sorry back to to be exactly uhat it says it is, a SYSIM languclge. a copy of the source code for my FQRPH system. is a mall interactive incranental capiler that ~tankly, I was surprised that p interested in SV1 are Mirect It is a 16 bit the system, since it is rather limited in facilities qenerates threaded code. ps;eudo am3 mfom with no other version in term of arachine for use on mini ad micro carputers. New definitions can bc added to an alreafy rid set names. I Stopped work on the systern just abut the intrinsic instructions. It is this extensibility time I &gan to receive ~nuals ~X~IS of fona arrd the that allows any user to create the most optinnnn IWUH form FIG. I see llow I wxld 6502 can hou add vocebulary his irdividd aeplicatim. an assembler, text editor, ard rardan block i/o.to for the system, but my duties at work and at school is a virtual stack Using the precluje any further developlent of U.T. €?3RRI for SW1 . iQ)1 mnctpt for foth variables ad instmctiars makes IKW. it pssible to exterd stepuiee progrdq to include stepuie debugging. SrJl this quite nicely. I want to especially thank you for informing does We RPN oclc of the nrwt effective means rn of Paul Bartholdi's visit to the University stack is also of of inplmmting tcp donr design, bottan up ding. lkxas. I was able to meet with him and we had a very stimulating discussion for about an hour and a StJl oprates on a pinciple of thrcakd mde. half. I was surprised to learn fmn him har widely All of the elements OF- SWl (procedures, variable, FORTH is used cormnercially, though usually under ampaler directives, etc.) referena the previous other nanes. We also discussed tu, extensions to the entry. Thus, each code indirectly "threads" the language that I believe greatly enhance it: (1) others ard is in turn threaded by the d follarirq syntax checkirq on cmpilatim for pmperly balancpd it. *am SW1 is a p;eudo machine, portability BDXN..EM) and IF..FJSE..lW3 constructs, and (2) the between different pruceseors and hardware is rcadily functions .n -" ard "PARI" to "PW that arrorplisbed. ?he low level interpreter is really allow explicit reference to paranetera on the stack. the Fcnadrine. It is slnall (only 11 byte6 are used), Finally, he showed me sane progr-ing exanplcs & fat. fran the Fwrm manual he wote which wide first- hand proof of the ease of prograuniq rather sophis- On of the mrrt poverful features of Syl is the ticated problem in FORTH. It is especially im- fact that is uses all on-line storage media as portant because moSt FPople in the ccmplter science . In effect the user can write departmnt here respond to my presentation of programs in SW1 using the full capacity of disk with a resnudirq lack of interest. Mter all, they storage and never be concerned with placement of keep abreast of the field and if they have not heard infomtion on the disk. SW1 allows you to progran of it .... machine codc procedures in assenbler uirq a high level language. This can optimize I/O OK math I have been promoting FORTH among the local rwtines. mnprter clubs Md lodc forward to the results of FIG'S micro ccnputer efforts. Plecse keep in tarh. ?hc abwe information was excerpted fran a press release of Nove&er 3, 1978. R>t further informa- Simeely yours, tion, contact nr. Dick Jones, Dnperical Research CKOU~,Inc., 28206 144th Avenue, S.E., Kent, WA Greg Walker 98031. Phap (206) 631-4851. PAC& 32

FORTH INTEREST GROUP ***** PO. BOX 1105 ***.* San Carlos, Ca. 94070 Here are some facts regarding Forth object Ihc abve exmples vhile rmt especially excitirq on the surface are quite interesting when you're size mcj exeuction S- versus w-1~ coding. actually writinq these program on a system installed mrm, ~m.,sane programers (myself inclded), with Forth and one that isn't. Using standard 0-m sane pretty incredible state- disk-based Assmbler system yw'd prcbably have to writs about Forth code resulting in less memory open an edit file, write the pmqra, close tne edit wid ( 1 ad execution speeds as fast as h-1~ file, call the assembler, and load the oblect file so written COQ (!!). 'R, help clear the air I'll try to you could use the debq program to execute. mybe explain those tuo outrageous clam. 10-30 minutes depending on the problem you have along the way. In Forth, you'd enter the code First, Forth code can run as fast, but not statement on the command line, carriage return, faster, using a constructional statement called ty "KEY", (a),and it's executing. 30 secOndS "Code" which is followed by a sort of mnemonic maxlmm! If you liked the way "KEY" executed you'd machine code string and a jump back to the Forth save it off on the disk using the Forth Editor. inner inteqxeter. It isn't reasonable to just have (Another 20 seaxds. ) one big aodc statement .for the %hole-ran. So this gets us into another Forth constructional The colon statemnt in brth was said to save man statentent called a "colon definitim'. in mry over Assembly, and provide the hign level languqe ability. An exanple code statement that Colon statements cost speed but save progrii~~~ would read the CRT keyboard cam& messages and then mry ~ycrkssenbly. Colon statements constitute execute the desired action could lodc like: the 'high level" aspect of brth but let's get badc to the point. : KL'YBQRW) 64 fl Do KEY 7F AM) Dup 0D = IF LFAVE THEN Loup MECVIF ; An exanple "code" statement in mcth to hendle the character input fmn a Cm to an Intel SeC 80/20 Keyboard is the label of this routine. Every mrould be: other word (Do, KEY, AND, =, LEAVE, THEN, LL)cB, and EXECVIE) requires tm bytes of mry. p-bit nunbers OODEKEY BDCINEDXNPRRCI1W3CSW require 3 bytes, 1 for the nunber am1 2 for a routine EC IbP A L H PNI IiPpusH JM€' that differentiates nunbers Era hods and provides these numbers on the stack for use by succeeding WE: Forth code statements allow beqin-end operations, e.g., 64 and B for 'Do'. and if-else-then constructs within the assembly. Also Forth requires source- "te mry saving can be visualized by thinking destinati-rand olganization of each of the routine "keybard" as a routire that looks assenbly statement (A L Mov instead of MDV like: LA)* ;a pmJran This exact sdme routine in k-1~ lm- ;a progrm guage would be: ;to stact a 64 locp :to inpit data ;place in next avail ;# for ANi) ;to AND it ;input status ;to WP data ;rotate reoeiver ready ;for (CR) test ;into carry bit :for (CR) test ;if (CR) leave loq, ;inpt CRP data ;to canplete IF ;push data on ;to loop 64 times ;stack in 16-bit :to Do ComMnd :format ;to UO next one bokiq at it this way, each CALL twes a byte. By entering ' KEY BD DUMP on the Forth system Fourteen bytes could be saved if the CALL OPCODE you'll get the object code displayed as: could be eliminated. Ihe result muld be the tw byte address' of everything to CALL. The innemst 4W0 DB 0P BP D2 08 4% CB Ec 6P €m-th interpreter uses these address' in serruence and 26 ~0 a 41 m is about 12 bytes of merory code and has ;he label 'NEXT'. This is exactly what the AeE+mbly code would pmduce if OSG'ed at 4flj7H ard the label HptGH = Thus, for just this single example, 14 bytes at 41H. WLP saved, at the cost of 12 bytes for "NMl". But cwry colon ad code Statement used "NEXT" so the Ikricwing the exarple mrth code statemnt: 'BEGIN" mmry savings build because "NEXT" is executed so v.uduced no cbject but sinply acted aa a label for many times. me justification in using subroutine "END. provided the JM: address for EH). *CS* calls in Assenbly mde versus inline ccde is based on sinply pmvided the JMP typ for m, in this case how many times it is called. "kE)(T" is canpletely JNC. "cs Nop ns" ddhave aDnplamtad the jurQ justified because it is called an emms nunkr of type md produced JC. times. Forth, Inc., has stated .NEXT" would be an --w PAGE 33 FORTH INTEREST GROUP ***** PO. BOX 1105 ***** San Carlos, Ca. 94070 excellent mic- to be inclujed in a 80 large code statanents can quickly get out of hand set and I'd have to agree. Befoe a "NEXT" with more than two lines (line in the example of vould be implemented ln WSprocessor-like 8085, =my-), becaw of the lesser ability t~ cQnaent e& 6800, or the like, Ftxth is going to have t0 beoanc acax as in Assetbly. So Ftxth, Inc., has stated quite dear to the industry. So I don't see it & staterronts should be kept short am3 meet. It's happening except in some 2900 bit-rlict iwle- really up to the user to trqde off reahbility for mntat ions. speed-

All this concern abwt microToding 'NEXT ha IIhe nanirq of colon and cde etaterPnt labels CM its mot. "m"is executed between each wxd ln a mally improve madability if p put gl~et-ht colon statement bebeen each wxd of a uxd that into the naning. itself is the rime of a colon statement. mem€orer "NDCT" slcvs thirqs dwn during exation, krt k & was said earlier, the Forth pmqrsn statement rcdeemirq since it saves space arrd all- the high can be executed by enterinq it on the connand line, level nature of hrth. then typing the name for executim. Colon statements are included in this ability and extremely fast ?t, keep thirqs wing quickly in the execution dirq ad debugging is the result. of mrth pmgrans, colon statements should ccntain a feu mrds defining the action of the defined colon I really object to paying $2,500 for any Softsate, statement and each word should be very closely but Brth is mrth it. (Ihey'd probably sell mce if connected to a code statement as possible (since it wsn't so expemive.) Besides the price thero code statements run at full machine speed). Also, EWXYM to be a feu other mpediments to Fbrth gaining each word in a colon statement should be povFrful, a mo~rapld pwarity growth. (1) It &es take if the mrd is the label of a cok statement, thia gettirq used to. (2) There's not m~ymrth could mean large code statanents. 6ystsPs and progrmmers amwd. (3) Pecple, in my jwt,are tob quick to &em it.

'lb really get fast disk copies on your )05800 progran. Iha amstant nancd EX3WKH provides the (RI Intel Corp.) mrth systme, add thia progrm to first address o€ the 3328 RAn bytes needed. your disking load: cwLIu\TE lhen exewted calls t?m to €omat the 0 ( HIGH SPEED DISK COPY ~~~-7aiooi disk in drive 1. "77 &IW- Pets up a DLOOP to 1 16384 CONSTANT SCRATCH mpy all 77 tracks. I/O requires mTCH (locatiar) 2 2000 CONSTANT BIAS I (the track and index of the loop) TRACK (to 3 26 CONSTANT TRACK canpute block # for I/O) REM (fmn, drive B) and 4 4 CONSTANT READ ALL (for # of sectors). VO will perform the disk 5 6 CONSTANT WRITE operatian. -1- prints the current track birq mpied 6 26 CONSTANT ALL to entertain the aperator. Next, Sa?Am qain gives 7 : DUPLICATE FnT 77 o the scratch area for I/O and I TRACK BIAS + 0 DO SCRATCH I TRACK ' provides the equivalent block nunbcr in drive 1 for 9 READ ALL 1/0 I . vo. 10 SCRATCH I TRACK 11 BIAS + WRITE ALL 1/0 WRI"T3 ALL instructs I/O to write all 26 sectors 12 STATUS IF [ ERROR] LEAVE THEN fmn scratch area. I/O perfora the disk operation. 13 LOOP FLUSH CR [ COPY J 7 ECHO bTMzLs pops the disk StatU8 byte fmn locatian 20H 14 ;S DUPLICATE TAKES 80 SECONDS 10 and if ntn-zero prints ERFOR ad leaves the loop. 15 FORnAT AND COPY ENTIRE NEW DISK. ~lsethe loop repeats Md MLSH is executed for the hedc-f-it. Cow is printed Md BELL is echo'ed to lbe main reason this progrim will take anly 80 Qzp to signal capletion. seomds to make a is whole tracka are read fmn the master disk in drive g and whole tracks are written to tk mpy in drive 1. But, alas, p'll need 3328 bytes of continuous RAM to run this FORTH DIMENSIONS

PUBLIC MEETINGS PAGE 37

COMMENTS PAGE 37

THE "TO" SOLUTION PAGE 38 Paul Bartholdi

THE FORTH IMPLEMENTATION PROJECT PAGE 41

FORTH INTERNATIONAL STANDARDS TEAM PAGE 41

TTC CORRESPONDENCE PAGE 42 Joh F. Spencer

poly-FORTH BY FORTH, INC. PAGE 43

GLOSSARY DOCUMENTATION PAGE 44 0. W. Wen

LETTERS PAGE 45

FORTH INTEREST GROUP ***a* PO. BOX 1105 ***** San Carlos, Ca. 94070 S TA?? PUBLIC MEETINGS O? F.1.O The volunteer ataffing lorth Dimensions 16 Forth Interart Croup la pleared to of The a bit'fluid. ?or this issue. our staff con- announce a public meeting aeries. Ye will siatad of: mee t on the. fourth (I) Saturday of the month in Hayward. Ca., tn the Spacial Events ROO. EDITOR Bill Regodale of the Liberty House Department Store, in the sou thland Shopping Centar (800 Southland Hell) RIVIEY Deve Boulton

This room is on the third floor rear- The CONTRIBUTORS Paul Bartholdl formal meeting begins at 1:00 PM. but we D. W. Borden gather for lunch about 12 Noon. TYPESETTING CLC Secretarial The specific dates are July 26. Aua 25, and Vydec Sept 22. Dct 27. and Nov 2b. A stogle tech- nlcal topic will be presented in detail, with ARTWORK Anne Ragsdale uorkahop seaaiona on the fig-FORTH model, and any topics of immediate interest. In July. CIRCULATION 6S02 TIM and Persci Dave Lyons will present the aacii memory dump of Forth which is part of his 6800 veraion. This Forth prograa shova tHe entire languaue map on one sheet of paper1

HISTORICAL PERSPECIVE PUBLISHERS COHMCNTS FORTH was created by Mr. Charlea It. The issueo of Forth Dimonsions havo Moore in about 1969 at the National Iadlo been scheduled for tvo month intervals. but Aatronomy Observatory, Cherlottesville, VA. have bean at intervals determioed by the over- It waa created out OC chia dissatlefactlon all actlvities of the steering consittee. with available programming tools. especially In the past months we have participotmd in tho for automation. Diatribution of his vork to International Standardr Team, given confetenco othmr observatories has made FORTH the papers the Fourth West Coaat Computer ?airs, de-facto standard language for observatory attended the Forth Users Heatinu in Otrecht, automatioo. Holland. Nr. Moore and several amsociatea forred These events have been outvardly reflect- Forth. lnc., in 1973 for the purpose of ed in the large gap since Iasue 3. lor the licensing and support of the FORTH Operating near term, hope is tn sightf. Ye have Ieaue Syatem and Programming Language. and to ruppl! 5 ready for publication in three weeka, and application programming to reet ~ustomcra Issue 6 should occur within a month. Thia will uniq ue reg uireme n t a. wrap up Volume 1. At this time ve will evaluate our efforta. and plan for future FORTH enjoy8 a synergism of its features. activftiea. Member comment will be quit. It her none of the elephantine character- apropos during thls period and will help istics of PL/l or FORTRAY. It has a density shape future application of effort. and speed far aurpaasing BASIC, but retains an ioteractive nature during progrnm development. Since it ir extenaible, special words arc Thanks are due the memberahip fot their eaaily defined to give it the terseness of patience during thls period. APL. Its clarity end conslatency result from beiog the product of e aingle mind (as were APL end PASCAL).

Althouah the language apeciflcntlon and many impleaeotations are in the public domain. men) other implementations and application package8 are available as program products of c ommo r c 1a 1 ve ador a.

The Forth Interest Croup is centered in Northern California, although our membership of 456 is vorld-wide. lt was formed tn 1978 by locel Forth prograaaers to encourage use of the language by the interchange of ideas throuuh aeminarr and publications. All effort ia on a volunteer basia and the group is effiliated vith no vendors.

:S FIG

Page 37

FORTH INTEREST GROUP ***** PO. BOX 1105 ****. San Carlos, Ca. 94070

L Paul Bartholdi Observatoire De Geneve CH- 1 290-Sauverny Sw i t rerland

ou): -m: At the Catalina standardization meeting, i)AQB@+CI AB+10C Chuck Moore suggested rapidly the 'TO' ii)PLl@GD4bHDI PGD10H construct to aleviate some, if not all, of iii) X F@ Y PI? P* 2 PI X Y Fc 70 2 the difficultiCs associated with address manipulation. This new construction seems to me extremely powerful. It should con- siderably decrease the number of errors and 3. VARIABLES or CONSTANTS 7 improve the readability of programs. It is very easy to understand and to use (much Some advantaqes of the new concept are easier in fact than the constructs It is quite evident from the previous examples. replacing!). Its implementat ion is also Just befor'e the Catalina meeting, I came to trivial but the lack of experience in using the conclusion that variables should be it may hide some difficulties. These notes dropped altoqether. If A , 0 , ... 2 had try to sketch its potentials. been constants in the previous examples then, using P and 1 , the three lines would 1. The ' lV concept have been coded The basic concept is the following: The i)AB+'C! code associated with -VARIABLES is divided ii) P G D- ' H D! into two exclusive parts. iii) x Y p* 2 F! - The first one (or ' fetch code "1 is which is already better than the 'old' above. identical with the one associated normally with CONSTANT . It pushes on The difficulty starts with ARRAYS. If the stack the value (byte, word or they push values onto the stack instead of words) in the parxer field. addresses, then it becomes much more diffi- cult to store values at the right places. - The second one (or store code '1 is new. It transfers the value (byte, Note that ' C (or H or 2 ) takes two word or words) from the stack into the words but is really, at execution time, parameter field, it is equivalent to a single operator ( LIT ). ! (or CI or D! TO is then the shortest solution in or PI ). terms of memory space, and more or less equivalent to the CONSTANT solution in terms The choice between the two codes depends on of the time used. a state variable (which will be called WAR hereafter) that has two possible states: 0 (or fetch state) and 1 (or store state). 4. The address ' problem If WAR = 0 the first code is executed and %VAR is unchanged. But the main advantage of ' TO ' in this context are the following: If WAR = 1 th? second code is executed and 8 VAR is immediately returned to I. - In the general sense a ' CONSTANT ' should be used as such, and never (or hardly ever) be changed. In particular it may The operator ' TO ' sets 8VAR to 1, reside in PROM . I suggest then to keep the forcing the next-called variable to store constants as such, its associated code the content on top of the stack in its ignoring the value of 8VAR . We then parameter field instead of fetching it. should redefine the variables to check RVAR and behave accordingly. 2. Examples using ' TO " - One of the main unresolved points at We suppose three single variables called Cataltna was the definition and use of A , B and C three double variables Q , C addresses for variables in the qeneral and H , and three floating variables X , Y sense. One consensus was obtained in and 2 . Then the following half-llnes are September at the Geneva meeting, that is, equivalent. The first column assumes the as far as possible, addresses should be old definitions of variables, the second one omitted. The ' TO ' concept solves this uses the new concept. requirement admirably. No addresses are Page 38

FORTH INTEREST GROUP ***** PO. BOX 1105 ***** San Carlos, Ca. 94070 ever put on the stack, or manipulated ( BLOC in of course just a provisional explicitly. Then byte or word addressing is name 1 ) irrelevant. It is taken care of at the system level only, in the code of the second Example : part (the .store code"). 4 , 12 BLOC 5 + TO 5 12 BLOC 5. Portability instead of Because of this, FORTH programs become more portable. " TO " replaces all fetch 12 BLOCK DUP 4 + @ 5 + and store operators which would or would not SWAP 5 + I be distinct, which would work on byte Or "pos1 t ion" or word addresses. Transporting Or a program from a micro to a large CDC implies now much less adaptations. 12 BLOCK 4 + @, 5 + 12 BLOCK 5 + I 6. Clarity - security 9. pztzral access to the (whole) nemory Using less operators, in fact the strict minimum, is probably one of the beet ways of No good FORTH programmer would ever lmprovinq clarity. Note also that TO ' accept to be strongly restricted in his appears as an infix operator to the program- access to the memory. But if the TO mer (and readerl). In terms of security, " concept is really accepted, then all the Q TO " implies that only the parameter field and 1 operators should disappear. I of variables can be changed. Other addres- suggest, instead, to add (its usage could be ses are not (at least directly) accesstble. restricted) a generalized array called MEMORY (or any equivalent) with once more This is certainly a tremendous gain €or the double code associated with it. some envtronments. Then

MEMORY would either fetch €rom or store into the real address. As example, we would have 7. The ARRAY problem an / TO 15317 MEMORY instead of simpleThe useas withof " variables,TO with ARRAYSbut still is notquite as 0 15317 1 or practicable. Note flrst that anything but a I MEMORY LOOP instead variable can stay between TO and the DO S. o€ " I @ LOOP etc. variable's name. If C ia defined as an DO S. ARRAY (with the double associated code) is clearly equivalent to e then I depending on WAR.

A To ' (instead Of A @ 10. Generalization of address matching: DO(.instead I 1y) ofI CDO LOOPI I C I LOOP virtual arrays

explicit address arithmetic in the procedure put the Of A into (see the PPT of Jim Btault €or example). Of into The necessary then This certainly neither clean fast. be is nor What I propose is the tollowing: A ABTOC virtual array ( VARRAY , DVARRAY , IVARRAY , CVARRAY etc.) behaves like an which is surely less pleasant because Of its array, but does not resewe space, exccpt asymmetry. €or a pointer to the real array. The link between the virtual and any portion Of 8. Fetching and Storing inside a disk block the me,,,ory is by the word MATCH . The problem extends of course to 'virtual arrays" like the disk blocks. In this example: context, direct access should be considered separately from Data Management. The double 1/11 ARRAY CUSTOUER code concept associated with TO should Ig0 ARRAY STAR be extended to the Data Management opera- VARRAY NUMBER tors. For the direct manipulation of data , CUSTOMER RATCR NUMBER inside a disk block, I suggest the creation of a new operator, with the double Cde, associates the real arrw CUSTOMER with the associated with the form at virtual array NUMBER . Then NUMBER will bo equivalent to CUSWGR. Page 39 FORTH INTEREST GROUP **-** RO. BOX 1105 *-*** San Carlos, Ca. 94070 Runember that, as previouS1Yr

NUMBeR pushes the value of the ith STAR or CUSTOMER on the rtack. and NIJM8ER will store into the ith STAR or CUSWER . At any tir, CUSMnER can bc replaced by STAR , (and vice versa) by STAR MATCH NUM0ER In thin way, MEMORY is defined by VARRAY MEMORY g HATCH MEMORY

;S PB

SCR # 150 0 ( Example of the creation of TO ) 1 HERE 0 , CONSTANT XVAR 1 XVAR SET TO 2 : OAR CONSTANT ;CODE INB. XVAR LDA, 3 A0 IF. B I) LDA. PUSH. 4 ELSE, CLA, XVAR STA, 8) LDA, B I) STA. 5 TREN. 6 : DVAR CONSTANT , ;CODE INB. XVAR LDA, 7 A0 IF. B IDA, DSP. A I) DLD, S) STB, ?USR. 8 ELSE, CLA, XVAR STA, -.T 8TB. S) DLDI 9 ..T I) DST, POP., 10 TREN. 11 t ARRlT 0 CONSTANT DP +I ;CODE IRB, 8) ADIS XvAR LDAI 12 A0 I?. B I) LDA, PUT. 13 ELSE. CLA. XVAR STA, 14 S1) IDA, B I) STA, ?O?., 15 TREN, SCR I 151 0 8 2ARRAT 0 CONSTANT DU? + I+ D? +I 1 ;CODE INB, S) ADD, 8) ADS, XIAR LDA. 2 A0 I?. I) I) DLD. S) 8TB. ?USR. 3 ELSE, CLA, XVAR StA, ..T STBs 4 ISP, S) DLD, e.7 I) DST. PO?.. 5 TRII, 6 I VARRAT 0 CONSTANT ;CODE IUD, B 1) LDB, 8) ADD, XVAR LDA, I A0 IF, B I) LDA, PUT, 8 ELSE. CLA, XVAR STA, S1) LDA, B I) STA, POP, 9 THEN, 10 : DVARRAT 0 CONSTANT ;CODE INB, B I) LDB. 8) ADD. S) ADD, I1 XVAR LDA, A0 IF, B I) DLD, S) STB, PWSB, 12 ELSE, CLA, XVAR STA, ..T STB, 13 ISP, S) DLD, ..T I) DST, ?0?., 14 TREI, 15 PORTB IMP : NATCR ‘ I ; IN? ’

40

FORTH INTEREST GROUP ***-* PO. BOX 1105 ***** San Carlos, Ca. 94070 FORTH IMPLEMENTATION PROJECT

In June of 1978. the Forth Interest Croup the Fourth west Coaet Computer Fairs, May 1919 heid its' first public meeting. with only in San Francisco.' Ill The result ie that PIC minimal publicity, we had in excess of 40 nor offers the Installation Manual vith people attend. Ue had intended to Offer glOSs*rY and Forth model ($10.00) and asaarbly educational assistance In using Forth. language liatings for numerous computer. However. ve found everyonr van enthusiastic to learn Forth, but only five had accean to ($10.00 @) Included are: 8080, PDP-11. runninp systems. PACE. 9900. 6800, and soon 6502, and 2-80.

FIG then surveyed for vendor avsilability Note that FIG offers theme listin8s vhich of the language. We found there were numeroua atill have to be edited into machine readabla mini-computer versions at educational and form, cu~tomired, and aseembled for specific research lnatitutione. all directly decended inatallatlons. We hapa that local teama from Mr. Uoore's word st NRAO. Of course. share the effort and then distribute for Forth. Inc offers numerous commercial systems. Others.

None of these systems vere available for Reports of installations are beginning to personal computing. It appeared unlikely that! come in from the USA and Europe. We sincerely thla need vould be met in the forseeable hope this vork vill give a benchmark of qual- future. Our conclurion vas.that a suitable ity and uniformity that vill raise the model should be created, and transported to expectation of all usera. lndividual micro-computers. Thua van born the Forth IapleoentaCion Team (FIT). PIC vould like to thank the follovi.8 members of the Implementation Team who have This team was proposed as a three tier devoted a major part of oine months' spare atructure. The first tter had several exper- tire to this effort. lenced Forth systems pro~~rammero.vhu vould provide the model and guide the implementation Dave Boulton Instructor effort. The next tIer vaa the moat critical. John Cassady 8080 It uas composed of systems level proaramrnera, Gary Feierbach Comp. Auc. not necessarily havtng 8 background in Forth. Bernard Greenin8 2-80 They were to transport the common language Kim Harris Librarian model to their own computerm by generating John James PDP- I I an sseembly lso#ua~e listing that follored Dave Kilbridge PAC& the model. Their result. vould be passed Dave Lion 6800 to the distributors that form the third Mike O'Malley 9900 tier. These distributors would custoslze for Bill Ragadale Instructor apecif ic personal computer brands. Finally, lob Smith 6800 the nsera could have access to both source and LaParr Stua r t 6800 object code for maintenance. (11 Pagadale. William F. Space doesn't permit inclumion of the "Forth Implementation. A Team Approach" FIT project. itself. The project wan detailed The Best of the Computer Fairea. Vol II as one of the six Forth conference papers at from: Computer Fsire ($14.78, USA) 333 Svett Road. Woodaide. CA 94062

FORTH INTERNATIONAL STANDARDS TEAM

For several years the Forth Ueerr Group batrean major users. ?or example. FIG la (Europe) has sponsored a team vorking tovard learning from the mUltt-tOSking of U of K. a standard. publication for Forth. The 1977 Kitt Peak and Utrecht are running fi8-FORTR. meeting (Utrechtl produced a vorking document and ue have adopted the security package FORTH- 77. Attendees included European pionaered in Europe. None of theme event. educational institutions and Forth, Ioc. would have been likely vithout the contact. begun at Catalina. In October. 1978. an expanded group MC at Catalina laland (Calif. )- Attendees The Team hos announced tbe next Standard. included Forth Users Group (Zteiuuenhuigren, Meeting for October 14 tbru 18. 1979, again Bartholdi). Forth, Inc. (Moore. Rather, at Catalina. The team agreed on an orginit- Sandereon). FIG (James. Boulton, Ragadale. ational budget of $1000.00, to be met by $30. Harris). Kitt Peak (Miedsner. Goad, Scott). contribuitions by aponaore (individuala and U of Rochester (Forsley). SLAC (Stoddard). and companica f . Safeguard Ind. (Vurpillat). These fuode vil1 be used solely to defray The document resulting from this four day organizing cost# of tho annual meeting and meeting has been released a8 FORTE-78. Thie distribution of the vorking docurcnta to document is becoming a good refereoce guide in particlpanta. Thooc ConBideriog participetimg evaluating the consistency and corpleteneas of ahould become Tear Sponsor8 by remiting a. particular Forth systems. It is available given belov. Sponsors will receive the juat from to particinntint snonsoro. (Sea releaned FORTU-78. and a11 Team uilinga. FIST 1. b low. ) Pleeee remft to FIST, %Carolyn ROaenber8. A major benefit of the tear meetin8 van Forth, Inc. 815 Manhattan Ave., Nanhettam the development of close communicaciona Beach. CA 90266. Page 41 FORTH INTEREST GROUP *.**- PO, BOX 1105 .**** San Carlos, Ca. 94070 & FORTH OlmEflSlUflS

VOLUME I Numbers 1 - 6 ...... * * * FORTH DIMENSIONS INDEX * * VOLUME I,II,III * * *

ADDING NODULES, STRUCTURED PROGRAMMING 11,132

APPLE-4TH CASE II,62

ARTIFICIAL LINGUISTICS 111,138

ASSEMBLER, 6502 111,143

ASSEMBLER, 8080 111,180

BALANCED TREE DELETION IN FASL I I, 96

BASIC COMPILER REVISITED 111,175

BEGINNER'S STUMBLING BLOCK II,23

BENCHMARK, PROJECT

BOOK REVIEW, STARTING FORTH

BRINGING UP 8080

CASE AND PROD CONSTRUCTS

CASE AS A DEFINING WORD

CASE AUGMENTED

CASE CONTEST STATEMENT

CASE IMPLEMENTATION

CASE STATEMENT

CASE STATEMENT

CASE STATEMENT

CASE STATEMENT

CASE STATEMENT

FORTH DIMENSIONS Page 1 INDEX CONTINUED

CASE, SEL, AND COND STRUCTURES 11,116

CASES CONTINUED 111,187

CHARLES r4OORE, Speech to a Forth Convention I, 60

COMPILER SECURITY How it works and how it doesn't

COMPLEX ANALYSIS IN FORTH 111,125

CONTROL STRUCTURES, THANSPORTABLE With compiler Security

CORRECTIOIJS TO METAFORTH III,41

CP/M, SKEWED SECTORS FOR

D-C HARTS

DATA BASE DESIGN, ELEMENTS OF III,45

DATA STRUCTURES 111,110 in a telecommunications front end

DATA STRUCTURES, OPTIMIZED FOR HARDIJ.CONTROL 111,118

DECOMPILER FOR SYN-FORTH III,61

DEFINING WORDS, NEW SYNTAX FOR DEFINING 11,121

DEVELOPMENT OF A DUMP UTILITY 11,170

DIAGNOSTICS ON DISK BUFFERS 111,183

DICTIONARY SEARCHES III,57

DISCUSSION OF 'TO'

DISK ACCESS SPEED INCREASE

DISK BUFFERS, DIAGNOSTICS ON 111,183

DISK COPYING, CHANGING 8080 FIG III,42

DO-CASE EXTENSIONS II,64

DO-CASE STATEMENT II,57

DTC VS. ITC ON PDP-11 I, 25

DUMP UTILITY, DEVELOPMENT OF

EDITOR

EDITOR III,80 FORTH Inc., FIG, Starting FORTH

FORTH DIMENSIONS Page 2 INDEX CONTINUED

EDITOR EXTENSIONS

EIGHT QUEENS PROBLEM

ENTRY FOR FIG CASE CONTEST

ERATOSTHENES, SIEVE OF

EVOLUTION OF A FORTH FREAK

EXECUTION VARIABLE AND ARRAY

EXECUTION VECTORS

EXTENSIBILITY WITH FORTH

FASL, BALANCED TREE DELETION

FILE EDITOR

FILE NAMING SYSTEM

FLOATING POINT ON TRS-80

FOR NEWCOMERS

FORGET, "SMART*

FORGIVING FORGET

FORTH AND THE UNIVERSITY

FORTH CASE STATEMENT

FORTH DEFINITION

FORTH DIALECT, GERMAN, IPS

FORTH ENGINE

FORTH IMPLEMENTATION PROJECT

FORTH IN LASER FUSION

FORTH IN LITERATURE

FORTH LEARNS GERMAN

FORTH LEARNS GERMAN, Part 2

FORTH POEM ' :SONG '

FORTH VS. ASSEMBLY

FORTH DIMENSIONS Page 3 INDEX CONTINUED

FORTH, IMPLEMENTING AT UNIV. ROCHESTER

FORTH, The last ten years & next 2 weeks Speech by Charles Moore

FORTH-85 "CASE" STATEMENT

FUNC'I'IONAL PROGRAMPlING AND FORTH

GAME OF 31

GAME OF MASTERMIND

GAME OF REVERSE

GAME, TOWERS OF HANOI

GENERALIZ ED CASE STRUCTURE

GENERALIZED LOOP CONSTRUCT

GERMAN FORTH DIALECT, IPS

GERMAN REVISITED

GERMAN , FORTH LEARNS

GERMAN, FORTH LEARNS, Part 2

GLOSSARY DOCUMENTATION

GOD0 CONSTRUCT, KITT PEAK

GRAPHIC GRAPHICS

GRAPHICS, SIMULATED TEK. 4010

GRAPHICS, TOWERS OF HANOI

GREATEST COMMON DIVISOR

HELP

HIGH SPEED DISK COPY

IMPLEMENTATION NOTES, 6809

INCREASING DISK ACCESS SPEED, FIG

INPUT NUMBER WORD SET

INTERRUPT HANDLER

IPS, GERMAN FORTH DIALECT

JUST IN CASE

FORTH DIMENSIONS Page 4 INDEX CONTINUED

KITT PEAK GOD0 CONSTRUCT

LOCAL VARIABLES, TURNING STACK INTO

LOOP, A GENERALIZED CONSTRUCT

MAPPED MEMORY MANAGEMENT

MARKETING COLUMN

MASTERMIND, GAME OF

METAFORTH, CORRECTIONS TO

MICRO ASSEMBLER, MICRO-SIZE

MODEM, TRANSFER SCREENS BY

MODEST PROPOSAL FOR DICTIONARY HEADERS

MOUE FROM GEORGE ( Pascal vs. Forth )

MUSIC GENERATION

NEW SYNTAX FOR DEFINING DEFINING WORDS

NOVA BUGS

OPTIMIZING DICTIONARY SEARCHES

PARAMETER PASSING TO DOES>

PASCAL VS. FORTH ( MORE FROM GEORGE )

PDP-11, DTC VS. ITC

POEM

PROGRAMMING HINTS

PROJECT BENCHMARK

PROPOSED CASE STATEMENT

RECURSION AND ACKERMANN FUNCTION

RECURSION, EIGHT QUEENS PROBLEM

RECURSION, ROUNTABLE ON

REVERSE, GAME OF

ROUNDTABLE ON RECURSION

SEARCH

FORTH DIMENSIONS Page 5 INDEX CONTINUED

SEPARATED HEADS

SIEVE OF ERATOSTHENES

SKEWED SECTORS FOR CP/M

SPOOLING TO DISK

STACK DIAGRAM UTILITY

STARTING FORTH, A BOOK REVIEW

STRING STACK

STRUCTURED PROGRAMMING BY ADDING MODULES

SYMBOL DICTIONARY AREA

TABLE LOOKUP EXAMPLES

TELE-CONFERENCE

TELECOMMUNICATIONS Data structures in a --- front end

TEMPORAL ASPECTS OF FORTH

THEORY THAT JACK BUILT

THREADED CODE

TINY PSUEDO-CODE

TOOLS, RANDOM NUMBER GENERATOR

TOWERS OF HANOI

TRACE FOR 9900

TRACING COLON DEFINITIONS

TRANSFER SCREENS BY MODEM

TRANSIENT DEFINITIONS

TRANSPORTABLE CONTROL STRUCTURES

TREE STRUCTURE, FASL

TRS-80 FLOATING POINT

TURNING STACK INTO LOCAL VARIABLES

USERSTACK

FORTH DIMENSIONS Page 6 INDEX CONTINUED

USING 'ENCLOSE' ON 8080

USING FORTH FOR TRADEOFFS Between hardware/firmware/software

VARIABLE AND ARRAY, EXECUTION

VIEW OR NOT TO VIEW

W, RENAME

WHAT IS THE FORTH INTEREST GROUP?

WORD SET, INPUT NUNBER

WORDS ABOUT WORDS

' ASCI I ' Instead of EMIT

:CASE

'CASE', A GENERALIZED STRUCTURE

'CASE', BOCHERT/LION

'CASE' , BRECHER

'CASE', BROTHERS

'CASE', EAKER

'CASE' , EMERY

'CASE', FITTERY

'CASE', KATTENBERG

'CASE', LYONS

'CASE', MUNSON

'CASE', PERRY

'CASE', POWELL

'CASE', SELZER

'CASE', WILSON

FORTH DIMENSIONS Page 7 WORDS CONTINUED

'CASE', WITT/BUSLER

'CVD', CONVERT TO DECIMAL

'DO-CASE', ELVEY

'DO-CASE' , GILES

'ENCLOSE', 6502 CORRECTION

' ENDWHILE'

'GODO', KITT PEAK

'SEARCH'

'TO' SOLUTION

'TO' SOLUTION CONTINUED

'VIEW'

'XEQ'

31, GAME OF

6502 'TINY' PSUEDO-CODE

6 502, ASSEMBLER

6502, CORRECTIONS FOR 'ENCLOSE'

6800, LISTING, TREE DELETION

6809 IMPLEMENTATON NOTES

79 STANDARD

79 STANDARD - A TOOL BOX?

79 STANDARD, 'FILL'

79 STANDARD, 'WORD'

79 STANDARD, CONTINUING DIALOG

79 STANDARD, DO, LOOP, +LOOP

8080 ASSEMBLER

8080, FIG DISK COPYING

FORTH DIMENSIONS Page 8 MISC. CONTINUED

8080, TIPS ON BRINGING UP 9900 TRACE

FORTH DIMENSIONS Page 9 INDEX CONTI NUEV

SCREENS OF FORTH CODE ......

ASSEMBLER FOR 6502

ASSEMBLER FOR 8080

BASIC COMPILER FOR FIG

' BATCH-COPY'

'BUILDS, 'DOES'

CASE AS A DEFINING WORD

CASE AUGMENTED

'CASE', BOCHERT/LION

'CASE', BRECHER

'CASE', BROTHERS

CASES CONTINUED

'CASE', EAKER

'CASE', EMERY

'CASE', FITTERY

'CASE', FORTH-85

'CASE', GENERALIZED STRUCTURE

'CASE' , KATTENBERG

'CASE', MUNSON

'CASE', PERRY

CASE, SEL, AND COND

'CASE', SELZER

'CASE', WILSON

'CASE', WITT/BUSLER

DATA BASE ELEMENTS

DATA STRUCTURES

DECOMPILER FOR SYN-FORTH

SCREENS Page 10 SCREENS CONTINUED

DISK BUFFER ilIAGNOSTICS

'DO-CASE', ELVEY

'DO-CASE' , GILES

EDITOR

EDITOR EXTENSIONS

EDITOR EXTENSIONS

EIGHT QUEENS PROBLEM

EXECUTION VARIABLE

'EXPECT' with user defined backspace

FILE EDITOR

FILE NAMING SYSTEM

FORGIVING FORGET

FORTH LEARNS GERMAN

GAME OF 31

GAME OF MASTERMIND

GAME OF REVERSE

GLOSSARY DOCUMENTATION

GLOSSARY GENERATOR

GRAPHICS (TEK 4010 SIMULATION)

GREATEST COMMON DIVISOR

HELP

HIGH SPEED DISK COPY

HUNT FOR CONTROL CHARS.

INPUT NUMBER WORDS

INTERRUPT HANDLER

JULIAN DATE

LOOP CONSTRUCT

SCREENS Page 11 SCREENS CONTINUED

'MATCH' FOR EDITORS

MICRO ASSEMBLER

MODEM

MUSIC GENERATION

OPTIMIZING DIC'I'IONARY SEARCHES III,57

PROJECT BENCHMARK 11,112

RANDOM NUMBER GENERATOR II,34

'SEARCH' II1,lO for a string over a range of screens

SECTOR SKEWING FOR CP/M 111,182

SIEVE OF ERATOSTHENES 111,181

SOFTWARE TOOLS II1,lO

STACK DIAGRAM PACKAGE III,30

STACK INTO VARIABLES 111,185

STRING STACK 111,121

SYMBOL DICTIONARY 11,150

THEORY THAT JACK BUILT II,9

'TO' SOLUTION

'TO' SOLUTION CONTINUED

TOWERS OF HANOI

TRACE COLON WORDS

TRANSIENT DEFINITIONS 111,171

TREE DELETION IN FASL

TRS-80 FLOATING POINT

'VIEW' using 'where'

6502 ASSEMBLER I 11,149

8080 ASSEMBLER 111,180

SCREENS Page 12 INDEX CONTINUED

INDEX COMPILED COURTESY OF M. TASSANO 936 DELAWARE WAY LIVERMORE,CA. 94550

SCREENS Page 13 FORTH DIMENSIONS

JUNE/JULY 1978 VOLUME 1 NO, 1

EDITORIAL: WHAT IS THE FORTH INTEREST GROUP?

The Porth Interest Group, which developed in the fertile ground of the computer clubs of the San Francisco Bay Area, grew in a few months from nothing to where we are now getting several letters a day from all

over the oountry. ' With this increasing public interest we need to let people know what we are doing and why, what we would like to see happen, how others can be involved, and what we can and cannot do. We are involved because we believe. that this language can have a major effect on the usefulness of computers, espeoially small oomputers,' and we want to see it put to the test. Increasingly software is becoming the oritioal, limiting factor in the computer industry. Large software proJects are especially difficult to develop and modify. Few are happy with prevailing operating systema, which are huge, hard to understand, 1 inoompatible with each other, and without unity of design. The Forth language is its own operating system and text editor. It ia interaotive, extensible (including user-defined dita types), structured, and recursive. Code is so compact that the entire system (mostly written in Forth) usually fits in 6K bytes, running stand-alone with no other software required, or as a task in a oonventional operating 878t@m. One person can understand the entire Forth system, ohange any part of it, or even write a new version tram scratch. Run-time effioienoiaa are as little as 30% slower than straight maohine oode, and even less if the system's built-in assembler is used. When the assembler la not used, programs can be almost completely transportable between maohines. Any large Porth program is really a special-purpose, applioatlon-oriented language, greatly facilitating maintenance and modification. We don 't yet have conclusive data, but typioal program development times and costs seem to be a fraction of those required by Fortran or assembly. Forth is especially useful for real-time, oontrol-type' applications, for large projects, and for small machines.

The problem is availability. Users have shown an ease of learning after they have a system available. The Forth characteristics of postfix notation, struotursd conditionals, and data stacks are best understood by a. To e~.oourage Porth programmers, we need readily available systems even of. modest performance. We hope that three levels will be available:

1. Demonstration - free ( or under $20. ) introductory version without file struoture which compiles and executes from keyboard input.

PAGE 1 FORTH INTEREST GROUP *-*-* PO. Box 1105 **-*- San Carlos, Ca. 94070 3. Professional - Commercial products for lab or industrial use and software development. ($1000. to 82500.)

Today the serious personal computer user holds the key to wider availability of the language. These users - generally engineers, businessmen, programmers - combine ~rofeasional competence and commitment with the freedom to try new methods which may require a lot of time and tinkering with no definite guarantee of payoff. Practically everyone involved with the Forth Interest Croup has both a personal and a professional interest in computers.

The Forth Interest Group is non-profit and non-commercial. We aren't associated with any vendor, no one is making money from it, and we are a11 busy with other work. We are an information clearinghouse and want to encourage distribution of all three of the previously mentioned levels of Forth. We do not have a Forth system for distribution at this time, and we don't want to get into the software or mail-order business because this is best left to 00mpanies or individuals committed to that goal. Naturally our critical issue la how to keep going over the long haul with volunteer energy. We need cost-effective means of information exchange.

At present we are writing, for professi.ona1 media, putting out this simple newsletter, and holding occasional meetings in the Bay Area. Also, we are developing a major technical and implementation manual, to be published in a journal form as four installments, available by subscription. While we cannot answer all of the mail individually, we certainly read it 1 to answer. it in the newsletter. While we cannot fill orders for software or literature, we will try and point you to where it is available. We weloome your input of information or sugaestions, how you could help, what you would like to see happen, and where we should go from here.

Dave Bengel - Dave Boulton - Kim Harris - John James Tom Olaen - Bill Ragsdale - Dave Wyland

PAGE 2

FORTH INTEREST GROUP PO. Box 1105 San Carlos, Ca. 94070 EVOLUTION OF A F . I.G . FORTH FREAK

By Tom Olsen

I have been actively involved in the personal computing movement since early in 1973 when I shelled out $120. for an 8008 chip. Since that time my hardware and software have evolved into a very powerful and useful system, of which FORTH is a principal component. The system consists of an l.SI-71, 28K of memory, 2 Diablo disks, an LA30 DECWRITER, a niablo HYTYPE-I printer, a VDM-1 display, and dual floppy disk drives. Obtaining an operatJng system which would effectively utilize all of this hardware initially appeared to be much too expensive for an individual to buy, and far too complex to write from scratch. This attitude changed when early in 1976 I read a technical manual describing the internal organization of a relatively unknown "language" called FORTH. Here was a programming system which included not only an editor, assembler, and file mapagement system, but the inherent capability to be rapidly expanded to perform any coaputer function I could define. The best part was the fact that the central core of this programming system was relatively small and would easily fit into 3K of memory. The large majority of the system Programming could be done in terms of high level functions which 1 would have She freedom to define.

After about three months of late nights and pulling my hair out, I finally had a stand alone FORTH system which I could bootstrap and then use to load application vocabularies from disk. Once the basic Implementation was fully debugged my general throughput of useful a?p:ication software increased to a level I never would have thought posaf ble, I can't over-emphasize the satisfaction associated with implementing the language from scratch. An added benefit of this approach is the flexibility derived by having a 700% understanding of ALL of the code your machine is executing.

Today I have application vocabularies which can do everything from playing a BACH minuet on a cdmputer controlled synthesizer to generatint?, sorting, and printing the FORTH INTEREST GROUP mailing list. It is my hope that with the continued growth of the FORTH INTEREST CROUP and the establishment of some syntactical standards, widespread exchange of applications vocabularies will greatly enhance the computing power of all users of FORTH-like languages.

PAGE 3 FORTH t NTEREST GROUP RO. Box 1105 ****- San Carlos, Ca. 94070 USING FORTH FOR TRADEOFFS BETWEEN HARDWAKE/F IRMWARE/SOFTWARE

By Dave Wy land

FnRTH provides a unique capability for changin~the tradeoffs between software, firmware, and hardware. This capability derives from the method cf nested definition of operators in FORTH.

Firmware (i.e. microprogramming) can add new instructions to the instruction set of an existing machine. New hardware designs can also add instructions to ari existing set, with the Z80 upgrede of the 8080 Serving as a good example. These new instructions could significantly improve the throughput of a system in many cases: however these new instructions cannot be used with existing software without rewriting the software. This is because current software methods such as assembler language, BASIC interpreters, FORTRAN compilers, etc., create software programs as one list. of instructions. To add improved instructions to a program generated by a FORTRAN compiler involves rewritin& the compiler to efficiently use the new instructions and then recompiling the program. This is not a trivia? task since decisions must typically be made as to when to use a new i2structlon. This is why each new machine requires a new, rewritten FORTRAN compiler. The fact that the job has been done many times before is not very comforting.

With FORTH, however, operations are built-up of nested definitions with a common functional interface between operations. If a new instruction has been added to the computer's instruction set, it can be added to the FORTH system by changing a small number of definitions, in the typical case. The method can be quite straightforward. Each new instruction does an operation which would have required several instructions in the previous case. By identifying those FORTH definitions ~hichcould benefit from the new instructions and recoding them to include it, all software which uses the modified definitions is immediately improved. Also, very few definitions will have to be modified: only those elenentry definitions with a high frequency of use need be modified to achieve throughput increase near the maximum possible.

PAGE 4 FORTH l NTEREST GROUP . . p 0. 80 x 110 5 . San Carlos, Ca. 94070 FORTH LEARNS GERMAN

By John James

Forth now understands German, thanks to the following redefinitions of the operations in the Decus (Caltech) Forth manual.

Many of the operations were mathematical symbols, and of course they did not have to be translated. Of the rest, the control operations (IF, THEN, ELSE, BEGIN, END, DO, LOOP, +LOOP) are special, because they are "immediate operations"; that is, they are executed at compile time. Just redefining their names would not work, because they would try to execute right in the definitions. So their original definitions were copied, but with the German names.

Program development time for bilingual capability, two hours. Memory required, 600 bytes. Effect on run-time execution speed, zero.

BLOCK 30 1 ( GERMAN. JJ, 6/19/78) 2 : ARWFRFFN DROP ; : IIRER OVER ; 3 : VFRT SWAP : : SPARFN 'AVE ; : ONSPAPFN UNSAVF ; 4 : VNBPDTNCT ABS ; : UND ANn ; 5 : FWHST MAY ; : MINPFCT MTN : : RRST Yon ; 6 : 09EP OR ; : /Rk?ST /MW ; : OSRTZEN OSRT ; 7 : ISFTZEN lSRT ; : HTFR PERF: ; : VRRCESSF!N PORGFT ; 8 : SCWLUSSPT, CODE ; : RESTAYDYC CONSTANT 9 : CAVZE TNTPGPR ; : ORDN[IYC ARPAY ; : TORD~~VV~;TARRAY ; 10 : SFTZEN SET ; 11 : AUFS-LAUPENDE UPDATE ; : AUSRADTFREN ERASE-CORE ; 12 : LADEN LOAD ; : ZURUCK CR ; 13 : SCHREIBEN TYPE ; : EASIS BASE ; 14 15 16 ( THE SAME: DUP, MINUS, =L, BLOCK, ;S, PI ;S

The control operation definitions (OB, DANN, SONST, BEGINNEN, ENDEN, TUN, SCHLINGE, +SCHLINGE) are not shown here; they are'all short (one line), and exact copies of the English operations. (Incidently this particular vocabulary is a rough draft; we have not seen the results of the International Forth Standards Team, which is currently at work.) The word GERMAN is defined on the load screen, So that the Forth user can call in the German vocabulary when desired. The following session shows the entry and execution of a fibonacci

PAGE 5 FORTH INTEREST GROUP I?0. Box 110 5 San Carlos, Ca . 94070 sequence pr ogram i n German (until 16-bit overflow). FORTV LOAD OK GERMAN OK : PRUFUNG 0 1 30 0 TUN VERT DUP . UBER + SCALINGE ABWERPEN ABWERPEN ; OK PRUFUNG 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 177. 28657 -19168 9489 -9679 -190 -9869 -10059

On a (slightly) more speculative note, why not extend this scheme to a computer assisted international language for computer conferences, electronic mail, and international data-base utilities? Clearly natural language is too Free, and computer languages like BNF arc too rcstri'ctivc, to bc feasible. But a hybrid, a vocabulary of several hundred unambiyuous words (each used in one sense only), and perhaps some computer-oriented syntactical markers, should be enough for useful dialog within a particular interest area. If it works for two languages it should work as well for any number. The final test - whether international teams could collaborate, after minimal training - would take a few weeks programming at most, after the vocabularies and terminal interfaces had been determined.

FORTH MAILBAG

By Dave Bengel

The Forth Interest Group developed from several people in the San Francisco- San Jose area who have been working on Forth for the last year and a half. Until about six months ago most of these users were unaware of each other. Until the publication of the article by John James in Dr. Dobb*~Journal (May 1978), about 80 percent of the group was from the Homebrew Computer Club - whose publication should also be watched for news concerning the F.1 .G.

We now have nearly 200 names on the mailing list, and are receiving about six letters a day. The writers' main question is how to get a version for their machine.

We don't yet have a detailed description of the versions of Forth now available, nor is there a standard form of the language available for various CPUs. Intense work on implementations is now underway; e-g. the Forth Interest Group implementation workshop. We will keep you informed as more documentation and systems become available.

Your answers to the questionaire in this newsletter will help US keep a mailing list for interest-specific applications, documentation, CPU versions, etc. We appreciate any information YOU can send us, particularly about Forth versions or variants which are running or being developed, or any software we can publish. We need your contributions to this newsletter -(which we hope will grow into a journal).

PAGE 6

FORTH INTEREST GROUP . ~0.Box 1105 ooooo San Carlos. Ca. 94070 FIG LEAVES

I PlPLEMENTAT I ON WORKSHOP

The Forth Interest Group will hold an implementation workshop, starting sometime in July. The purpose 1s to create a uniform set of implementations for common micros. The assembly listings which result will be available through F.I.G. to those who wish to distribute specific versions.

This will be a small group, no more than ten, with only one person for each machine. There will be approximately four all-day sessions, over six weeks. Implementers must have access to their target machine, with an assembler and editor; floppy or tape is not required. The meetings wilL be to share notes and specific guidance on implementation details. At the end of the workshop we should have uniform Forth versions for all the machines.

We now have implementers scheduled for 8080, 6502, PACE, and LSI-11. We need implementers for 6800, 280, 1802, F8, System 3 (321, 5100, etc. We also need a project librarian with Forth experience.

If you are interested write to FORTH IMPLEMENTATION PROJECT, 20956 Corsair Blvd., Hayward, Ca. 94545.

COXTRI BUTED HATER IAL

Forth Interest Group needs the following material: (1) Manuals available for distribution. We can purchase copies and distribute, or print from your authorized original. (2) Name and address of Forth implementations for inclusion in our publications. Include computer requirements, documentation, and cost. (3) Technical material for the forthcoming journal. Both expositions on internal features of Forth and application programs are needed. (4) Users who may be referenced for local demonstration to newcomers, on a regional basis. Indicate interest area (i.e. personal computing, educational, scientific, industrial, etc.). (5) Letters for publication in this newsletter.

(PAGE 8 AND 9 BLANK) PAGE 7

FORM INTEREST GROUP ***** PO. Box 1105 ***** San Carlos, Ca. 94070 FORTH OlMENSlONS AUGUST/SEPTEMBER 1978 VOLUME 1 NO, 2

CONTENTS

HISTORICAL PERSPECTIVE PAGE 11

FOR NEWCOMERS PAGE 11

EDITORIAL PAGE 12

EXTENSIBILITY WITH FORTH PAGE 13 KIM HARRIS

GERMAN REVISITED PAGE 15 JOHN JAMES

FORTH LEARNS GERMAN PAGE 15 W .F. RAGSDALE

THREADED CODE PAGE 17 JOHN JAMES

FORTH DEFINITION PAGE 18

HELP PAGE 19

MANUALS PAGE 20 FORTH was created by Mr. Char108 H. to give it tho terseness of APL, Its Moore in about ,969 at the ~~~i~~~l~~di~Clarity and consistency result from being Astronomy Observatory, Charlottesville, VA. the product of a sin6le mind* (as IPL It was created out of his dissatisfaction and PASCAL). with avaliable programming tools, especially for automation. Distribution of hi8 work to other observatories has made FORTH tho de-facto ~tandard language for observatory Although the languago specification and automation. many implemontations are in the public domain, many other implementatfona and appliaation packages are available as Mr. Moore and several associates Program products of commercial suV9lior3. formed Forth Inc . In 1973 for the ~ur~oso. . of licensing and support of the FORTH Operating Sys em and Programming Language.- - Tho FORTH Intorost Oroup is conterad in and to supply a v plication prog~amming to Northern California. It was formed in 1978 meet customers un lque requirements. by looal FORTH programmars to anoourage oae of the language by the interchange of ideas though seminars and publications. About 300

FORTH en OY J a synergism of its members are presently associated into a features. It has none of the elephantine looaa national organizatioH. ('Loose' means characteristics of PL/t or FORTRAN. IC has that no budget eiiats to 3uPport my formal a density and speed far surpassing BASIC, effort.) All effort is on a volunteer basis but retains an interactive nature during and the group is assooiated vith no vendors. program development. Since it la extensible, special vords are eaaily defined ;S W.F.R 8/20/78

FOR NEWCOMERS Q a3' @ Fotchr the 16 bir cad- d an m. C@ doa thm d FORTH listings cwM of sequmeu "wu&* thd mmo faa byte. mw bo alsu colld 8@ or \@. I PI aearte and/a conpile. Whm yau hlhrdld a gbW 1 Ll md a few sample lirting, ywsharld dovolop tho ability to Ttm*rardr~thovcand~rumbadth.mrwnay udmtand tho odim of new wadr in t.nrr of thdr d4n- addnr an tho top of tha shdc. C 1 stwes only a byto; H ition conpooenk. Fathe time belrq, m pr& a rinp- moyb.dBIor\Ion~*.m. lifid glcssq of the undefined wordr in thh tare d FORTH DIMENSTONS. Fw a fullr Ilsting rond far tho F.1.G GI-.

: xxx ..... ; I:' crmta a now wad mmad ka' ad carpil~th following w& (represented d ....)until dingI;'. Whon ku' is Idaud, it a.cvhr tho.womb righ ol)~L name until the I;'.

CONSTANT VARIABLE Eoch crwtra o new wad with th. following mmo, which tdta its value from the ruder -@ bh.

IF ELSE THEN A tost is mode at 'IF'. If hue, tho wads until h ' ELSE' and sklp until THEN. If f ah, Alp untllELSE md axecute until THEN.

BEGIN END At END a tost is made; if faho, ececvtlon nhrrn to BEGIN; dhawko cantirue dud.

DO LOOP LEAVE At 00 o limit md fin) Index cn rwd. At LOOP, tho Index is in-4; until tho llmk 1s dd,rcbartlar durn to DO. LEAVE facrr eacecvtion to atd LOOP.

DUP DROP OVER SWAP ROT + - / Thase wads weon runban in a stock Fr( o than do in a HP calculdcr. If yau like HP, you'll lorn WH.

>R R) )R mar the tap tack rumba to umth R) mivait back to tho original stock. PAGE 11

FOSIH INTEREST GROUP -oeo- RO. Box 1105 ---*- San Carlos, Ca. 94070 EDITORIAL

FORTH DIMENSIONS is dedicated to the promotion of extensible, threaded languages, primarily FORTH. Currently we are seeing a proliferation of similar languages. we will review all such implementations, referring to sources and availability.

Our policy is to use the developing "FORTH 77" International Standard as our benchmark. Variant languages, such as STOIC, URTA, and CONVRRS, will be evaluated on their advantages and disadvantages relative to FORTH. However, in evaluating languages named FORTH, we will note their accuracy in imolementinq all FORTH features. We expect complete versions named FORTH to contain: I. indirect threaded code 2. an inner and outer interpreter 3. standard names for the 40 major primitives

4. words Such as ;CODE, BLOCK, DOES), (or :) which allow increased performance.

We hope to enable prospective users/purchasers to correctly select the version and performance level they wish, to foster long-range growth in the application of FORTH.

W.F.R.

CONTRIBUTED MATERIAL

FORTH Intarss) Gmps needs the following material :

1, Technical mdarial for inclusion .in FORTH DIMENSIONS, Ebth ~RIorrron internal faalum of FORTH ond ~licab'mprogram are apprecidal,

2. Name and oddrsss of FORTH Inplmmtatiom for inclusion in our publications, Include computer mcpiremcmts, doarmcmtcltion and cost,

3, Manuals available for distribution, We can pnchore capias and distribute, or pint from your cuthoriual original,

4, Lettam of geneml fntamt for pub1 fdion in this n.mldter.

5, &a who may be refarend for local denwddon to nawcomem, PAGE 12

FORTH INTEREST GROUP *-*We PO. Box 1105 ***** San Carlos, Ca. 94070 Quantum Mechanics:

EXTENSIBILITY WITH FORTH

Eleatricity and Uagnetism: The purpose of any computer language (and its compiler or interpreter) is to bridge the gap between the "language" the machine understands (low level) and a Language people understand (high level programming language ). There are many choices for human-understandable languages: natural languages and artificial languages. The choice of language should allow Matrix Algebra: Convienient, terse, and unambiguous Specification of the problem to be solved by The trace of a matrix is equal to the suu of the computer. Ordinarily only a few its eigenvalues. computer languages are available (0.8. BASIC, FORTRAN. APL). These were designed Organic Chemistry: for certain classes of problems (such as mathematical equations) but are not suitable Kd, C &O4 + Ct-,&-+ VH*V~CH,CHO(S) For others. The level of a language is a measure of suitability of that language for a particular application. The hi8her the level, the the progrem. By Knitting: definition, fehighest level would allow a given problem to be solved with one K2 tog.3(5) times. *k1, p2 operator (or command) and as many operands kl, as there are input data required. V2. kt, 91. kt, P3 to$., k repeat between .'a onoe more. kl, ~2,k1. k3 tog., mes; 47(51) sts. A natural language e.. Engliah) kl, p2, kl; k2 tog. 3(5) t might appear to be the best choice for a human-understandable computer language, and Poetry: for some applications it may be. But natural languages suffer from three Shakespearean sonnets are in iambic limitations: verbosity. ambiguity, and pentameter and difficulty to decipher. This is partly consist of three quatrains followed by a because the meaning of a given word la oouplet. dependent on its useage in one or more sentences (called "context aenaitivew) and because they require complex and nonuniform grammar roles with many exceptiona. Specialized vocabularies and grammars permit FORTH is capable of being matched to terse and precise expression of ooncepts for each of the above relations at a high level. re tricted sets of problems. For example, Furthermore, using the FORTH concept of 121 consider the following definition of a vocabularies, several different applications sy logism from propositional caloulua: oan be resident simultaneously but the scope of rererenoe of component worda can be restriated (1.e.. not global ). This versatility is beoause the PORTH language is extensible. In ract the normal act or programming in FORTH (1.0.. defining new This sentence may be translated into English words in terms of exiating worda) extends as 'Given three stateaents which are true or the language1 For each problem programmed false, if the truth of the first implies the in FORTH, the language is nxtended as truth of the second, this implies that if required by the special needs of that the truth of the second implies the truth Of problem. The final word defined which the third, then the truth of the first solves the whole problem la both an operator implies the truth of the third.. Ambiguity within the FORTH language (which is also a is hard to avoid in most natural languages. noommandw) and the highest level operator The English phrase 'pretty little girls for that problem. Further, the lower level school" (when unpunctuated) has 17 poasible words defined for this problem will interpretationsf (Try it. ) [3] frequently be useable for the programming of related problems.

As for the suitability of traditional programming languages (e.g. BASIC, FORTRAN. It is true that popular computer COBOL. PASCAL, APL) for 'almost all languages allow new funotions to be added technical problems", try coding the uaing SUBROUTINES and FORTRAN-like following "sentencesn in your favorite FUNCTIONS. However these cannot be used computer language: syntsotically the same as the operators in the language. PAGE 13

FORTH INTEREST GROUP *-- f?O. Box 1105 ooo*o San Carlos, Ca. 94070 Por example, let*. a8.u~ a BASIC APL fans will point out that all the interpreter doem not have the logioal AND above is true for APL also. For something operator. To be oonsistent with similar, as aimplo am *AIDn there is little existing operators one would like to Us0 differenoe. However, APL allows only .ANDe in the following syntax: monadic (single operand) and diadic (two operand) operators; FORTH operators can be A AND B written to accept as many operands as the I programmer den ires. / (A,B are any valid operands). Furthermore, I one would want this new operator to have a I the previous discussion addressed the priority higher than "ORe and lower than .NOTe so that oxtansion of the FORTH language, but it is 8lB0st as easy to extend the PORTH NOT A AND B OR C compilerl New compiler oontrol structures (e.g., the CASE oonatruct) oan be added would mean without ohanging any of the existing oompiler. Or the existing complier can ,bc (HOT A) AND (B OR C) modified to do something different. To maintain compatibility with the existing The only way to do this is to modify one0. compiler, the modifications could be part of BASIC interpreter. Although not impossible, a user- defined wvocabularyw so that both this is usually very diffioult because of versions would be seleotively available. the following reasons: Furthermore, one oan write an entirely new oompiler which accepts either the FORTH (1) noat BASIC's are distributed without the language or another language. (Complete interpreter source code (or not in BASIC interpreters have been written in machine-readable form). (2) One would have FORTH. ) to learn this program and design a change. One modifioation might be npatohed in., but many probably aould not. Such a modified The choice of a computer langua~efor n interpreter might not be oompatible with given application (inoluding system future releases from the manufaoturer. development) should optimize the following Errors might be introduced into other parts attributes: (1 ) Be terse (1.0.. the highest of the interpreter by this modifioation. levd for the application) (2) Be (3) The prooess of ohanging is time unambiguous (3) Be extensible (c .g., consuming. Before one could try the new language, data types, compiler) (4) Do version, one would have to assemble, link, effioient (5) Be understandable (e.g., self load, and pomsibly write a PROM. (How long documentation) (6) Be correct (e.g.,testing. would this take on your system?) proving assertions, consistency checks) (7) Be struotured (0.g.. struotured programming, Another aItornative would be to use a BASIC reentrant, reoursive) (8) Be maintainable FUNCTION to add the AND operator, but it (0.g.. modular, no side effeots) would have to be referenoed as:

AND (A,B) FORTH is a oarpromise among theae goals. but comes cloaer than most existing programming If NOT and OR wore also ?UNCTIONS, (NOT A) language s. AND (B OR C) would have to be written 888 ;S KIM HARRIS

This later form la lower level, less readable, and inoonsistent with the intrinsio operators. 1 Halatead, Maurice, Lan~uageLevel: A Hissing Concept The addition of an AND operator in in Information Theory, FORTH is 88 simple as any other prosramming Performanoe Evaluation addition; it would require one lino of Review, ACU SIGUETHICS, Vol. 2 .source aode. The PORTH assembler oould be Naroh '73. used to take advantage of a partioular prooessor's inatruotion, or tho oompiler 2 nofeeman, Horning, and Wortman, A could be used, resulting in maohine Compiler Generator, transportabilityl Other dlfferencas from the Prentioe-Hall, 1970. example of modifying BASIC are: (1) Nothing existing in tho FORTH aystr need8 to be 3 Brown, James Cooke. Loglan 1: A changed, 80 no learning is required, no Logical Language, errors are introduoed to tha exiating Loglan Institude, 2261 Soledad symtem, and oompatibility with future Ranoho Road, releases is preserved. The aouroe of the San Diego, CA (714) 270-9773 FORTH kernel is not even neoesaary. (2) The new operator oan be tried immediately after it is defined; if it is wrong it oan bo fixed before any further uae is made of it. (3) This new operator is uaed exactly tho aa# as any FORTH operator. So it may be mixed with exiating operators in a totally PAGE 14 oonsistant aanner.

FnRTH INTEREST GROUP ** PO. Box 1105 em*8* San Carlos, Ca. 94070 GERMAN REVISITED FORTH LEARNS GERMAN

In the last issue of FORTH DIMENSIONS In the laat issue of FORTH DIMENSIOWS. we showed how to create a bi-lingual (or we featured an article on natural language multi-lingual) version of FORTH, and listed name conversions for FORTH. This article a simple program (set of FORTH definitions) will adC some additional ideas on the same for doing so. In respect to translation, topic. there are three different classes of FORTH words: First, the method shown (vectoring thru (A) Those such as mathematical symbols whioh code) does have some run-time overhead. don't need to be translated. Also, some code definitions cannot execute properly when vectored in this manner, for (B) Words such as DO and IF which oannot be example: translated by a simple colon definition; the existing definitions must bd re-copied and given German names. (all the definitions are short - one line - however) will pull the call of R> from the return staok and crash. Wo would ultimately liko (C) Other words, which could either be to translate names with: re-copied, or re-defined by a colon definition. 1. Preoisoly correct operat,ion during execution and compiling.

In any case. separate vocabularies oan 2. A minimum of memory cost. be used to prevent spelling clashes, no matter how many languages are spoken by one 3. A minimum of run-time oost. FORTH system. It can be possible to change languages as much as desired, even in tho 4. A minimum of compile-time oost. middle of a line. Let us now look at thrao specific exaaples to further clarify some of tho trade-offs Tho article stated that there was no involved. run-time overhead. Such performance is possible, but the example given does have a EXAUPLE 1 - COMPILING WORD run-time overhead of one extra level of nesting for each use of a word translated by Let us see how UBER oan be oreatod to a colon definition. self-compile .

The following article by Bill Ragebale is a more advanced treatment of language : D-E >R 2+ Q (2+ optional on some systems) translation methods. It is written at the level of the FORTH systems programmer, and STATE e IF (compiling) DUP 8 - Ce 80 < it uses a more standard FORTH version than the DECUS-supplied version whioh was used in IF 2 - . ELSE (immediate ) EXECUTE THEN the article which appeared in FORTH DIUENSIONS 1.

JOHN S. JAUSS : DO ENGLISH EUPLACE D-S ' , IUMEDIATE ; IMMEDIATE : UBER DO.ENOL1SH OVER ;

: LADEN DO.ENGLISH LOAD ; eta.

When building the translation vocabulary, the oolon ': ' creates the word UBCR and then exooutes the imm0diate word DO.ENGLISH. DO.ENGL1SH first Omplaces the run-tima procedure D-E' and then usen " , " to emplace the pmrameter field address of' the next source word ( OVER). illy tho new word (UBER) la ~rkedimmediate. so that PAGE 15 it will execute whenovor later enoountorod.

FORTH INTEREST GROUP *m-*b PO. Box 1105 ****- San Cartos, Ca. 94070 Now we see how UBER executes. When it is interpreted fron the terminal keyboard, 'D-E' will execute to fetch the emplaoed PIA This last method is the most fool-proof within the definitions of UBER (by R> 2+ After checking STATE the ELSE part will of all. Ye will just re-label the name field of eaoh resident word to the German execute OVER from its parameter field apuivalent. address. : MENAME ' U - DUP CIi' bO Uhen UBER is encountered by the AND (precedence bit compiler in a colon definition, it will 20 YOAD HERE C@ + execute. as do all compiling words. Again R> 2+ @ will fetch the PFA of OVER to the HERE Cl (store into length) stack. The check of STATE will be true and SWAP P HOVE ; DUP 8 - C@ will fetch the byte containing the precedence bit. When compared to hex ( overlay old name ) 80, a true will result for non-immediate. and 2 will compile the oode field - , RENAME OVER UBER address. RENAME LOAD LADED However, if the word had been immediate RENAME BASE BASIS ( OVER isnet ) the ELSE part will eXe0ute the word as in nny compiling word. This method extracts the precedence bit of the old (English) definition and adds it to the length count of the new (German) name. The new nan is then overwritten to the old The space cost of exanple 2 is 14 bytes name field. There is no space or time per word ( 8 bytes per header and 6 bytea in cost l 1 The dictionary is now truely the parameter field). Tee oo~pileti- cost translated. is the execution of D-E. There is no ultimate run-time cost in compiled definitions. A final caution is in order for Examples 1 and 2. Some FORTH methods may EXAMPLE TWO - still give trouble. If you should try: Another way is to define a UBER 'BUILDS-DOES' word E>G (English to German). It is then used to build a set of you will find the PYA of UBER which is a translation words similar to a FORTH tranalatlng definition, and not the ultimate mnemonic assembler. run-time procedure, (which is really in OVER). This would have disasteroua results : E>G e STATE e thought was the executing procedure, and you IF (compiling ) DUP 8 - CC 80 < were really altering the compiling word. IF 2 - , ELSE EXECUTE THEN For this reason, ,the method,of Example 3 is ELSE execuTE THEN ; theonly truly f001-pr00f method. The renaming method has the added use of e>o useR oveR allowing you to change names in your running E>G LADEN LOAD ayster. For example, it is likely that the E>G BASIS BASE .. . etc. old R in the international standard FORTH-77. You can simply update your system by the use of the E>G is a defining word that builds eaoh, word RENAME. German word (UBEP) and emplaces the Parameter field address of tho English word ;S W.F. RAGSDALE 8/27/)8 (OVER) into the new parameter field ( of UBER ), and finally makes UBER immediate. When UBER is encountered by tho outer interpreter, it does the DOES> part. Tho parameter of UBER, (tho PFA of OVgR ) will be fetched and STATE tested. Sinoe executing, the ELSE part will exeouto OVER from it6 parameter fiold address ( as la the example 1 ).

When oompiling, tho DOES> pa~twill bo exeouted, again similarly to D-E* an in Example 1. The space oost of the BUILDS-DOES method is 10 bytes per word ( 8 in the header, 2 in the parameter field). The oompile time is the maw as in examplo 1 and there is no run-time cost. PAGE 16

FORTH INTEREST GROUP ** t? 0. Box 1105 ***** San Carlos, Ca. 94070 Bell (1) and Dewar (2) have described By the way, virtually everything in the concepts of Threaded Code (also called Forth is part of a dictionary entry: the Direct Threaded Code, or DTC), and an compiler, the run-time routines, the improvement called Indirect Threaded Code. operating system, and your programs. In or ITC. DTC was used to implement Fortran most versions, only a few bytes of code are IV for the PDP-11, and ITC was used for a outside of the dictionary. machine- independent version of Spitbol (8 fast form of the string-processing language The code address is crucial; this is Snobol). Forth is a form of ITC, but the 'indirect' part of ITC. Every different from the scheme presented in (2). dictionary entry contains exactly one code address. If the dictionary entry is for a In DTC, a program consists of a list of "primitive" (one of the dl or so operation8 addresses of routines. DTC is fast; in defined in machine language), the code fact, only a single PDP-11 instruction address points two bytes beyond itself, to execution is required to link from one the parameter field, which contains the routine to the next (the instruction is 'JMP machine-language routine. @(R)*', where 'R' is one. of the general registers). Overall, DTC was found to be If the dictionary entry is for a Porth about three percent slower than straight higher-level operation (a colon definition), code using frequent subroutine jumps and the code address points to a special "code returns, and to require 10-2Cpercent less routine" for colon definitions. This short memory. But one problem is that for 5 routine (e.9. 3 PDP-11 instructions) nests variable the compiler had to generate two one level of Forth execution, pushing the short routines to push and pop that variable current 'I' register (the Forth 'instruction on the internal run-time stack. counter') onto a return-address stack, then beginning Forth execution of the In ITC, a program is a list of address-list in the new operation's addresses of addresses of routines to he parameter field. executed. A< used in (2), each variable had pointers to push and pop routines, followed If the dictionary entry is for a by its value. The major advantage over DTC variable, then the code address points to a is that the compiler does not have to code routine unique to that variable's type. qenerate separate push and pop routines for The parameter field of a variable may each variable; instead these were standard contain the variable's value - or pointers library routines. The compiler did not if re-entrant, pure-code Porth is desired. generate any routines, only addresses, so it was more machine independent. In practice, ITC was found to run faster than DTC despite the extra level of indirection. It also Results of Forth-type ITC include: used less memory. (A) Execution is fant, e.g. two PDP-11 Forth is a form of ITC, with additional instruction executions to transfer between features. primitives, about ten to nest and on-nest a higher-level definition. (Because of the Forth operations are lists of addresses pyramidal tree-structure of execution, the pointing into dictiona9 entries. Each higher-level nesting is done less often.) dictionary entry contains: Yet the language is fully interactive.

(A) Ascii operation name, length of the (8) Forth operation names (addresses) name, and precedence bit; these are used are used exactly the same regardless of only at compile time and will not be whether they represent primitives or discussed further. higher-level definitions (nested to any depth). Not even the compiler knows the (B) A link pointer to the previous difference. In case run-speed optimization dictionary entry. (Thia is used only at is desired, critical higher-level operations compile time.) (such as inner loops) can be re-coded as primitives, running at full machine speed, (C) A pointer called the code address, and nothing else need by changed. which aJ-uVayY. pints to executable machine code. (C) Forth code is very compact. The language implements an entire operating (D) A parameter field, whlch can system which can run stand-alone, including contain machine instructions, or Forth the Porth compiler, optional assembler, address lists, or variable values or editor, and run-time system, in about 6k pointers or other information depending on bytes. (Forth can also run as a task under the variable type. a conventional operating system, which sees

PAGE 17

FORTH INTEREST GROUP o*-oo PO. Box 1105 ***-- San Carlos, Ca. 94070 STAFF it as an ordinary assembly-language program, and Forth can link to other langusqea this tk ddoudflne of FORTH DIMENSIONS way.) Code is so compact that i, a bW Far he, cur r)ail ca~btd application-oriented utility routines can be Fluid. thL left in the system perranently, vhere they dr are lnraediately available either as keyboard commands or instructions in programs, and EDmR X)HN JAhm they are used in exactly the same way in either case. No linkage editing is needed, CoNTRnIUl~ KIM HARRIS and overlays are unusual. W .F.RAGSDALE

TYPlESEnMG TOM OLSEN X)HN JAMES (1) Bell, James R. Threaded code. C. ACM 16, 5 (June l973), 371-373. (2) Devar, Robert R. K. Indirect threaded ARTWORK ANNE RAGSDALE code. C. ACW 18, 6 (June 1975). 33%-331. ClRCUUTlON DAVE BENGEL

DATA PROCESSING P D P -11

FORTH DEFlN I T ION NOTES

PORTH is the combination of an - Tha second meeting of the PORTH extensible programming language and International Standards Team will oocur in interactive operating system. It forma a Loa Angeles on Ootober 16-19. Contact FORTH consistent and complete programming Ino. for additional information. environment which is then extended for each application situation. - A partially micro-coded FORTH-like language la desoribed in "Threaded Code for Laboratory Computersm by J.B, Phillips, PORTH is structured to be interpreted U.P. Burke, and C.S. Wilson, Dept. of from indirect, threaded oode. Thi8 oode Chemistry, University of Arizona, Tucson, AZ oonsists of sequences of machine independent 85721. The article is published in Software compiled parameters. eaoh headed by a - Prrotioe and Experience, Volume 8, pages pointer to executable maohine oode. The 257-263. Implementation is on a HP2100. user or?atea hi8 own applioation prooedurea The article also doscribes the advantages of (called words'), from any of the exlotin6 threaded languages for laboratory worda and/or machine aaaembly language. New applloations. classes of data structures or procedurea may be created; these have assooiated - A wformm of PORTH for the Apple and PET interpretive aids defined in either maohine 6502 based computers is available from code or high level form. Programma Conaultanta, 3400 Yilshire Blvd., Los Angeles, CA 90010. Ye have not used theae enough to review them for this issue The user has aooess to a computation but they have been shipped and do work. For stack with reverse Polish oonventiona. more information write to Programma Another stack is available, usually for Conaultanta or watch future issues of FORTH execution control. In an interaotlve DIUENSIOYS. environment, each word oontaina a aymbolio identifier aiding text intarpretation. The - FORTH Ino. is looking for a programmer user may exeoute or oompile souroe text from with some systems-level experience using the terminal keyboard or mass storage TORTH or similar languages. Interested device. Raaident worda are provided for persona ohould contact FORTH Ino., 815 editing and acoeaalng the data atorad on Manhattan Avenue, Manhattan Beach, maas atorage devioeh (dink, tape 1. California 90266, (213) 372-8493 .

In applications that are to run 'atand-alone', a compaot croaa-oompilad form ia used. It consists of compiled words, interpretive aide, and machine oode prooedurea. It la non-axtenaibla, aa tha aymbolio identifiers are deleted from aaoh word, and little of the usual oparating system need be inoluded. PAGE 18

FORTH INTEREST GROUP RO. Box 1105 em*mrn San Carlos, Ca. 94070 SCR r 6 HELP o rn~'nap' COIIMANG IS PROBABLY me MOST use~uOPUW FOR I A FORM SYSTM* IfALLOWS YOU TO VIEW THE DICTIONART WROS 2 AND LOCATE TXM IN HWORYo WEN YOU ARE TtS11NG NEW 3 DEFINI TIWSI IT WILL SOW 'RE-DEFINI TIONSa IT IS A YAY TO 4 LOCATE WERE.: A HISSING WORD SOLLO Be BUT I%'?*

8 9 YOU SH0U.D MODIFY TXE FOLLOYIMQ D~INIflONSTO Ills FOmAt 10 YOU WANT* FOR OBJECT CODE MMIWATIONI I LIKE 'THE 0601: FIaD I1 ADDRESSES AS 94OWCJs SIIQCE 7H1S IS MAT RESUTS IN ME WPILW IQ CODE* FOR A QUICK SAP-SOT OF 'IME DIC'TIWARYD I JUST PRIN? 13 THE LMGM AND NAMES* 14 i 5 JUST TYPE *HELPe AiJD H11 ME 'BREM' KW TO STOP*

SCR i 7

0 C HaP ) ti0 1 00 CONSTANT LASTOLIIW ( IS a000 OH MIWIO-FORW 1 2 4 CONSTANT #/LINE < WORDS PRInTtD PER LINE 1 3 4 a ONWIE ( ENTER WIfH ADDRESS OF LWGTH BYIC 3 5 DUP C@ 7F AND DECIHAL 3 *R SPACE l* 3 TYPE SPACE I 6 1 : .CODE-ADDRESS < ~TUZYI f~ ADDRESS OF LMOTH BYTC ) 8 6 * HM 5 OR SPACE J 9 10 t *HEADER ( ENTER WI TH ADDRESS OF LENGTH BYTE IP DW *NmE *CObE-ADDRLSS t 12 13 t ?TERMINAL 0 I C USER'S MACHINE DWWDOJT TmINAC BRUK 1 I4 ( RETURN '00 "FOR NO BRWD CLnO '01 ' FOR A BUM I5 8 LOAD J S 8/27778' WFR

SCR # 8

PAG-E 19 FORTH INTEREST GROUP .-. PO. Box 1105 San Carlos, Ca. 94070 HEZP 4na ILBB SOL: lwo 7 .HE 1m0 13 .CO ttm 5.WA IL43 6 IC39 9LAS iar 4TAS la5 a BOO I~Bgo> IBW 4 TUB tes7 3 TW 1844 OK

ABOVE WE SEE AN uwme OF THE LOADXNB OF THE enapeaww~ FROM DISC. If T#P( IS TESTED. AND DWPS WE Of CTIOnARu* YE SEE THE LISTING OF 'HUP' AND THE WRDS IS USES, LISfllJ6 CONTINUES INTO ?ME RESfDWT'DLCTIOWART~

BOOG LUG<. YCR

MANUALS

DECUS PDP-I1 FORTH by Owens Valley Radio Observatory, California Institute of Technology, Martin S. Ewing. (alias The Caltecn FORTH Manual) Available from DECUS, 129 Parker Street, PK3/E55, Maynard, Nass. 017SlJ. Ordering information: Program No. 11-232, Write-up, $5.00 . FORTH Systems Reference Manual W. Hichard Stevens, Sep 76. Kltt Peak National Observatory, Tucson, AZ b572b. (NOT YOU SALE)

LABFORTH An Interactive Language for Laboratory Computing, Introductory Principles, Laboratory Software Systems, InC., 3634 Nandeville Canyon, Los Angeles, CA 90049. $8.00 . STOIC (Stack Oriented Interactive Compiler) by MIT and Harvard Biomedical Engineering Center. Documentation and listings for 8080 from CP/M Users Group, 164 west b3rd Street, New York, N.Y. 10024. $4.00 membership, $6.00 per 8" floppy, 2 floppies needed.

CONVERS The Digital Group, Box 6528, Denver, CO 80226 tlanual: DOC-CONVERS $12.50 . UHTH (University of Rochester FORTH), Tutorial Manual, Hardwick Yorsloy, Laboratory for Laser Energetics, 250 E. River Rd., Rochester, NY 14621 . microFORTH Primer FORTH, Inc. 815 Nanhattan Ave., Manhattan Eeach, CA 9026b (moving soon) $15.00 . (Page 21, 22 Blank) PAGE 20

FORTH INTEREST GROUP RO. Box 1105 *moo* San Carlos, Ca. 94070 FORTH OIMENSIONS

7 CONTENTS

HISTORICAL PBPSPRCTIVB Page 24

Paee 24

DTC vr ITC for FORTH Page 25 David J. Sirq

D-CHARTS Page 30 Kim Earria

FORTH vr ASSEMBLY Page 33 Richard 1. Main

HIGH SPEED DISC COPY Page 34 Richard Bo Hain

Page 35

FORTH INTEREST GROUP *O .*a RO. Box 1105 ***o* San Carlos, Ca. 94070 PERSPECTIVE

FORTH was oreated by Mr. Charles H. to give it the tarsanmas or APL. It8 Moore In about 1969 at the National Radio clarity and consiatanoy result from betag Astronomy Observatory, Charlottesville, VA. the produot OF a single mind. (as uara A?% It was created out of his dissatisZaotion and PASCAL). with available prograaaing tools, espeoially for automation. Distribution of his work to other observatories has made FORTH the de-facto standard language for observatory A1thou@ the language epaoif loation and automation. many Impleaentations are in the publio domain, many other impleaentatlono and application packages 8 ar8llable 8s Mr. noore and several aaaoclates program products of commaroial auppliera. formed Forth Inc. in 1973 for the purpose of llcenalng and support of the FORTH Operating System and Programming Language, The PORTH Interest Group la omnterad in and to supply application programaing to northern California. It was formed in !978 meet customers ' unique raquirements. by loam1 FORTH programmer. to eocour8ga uoa of the language by the intmrohanaa of idearn though aemiaars and publloations. About 300 FORTH enjoys a synergism of its members are presently arsooiatad ?nto a feature*. It has none of the elephantine loose national organization. ( 'Loose means characteristics of PL/1 or FORTRAN. It has that no budget oxists to support any form1 a density and speed far surpaorlng BASIC, effort.) A11 effort is on a volunteer br810 but retains an interactive nature during and tho group 1s asmooiatod with no vendors. program development. Sinoa it is extensible, special wordo are easily defined

CONTRIBUTED MATERIAL

FORTH Interest GIW~needs the fdlowing mdarial :

4. Lstt.sn of general Ontwart far publicdm in this namIdtere

PAGE 24

FORTH INTEREST GROUP -- moo PO. Box 1105 ---..San-Garbs, Ca. 94070 DTC VERSUS ITC FOR FORTH ON THE PDP-11

By David J. Sirag Laboratory Software Systems, Inc. 3636 Nandeville Canyon Road, Loo Angeles, CA 90049

During the design of LABFORTH, the FORTH implementation by Laboratory Software Systems, the choice had to be made between direct threaded code (DTC) and indirect threaded code (ITC). A detailed analysis showed DTC to be significantly superior to ITC in both speed and size. This analysis contradicts the findings of Dewar (ACM June 1975) which were referenced in the "Threaded Code" article in the August 1978 issue of FORTH Dimensions. Dewar compared his use of ITC with DTC as use.d for PDP-11 FORTRAN. His analysis does not apply to the implementation of FORTH on the PDP-11.

The FORTH analysis involves 3 types of definitions - low level (CODE), high tevel (COLON), and storage (variable,etc). The Low level definitions will be encountered most frequently by far because of the pyramidal nature of FORTH definitions. On the other hand, storage definitions will be encountered far less frequently in FORTH than in FORTRAN because in FORTH the stack is used extensively whi'le in FORTRAN no stack is available. Also, when storage locations are used in FORTH operators are available which minimize the number of references. For example, in FORTRAN

COUNT = COUNT + 1

involves 2 references to the variable COUNT, while in FORTH

COUNT l+! involves only 1 reference. It should be noted that in LABFORTH, I+! is a primitive, but it is not in some other versions of FORTH. Another factor which reduces the references to storage locations is that in FORTH literals are placed in line and handled by a reference to the LITERAL (low level) routine.

The OTC and ITC routines for the 3 types of definitions are shown below, they are condensed to show only the relative PDP-11/40 overhead. The register notation in the routines is as follows:

Q is the cue register (R5) which points to the next address. It is called IC (instruction counter) in some literature.

S is the stack pointer (R4).

R is the return stack pointer (R6).

P is the program counter (R7).

RO is a temporary register assumed to be available.

0-> PAGE 25

FORTH INTEREST GROUP ern PO. Box 1105 San Carlos, Ca. 94070 DTC AND ITC ROUTINES

LOW LEVEL DEFINITION LINK LINK (CODE CODE ADDR mRACHINE MACHINE OVERHEAD OVERHEAD 1 WORD 3 WORDS 2.3 USEC 4.6 USEC

: = NEXT 1GIMOV (Q)+,RO = NEXT

H16M NARE 1 LEVEL DEFINITION (COLON) I MOV R0.Q AODRESSE S ADDRESSES MOV I~+,RO I JMP a(Ro)+ OVERHEAD OVERHEAD 2 WORDS 2 WORDS 8.0 USEC 14.0 USEC

UNNEST: MOV (R)+,Q UNNEST: MOV (R)+,Q JMP aca)+ ROV (Q)+,RO JMP a

STORAGE DEf XNI?lOU 4YARAI0Cf 1

OVERHEAD OVERHEAD 2 WORDS 1 WORD 5.7 USEC 4.6 USEC

-0, PAGE 26 FORM 1NTERST GROUP .. . . . 0. 00 x 110 5 San Carlos, Ca . 94070 The distinction between DTC and ITC as applied to FORTH is that in DTC executable machine code is expected as the first word after the definition name; uhile, in ITC the address of the machine codp is expected. Thus the DTC space advantage in the entry to a low level definition is obvious. The machine code of the low level definition terminates with the "NEXT" routine. In DTC NEXT is a 1 word routine while in ITC the extra level of indirection results in a 2 routine (Note: a JMP NEXT would also take 2 words).

In the high level definition the machine code of the "NEST" routine is stored in line for DTC, but since it is only 1 word, it takes no more room than the pointer to the "NEST" routine. However, the 1 instruction for DTC takes considerably less time to execute than the 4 instruct+ons for ITC (Note: replacing the last 2 instructions with JMP NEXT would take even more time). The remaining words in the high level definition are addresses in both cases. The last address points to the UNNEST routine which again is more complex for ZTC because of the additional indirection.

In the storage definition case the machine code of the subroutine call to the appropriate processor (VAR in the example) is stored in line. This requires 2 words not including the the storage for the variable itself. The storage words follow the call and can be thought to be the parameters for the call. Thus in this case, the 1 word code address for ITC represents a 1 word advantage over the subroutine call. The execution time is also slightly in favor of ITC, even though 3 instructions are executed in both cases. r DTC VERSUS ITC OVERHEAD SUMMARY

Us KC QTC ADVANTAGE

Low level 1 word 3 words 2 words (CODE 1 2.3 usec 4.6 usec 2.3 usec

High level 2 words 2 words 0 words (COLON) 8.0 usec 14.0 usec 6.0 usec

Storage 2 words 1 word -1 word (VARIABLE) 5.7 usec 4.6 usec -1.1 usec 4

The summary table shows that DTC has the overhead advantage in both low level and high level definitions; while ITC has the advantage in storage definitions. Considering the high occurrence of low level definitions and the low usage of storage definitions, one can see that a FORTH implementation with DTC has a significant speed and space --> PAGE 27 FORTH INTEREST GROUP ..**. RO. BOX 1105 *.*.. San Carlos, Ca. 94070 advantage over one using ITC. To make the advantage more concrete weights should be assigned to the various definition types. If we have a program containing 500 definitions (including the standard FORTH definitions), we might expect 200 low level.. 250 high level, and 50 storage definitions. Using these numbers the size advantage of low Level, high level, and storage should be weighted -4, -5, and .I respectively. During the execution of a program, ve might expect the frequency of occurrence of low level, high level, and storage to be bOX, ZOX, and 20% respectively. The result of applying these weights is shown in the following table.

WEIGHTED ADVANTAGE OF DTC OVER ITC

SIZE ADVANTAGE SPEED ADVANTAGE I I Low level 2 x .4 = .8 words 2.3 x .6 = 1.38 usec

I High level Ox .5= Owords 6.0 x -2 = 1.2 usec

Storage -1 x .I = -01 words -1.1 x .Z = -.22 usec

Weighted advantage .7 words 2.4 usec

J

Thus using the weighted advantage for DTC we would expect to save -7 words in each of the 500 definitions which is a total of 350 words. Also each time a definition is executed t'he overhead would be 2.4 usec less. This may represent a savings of 20 or 30% of the total execution time of the frequently used short definitions.

The remaining advantage that is claimed for ITC is one of machine indepeodance because no machine code appears in the code generated by the compiler. But even this advantage is illusionary since fORTH programs are transported in source form. In fact on most SySttfIIS they are compiled each tine they are loaded via the LOAD command. Thus, after a FORTH system is hosted on a given computer, the machine code that is generated by the conpiler is suitable for that particular machine; this includes the machine code generated for the DfC routines. If one did try to introduce the concept of FORTH portability at the object code level by restricting the programs to high Level definitions and placing all machine code in a run-time package, he would still probably have machine dependencies in byte versus word addresses, floating point format, and character string representation. In any case, current FORTH inplenentations do not claim transportability at the object code level. --s

PAGE 28

FORTH INTEREST GROUP PO. Box 1105 =***= San Carlos, Ca. 94070 s shown that when the special The analysis of DTC versus ITC ha PDP-11 as opposed to FORTRAN is esented by FORTH on the situation Pr advantages over ITC in ~seof DTC provides signif icant considered, u TH was implemented using DTC. ed and sizt. Thus LABFOR both spe colnput er, the choice may be However, if it is rehosted on another and 1ed as part of -the rehost ing different The change would be h s whichI would be required. effort a1 uith all the other change ;S DJS

FORTH Interest Group LABORATORY SOWARE SYSTEMS. INC. 3634 MANOEVIUE CANYON ROAD 787 Old Country Road LOS ANGELES. CALIF. 90049 San Carlos, CA 94070 (2131 472-6995

Dear Figgy,

FORTH Dimensions is just the sort of comnunications vehicle which is needed by the FORTH community for both users and vendors. My payment for a subscription is enclosed.

As Dr. R.F. Harper indicated in an earlier letter, we at Laboratory Software Systems have developed a version of FORTH on the POP-11 called LABFORTH. As the name implies, LABFORTH contains features which make it particularly suitable for the scientific laboratory environment. This environment includes high speed data collection and analysis; thus particular attention is given to making LABFORTH fast. For this reason the direct versus indirect threaded code discussion in the Thread Code article in the August/September 1978 issue of FORTH Dimensions was of particular interest. Our analysis of DTC versus ITC was an important aspect of the effort to design LABFORTH for maximum speed. DTC proved to be faster than ITC and as a bonus required less space. An article on this analysis is enclosed for your paper. It contradicts Dewar's analysis of DTC versus ITC for DEC's FORTRAN, but his analysis cannot really be applied to FORTH. IfDEC had used DTC in a more elegant manner, DTC may also have fared better in the FORTRAN case.

Hopefully the DTC advantages will persuade you to delete the requi rement that FORTH be implemented with ITC. The programming techniques used in implementing FORTH ought to be left to the designer and his results should to be evaluated by benchmarks.

I look forward to your next issue of FORTH Dimensions.

Davs Si rag

~aborator?software Systems, Inc.

PAGE 29 FORM INTEREST GROUP RO. BOX 1105 San Carlos, Ca. 94070 D-CHARTS Kim Harris

An alternative style of flowcharts called f he only mlinesm in Dtcharts are used to D-charts wi 11 be descr i.bed. But first the show nonsequential control paths (e.g., purpose of flowcharting will be discussed as conditional branches, loops). In a proper well as the shortcomi ngs of traditional D-chart, no lines go up; a11 lines either go flowcharting. down or sideways. Any need for line8 directed up can be (and should be) met with A flowchart should be a tool for the design the loop symbols. This simplifies the and analysis of sequential procedures which reading of a D-chart since it always starts make the control flow of a procedure clear. at the top of a page and ends at the bottom. With FORTH and other modern languages, flowcharts should be optimized for the ~t is customary to underline the entry naae top-down deslgn of structured programs and (or FORTH definition name) at the top of a should help the understanding and debugging D-chart . of existing ones. An analogy may be made with a road map. Thls graphic representa- tion of data makes it easy to choose an optimum route to some destinkion, but when 2-WAY BRANCH SYMBOL driving, a sequential list of .instructions is easier to use (e.g., turn right on 3rd In PORTR, this structure takes the form; street, left on Ave. F, go 3 blocks, eke.). Indentat ion of source statements to show condition IF true phrase control structures is helpful and is recom- ELSE false phraae mended, but a two dimensional graphic THEN . display of those control structures can be superior. A good flowchart notat ion should Another FORTH structure which is used for be easy to learn, convenient to use (e.g., conditional compilation has mare mnemonic good legibility with free-hand drawn name: charts), compact (minimizing off-page 1 ines) , adaptable to special i zed notat ions, condition IFTRUE true phrase language, and personal style, and modifiable OTREFWISE false phrase with minimum redrawing of unchanged sec- ENDIF t ions. . The D-chart symbol has parts for each of Traditional flowcharting using ANSI standard these elements: symbols has been so unsuccessful at meeting these goals that "flowchart" has become a dirty word. This style is not structured, is at a lower level than any higher level language (e.g., no loop symbol), requires the use. of symbol templates for legibility, and forces program statements to be crammed false phrase true phrase inside these symbols like captions in a cartoon. D-charts have a simplicity and power similar I to FORTH. They are the invention of Prof. words following BNDIP (or THBN) Edsger W. Dijkstra, a champion of top-down design, structured programming, and clear, c0nCls.e notation. They form a context-free The "condition" im evelwted, If it 1. trua, the language. D-charts are denser than ANSI "tme phrase*' im executed; othewime, the "falme flowcharts usually allowing twice as much phrase" im executed. The words follouing tlP)IF program to be displayed per page. There are (or mu) are uaconditiolully executed. only two symbols in the basic languagef however, like FORTH, extensions may be added for convenience. If either phrase is omitted, am with Sequential statements are written in free form, one below the other, and without condition IF true phrase TUltN boxes. statement a vertical line is drawn as shown: next statement I next statement condition

1A true phrase

--w PACE 30 FORTH INTEREST GROUP ----.PO. Box 1105 San Carlos, Ca. 94070 LOOP SYMBOL A more general case ia The basic loop defining symbol for BEGIN first phrase D-charts is properly structured. condition IF second phrase AGAIN

cond i t ion which is explained better graphically 1 than verbally:

first phrase +- condition

The switch symbol:

indicates that when the switch is encountered, the ."condi t ionm (on the aide line) is evaluated. Both previous symbols may be properly 1. If the *conditionm is true, then nested indefinitely. The following example the side line path is takenr if shows how these symbols may be combined. false, then the down line is taken This is the FORTH interpreter from the (and the loop is terminated). P.I.G. model. 2. If the side line is taken, all statements down to the dot are executed. The dot is the loop end r INTERPRET BEGIN ( ' IF HERE NUMBER symbol and indicates that control ELSE EXECUTE is returned to the switch. THEN 7 STACK AGAIN ; INTERPRET 3. The 'conditionm is again evalua- - ted. Its outcome might have until null word executed changed during the execution of the loop atatement. I search dictionary far next word Repeat these steps starting with step 1. found This symbol tests the loop condition before executing the loop body. However, A other loops test the condition at the convert word execute word end of the loop body (e.g., DO LOOP to integer .. I and BEGIN .. END) or in the middle of the loop body. This loop symbol ray be extended for these other cases by adding a test within the loop body. Consider the FORTH loop structure pud~Integer BEGIN loop body condition END . The loop body is always executed once, and is repeated as long as condition is false. The D-chart symbol for this check stack structure would be: Fcondition

FORTH INTEREST GROUP o**** RO. Box 1105 San Carlos, Ca. 94070 n-WAY BRANCH SYMBOL The condition is uoually an index which selects one Of the Cases. The rejoining A structured n-way branch symbol (Some- of control to a single line after the times called a CASE statement) may be cases are required by structured program- defined for convenience. (It is func- ming. Depending on the complexity of t ionall y equivalent to n nested 2-vay the cases, this symbol may be drawn differently. branches). One style for this symbol 1s: I pcharts are efficient and useful. They are vastly superior to traditional flovchart style. first case second case .. last case ;S KIM HARRIS

P.O. Box 8045 Austin, M 78712 Wwerhr 3, 1978

Editor, mrth Dimensicns:

Thank yw for your card ard s&aquent letter. SE/l was witten by -rid Fbsearch C;roup, Inc. an back I sorry that I did mt get to you momr with to be exactly uhat it says it is, a SYSIM languclge. a copy of the source code for my FORTH system. is a snall interactive incranental capiler that Frankly, I was surprised that p are interested in SV1 qenerates Mirect threaded code. It is a 16 bit it the system, since is rather limited in facilities ps;eudo arachine for use on mini ad micro carputers. am3 mfom with no other FOFU?J version in term of Nev definitions can bc added to an alreafy rid set names. I stopped work on the systm just abut the of intrinsic instructions. It is this extensibility tune I began to receive ~nualsfona an3 the see now how that allows any user to create the most optimum 6502 IWUV form FIG. I can I wld add vocebulary for his irdividd aeplicath. an assembler, text editor, ard ram block i/o .to the system, but my duties at work and at school SW1 is a virtual stack processor. Using the precluje any further deveioplent of U.T. F?3RRI for iQ)1 &meet for foth variables- ad inst~ctiarsmdces IKW. it p~ssibleto exterd stepiee progrdq to include s&ie debugging. ul do& this quite nicely. I want to especially thank you for informing We RPN stack is also om of the nrwt effective means me of Paul Bartholdi's visit the University of to of inplmmting tcp dmdesign, bottan up ding. 'lkxas. I was able to meet with him and we had a wry stimulating discussion for about an hour and a StJl oprates on a principle of thrcakd mde. half. 1 was surprised to learn fmn him har widely All of the elements of. SWl (procedures, variable, FORTH is used cormnercially, though usually under cacpiler directives, etc.) referena the previous other nanes. We also discussed tu, extensions to the entry. Thus, each code indirectly "threadsg the language that I believe greatly enhance it: (1) others ard is in turn threaded by the d follariq syntax checkiq on vilatiar for pmperly Wand it. *am SWl is a p;eudo machine, portability BDZIN. .EM) and IF. .ELSE. .THE3 constructs, and (2) the between different poceseors ard hardware is readily functions On PMW9?ESn ard "PAR]" to "PAIW" that arrorplisbed. ?he low level interpreter is really allow explicit reference to paranetera on the stack. the Fcnadrine. It is slnall (only 11 bytes are used), Finally. he showed me sm progr-ing exanples & fat. fmn the FORRl manual he wote which wide first- proof hand of the ease of prograunirq rather sophis- On of the mrrt poverful features of SVl is the ticated problems in FOWm. It is especially im- fact that is uses all on-line storage media as portant because most FPople in the werscience virtual memory. In effect the user can write departmnt here respond to my presentation of KMUll programs in SWl using the full capacity of disk w~tha resnudirq lack of interest. Mter all, they storage and never be concerned with placement of keep abreast of the field ard if they have not heard infomtion on the disk. SWl allows you to progran of it .... machine an3e procedures in assenbler usirq a high level language. This can optimize 1/0 or math I have been promoting FORTH mng the local -tines. mnprter club6 and lodc forward to the results of FIG'S micro ccnputer efforts. Plecse keep in tcuch. ?hc abwe information was excerpted fran a press release of Nmedxr 3, 1978. Rx further informa- tion, contact nr. Dick Jones, mperical Research Group, Inc., 28206 144th Avenue, S.E., Kent, WA Greg Walker 98031. PhaP (206) 631-4851.

FORTH INTEREST GROUP a-o- PO. Box 1105 **--* San Carlos, Ca. 94070 Ihc abve exmples vhile not especially excitirq Here are some facts regarding Porth object on the surface are quite interesting when you're snd size exeuction sp~d8versus Psdly coding. actually writinq these progrmrs on a system installed with Forth and one that isn't. Uslng standard mrth, Inc., sane progrmmers (myself inclcded) , Md 0th- have made sane pretty incredible state- disk-based Assmbler system yw'd pmly have to open an edit file, write the proqra, tne edit ments about Forth code resulting in less memory close file, call the assembler, and load the oblect file so cquired ( 1 ) ad execution speeds as fast as AS-ly you could use the debug program to execute. mybe written coQ ( ! !) . 'R, help clear the air I'll try to explain those tuo outrageous claims. 10-30 minutes depending on the problerns you have along the way. In Forth, you'd enter the code First, Forth code can run as fast, but not statement on the command line, carriage return, faster, using a constructional statement called ty "KEY", (a),and it's executing. 30 seconds 'Coden which is followed by a sort of mnemonic maxlmm! If you liked the way "KEY" executed you'd machine code string and a jump back to the Forth save it off on the disk using the Forth Editor. inner inteqxeter. It isn't reasonable to just have (Another 20 semrds. ) one big aodc statcrnent .for the %bole -ran. So this gets us into another Forth constructional The colon statemnt in brth was said to save man statentent called a "colon definiticn'. in mrywer Assembly, and provide the hign level languqe ability. An exanple code statement that Colon statements cost speed but save program wuld read the CRT keyboard cam& messages and then mnory avcr Assenbly. Colon statements constitute execute the desired action could lodc like: the 'high level" aspect of mrth but let's get bad to the point. : KL'YBQRW) 64 fl DO KEY 7F AM) DUP 0D = IF LFAVE THEN LOUP MECVIF ; An exanple "code" statement in mrth to hendle the character input fmn a CRT to an Intel SBC 80/20 Keyboard is the label of this routine. Every wuld be: other word (oO, KEY, AND, =, LEAVE, THEN, LL)CB, and EXECVIE) requires tw bytes of mry. r-bit nunkrs OODE KEY BDCIN ED XNP RRC I1W3 CS require 3 bytes, 1 for the nunber arrl 2 for a routine EC IbP A L 130V 0 H PNI IiPUSH JM€' that differentiates nunbers Era hods and prar~des these numbers on the stack for use by succeeding PWE: Forth code statements allow begin-end operations, e.g., 64 and j3 for 'CO'. and if-else-then constructs within the assembly. Also Forth requires source- 'fbe mmry saving can be visualized by thinking destinaticnxprand olganization of each of the routine "keybard" as a routire that looks assenbly statement (A L MOV instead of WV like: LA). KEYBORI(D: CALL64 ;a pm~ran This exact srme ZOuti~in Assembly lan- =B ;a progrm guage would be: CALLCO ;to stact a 64 locp CALL KEY ;to inpt data ;place in next avail CALL 7F ;# for ANi, CALL AM) ;to AND it ;input status CALL Mm ;to WP data ;rotate reoeiver ready CALLm ;for (CR) test ;into carry bit CALL IF ;for (CR) test CALL LEAVE ;if (CR) leave loq, ;inpt CRP data CWTHPl ;to canplete IY ;push data on CALLIDOP ;to loop 64 times ;stack in 16-bit CW ExEm ;to DO camand :format CALL ";" ;to UO next one

bokiq at it this way, each CALL taices a byte. By entering ' KEY BD DUMP on the Porth system Fourteen bytes could be saved if the CALL OPCODE you'll get the object code displayed as: could be eliminated. me result wuld be the tw byte address' of everything to CALL. The innemst mrth interpreter uses these address' in seance and is about 12 bytes of merory code and has ;he label 'NMT' . This is exactly what the Aeenbly code would pmducc if Og'ed at 48j7H ard the label HPtGH = Thus, for just this single example, 14 bytes at 41H. were saved, at the cost of 12 bytes for "NEXT". But cwry colon ad code Statement used "NEXT" so the Ikricwhg the exarple mrth code statemnt: 'BEGIN" mmry savings build because "NEXT" is executed so v.uducs3 no cbject but sinply acted aa a label for many times. me justification in using sub-routine "END. Md provided the JM: address for EED. *CSW calls in Assenbly mde versus inline code is based on sinply pmvided the JMP typ for m, in this c- how many times it is called. "kE)(Tm is canpletely JNC. "CS NOP QW would hare -lamtad the jur~ justified because it is called an enoms nuntxr of tyFc 9d produced JC. times. Forth, Inc., has stated .NEXTw would be an

PAGE 33

FORTH INTEREST GROUP ***** F?O. Box 1105 ***** San Carlos, Ca. 94070 excellent micnrcode to be inclded in a 80 Large coQ statanents can quickly get out of hand set and I'd have to agree. Before a "NEXT" with more than two lines (line in the example of vould be implemented In WSprocessor-like 8085, "mp),becaw of the lesser ability b canaent e& 6800, or the 1 ike, mrth is going to have to b- acax as in Assetbly. So Ftxth, Inc., has stated quite dear to the industry. So I don't see it & statements should be kept short am3 meet. It's happening except in some 2900 bit-slice imple- really up to the user to trqde off reahbility for mentations. speed-

All this concern abwt microToding "NEW ha IIhe naniq of colon and codc statement labels cm its mot. "NMTn is executed between eah wrd in a mally improve malability if p put 6une ttought colon statement bebeen each ~3rdof a wrd that into the naning. itself is the rime of a colon statanent. %emfore. "NEW slcvs thirqs dwn during exatiar, but k & was said earlier, the Rxth pmqrun statanent redeemiq since it saves space arrd all- the high can be executed by enterinq it on the connand line, level nature of Ebrth. then typing the nap for execution. Colon statements are included in this ability and extremely fast lb keep thirqs wing quickly in the execution ding ad detuggiq is the result. of mrth pmgrans, colon statements should main a feu mrds defining the action of the defined colon I really object to paying $2,500 for any software, statement and each word should be very closely but Brth is wxth it. (Ihey'd probably sell mce if connected to a code statement as possible (since it wsn't so expensive.) Besides the price then code statements run at full machine speed). Aim, to be a feu other mpediments to Fbrth gaming each word in a colon statement should be powerful, a more rapld ppllarity growth. (1) It &es take if the ~3rdis the label of a cok statement, this saae gettirq used to. (2) There's not many mrth could mew large code statanents. system and progrmmers amwd. (3) People, in my jwt,are tob quick to &em it.

HIGH SPerT) DmCBY ey Richard 8. nnin Neptune UES, Pleasa*ar, CA

'fb really get fast disk ccpies on your BmS-800 -ran. Iha amstant named SaWKH provides the (RI Intel Cow.) mrth systarrs, add this progrm to first of the 3328 RAn bytes need&. your disking load: WLICXCE when exewted calls t?W to format the ( HIGH SPEED DISK COPY RBU-781001 ) disk in drive 1. "77 &IWe sets up a DLOOP to 16384 CONSTANT SCRATCH copy all 77 tracks. I/O requires mZH(locatiar) 2000 CONSTANT BIAS I (the track and index of the loop) TRACK + (to 26 CONSTANT TRACK canpute block # for 1/0) REM (fmn, drive B) and 4 CONSTANT READ ALL (for # of sectors). VO will perform the disk 6 CONSTANT WRITE operatian. 'Ie prints the current track birq mpied 26 CONSTANT ALL to entertain the aperator. Next, S3A101 qain gives : DUPLICATE FHT 77 0 the scratch area for 1/0 and I TRACK BIAS + DO SCRATCH I TRACK ' prwfdcs the equivalent block nun& in drive 1 for READ ALL 1/0 I . Vo- SCRATCH I TRACK BIAS + WRITE ALL 1/0 WIUTE ALL instructs I/O to write all 26 sectors STATUS IF [ ERROR] LEAVE THEN fmn scratch area. I/O perfora the disk operation. LOOP PLUSH CR [ COPY ] 7 ECHO bTMZLS pops the disk status byte fmn locatian 20H ;S DUPLICATE TAKES 80 SECONDS 10 and if ntn-zero prints &RFOR ad leaves the loop. FORMAT AND COPY ENTIRE NEW DISK. Else the loop repeats Md FUSS is executed for the hecJc-f-it. COW is pr~ntedMd BELL is echoled to lbe main reason this progrim will take anly 80 QZP to signal capletion. seomds to make a is whole track8 are read fmn the master disk in drive 0 and whole tracks are written to tk copy in drive 1. But, alas, p'll need 3328 bytes of continuous RAM to run this FORTH DIMENSIONS

DECEMBER 1978/JANUARY 1Q/9 VOLUME 1 No. 4

PUBLIC MEETINGS PAGE 37

COMMENTS PAGE 37

THE "TO" SOLUTION PAGE 38 Paul Bartholdi

THE FORTH IMPLEMENTATON PROJECT PAGE 41

FORTH INTERNAT KINAL STANDARDS TEAM PAGE 41

TTC CORRESPONDENCE PAGE 42 Joh F. Spencer

ply-FORTH BY FORTH, INC. PAGE 43

GLOSSARY DOCUMENTAT ION PAGE 44 0. W. Wen

L€11 ERS PAGE 45

FORTH INTEREST GROUP -**-* PO. Box 1105 ***** San Carlos, Ca. 94070 S TAP? PUBLIC MEETINGS 01 F.I.0 The volunteer ataffing of Torth Dimensions is Forth Interart Croup 18 pleared to The a bit 'fluid. lor this issue. our staff con- announce a public meeting aeries. Ye will siatad of a et on the fourth (I) Saturday of the month Hayward. Ca., tn the Special Events ROO. the Liberty House Department Store, in the EDITOR Bill Ragadale ~uthlandShopping Centar (800 Southland Mall) RIVIEY Dave Boult on

This room is on the third floor rear. The CONTRIBUTORS Paul Bartholdl formal meeting begins at 1:00 PM. but We D. W. Borden gather for lunch about 12 Noon. TYPESETTING CLG Secretarial The specific dates are July 28, Aua 25, and Vydec Sept 22. Dct 27. and Nov 24. A atogle tech- nical topic will be presented in detail, with ARTWORK Anne Ragsdale uorkahop seaaions on the fig-FORTH model, and any topics of immediate interest. In July, CIRCULATION 6502 TIM and Persci Dave Lyons will present the aacii memory dump of Forth which is part of his 6800 veraion. This Forth program show* tHe entire langua8e map on one sheet of paper1

HISTORICAL PERSPECIVE

FORTH was created by Mr. Charlea It. The insure of Forth Dimansions have ltoore in about 1969 at the National Iadlo been scheduled for two month intervals. but Aatronomy Observatory, Cherlotteaville, VA. have been at intervals determined by the over- It waa created out of this dissatlefaction all activities of the steering conmittee. with available programming tools. especially In the past months we have participated in tho for automation. Distribution of his work to International Standardr Team, given confeteaco other observatories has made FORTH the papers the Fourth Vest Coast Computer Faire, de-facto standard language for observatory attended the Forth Users Heatin8 in Otrecht, *uComation. Holland. Nr. Moore and several associates forred These events have been outwardly reflect- Forth, Inc., in 1973 for the purpose of ed in the large gap since Iasue 3. lor the licensing and support of the FORTH Operating near term, hope is in sighti. Ye have Iaaue Syatem and Programming Language. and to euppl~ 5 ready for publication in three weeka, and application programming to meet customers Issue 6 should occur within a month. Thia will unique requirements. wrap up Volume 1. At this time we will evaluate our efforta. and plan for future FORTH enjoys a synergism of its features. activities. Member comment will be quit. It her none of the elephantine character- apropos during this period and will help istics of PL/l or FORTRAY. It has s denslty shape future application of effort. and speed far surpassing BASIC. but retains an interactive nature during program development. Since it ia extensible, special words arc Thrnka are due the membership fot their eaaily defined to give it the terseness of patience during thls period. APL. Its clarity and conslatency result from being the product of e aingle mind (as were APL end PASCAL).

Althouah the language apectficatlon and many implementations are in the public domain. many other implementations and application package# are available as program products of commarcial vendora.

The Forth Interest Croup is centered in Northern California, although our membership of 450 is world-wide. It was formed tn 1978 by local Forth programmers to encourage use of the language by the interchange of ideas throuuh aeminarm and publications. All effort ia on a volunteer baeia and the group is affiliated with no vendors.

Page 37

FORTH INTEREST GROUP *ee** PO. Box 1105 ****- San Carlos, Ca. 94070 THE "TO" SOLUTION

Paul Bartholdi Observatoire De Geneve CH-1290-Sauverny Swi trerland

At the Catalina standardization meeting, Chuck Moore suggested rapidly the "TO" construct to aleviate some, if not all, of the difficultiCs associated with address manipulation. Thts new construction seems to me extremely powerful. It should con- siderably decrease the number of errors and 3. VARIABLES or CONSTANTS 7 improve the readability of programs. It is very easy to understand and to use (much Some advantaqes of the new concept are easier in fact than the constructs It is quite evident from the previous examples. replacingl). Its implementat ion is also Just befor'e the Catalina meeting, I came to trivial but the lack of experience in using the conclusion that variables should be it may hide some difficulties. These notes dropped altoqether. If A , B , .. . 2 had try to sketch its potentials. been constants in the previous examples then, using P and 1 , the three lines would The " lV concept have been coded The basic concept is the following: The code associated with - VARIABLES is divided into two exclusive parts.

- The first one (or " fetch code ') is which is already better than the "old" above. ident ical with the one associated normally with CONSTANT . It pushes on The difficulty starts with ARRAYS. If the stack the value (byte, word or they push values onto the stack instead of words) in the parameter field. addresses, then it becomes much more dif f i- cult to store values at the right places. - The second one (or ' store code ") is new. It transfers the value (byte, Note that ' C (or H or 2 ) takes two word or words) from the stack into the words but is really, at execution time, parameter field, it is equivalent to a single operator ( LIT ). ! (or CI or D! TO is then the shortest solution in or PI ). terms of memory space, and more or less equivalent to the CONSTANT solution in terms The choice between the two codes depends on of the time used. a state variable (which will be called WAR hereafter) that has two possible states: 0 (or fetch state) and 1 (or store state). 4. The ' address " problem If WAR = 0 the first code is executed and %VAR is unchanged. But the main advantage of " TO " in this context are the following: If WAR = 1 th? second code is executed and 8 VAR is immediately returned to U. - In the general sense a " CONSTANT " should be used as such, and never (or hardly ever) be changed. In particular it may The operator TO " sets 8VAR to 1, reside in PROM . I suggest then to keep the forcing the next-called variable to store constants as such, its associated code the content on top of the stack in its ignoring the value of 8VAR . We then parameter field instead of fetch ing it. should redefine the variables to check RVAR and behave accordingly. 2. Examples using " TO " - One of the main unresolved points at We suppose three single variables called Catalina was the definition and use of A , B and C three double variables P , G addresses for variables in the qeneral and H , and three floating variables X , Y sense. One consensus was obtained in and Z . Then the following half-lines are September at the Geneva meeting, that is, equivalent. The first column assure the as far as possible, addresses should be old definitions of variables, the second one omitted. The " TO concept solves this uses the new concept. requirement admirably. No addresses are Page 38

FORTH INTEREST GROUP ----e PO. Box 1105 *-a** San Carlos, Ca. 94070 ever put on the stack, or manipulated ( BLOC in of course just a provisional explicitly. Then byte or word addressing is name 1 ) ~rrelevant. It is taken care of at the system level only, in the code of the second Example : part (the 'store code'). 4 , 12 BLOC 5 + TO 5 12 BLOC 5. Portability instead of Because of this, FORTH prograns become more portable. ' TO ' replaces all fetch 12 BLOCK DUP 4 + @ 5 + and store operators which would or would not SWAP 5 + I be distinct, which would work on byte Ot "posit Ion" or word addresses. Transporting or a program from a micro to a large CDC implies now much less adaptations. 12 BLOCK 4 + g.5 + 12 BLOCK 5 + I 6. Clarity - security 9. general access to the (whole) nemory Using less operators, in fact the strict minlmum, 1s probably one of the beet ways of No good FORTH programmer would ever improvinq clarity. Note also that " TO ' accept to be strongly restricted in his appears as an infix operator to the program- access to the memory. But if the " TO ' mer (and readerl). In terms of security, ' concept is really accepted, then all the Q TO " implies that only the parameter field and 1 operators should disappear. I of variables can be changed. Other addres- suggest, instead, to add (its usage could be ses are not (at least directly) accessible. restricted) a generalized array called MEMORY (or any equivalent) with once more This is certainly a tremendous gain for the double code associated with it. some envt ronments. Then

MEMORY would either fetch from or store into the real address.

AS an example, we would have 7. The ARRAY problem @ TO 15317 MEMORY instead of The use of " TO " with ARRAYS is not as 0 15317 1 or sim~leas with variables. but still auite practicable. Note flrst that anything but a DO I MEMORY S. LOOP insteadof variable can stay between TO and the " ' DO I @ S. LOOP etc. variable's name. If C is defined as an ARRAY (with the double associated code) is clearly equivalentto e and then I depending on WAR.

A (instead A @ 10. Generalization of address matchingr DO I To I C LOOP virtual arrays (instead of DO I I C I LOOP

explicit address arithmetic in the procedure the Of A into (see the PPTof JimBtault for example). Of The necessary then This is certainly neither clean nor fast. be What I propose is the following: A ABTOC virtual array ( VARRAY , DVARRAY , IVARRAY CVARRAY etc.) behaves like an which is surely less pleasant because of its array, but, does not resewe apace, exccpt asymmetry. for a pointer to the real array. The link between the virtual and any portion of 8. Fetching and storing inside a disk block the me,ory is by the word MATCH The problem extends of course to 'virtual . arrays' like the disk blocks. In this example: context, direct access should be considered separately from Data Management. The double lug ARRAY CUSTOMER code concept associated with " M " should 1gg ARRAY STAR be extended to the Data Management opera- VARRAY NUMBER tors. For the direct manipulation of data , CUSTOMER MATCH NUMBER inside a dlsk block, I suggest the creation a new operator* with the double code, ag-ciates the real arrw CUSTOMER with the associated with the form of virtual array NUMBER . NUMBER will be equivalent to BLOC CUSWER. Page 39

FORTH INTEREST GROUP -*--* RO. Box 1105 *-*om San Carlos, Ca. 94070 Remember that, as previously, NUMBeR pushes the value of the ith STAR or CUSTOMER on the stack. and TO < i> NVn8ER will store into the ith STAR or CUSWER . At any t ir, CUSTOMER can bc replaced by STAR , (and vice versa) by STAR MATCH NUMBER

In thin way, MEMORY is defined by

SCR 0 150 0 ( Exampla of the creation of TO ) 1 HERE 0 . CONSTANT XVAR 1 ZVAR SET TO 2 : VAR CONSTANT ;coDe INB. ZVAR LDA, 3 A0 IF. B I) LDA. PUSH. 4 ELSE, CLA. ZVAR STA, 8) LDA, B I) STA. POI, 5 TREN. 6 : DVAR COISTANT . ;CODE INB. ZVAR LDA, 7 A0 IF. B IDA, DSP. A I) DLD, S) STB, ?OSn. 8 ELSE, CLA, ZVAR STA, ..T STB* S) DLD, 9 .ST I) DST, POP.* 10 TREN. 11 t ARRAY O CONSTANT DP +I ;CODE IIB, I) ADD, XVAR LDAs 12 A0 I?. B I) LDA, PUT. 13 ELSE. CLA. XVAR STA, 14 S1) IDA, B I) ST*, POI., 15 TREN,

SCR I 151 0 r 2ARRAT 0 CONSTANT DU? + I+ DP +I 1 ;CODE IIB, S) ADD, S) ADS, XIAR LDA. 2 A0 I?. B I) DLD. S) STB. PUSR. 3 ELSE, CLA, XVAR ST*, ..T STB. 4 ISP, S) DLD, e.7 I) DSTe POI.. 5 TRII, 6 1 VARRAT 0 CONSTANT ;CODE IIB, B 1) LDB, S) ADD, XVAR LDA, 7 A0 IF. B I) LDA, PUT, 8 ELSE, CLA, XVAR ST*, S1) LDAs 1 1) STAs POPS 9 THEN, 10 : DVARRAT 0 CONSTANT ;CODE INB, B I) LDB, S) ADD, S) ADD, I1 ZVAR LDA, A0 IF, B I) DLD* S) STBs PUSH, 12 ELSE, CLAW ZVAR STA* ..T ST88 13 ISP, S) DLD, ..T I) DST, POP., 14 TREI, 15 PORTIJ IMP NATCR I ; Inr '

hula' axampla of tha uma of TO will be !rammatad i8 tha mext laaue of Forth Direnmiona. It utilisem Knuthm examplo tot the calculati~n of tha data* of Eamter.

rage 40

FORTH INTEREST GROUP --*-* PO. Box 1105 ***-* San Carlos, Ca. 94070 FORTH IMPLEMENTATION PROJECT

In June of 1978. the Forth Interest Croup the Fourth west Coaet Computer Faire, 1.7 1919 heid its' first public meeting. With only in Sari Francisco.' Ill The result im that PIC mintma1 publicity, ve had in excess of 40 nor offers the Iastallation Manual vith people attend. Ue had intended to offer glomsar~and Forth model ($10.00) and assarbly educational assistance In using Forth. language liatings for numerous computere However. ve found everyonr van enthusiastic to learn Forth. but only five had access to ($10.00 0 Included are: 8080, PDP-11. runninp systems. PACE. 9900. 6800. and soon 6502, and 2-80. FIG then surveyed for vendor avsilability Note that PIC offers theme listin8s vhich of the language. We found there were numeroua atill have to be edited into machine readabla mini-computer versions at educational and form, cu~tomized, and aseembled for specific research in~titutlons. all directly decended installations. We hapa that local teama from Ur. noore's word st NRAO. Of course. share the effort and then distribute for Forth. Inc offers numerous commercial systems. Other*.

None of these systems vere available for Reports of installations are beginning to personal computing. It appeared unlikely that! come in from the USA and Europe. We sincerely thls need vould be mat in the forseeable hope this vork vill give a benchmark of qual- future. Our conclurion vas'that a suitable ity and uniformity that vill raise thm model should be created. and transported to expectation of all usera. individual micro-computers. Thus vas born the Forth Iaplementa~ionTeam (FIT). FIG vould like to thank the follovim8 members of the Implementation Team who have This team was proposed as a three tier devoted a major part of oine months' spare structure. The first tier had several exper- tire to this effort. lenced Forth systems pro~~rammer.. vhv vould provide the model and guide the implementation Dave Boulton Instructor effort. The next tier was the moat critical. John Cassady 8080 It was composed of systems level proaramrnera, Gary Feierbach Comp. Aut. not necessarily having a background in Forth. Bernard Greenin8 2-80 They were to transport the common language Kim Harris Librarian model to their own computerm by generating John James PDP- I 1 an sseembly lso8ua~e liating that followed Dave Kilbridge PAC& the model. Their results vould be passed Dave Lion 6800 to the distributors that form the third Uike O'Ualley 9900 tier. These distributors would custoslze for Bill Ragadale Instructor specific personal computer brands. Finally. lob Smith 6800 the nsers could have access to both source and LsParr Stuart 6800 object code for maintenance. (11 Pagadale. William F. Space doesn't permit inclumion of the "Forth Implementation. A Team Approach*' FIT project. itself. The project wan detailed The Best of the Computer Fairea. Vol II as one of the six Porth conference papers at from: Computer Fsire ($14.78, USA) 333 Svett Road. Woodaide. CA 94062

FORTH INTERNATIONAL STANDARDS TEAM

For severs1 years the Forth Umers Croup batwean major users. lor example. FIG ia (Europe) has sponsored a team vorking toward learning from the multi-tasking of U of K. a standard. publication for Forth. The 1977 Kitt Peak and Utrecht arm running fi8-FORTE. meeting (Utrechtl produced a vorking document and re have adopted the security package FORTH-77. Attendees included European pionaered in Europe. lone of theme event# educational institutions and Forth, Ioc. would have been likely vithout the contact# begun at Catalina. XIS October. 1978. an expanded group ut at Catalina laland (Calif. )- Attendees The Team has announced tbe next Standard8 included Forth Users Croup (Neiuvenhuigzen, Meeting for October 14 tbru 18. 1979, again Bartholdi). Forth. Inc. (Moore. Rather. at Catalina. The team agreed on an orginit- Sandereon). FIG (James. loulton, Ragadale. ational budget of $1000.00. to be met by $30. Harris). Kitt Peak (Uiedsner. Goad, Scott). contribuitions by aponaorm (individual8 and u of Rochester (Forsley). SLAC (Stoddard). and companica 1. Safeguard Ind. (Vurpillat). These fundm vil1 be used solely to defray The document resulting from this four day organizing costa of tho annual meeting and meeting has been released 8s FORTE-78. Thim distribution of the vorking doeurenta to document is becoming a good refereoce guide in partielpanta. Th0.e eon~ideringparticipetimg evaluating the consistency and corpleteneas of ahould become Tear Sponmorr by remiting a8 particular Forth systems. It is available given below. Sponsors will receive the juat from FIST to partici~atint-. snonsors. (See releared FORTU-78. and a11 Team uilings. below.) Pleeee remft to FIST, %Carolyn Rooenberg. A major benefit of the tear meetin8 van Forth. Inc. 815 Uanhattan Ave., Manhattam the development of close communicaciona leach. CA 90266. Page 41 FORTH INTEREST GROUP ---*- PO. Box 1105 -**** San Carlos, Ca. 94070 PASCAL COMPUTING SERVICES INC

1979 February 22

Editor expected." FORTH DII(ENSI0NS P.O. Box 1105 Obviously the two men are not referring to the same thin a. San Carlos, CA 94 Hr. De- is referring to the list of addresses vhich def%e the FORTH word, vhile Mr. Sirag is referring to the impl- mentation of the FORTH interpreter. If indeed Ur;, Sirag's statement vere true (vhich it is not) that their analysis Dear Sir: contradiccs the findings of Uewar", then they snould have implemented a DTC langua l rather than the ITC language of I was somewhat disconcerted when I read the article by Mr. FORTH! Indeed, a carefuf examination of what is actually David J. Sirag. "DTC Versus ITC for FORTH on the PDP-11". occuring in LABFORTH reveals that their techniques are lo- FORTH Dimensions, Volumc 1. No. 3. The author has, 1 be- gically identical to Dewar's ITC. They have simply. through lieve, misunderstood the intent of the article by Ur. De- clever programing. taken advantage of a particular instruc- war. tion set and architecture. It is beyond the scope of this letter to prove this equivalence, or to support the FIG In Mr. Dewar's article, the definitions of direct threaded desire to have a common implementation structure for a11 code (DTC) and indirect threaded code (ITC) are versions of FIG FORTH. "DTC involves the generation of code (my em- Please note that I am not quiblin over semantics with Mr. phasis) consisting of a linear Aist of addres- "rag. All definitionGre arbit$ary. (However, the value ses of routines to be executed. of a definition lies in its coneistency. precision, and useability. I find Mr. Sirag's definition of DTC and 1TC "ITC ..." (involves the generation of code con- to be inconsistant with the environment in which he ope- sisting) "...of a linear list of addresses rates, FORTH, and thus quite useless.) My intent is twc of vords which ~ontainaddresser of routines fold. (1) I am a self appointed defender of the excellent to be executed. work of Mr. Dewar, and (2) I want to correct any misconcep- tions concerning this issue for readers of thir newsletter As ap lied to the FORTH type of heirarchal structure (Heir- who did not have access to Dewar's (better) definition of archa! indirect threaded code?), I vould extend Mr. Dewar's DTC and ITC. definition to be "ITC involves the generation of code con- sisting of a linear list of addresses of words vhich contain addresses of routines to be executed. These rottines may them- selves be ITC structures. However. Mr. Sirag based his conclusions on the following . President loose definition: - Pascal Computin Services, Inc. 14011 Ventura Bfvd. .Suite 2OlE "The distinction between DTC and ITC as Sherman Oaka, CA 91403 applied to FORTH is that in DTC executable machine code is expected as the first word after the definition name; while, in ITC the address of the machine code is Because of its speed and economy, mRTH or mass storage. Other improvements over Inc.'s FORTH language has been favored by previous versions include faster dictionary many mini and microcompute? designers. Now search, all 16-bit arithmetic and a simpler comes polyFORTH, which combines the best target compiler. features incorporated in the mini and micro versions. The target compiler can be used to develop a program of a micro-computer developlnent PolyFORTH is a multilevel language with system. The compiler code can either be the essential Eunct ions (e.g., basic arith- executed directly, or be compressed and metic and logic operators) in a 512-byte burned into ROH. Scientific routines, a nucleus, and user-defined "words' (com- data-base management system and applications parable to macros) in the outermost layer. software are available options. What's more, the standard package fits in 4 kbytes of PROM, with an additional 2 k The 8080 and 9900 are polyFORTH's first for the assembler and text editor (which targets. but versions for the 8086, LSI-11. aren't needed to run a proqram once it's Ser~es-1 and Honeywell Level 6 are scheduled developed ) . by the Manhattan Beach, CA company for release later this year. The new operating system goes beyond previous FORTH versions by being able to Contact Steven Hicks at PORTH, Inc., 815 handle molt itasking and many terminals Manhattan Avenue, Ranhattan Beach, CA 90266, (limited only by the hardware), and by (213) 372-8493. including a buffer handler that supports RAM

January 23, 1979

Dear FIG: of threading them in a subroutine, and it is at thie low level of primitives that the Having just received your issue NO. 3, it concept has meaning. Even when a subroutine seems to me that the "DTC" method used by call saves nothing compared to a full Siraq is still .indirect threaded code" in in-line expansion, going to two subroutine the terminology used by Dewar, and should be calls, 1. e. ~ndicect threadxcode, many distinguished from other implementation save space by reducing the amount of code to methods as being "executed" rather than identify the types of the operands being "interpreted." The use of actual machine processed, ana ln some cases it nay also code in place of the code address is the save time. On a very large computer perhaps "executed" aspect, but only in the case of all the variable types involved are an the Low Level Definition (Code) does the inherent part of the machine instruct ion use of machine code reduce the level of set, and the memory may be tagged to indirection in the threading to that of identify type there as well, and both the direct threaded code. In the Storage questions of executed/interpreted and Definition in Sirag's diagram, there is indirect/direct would not be relevant. If still a subroutine call in the dictionary one had a machine which executed PORTH entry containing data (constant, variable primitives as its machine language, you type entries). Direct threaded code would would st ill have indirect threaded code, but require this subroutine call to be moved completely executed instead of interpret&. from the individual data-Word to the code The PDP-1 1 seems to fall in between. string referencing that word. Whether that subroutine call is executed by an actual None of the above considerat ions, how- mach ine language JUMP SUBROUTINE instruct ion ever, contradict Mr. Sirag 's main conclusion or by an interpreter routine is another that how PORTH is implemented should not be matter. Now, in the case of the Code type part of its definition. dict ionary entry, use of executed machine code tends to also remove a level of One final note: in the DTC, ITC com- indirection because only one jump is needed, parison for storage definitione, DTC was there being only one address, that of the shown having a larger overhead than XKeven code routine. involved; this coincidence though the VAR routine appears shorter in unfortunately confuses the two consequences, the DTC case. Even though the space over- even though they are separate. head is greater, I wonder if he has over- stated the DTC overhead time. He seems to The concept of Threaded Code seems show a single jump-aubrout ine taking longer inherently fuzzy, because any high-level than an interpreted jump. instructions compiled by a translator into a series of subroutine calls has the same form sincerely Yours. as threaded code, so it looks like almost any compiler is goinq to use a certain amount of threaded code. Some operations, however, like adding two numbers, take so Georqe B. Lyons little machine code that many compilers 280 Henderson Street would expand them completely in-line instead Jersey City, New Jersey 07302

FORTH INTEREST GROUP ***** I? 0. Box 1105 *-"-* San Carlos, Ca. 94070 listed in the article (still waiting for DBCUS) except for the laat om: is it in priht7 mar PIG: I also have the docuaentation for the I was very excited to find sowthing from Digital Group's CONeRS and Programma's 6502PORTB /for the Apple, which I don't you in my mail today, but then I was dis- appointed to discover that it was a copy of have). Both of theae programs are outer the journal article which introduced me to interpreters written in assembly language, PORTH and your existence, which I already and contain no inner interpreter. Interest- have. ing, and they look like FORTH, but that's not really what fant to do.. . On October second, I sent you a check and asked for everything else offered on the Rather than invert another 30 cents in subscription form (PORTH~IMENSIONS,Volume postage, I'm enclosing a check for $2.00 1, number 1, p. 22.), i.e., newsletter sub., for the reprint--I know these things aren't glossary, and FORTH-65. And I've been free, but pleaes send the other items soon, anxiourly awaiting the receipt of any or all okay? Thanks. of there. Sincerely, Dan del Vecchio Of course I realize you're all volun- Ann Arbor. MI teers, and I'm not angry ...but I really editor -- would like to get that stuff. I am, like many others, I imagine, anxious to get a Apologierr to Mr. del Vecchio. We mis- version of PORTA up on my system. I've handled his entire requeat, and yet he en- managed to dig up most of the references closes an extra $2.001 Our mail processing is now current. We will complete the full six issues of PORTR DICICNSIO#S.

SCR 0 GLOSSARY DOCUHENTATIPN - D.U-BURDEN 1 AFTER READING U.F.KACSDALE~S ARTICLE ON IHE -HELP- conn~m 2 IN FORTH UIHENSIONS NO*? AND SOHE PROPACNDA FHOII FORTH 1NC.r I 3 UROTE a SHORT FR0GI;AR UHICH PRINTED OUT EACH FORTH UORU AS IT 4 IS DEFINED* THE ADDRESS OF THE LENCTH BYTE AND THE ADDRESS OF 5 THE YARH BYTE. AFTER EACH ENTRY* I PRINTED ELLIPSES TO ALLOU 6 A HANUUHITTEN ENTRY OF UHAT EACH COMMAND IS SUPPOSEDLY DOING. 7 THE ADUHESS OF THE PAHH BYTE IS USEFUL SINCE THAT ADDRESS 8 APPEARS IN HIGH LEVEL COLON DEFINITIONS 'OBJECT" CODE. THUSv IF 9 YOU HAVE NOT URITlEN YOUR OUN FORTH SYSTEHr YOU CAN HAND 10 DISASSEHBLE ( UISFORTH RIGHT BE WORE APPROPRIATE ) EMH COHHAND 11 AND SEE UHAT IT IS DOINGe 12 OF COURSE A DISFORTH PROGRAM COULD BE URITTEN AND I HAVE DONE 13 SOP BUT J AH NOT HAPPY WITH ITS .OUTPUT FORM1 YET. I ALSO HAVE 14 UHITTEN A TRACE WHICH PUTS A TRAP IN "NEXT' AND LISTS EACH FORTH 15 COMMAND EXECUTED. VERY USEFUL FOR DEBUGGING. 8s 01/_51/79 SCR t 2

0 GLOSSARY OF FORTH UORDS UITH HEhD AND PARH ADDRESSES ) 1 0 VARIABLE CHD ( TEMPORARY VARIABLE TO HOLD COMMAND ) 2 : TOPOFPACE CR CR c cnD HEAD PARH Icw i 3 : UNDERLINE C r~~.~~o~~~~.~.~..r~~.r..~~~~.~o.***~~..t***3 i 4 : GLOSSARY TOPOFPACE CURRENT @ P CND ! ( GET TOP CMD ADDRESS ) 5 BEGIN 6 CHD @ IF CMD @ C@ DUP 80 AND - ( GET COMMAND LENCTH ) 7 UECIML HEX 4 1 DO ( PRINT COHHAND LENGTH 1 8 cno Q I + ( INDEX FETCHED IS 1-2-3 ) 9 C@ ECHO ( PRINT COHHAND LETTER ) lo LOOP SPACE 11 CHD @ OH SPACE ( PRINT COHHAND HEAD ADDRESS ) 12 CMD @ 6 + .H UNDERLINE CR CR ( PRINT CHD PARH ADDRESS ) 13 CHD @ 4 t @ CHD ! ( PICK UP LINK UITH NEXT CHD ADDRESS J I I 14 ELSE QUIT THEN ECHO EMIT IS MAIN ; is 1/30/79 DUE .a 8. (hex output) GLOSSARY

FORTH INTEREST GROUP PO. Box 1105 ****a San Carlos, Ca. 94070 Dear PIG: Also, have you reviewed Programma Inter- national's PET PORTH yet? hey told me that I have been programming for sixteen a new version (1.1) would be out in Nov./ years, but I only discovered WRTH about two Dec., but I'm waiting before buyi ng... would weeks ago1 It was a clear case of love at like your opinione/recoucndations. first sight, but I've encountered a really st icky problem already. I have seven different programs, each rune on my Apple I1 computer, and each claims the name "PORTR'. Aside from that the only thing they have in nark 1 Inmerman common are the three verbs, ":","I", and Caltech 130-33 "em. Beyond that, everything is different. Pasadena, CA 91125 My question is: Is there such a thing as a 'standard" FORTH, and if so, where do I find out more about it? The only docu- mentat ion I have rounded up so far is one borrowed copy of FORTH DIMENSIONS, and Programma International *e version is not two pitifully incomplete "user's guides" recommended by PIG. It has a non-standard supplied with two of the versions PORTH I've header (no word length indication) and is bought. HELP! pure machine code. The inner interpreter NEXT is missing as are the critical defini- Sincerely, tions #CODE, , and BLOCK. PROTECT traps execution of compiling words outside of colon-def initione. PIG now uses Gary J. Shannon ?COnP for this purpose. 14 115 Hubbard Street Sylmar, CA 91342 Editor -- April, 1979 Mr. Shannon addresses a major prQblenl FORTH uniformity is a major problem. Current standards (FORTH-77 and ?O#PH-78) Dear PIG: exist but cover only areas of mutual user concensus. There are remaining areas where I now have Programraes 6800 PORTH and definition and/or refinement are needed. I probably shouldn't conplain, however it The FIG Installation UANUAL has a lode1 of does have some differences with the OECUS the language offered for public comment FORTH (CALTECH FORTR). I think my major toward uniformity. We also pin-point complaint is with the coding; any con- areas of deviation from FORTA-78 in our ditional branching is almost impossible pub1 icat ions: without a previously assembled list ins to obtain address displacements. ly UIKAbOS/OS/assembler/di sassenbler ) i s interactive, single-pass, and fast. I haven't figured out yet how to do any I have an 8k PET and after reading bt. editing other than backspace and line -Dobb's number 28 I called Programma Con- deletion, other than redo the proaram. sultants to purchase PORTH. Two weeks later Also, I have the Felix OSP and recursive I received it1 programs just cone naturally; same with textual programming - somewhat difficult I have been working with PET mRTH now with PORTH. Can recursive work be done in for a couple of weeks and am still fascina- FORTH? I don*t know a8 I can*t find out ted with PORTH although I have sole problems enough fran any ntnual (the only one with with Programma's implementation. Programma's is intorid') to answer my quest ions. Please sign me up. My "down" outlook nay surprise other Regards, Figgers, however I am (obviously) not a computer scientist but feel that after the Chris Torkildson Dobbes puffery by John James and a couple St. Paul, UN of letters to the editor, the simplicity and all-encompassnent have been vastly overrated. December, 1978 Sincerely, Dear FIG:

The FORTH-65 implementation listing you Neal Chapion sent is great111 I'm beginning to understand Space #27 the power and beauty of this language/ 602 Capper Basin Road system, with the aid of it, a Caltech (Space Prescott, AZ 86301 Radiation Lab) PORTH manual, and James* article in Dr. Dobbs...but there are still Editor-- some items I can't figure out. (One stupid The above letters Illustrate the nepa- question: What is PROTECT, used in screens tive comment we receive about Proqranma 36 and 451) Internationalre IrORTH. Page 45 FORTH INTEREST GROUP .. . . . 00. Box 1105 -**-. San Carlos, Ca. 94070 FORTH INTEREST GROUP Volume 1 P.O. Box 1105 Number 5 Sen Carlos. CA 94070 Price $2.00

Historical Perspective

Publisher's Column

CASE Statement Contest

"To" Solution Continued

Dictionary Headers

FORTH-85 "CASE" Statement

Another Generation of Mistakes?

lnstallation Reports

Meeting Notices

Letters

More From George

New Products

FORTH, Inc. News Mr. Moore and several associates formed Forth, Inc. in 1973 for the purpose of licensing and support of the FORTH Operating System and Pro- Published by Forth Interest Group gramming Language, and to supply application programming to meet volume 1 NO. 5 JanFeb 1980 mstomers unique requirements.

publisher Roy C. Martens The Forth Interest Group is centered in Northern California, although our Editorial Review mrd rnenbership of 950 is world-wide. It was formed in 1978 by FORTH programers Bill Ragsdale to encourage use of the language by the Dave Boulton interchange of ideas through sem'inars Kim Harris and publications. John James George Maverick

FOHIH DIlYENSIONS solicits editorial material, comments and letters. No responsibility is assumed for accuracy PUBLISHER'S COLUMN of material submitted. ALL MATERIAL PUBLISHED BY THE FORTH INTEmST IS IN THE PUBLIC DOMAIN. Information in FORTH DIMENSIONS may be reproduced Forth Interest Group has come of with credit given to the author and the age. FIG now has a publisher for JKlFH Forth Interest Group. DIMENSIW. Roy Martens will handle all facets of putting together and Subscription to EYRIV DIMENSIONS .is getting out future issues of FORTH free with membership in the Forth DIMENSIONS. He comes to FIG with a Interest Group at $5.00 per year slid background dating back to Hughes ($9.00 overseas). For membership, Aircraft Company in the 50's to change of address and/or to submit Singer Business Machines and American material, the address is: Micro Systems in the 70's. He has publication experience gained from Forth Interest Group Hayden Publishing Canpiny (Electronic P.O. Box 1105 Design, Canputer Decisions, etc.), CBS San Carlos, CA 94070 and EW Cccmnunications. Welcame aboard, ROY I S. Figgie

HISTORICAL PERSPECTIVE Thanks. I look forward to working with FIG and hope that we can make FO#IH DIMENSICBE a useful and timely EYRll was created by Mr. Charles H. tool for all members. Please send in Moore in 1969 at the National Radio your letters, cases, suggestions. Your Astronomy Observatory, Charlottesville, input will make FORTH DIMENSIONS VA. It was created out of dissatis- successful. faction with available programming tools, especially for observatory automation. cry C. Martens

Page 46 FO- $$$$ CASE STATEMENT $$$$ C. An "Englishn explanation of how CONTEST these words work D. Glossary entries for each FIG is sponsoring a contest for the word best CASE statement for FDRTH. E. Examples of the use of this Prize...... $100 ($50 from FIG and $50 statement from FORTH, Inc ) . F. A discussion on the statement, Furthermore, entries will be m- including advantages and dis- sidered as experimental proposals for advantages, limitations, appli- possible inclusion in the future FORTH cations, etc. Standard. Contest Purpose...... Cmtest Rules...... The selection of one of several Submit a CASE Statement, as speci- procedures based on some criteria is a f ied below, to useful and comnon amtrol structure. Standard FDm provides two mechanisms FIG CASE CONTEST for this structure: nested IF struc- P.O. Box 1105 tures and execution vectors. It is San Carlos, CA 94070 desirable to have a standard structure to handle a variety of situations. Postmarked on or before March 31, 1980. Hawever these do not appropriately All entries will be judged by satisfy all situations in terms of selected, non-entering members of source mnvenience and execution-time Forth Interest Group. All entries efficiency. A simple situation where will become plblic domain and may be the selection criteria is a single published by FIG. integer index with a limited, con- tinuous range is adequately met by Judging Criteria...... FORTRAN's computer GOT0 or FORTH's execution vectors A. Cmformity to rules B. Generality of statement At the other end of the complexity C. Simplicity of statement scale, if the selection criteria was an D. Self-identifying function index with a non-contiguous range or a E. nFOR!m-like" style series of expressions, the simple statements would require manipulations Entry Requirements ...... at the source level and would appear less clear. Because of FORTH's Your entry should contain descrip hierarchial modularity, the range tions of a collection of EWTH words of oomplex situations can be met with a which allow the selection of one of range of structures. The execution-time several actions based on a selection overhead need not be greater than what criteria. The actions may be single the situation requires. The purpose of words or groups of words. The selec- this contest is t;o produce a "kit" of tion criteria may be simple or com- compiler words which will allow the plicated. A variety of situations optim specification of case control should be accorrmodated. Included in by combining minimum execution-time your entry should be.... werhead with a uniform source language.

A. An overview of the statement B. Source definitions in fig- FORTH words for the needed compiler and support words "TO" SOLUTION CONTINUED...... "EASTER" 0 ( Dates of Easter IY4B-790CT29 ) 1 : (EASTER) ( year - day day 1 As promised in the last issue, here 2 (calculate date relative to March 1) is the example for the calculation of 3 DUPDUPTOYEARl9MODl+toG the dates of Easter from Paul Bart- 4 100 / 1+ DUP DUP TO C holdi, Observatoire De Geneve, Switzer- 5 3 *412TOx land. 6 8*5+255TOZ 7 YEAR5*4XlOTOD SCR 19 8 G11*20+Z+X30MOD 0 (Dates of Easter, Clavius Algorithm 9 DUP O< IF 30 + 'MEN 1 (This algorithm and variable names are) 10 DUPDUPTOE 2 (from "Fundamental Algorithms" by 11 25 = G 1 > AND SWAP 24 = OR 3 (D. Knuth. The method was originated 12 IF E 1+ TO E THEN 4 (by the sixteenth century astronomer 1 13 44E-WIPTDN 5 (Clavius. 1 14 21 < IF N 30 + N THEN 6 15 NDUP7+SWAPD+ 7 16 7MU)-DUPDWTDN;--> 8OVARIABLE%VAR (ifone,store ) 9 : TD 1 %VAR ! ; ( set to store ) 10 : FROM 0 %VAR ! ; ( set to fetch ) 13 : (( (preserve %VAR flag ) 0 ( Dates of Easter lXB-79OCT29 ) 14 R) %VAR @ >R >R FROM ; 1 : EASTER ( year --print one Easter ) 15 : )) ( restore %VAR flag ) 2 (EASTER) 31 > 14 R) R> %VAR 1 >R ; 3 IF 31 - 5 .R . APRIL " 15 4 ELSE 5 .R ." MARCH " 16 - 5 YEAR 5 .R ; 6 SCR #lo 7 : EASTERS (Begin year, end year - ) 8 ( print Easter for a range of years. ) 0 ( Simplified TD DAB-790CT29 ) 9 PXE 32 SPACES ." INTES OF EASTERw CR 1 10 1+ 0 s4w rn 2 : VARUBLE ( defined to observe TD ) 11 DO I EASreR 1+ 3 (BUILDS 0 , DOES> %VAR @ 12 WP 4 MOD O= IF CR THEN 4 IF (set, sostore) 1 FROM 13 WP 240 Ma> @ IF PAGE THEN 5 ELSE ( clear, so fetch ) @ THEN ; 14 KlOP CR PACE mP ; 6 15 7 16 8 VARIABLE C VARIABIE D VARIABU E 9 VARIABIE G VARIABLE N VARIABLE K 10 VARIABLE X VARIABLE z VARIABLE YEAR 11 12 13 -> 14 Note that this demonstration does not 15 include the newer .YIO , AT etc. 16

EXAMPLE

10 April 1955 1 April 1956 21 April 1957 6 April 1958 29 March 1959 17 April 1960 2 April 1961 22 April 1962 14 April 1963 29 March 1964 18 April 1965 10 April 1966 26 March 1967 14 April 1968 6 April 1969 29 March 1970 Page 48 Farrnr D-1- 1/5 A MODEST PROPOSAL FOR auld put the characters in the forward direction, but the dictionary search DICTIONARY HEADERS would take longer. The suggested structure increases the maximum allowable word length to 63 (or Robert L. Smith possibly 64). Palo Alto, CA It would be possible to use the The new fig-FORTH mdel has improved leading bit of the first character for the utility of FORTH by allowing the mdqe bit, but it would somewhat dictionary names to be of any length, complicate the dictionary search up to the current maxim of 31 charac- procedure. One character names would ters. Most previous implementations have to be a special case with no stored only the first three daracters terminal bit specified, since that of the name, along with a count field. location would be designated for Confusion could easily arise, say snudging purposes. between the words "ILXIK" and "IDOP". The maximum word length stored in This proposal eliminates the need the fig-FORTH model can be changed for a nuher of special words in the dynamically by changing the value of f ig-FORTH model (TRAVERSE, PFA, WA, WIDTH. If one wishes to return to the CFA). The only obvious disadvantage is former restriction of 3 character that the routine for printing the names, the new model will still be an dictionary names would need to take improvement because 1 and 2 character characters in the opposite direction names will require less dictionary from other text. The advantages space. appear to outweigh the disadvantage. One advantage of the old dictionary format has been lost, namely a fixed Terminal bit + last relationship between the link field and 111 1 I I I I I I .character of name the CFA (Control Field Address) or the parameter field. The following proposal will restore the fixed relationship, while at the same time keep the new fig-FORTH advantages. In addition, the maximum allowable word . 1 Increasing Addresses size is increased to 63. . 4 A model of the proposed dictionary 101 1 1 I 1 1 I I First character of name entry is shown in Figure 1. The name of the word is stored in reverse order -1 Precedence + Smudge + to simplify the dictionary searching. count field. Link From the link field one can step field. Points to ant backwards to obtain the name, or field of previous forwards to obtain the definition dictionary word. of the word. The leading bit of CFA. minter to the machine representation of each executable mde. character of the name is set to zero, except for the terminal character which Im1Beginning of Parameter has the leading bit set to one. Thus Field. the effective end of the name can m readily be determined. The name field is reversed to sinplify the dictionary search procedure, but it is an inple- Figure 1. A proposed Dictionary Structure. mentation decision. Obviously one tS

RXU'H DIMIUSIOIS I/5 Page 49 FORTH-85 "CASE" STATEMENT The screen showing DIW3ASE through END-CASES must be loaded into your Richard 8. Main system before they can be used. This Zendex Corp. screen will actually extend your FORTH Dublin, CA compiler beyong having IF...ELSE... THEN, BEGIN...IF...ELSE. ..WHILE, NEPTUNE UES has recently extended DO... LOOP, AND BEGIN...END. its FOKITi-85 with a "CASE" statement. The CASE statement allows an n-way Line 1 extends the assembler to branch based on a andition. Its use include JNC for use by the following is very similar to the PASCAL CASE code statements. statement. the IF..(this)...ELSE... (that)... THEN structure is a twwway Line 2 contains code to set up the branch while the FORTH-85 DO-CASE run-time variable "VCASE" for use by ENPCASES allows 65,000 different cases "DO-CASE" and "CASE". randomly arranged. (n+l CASE may precede n CASE.) Each case can Lines 3-9 code statements define the test on a 16-bit quantity. The CASE run-time behavior of "W.CASE, CASE and structure must begin with "DO-CASE" END-CASE". While lines 11-15 define then "CASE...END-CASEN and finish with the compile-time behavior of the "END-CASES" . compiling words : "DO-CASE, CASE, END-CASE, and ENDUSE". The test "CASE" structure screen gives an example of using CASE within During compile time "Do-CASE" FORTH-85. An unknown variable is assenbles the code "DO-CASE", places passed to "MONITOR" for an n-way branch "HERE" and jJ on the compile-time based m a match between the variable stack, and assembles (temporarily) a and one of the cases. "DO-CASE" places 16-bit B. "CASE" then compiles the variable passed on the stack into a code "CASE" swaps the compile-time location in memory. "41 CASE" will stack places "HERE" on the stack to fetch the variable and ampare it to locate "CASE" for "END-CASE" and 41. If it is 41, code between "41 temporarily assembles an 8-bi t zero. CASE" and "END-CASE" will be exe- "END-CASE" now has passed to it cuted (in this instance "ASSIGN" will the location of "CASE" and "DO-CASE". be printed) and then a direct junp to "END-CASE" will pass "DO-CASE" loca- "EM)-CASESn. If the variable is not tion on to "END-CASES". 'END-CASE" 41, then "41 CASE" will cause a junp to assembles code "END-CASE", places the next case, and so on. "HERE" m the cwnpile-time stack for nEND-CSES", wqmtes 'END-CASEn minus The "n" for "CASE" need not be "CASE" and loads the result (assenbles in-line ale, mr absolute, nor known difference) at "CASE" +2. "ENDCASE" at cwnpile time. During run-time 'n" further assembles a 16-bit zero may be camplted, fetched or otherwise temporarily for "END-CASES " . "END- placed on the stack just prior to CASES" has passed to it, on the executing case. The possibilities that oompiletirne stack, all the locations exist for this, aombined with 16-bit of "END-CSEn and the beginning "DO- CASE testing and 65, 000 possible CASE". Since the nufilber of cases is cases AND (!) no restrictions on the variable "DO-CASE" had put a zero on amount or type of code between CASE.. . the compile-time stack to mark the ENDaSE, are imnense. Saw uses that bottom location the "BEGIN HERE !XW! - occur to me immediately are monitor WP (ii = END" takes every "ENDUSES" program executives, machine code location and assembles "END-CASES" disassemblers, text interpreters, and location there for direct forward junps disk 1/0 drivers. fran "EM)-CASE" to "mES".

Page 50 iQRTH DIMeJsICNS I/5 The code described here may be used The effect of all the compiling for your personal use and experimenta- machination was to place 16-bit and tion only. - Commercial users should 8-bit code for use by the address write to the author. interpreter during execution. Review- ing the intrepreter during execution . Reviewing the interpreter : compiled EXAMPLE mlon definitions are si~lystrings of addresses of routines to execute.

Therefore, the address string compiled 0 I DOCIA CISFI EM)-ChSE. FM)-CAX5 > 1 #(LEMLER D€FINITIDNS WX . JNC O? LNO : FCIWIH 0F.F IN111- for: "DO-CASE...CASE ...END-CASE... ZDVmIM%EVUSE END-CASES" 3 CUD€ OO-C*SE I4 WP . VWX SKD I INX 1 INX NEXT MP is: 4 CODE USE U PU' ' VWx LKD L AmY 1. CW' 5 0-NOTIF IUWU 11*m nIi+mu NKXlJNc 6 1 IWR WEXI JrC TWN H A HOU U CW Fig 1 7 0-LDTIF IUWU II*CY)O AIl.Hov WCXTJNC e I m NEXT IYI' TICN I INX MXI .Jnr VCWEnILOCU LLW IINX ILMX AHW 10 HR)BW IPOP IEXTJII AB.... CD....EZ'....(G).... 11 jDO-UBt: \#)USE HEM 0 0. i IIYFDIATF: 12 . UBC: \ U(E SW l€lK 0 C. I IMDlnTE where : 138- \DIKASE -8.- tKM 14 - 9YP Cl I 18WEBIATE IS I E)O-ClbES BEGIN )(ERE SYW -OW 0 - EWD : IMDIATF A = 16-bit address of de"DO-CASEn B = 16-bit address (G) C = 16-bit address of code "CASEn D = 8-bit value of distance F+l E = 16-bit address of code "ENDCASE" F = 16-bit address of (G) and (G) 10 is the location to continue execu- 11 I KEIBOlllD =N KEY 7F *N) OW WIWITOR 20 - END i tion after case. I = interpreter pointer

HOW IT KIRKS (during execution)

The following will refer to A through (G) in Figure 1. Editors Note: This article has been presented as a Before executing (address inter- good exanple of the ease of addition of preting) : A (DO+ZSE) the case nm&r to execute 7s placed on the run-time amtrol structures to match application stack. Code DO-CASE is executed when A needs. is it will encountered and pop the FOKM-85 a UES software product stack and store it at the memory is derived from microforth (TM, FORTH, location "VCASE". At this point there jump Inc. ) . Both these versions contain is no to mke based on condition definition names at variance with so I is incremented past 5 B exists fig-EDlQ!H and EO#1H-78. We present a to %vide a backward stub 1ocaTion for the axpiling of the structure. Code reference table: between B and is executed, and by the time-c is encountered the case andition to test for is on the stack. C is the code "CASEw which will pap the I n - [ stack and do a 16-bit compare to I I I "VCASE". If there is no match code, CCMPIU Nane "CASE" increments I (interp. pointer) I IP None by D (8-bit ) . Control would then pass en, UNTIL or END END to F+1. If there is a match, I is ZHBJ ENDIF or THEN THEN incremented by one and points to Dcl. Code till E is executed. E will cause code "ENDCASE" to execute and it will load I with F. Now I points to (G). ANOTHER GENERATION stack is "cached" on chip, the nunb of memory cycles per instruction wil OF MISTAKES? drop amsiderably. And if this lattc idea is properly extended to th Roger L. Gulbranson instruction stream to create a University of Illinois "instruction stack, ' much like that c the CDC Cyber computer line or tt Much has been said abut hw ea& Cray-1, the number of memory cycle generation of computers the large can be reduced even further. Thj mainframes, the minis, and now the reduction of memory cycles shoul micros - has repeated the mistakes noticeably increase the speed of a of the past generation. There have hypothetical . even been comments on upward-com- patibility mistakes in going from one Considering the impetus given t generation of microprocessor to its virtual stack machines by the Pascz succeeding generation(s).[l] I would P-code groups [ 31 and the Concurrer like to take this further by mmnent- Pascal originators, [4) one wonders wf ing on the latest generation of these ideas have not been efficient] , the 16-bit CPUs. implemnted in silicon. Must we waj for another generation? I was talking to an EE who tried to convince me that the yet-to-be released [ll L. Armstrong, "16-bit Wav microprocessors are "so much bettern Gathering Speed," Electronic2 than the existing ones because they Vol. 51, No. 4, Feb. 16, 1976 have included all of the addressing ~p.84-85. modes in each instruction. Anrong other things, I am told, this reduces program [2] A good overview of stac size and makes the micro run faster, machines can be found in th since its speed is directly related to May 1977 issue of Computer the number of fetches it must do per instruction and the number of instruc- (31 References to these groups ca tions used. As a concept, in toto, I be found in Pascal News, can mly reply, BUNK! publication of the Pascal User' Group. If one were to design a micro- processor stack computer, [2] it [4] Per Brinch Hansen, The Archi would be possible to incorporate an tecture of Concurrent Programr instruction set that has only one Prentice-Ifall Inc., Englewoc multi-addressing rode instruction, a Cliffs, N.J., 1977. "load effective address" instruction. Since this is perhaps a bit austere, it Reprinted frum Canputer, April, 197! may be realistic to add appropriate Copyright 1979, IEEE load to stack, store from stack, conditional and unmnditional branch, and subroutine call instructions to the group of "addressed" instructions. The remaining instruction set need not contain more than 128 (if even that many) zero-address instructions. This instruction set can be arranged so that all zero-address instructions are 8 bits long. This means that most of the time an instruction word will aontain two instructions, decreasing the number of memory cycles per instruction. If, in addition, the

Page 52 FORm DxMEtSICNS I, INSTALLATION REPORTS 20 installations shoulc3 be up by ncm. Jdvl has gone to great care to create a The distribution of fig-FORTH began nportablen version for the various CW on May 11, 1979 at the Fourth West variations. fig-FORTH is kncm to be Coast Computer Faire. The first running on Heathkit and DEC LSI-11's up installation to be brought up by a user through the DPD-11/60. Installations occurred while the Faire was still are knwn in California, Arizona, New running! Bob Steinhaus of Lawrence York, and the Netherlands. Livemre Lab got the 8080 listing on Saturday at the Faire. His wife read the hex code to him and he typed it in. By Sunday morning, he was running ! The next to run was Dwight Elvey of Santa Cruz. He organized five MEETING NOTICES proqramners on five Intel developnental systems. Each edited in 1/5 of the source code. They then merged the files, assembled at the listing origin and caught final editing errors by a byte-by-byte comparison. They then EQMAL, a meeting to gather input updated the 1-0 and re-origined. They for the future implementation of were running in four evenings work (of FORTH, will be held January 8, 9, five people ) . and 10, 1980 at Imperial College, London, England. Attending from The next to run was Dave Carlton of FIG will be: Kim Harris, Bill Ceres, CA. Dave brought up f ig-FOIUV Ragsdale, Jon Spencer, Larry on his TEIS-80. He did fill his edit Forsley and probably 2 or 3 mre. buffer and then crash, which cost Look for a report in the next re-typing 25 pages ! Dave demstrated issue of FOFtTfi DIMENSICNS. his system to FIG on June 25. He had just interfaced to his floppy-disc and NcmvEm CALIFORNIA had the sample editor running. FIG mthly meetings will continue John Forsberg of Maracaibo, Vene- to be held the fourth Saturday of zuela should be up and running with his each month at the Special Events Prolog 8080 with 32K RAM and casette, FZmm of the Liberty Hoyse depart- floppy and disk capability that he put ment store in Hayward. s Informal together himself. lunch at 12 noon at .the store restaurant, followed by the 1 pm Frank D. Wgherty of Belvidere, IL meeting. Directions: Southland has a IMD05 Ver 2.05 with 15 languages Shopping Center, Highway 17 at running. He says his AXion EX-801 Winton Avenue, Hayward, CA, Third printer works like a charm. floor, rear of the Liberty House. Dates : 1/26/80, 2/23/80, 3/22/80, Many installations of the PDP-11 etc. All welcome. are operating. There is a short cut in this case. John James (the inple- Send us notices of any meetings that mentor) is also acting as a dis- you know about. tributor. He provides a source diskette that will assemble and run under KC-11 and RSX-11.M. Between 10 and

RXll DIMENSIONS I/S Page 53 LETTERS U/ UNSIGNED DIVIDE 30,600 cycles 203 bytes CASSADY 2,495 cycles 76 bytes VILLAJOCK Despite your warnings regarding Programma International's imple- I was well into the design and mentation of FORTH for the PET, I coding of MSL when I stumbled upon bought it just to have something FIG and its efforts. Your documents to work with and get a feel for ~~ (particularly the installation manual (or at least a FORTH-like system), and and James' work on the 11) have been I have been having a ball with it most useful and have saved me consider- (despite the limitations of this able time in putting the finishing version), af ter adding 16K of RAM - I touches on MSL. I'd like to return the thought the thing would run in 8K favor , so I hope that my 8080 but found out differently. The first routines will be useful to you. MCABULARY written for the PET was a DEFORTH routine to disassemble the Many thanks again to FIG for your dictionary . After DEFORTHing the excellent efforts. latter dictionary entries and saving them on tape, I was able to truncate R. D. Villwock the dictionary to wipe out 10 unneeded Pasadena , CA words. This saved about 3 pages of -ry. Edward B. Beach Arlington, VA Editor.. . MORE FROM GEORGE People keep trying!

Follwing are some observations on PASCAL and FORT•÷3 inplementatim details made upon reading the recent article in Dr. Dobb's Journal. You will find enclosed a set of I source listings for the 8080 nucleus of With the erergence of a law cost yet MSL. (Editor's note: Inmrporated in elabarate mmpiler for PASCAL at USCD f ig-FORTH 8080 Assembly Listing, amsideration might be given to PASCAL Version 1.1 see New Products.) as an alternative to FORTH. PASCAL is implemented with a self-compiling, All my code routines are re-entrant. virtual-machine language system Not mly that, but without exception, offering transportability similar to they use no more bytes or time than FORTH, and is supplied by USCD with Cassady's routines. In fact, in many full source &. From the standpoint cases, you will note that my routines of sophisticated extensions to a system use fewer bytes and run faster. In sub as high-speed arithmetic pms- some cases, such as multiply and sing hardware, mverting from floppy- divide, the improvement is enormous! disks to hard disks, adding memory viz beyond directly addressable space, however, PASCAL may be much more U* UNSIGNED MULTIPLY difficult to work with. The system involved very large programs including 4950 cycles 81 bytes CASSAm a cumpilcr, an interpreter, a run time 994 cycles 47 bytes VILIWOCK executive, and a debugger--all of Initially the vector points to code which mst be o~lsistentlymodified in which reserves space for the variable making extensions. The USCD authors on the stack, and is th'en switched may well turn out to be the only users to point the code retrieving the able to efficiently make expansions data. Thus storage is automatically themselves. allocated, not upon entry to a pro- cedure, but precisely when a variable An inportant advantage seems present becomes used. in PASCAL, however, which is dynamic storage allocation-the nested globals The principle of the above, creating and locals environment, and FOm does new defining-rds, wld have other not seem to offer this. Several uses as well; for example, data for methods for accomplishing this in EVRIW a variable could reside on disk and might therefore be noted. First, the code-address of its dictionary existing FORTH system words can entry muld pint to a routine which be used to create a class of variables retrieves it from disk. What is needed and mstants whose code-address points is an easy way to compile these to a nw defining-word which returns, structures. For instance, if we want not the address or data in the vari- to create a variable X, to reside on able or constant itself, but in a disk, we need another variable, Y, dynamically reserved area on the to hold the data, and an operator stack. The parameter field of the RETRIEVE; X is then compiled as variable holds an address off set the definition; Y RETRIEVE so every generated at mqile time, relative to reference to X returns the value from an environment pointer implemented as disk. Having defined the "Y Retrieve" another variable whose parameter word we need an easy way to tell the field is filled with the stack pointer mnpiler that X should be compiled as value upon entry to a procedure, before that kind of definition, without having shifting the SP to reserve the data to write it all out. area. The code addressed by the variable conbines the offset with PASCAL implementation my be very the environment pointer and returns well optimized, but FOm code accom- either this address, or the data at plishes even mre in the way of code that address on the stack. compaction because of its unique representation of operands as though The of retrieving dynam- they were operators in object code. ically stored data would be slowest This means that no separate operator when implemented with regular FORTH for "load stack" to push an operand language, so a second method is to is needed in object code, saving provide mchine language for the basic space. This is a kind of software mechanisms involved just as FOKl'H does inplementation of "tagged memoryn on for its standard data handling. large scale machines. FORTH still Assumed in both cases is a provision requires 16 bits for each object code for conpiling words (e.g. SVARIABLE- entry, but further compaction implies define a "stackw variable) which what must be a time mnsuming unpacking creates the related dictionary entries operation every time a virtualmachine with the same ease as the regular instruction is executed. The same VARIABLE and CONSTANT words do. compaction in FORTH applies to pro- cedure calls as well as to data; no An interesting variant would be separate wcall" op code is needed as pointing the code-address of a vari- the procedure referencing aperand is able at a modifiable jump-vector. the call itself. Since each procedure

FORTH DIMENSIONS I/5 Page 55 has within itself whatever housekeeping again, no assignment operators at all functions are involved with entry and wld appear in object code, either. exit, elaborate housekeeping need In order for the compiler to work this be performed only when necessary; way it would have to be expanded beyond e.g. locals can have fixed absolute the standard FORTH by adding the addresses or be dynamically allocated capability of distinguishing different as the case warrants. Have the hard- types of words and using different wired stack-machine designers missed procedures to compile variables something here? and non-variables. This might be acmmplished by adding to the axle for PASCAL is also capable of making each type of word, e.g. variables, a available at run time the pwer of the pointer to a compiler routine to be onpiler for sophisticated interfacing used when compiling words of each of users to applications packages, by type. When encountering a word in the running an interpreter for PASCAL and input stream, it would be looked up in calling precompiled object code pro- the dictionary, the code address cedures. The interpreter seems large, extracted, and then the pointer to the however, and the whole procedure oqiler code located within the code; currbersome. A high quality APL inter- ampilation would then continue where preter will . soon be available from pointed. The ampile code for vari- MICROSOFT for this kind of appilcation, ables wmld check the state variable but APL has myproblems running from and enter the appropriate address its special keyboard to the difficulty from the word being compiled. Code of modifying it. FORTH thus offers for variables would have to make unique advantages in this area. allowance for the varying distane of the parameter field from the code address. George B. Lyons Jersey City, EU This method might be a technique for implementing compilers of all sorts derived from the FORTH compiler. In the case of ARRAYS, one might consider having several code addresses in each array in the dictionary, with "The 'm' Solutionn in issue 14 associated operators in the source code improves the handling of variables which do not get put into the object by increasing the arrrwnt of interpre- code, but merely select which of the tation done at run-time in FORTH (a code addresses will be compiled for conditional branch on the value of each array reference in source. the store/retrieve state variable). Perhaps this mld also be accarplished Of course, if you expand the instead at compile time. Let each corr(piler, it might get too big to fit variable oontain two code addresses, in menory with all the application code one for rqtrieval, one for storing, and the way F'oKTH nomlly does. let the conpiler select which to put into the object code generated on the basis of the state variable. "TOn as such would then not appear in the object code at all, saving spa-, but variables would become longer. But again, no assignment operators at all

Page 56 Ewrnr DlHmSIW 1/5 FORIM FOR THE TRS-80 MMSFORTH offers TRS-80 users stack-oriented logic and structured REVISED f ig-FORTH LISTING programming, mach he-code speed and compactness, virtual memory, major f ig-FORTH 8080 Assembly Listing has advantages of interpreter, compiler been revised to Version 1.1. If you and assenbler (all are co-resident), have an old version (1.0) , send in the and your own commands in its exten- original cover and $4.00 for the new sible dictionary. PBlSFOKI'H includes version (1.1). Otherwise available for assembler/ editor, all necessary $10.00 (overseas $13.00. Forth routines for disk and/or tape, and Interest Group, P.O. Box 1105, San additional routines for BASIC-like Carlos, CA 94070. handling of strings, arrays, etc. MMS supplies information and examples to learn this language or to start your awn FOlUl program for your specialized application.

In addition to the fig-FORTH system, SPECIAL - At no extra cost, THE GAME the diskette includes an editor, Forth OF LIFE in MMSFOFKW just 2 seconds per assembler, string package and an generation, an excellent denonstration 80-page User's -Guide with discussion of the techniques and speed of EDFU'H. and examples of Forth programming mSFOIFH, without manual: techniques. L.2 16K tape $35.00 Like all the fig-FORTH systems, Disk, w/Disk I/O $45.00 this one has full length names to 31 "The microi;DR!lY PRIMER", characters, the "security package" manual for M4SFOITTH $15.00 of compile-time error checks, and alignment with the 1978 Forth Inter- Miller, Microaquter Services, 61 Lake national Standard. Shore Road. Natick, MA 01760 This system runs under the Rl'-11 or RSX-11M -rating systems, and can be modified for other environments or for stand-alone It can interface to database packages m other so•’ware , allowing interactive access and program SBC-FORTH is a complete firmware develapnrent with systems not otherwise operating system designed to plug available interactively. The fig-F0KLI-l directly into the W3M sockets of the model is distributed in Macro-11 SBC-80 series of single board computers source, for easy modifiability by offered by Intel & National. Operating programmers without a Forth back- entirely within the resources of one ground; the editor, assembler, and SBC Card SBC-FDWI?I: features resident string package are in Forth source. compiling and assembling of user entered tasks. The addition of SBC The oomplete system pricle is $130, Disk and RAM Cards to the system allows including diskette and all documenta- SBC-EDHIH's resident disk I/O and Text tion; the User's Guide separately is Editor to edit, load, and run source $20. (Ca. resident- 6% tax.) John programs from disk. SBC-FORTH is S. James, P.O. Box 348, Berkeley, CA interactive with the user's CRT and 94701. produces tight object code capable of

PoRTH D-IONS I/5 Page 57 execution speeds approaching assenbler FORTH, Inc. NEWS code. SBC-EWTH is presently available on four 2716 EPROMS for the SBC-80/20 and two 2732 EPROMS for the SBC-80/30 CPUs. Options include Single or Double A new on-line monitoring and Density SK Disk 1/0 Drivers anad CRT record-keeping system developed by Console Baud Rates. Priced from $750 EV#IH, Inc., using a PDP 11/60 mini- depending on media. Zendex Corpora- computer, is being used by the Depart- tion, 6398 Dougherty Road, Dublin, CA ment of Pulmonary Medicine of Cedars- 94566. Sinai Medical Center, Los Aqeles. The FOEFH system oollects data fran five on-line sources, maintains a data base including this information and perform calculations for and formats a wide variety of reports. Data is collected from patient admittance SrOIC-I1 is an enhanced version of questionnaires and intensive care S'IDIC, a FORTH dialect which originated patient records through terminals; from at MIT's Biomedical Engineering Center. the automated blood gas laboratory; the STOIC offers significant advantages pulmonary function test equipment; over other microprocessor FWUV inple- and the exercise laboratory, all mentations, notably a comprehensive through direct links with the PDP disk file system and text editor in 11/60. The speed of FORTH allows the place of the "screen" ap proach used Cedars-Sinai pubnary specialists to elsewhere. This encourages good examine all data on a particular program docu mentation by allowing patient, while the patient is still in arbitrarily long lines and pages, the laboratory and connected to the thus making it easier to include equipmnt. adequate comments and indenta tion. Other features include syntax checking Current Openings and a separate stack for loop control, which together yield a system that Project Manager - applications and recovers from mst errors instead of special systems crashing. STOIC also provides for character-string literals and offers Product Manager - processors and a very extensive set of standard words, drivers including 16 and 32 bit arithmetic. Programoer/Engineer - hardware and The standard STOIC-I1 package software projects includes the kernel and basic words, assembler, file system, editor, double- Technical Writer - software dcm- precision and floating-point arith- mentat ion metic, target compiler and associated library of primities, and utility FOF?TH, Inc. programs for paginated file listing and 815D Manhattan Avenue alpabetized listing of vocabulary Manhattan Beach, CA 90266 branches. The version currently distributed runs on 8080, 8085, and 2-80 based mnputers with soft-sectored floppy disks, and is priced at $4000 with conplete source code or $2000 for object code only. Avocet Systems, 804 South State Street, Dover, Delaware 19901.

Page 58 Farmr DIMENSIrn I/5 FORTH OlNlENSlOflS

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

Historical Perspective

Publisher's Column

FORTH, The Last Ten Years and The Next Two Weeks by Charles H. Moore, Creator of FORTH and Chairman of the Board of FORTH, Inc.

Information

Meeting Notices

FIG Doings published by Forth Interest Group Mr. Moore and sever ssociates formed FORTH, Inc. in 1973 for the Volume 1 No. 6 March/~pril 1980 purpose of licensing and support of the FORTH Operating System and Pro- pub1 isher Roy C. Martens gramming Language, and to supply application programming to meet Editorial Review Board customers unique requirements.

Bill Ragsdale The Forth Interest &oup is centered Dave Boulton in Wthern California, although our Kim Har-r is membership of 950 is world-wide. It John James was formed in 1978 by FOKI'H programers George Maverick to encolarage use of the language by tk interchange of ideas through seminars FOm DIMENSIONS solicits editorial and pub1 ica tions . material, comments and letters. No responsibility is assumed for accuracy of material sutmitted. ALC MATERIAL PUBLISHED BY !LIE FORTH INlEREST GWP IS IN THE PUBLIC DOMAIN. Information in EDRTH DIMENSIONS may be reproduced PUBLISHER'S COLUMN with credit given to the author and the Forth Interest Qoup.

Subscription to EURlTI DIMENSIOtS is This is a special issue of FORTH free with membership in the Forth DIMEIGIONS. It is the regular issue Interest Group at $12.00 per year but it is also very special. It ($15.00 overseas). For membership, includes the canplebe text of Charles change of address and/or to submit Moore's speech at FORTH Convention, material, the address is: October 1979, in San Francisco. The founder of FORTH has given us a Farth Interest Woup historical and futuristic view of P.O. Box 1105 mm. Thank you, mu&! Sm CX~OS, CA 94070 This issue completes Volume 1 of FORTH DIMENSIONS and what a way to finish. The largest issue to date and the complete Charles Moore article . Look for Volume 2, Number 1 soon. I HISTORICAL PERSPECTIVE

Fby Maatens FOR!El was created by W. Charles H. Moore in 1969 at the National Radio Astronomy Observatory, Char lottesville, VA. It was created out of dissatis- faction with available programming tools, especially for observatory autunation.

Page 59 I;ORTH DIMESIONS I/6 FORTH, The Last Ten Yearn and The Next Two Weeks ...

Charles H. Moore Chairman of the Board EDR!l'H, Inc.

WELCOME about FOKTH the company you can talk about other things. This is a reason- able organization for what is really a %ank you. You honor me just by txoadly based attack upon the problems being here and being so involved of society. in something that I never really expected would be this interesting to a When I was very young I don't group of people. I think way back in think I would have liked myself very the Dark Ages I had in mind maybe some much. I recollect being rather day addressing the Rotarians about arrogant - that is a little bit too FOFVH. This is a rather more select strong -- I wanted to do things my way, 5wm' I was not convinced that I should not be permitted to, and I think I was a It turns out that FIG'S estimate bit hard to get along with. That's all of this being the tenth birthday party changed now. But in particular I was for FORTH is remarkably accurate. By insecure. I was promoting certain way of explanation, this is not ideas which everyone told me were wrong intended to be a history of FOfZTH. For and that I thought were right. But if one reason, I do not have a very good I were right, then all those other memory for such events and I am not people had to be wrong and there were a going to be particularly accurate nor lot more of them than me. It took a particularly complete -- I am just lot of arrogance to prsist in the face going to give you my impression of of rather massive disinterest. what's happened for ten years. I am not up with what's happening in You may have noticed that FDFCtW is Europe or even in San Francisco and I a polarizing concept. It is just like apologize for that, but there never religion or politics, there are people seems to be a need to delve into the who love it and people who hate it and history of FORTH. There is a history if you want to start an argument, just but first I want to talk a little bit SaY - "Boy, EOlTH is really a great about what FORTH is. This has been a language". subject of sane speculation. I think there were some of you around ten years ago who may be aware of tk problems that a programmer would Is FORTH an operating system? Is encounter. They are exactly the same it a language? Is it a state of mind? problems that a pxgrammer encounters I propose to trace five threads of today! There has been no progress in history through ten years. I am going the software industry for the last to do it in such an order that if we twenty years. lhis was apparent ten cut off the end nobody will care. years ago and it was unsettling. It did not seem that the last thought The five aspects of FORTH are had been "thunk" when FORTRAN was philosophy , language, implernenta tions, invented and yet nobody seemed to computers, and organizations, (meaning question that. It was the unspoken groups like FIG). If you talk about assumption that things are the way FORTH, the language, you can talk about they are and they cannot become some of these things and if you talk substantially different. Speech at FOR'I'H Convention, October 1979, San Francisco. CA.

FORTH DIMENSIONS I/6 Page 60 &fore I left -- my last week -- I wrote a book. It was entitled Program- Let me about philosophy now. I ming a Problem Oriented Language and it was a free-lance programmer once upon a expressed my philosaphy at the tine. time (1968). I went to work for a It is very amusincj readiq. It also carpt manufacturer and learned COBOL describes what was then FORTt1. It partly out of financial necessity and makes amusing reading because, unknown partly with the thought "here's a to anyone, I was expressing opinions, language I don't know - let's pick up attitudes, not designing a programming one more". These people acquire a language. graphics system. It was an IBM 1130 with a 2250 graphic display unit, a FORT73 first appeared on that 1130 very nice state-of-the-art outfit, and it was called FOR1[H. It had all expensive! Speculation was that this the essential characteristics of FORTH would help us design carpets or maybe and I will return to that point later. furniture. Nobody was really sure but. they wanted to try. The 1130 was a F-0-R-T-H is a five letter very important computer. It had the abbreviation of "fourth," standing for first cartridge disk. It also had a fourth-generation mputers. This was card reader, a card punch, and a the day, you may remember, of third- console typew i ter . The backup for the generation canputers and I was going to disk was the card punch! I don't leapfrog all of that. But FORTH ran think I ever backed-up the disk but I on the 1130 which only permitted do remember reloading the operating f ive-char acter identifiers. system numerous times. The first thing that was modern The 1130 went away one day because FORTH was the Honeywell 316 pragram at without color it really wasn't mrth NRAO. I was hired by George Conant anything for manufacturing carpets. to program a radio telescope data They also had a Burroughs 5500 which acquisition program. I was given a was running ALGOL at a time when AZX33L computer (to the envy of other people was not popular. A very nice machine. who felt they deserved it). I was They were programing in COBOL, which turned loose to do whatever I could was the first good COBOL. These were with it, provided I came up with a progressive people and want to credit poduct. I just went off and nobody them -- Mohasco Industries. I put really wanted or appreciated what they FORTH on the 5500 -- this is fairly ended up with . unusual. It was cross-compiled to the 5500 from the 1130, since there is no We developed a number of systems at assembler on the 5500. There is a NRAO and encountered the issue of dialect of ALGOL called ESBOL that patenting software. Programs cannot be Burroughs used to compile operating patented; ought not to be patented; systems (it was not available to the would be very expensive to patent. users). But I learned about push-down NRAO has an agreement with Research stacks from this machine and had a Corporation, a canpany that tries to lot of fun. It was third-shift work pull from universities some technology because the 5500 was busy. It was spinoffs that can be used to better replaced by a Univac 1108, so I imple- mankind. (They patent things for mented FORTH on the 1108. It con- people who don't how (or care) how.) trolled the interactions of a bunch of FORTH seemed like something that COBOL modules which did all the real perhaps should be patented, so we spent work. The 1108 was cancelled due to a year writing poposals, investigating anticipated financial reverses; the and getting lawy@rs' opinions. The programming staff quit; and I went to conclusion was that maybe it could be work for the National Radio Astroraamy patented, but it would take Supreme Observatory (NR40). Court action to do it. NR40 wasn't

Page 61 FORTH DMEN!!IONS I/6 interested. As inventor, I had fall- is not in keeping with the attitude back rights but I didn't want to spend that we preach for other people to $10,000 either, so FORTH was not follow. patented. This probably was a good thing. I think that if any software As time wnt on it became apparent package would qualify for patenting that FORTH is an amplifier. A god FORTH would. It has no really innova- pccgramner can do a fantastic job with tive ideas in it, yet the package would FORTH; a bad programmer can do a not otherwise have been put together. disastrous one. I have seen very bad If you apply this reasoning to hard- FORTH and have been unable to explain ware, hardware is patentable. It is to the autbr why it was bad. There one of my disi~usionmentsthat the are character istics of good FORTH: establishmenl ref uses to provide any very short definitions and a lot of effective protection for software. them. Bad FORTH is one definition per Probably it is the lack of vocal block, big, long, dense. It is quite objection from within the industry apparent, but very hard to point to an and the willingness to acquiesce, example of sanething that went awry or knowing that today's software will be explain why or how. BASIC and FORTRAN obsolete in a year anyway. me much less sensitive to the quality of the programmer. I was a good Given interest from other astron- FOWIlRW programer. I felt that I was mrs, a few believers formed FORTH, doing the best job possible with Inc. We developed miniMF?lTi (FORTH on FOKIRUJ and it wasn' t much better than miniccmputers) with the idea to have a what everyone else was doing. I proqramning tool. The first important indented things a little more nicely, realization of that tool came when we maybe, and I declared some things that put an LSI-11 and FOEiTH into a suit- everybody else left to get declared by case. I think I became the first default. What more can you do? mputer-aided programer, in that I In a sense I said, "let me do it had my computer and took it around. I right. Let me use a tool which I talked to my computer, my computer appreciate and if everyone can't use talked to your computer and we could this tool well, I am sorry, but that is c~rranunicatemuch more efficiently than not my goal." In that sense FORTH is I could directly. Using this tool we an elitist language. On the other put FORTH on many cunputers. My goal hand, I think that FORTH is a language in all of this was to make myself- a that a grade-school child can learn to more productive programmer. Before use quite effectively if it's presented all this started, I had figured that in the proper bite-size pieces, with in forty years I could write forty the proper mtivation. programs at the rate I was going. That was it. Period! That was my destiny Finally, polyFORTH is a con- but I wanted to write more programs densation of everything we have learned than that. There were things out in in the last ten years of developing the world to be done and I wanted to FORTH. I think it is a very good do them. package. I foresee no fundamental changes in the design of the language It has taken a long time. I still except for accommodation to the don't have the mputer I want, but I'm standards which are becoming in- working at ten times that rate and I creasingly important. Up until see other computer-aided programmers now there has been no reason for now. I am amazed that it should not standards. There are internal stan- have been obvious that programmers dards of FORTH, Inc. internal standards had to be computer-aided. To expect at Kitt Peak for the effectiveness of the pxqrarraner to deal with an intrin- the organization, but there has never sically unfriendly machine on his own been a demand for portability. In

'FORTH DIMENSIONS I/6 Page 62 fact I know very few programs that grammers, which is 2 to the 10th portability has ever been seriously power and canes out nice and round -- a attempted with. The time has clearly doubling time of one year. Actually, I come to change that. think the doubling time is slightly shorter than that - 10 times in tkee There will be developments in years and that canes out to 2,000 as other areas and one was brought home some people would prefer. What we most forcibly today. It may be that conclude is that next year there will FORTH is not merely a programming be twice as many pzogrammers; the year language. It may be saying something after that twice as many, and if you much more important about cmunication believe numerolqy these projections - between people, between mputers, are unarguable. There is a curve, you between animals. This is startling! extrapolate the curve and draw the It had never occurred to me that anyone conclusions. We don' t know how i t is would really "speak FORTH" in an going to cmabout. FORTH, Inc. can' t attempt to cmunicate with anything train twice as many people next year - else than a computer; it is not any well, maybe w can. But, somehow the longer clear that that is the case. FORTH community as a whole has got to There may be concepts embodied in FORTH train twice as many people next year of greater general utility to the basic and thereafter. Maybe the Apples ar4 problem of cmmnunication. the Radio Shacks me going to be the method of accomplishing that. It seems Now in concluding the philosophy that capabilities cane along just about section, I would like to read a poem. quickly enough to keep the exponential This is a poen that some of you have curve growing. I have fairly great heard. It is a translation of a confidence that 1) the doubling time classic of English literature and it is a year, and 2) it is going to ges as follows: continue. Now there is collateral evidence to support this, if you plot : SONG the number of FORTH systems or the SIXPENCE ! dollar value of FORTH systems or BEGIN RYE @ FOCKET +! ?FULL END percent penetration of markets. Each 24 (2 DO BLACKBIRD I + @ PIE +! LCOP way, you get about the same growth BAKE BEGIN ?OPENED END curve, so I think the growth curve is SING DAINTY-DISH KING ! SURPRISE ; honest . The authar is Ned Conklin, who is Ten years ago there was one very good at that sort of thing and FORTH programmer. The second FORTH is the first FORTH poet. Is there a programer is in the audience; please place for this in the world of com- meet Elizabeth Rather. Now that is munication? I don't know. It is quite a quantum jump, fran one to two. remarkably easy to come up with such The next step was four and they came paraphrasing of just about anything out of Kitt Peak and the growth can be that you care to paraphrase. It's not traced from there, for awhile, if clear that it's not an efficient anyone cares to. .ktually the first means of comnunication. FORTH user is in the audience and that is Ned Conklin. He was head of the station at Kitt Peak for NRAO, running the telescope, responsible for Let me introduce two people since canmitting his telescope to this risky I have touched upon the subject. venture. It is an important telescope It is ten years since there was one because it is responsibk for half of FORTH programmer. I would estimate the interstellar molecules discovered that there are now 1,000 FORTH pro- in the last ten years.

Page 63 FOR'IIi DIXENSIONS 1/6 Again, I didn't exactly ask Here is another example, quite permission to corranit these people to similar. [Figure 2.1 Here ATOM has this course of action. Nobody realized become W and I am looking up + and - what the consequences were going to and T, R, A and I - which represent an be. It doesn' t seem to have &rked out early version of our text editor. That too badly. FORTH is still running on again is .WL. I am not canpletely that telescope at Kitt Peak and on a clear what was being edited. I think lot of other telescopes. it was some kind of files sort program, maybe on cards that were getting printed or rearranged. FICURE 2. 120 CICLE; rtu mrrwrm BWPERIII.~LFPERI~I: 1 muuJm rm) 'Em - the 2 IFW.011 1M1( 16RY (.a( Now let's talk about language 3 ELSE IF -C mm L:=HINIU-I, ECF) 4 ELSE IF Mmt 71W L:*IN(LIWORD.UF) and how FORTH cam2 to be what it is 5 ELSE IP W-'- TlQX L:-(L-.O) 6 ELSE IF M7 'D(M BffilN today. There is a pre-history which 7 IF WRLX 111W W:=l; W.+INlLIV-I. ECF); 8 AR L:-L m.P 1 WILW KI BElN goes back much further than ten years 9 RIEITICN: TWE MD; L.=L-I fWJ and I have some slides showing that 130 else IF u-'R -RW B~IN 1 WITION: WEEM, time. These are strictly pre-history 2 USE IF *.A VlRd BffiIN 1 L:-LI*':-BlP+I; REPLLCE EM, I found an old pile of listings 4 USE IF W-.I W W=.D -RW BOCIN -- 5 IF Kx RW BffiIN 6 ~:=nuE:- RBIIN)lUIWl m; and I photographed them. The first 7 UXITIW; (F W -.I YW3 BOGIN component of FORTH to occur was the 8 WE: =ME m 9 BEGIN -:-; IF YRD a1 mm BOGIN interpreter. [Figure 11 This is an 140 L.rllm(IUI-1, UF); SPKEICARD, GLO*I I; U3:-L+1 example of an early interpreter 1 mwm progranned in .ALGOL. This was done at Here is another way of setting up Stanford Linear Accelerator Center back a dictionary. [Figure 3.1 I am in the early sixties. This is a filling an array with strings of text program which still exists and it and I am going to search that array for is called TRANSPORT. It designs a match, take the index and vectar through a cmputed G13-TO. elecbdn-beam transport systern. You PIWRE 3. see an early dictionary there. The word ATOM shows the LISP influence. Am1 is an indivisible entity, which we now call a "mrd." Haviq read a word DRIFT from an input card, I would execute the drift routine and so on. I have looked through innumerable listings and found this style of prgrannning quite consistent - it's the way I wrote programs in those Here is another way of imple- days. I had an input deck which got menting the dictionary. [Figure 4.1 interpreted with a structure pretty This is the first appearance I have on much as you see it today: words record of a stack. I am looking up separated by spaces, no particular the words in a conditional statement limits on the length of the words (as and setting NEXT to the index. And you can see from SOLENOID), only that's the first appearance of NEXT the first character sf however, were which I can f ind. FIGURE I. significant.

---- - FORTH DIMENSIONS I/6 Page 64 Here is the other half of that -- up in the course of several weeks this is the implementation of the or several months in order to be stack. [Figure 5.1 This is a variant effective. FORTH, I figured could of ALCOL called R4LGOL that lets you replace all of them. put assignment statements inside other statements. "Stack of J replaced by Here is NEXT: PROCEDURE CHARAC- J-1" is how you push something onto the TER. [Figure 7.1 I don't remember stack. One of my "less-liked" features that syntax but that I think it is the of ALGOL was that I had to play first definition of NEXT as a procedure games like "real of boolean of stack of that went off and got the next word and J and boolean of .. . " just in order to did something with it. This is still get around the automatic typing that all pre-FORTH. We haven't gotten to AIXX>L was insisting that I apply. Now what I would consider the first EORTH

this was specifically intended to let sys tern. PI- 6 b 7 me manipulate parameters that were I /,~ILIPI an smOVERHEAD 2 N txr FUI-1EBWDTE. PAm* interpreted from the card deck as I I m SYXUT-A 4 /BSIN CD MT~ arguments to the routines. In other 5 ./ Am HanE~,mL-oo.~-3,LIS- 6 NEm: FlOCaWRE flWWlER14); words, if I wanted the sine of an 7 OECW KmExnm STRFM Im,PRIm SIREM CUT- PRIW; B ntTW 1 l 'RXT (81 1 INITUL(l8lI. *), angle, I could say ANGLE SINE but if I 9 2 C(81) c'nR(1). I MITUL(T",W CWVCTF%(41, 10 WXfD CHIIRKTER( 12) MRYItG 845WI 1,P.HIIERIC BIT111 1 -1 wanted to convert the amle from one 11 RMMIlC(II1; 12 IF C(1 I='-' CR C(1)-'.' CR '0' LE C(I I TW( BffiIN; NVCRIC..l.B: unit to another, I needed at least some 13 IF C(I1 NJb'.' 'nit3 00 I=I+l BY 1 WIlE -0. LI: C(II: EM: 14 IF C(l)=..' lW2 I-Ill BY 1 WIE '0' LF C(I); m; Em: simple arithmetic operators and this 15 Effie 00: NLUtSUC-.O"B: 16 IF 'A' I2 C(I) rn u) I-1b1 BY 1 WllE .A. L?, C(II ClI)'--. provided- them. This is again at 17 W: ELSE: I=!tl; EM); 18 -: WlWNW): Stanford . QIrn 5. 6 7 BOMEA)( PwxLxme -m; BEGIN Here is a rather later version of H 11=.~:-1; m[01:.1; m CASE sxr c~ ma 9 3:-1; FORTH coded for the IBM 360. [Figure 21 0 .STACXIJ:<+ll:~; 1 SPTK[J:.J+ll:*rr: 8.) Those are the routines PUSH and 2 SPTK[J:cJ-11:-WAL(SIICKIJI~KIJ+ll I: J mKKIJ:.J-11:-mLlSTACXlJl GI% .9lWXlJ+11); POP. PUSH cost 15 microseconds on an 4 STsCKlJ:<-11 :-RFSL(STscKlJ1 LSS !TAfXIJ+ll); 5 .SlWK[JI:-RFAL(!QT 803WN(STPCKlJI))): IEM 360-50. It includes stack limit 6 .TTK[J:d-11 :-RE~L(B!XJLWNIST.ACKIJII AW BODWNlSbCKlJ+lI 11I: 7 ~KK(J:=.J-l1:=RFAL(803tUICl(STUKIJJ)M BDOLUW(SRCKIJ+lI 1)); checking, which doubled the cst and P STCKfJ:~-ll~~KlJl+~lJ+l~; 9 Sl'TKIJ:.J-11 :wKIJI-SIACKIJtlI: was one of the things that led me to 220 ~4CXIJ:<-lI:=STTKIJlxSP4CI(IJ+ll: I ~KKIJ:<-11:-S19CKIJi/STAO(IJ+II; feel that execution-time stack checking 2 ma MIL J ffis 0: 3 ~:.B?XEAN(STUKIOII IM); was not desirable and in fact not 4 necessary. However, up to that point, Now here is a PL/1 program doing the consequences of a runaway stack very much the same thing at a con- were terrifying. FOP is there also. siderably later date. [Figure 6.1 At It was coded in a macroassembler that the top you see JCL (Job Control did not have stack operations. It was Language) which was also not a pleasant not possible to refer to a previous thing to deal with. One of the "anythingn so the deck is full of "L19 criticisms of programming languages data mnstants, address, AL2 (*-L18)" that I mentioned in my book was that a to give me a relative jump to the programmer at a typical computer wevious- one. It could all be done but center, in order to function, needed to it wasn't pleasant. know nineteen languages. This mered writing Fartran programs, suhnitting card decks, etc. These languages were all subtly different with canmas here and spaces there and equal signs meaning different things - nineteen languages, just to function. Nobody advertised the fact. Nobody sat down and took a course in nineteen languages, but you had to pick them

Page 65 EDRTtI DIMENSIOBS I/6 Here is a version of ~~ coded for CODE and these are the code in 03BOL. [Figure 9.1 This was done definitions of the stack operation at Mohasco, of course. I am setting up on a 5500. Now the 5500 is a stack a table of identified words which machine at a time when stack machines I am going to interpret from an input were not at all popular. They did a string . 9-e attitude is so pervasive very good job with their stack. All that I begin to think that I was of these were implemented with one talking myself into something here. 12-bit instruction and the present COBOL is fairly difficult to write names of these operations are directly subroutines for. They have sub- derived from the names of the 5500 routines, they can be performed, but operations. That's where DUP came they may not have any parameters. This from, for instance. Notice that the makes it a lit'tle bit awkward to do $OR was a way of distinguishing the anything meaningful. assemblers OR from the FORTH OR before FIWE 9. vocabularies were available. FI(XIRF. 11.

Here's the first example of EDKI'H text. [Figure 10.1 This came out of Stanford again. The word DEFINE begins (that is,:) a definition and the word END (that is,;) ends it. The Here's an example of FIND coded for "OPEN is obscure. "NAME seems to be the 5500. [Figure 12.1 Notice that the way the name was introduced. the mrd SCRAMBIE is referred to, which Apprently there did not have to be a is a colon-definition for doing a space between the quote and the word. hashed search. Apparently here I had There are the definitions of a number eight threads, just as we put in of stack operators. Top of the line is polyF0RTI-l last year. These ideas go CODE - "OPEN DEFINE MINUS + END ; way, way back. This is FORTH after the I guess that is subtraction. SEAL threshold was crossed, ten yems ago, was an early word for sealing the almost exactly. One can become a dictionary for some reason. BREAK, I little bit depressed at the "trenen- guess broke the seal. "< : OPEN dous" rate of progress in the last ten DEFINE - < END ; is the same years when you see that it was all back definition we use today, in a very there. P1~12. early state. That was fran a thing I called "Base Two," intended to be some kind of base pogramning language - I can't remember any more about it. rwlo. '- mxte nw+ m SUL .<'OPMrnPRe - DO- -m-mRe nIm61+ m . OR NJl' IID the Univac 1108. These are very -+.OPDlmIIS: -m Rm y'wmrnm, >m m early record descriptions. This is the .>.mOEFW tm W .-w Wm WRe ME10 *URU WRmr 3 10 aBL WCIZ 0 LINE layit of a record^^ in a file with the This is a version of. EORTH source name of the field and the number of for the 5500. [Figure 11.1 Again, bytes in the field. That was the Dun & very early - the second canputer that Bradstreet reference file for looking FO#IH was put on. Apparently g! stands up bad debts.

FORTH DIMENSIONS I/6 Page 66 The first FORTH was coded in

3 m1 m1mJ.RE 33 33 FORTRAN. Very shortly thereafter it 4 aM 8 NME 24 S- 19 CITY 15 SThR 4 ZIP 5 5 RlCHE 10 3 PKCU3 19 CfFICER 24 SIC 4 SIC1 4 SIC2 was recoded in assembler. Very much 6 SIC3 4 SIC4 4 SICS 4 7Wl'AL 5.0 DIR 5.0 - 9.0 9.0 later it was coded in FORTH. It took a long time to feel that FORTH was complete enough to code itself. 'Ihe first thing to be added to what had already existed was the return stack This is the last slide. [Figure and I don't remember why that was. I 14.1 This is a modern FORTH source don't remember why I didn't just from FORTH, Inc. Vector arithmetic put the return information on the coded far the Intel 8086. CODE V+ with parameter stack. It was an important comments listing the arguments that are developnent to recognize that there had on the stack with the results being to be two stacks -- exactly two stacks, obvious. Fairly nicely spaced out no more, no less. code. It just looks like gccd, clean pure FORTH instead of that other The next thing to be added was gibberish. Not at all cryptic, per- even more inqmrtant. I don't know if fectly obvious to the discerning reader you appreciate it but it was the and that's the end of the slides. invention of the dictionary. In particular, the dictionary in the form 0 ~~*R~C) of a linked list. In particular, the 1 CmEV+iYX YX) omp 1KR 2m 3mp 2 20- 31- 1Wsn OrnH Ern existence of the code field in the 3 COCEV-(YX YXI 2rnP 3mp om 1mP header. For control, up until then, flags had been set, computed GO-TOs executed, some mechanism for associa-

10 (LmEV./ (YXND) 7PJP 3- 1mP OPOP ting a subroutine with a word. Now 11 3 IUUL 7 IDIV 0 PUSH 12 1 0 lW 3 INIJL. 7 IDIV 0 PU5H SXT the existence of the address of the 13 I4 routine (rather than an index to the 15 CCPYRrmr IORIW. IHC (CT. 1979 routine) made an incredibly fast way of kt me now sketch in time sequence executing a word once it had been the operations that were implied by identified. No other language has a some of those slides. The first thing code field or anything resembling ie. to exist was the text interpreter NO other language feels obliged to reading punch cards. The next thing to quickly implement the code that the exist was the data stack with the word identifies. You can go about it manipulations of the operators. at your own precious time, but even in Those took place very early, around these days it was important that 1960. FORTH be efficient . The whole purpose of this system was to draw pictures on Nothing substantial then happened the 2250 display. The 2250 was a until 1968 and that was the 1130 and stand-alone minicomputer interfaced the ability for the first time to with the 1130. What came out of the totally control the way the computer 1130 was a cross-assembler which interacted with the programer. This assembled the instructions which were machine had the first console I had then to be executed by the 2250. I ever seen. I had always suhnitted card think the 2250 had its own memory. decks - now I had a typewriter. Do Again, very sophisticated things being you know what I did? I submitted card done very early in a very demanding decks. It took a long time to figure environment. IBM software, in 16K of out how to use the keyboard and memory, could draw pictures on the 2250 whether or not the keyboard would do fairly slawly. What I accomplished in anything for me. I was very good at a 4K would draw three-dimensional moving keypunch and I really didn't care if pictures on the 2250. But it could there was a console or not.

Page 67 FORTM DIMENSIONS I/6 only do that if every cycle were ters per word could be replaced by accounted for and if the utmost was two bytes per word at a canpression of squeezed out -- that's why FORTRAN had a factor of two or three. Execution to go. I couldn't do an impressive speed would be vastly faster. Again, enough job with FORTRW, an assembler if it was that easy, why hadn't anyone was the requirement. else done that? It took me a long time to convince myself that you could At this time colon definitions compile anything and everything. The were not compiled - the compiler came conditional expression, for instance, much later. The text was stored in the had to be compiled somehow. Before body of the definition and the text canpilation, if you caw to an IF you interpreter reinterpreted the text in could scan ahead in a text string until order to discover what to do. This you came either to an ELSE or a THEN. kind of contradicts the efficiency of HOW did you do an IF if you were going the language but I had big words that to compile things? But, it worked! put up pictures and I didn't have to Again, I can't remernber the sequence. interpret too much. The cleverness was 1imi ted to squeezing out extraneous It may be that the 316 compiled blanks as a compression medm and I am the 360, but I think the 360 compiled told that this is the way that B.4SIC the 315. Again, in the early days of executes today in many instances. RXTH, the idea of of today was there -- cross compiling, cross assembling This machine had a disk - I can't be tween different computers was there. prove it but I am almost certain that Interrupts came at about this time. It the word BLOCK existed in order to was important to utilize the interrupt access records off the disk. I do capability of the ccmputer but it had remember that I had to use the FORTRAN not been done by me before that. I I/O package and it wouldn ' t put the didn ' t know anything about interrupts, blocks where I wanted them -- it put but 1/0 was not interrupt-dr iven. the blocks where it wanted them and I Interrupts were available for the had to pick them up and move them into application if it wanted them. FORTH my buffers. It had an assembler didn ' t bother. for assembling 1130 code, it had a target assembler for assembling 2250 The multi-programer came along a code and clearly B-5500 code. The couple of years later when we put an B-5500 program was taken far enough to i,mgroved version of the system into the recompile itself. Beyond that there Xitt Peak PDP-11. This multiprogrammer was no application because there was no had four tasks. Input was still not way I was going to get access to that interrupt-dr iven, which was unfor- machine outside of the third shift. tunat.2. Interrupt-dr iven I/O came along when FORTH, Inc. produced its This was the transition point first multi-terminal system. It did between something that could not be not speed things up particularly. If called FORTH and something that could. you count cycles it was much more IU1 the essential features except the efficient, and it prevented any loss of compiler were present in 1968. It took characters when many people were typing a long time for the next step. at the same time. FORTH didn't have to look quickly to get each character The, first compiler occurred on the before the next one came along, as they Honeywell 316 system at NFV40 several were all buffered and waiting. years later. It resulted from the recognition that, rather than reinter- Data-base management came along at preting text, the words could be this time. It has been extensively compiled and an average of five charac- changed, just like FORTH has, but

FORTH DIMENSIONS I/6 Page 68 fundamentally nothing has changed. The concept of files and records and fields that I outlined this af ternoon dates All right, let's switch gears a back from 1974 or so. little bit. I would like to talk about the implementations of FORTH of which I The first target compilers came am aware. I have touched on them along later with microFORTH. They are already but I want to rattle off a very complex things, much more so than string of CPUs which have come to I had expected them to be. mind just to dazzle you with the capabilities. It is actually a tour I think that completes the through the history of computers and it capabilities that I think of as FORTH is fascinating that this could all have today and I think you can see how they happened in ten years. dribbled in. At no point did I sit down to design a programning language. FORTH has been programmed in I solved the problems as they arose. FORTR.4N and in ALCX>L and in PL/1 and in When demands for irnproved performance COBOL and in assembler and in FOm. I came along I would sit and worry am sure some of you can come up with and come up with a way of providing other languages with the same history. improved performance. It is not clear It has been done on the IBM 1130, the that the process has ended, but I Burroughs 5500, the Univac 1108, think it is clear that that process has the Honeywell 316, the IBM 360, the now got to be carried into the hardware Nova, the HP 2100 (not by me, but by realm. Paul Scott at Kitt Peak), the PDP-10 and PDP-11 (by Marty Ewing at Cal- HARDWARE Tech ) , the PDP-11 (by FORTH Inc. ) , the Varian 620, the Mod-Comp 11, the I have designed some computers. GA/SPC-16, the CDC 6400 (by Kitt Peak), This is expensive because I am supposed the PDP-8, the Computer Automation to be earning money by writing soft- LSI-4, the RC4 1802, the Interdata, the ware. I think that hardware today is Motorola 6800, the Intel 8080, The in the same shape as software was 20 Intel 8086, the TI 9900 ant! caning soon years ago. No offense, but it's time the 68000, the 28000, the 6803 -- I that the hardware people learned know you people have 6502s and Four something about softwzre and there is Phase. (Audience: And Illiac!) I've an order or two magnitude improvement raised the question - is it the case in performance possible with existing that FORTH has been put on every technology. We do not need pi-second computer that exists? computers to make substantial, really substantial, improvements in speed. COMPUTERS And faced with that realization, there is no point in trying to optimize the We speak now about FORTH ccmputers software any further until we have - there are EDRTH cffnplters. The first taken the first crack at the hardware. one I know of was built at Jodrell Bank The hardware redesign has got to be as in England around 1973. It is a complete as the software redesign was. redesign of a Ferranti carq?uter that I The standard microprocessors did think went out of production. They not have FORTH in mind. Those mini- were going to build their own bit-slice campters that can be micropccgrd version and they discovered FORTH about cannot be microproyr a& well enough the same time, modified the instruction to even be worth doing. The ixqxove- set to accommodate FORTH, and built ments available are much greater than what I am told is a very fast FORTH you can achieve by these half measures. computer. I have never seen it . I

Page 69 ECRTH DIMENSIONS I/6 have talked to its designer, John not need any I/O ports except for the Davies, who is one of the early FORTH application requirements. A serial enthusiasts and eminently cunpe tent to line is nice; a disk port is nice. We do this. have put FORTH on an 8080 with disk replaced by enough core to hold 8 In 1973 came General Logic and blocks. Quite viable, no particular Dean Sander son. The machine qua1if ies problem with system crashes, a somewhat as a FORTH computer because it has a protected enviromnt. Bubble memories FORTH instruction set and there is a are caning, and Winchester drives of story there. Dean showed me his course. We don't need much mass instruction set and there was this rnemry, we only need on the order of funny instruction that I couldn' t 100 to 250 blocks. The fact that FORTH see any reason for. I figured it was can exist quite happily on a very s.mll some kind of no-op or catch-all because machine by con temporary standards it had the weirdest properties. It should be exploited. couldn't possibly 5e useful - it was NEXT. It was a one-instruction NEXT - it was beautiful. And it was a very simple modification to the instruction Finally, I would like to run set. A few wires here and there and through the history of the organiza- that was the first time I -saw a FORTH tions which have been involved with computer. Here was the ability to FORTH. They form another thread to change an ordinary computer to make it the tapestry. Mohasco, of course, into a FORTH computer. and the National Radio Astronomy Observatory. They birthed it and they We have had some ideas about other rejected it. Thats vetty much why I such modifications that could be am here today instead of in South made effectively, but I don't know that .Wr ica poqr amning telescopes. They any of them have been carried out. I had what we have learned to identify as am told that Cybek has got its own the NIH Syndrome but in a weird mutated machi-e nw, built by Eric Fry. These case because it -was invented there! It are rumors that I'm just passing on. is their loss. You have perhaps read Child, Inc. does raster graphics about the VLA, a very large array of systems. I am told they were working antennas in New Mexico -- a very cn a FORTH mputer that was supposed exciting project. Something that I to be available last February -- really would have liked to have pro- I haven't heard. Again, I think they gramned. It wasn't in the cards (and are competent to do it and do it well. they have sof tware problems today ) . A blindingly fast FORTH cmputer on a On the other hand, there was Kitt board, probably biased towards graphics Peak. Astronomers are a conservative applications, raster gr&hics. lot. This may be surprising. I think they are surpassed only by nuclear I have built a FORTH computer physicists in being conservative. We called BLUE. It's small. It has never have been unable to scratch the nuclear executed any FORTH yet. The design physics field here although I am told changes as fast as the chips can be that CERN is interested. NRAO is a plugged into the board, but it's not sister laboratory to Brookhaven. One hard to do. would think that there would be scxne canmunication between them and there What are the characteristics of a isn't. They are both managed by the FORTH mputer? It does not need a lot same University Association. We of memory. 16K bytes is about right. couldn ' t interest Brookhaven and we Half PROM, half RAM, maybe. It does couldn't interest NRW, but we could not need a lot of 1/0 ports - it does interest Kitt Peak and Elizabeth Rather

FORTI3 DIMENSIONS I/6 Page 70 is the one who did it. She liked FORTH argue about who did what, but Art and talked a lot of other people into provided the opportunity to do com- liking it, too. Kitt Peak adopted mercial systems. He got a good deal FORTH - gave it the impetus because because he could handle 10 times as Kitt Peak is the show place of the many terminals as he could with the astronomy world. Kitt Peak put FORTH BGIC prcqrarn that preceded FORTH; we on a whole batch of Varians. It's fun learned everything we know about data because I remember Varians breaking base management from him. We also down and spares being wheeled in -- acquired our distaste for commercial there were 14 of them lined up in the programing at that time. I canmend hall. Reliability through redundancy? those of you who are involved in it. Pipeline architecture? A lot of other I find it much to heavy in system observator ies picked it up. analysis for my taste. You've got to go in there and tell the businessman We were deluged by requests for what he has to do, talk him into it, FORTH systems from astronomers and went and hold his hand all through the into business to try to exploit that process of installation. It is a market. It is a market we would still different talent from that of writing be in today except that there are so pograms. Don't underestimate the cost few new telescopes in the world, and of support . you can't support a company on that market. I think that is about the time that the International Astronomical The formation of FORTH, Inc. was Union met and agreed on FORTH as a important because I don't think we standard language. That was a boost in would be here today if it weren't for the world of astronomy although FORTH, Inc. We worked very hard to try the world of astronomy was no longer to sell this thing. We didn' t know the major driving force in the popu- what we were getting into; we were your larity of FORTH. I think EFUG came classic naive, small business folk. I along about that time -- this was '76 caution any of you against thinking it or so -- the European FORTH Users is easy to go into business for your- Gkoup. It turned o:t, to our surprise, self. It is fun, but the advice is that Europe was a hotbed of FORTH true -- do not go into an area where activity of which we were largely you must create the demand for your unaware and perhaps really still are product. But that was the least of unaware, in that we are not involvd in the problems really that FORTH has that world and don't quite appreciate faced. The next step was probably the level of interest. FST (FORTH DECUS. Marty Ewing gave his PDP-11 Standards Team) probably began in FORTH system to DECUS. I didn't know EFUG's first meetings. Later, a if that was a good idea at the time - couple of years ago, FIG was started free FORTHs floating around. It and now we have FORllL (FORTH Modi- was imprtant because a lot of people fication Laboratory), which is an were exposed to FORTH who otherwise idea-generating organization. The would not have been. I imagine we tendency seems to be for people to picked up a few sales through that organize themselves into groups. Some channel. Cybek came along. Cybek is of these groups are ccmpanies, some of probably the savior of FORTH, Inc., in these groups are associations. It that it provided us lucrative business looks like FORTH is going to be a at a tim where we desperately needed communal activity in the sense of it to stay alive. Art Gravina, unstructured clusterings of like minded the President of Cybek is the one that people. The suggestion is that this designed (if that's the word) our whole world of FORTH is going to be data-base management system. We can quite disorganized, uncentralized,

Page 71 FORTH DItlENSIONS I/6 uncontrollable. It's not bad, it's Mr. Mocze: That's a good question -- perhaps good ;CODE cam first. I think it began way back in 1130 days with the notion that you could define a word that would define other words. That was stagger- 'Ib close on a philosophical note: ing. I couldn't grasp the implica- power to the people. This is the tions. ;CODE was a very esoteric first language that has come up from wwd. I explained it to people ~oudly the grassroots. It is the first but I couldn't express the ptential I language that has been honed against saw in it. I didn ' t know what ;CODE the rock of experience before being should do. (It specified the code to cast into bronze. I hesitate to say it be executed for a previously defined is perfect. I will say that if you wurd.) I don't have it but I think the take anything away from FORTH, then initial assembler code for ;CODE was it isn't FORTH any longer, that the three or four lines long. One of tbe basic components that w know are all driving forces behind the address essential to the viability of the interpreter was making it possible to language. If you don't have mass code ;CODE cleanly. This had all kinds memory, you've got a problem and it of implications as to what registers can't be waved away. I hesitate to should be available. W should be savee predict. I don't know what is going to in a register instead of (pardon the happen. I think my view of the future expression) direct threaded code is more unsettled tonight than it has recovered somewhere because that was been for years. Promising, yes, expensive. I had a lot of trouble with confusing, and perplexing. The ;CODE. That was the most canplicated imp1 ications are perhaps as staggering routine I had coded in this systems now as they were ten years ago. The programming fashion. Not so much promise of realization is much higher. later it seemed that there ought to be This is ten years of WR!J!H. an analog of ;CODE which specified the code to be interpreted when you My original goal was to write more executed a word. It seemed the natural than 40 programs in my life. It think balance, but I hadn't the foggest idea I have increased my throughput by a of what the implementation should be. factor of 10. I don't think that that The first definitions of ;: required throughput is program-language limited three or four lines of code. You had any longer, so I have accomplished what to do what ;CODE did and then more and I set out to do. I have a tool that is this couldn't be explained to anyone. very effective in my hands - it seems Out of that grew the distinction that it is very effective in others' between compile time action and hands as well. I am ham and proud execute-time action and the present that this is true. form of CREATE and DOES?, This was due to Dean Sanderson, again. It was very I wish that the future smiles on convenient for words to be coded to act you and all of your endeavors. this way, but it was expensive. It required not only the address of the (Mr. Moore ' s address concluded code to be executed, but the address of to an extended standing ovation.) the code to be interpreted as well as the parameter to be supplied to the code to be interpreted. Questions DISCUSSION PERIOD included: should the parameter be put on the stack or should the address of Question: When did (BUILDS and DOES> that parameter be put on the stack? come along? Should that parameter be at the

FORTH DI!'IENSIONS I/6 Page 72 beginning of the parameter field where don't really want it on my wrist. it was a little bit awkward or one These consider ations have conse- word in? How I don't know if you are quences. I consider that a reliable aware of the new DOES>? It now has computer is one with small parts full synnnetry with ;CODE. count. The pcobability of failure is proportional to the number of parts. Again, this grew out of a clear So if you only have six parts you can perception of what the word is and what last maybe ten years -- I don't know. it does. I know of no way of speeding I would like it to have voice input/ the process from initial thought to output. A terminal is acceptable development except to let a certain but this isn't small. Are you familiar amount of time pass. We sat and with the Write-Hander? A very nice debated this thing endlessly and input device which, if it's perfectly missed the obvious. The current matched lm your fingers and if you can implementation of DOES> does not train your reflexes to depress two keys require the address of the code to be at the same time, is a good idea. I interpreted. That is supplied by a am afraid the implementation is different mechanism and therefore the not perfect. It probably has to be parameter can occupy the parameter customized to your hands sanehow and field as it is supposed to. Therefore even then it is only a substitute for you can "tickn it and change its valuer voice input. No power supply, of which is wonderful, except that it course, it should run off body heat. is going to be in ROM and won't matter. We save two bytes per DOES> The potentials in the field of definition. 'I'M bytes per word for a comnunication are enormous. I don't very common class of words and for like telephones much. I speculate that three years we didn't realize that we I would talk on the telephone if there had missed the optimum by so much! were a computer between me and it. I Although this is proprietary to FOKl!H, speculate that a personal canputer like Inc., I am sure that given these clues this could be an interface between an all of you will proceed to go off and individual and society. If I wanted a invent the new DOES>. Maybe that's the new driver's license I would tell my way things should be. computer to get me a new driver's license and it would deal with the Question: When you were in the phil- bureaucracy . osophy section, you said that you still don't have the computer that you want Question: Can you develop a version of and you sort of alluded to that at FO#M that will be machine-independent? various times. Can you tell us just what axnputer you would like to have? Mr. we: The premise is wrong. The equivalence of FORTH on different Mr. Moare: Well, first and faremst it machines requires IIE ticulous attention has to be reliable. I want an MTBF of to the characteristics of these ten years. I see around me computers machines. You must use all the hard- that fail in six months and that is ware capabilities of each machine and preposterous. You do not get an CflBF you must then work to faroe it into the of ten years by taking ten ccnrplters mold specified by FORTH ' s virtual with an MTE3F of six months and lining machine. them up in parallel. I want a canplter that I can drop in the ocean and fish The internal character istics out and it doesn't care. I want a of every machine can and must be computer without an on/of f switch. I exploited. You do not need any par- want it to be -11. By small I guess ticular number of registers or stacks, I mean I want it to fit in my pocket, I as they can all be simlated; but if

Page 73 FORTH DIMENSIW I/6 you neglect the capability of the difficulty l~fthe task that we were machine, you can end up a factor of two trying to slve. We could compare down from where you might otherwise be. two implementations with different hardware/ software tradeoffs based on Question: So far I've heard you say the carnnon masure of the area it took that thinqs can be done differently but to implement. I think that would be a I wanted -to hear what you had to say very, very interesting thing to do. about the architecture of the processor itself. There is a speculation that human hains have a great capacity, 10 to the Question: I would like to support that 13th bits, some preposterous number. I question with one more question. I suspect that human brains have a much have a custcxner who ran 64 users on a smaller capacity than that, on the 5500 for ten years and bought a VAX and order of 10 to the 9th bits mayk. We can only run 16. My question is -- make up for our bad memories by which is progress and what is a suit- "faking it" a lot; people don't able architecture for a FORl7-I machine? remember what happened ten years ago. I reconstruct what must have happened Mr. Moore: If you measure the size of based on little clues that I pick up those two machines, we could put 64 here and there. Those reconstructions users on a VAX, no problem. The fact are so accurate and so impossible to that he couldn't is a condemnation of contradict that we get the ingression the so•’tware, not the hardware. that we can remember a very great deal. I suspect that we can build a The characteristics of a FORTH computer as complicated as a human processor? I don't want to go into brain now and it won't need to be detail but I will say it is substan- powered by Niagara Falls. It will be a .tially simpler than machines like the small box. 8086, 6800s, simpler than the 8080, probably. You don't need much more Question: Assuming someone were to than the ability to execute . design a FDR'IW small micro-enqine of Very simple microcode will serve for some sort, how much faster or more this very simple architecture and capable do you think it would be wer the performance comes out of the the present implementations? Just simplicity. If you add complexity, you assuming that someone has done that. are going to decrease your reliability No guesstimate? and increase power consumption, all those bad things. I would like to see Mr. Moore: No, and I am not saying and some studies made of the tradeoffs. I don't you say either, Dean. would like to know how complicated FORTH is. Take FOIMWW. You cannot Question: Can we assume that it is measure its complexity. You can't say less than 100 and more than l? a FORTRAN program is 10 to the sixth power in

FORTH DIMENSIClNS I/6 Page 74 Mr. Moore: If you have a thing that have-nots. But it will probably also does one thing well it is of no generate the solution. interest or value unless the one thing that does well is FORTH. I have no .U to the twists that might occur, idea. It never occurred to me to ask there are two wild speculations. One, how you measure flexibility. that computers become intelligent or aware. Nobody has a clue as to what Question: Could you extrapolate that means, but it is conceivable. present trends to the future? Two, that we learn to record human personalities in machines. That Mr. Moore: I think the obvious extra- merely requires the ability to detect polation is telepathy. That in 20 and record the requisite volume of years we will have the functional information which, as I say, I don't equivalent of telepathy. If you want think is all that great. to talk to anyone in the world you will be able to do so with minimal apparatus Question: I wonder if you care to and you will ke able to talk to them in mmnent about the possibility of a new the sense of not intruding upon them as direction of architecture having to do telephones do now, but rather r elayinq with associative memory, which the messages •’ran your computer to their txain seems to he. computer and holding vast dialogues in the way computer mediated conferencing Mr. We: I've studied these associa- is being done today through terminals. tive memories: there is such a chip on This will be a very natural way of the market. I'd like to say they ought conducting our lives. It requires to be useful in implementing a FORTH nothing in the way of technological canplter but, I'm afraid I'm stuck in breakthroughs! It merely wants the the mold. When I first encountered implementation of optical comnunication LISP I couldn't mncleive of a language links worldwide. that didn't have a store operator. How could you do anything if you couldn' t I'm reluctant to quote science- store yoor results sanewhere? I can't fiction books, but there was one conceive of a pied of data that is its recently dealing with the first manned own label, if you will. I am so used Mars mission and the fact that the to thinking of data having addresses United States came up with project that my mind just doesn't grasp the management techniques of an advanmd possibilities if they don't. So, I'm crder through the use of canplters - afraid I can1t say anything useful and completely outstripped the rest of about associative memories. the world. We gained an ascendant position in the world and earned the hatred of the rest of the mrld for our (The evening concluded with super ior i ty, tr ied desperately to an extended mation.) export technology and failed. The same thing can happen here. If we have a very tightly integrated community in terms of human resources and the rest of the world is excluded, we are going to have one hellwa problem. I think this will happen. I think it will happen withoit any deliberate planning, and I think it is going t;o cause problems as great as tho& we have today between the haves and

Page 75 FORIll D-1- I/6 INFORMATION

Convention Transcriptions ...Using FORTH, 1979, Carolyn menberg and Elizabeth Rather, Audio tape transcripts of the 160 pp, $25.00. Order from FIG FORTH Convention held in San E'rancisco, or FORTH, Inc., 2309 Pacific October, 1979 are available. FIG Coast Highway, Hermosa Beach, CA member Jim Berkey reccrded the tech- 90254. nical sessions and the banquet speech by Charles me. .. .microFO~~~~~ Pr imr , 2nd Edi- tion, 1978, 60 pp plus glossary. Our thanks to Jim for this signif- Order from FORTH, Inc. or Miller icant contribution to FORTH history. Microcomputing Services, 61 Lake Shore Road, Natick, MA 01760. There are four tapes and they may be ordered at $4.00 each, postpaid ...Kitt Peak Primer, Feb. 1979, from: Audio Village, PO Box 291, Richard Stevens, 200 pp plus Bloomington, IA 47402. glossary. Order from FIG. Tape 1 - Bill Raqsdale, Welcome and ...Introduction to STOIC, Mar. 1978, ~ntroductions; Standard Jonathon Sachs. Order from Teams Report; General Stephen K. Burns, MIT, Room Announcements; Case State- 20A-119, Cambridge, MA 02139 or ment Contest. Wink Seville ( 714) 452-0101. Tape 2 - More Standards Team ...Cal Tech FORTH Manual, June &ports; FORML; Applica- 1978, M.S. Ewing. Send $6.00 tions of FORTH: Language to Cal Tech Bookstore, 1-51, Concepts. California Institute of Tech- nology, Pasadena, CA 91125. Tape 3 - Con tinuation of Language Concepts; Technical Work- ...URTH Tutorial, University of shop with Charles Moore. Rochester. Send $20.00 to Sof tware Ventures, 53 .&vine Tape 4 - Banquet Speech by Charles Heights, Rochester, NY 14611. Moore, "FORTH, The Last Ten Years and The Next Two ...FORTI4 Introduction Reprints, 38 Weeks." (Printed in this pp, summary and collection of issue of FORTH DIMENSIOEJS.) published and unpublished articles about FORTH. Send $10.00 to John S. James, P.O. Box 348, Berkeley, CA 94701.

Manuals Know anymare? Send us your lists. Here's an update of FORTH manuals currently in print and commercially availabe i.e. not part of licensed mater ial.

---- FOR!lV DIMENSIONS I/6 Page 76 MEETING NOTICES

on the third Wednesday of the month at 7:00 pn in Cochituate, Mass. Call Dick FIG Monthly meetings are held the at (617) 653-6136 for the site and more fourth Saturday of each month at the information. Special Events Room of the Liberty iiouse department store in Hayward. Incidentally, Dick offers a TRS-80 Informal lunch at noon in the store FORTH System and 280 and 8080 assem- restaurant, followed by the 1:00 p.m. bler, data base manager and floating meeting. Directions: Southland point math extensions. Enthusiastic Shopping Center off Highway 17 at cunments have been received . Winton .4venue in Hayward, CA. Third floor rear of the Liberty House. Dates: 3/22/80, 4/26/80, etc. All welcome. FORTH DAY AT WC

THREE NEW GROUPS Tuesday, May 20, is FORTH DAY at the PERSONAL COMWTING FESTIVAL at the FORTH Ottawa Group National Canputer Conference which is c/o W. Mitchell being held at the DISNEYLqND HOTEL, 39 Rockfield Crescent .4NAHEIM, CA on May 19-22. FIG members Nepeah, Ontario, K2E 5L6, CANADA wishing to break out their portable soapbox are invited to participate . Speakers may address the audience on FORTH UK Group any FORTH related topic a may be part c/o William H. Powell of a panel discussion. FIG will have 16 Vantorts Ftmd a table in the exhibit area for dis- Sawbr idgeworth , Her ts tribution of FIG literature and CM21 9NB, ENGLAND individual discussions. Figgers with running FORTH systems with a good Mr. Edward J . Murray demonstration package may show off Department of Canputer Science their efforts at the exhibition area. University of South Africa Members with a paper may present it P.O. Box 392 and have it become a part of the Pretoria 0001, Union of South Africa proceedings. FIG has committed to this effort on a short deadline. Those wishing to participate should Congratulations! Ikt us know what contact Jim Flornoy (415) 471-1762 you're doing. inmediately. There will also be a FIG mting at the show. People who want to organize local groups can write to FIG for organiza- tional aids and names of other members in your areas. Start a group!

Dick Miller of Miller Microcmputer Services announces mnthly meetings of the bPl!5l?OlWH Users Group. Meetings are

Page 77 FO#RI DPIENSIONS I/6 FIG DOINGS seven vendors talk and answer questions about EOR'l'H systems.

A four hour technical session was also held on the topics of FORTH introduction, Extensibility, Standards, FIFTH CCt4PWl'ER FAIRE FIG implementation, poly-FORTH, multi-tasking in URTH, and ARPS. The Lmk for FIG at the Fifth West Coast conference pmedings are available Canputer Faire! We'll be at Booth 1028 for $14.78 from Computer Faire, 333 in Brooks Hall, San Francisco (the Swett Faad, Woodside, CA 94062. lower exhibit area), on March 14-16. We'll also have a Users Group Meeting on Saturday. -911 FIG Publications will be available. This will be an ideal time to sign up for FORTH DIMENSIOIS, EmoPEAN MEETINGS volume 11. Promptly after the Fourth West Coast The Booth and meeting site are Canputer Faire, severa1 FIG members, through the generous consideration of including Kim Harris, Bill and Anne Jim Warren and the Faire management. Ragsdale, John James and John Bum- Thanks again! garner, sallied forth (sic) to Amster- dam for the annual European FORTH User's Group Meeting, May 1979.

The meeting was held at the State FIG MEMBER PAeER University at Utrecht, under the hospitali ty of Dr . Hans Nieuwenhui zen . Joel Shprentz of the Software Farm, In addition to papers fran FIG members Reston, VA, will present a paper at the that were also ~esentedat the Can- Fifth Canputer Faire entitled "Solving puter Faire, there were status reports the Shooting Stars Puzzlen. Joel sells on standards efforts and reviews of TRS-80 tiny-FORTH and features a FOEFH European developnents. solution to this network problem, using a modification of Dijkstra's algorithm The next meeting is planned for for the shortest path problem. Nancy, France, hosted by TECNA. Incidentally, TECN9 is one of the most technically progressive firms in using FORTH as a base for a variety of operaking systems and application OLD NEWS BVT IrnRESTING dialects. The West Coast Computer Faire is one of the best personal computing conferences and exhibitions. The Fourth Canplter Faire was held in San REVIEW BY KIM HARRIS Francisco on May 11-13, 1979 with more than 14,000 people attending. During the European User's Group Meeting at Utrecht, it was exciting to FIG had a booth where it released meet other FORTH users and learn of the first of the public domain fig- their activities. Attendees shared the FORTH implementations. FIG also results of projects including imprwed sponsored a FORTH Users Meeting at user security, an innovative file which about 100 people attended to hem systern, a microcoded FORTH interpreter ,

FOm DIMINSIONS I/6 Page 78 The intent of FORTH-79 is for a and the extension of WRTH to new comnon form for publication and inter- languages. This last topic illustrated change of EWTH programs. The steps a powerful use of FORTH. A translator before release include a final Wch- was written in FORTH which converted nical Referee review and a mail vote a completely different computer of the Standards Team. Watch FORTH language into FORTH source which was DIMENSIONS for the availability subsequently compiled and interpreted. announcement. The new language was designed to be readable by bank managers in France (it resembles French COBOL). But this language can be easily controlled and expanded because the FORTH translator is small, structured and itself FORTH CONVENTIrn ex tensible . On October 20, 1979, FIG sponsored a We also met some University of one day mvention in San Francisco. Otrecht students who have done a lot This date allowed European members with FORTH on an Apple 11. They added attending the Computer Faire to floating point software to FORTH and attend. In all there were 255 at- wrote some excellent high resolution tendees with 110 at a dinner for graphic words. We were shown a timing Charles Moore ' s "Tenth Birthday of benchmark of 500 floating point addi- FORTH". Technical meetings were tions using the same floating point held and Jim Berkey has tape tran- software but called from FORTH or scripts. $16.00 for 4 tapes. Audio microsof t BASIC. Village, P. 0. Box 291, Bloomington, IA 47402. European FORTH users me very active in experiments for improving FORTH. FIG members were pleased to meet some of them and we all look forward to sharing past, present and future developnents. The first meeting of the FORTH Modification Labor ator y ( FOWL) was held at Imperial College, Iondon, January 8-10, 1980. Representatives of both the European FOm Users Woup and Wnty seven people, canprising the FIG attended. 1979 Standards Team, met at Avalon, CA (Catalina Island), October 14-18, participants identified cate 1979. The scope of their work has garies of limitations and approaches significantly expanded! FORTH-77 toward solutions. Detailed work is to and FORTH-78 were primarily stan- be done by individuals with progress dardized glossaries for carmon pogram reports to the team. Topic areas expression. FORTH-79 has been extended included : Virtual FORTH Machine, to assure (hopefully) program port- conclrrency, lanaguage, cclrrectnesa, ability. The glossary notation has documentation, file system, 1/0 and been improved, definitions of terms programning methodology. added, English vocalization specif id for symbols, rules of usage added and Contact Kim Harris or Jon Spencer address space specified. through FIG for further information.

Page 79 EQR'IM DIMENSIONS I/6