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 Six

PDFs provided by MicroProcessor Engineering Limited
Lawrence P. Forsley
Number 1 - James Basile
Number 2 - James Basile
Number 3 - Lawrence P. Forsley
Number 4 - Lawrence P. Forsley
Brad Rodriguez
The Harris RTX 2000 Microcontroller
Tom Hand
Harris Semiconductor has developed the RTX 2000, a highly integrated 10MHz 16-bit microcontroller, for embedded applications that have demanding real-time requirements.

The RTX 2000 is a high-performance stack machine that has many of the advantages of RISC processors, but without their disadvantages. The RTX 2000 has a predictable run-time behavior because of its advanced, yet simple, architectural features.

A User Definable Language Interface for Forth
T. A. Ivanco and G. Hunter
The Forth programming language has often been criticized as a write-only language, i.e., a difficult language to read due mainly to the postfix syntax and the implied operands on the stack. In this article we describe two meta compiler implementations written in Forth-79 and Forth-83 respectively that enhance the language so that it supports a user defined syntax and semantics. The language is defined in conventional Backus-Naur notation with semantics written in Forth embedded within the definitions.
Marsaglia Revisited: Rapid Generation of Fitted Random Numbers
Ferren MacIntyre
Source code is given for a fast hex-integer version of Marsaglia's well-known method for converting uniformly distributed pseudorandom numbers into any desired distribution.
Data Structures for Scientific Forth Programming
J. V. Noble
This article describes methods for defining typed data (REAL, COMPLEX, REAL*8, COMPLEX*16, etc.), and for defining scalars and 1- and 2-dimensional arrays of such data. Also a method is given for run-time binding of data types that automates mixed-mode arithmetic, thereby incorporating one of FORTRAN's best features.
Handling Multiple Data Types In Forth
John J. Wavrik
While originally developed for use in hardware control, Forth is, because of its flexibility, an attractive language for developing software systems. In computer algebra, for example, it provides a programmer with an unrestricted ability to choose the representation of a large variety of data structures and the words needed to manipulate them. This paper deals with the problem of using many data types while preserving a simple Forth syntax. We introduce a mechanism for managing the storage of intermediate results of computation. This package takes advantage of special features of Forth to handle the recovery of unused storage.
The Cost of User-Friendly Programming: MacImage as Example
Ferren MacIntyre, Kenneth W. Estep and John McN. Sieburth
The Xerox Star and Apple Macintosh computers introduced the concept of the "user interface" to personal-computer software. The user interface is an intuitive, easy-to-use environment through which the user directs operation of the computer. It simplifies program learning and use, but at the cost of increased code and a limitation of programming options. As an example of this cost, we describe MacImage for the Macintosh, an image-analysis application. The actual code needed to implement a basic Macintosh interface is given for a simpler application called Simple Tones. The user interface occupies 47% and 60%, respectively, of the Forth code for MacImage and Simple Tones, but results in software that can be used almost immediately, without consulting a manual.

A second, less exploited, but ultimately more important aspect of user friendliness is that both the programmer and user should recognize that the user will need to optimize code for his application, and the program must be designed with this eventuality in mind.

Little Universe: A Self-Refencing State Table
Karl-Dietrich Neubert
Little Universe is a self-referencing state table, providing an environment in which to embed a multiplicity of alternative actions, procedures, equations or other objects. Essentially, it consists of matrices, whose rows are called classes and whose columns represent states. Each matrix element is considered to be an object, and a matrix is a world of objects. The set of all worlds is the universe. An object not only is identified by its class-, state-, and world-names, but conversely is aware of these coordinate values.
A FORmula TRANslator for Forth
J. V. Noble
This paper discusses problems in automating the translation of FORTRAN expressions into Forth code. I avoid multiple passes, the translator recursively decomposes a complex expression into simpler sub-expressions residing on an expression stack, with corresponding arithmetic operators residing on a parallel operator stack. When the top of the stack can no longer be decomposed, its code is emitted. The program has finished when the stack is empty. The stack-based parser seems simpler both in concept and execution than the trees usually advocated in compiler design.
A Generalized EXIT
Carol Pruitt
Like EXIT, {EXIT} allows a Forth word to abort its own execution upon discovery of an exceptional condition. Unlike EXIT, however, {EXIT} can be used within a DO loop. It can specify the point where execution is to resume. And its behavior is not affected by refactoring of the code that uses it.
Strings, Associative Access, and Memory Allocation
N. Solntseff and Bradford Rodriguez
The goal of the present paper is the implementation of strings modelled after SNOBOL4. Extensions to Forth to implement the memory-management strategy needed to allow strings to grow and shrink in an arbitrary manner are described. Associative or content-addressable storage needed to allow indefinitely many levels of indirectness is discussed. We propose the use of hash and string spaces, separate from the ordinary Forth space, to implement associative memory in a relatively simple manner and to allow strings to freely migrate in string space. Lastly, string store and fetch operations are introduced.
MATMATH: A Matrix Handling Package for Forth
Denise S. (Derby) Stilling and L. Glen Watson
This paper discusses a matrix mathematics package which illustrates the utility of Forth for numerical analysis. Since matrices are the primary building block for much of the numerical analysis used in present day science and engineering, the package was developed to be suitable for a variety of applications. The code presented assumes the presence of the proposed FVG Standard floating point extensions and follows the Forth-83 Standard. The package provides for the creation, initialization and fundamental manipulations of matrices. To demonstrate the utility of the package, two applications have been presented.
A Debugging Environment for Forth
Peter C. Lind and N. Solntseff
This paper outlines the design and implementation of a visually oriented debugger and execution tracer for Forth. The utility is coded in Turbo Pascal and provides a visual user interface for controlling the execution of a Forth system and a machine-language monitor which performs the context switching between the user interface and Forth and handles a variety of software interrupts.
A Preliminary Exploration of Optimized Stack Code Generation
Philip Koopman, Jr.
This paper presents an experimental code generator that performs intra-block stack scheduling for a stack-based execution model. For small test programs, 91% to 100% of redundant local variable accesses were eliminated using this compiler. Compiled intra-block stack scheduling and hand-performed global stack scheduling show that significant opportunities exist to keep temporary variable values on the expression evaluation stack when compiling conventional languages.
Introduction to Object Oriented Approaches
Steven M. Lewis
In the past several years object oriented programming has become extremely popular. It is important for the Forth community to understand this approach and the reasons for its popularity. This introduction defines some of the critical concepts in object oriented programming and some of the reasons for its popularity. It discusses the basic methods and vocabulary of object oriented programming. Finally it discusses some options for implementation of objects within Forth. Several general principles must be realized from the outset.
R. J. Brown
Dreams is a message passing object oriented programming system. It allows for before, after, and around methods, multiple inheritance, and operator overloading. It is based on a prototype model of object oriented programming and dynamic scoping, rather than the more traditional class model and lexical scoping. Designed for real-time, Dreams has a fixed, predictable overhead.

A dream object is implemented as a contiguous data structure, and is therefore a suitable candidate for I/O. This makes it possible for objects and messages to be sent and recieved over a communications link or network, and for objects to be written to and read from a file or database.

Implementation techniques based on indirect threading, direct threading, token threading, and subroutine threading are discussed. The threading scheme chosen has a significant effect upon the efficiency of multitasking and MINED parallelism. A hardware implementation of the dynamic binding mechanism used in Dreams is discussed. This hardware will permit determination of the currently active binding of any object without the addition of any processor cycles.
Emulation of a Stripchart Recorder with the Split Screen and Smooth Scrolling Capabilities of the VGA
David MacGibbon
We produce a medical flowmeter equipped with a RS232 computer interface. The interface board was completely described in last year's proceedings, but it's basic function is to digitize a medium speed analog signal (100 samples per second) and to transmit the data to the computer for storage and display. We soon found that even our moderate data acquisition rate was enough to severely burden conventional computer display techniques. We tried a plot and clear screen type of display, but users complained that it was hard to follow and that important events at the edge of the screen were immediately erased. We also explored the technique in which an erasing cursor moves across the screen just in front of the drawing cursor. Our company critics felt that this was an improvement but that viewing this display was still fatiguing because of the constant eye movement required. At this point, our chief critic challenged us to produce a smooth scrolling stripchart type display without any hardware. It was also requested that half of the screen be available for use as a help menu.

After a couple of weeks of vehemently insisting that these requirements could not be met with software alone I discovered an excellent article discussing the smooth scrolling capabilities of the EGA and VGA. The article also describes the screen splitting potential of the VGA. With this additional information, we were able to build a software package that converts any VGA equipped personal computer into a smooth scrolling split-screen stripchart emulator.

The source code listed was written for Tom Zimmer's FPC3 dialect of Forth and has several components that are specific for a VGA equipped IBM clone. The program described will provide for stripchart playback of a recorded disk file at 100 samples per second. It can easily be adapted for multichannel, multicolor operation and for data streams from sources other than disk.
ANS Standard Meetings:
Minutes of X3J14 Meeting #7
ANS Forth Technical Committee
January 25-28, 1989, Los Angeles, California
Minutes of X3J14 Meeting #8
ANS Forth Technical Committee
May 3-6, 1989, Boston, Massachusetts
Minutes of X3J14 Meeting #11
ANS Forth Technical Committee
January 24-27, 1990, San Diego, California
Minutes of X3J14 Meeting #12
ANS Forth Technical Committee
May 22-26, 1990, Melbourne, Florida
Minutes of X3J14 Meeting #13
ANS Forth Technical Committee
August 21-25, 1990, Burnaby, British Columbia
Minutes of X3J14 Meeting #14
ANS Forth Technical Committee
November 6-10, 1990, Detroit, Michigan
Conference Abstracts:
1988 FORML Conference
1989 SIGForth Workshop on Real-Time Software Engineering
1989 EuroFORML Conference
1989 FORML Conference
Call for Papers
1990 EuroFORML Conference