JFAR was a refereed journal and long served an important role in the early years of Forth programming. Its diverse content is a resource we help to preserve by making it available here, without charge. All code examples may not run unmodified on modern, standards-based Forth systems but the knowledge it nevertheless conveys may be invaluable.

JFAR volume 1, issue 1

Expert System for Diesel Electric Locomotive Repair

Harold E. Johnson, Jr. and Piero P. Bonissone

General Electric Company, Schenectady, NY

Download PDF (625.96 kB)

In recent years, expert systems have become the most visible and the fastest growing branch of Artificial Intelligence. General Electric Company’s Corporate Research and Development has applied expert system technology to the problem of troubleshooting and the repair of diesel electric locomotives in railroad “running repair shops.” The expert system uses production rules and an inference engine that can diagnose multiple problems with the locomotive and can suggest repair procedures to maintenance personnel. A prototype system has been implemented in Forth, running on a Digital Equipment PDP-11/23 under RSX-11M. This sytsem contains approximately 530 rules (roughly 330 rules for the Troubleshooting System and 200 rules for the Help System), partially representing the knowledge of a Senior Field Service Engineer. The inference engine uses a mixed-mode configuration, capable of running in either the forward or backward mode. The Help System can provide the operator with assistance by displaying textual information, CAD diagrams or repair sequences from a video disk. The rules are written in a representation language consisting of nine predicate functions, eight verbs, and five utility functions. The first field-prototype expert system, designated CATS-I (Computer-Aided Troubleshooting System – Version I), was delivered in July 1983 and is currently under field evaluation.

A State Space Approach to Robotics

Daniel Slater

Elicon, Inc. (Brea, CA)

Download PDF (408.1 kB)

Two robotic systems for the filming of motion picture special effects and the measurement of spacecraft antenna performance are described. Both systems are programmed in the Forth language and use a common approach of state space methods to produce a highly modularized and reliable control program. As the robot revolution continues, robots are taking on new and unusual applications. Two new applications discussed in this paper are in the area of motion picture effects filming and spacecraft antenna pattern measurements.

Control of a Cartesian Robot

Judy Franklin, Terri Noyes, Gerry Pocock

University of Massachusetts

Download PDF (381.43 kB)

The work in control applications at the Laboratory for Perceptual Robotics has been directed toward a prototype CartesIan Assembler donated to the laboratory by General Electric of Schenectady, New York. The machine and some of the hardware interfaces are described along with low level controlling schemes for point-to-point position velocity control. An emulation of single axis controllers is shown to be an effective control method. Encoder positional information is the basis of this low-leve control structure, which will later be tailored for use with processors devoted to each axis. High level control issues, such as adaptive learning techniques, are addressed.

A Robotic Application for Contamination Free Assembly

Randy M. Dumse

New Micros, Inc.

Download PDF (1.03 MB)

Rockwell’s Electro Static Gyro Navigation (ESGN) System is built around a one gram beryllium ball that functions as a gyro rotor. It is round within four millionths of an inch and is electrostatically suspended in a cavity with only two thousandths of an inch clearance between the ball and the walls. The presence of a detectable impurity during assembly could cause an electrostatic discharge that would destroy the gyro. Cleaning by conventional methods typically took 25 hours. This paper discusses the mechanical construction and Forth programming of a robot arm that reduced the process to a 17 minute cycle.

Improvement of a Human/Robot Interface Through the Use of Forth

Doug Thompson

International Robomation / Intelligence

Download PDF (591.37 kB)

International Robomation Intelligence (IRI) manufactures a computer-controlled 5-axis robot arm for industrial uses such as machine loading unloading and parts transfer. IRI updated its computer operating system from the present assembly code version to Forth. This paper describes the usage of Forth for man-machine interfaces. User programming is accomplished via IRI’s simple and straight forward on- line Robot Command Language (RCL). Special emphasis will be placed on how Forth has been adapted to the production environment where the end user may have little or no programming experience. The approach taken emphasizes at all times the relationship between human and robot rather than the physical control of the robot itself.

Forth and Automation Research at The National Bureau of Standards

William G. Rippey

U.S. Department of Commerce, National Bureau of Standards

Download PDF (472.4 kB)

The National Bureau of Standards (NBS) is conducting a large research project in industrial automation. Automated control of manufacturing processes will be achieved through extensive use of computers. Some of the individual projects implemented in Forth will be described. Some Forth techniques used on each project will be highlighted.

Dynamic Processing of Analog Data Using an Apple Computer

William H. Caskey

USDA (Morris, MN)

Download PDF (469 kB)

GASCHROMATOGRAPH is a program that supports data acquisition from laboratory instruments using an Apple-ADALAB system with dynamic calculations of areas under the peaks for quantitative analysis. Requirements of the system are: an Apple II computer with 48k RAM, monitor, disk drive, printer, and game controller. Analog to digital conversion of the instrument signal with 13 bits of resolution is accomplished with an ADALAB interface board. The areas calculated by GASCHROMATOGRAPH are shown to be essentially identical to those determined by direct digitization of the area under a peak produced by the tracing on a strip chart recorder. The integration algorithms of GASCHROMATOGRAPH were designed for and are applicable to analysis of samples that are resolved completely by the chromatography system.

Vectored Versions of Forth Compiling Words

N. Solntseif

Unit for Computer Science, McMaster University

Download PDF (112.04 kB)

Technical note on vectoring , and C, for meta-compiling.

JFAR volume 1, issue 2

Implementing Data Structures in FORTH

James Basile

Department of Computer Science, Long Island University

Download PDF (558.95 kB)

This paper focuses on the application of Forth’s extensibility to implementing powerfuL versatile data structures. Use of CREATE … DOES> is briefly explored. Tools are introduced to change the residency of a structure to disk, map memory, vector generic structures, and control multitasking.

Message Passing with Queues

Rosemary C. Leary / Donald P. McClimans

University of Rochester / Inti Electronics Corp.

Download PDF (568.44 kB)

General message passing software for intertask communication has been written in Forth using first-in, first-out queues. These queues can be of any length, and either memory or disk resident. The disk-resident queues may be several blocks long. The width of a queue entry is also arbitrary and can range from a single byte to the queue length. This software was successfully used for intertask communication among the seventeen tasks of the Omega Laser Alignment System.

Vectoring Arrays of Structures

Rieks Joosten, Hans Nieuwenhuyzen

State Universily of Ulrecht Laboratory for Experimental Physics

Download PDF (727.24 kB)

Writing a program module requires the specification of the interface between this and other program modules (or the operating environment). Since modularity implies that you can replace one module by another, a mechanism is needed to switch the definitions (data structures) that make up the program module interface. In this paper, a general way of switching the action of a set of Forth data structures (which can be thought of as a program module interface) is presented.

Multiple Code Field Data Types and Prefix Operators

Klaus Schleisiek

Download PDF (318.06 kB)

This paper presents compilers for creating “intelligent” data types that have more than just one code field, as words in classical Forth do. These compilers introduce a prefix syntax into Forth to create a whole class of data structures, the first of which became known in the Forth community as the ‘TO’ concept in 1979.

A Portable Forth Random Number Generator

William T. Doyle

Physics Department, Dartmouth College

Download PDF (157.54 kB)

A portable high-level Forth random number generator is described. It is based upon Knuth’s FORTRAN function IRN55 and uses the tabular method of Mitchell and Moore. The Forth word and the FORTRAN subroutine yield identical long sequences of random double numbers.

The QUAN Concept Expanded

Tom Dowling

Miller MicrocompUler Services

Download PDF (118.41 kB)

The QUAN (multiple CFA words) was presented by Evan Rosen at the fourth FORML Conference. This concept is very close to the TO concept but moves the selection of an EXECUTE routine from the execution to the compilation phase. The QUAN concept has been implemented in MMSForth V2.2 and extensions have been studied. The use of this type word for data hiding and implementation-independent applications will be investigated. Examples of the use of these concepts in practical situations will be presented. Using QUAN instead of VARIABLE leads to both time and memory savings. The resulting code is also easier to read with the removal of redundant @ and !. Experience with this concept in several projects proves the advisability of including it in the next Forth standard.

A Note on Bitmaps

Howard Goodell, Jr.

Periphonics

Download PDF (88 kB)

Bit maps are an invaluable tool for handling 2-valued data such as disk free block lists and compressed database indices. They reduce index storage space by a factor of 8 over bytes, and can reduce the iterations for searching the indexes by a factor of the word length of the computer.

A Forth Finite State Machine

James Basile

Department of Computer Science, Long Island University

Download PDF (107.17 kB)

Finite state machines arise naturally in many applications and are a versatile, easy to understand structure to organize a control application around.

Multi-Dimension Arrays

James Basile

Department of Computer Science, Long Island University

Download PDF (76.39 kB)

It is easy to write defining words to provide one (or even two) dimension arrays in Forth via CREATE … DOES>. Nonetheless. this leaves one in the position of having to write a new defining word for each size array as well as each data type. The attached code provides a defining word for generalized arrays of any size or type.

JFAR volume 2, issue 1

The R65Fl1 and F68K Single-Chip Forth Computers

Randy M. Dumse

New Micros, Inc.

Download PDF (588.92 kB)

The R65Fll, introduced mid year 1983, was the first commercially available single-chip Forth “engine.” It has remained relatively unchallenged in its market position for over one year. Other single-chip systems are under development. In all probability, near the end of 1984, the F68K will become the second single-chip engine for the Forth language, with an anticipated 20 times execution speed improvement in performance over its predecessor. This paper focuses on the design methodologies used in the development of the R65F11 and the new F68K.

A Forth Machine for the S-100 System

R. C. Grewe and R. D. Dixon

Wright State University

Download PDF (389.44 kB)

A three-board processor that contains a Forth interpreter executing on AMD-2900 bit-slice components, high-speed memory, and hardware stacks, has been designed and built for use in the S-100 bus environment. The Forth system operates independently of the S-100 system processor and memory, and can only be accessed from the bus by ports. The S-100 system processor is free to do I/O and the existing system uses the CP/M operating system to support the operation of the Forth system.

Forth Direct Execution Processors in the Hopkins Ultraviolet Telescope

Ben Ballard

The Johns Hopkins University Applied Physics Laboratory

Download PDF (529.63 kB)

Engineers at the Johns Hopkins University Applied Physics Laboratory have designed and built two computers that will control and monitor the Hopkins Ultraviolet Telescope, a 1986 Space Shuttle experiment. These computers implement a microcoded Forth nucleus in a word-addressed AMD 2900 series bit-slice architecture. All programs for them are written in Forth, which takes the place of assembly language in this architecture.

The Design of a Forth Computer

James C. Vaughan and Robert L. Smith

Palo Alto, California

Download PDF (661.53 kB)

A relatively fast but simple computer architecture is outlined in which the machine language is very closely related to the high-level language Forth. Speed is obtained by the direct implementation of Forth primitives and the parallel operation of a sequencer, arithmetic logical unit, data memory, and stacks. Suggestions are made for certain improvements including the possibility of reducing the computer to VLSI.

QFORTH: A Multitasking Forth Language Processor

Christopher Vickely

Queens College CUNY

Download PDF (498.35 kB)

This paper presents the architecture of a computer designed to execute Forth language programs efficiently in a multitasking, single-user, real-time environment. Issues addressed in the design include a stack mechanism allowing high-speed primitive operations as well as dynamic stack creation and deletion, memory configurations tailored to the different requirements for code and data memories, and processor-controlled rapid context switching in response to interrupts and program events.

polyFORTH on the NCR/32

Michael L. McBride

NCR Microelectronics

Download PDF (256.55 kB)

A very high performance polyFORTH II system implemented on the NCR/32 chip set was presented at the 1984 Rochester Forth Applications Conference. This article will clarify some aspects of the implementation.

Interactive Headerless Code

Jose Betancourt

General Instrument Corp.

Download PDF (50.45 kB)

For certain Forth applications, a few words constitute the user interface, but the underlying supporting words are useful during development. There should be a simple method of creating headerless words or structures, while still maintaining an interactive environment, and without having to resort to complicated metacompilers.

JFAR volume 2, issue 2

Laser Beveling in polyFORTH

Thomas R. Anthony

General Electric Research and Development Center

Download PDF (688.09 kB)

High-power thyristors capable of carrying 1000 amperes and of blocking up to 6500 volts, used for high voltage DC transmission applications, must have their edges beveled to have the lowest possible electric fields at their surfaces to prevent premature surface breakdown in reverse bias. A computer-controlled system has been developed for the General Electric High Voltage DC Transmission Operation in Collingdale, PA, to produce bevels on the edges of their high-power thyristors. The system uses an IBM PC connected to three micromanipulators and a Q-switched laser. Various laser-cutting algorithms coded in polyFORTH have been developed for beveling. Each algorithm requires different processing times and produces different quality bevels in terms of thyristor surface breakdown resistance.

The Use of Forth in the Instruction of Introductory Robotics

Alan J. Cotterman, Daniel M. Willeford, and James E. Brandeberry

Department of Computer Science, Wright State University

Download PDF (522.2 kB)

At the Digital Control and Robotics Laboratory at Wright State University, students use an implementation of Fig-Forth to design a teach mode control program for modified toy robot arms. This program allows the arm to be taught multiple trajectories of up to 100 points (unique arm positions) and then permits repeated execution of these trajectories. The program successfully realizes real-time position monitoring, motion-execution algorithms, management of the trajectory database and features a menu-driven, user-friendly operation. The hardware environment consists of the host PDP-11/34 minicomputer operating under RSX-11, and four LSI-11 microprocessor workstations. TASK4TH, a standalone derivative of Fig-Forth, is down-line loaded from the host into the workstation and is capable of supporting peripheral equipment which includes serial and parallel I/O and also analog-to-digital and digital-to-analog conversion. Toy robot arms with five degrees of freedom are connected to the workstations and have been modified to operate under computer control. Position detection is accomplished through analog-to-digital conversions on the outputs of Hall-effect sensors (mounted on the axes of rotation) and arm motion is accomplished by actuating solenoids via the parallel port.

An Intelligent Forth-Based Robotic Vehicle

Steven J. Formisani / Stuart D. Asakawa / Allan K. Ronne / Maged G. Tomeh

AT&T Bell Laboratories / Hewlett-Packard / Watkins-Johnson / Harvard Business School

Download PDF (871.01 kB)

A Forth-based robotic parts delivery system was developed at Stanford University as a joint masters project. An electric personnel carrier was modified to follow a tape track from workstation to workstation, where it would stop for a preprogrammed period of time. Closed loop feedback systems were implemented to control vehicle guidance and speed, and an ultrasonic sensor was used for obstacle avoidance. The vehicle recognized thin metal plates on the floor, enabling it to be taught to wait at a workstation or change the obstacle detection range.

Kitt Peak Multi-Tasking Forth-11

Thomas E. McGuire

Health Systems International

Download PDF (453.38 kB)

An overview of the Kitt Peak National Observatory (KPNO) real-time environment is presented. The eleven optical telescopes at Kitt Peak employ a variety of experimental instruments, including Fourier Transform Spectrometers and large array digital cameras, that impose a diverse set of real-time requirements. Presented next will be a historical perspective of Forth and KPNO over the last decade outlining the evolution of the embryonic version of Forth on an 8k mainframe (CDC), mini (Digital VAX-11 and PDP-11), and micro (Digital LSI-11) machines. The real-time attributes of Forth in general and KPNO multi-tasking Forth-11 in particular are discussed. Some details of the implementation of Forth-11 are presented to reveal the power of this real-time programming environment. Finally, the KPNO CCD camera system will be used to illustrate a complex real-time application of multi-tasking Forth-11.

Separate Headers

Siem Korteweg, Hans Nieuwenhuijzen

Download PDF (183.69 kB)

In classical Forth, code is generated linearly in memory, and consists of appropriate, interwoven header and object code structures. To improve the memory usage characteristics of this classical dictionary structure, we have separated the headers from their associated object code to implement new header structures, supporting the removal of headers from memory when they are no longer required.

Identifiers

Siem Korteweg, Hans Nieuwenhuijzen

Download PDF (130.85 kB)

This paper formalizes the use of identifiers for the identification of dictionary entries.

JFAR volume 2, issue 3

Forth Meets Smalltalk

Charles B. Duff and Norman D. Iverson

Kriya Systems, Inc.

Download PDF (924.13 kB)

Forth has certain inadequacies that limit its use as a general-purpose production language, particularly for building large applications. The object-oriented approach of Smalltalk-80 is used as a model for extending the Forth compiler to create a hybrid language. The resulting system permits definition of classes and objects in the manner of Smalltalk-80, and can be fully intermixed with standard Forth.

Stack Usage and Parameter Passing

Siem Korteweg, Hans Nieuwenhuyzen

Download PDF (809.56 kB)

Routines can use the arithmetic stack for parameter passing and for temporary storage. This paper describes a mechanism that formalizes stack usage by providing each routine with an “activation record”-like data structure, cf. Pascal. This data structure, consisting of a storage space and an arithmetic stack, provides an interface between routines and the arithmetic stack. The interface allows the flow of all possible data to and from routines, and offers extreme clarity of source code. The described implementation increases the execution time and the amount of generated object code by 10-30%.

Number Crunching with 8087 FQUANs: The Mie Equations

Ferren MacIntyre

University of Rhode Island

Download PDF (511.65 kB)

By long-standing tradition, Forth uses scaled-integer arithmetic in preference to floating-point operations, both because of its origin in the integer-rich world of process control and because of the inefficiencies of floating-point operations. However, scaling requires advance information on magnitudes, which is not always easily available in scientific calculations. In addition, the appearance of the 8087 numerical coprocessor has removed the stigma of inefficiency, and we have reached the point anticipated by Charles Moore, at which it becomes preferable to use floating-point operations. Taking the IBM PC BIOS software single-precision routines as baseline for the heavily numerical Mie equations, the 8087 is 115 times faster. Precision increased from one significant figure with BIOS (round-off error dominates in the recursive claculations) to agreement with published 6-figure values with the 8087. Because stack operations are fast on the 8087, while 8-byte stores and fetches are relatively slow, it pays to keep operands on the 80-bit-wide, 8-word- deep 8087 stack. It is, for instance, possible to replace two complex numbers with their sum and difference, without leaving the stack. The net result is a Mie-equation algorithm that produces a result in 15 minutes, compared to the 24-hour turnaround for a one-second CRAY-1 background run.

A Forth Profile Management System

John Michaloski

National Bureau of Standards

Download PDF (557.66 kB)

A Profile Management (PM) system for source code control has been developed, which partitions source blocks. Profiles refer to sections of code which can be loaded by name, and whose status can be accessed through PM. Profiles can be subdivided, and a query language allows the user to create conventional load blocks from them. All profile information is embedded as commenting structures. The package occupies approximately 3k of memory with 35 source blocks, and has been effectively used to manage an application with over 4 megabytes of source code.

Patching the ONLY Structure on Top of Fig-Forth

Man Char Ko and Scott Jenson

Ascent Inc.

Download PDF (125.5 kB)

The ONLY structure is by far the most powerful enhancement made to the Forth-83 standard. It expands the power of the vocabulary structure to become a truly useful software development tool. Dictionary searches can be limited to search only a group of five words if you so desire. This allows for much more modular programming, vocabularies becoming akin to procedures in Pascal. Scoping can be limited very easily as well, so local and global variables can have the same names.

A Group Construct for Field Words

Charles B. Duff

Kriya Systems, Inc.

Download PDF (130.98 kB)

Glen Haydon’s very useful field definition words are made more useful with the addition of a GROUP construct that allows the aggregation of several fields into a repeating group. This accommodates situations in which a record definition contains an array or more complex indexed structure that should be accessed symbolically.

JFAR volume 3, issue 1

Forth-Based Software for Real-Time Control of a Mechanically Scanned Ultrasonic Imaging System

E. T. Lynkt and H.E. Johnson, Jr.

General Electric, Corporate Research and Development

Download PDF (8.06 MB)

CenterForth was used as the control software for an ultrasonic imaging system developed at GE/CRD. The system is an “Ultrasonic Macroscope” and is used in industrial “Nondestructive Evaluation” applications. It forms an image by mechanically moving an ultra-sound beam over the surface of the material under test. The beam is tightly focused at a constant depth below the surface to reveal flaw locations within the sub-surface slice. Image acquisition and display functions are performed by two Direct-Memory-Access controllers, using extended memory. Data input, output, and computation all take place concurrently. The system is fully interrupt-driven to free the 11/23 bus for DMA transfers (word transfer rates on the order of tens of KHz).

The application software (which runs on an enhanced fig-Forth-derived kernel) models the imaging system as a cyclic, sequential finite state machine. A state variable is derived from the image line-counter and governs the operations that the CPU must perform. Through the use of interrupts and flags, the output process (which synchronizes the entire operation) functions as if it were driven by an independent processor.

Routines were written to permit high-level access to extended memory and high-level interrupt handlers. Software debugging was facilitated by a “snapshot” routine which captured the “state” of the system. It provided a post-mortem display/dump of the sequence of events, state of flags, variables, etc., at the time each snapshot was taken.

This application was particularly well suited to Forth. Because of the heavy bus usage anticipated at high scan speeds, stand-alone operation is mandatory, regardless of the software environment.

Fast and Flexible Forth Programming in a Femtosecond Laser Lab

Theodore Sizer II

Laboratory for Laser Energetics, University of Rochester

Download PDF (5.96 MB)

A software system has been developed in Forth to manipulate, control, acquire, and display experiments which are performed in a femtosecond dye laser laboratory. Requirements placed on the system are that it be user friendly while maintaining both flexibility and speed. The use of vectored execution allows one to satisfy these two requirements while keeping the number of user addressable words to a minimum. This system is currently in use measuring both optical and electrical transients in the terahertz frequency regime. Techniques that are used to control and display the experiments will be explained along with some typical results that this system gives the experimenter.

Stack Frames and Local Variables

George B. Lyons

Download PDF (5.37 MB)

The stack frame technique for dynamic local variable storage in Algol and descendant languages may be adopted in Forth to expand the number of elements easily handJed directly on the stack, reducing the need for variables. The required extensions to Forth can preserve the interactive quality of Forth by using the parameter stack exclusively and by using a built-in set of local variable names rather than an argument list compiler. Special techniques such as wildcard names, code pointer arrays, and modifications of TO can reduce the overhead involved.

Should VARIABLE be an Immediate State-sensitive Word?

Steven M. Lewis

Department of Bioengineering, University of Southern California

Download PDF (3.35 MB)

We present an alternative to the word VARIABLE. In the absence of special modifiers, the word returns the contents. Previous use of modifiers allow the word to store or otherwise modify its contents. Unlike previous implementations the word is immediate and modifiers act at compile time allowing run time performance equivalent or superior to that seen with @ and !. The extension of this concept to arrays is also presented.

Readable and Efficient Parameter Access Via Argument Records

Bill Stoddart

Department of Computer Science, Teeside Polytechnic

Download PDF (8.12 MB)

An Argument Record allows the input parameters and local variables of a high level Forth definition to be accessed by name. Method selection prefixes such as T then become widely applicable, allowing closer action object binding and reducing the proliferation of dictionary words as new data types such as floating point numbers and matrices are introduced. Such enhancements are of particular interest because they can be freely intermixed with classical Forth. Standard Forth techniques for describing compiler extensions prove to be an ideal tool for implementing these enhancements. A package that requires just 1200 bytes of dictionary space is sufficient to provide a wide range of facilities, and produces efficient re-entrant code.

Run-Time Error Handling in Forth Using SETJMP and LNGJMP for Execution Control

Robert J. Paul, Jay S. Friedland, Jeremy E. Sagan

Turning Point Software, Inc.

Download PDF (1.32 MB)

This paper discusses and provides two Forth implementations of the SETJMP/LNGJMP concept for error handling in applications which have words nested many layers deep. SETJMP and LNGJMP may be familiar to programmers who have worked with UNIX/C environments. A SETJMP is paired with a LNGJMP, which when executed later, will return control to the code following the SETJMP. passing an appropriate value on the stack. In essence, this creates the equivalent of the GOTO statement in Forth. In most Forth applications a word at each level returns an error or success code which is processed before continuing. The use of SET JMP!LNGJMP eliminates the nesting of IF … ELSE … THEN or BEGIN … UNTIL statements by transferring control to a level where all error conditions may be handled. SETJMP and LNGJMP may be nested to handle local as well as global situations. These constructs reduce code overhead and produce code which is easier to follow. SETJMP and LNGJMP are ideal programming constructs for error handling since they allow control flow to be optimized.

JFAR volume 3, issue 2

The MAGIC/L Programming Language

Arnold Epstein, Qaire H. Gilliatt

Download PDF (4.73 MB)

When Forth was created in the early 1970s, it represented a major change in the way programmers could think about their machines and the programming process. It allowed fully interactive coding and provided for almost unlimited extension of the environment. This has undoubtedly been an important breakthrough. However, there are a number of characteristics of Forth which can be problematic, especially where group productivity is concerned. Among these are its reverse polish notation and the tendency towards highly dialectical programming. MAGICIL, developed by Loki Engineering, Inc., combines the fundamental advantages of Forth with a stable syntactical structure and a full set of programming constructs, increasing efficiency in programming and project management.

Expanding the Forth Dictionary Beyond the 64k Limit by Using Bodiless Code

Robert Boni

Kodak Research Labs

Download PDF (1.23 MB)

At the Kodak Research Labs (KRL), experimental test beds are controlled from Forth. The most complex test beds require a Forth system with a dictionary larger than 64 kilobytes of memory will allow. An existing Forth system, modified to produce bodiless code, now supports a dictionary of several megabytes. These modifications, which generate the bodiless code, provide a method to increase the dictionary space of a Forth system running on a computer with memory management capabilities.

Improving the Understandability of Forth Code

John Bowling

Starlight Forth Systems

Download PDF (1.44 MB)

One of the most often vocalized complaints about Forth is that it is unreadable, and therefore unmanagable because no one but the original author understands it. An example of this is metacompiling, one of the least understood and most complex functions in Forth.

A Window System

Mitch Bradley

Download PDF (1.55 MB)

This simple window system can be used with most ASCII terminals. Arbitrary rectangular regions of the screen may be defined as windows. Output directed to a window will be confined to that region of the screen. By assigning a different window to each task, tasks may conveniently share the screen without worrying about each other. The system also manages access to the keyboard so that multiple tasks may simultaneously request input without confusion.

An Alternate Forth Dictionary Structure

James C. Brakefield

Technology Incorporated, Life Sciences Division

Download PDF (1.61 MB)

The data structures used for definitions and the word search of Forth can facilitate various utilizations of the same. My goal is completeness and efficiency. Constants or literals are stored separately so they can be hashed. The concept of a constant is enlarged so that the code string is a constant in the same sense as a text string. A constant is something that is self identifying and unchanging at the textual level. A colon definition is then a palrlng of a code string with a name. Only pointers to the two “constants” are kept in the definition entry (a pointer to the name string and a pointer to the code string). The various constant and definition records are implemented with tagged fields. This allows inspection of the entire record by any routine possessing a pointer into any field of the record. Additional optional fields are: Reference count, Comment pointer, Input type list pointer, Result type list pointer.

Conversion of a Token-Threaded Language to an Address-Threaded Language

Bob Buege

RTL Programming Aids

Download PDF (1.46 MB)

After becoming spoiled by almost four years of experience with a token-threaded language, I find it difficult to imagine ever going back to an address-threaded language. Token threading gives me the flexibility of a metacompiler without the complexity. All code is relocatable. I can modify or delete words at the beginning of the dictionary without recompiling. I can eliminate the words not needed for an application before burning the application in ROM, and because garbage collection becomes a trivial problem, I can even eliminate the need for screens by decompiling object code and doing all my editing from RAM. Many of the tools I have come to depend on would be difficult or impossible to adapt to an address-threaded language. However, address-threaded languages do have a speed advantage over token-threaded languages for most applications. A compromise has been achieved that allows me to do all my development work in a token-threaded language and then use self-modifying code to convert the language into an address-threaded language for increased speed when the project is completed.

A Direct-Threaded Code TTL Control Unit

Jack Calderon

Download PDF (331.42 kB)

A hardware design for a control unit is presented, which utilizes TTL logic and fast CMOS Static RAM to implement a very fast version of DTC. The control unit is capable of sequencing the operations required for NEXT in one memory cycle and for DOCOL and SEMI in two memory cycles. A prototype of the control unit is currently being tested for performance evaluation.

A Forth-Based Object File Format and Relocating Loader used to Bootstrap Portable Standard LISP

Harold Carr, Robert R. Kessler

Department of Computer Science, University of Utah

Download PDF (1.64 MB)

For a quarter of a century, much Artificial Intelligence research has been accomplished using Lisp as the implementation language. Portable Standard Lisp (PSL) was created to support research activities on a wide variety of processors and operating systems. To aid in porting PSL, we developed an ASCII object file format whose relocation directives are essentially Forth language statements. A Portable Linker is then used to directly link compiled Lisp code normally dependent on the Lisp runtime system. Finally, since the object file contains Forth statements to handle final relocation of segments, we wrote a relocating loader in Forth to load and execute these “exported” Lisp programs. The PSL runtime system is ported by processing it with this system as just another exported program. This paper discusses the Forth-based object file format (which is general enough to handle other languages besides Lisp) and the Forth-based relocating loader.

A Multiprocessing Computer System Composed of Loosely Coupled Forth Micro-chip Modules

Gabriel Castelino, Richard Haskell

School of Engineering & Computer Science, Oakland University

Download PDF (1.58 MB)

A Multiprocessing Computer System consisting of loosely-coupled Forth micro-chip modules is currently being developed at the School of Engineering and Computer Science at Oakland University. A network of 16 modules has been designed. The modules do not share any common memory and communicate with each other over a global bus — an 8-bit parallel bus with seven control lines. The system uses a layered protocol structured on the OSI Reference Model. The network is designed to support different types of micro chips operating at different speeds. The software support at the physical and data-link layers will have to be modified for the different types of micro-chip modules. In such a system, it would be desirable for one module to execute a word that has been defined in another module in the system. This is referred to as a Remote Procedure Call (RPC). In the system being developed, calls of this type are handled by the RPC layer which sits above the Data-link layer of the OSI model. The Forth words defined at this level are independent of the type of micro-chip being used.

A Microcoded Machine Simulator and Microcode Assembler in a Forth Environment

A. Cotterman, R. Grewe, R.D. Dixon

Department of Computer Science, Wright State University

Download PDF (443.03 kB)

A Forth program that provides a design tool for systems containing a microcoded component was implemented and used in a computer architecture laboratory. The declaration of standard components such as registers, ALUs, busses, memories, and the connections is required. A sequencer and timing signals are implicit in the implementation. The microcode is written in a Forth-like language which can be executed directly as a simulation or interpreted to produce a fixed horizontal microcode bit pattern for generating ROMs.

A Micro-Based ASW Trainer in Forth

Robert H. Davis

Download PDF (1.99 MB)

The author’s group at the Naval Surface Weapon Center is engaged in the development of a low cost desktop trainer for NAVY ASW Acoustic Sensor Station Operators. Each device is based on a Zenith 150 microcomputer, with the software being developed using ROHDA-Forth, the author’s personal implementation of the Forth language. Brief descriptions of the system being simulated and the Forth-based simulation are given. The paper then focuses on the productivity aspects of using Forth in the development effort. Particular areas discussed are the value of very high level coding (using the ROHDA-Forth Data Structures and Symbolic Function compilers) to expedite development of all coding for an initial pass, and use of trace facilities to achieve extremely rapid code development. Selected examples of coding from the project will be used to illustrate the use of the high level programming constructs and the trace facilities used in the software development.

Forth as the Basis for an Integrated Operations Environment for a Space Shuttle Scientific Experiment

Henry M. Harris, Mission Design and Operations Manager SIR-B

Jet Propulsion Laboratory/California Institute of Technology

Download PDF (4.91 MB)

Over a period of three years, a Forth-based system was developed by JPL for the operations of a major scientific instrument onboard the Space Shuttle. The software had to meet a very demanding operations environment where the the interactiveness of the software was not merely desirable but essential to the success of the mission. Forth was chosen for its capability of integrating divergent software needs into an interactive package. The mission flown in October 1984 was beset with numerous hardware failures and challanged the capability of the system to its fullest.

A Machine to Implement a Generalized Forth Environment

R. Dixon, R. Grewe, T. Rocheleau, A. Cotterman

Department of Computer Science, Wright State University

Download PDF (395.3 kB)

A microcoded design of a machine to implement a 32-bit Forth has been simulated. The addressing is segmented so that storage allocation and deallocation is quite general. Garbage collection and compacting of memory are supported. The design of the instruction set is in the spirit of the RISC (Reduced Instruction Set) machines, allowing stack operations and indexed access directly into the stack to produce a frame or register-like environment.

Forth Implementation of the Heap Data Structure

W. B. Dress

Instrumentation and Controls Oivision, Oak Ridge National Laboratory

Download PDF (1.84 MB)

The use of the heap for memory management provides the Forth programmer with a versatile tool. Its use speeds program development at the conceptual level by allowing the program designer a means to consider dynamic arrays, garbage collection, and overlays; and at the implementation stage by providing a framework for easy manipulation of data structures.

Real-Time State Machine Implementation Programming Techniques

Randy M. Dumse

New Micros, Inc.

Download PDF (412.73 kB)

Experienced system designers readily admit that state diagrams are more useful in describing real-time automina than flowcharts. This is particularly true during the system definitions, when the actions of the machine are described in terms of the inputs and outputs and time conditioned responses. These same designers would be hard pressed to name even one source describing any method for generate programs from state diagrams. State diagrams have historically been the tools of the hardware designer, which may explain why published materials on conversion methods from state diagrams to computer programs (flow chart, pseudo-eode or high level language routine) are not widely available. This paper will attempt to identify why high level language programmers have lined up behind the flow chart (or pseudo-eode equivalent) and left state diagrams to hardware engineers and a few stubborn assembly language programmers. h will also explain at least one version of the rules used to design using state diagrams, and how to program from these drawings.

A Forth-Based Iconic Interface

M. Erradi, C. Frasson

Département d’Informatique et Recherche Operationnelle, University of Montreal

Download PDF (1.52 MB)

This paper highlights the power of MacForth as a high-performance interactive programming environment for the Macintoch Computer, in developing an interactive interface for integrated databases. We present the main specfications and some implemented commands of a command language based on icons. Objects to be manipulated are represented by icons. Properties are attached to each object and are also represented by icons.

Interactive Videodisc Control and Computer-Based Training on the Apple Macintosh

Nick Francesco

JAM, Inc.

Download PDF (1.6 MB)

This paper presents the use of a microcomputer to control the action of the videodisc player. This has the great advantage of allowing an instructional designer to create a complete course for the student, with remediation and branching, that can either be run by the instructor in a classroom setting, or by the individual student at his or her own pace.

The Design of a Low-Cost CAD/CAM System

D. French, B. Hughes

Dept. of Mechanical Engineering, University of Waterloo

Download PDF (1.52 MB)

There are a number of CAD/CAM systems available to Industry today, ranging in cost from approximately $25,000 to $300,000. These systems vary greatly in the hardware and software facilities which they offer to the potential user. The small companies that make up the majority of the manufacturing industry cannot, in general, afford the highly sophisticated systems. In many of these companies, the need to carry out complex analyses is not necessary. However unless the small company has access to this new technology at a reasonable cost, it will be unable to manufacture its products on a competitive basis.

Microcomputer Control of a Machine Tool

D. French, R. Rier, B. Hughes

Dept. of Mechanical Engineering, University of Waterloo

Download PDF (1.63 MB)

The requirement of a low cost Controller for Machine Tools, which could perform similar functions to more expensive systems, is necessary if small companies are to be able to use sophisticated techniques for manufacture. At the University of Waterloo, in the Department Engineering, a number of systems have been designed. varied both in the hardware, and software used.

DEBUGGER: The Design of a Test Aid to Support the Development of an Embedded Computer System

Harvey Glass

University of South Florida

Download PDF (480.29 kB)

This paper describes the design of a Forth-based debugging aid that has proven useful in the development of a sophisticated real-time microprocessor based controller. The controller provides an interface between a militarized intelligent terminal, an auxiliary bubble memory, and a local area network. The computer programs supporting the controller operate in an interrupt-driven multi-tasking environment. The test support facility was implemented to assist in identifying and correcting programming errors in the controller software. We will discuss our experiences in the design of this tool and how it provides a programmer with a means of gaining visibility into the product under development.

Local Variables

John R. Hart, John Perona

HARTRONIX Inc.

Download PDF (1.28 MB)

There are some cases where the number of variables inside a procedure exceed the maximum that can be easily accessed with simple stack operators. Local variables are proposed to free programs from stack thrashing and spaghetti-like manipulation that can occur in programs with a large number of stack variables.

Forth Automates Intrinsic Viscosity Determinations

D. J. Hooley

Standard Oil Co.

Download PDF (463.38 kB)

An automated system for determination of the intrinsic viscosity of polymer samples has been implemented in the Analytical Laboratory at SOHIO (Standard Oil of Ohio).

HFORTH: A High-Level Business Language in Forth

Pierre Moreton

Download PDF (3.23 MB)

This paper presents some features of HFORTH, a high-level business language written in Forth, some recent applications, and the extension to THE ROBOT, a menu-driven program generator.

System Development Via Prototyping in the Analytical Laboratory

D. J. Hooley

Standard Oil Co.

Download PDF (414.84 kB)

In the appropriate situation, the prototyping approach to system development offers lower risks to the software development manager than the traditional structured approach because it is more likely to produce a system meeting clients’ needs. l The iterative process of prototyping will be examined using the system for determination of intrinsic viscosity of ploymers, implemented in the Analytical Laboratory at SOHIO (Standard Oil of Ohio), as an example.

What’s Wrong With Forth?

John S. James

CommuniTree Group

Download PDF (1.36 MB)

Forth offers unusual control over the entire hardware and software environment, allowing design efficiencies far more important than its speed and memory performance. But some traditional coding practices have used this flexibility in ways which impede the development and maintenance of large software projects. And easy access to system facilities has too often allowed vendors to get away without providing complete application support for any particular purpose. The keys to improvement are modular software design, information hiding, and closure. We will have succeeded when programmers can join a project, then quickly come up to speed and contribute within a single section of a complex system.

Meta-Compilation System

Rieks Joosten

Pijnenburg Software Development B.V.

Download PDF (316.18 kB)

An overview is given of concerns and techniques leading to the creation of a generalized meta-Forth system. Analysis shows that the meta process can best be controlled by a number of states in distinct environments. An integrated administration tool adds to the flexibility of the system.

Some Problems in Implementations of tbe Forth Standards

Mahlon G. Kelly, Nicholas Spies

Download PDF (2.2 MB)

There have been many complaints about the Forth standards. These have been both from users and from those responsible for implementing the standards in commercial Forths. Complaints have even appeared in letters in major magazines, and have included such adjectives as “unuseable”. But the reasons for the complaints have been, in large part, unfocused. Many users’ complaints seem to stem from a wish that standard Forth “did more”, which reveals a misunderstanding of the purpose of the standards: to provide a minimal word set so as to allow writing of portable code (although one may argue what “minimal” means — for example standard floating-point words were called for even before Forth-79 was formulated). Perhaps a more basic user’s complaint is that small changes in Forth-83 (e.g. redefinition of ‘ and the termination of LOOP ) make it difficult to translate code and can lead to subtle bugs (e.g. with floored division) if the differences are not understood. The failure of the Forth-83 standard document to explicitly spell out differences aggravates this problem.

A Tokenized Rule Processing System

Steven M. Lewis and Mike Fisher

USC Department of Bioengineering and Danforth Corporation

Download PDF (396.55 kB)

In examining rule processing in LISP we were struck with the crudeness with which text was treated. We have developed a rule processor in Forth in which the rules are strings of Forth words. Undefined words are automatically entered into a text vocabulary. As unknown words are entered into the vocabulary they are tested for the presence of special characters and English constructs such as ending with s. Words with appropriate construction are designated as one of 255 special classes. Clauses are compared on a word by word basis, each word being tested not only for equality but for synonyms. The processor will automatically equate regular plural and singular words and expand regular possessive forms. Special words allow rules to remember indeterminate antecedents and retain them during the testing of a rule. Articles and similar words are included in the clauses but not tested in matching clauses. Incorporating the syntactic processor into an available inference machine (Park, Mountain View Press) gives a flexible powerful knowledge system.

Concrete Suggestions for a Forth Floating-Point Standard

Ferren Macintyre

University of Rhode Island, Center for Atmospheric-Chemistry Studies

Download PDF (446.19 kB)

Many serious programmers dismiss Forth as unsuitable for professional work because it lacks standard floating-point (FP) Capability. Proposed here is a word set based upon two years of intensive use of the MMSForth words (including FQUANs and “long-addressed” variants) with the 8087 numerical coprocessor, with input from several other approaches. Most operations are the familiar Forth words preceded by an F, or a C for complex arithmetic. Short words are strongly preferred because of the natural length of FP definitions.

Plotter Drivers as an Exercise in Forth Wordset Design

A. Richard Miller, Thomas B. Dowling

Miller Microcomputer Services

Download PDF (480.97 kB)

Three levels of driver design are discussed for a typical X-Y plotter. A minimum driver merely permits Forth to mimic the plotter’s internal BASIC command set. A more elegant one transforms the same commands into a more Forth-like and more English-like word set. Finally, the command set is modified and vectored into the existing MMSForth TGRAPH (Turtle Graphics) utility. This transforms the plotter into an optional video screen to which one can output TGRAPH graphics routines without any modification. Demonstra tions will be given using the inexpensive Radio Shack FP-215 Flatbed Plotter. Source code for a simple Forth implementation is included, and can be adapted to many similar plotters

Forth in the Computer Numerical Control Environment

John Mullen

Iowa State University, Department of Industrial Engineering

Download PDF (452.75 kB)

In order to help students grasp the concepts of computer-aided manufacture, a small Computer Numerical Control (CNC) workstation was built. It consists of a microcomputer, a vertical mill, a plotter, a printer and necessary interface electronics. The workstation may be controlled by means of either a Forth-based control language or a CNC language closely following the standards of EIA RS-358-B. Although the capacity of the mill is small and the resolution of the system is not consistent with industry standards, the workstation provides students with the desired experiences and also serves as a physical demonstration of the potential of Forth.

Under the Hood of a Superchip: The NOVIX Forth Engine

Charles H. Moore, Robert W. Murphy

Download PDF (1.47 MB)

The NC4000P is a single-chip Forth Engine based upon minimum hardware concepts developed by Charles H. Moore. This highly parallel machine architecture directly executes Forth primitives in a single clock cycle. The initial implementation of this device is based upon a 4000 gate CMOS semicustom integrated circuit operating at an 8 MHz clock rate.

Forth for a Multimicroprocessor Control System

C. A. Myerholtz, A. J. Schubert, M. J. Kristo, and C. G. Enke

Michigan State University, Department of Chemistry

Download PDF (1.69 MB)

In our laboratory, a triple quadrupole mass spectrometer (TQMS) has been placed under complete computer control. A distributed processing system of several microcomputers were required to control the more than 30 instrumental parameters, acquire data and perform peak finding in real time. The software for this system was based on a standard Forth operating system.

Fifteen Programmers, 400 Computers, 36,000 sensors, and Forth

Elizabeth D. Rather

FORTH, Inc.

Download PDF (12.06 MB)

A large, recently completed Middle East Airport featured in its design a powerful, integrated computer system incorporating security and access control, fire and life safety monitoring, environmental monitoring and control, power distribution, fuel farm monitoring, water distribution, control of runway lights, and numerous related applications. The system is being supplied by Avco Corp., and is programmed in Forth by a team of programmers from FORTH, Inc. and Avco. This paper discusses some technical and management highlights from this experience.

A Versatile Software Control System For A Triple Quadrupole Mass Spectrometer

C. A. Myerholtz, A. J. Schubert, M. J. Kristo and C. G. Enke

Michigan State University, Department of Chemistry

Download PDF (1.68 MB)

The complete computerization of a triple quadrupole mass spectrometer (TQMS) in our laboratory has been accomplished by a software control system that allows the operator to conveniently and flexibly control the instrument’s 30 parameters and 5 different scan modes. Forth has allowed us to create such a system by allowing the system programmers to tailor-make a command syntax specific to our application, while still allowing access to the Forth kernel and application primitives.

BASIC on Forth

Hans Nieuwenhuyzen, Harm Bramms

University of Utrecht

Download PDF (294.49 kB)

Design is discussed of an implementation of the BASIC language on Forth. The program is changed to one long Forth executable statement. The data is separate from the program.

Implementing Forth for the Multics Operating System

Michael A. Pandolf

Honeywell Information Systems

Download PDF (1.92 MB)

Like many tools and subsystems on Multics, Forth resulted from a wish of one of its users (in this instance one of its developers) to add to Multics’s range of computation. After a period of development and some local exposure, such spontaneously generated software enters a stage of peer review and wider exposure that enables it to be considered for product review. Currently, a version of Forth that follows the design as described in the “fig-FORTH INSTALLATION MANUAL” by the FORTH INTEREST GROUP is in the local exposure state at MDC/CISL and is not yet scheduled for peer or product review.

A Process Monitor

Hemant S. Patel

E. I. duPont deNemours & Co.

Download PDF (441.97 kB)

This paper discusses a Forth implementation for monitoring, control and optimization of a medium-sized chemical process. The 68000 based program routinely collects on-line field data, performs absolute and deviation limit checks and stores data on a hard disk for future retrieval in graphic or tabular form. Routines for lab analysis and product quality management via CUSUM technique are provided. Both field and lab data are used to optimize conversions and yields. To quickly isolate and respond to plant upsets, field variables are organized and displayed as trend charts in groups containing up to eight variables. A top-down tree structure is used so that each variable in a group above is casually related to another group below. Forth screens are utilized as fill-in shells for customer reports and help files.

Object Oriented Extensions to Forth

Richard Pountain

Download PDF (379.32 kB)

The paper describes two iterations in the evolution of a set of object oriented extensions to Forth-79, based loosely on the syntax and semantics of Smalltalk-80. The initial inspiration for the project was a desire to create a structured data facility in Forth, equivalent to records in Pascal (as an illustration for a book chapter on Data Structures in Forth).

State Sequence Handlers

Edward B. Rawson

Rawson Engineerin

Download PDF (454.37 kB)

We describe a new type of sequence control structure which allows an ordinary: word to behave as a small state machine. The control structures may be freely mixed with BEGIN, UNTIL, etc., and with IF, ELSE, and THEN, with conventional nesting restrictions. The new structures include analogs of BEGIN, UNTIL, etc., as well as several other words which support terse, readable, state machine code.

From Bubble to Quick: A Forth Comparison of Sorting Algorithms

John Rible

Miller Microcomputer Services

Download PDF (326.05 kB)

This paper compares generalized implementations of half a dozen sort algorithms in Forth. Examples of sorting integers and strings are used to illustrate the different methods. Even the faster sorts are coded compactly in Forth. The sorting algorithms take ite m numbers as arguments, allowing users to define their own EXCHANGE and COMPARE words. Informal guidelines are given for choosing an appropriate algorithm for your application.

Combining Forth and the Rest of the Computer World; Dynamic Loading of Subroutines Written in Other Languages and Their Use as Forth Words

William L. Sebok

Princeton University, Dept. of Astrophysics

Download PDF (1.76 MB)

Dynamic subroutine loading has been added to the local VAX implementation of Forth-79 that runs under the Berkeley dialect of Unix (so called “Princeton Forth”). This paper is about the semantics of how this might be specified and a sketch of how it was implemented here. Also mentioned are some of the problems that must be faced.

The Reed for a Standard Test Suite

Nicholas Spies, Mahlon G. Kelly

Download PDF (1.4 MB)

A test suite is a set of programs used to assure that a compiler or programming language meets explicit specifications. A standard Forth test suite would bring many advantages to the Forth community. Ambiguities in the language of the standard would be resolved through example. Both users and system-authors would have a convenient way to confirm that their dialects meet standard requirements. And most importantly, dialects that could run the standard test suite successfully would be virtually assured of being code-compatible. In short, we feel that a standard test suite is a necessary step in the evolution of an effective Forth standard.

Forth in a Muon Channel with CAMAC Control

Robbie Spruit

University of British Columbia, TriumF Cyclotron Laboratory

Download PDF (348.69 kB)

Control and diagnostic software was developed for M15, a recently commissioned surface muon channel at TriumF. Logistics gave rise to several efforts in several programming languages. This paper describes the Forth diagnostic package, and the choices of languages is briefly discussed. Several extensions to the Forth language, and the way they were put to use, are shown in the framework of a detailed account of the software implementation. The emphasis is on the production of readable code and on the design of constructs that most closely model the structure of the application.

Pragmatic VLSI Design Environment (PRIDE)

Thomas Almy

Tektronix, Inc.

Download PDF (1.72 MB)

This report consists of the overview of the VLSI design environment created in Forth. The PRIDE program has been run on computers ranging in size from a TRS-80 Model I to a VAX-ll/780 and has been used for the design of over 10 ICs.

NAPLPS Decoding in Forth

Dr. Billie Goldstein Stevens

CBS Technology Center

Download PDF (1.94 MB)

The North American Presentation Level Protocol Syntax (NAPLPS) is a standard for encoding both textual and graphic information for videotex. Given a personal computer with hardware (either built in or added on) that can produce a display conforming to the standard, the actual decoding of NAPLPS-encoded data can be done in software. Such software decoder. have been written both experimentally and as commercial product. (primarily in Canada, where consumer videotex is more prevalent than in the U.S.). NAPLPS decoding is similar to recursive descent par.ing, but NAPLPS code does not always have the clean structure of a context-free language. There are awkward jumps and unexpected escapes possible. Forth lends itself readily to the task of NAPLPS decoding, gracefully handling both the straightforward parsing and the sudden shifts. An experimental NAPLPS decoder in Forth has been developed at the CBS Technology Center. We briefly describe the NAPLPS coding techniques, then explain the design and implementation of the decoder. The suitability of Forth for this task is illustrated and emphasized.

Controlling an Integrated Automatic Parameter Characterization System with Forth

Jonathan Sun, Barry Mason

GTE Communication Systems

Download PDF (1.75 MB)

An integrated automatic parametric characterization system for semiconductors has been developed in GTE COMMUNICATION SYSTEMS. The system consists of an automatic testing and measuring system, a database, and extraction algorithms for device parameter. This paper describes an automated system that fulfills these modeling tasks for existant and future technologies. The architecture of this system, the operation of the software, and a brief description of design methodology based upon Forth and the tradeoffs between Forth and BASIC for this application are discussed.

REvised REcursive AND? ‘REPTIL :IS

Israel Urieli

Ohio University

Download PDF (1.28 MB)

REPTIL represents an attempt to present a Forth-like language as a viable, pedagogically sound, alternative language for student programming at all levels. Since its initial presentation in 1984, it has been totally revised and is currently being rewritten. This paper is a review of the infrastructure and some of the structured features of REPTIL.

Forth-79 Profiled

Alan Winfield, Ron Goodman, Richard Pountain

Metaforth, Ltd.

Download PDF (451.84 kB)

The technique of profiling an application program, that is obtaining statistical data on the length of time that the program spends in each of its component sections, is well known and allows time critical parts to be identified and thus optimized. Less obvious is the possibility that an entire operating system might be profiled. This is hardly practical with the majority of operating systems (even less, compiler), but the simplicity and virtual machine concept of a Forth system does lend itself to the in-depth analysis that profiling will allow. This paper describes such an analysis for a Forth-79 system.

Production Testing of Domestic Clothes Dryers Using LMS Forth

J.D. Wood

Montreal Systems Consultants Inc.

Download PDF (1.73 MB)

This paper describes the implementation of a semi-automated testing facility for domestic clothes dryers, with particular emphasis on the system functionality, and the approach taken for controlling asynchronous concurrent tasks.

Top-down Design in Forth

Dr. James Basile

Department of Computer Science, Long Island University

Download PDF (4.61 MB)

Top-down design and coding practices are central to effective software engineering. Forth provides a programming environment that can be readily modified and expanded to suit particular needs. This paper examines the relationship between Forth as a programming environment and the use of top-down design and coding.

Forth Implementation in a High-level Language

James C. Bender

The BOM Corporation

Download PDF (1.38 MB)

A prototype Forth interpreter has been implemented in Ada as a research project. The Forth interpreter is written to take advantage of Ada features, such as range checking, exception handling, and utility packages for string handling and numerical operations.

Measurement of Interrupt Response Time of PDP-11/44 and PDP-11/23 Computers with a CAMAC Interface

J. R. Birkelund, J. A. Abate, and T. S. Lund

Research Laboratories, Eastman Kodak Company

Download PDF (1.57 MB)

Comparison of interrupt response times for PDP-11/44 and PDP-11/23+ machines, using the Forth programming language, is presented. The interrupt response of the machines with Forth implemented as a stand-alone operating system is compared with an implementation of Forth running under the RSX11M operating system. The comparisons have been made on systems operating CAMAC parallel interface busses, both as single bus controllers (IEEE 583) and as parallel highways (IEEE 596), which require a branch driver interface.

An Implementation of MC68000 fig Forth under UNIX

P.R. Blake and N. Solntseff

Department of Computer Science and Systems, McMaster University

Download PDF (1.86 MB)

The Department of Mathematical Sciences (the previous home of Computer Science at McMaster University) acquired three Pixel-80 computers in January 1984 for graduate and senior undergraduate teaching. The computers incorporate a MC68000 microprocessor and operate under the Unix operating system. The present paper summarizes the work done to implement Forth on the Pixel-80s.

JFAR volume 3, issue 3

A Microcoded Machine Simulator and Microcode Assembler in a Forth Environment

A. Cotterman, R. Dixon, R. Grewe, G. Simpson

Wright State University, Department of Computer Science

Download PDF (13.26 MB)

A Forth program that provides a design tool for systems which contain a microcoded component was implemented and used in a computer architecture laboratory. The declaration of standard components such as registers, ALUs, busses, memories, and the connections is required. A sequencer and timing signals are implicit in the implementation. The microcode is written in a Forth-like language which can be executed directly as a simulation or interpreted to produce a fixed horizontal microcode bit pattern for generating ROMs. The direct execution of the microcode commands (rather than producing bit patterns and interpreting those instructions) gives a simpler, faster implementation. Further, the designer may concentrate on developing the design at a block level without considering some of the implementation details (such as microcode fields) which might change several times during the design cycle. However, the design is close enough to the hardware to be readily translated. Finally, the fact that the same code used for the simulation may be used for assembly of the microcode instructions (after the field patterns have been specified) saves time and reduces errors.

A Forth Implementation of the Heap Data Structure for Memory Management

W. B. Dress

Oak Ridge National Laboratory, Instrumentation and Controls Division

Download PDF (5.39 MB)

The use of the heap for memory management provides the Forth programmer with a versatile tool. Its use speeds program development at the conceptual level by allowing the program designer to consider dynamic arrays, garbage collection, and overlays; and at the implementation stage by providing a framework for easy manipulation o(such data structures. An examination of the highlevel code leads naturally to examples of these and other techniques of dynamic data management. The implementation presented here has been used for some time in our Forth-based version of the expert systems language, OPS5. This has resulted in faster execution times for OPS5 programs and has overcome problems in extending the language to the real-time domain.

Object-Oriented Extensions to Forth

Dick Pountain

Download PDF (10.46 MB)

This paper describes an extension to a standard Forth-79 or -83 system that enables programming with objects organised into classes (with subclass inheritance). Objects are activated by sending messages to them, following the model of Smalltalk-80.

Discrete Event Simulation in Forth

Leonard F. Zettel

Ford Motor Co.

Download PDF (4.01 MB)

A Forth-based discrete event simulation system is presented, with words for scheduling events, executing the simulation, or optionally stepping through it. An example problem, the barbershop simulation, is presented and discussed. Forth is shown to have considerable advantage over implementation in conventional procedural languages.

Plotter Drivers as an Exercise in Forth Wordset Design

A. Richard Miller, Thomas B. Dowling

Miller Microcomputer Services

Download PDF (2.8 MB)

Three levels of driver design are discussed for a typical X-Y plotter. A minimum

driver merely permits Forth to mimic the plotter’s internal BASIC command set. A more elegant

one transforms the same commands into a more Forth-like and more English-like wordset. Finally,

the command set is modified and vectored into the existing MMSFORTH TGRAPH (Turtle Graphics)

utility. This transforms the plotter into an optional video screen to which one can output

TGRAPH graphics routines without any modification. Source code for a simple Forth implementation

for the Radio Shack FP-215 Flat-bed plotter is included, and can be adapted to many similar

plotters.

JFAR volume 3, issue 4

Extending Forth in a Camac Controlled Muon Channel

Robbie Spruit

TRIUMF

Download PDF (6.99 MB)

Control and diagnostic software was developed for a recently commissioned muon channel at TRIUMF. Logistics gave rise to separate efforts in several programming languages. This paper describes the Forth diagnostic package. The choice of programming language is discussed briefly. Several extensions to Forth, and their usage, are shown in the framework of a detailed account of the software implementation. Emphasis is placed on the production of readable code and on the design of constructs that closely model the structure of the application.

Forth in the Computer Numerical Control Environment

John Mullen

Iowa State University, Department of Industrial Engineering

Download PDF (6.18 MB)

In order to help students grasp the concepts of computer-aided manufacture, a small Computer Numerical Control (CNC) workstation was built. It consists of a microcomputer, a vertical mill, a plotter, a printer, and necessary interface electronics. The workstation may be controlled by means of either a Forth-based control language or a CNC language closely following the standards of EIA RS-358-B. The development of this workstation has been greatly facilitated by the use of Forth, which was used to test electronic driver and interface circuits, to control the plotter and mill, to form a basis for the Forth-like control language, and to implement the EIA standard CNC language. In addition, since the CNC languages are embedded in Forth, the support features of the Forth system are available to the user. The inherent transportability of Forth combined with a hierarchial modular design results in an implementation that is almost totally hardware-independent and very flexible. This project serves as an extensive demonstration of the utility of the integrated Forth environment in CNC applications

Exception Handling in Forth

Clifton Guy and Terry Rayburn

Bremson Data Systems, Inc.

Download PDF (3.65 MB)

Forth relies on the discipline of the progranuner to provide the benefits of structured languages: readability, predictability and modularity. A difficult class of problem for structured software is the handling of exceptions to the control flow, including errors. Even in properly designed software, a low level module may detect a condition whose proper resolution resides on a higher level. We describe a general implementation for exception handling in Forth that hides the inherent structure violation within a readable control structure which allows return from any nesting depth of Forth words and control structures. Further, this structure is itself nestable to any arbitrary depth.

State Sequence Handlers

Edward B. Rawson

Rawson Engineering

Download PDF (7.82 MB)

We describe a new type of sequence control structure that allows an ordinary : word to behave as a small state machine. The control structures may be freely mixed with BEGIN, UNTIL, etc., and with IF, ELSE, and THEN, with conventional nesting restrictions. The new structures include analogs of BEGIN, UNTIL, etc., as well as several other words that support terse, readable state machine code. The normal state variable is replaced by an execution pointer, whose handling is mostly hidden in the source code. Application code never need supply a pointer value. DefInitions may be understood as standard Forth procedures, with the understanding that execution may “hang up” in one of the internal loops or called procedures until it is proper to proceed. Repeated calls to the main procedure result in repeated execution of the loop code or the called procedure until continuation is appropriate. The sequence control structures encourage structured code, make state entry and exit natural, and produce fast, compact, object code. They eliminate the need to assign and manage state numbers. The structures and several applications are described.

User-Oriented Suggestions for Floating-Point and Conlplex-Arithmetic Forth Standard Extensions

Ferren MacIntyre

University of Rhode Island

Download PDF (8.87 MB)

Governmental, industrial, and editorial acceptance of Forth requires that it conform to some recognized, formal standard, (preferably sanctioned by ANSI). Proposed here are standard extension wordsets for floating-point (FP) and complex (CP) arithmetic, based upon three years of extensive use (and rewriting) of the MMSFORTH words with the 8087 numerical coprocessor. The models for the proposed extensions are IEEE 754 for constraints and the HP-15C pocket calculator for scope.

A Wordset for Error Propagation Arithmetic

Ferren MacIntyre

University of Rhode Island

Download PDF (3.34 MB)

Experimental and observational errors propagate as data are transformed or mathematically manipulated to produce quantities of interest. The mathematics of this propagation are simple, well known, but tedious to apply. Forth proves to be an ideal language for error analysis. Presented here is a short wordset that reduces the mathematical portion of the process (in contrast to its philosophical aspects) to routine coding, supplying the minimum propagated error of any data reduction nearly automatically. Additional words can be built upon the models supplied. Floating point capability is assumed.