The Journal of Forth Application and Research
ISSN: 0738-2022

Forth Institute

Editorial Board

Author's Guidelines

Authors Index

Volume 7
Volume 6
Volume 5
Volume 4
Volume 3
Volume 2
Volume 1

Valid XHTML 1.0 Strict
Valid CSS!

Volume Two

Thea Martin
Number 1: Forth Engine
Michael Starling
Number 2: Real Time Systems
Lawrence Forsley
Number 3: Enhancing Forth
Lawrence Forsley
Number 4: Forth on Large Machines
Michael Perry
Jose Betancourt
Ferren MacIntyre
The R65F11 and F68K Single-Chip Forth Computers
Randy Dumse
The R65F11, 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
Abstract / Errata
A three-board processor which contains a Forth interpreter, executing on AMD-2900 bit-slice components, high speed memory and hardware stacks, has been designed and build 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
Engineers at the Johns Hopkins University Applied Physics Laboratory have designed and build two computers which will control and monitor the Hopkins Ultraviolet Telescope, a 1986 Space Shuttle experiment. The computers implement a microcoded Forth nucleus in 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
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 Vickery
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.

A prototype implementation using commercially available parts is under development.

Laser Beveling in polyFORTH
Thomas Anthony
High power thyristors capable of carrying 1000 amperes and of blocking up to 6500 volts, used for high voltage DC transmission application, must have their edges beveled to have the lowest possible electric fields at their sufaces 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 edge of their high-power thyristors. The system uses an IBM PC connected to three micromanipulators and 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
Abstract / Errata
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 RSC-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. Bonne and Maged G. Tomeh
Abstract / Errata
A Forth-based robotic parts delivery system was developed at Stanford University as a joint master 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
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.
Forth meets Smalltalk
Charles B. Duff and Norman D. Iverson
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 and Hans Nieuwenhuÿzen
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
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 co-processor 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 calculations) 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 which produces a result in 15 minutes, compared to the 24-hour turnaround for a 1-second CRAY-1 background run.

A Forth Profile Management System
John Michaloski
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 sub-divided, 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.
Forth in a Hardware-Rich Environment
Mitch Bradley
Historically, Forth has excelled on computers with limited hardware resources - small memories/16-bit address spaces, small or nonexistent mass storage devices and CPUs capable of executing less than 1 million instructions per second (1 MIP). Forth has done well in this kind of hardware environment and will probably continue to be a language of choice for such small machines.

However, computer hardware is getting cheaper and more powerful each year. Already a 64K memory is considered small. Microprocessors are getting faster and faster, and their memory address space is well into the several megabyte range. During 1985, systems based on the Motorola 68020 or the National 32032 will boast a full 32-bit address space (4 gigabytes!) and CPU speeds of 2 MIPs or more. Mass storage devices are similarly improving. It is already possible to buy a hard-disk drive that stores over 100 MBytes and fits in the space of a standard-height floppy drive.

Forth, as most of us know it, doesn't know what to do with a machine like this. If Forth is to have a future in applications other than machine control or real-time systems, it must evolve to take advantage of the hardware capabilities of machines like these. For the purposes of this review, such a hardware-rich machine will be called a "workstation".

Currently there are several aspects of Forth that do not match well with workstations. Many of these problems are not inherent in the Forth language itself, but rather parts of the Forth ``culture'', which is accustomed to having to live with very limited hardware.

A VAX Implementation of the 79-Standard
William Sebok
A public domain implementation of Forth has been written for the VAX super-mini computer that runs under 4.1 and 4.2 BSD UNIX. It has been running now for over two years at the Astrophysics Department at Princeton University and is used for image processing. It follows the 79 Standard except: 1) entries on the parameter stack are 32 bits wide, 2) addresses are 32 bits (rather than the demanded 16 bits) wide, and 3) certain escape sequences beginning with a backslash are recognized in the printing word.

Some extensions to the 79 Standard are: 1) a character string stack, with a full set of string operators; this also makes manipulation of UNIX file names infinitely easier, 2) a floating point stack, and 3) a set of UNIX interface words.

Colon definitions are compiled as a series of bsb, bsbw, or jsb instructions rather than as a list of pointers. The ICODE operator can be used instead of the CODE operator for short definitions. When a word defined by the ICODE operator is compiled, its code is placed in-line rather than referenced. Number references are compiled as the shortest of the many possible instructions to push that number onto the stack.

Token Threaded Forth and the Extended Address Space
Terry Holmes
This paper outlines a proposal for token threaded code to extend FORTH beyond its traditional 64K boundary while maintaining the compactness of 16-bit FORTH systems. Comparisons are made with the efficiencies and functional characteristics of indirect- and direct-threaded extended-address-space implementations on the MC68000 microprocessor.
Analysis of Several Extended-Memory 8086 Forth Implementation Approaches
Robert Berkey
Several 8086 system designs are evaluated that provide the Forth application programmer one megabyte of dictionary space. A flat (non-segmented) address space with a 32-bit virtual machine is chosen.
Compatible Forth on a 32-Bit Machine
Mitch Bradley and William Sebok
The arrival of affordable 32-bit machines poses some problems for Forth, which explicitly assumes that addresses and stacks are 16 bits wide. A scheme is presented for writing Forth code that will run without change on either a 16-bit or a 32-bit machine. This scheme is based on experiences running Forth on a number of 16 and 32 bit systems and may easily be implemented on top of a standard system.
A Proposal for Implementing Local Words in Forth
Ronald L. Green
Some advantages of defining local, headerless words in Forth are presented and discussed briefly. Among these are the use of local words to enhance information hiding and to prevent stack clutter, making code more readable. An approach is presented which uses a local vocabulary to temporarily store the headers of local words until they are linked into the code. The requirements for implementing the approach in a Forth system are discussed.
Binary Search
Siem Korteweg and Hans Nieuwenhuÿzen
This paper describes a new dictionary structure supporting binary search. This dictionary structure can be implemented without a penalty in memory usage. It appears in this implementation that vocabularies can increase the searching time. Therefore, the new dictionary structure does not support vocabularies.
Technical Notes:
polyFORTH on the NCR/32
Michael McBride
A very high performance polyFORTH II system implemented on the NCR/32 chip set was presented at the 1984 Rochester Forth Applications Conference. This technical note will clarify some aspects of the implementation.
Separate Headers
Siem Korteweg and Hans Nieuwenhuÿzen
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.
Siem Kortweg and Hans Nieuwenhuÿzen
This paper formalizes the use of identifiers for the identification of dictionary entries.
Patching the ONLY Structure on Top of fig-FORTH
Man Chor Ko and Scott Jenson
The ONLY structure is by far the most powerful enhancement made to the FORTH-83 standard [1] [2]. 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.
Segment-Threaded Code
Robert Berkey
An 83 Standard Forth was implemented for the 8086 in which the threaded code is maintained outside the 64k Forth address space by using segments for the compilation address. Execution and compilation speeds are equivalent to a comparable 64k system.
Interactive Headerless Code
Jose Betancourt
A Group Construct for Field Words
Charles B. Duff
MENU: A Menu Creating Word
Kevin Appert
A technique for generating a menu from a list of FORTH words is presented.
A Review of RISC and Forth Machine Literature
Lawrence Forsley
Recently considerable attention has been given to the development of a Reduced Instruction Set Computer, or RISC, which may alleviate may of the design problems and instruction execution bottlenecks associated with modern computers. Forth may be a member of the RISC class of machines. This paper examines current RISC and Forth machine literature, draws parallels, and notes differences among the efforts.
Conference Abstracts:
1984 Rochester Forth Applications Conference
1984 FORML Conference
1985 Rochester Forth Conference
For Number 1
For Number 2
Calendar of Events:
Number 1
Number 4
Call for Papers:
Journal of Forth Application and Research
1985 Rochester Forth Conference
1985 Rochester Forth Conference