0% found this document useful (0 votes)
260 views114 pages

Pocket-Guide-to-Forth - Dokumen - Pub

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
260 views114 pages

Pocket-Guide-to-Forth - Dokumen - Pub

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 114

Pocket Guide to

FORTH
Linda Baker/ Mitch Derck
Addison-Wesley Programming Pocket
Guides

This series of pocket-size reference guides to the major


programming languages provides you with concise
references and reliable descriptions of the main
language features. You can use them as memory-joggers
or reference tools.

Introduction to Programming John Shelly 07736


Pocket Guide to BASIC Roger Hunt 07744
Pocket Guide to COBOL Ray Welland 07750
Pocket Guide to Fortran Philip Ridler 07746
Pocket Guide to Pascal David Watt 07748
Pocket Guide to FORTH Baker and Derick 10103
Pocket Guide to Wordstar Bove and Rhodes 07754
Pocket Guide to CP/M Dwyer and
Critchfield 10363
Pocket Guide to Dwyer and
Microsoft BASIC Critchfield 10364

Copyright © 1983 by Addison-Wesley Publishing Company,


Inc.

All rights reserved. No part of this publication may be


reproduced, stored in a retrieval system, or transmitted, in any
form or by any means, electronic, mechanical, photocopying,
recording, or otherwise, without the prior written permission
of the publisher. Printed in the United States of America.
Published simultaneously in Canada.

ISBN 0-201-10103-3
ABCDEFGHIJ—AL--89876543
Contents

1. What Is FORTH? 1

2. Why Use FORTH? 1

3. Where Did FORTH Come From? 2

4. What is fig-FORTH? 2

5. What Is FORTH’s Syntax? 3

6. What Are the Components of a Minimum FORTH


System? 3

The Dictionary 3
The Stack 4

The Interpreters 4

Virtual Memory 4

7. What Is a FORTH Definition? 5

8. How This Book Is Organized 5

Word Name (Parameter Stack Activity) 5


Word Pronunciation 6

General Description 6
Low Level Statement 6
“Refer To” List 6
FORTH-79 7

9. Definition of Sequence Times 7

10. FORTH Words in Ascii Order 8

11. FORTH System Messages 95

12. Standard fig-FORTH Memory Map 97

13. Functional Cross Reference 98

14. Ascii Order Index 102

11
WHAT IS FORTH?

FORTH is a highly interactive, structured, interpretive


programming environment. Its purpose is to give the
programmer a “user friendly” interface to a computer.
FORTH is “extensible.” That is, the basic language set is
only a stepping stone in solving a specific problem. Using the
“standard FORTH kernel” as a basis, the programmer
interactively extends the language set by defining new “words”
in terms of already existing “words.” It has been said that
FORTH is a collection of good programming techniques. This
is true. Because FORTH is a collection of tools, comparing it
with other languages is difficult. However the following similar
strengths are readily apparent: in terms of extensibility FORTH
is similar to LISP and APL; FORTH’s hardware interface
capabilities resemble those of C or assembly language; and for
any specific application, the high level aspect of FORTH may
be made even higher than COBOL, FORTRAN, or PASCAL.
The power of FORTH is that each and every word currently
defined is instantly accessible. This allows the programmer the
ability to solve logical problems in the most high level terms;
to instantly access the lowest level function possible on the
machine being used; or to work at any level in between.

WHY USE FORTH?

FORTH offers the following advantages:

1. FORTH makes all of the host machine’s resources available


interactively (fast development cycle; shorter debugging
time).
2. Assembly language procedures are just as easy to create as
high level procedures.
3. The parameter stack inherently allows reentrant
programming.
4. Structured programming has been shown to be an
advantage (no GOTO’s; eliminates “spaghetti code”).
5. FORTH allows for top-down design and coding.
6. Properly written high level source code is almost English
and is practically self-documenting. (Beware. It is quite

1
possible to improperly write FORTH source that is “write-
only” code!)
7. FORTH produces compact code that executes much faster
than other high level languages.
8. FORTH is extremely transportable (i.e., an application
containing no CPU specific definitions can be run on
different CPUs simply by recompiling).
9. FORTH’s compiler can be extended to allow any new
control or data structures conceivable.
10. The programmer has complete control over and may use at
any time all “operating system” functions (including the
ability to create new operating systems—actually, FORTH
can be its own operating system).

WHERE DID FORTH COME FROM?

FORTH is a “grass roots” language. In other words, it was not


created by a committee setting out to develop a new language
but was instead created by one person, Charles Moore, over a
period of years. Starting in the sixties, Mr. Moore began
working on a programming tool concept which eventually
evolved into what is now FORTH. In 1973, FORTH, Inc., was
formed to commercially develop and market FORTH and
FORTH applications.

WHAT IS fig-FORTH?

fig-FORTH is a version of FORTH created by the FORTH


Interest Group (FIG). Several years ago members of FIG became
convinced that FORTH would become a popular language if
any essentially free, public domain version of FORTH were
made available. The result of this effort was fig-FORTH. The
majority of hobbyist level FORTH implementations and many
commercial applications now use fig-FORTH.
FORTH-79 is a voluntary standard dialect intended to allow
greater transportability between systems. It is essentially a
subset of fig-FORTH comprised only of application-oriented
words and not those words used to implement the language.
2
The FORTH Model described in this Pocket Guide was
created and placed in the public domain by:

FORTH INTEREST GROUP


P.O. Box 1105
San Carlos, CA 94070

WHAT IS FORTH’S SYNTAX?

FORTH does not have a formal syntax definition. The ability


of FORTH to be extended (including the ability to extend any
or all of the compiler functions) precludes a formal, rigid
syntax. FORTH does, however, have a syntax that resembles
the syntax of assembly language in that tokens (or “words”)
are delimited by at least one space.
FORTH uses the English word “word” to mean an
executable procedure. The source input to the FORTH
compiler is a data stream of wordnames separated by spaces.
The output of these compilers is one dictionary definition for
each new word (procedure) compiled. Actually, the FORTH
“compiler” is composed of many individual FORTH words
acting as specific-purpose compilers.

WHAT ARE THE COMPONENTS OF A


MINIMUM FORTH SYSTEM?
The Dictionary: The primary component of any FORTH
system is the dictionary. This dictionary is a threaded list of
FORTH definitions (or procedures) comprised of all of the
executable code in the system with the exception of the “inner
or address interpreter.” These definitions may vary greatly in
content and may contain addresses of other definitions, data,
executable machine code, or any combination thereof. As new
definitions are compiled, they are sequentially appended to the
end of the dictionary. Although the dictionary is one
contiguous physical structure, a logical scoping/vocabulary
structure can be maintained through the use of multiple
threads.

3
The Stack: FORTH is based on the use of two LIFO stacks: a
“parameter stack” and a “return stack.” The parameter stack is
used as the primary means of passing data between
definitions. By convention a FORTH definition removes all of
its input parameters from the stack and replaces them with a
result (if any). Data is operated on in a post-fix manner, (using
Reverse Polish Notation) just as on a stack-oriented calculator.
The return stack is used exactly as a stack is used to nest
subroutine return addresses. A FORTH definition is composed
of other definitions that are composed of other definitions, and
so on, until a “primitive” definition, composed of assembly
language code, is reached. As FORTH “chains down” through
these nested levels of definitions, it saves the previous
definition’s return address on the return stack. “Chaining back
up” is merely a matter of retrieving these return addresses
from the return stack.

The Interpreters: There are two interpreters in a FORTH


system: the “outer interpreter” and the “inner interpreter.”
The outer interpreter is a text interpreter (like a BASIC text
interpreter). It parses text from the input stream and looks
each token (word) up in the dictionary. When a word is found
in the dictionary, it is executed by calling the inner
interpreter.
The inner interpreter is an address interpreter (like
PASCAL’s p-code interpreter), which executes definitions
whose absolute addresses have been previously compiled into
the dictionary.
This two-level mode of interpretation gives FORTH both
compactness and high speed of operation.

Virtual Memory: Mass storage references in FORTH are


transparent to the programmer, i.e., there are no “reads” or
“writes.” Data transfers are accomplished via the virtual
memory word BLOCK . BLOCK fetches a fixed block of data
from mass storage to memory and returns the memory address
of that data. Data residing in buffers is automatically written
to disk if it has been flagged as updated. A standard FORTH
system has no data types; however, FORTH allows the

4
programmer to easily build whatever data structures are
necessary for the application.

WHAT IS A FORTH DEFINITION?

A FORTH definition (in general) is a procedure compiled into


the dictionary by a defining word such as : (colon). The source
format for a colon definition is:

wordname already defined words or numbers

This source will create a definition with the structure as


follows:

NFA or Name Field contains a


character string.
LFA or Link Field contains an
address link to a previous
Header definition.
CFA or Code Field contains a
pointer to code instructions
executed when this word is first
executed.

PFA or Parameter Field contains a


Body ‘ series of addresses of already
defined words.

HOW THIS BOOK IS ORGANIZED

Each word (or “definition”) description follows this general


format:

1. Word Name (Parameter Stack Activity)

The first line of each description is printed in bold characters.


The definition name is on the left followed by the parameter

5
stack activity enclosed in parentheses. The general format for
parameter stack entries is:

before execution — after execution

When multiple stack parameters are listed, each entry is


separated by a “\.“ The left-hand entry is lowest on the stack;
the right-hand entry is at the top of the parameter stack.
Hint: By pronouncing”\” as “under” and “—“ as “leav
this horizontal stack format is quite readable. For example:

(vi \ v2 — v3 ) becomes “vi under v2 leaves v3”

Some definitions return different stack conditions, depending


upon their input (for example, successful or unsuccessful
completion of a word). In these cases, each condition is listed
separately.

2. Word Pronunciation

Since FORTH is intended to be a speakable language, the


pronunciation (if necessary) is given inside parentheses.

3. General Description

The first part of the text section is usually a summary of the


purpose of the definition.

4. Low Level Statement

Those primitive definitions comprised of low level code are


flagged as such. Definitions not flagged are high level words.

5. “Refer to” List

Listed are words to refer to for more information.

6
6. FORTH-79

This shows how the described word relates to the FORTH-79


Standard.

DEFINITION OF SEQUENCE TIMES


One of the major philosophical differences between FORTH
and the more traditional programming languages is that the
FORTH compiler is itself composed of FORTH words. The
compiler may also be extended at any time with the addition
of new compiler words; this causes a special set of problems
to arise.
Specifically:

What is a word doing at any given time?


Is it being defined?
Is it being compiled?
Is it executing?

This ambiguity is made clear through the use of the terms


Sequence 1, Sequence 2, and Sequence 3. These sequences are
described in ascending order of complexity.

Sequence 3: The act of executing is termed as a definition’s


“run time” (“execution time”) or Sequence 3 action.

Sequence 2: In order to execute, a word must be compiled.


The act of being compiled is the Sequence 2 action of a
definition.

Sequence 1: Some FORTH words are “defining words.”


These words are used to create compiler definitions or
“parents,” which in turn execute and create “child”
definitions. Creating a defining word is a Sequence I action.

7
(value \ address —)
(pronounced “store”) stores the 16-bit value located in the
second parameter stack entry into the memory location
specified by the top parameter stack entry.
C! is used to store 8-bit (i.e., byte or character) values.
@ has the opposite effect of
is a low level code primitive.
Refer to C! and
FORTH-79: Is equivalent.

!CSP(—)
!CSP (pronounced “store-C-S-P”) saves the current parameter
stack address in the user variable CSP . !CSP is used with
?CSP to determine whether the parameter stack has become
unbalanced during compilation.
Refer to ?CSP
FORTH-79: No equivalent.

# ( double precision value — double


precision quotient)
# (pronounced “sharp”) performs a binary-to-ascii conversion
of one digit from a double precision value into an ascii
character that is then placed into a pictured numeric output
string. One digit is converted each time # is executed. The
input value is divided by the value currently in BASE . The
reminder of this division is converted into a digit. The
resulting quotient is left on the stack.
<# must be executed to properly set up for # . # is used in
the general form <# # #> to convert a single digit. The form
<# # #.. . #> is used to convert as many digits as specified
or <# #S #> to convert all the digits.
DABS should precede the <# in a pictured numeric
expression to convert negative double precision values to their
absolute value. SIGN is used to display the sign. HLD points
to the last character converted.

8
Refer to <# ,#> ,#S ,HOLD ,SIGN ,HLD ,BASE ,and
PAD.
FORTH-79: Is equivalent.

#> (double precision value — address \


count)
#> (pronounced “sharp-greater-than”) terminates a pictured
numeric conversion expression. #> drops the double precision
conversion value left by # and replaces it with the beginning
address of the converted character string and the string length
(in a format suitable for TYPE
#> is used in the general form:

<# # #>

Refer to <# ,# #S HOLD SIGN and PAD.


FORTH-79: Is equivalent.

#S (unsigned double precision value —0


\0)
#S (pronounced “sharp-S’) performs a binary-to-ascii
conversion of a double precision value into an ascii pictured
numeric output character string. The word performs a #
conversion until the original double precision value is
completely converted to ascii. BASE contains the radix to be
used in the conversion.
#S is used within a <# #> expression.
Refer to <# SIGN HOLD HLD and PAD.
FORTH-79: Is equivalent.

(— addr of specified word)

‘(pronounced “tick”) places the PFA of a specified definition


onto the top of the parameter stack. It is used in the form:

9
wordname
where wordname is the name of the desired word.
Two characteristics are exhibited, since LITERAL is used
within the definition:

1. Compilation State: the address is compiled into the


dictionary as a literal.
2. Execution State: the address is left on the top of the
parameter stack.

searches both the CONTEXT and CURRENT vocabularies. If


the specified word is not found, Error Message 0 (“?“) is
issued and a QUIT occurs.
Note that is an IMMEDIATE word.
Refer to -FIND
FORTH-79: Is equivalent.

((pronounced “left paren”) is used to denote the beginning of


a comment. It is used in the form:

(comment)

Note that (is a FORTH word and therefore must be separated


from the comment string by at least one blank. The comment
must be terminated by a ) (“right paren”). The terminating
right parenthesis does not have to be preceded by a blank.
Comments may appear inside or outside of a definition.
Note that (is an IMMEDIATE word.
FORTH-79: Is equivalent.

(.“) Return Stack ( address — address)


(.“) (pronounced “paren-dot-quote”) is the run time procedure
compiled by .“ . Its purpose is to output the text string
compiled into the dictionary by .“
(.“) performs two basic functions:
10
1. Prints the character string compiled into the dictionary by

2. Increments the IP past the character string so that


interpretation begins with the word following the string.

(.“) may be used only inside of a colon definition.


Refer to
FORTH-79: No equivalent.

(+ LOOP) (increment value —)

(+ LOOP) (pronounced “paren-plus-loop”) is the execution


time (Sequence 3) procedure for + LOOP . During compile
time (Sequence 2), + LOOP compiles the CFA of (+ LOOP)
into the definition being created.
The purpose of (+ LOOP) is to serve as the run time end of
a DO. . . + LOOP structure. In doing so, (+ LOOP) performs four
primary functions:

1. Obtains the loop increment value from the top of the


parameter stack.
2. Increments the loop Index by the increment value. Note
that this value can be either positive or negative.
3. Performs a signed comparison of the newly calculated loop
Index and loop Limit.
4. Executes a branch back to the “DO” portion of the structure
until the Index is either equal to or greater than the Limit
when incrementing by a positive value or until the Index is
greater than the Limit when incrementing by a negative
value. When either of these conditions occurs, the Index
and Limit are dropped from the return stack and execution
continues with the word after the DO... + LOOP

(+ LOOP) differs from (LOOP) only in that the increment


value is provided on the top of the parameter stack instead of
defaulting to a value of 1.
(+ LOOP) is a low level code primitive.
Refer to + LOOP ,DO ,and (LOOP)
FORTH-79: No equivalent.

11
(;CODE)(—)
(;CODE) (pronounced “paren-semicolon-code”) is normally
used during Sequence 2 compilation. Its purpose is to compile
the beginning address of the assembly language code, that
must immediately follow (;CODE) into the Code Field of the
definition being compiled.
(;CODE) is actually the run time procedure for CODE
CODE is usually executed at Sequence 1 when defining a
“parent” word. The “parent” defining word is then executed at
Sequence 2 time to create “child” definitions.
Refer to CODE
FORTH-79: No equivalent.

(ABORT) ( all stack values —)


(ABORT) (pronounced “paren-abort”) is an intermediate word
used between ERROR and ABORT. (ABORT) is intended to be
the “hook” for application error routines. Replacing the CFA
for ABORT with that of a user-defined error routine and
setting WARNING to — I allows the user routine to “get
control” when an error occurs.
Refer to ABORT WARNING ,and ERROR.
FORTH-79: No equivalent.

(DO) (Limit \ Index —)


(DO) (pronounced “paren-do”) is the execution time (Sequence
3) procedure for DO . During compile time (Sequence 2), DO
compiles the CFA of (DO) into the definition being created.
The purpose of (DO) is to initialize a DO. . LOOP structure
for execution by transferring the user-supplied Limit and Inde
values from the parameter stack to the return stack. The Limif
and Index values are then accessed by the run time procedures
(LOOP) and (+ LOOP)
Note that when the loop completes, (LOOP) or (+ LOOP) has
removed the Index and Limit from the return stack.
(DO) is a low level code primitive.

12
Refer to DO LOOP + LOOP (LOOP) and (+ LOOP)
FORTH-79: No equivalent.

(FIND)

Successful: (string addr \ NFA — PFA \


length \ true flag)

Unsuccessful: (string addr \ NFA —


false flag)

(FIND) (pronounced “paren-find”) performs a dictionary search


starting from a specified NFA. It then looks for a match on the
character string pointed to by the address in the second stack
entry. (FIND) will search an entire “branch” of the vocabulary
dictionary, “inwardly’ toward the “trunk. The search stops
when a 0 Link Field is encountered, usually, but not
necessarily, at the end of the FORTH vocabulary.
(FIND) is a low level code primitive.
Refer to FIND and VOCABULARY.
FORTH-79: No equivalent.

(LINE) (line # \ screen # — beg line addr \


line length)
(LINE) (pronounced “paren-line”) converts a specified line
number and screen number into the disk buffer address of the
specified line. The value for the line length used is also
returned. The specified screen is read into memory if
necessary. (LINE) is used by LINE to set up parameters for
TYPE.
(LINE) performs 3 basic functions:

1. Calculates what block the line is in within the screen.


2. Calculates the absolute block number.
3. Executes BLOCK and calculates the memory address of the
line.

13
Refer to LINE
FORTH-79: No equivalent.

(LOOP) (—)
(LOOP) (pronounced “paren-loop”) is the execution time
(Sequence 3) procedure for LOOP . During compile time
(Sequence 2), LOOP compiles the CFA of (LOOP) into the
definition being created.
The purpose of (LOOP) is to serve as the run time end of a
DO.. LOOP structure by performing the following functions:
1. Increments the loop Index by 1.
2. Performs a signed comparison on the newly calculated loop
Index and loop Limit.
3. Executes a branch back to the “DO” portion of the structure
until the Index is either equal to or greater than the Limit.
When this last condition occurs, the Index and Limit are
dropped from the return stack and execution continues with
the word after the DO. . LOOP

(LOOP) only differs from (+ LOOP) in that the increment


value defaults to I in (LOOP) instead of being provided on the
top of the stack as for (+ LOOP)
(LOOP) is a low level code primitive.
Refer to LOOP , DO , I , and (+ LOOP)
FORTH-79: No equivalent.

(NUMBER) ( double number \ string addr —


double number \ char addr)
(NUMBER) (pronounced “paren-number”) converts a string of
ascii text beginning at the specified address plus 1 into a
double precision value using the current BASE value as the
conversion radix. (NUMBER) is used primarily by NUMBER.
If DPL is set to a value other than — I, the user variable DPL
is incremented to reflect the number of digits encountered to
the right of the decimal point.

14
The address of the first unconvertible character encountered
is returned on the top of the parameter stack.
Refer to NUMBER.
FORTH-79: Is equivalent to CONVERT.

* (valuel \ value2 — single product)


* (pronounced “times”) multiplies two signed single precision
values and replaces them with their signed single precision
product.
Refer to M*
FORTH-79: Is equivalent.

*1 ( mutliplier \ multiplicand \ divisor —


quotient)
*/ (pronounced “times-divide”) performs a multiplication and
then a division of three 16-bit signed single precision values
and leaves the 16-bit signed single precision quotient
according to the algebraic statement:

(valuel * value2) / value3

*/ carries the result of the multiplication as a 32-bit signed


double precision intermediate result for greater accuracy. If a
remainder is desired, use */MOD
Refer to */MOD
FORTH-79: No equivalent.

*/MOD ( multiplicand \ multiplier \ divisor


— remainder \ quotient)
*/MOD (pronounced “times-divide-mod”) performs a
multiplication and then a division of three 16-bit signed single
precision values and leaves both the 16-bit signed single
precision quotient and the 16-bit signed single precision
remainder according to the algebraic statement:

(valuel * value2) / value3

15
*/MOD carries the result of the multiplication as a 32-bit
signed double precision intermediate result for greater
accuracy.
Refer to */
FORTH-79: Is equivalent.

+ (valuel \ value2 — value)

+ (pronounced “plus”) adds the top two 16-bit signed


numbers on the parameter stack and replaces them with their
16-bit signed sum. Note that generation of a carry goes
unnoticed.
+ is a low level code primitive.
FORTH-79: Is equivalent.

+! (value \ address —)

+! (pronounced “plus-store”) adds the 16-bit value contained


in the second parameter stack entry to the 16-bit memory word
addressed via the entry on the top of the stack.
+! is a low level code primitive.
FORTH-79: Is equivalent.

+ — (value to have sign set \ value whose


sign is used — value whose sign is set)
+ — (pronounced “plus-minus”) negates the sign of the second
stack value if the sign of the top stack value is negative. The
top value is then dropped.
The following truth table describes the outcome of all
possible combinations:

Second Top of
Entry Stack Result
+V2 +V1 +V2
+V2 -VI -V2
-V2 +V1 —V2
—V2 -VI +V2

16
Refer to ABS and D + —
FORTH-79: No equivalent.

+ BUF (buffer address — next buffer address


\ flag)
+ BUF (pronounced “plus-buff”) advances the specified buffer
address to the address of the next buffer.
The action of + BUF is directly related to the physical
arrangement of the buffers in a FORTH system. A system
normally contains several buffers.
These buffers are located in memory as a contiguous buffer
array. While the buffers are physically continguous, they are
logically treated as a “circular” array. A reference to + BUF
always returns the address of the next buffer in the circular
array.
Refer to BLOCK ,PREV ,UPDATE ,and BUFFER.
FORTH-79: No equivalent.

+ LOOP (increment value —)


+ LOOP (pronounced “plus-loop”) is used to end a
DO.. . + LOOP structure by incrementing the loop Index by the
specified value and comparing it with the Limit value. (This
action is actually performed by (+ LOOP) .)
If the increment value is positive, a branch back to the “loop
body” of the loop structure is executed if the Index is either
larger than or equal to the Limit. If the increment value is
negative, a branch back to the “loop body” is executed if the
Index is larger than the Limit. If a “loop” back is not
executed, the Index and Limit are dropped from the return
stack, and execution continues with the definition following
the DO. . . + LOOP.
+ LOOP may only be used within a colon definition.
Refer to (+ LOOP) DO LOOP ,and (DO)
FORTH-79: Is equivalent.

17
+ ORIGIN

COMPILE TIME: (—) (Sequence 2)

EXECUTION TIME: (offset — address)


(Sequence 3)

+ ORIGIN (pronounced “plus-origin”) is a compiler word and


therefore exhibits both compile time and execution time
actions. + ORIGIN is used to obtain the address of a particular
start-up parameter located within the “origin parameters.”
The “ORIGIN” is a location in the FORTH system that marks
the beginning of a series of parameters primarily used to
initialize the system. By supplying + ORIGIN with an offset,
the address of a specific parameter is obtained.
Refer to COLD and the user variables SO , RO , TIB , WIDTH
FENCE ,DP , WARNING ,and VOC-LINK.
FORTH-79: No equivalent.

(value —)
(pronounced “comma”) compiles (i.e., stores) the 16-bit value
on the top of the parameter stack into the next available
dictionary location and advances the dictionary pointer.
is the primary compiler word. This is the principal means
of compiling a word into the dictionary (e.g., INTERPRET uses
,to compile definitions into the dictionary).
Refer to INTERPRET.
FORTH-79: Is equivalent.

— (minuend \ subtrahend — difference)


— (pronounced “subtract,” or “minus” in FORTH-79) is a
signed single precision subtraction that subtracts the entry on
the top of the stack from the second stack entry and replaces
both values with their difference.
Refer to MINUS
FORTH-79: Is equivalent.

18
-->(—)
— —> (pronounced “next-block”) is used at the end of a text
screen in place of ;S to force interpretation to continue on to
the next sequential screen.
Note: It is not “legal” to continue a colon definition onto the
next screen (i.e., a ; must terminate a definition before a — —>
is issued).
— —> is an IMMEDIATE word.
Refer to LOAD and INTERPRET.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

-DUP

If zero: (valuel — valuel)


If non-zero: (valuel — valuel \ valuel)
—DUP (pronounced “dash-dupe”) duplicates the top of the
parameter stack if its value is non-zero.
Refer to IF
FORTH-79: Is equivalent to ?DUP (“query-dupe”).

-FIND

Successful: (— PFA \ length \ true flag)


Unsuccessful: (— false flag)
—FIND (pronounced “dash-find”) reads a word from the input
stream and then searches the CONTEXT and CURRENT
vocabularies for a definition whose name matches the input
word. The next text word in the input stream (delimited by
blanks) is used as the character string to search for.
Refer to (FIND) and WORD.
The closest FORTH-79 equivalent to —FIND is FIND

19
—TRAILING ( beginning addr \ count —
beginning addr \ count)
—TRAILING (pronounced “dash-trailing”) supresses trailing
blanks when outputting a character string with TYPE . Using
these parameters, —TRAILING examines the character string
and reduces the character count so that trailing blanks are not
output by a subsequent TYPE . —TRAILING scans backward
from the last character toward the first character. The first non-
blank character encountered stops the scan.
Refer to COUNT and TYPE.
FORTH-79: Is equivalent.

• (value to be output —)
• (pronounced “dot”) performs a binary-to-ascii conversion
(pictured numeric output) on the 16-bit signed value on the
top of the stack and prints the result (followed by one space)
on the output device. The sign is printed only if the value is
negative. The current value in BASE is used as the conversion
radix.
Use U. to display 16-bit values.
Refer to D. and D.R
FORTH-79: Is equivalent.

•,, ( — )
(pronounced “dot-quote”) is a special FORTH word that
exhibits both execution and compile time traits. The purpose
of .“ is to output a text string. When this string is output
depends upon the state of the system when the word is
executed. When execution begins, a test is made to determine
if the system is in execution or compile state.
is used in the form:

text string”

where the terminating delimiter is a “ (quote).

20
If the system is in execution state (i.e., .“ is not inside a
definition), the text string is output immediately. If the system
is in compile state, .“ behaves as a standard compiler word
and therefore exhibits both compilation time and execution
time behavior.
At compile time: The execution time procedure address (that
of (.“) ), the length of the string, and the string itself are
compiled into the Parameter Field of the definition.
At execution time: The procedure (.“) outputs the text string.
is defined as IMMEDIATE.
Refer to (.“)
FORTH-79: Is equivalent.

.LINE (line # \ screen # —)


LINE (pronounced “dot-line”) prints a line of text from a
screen stored on disk. Trailing blanks are suppressed and not
printed.
The constant C/L specifies the line length.
Refer to (LINE)
FORTH-79: No equivalent.

.R ( value \ field width —)


.R (pronounced “dot-R”) performs a binary-to-ascii conversion
(pictured numeric output) on the signed 16-bit value in the
second stack entry and prints the result right justified in a
field whose minimum width is specified by the value on the
top of the stack.
Note, however, that the field width parameter specifies only
a minimum field width. The entire value is always printed
even if it exceeds the specified field width. No truncation
occurs, and no trailing blank is printed.
The current value in BASE is used as the conversion radix.
Refer to D.R.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

21
/ ( dividend \ divisor — quotient)
/ (pronounced “divide”) divides a 16-bit signed single
precision value by another 16-bit signed single precision value
and replaces them with their 16-bit signed quotient. The
second stack value is divided by the top stack value.
The basis of / is /MOD . /MOD leaves a quotient and
remainder. / drops this reminder. This is very similar (but
opposite) to MOD , which drops the quotient.
Refer to /MOD
FORTH-79: Is equivalent.

/MOD (dividend \ divisor — remainder \


quotient)
/MOD (pronounced “divide-mod”) divides a 16-bit signed
single precision value by another 16-bit signed single precision
value and replaces them with a 16-bit signed quotient and a
16-bit signed remainder. The remainder takes its sign from the
dividend.
Note that /MOD uses a single precision dividend while MI
uses a double precision dividend.
Refer to M/
FORTH-79: Is equivalent.

O(—O)
o is a single precision CONSTANT value. To save compiling
time, this value has been made into a CONSTANT.
FORTH-79: No equivalent.

0< (value — truth flag)


0< (pronounced “zero-less-than”) examines a signed value on
the top of the parameter stack and replaces it with a true flag
(1) if the number is less than zero (negative) or with a false
flag (0) if the number is greater than or equal to zero.
22
0< is a low level code primitive.
Refer to SIGN
FORTH-79: Is equivalent.

0= (value—truth flag)
0= (pronounced “zero-equal”) examines the value at the top
of the parameter stack and replaces it with a true flag (1) if the
value is equal to 0 or with a false flag (0) if the value is not
equal to 0.
0= is a low level code primitive.
FORTH-79: Is equivalent.

OBRANCH (truth flag —)

This execution time (Sequence 3) code (pronounced “zerobranch”)


is compiled into a definition (Sequence 2) by IF
UNTIL , and WHILE to perform a conditional branch. If the
flag on the top of the parameter stack is 0 (false), the offset to
which IP points at entry is added to IP to cause either a
forward or backward branch, depending upon the value of the
offset. If the flag is non-zero (true), no branch is taken.
OBRANCH is a low level code primitive.
Refer to IF UNTIL , WHILE ,and BRANCH.
FORTH-79: No equivalent.

1(—1)

1 is a single precision CONSTANT value. To save compiling


time, this value has been made into a CONSTANT.
FORTH-79: No equivalent.

1+ (value—value+1)

1+ (pronounced “one-plus”) adds 1 to the value on the top of


the parameter stack.
Note: The algebraic rules of signed addition apply here.
FORTH-79: Is equivalent.

23
2(—2)

2 is a single precision CONSTANT value. To save compiling


time, this value has been made into a CONSTANT.
FORTH-79: No equivalent.

2+ (value—value+2)
2+ (pronounced “two-plus”) adds 2 to the 16-bit value on the
top of the parameter stack.
Note: The algebraic rules of signed addition apply here.
FORTH-79: Is equivalent.

3(—3)
3 is a single precision CONSTANT value. To save compiling
time, this value has been made into a CONSTANT.
FORTH-79: No equivalent.

(pronounced “colon”) is the defining word used to create


(i.e., define) a high level FORTH definition. A colon definition
is terminated with either or CODE . It is used in this format:

specified name body of definition

is a defining word and therefore exhibits both compilation


time and execution time actions.
The compile time (Sequence 2) action of : is to create a
definition header in the dictionary for the name specified and
enter compile mode by setting the user variable STATE to a
non-zero value (see STATE ). The CONTEXT vocabulary is set
the same as the CURRENT vocabulary.
The Code Address of the execution time portion of is
compiled into the CFA of every colon definition word. The
execution time (Sequence 3) action of : is to save the current
position of IP and begin execution of the body of this
definition (i.e., thread “down” one level of threaded code).

24
Note that : is an IMMEDIATE word.
Refer to STATE and VOCABULARY.
FORTH-79: Is equivalent.

COMPILE TIME: (—) (Sequence 2)


EXECUTION TIME: (—) (Sequence 3)
(pronounced “semicolon”) is a compilation word and
therefore exhibits both compilation time and execution time
actions.
is used to terminate a (“colon”) definition.
The compile time (Sequence 2) action of ; is:

1. To compile 5 (the execution time procedure of ) into the


definition being created.
2. To SMUDGE the smudge bit.
3. To place the system back into interpret mode (from compile
mode) so that the next input data stream word can be
interpreted.

The execution action (Sequence 3) of ; is actually that of 5


Basically, 5 “chains back” up one level of nesting and
“returns control” to the definition that “called” the definition
now executing 5
Note that ; is an IMMEDIATE word.
Refer to 5 and
FORTH-79: Is equivalent.

;CODE

DEFINITION TIME: (—) (Sequence 1)

EXECUTION TIME: (—) (Sequence 2)

;CODE (pronounced “semicolon-code”) is a defining word and


therefore exhibits both definition time and execution time
actions.

25
CODE is a Sequence 1 defining word that creates Sequence
2 defining words. CODE is used in conjunction with another
defining word (one that creates the header of the defining
word being created) to create defining words (“parents”) that
in turn create other words (“children”).
When creating a defining word (at Sequence 1), CODE acts
as a dividing line between the high level words that create the
“child” (at Sequence 2) and the assembly language code words
that are the “child’s” run time procedure (at the “child’s”
Sequence 3).
The function of CODE is very similiar to that of DOES>
except that CODE defines the beginning of a code procedure,
while DOES> defines the beginning of a high level procedure.
CODE also SMUDGEs the header created by whatever
defining word was used to begin the definition.
Note that the Version 1.1 fig-FORTH Model does not set
CONTEXT to the ASSEMBLER vocabulary. To rectify this
problem, the word ASSEMBLER should immediately follow
CODE.
;CODE only executes at Sequence 1. (;CODE) executes at
Sequence 2.
The end effect of CODE is that the dictionary definition
structure of the “child” is determined by the words preceding
;CODE ; but when the “child” executes at Sequence 3, the
code following CODE is executed.
This allows whole new families of dictionary structures and
the code to process these structures to exist. An example of a
structure could be a graphics control table while the code
following ;CODE could display the table.
Note that CODE is an IMMEDIATE word.
Refer to (;CODE) ,DOES> ,and <BUILDS
FORTH-79: No equivalent.

;S (—)

;S (pronounced “semicolon-S”) is the execution time


(Sequence 3) procedure compiled by ; . Its purpose, at the end
of a colon definition, is to “chain back” to the next higher
level by popping the return address of the calling procedure
off of the return stack.

26
;S is also used to stop interpretation of a screen.
;S is a low level code primitive.
FORTH-79: Is equivalent to EXIT

<(valuel \ value2 — flag)

< (pronounced “less-than”) performs a signed comparison of


the top two single precision values on the parameter stack and
replaces them with a Boolean truth flag. The flag is true (nonzero)
if the second stack entry is less than the top stack entry
(hence the name “less-than”). Otherwise the flag is false (0) if
the second stack entry is equal to or greater than the top entry.
FORTH-79: Is equivalent.

<# (—) (See note)

<# (pronounced “less-than-sharp”) begins a double precision


integer pictured numeric conversion expression. The specific
purpose of <# is to initialize the pointer in HLD to aim at the
beginning of PAD
Note: Although this word does not require any entry
parameters, the top of the parameter stack should contain a 31-
bit value to be converted and output (see # ) with its high
order portion in the first entry and its low order portion in the
second entry. (Note the 31-bit value.) # correctly converts only
positive values.
Pictured numeric conversion converts values on the stack
into ascii strings that are formatted according to picture
specifications. This is similar in concept to the BASIC PRINT
USING or COBOL PICTURE statements.
The character string is created in memory, starting one byte
before PAD and working backward toward low memory. The
conversion takes place one digit at a time, starting with the
one’s column, then the ten’s column, and so one. (That is why
memory is filled in a right-to-left direction.)
The user variable HLD contains a pointer to the last
converted character (see HOLD ).
For example, the general structure of a picture numeric
expression is:

27
<# SIGN
start one multiple sign end
digit digits

Refer to # ,#> ,SIGN ,HLD ,and HOLD.


FORTH-79: Is equivalent.

<BUILDS

DEFINITION TIME: (—) (Sequence 1)


EXECUTION TIME: (—) (Sequence 3)
<BUILDS (pronounced “builds”) is a defining word and
therefore exhibits both definition time and execution time
actions.
<BUILDS is a Sequence I defining word that is used to
create Sequence 2 defining words. Words created by <BUILDS
are then used to create other words. For example, <BUILDS
(Sequence I) is used to create the defining word
VOCABULARY (Sequence 2), that in turn creates vocabulary
definitions such as FORTH ,EDITOR, and ASSEMBLER.
Such a word is then executed (Sequence 3) to set the point at
which dictionary searches start.
<BUILDS is normally used in conjunction with DOES>
When used this way, <BUILDS “builds” a dictionary header
for the new definition. Refer to Figure 1.
The definitions between <BUILDS and DOES> are executed
at compilation time (Sequence 2) while creating a new
definition. The words following DOES> are executed at
Sequence 3 time when executing the new definition. (Refer to
Figure 1.)
The compile time (Sequence 2) action of <BUILDS is simply
to “build” a dictionary header for the new definition. This
header is actually the definition for the constant 0. DOES>
then overlays this header with execution time (Sequence 3)
pointers for the word (refer to DOES> ) . The CFA is overlaid
to point to the execution time code for DOES> . The first
entry in the Parameter Field (the 0) is overlaid with the
address of the new definition’s execution time (Sequence 3)

28
C’) . !
c: 0
0 . i5 . 0
C LLLLL
a) . a) . )
E cV
Cl) z
0
: ‘b —
QiQ)

a)
E U) a) !?
)
20a) DD A D

Li1 D0 :><
<

.Cnz
EcV ci E
0
L
><
q)q)
.
a)
0 0
Q- i

C
0
a)
o Cl)

(I)
C.) A
C (I) a)c’
-J
0 w-9
Qci
O a)a)
Cl) Q
a)

29
definitions. This is the address of the first word following
DOES>.
Refer to DOES> , VOCABULARY ,FORTH and CODE.
FORTH-79: Is equivalent to CREATE. Refer to FORTH-79
Standard.

= (valuel \ value2 — flag)


= (pronounced “equals”) compares the top two values on
the parameter stack and replaces them with a Boolean flag.
The flag is true (1) if the values are equal; it is false (0) if the
values are not equal.
FORTH-79: Is equivalent.

> (valuel \ value2 — truth flag)

> (pronounced “greater-than”) compares the two topmost


signed 16-bit values on the parameter stack and replaces them
with a truth flag. The truth flag is set true (non-zero) if the
second value is greater than the top of the stack value and
false (0) if it is less than or equal to the top of the stack value.
FORTH-79: Is equivalent.

>R ( value to be placed onto return stack —)

>R (pronounced “to-R”) pops a number from the top of the


parameter stack and pushes it onto the top of the return stack.
Note: Care must be taken to ensure that the return stack is
restored to its original condition before returning to the calling
procedure.
Refer to R>
FORTH-79: Is equivalent.

? ( address of value to be output —)

? (pronounced “question-mark”) performs a binary-to-ascii


conversion on the signed 16-bit value contents of the specified

30
memory location and prints the result on the output device.
The current value in BASE is the conversion radix.
Refer to D.R
FORTH-79: Is equivalent.

?COMP (—)

?COMP (pronounced “question-compile”) issues Error Message


I1H (“COMPILATION ONLY, USE IN DEFINITION”) and
executes a QUIT if the system is not in compile mode. In this
case, compile mode is defined as the user variable STATE
containing a non-zero value.
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.
Refer to WARNING ,MESSAGE ,STATE ,?ERROR,
(ABORT) ,QUIT ,and COMPILE.
FORTH-79: No equivalent.

?CSP (—)
?CSP (pronounced “question-C-S-P”) issues Error Message 14H
(“DEFINITION NOT FINISHED”) and executes a QUIT if the
current parameter stack pointer position does not equal that
stored in the user variable CSP
This is most often used in compiler security, since an
unbalanced stack often reflects a compilation error. Normally,
a !CSP is used to save the stack pointer position when
beginning compilation (e.g., in : ) and ?CSP is used to check it
when finishing compiling (e.g., in ; ).
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.
Refer to WARNING , MESSAGE , ?ERROR, STATE,
(ABORT) , and QUIT.
FORTH-79: No equivalent.

31
?ERROR (truth flag \ Error Message
Number —)
?ERROR (pronounced “question-error”) issues the specified
error message and executes a QUIT if the truth flag is true
(non-zero).
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.
Refer to ?ERROR ,MESSAGE , WARNING ,QUIT ,ABORT,
and (ABORT)
FORTH-79: No equivalent.

?EXEC (—)

?EXEC (pronounced “question-execute”) issues Error Message


12H (“EXECUTION ONLY”) and executes a QUIT if the system
is not in execute mode. In this case, execution mode is defined
as the user variable STATE containing a value of zero.
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.
Refer to WARNING, STATE , ?ERROR, (ABORT) ,and
QUIT.
FORTH-79: No equivalent.

?LOADING (—)

?LOADING (pronounced “question-loading”) issues Error


Message 16H (“USE ONLY WHEN LOADING”) and executes a
QUIT if the system is not loading from disk.
The system normally receives input from disk (loading) or
from the terminal keyboard. The user variable BLK contains 0
if the system is receiving input from the terminal input buffer.
?LOADING tests the contents of BLK and issues the error
message if BLK contains 0.
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.

32
Refer to ?ERROR , STATE , MESSAGE ,WARNING,
(ABORT) ,and QUIT.
FORTH-79: No equivalent.

?PAIRS (valuel \ value2 —)


?PAIRS (pronounced “question-pairs”) issues Error Message
13H (“CONDITIONALS NOT PAIRED”) and executes a QUIT if
the top two 16-bit values on the parameter stack are not equal.
This word is normally used during compilation to evaluate
compilation conditionals.
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.
Refer to ?ERROR , WARNING ,MESSAGE ,STATE,
(ABORT) ,AND QUIT.
FORTH-79: No equivalent.

?STACK (—)
?STACK (pronounced “question-stack”) is an installation
dependent word tht checks for stack underfiow and stack
overflow and executes ?ERROR if either condition has
occurred.
Stack underfiow generally occurs when the stack pointer has
“backed up” behind the initial starting location (“EMPTY
STACK”). Stack overflow generally occurs when the stack has
“grown” into the PAD area just below the end of the
dictionary (“STACK OVERFLOW”).
When an error message is issued, the exact nature of the
action taken depends upon the contents of the user variable
WARNING.
Refer to ?ERROR , WARNING ,MESSAGE ,QUIT ,ABORT,
and (ABORT)
FORTH-79: No equivalent.

33
?TERMINAL (— flag)
?TERMINAL (pronounced “question-terminal”) is an
installation dependent word that normally determines whether
there is a character ready to be input from a terminal.
This word is sometimes used to determine first if the break
key has been pressed, then if any other key has been pressed.
A true flag (1) indicates that a character is ready. KEY can
then be used to read that character. A false flag (0) indicates
that no key has been pressed.
?TERMINAL is a low level code primitive.
FORTH-79: No equivalent.

@ (memory address — 16-bit memory


contents)
(pronounced “fetch”) replaces the 16-bit address on the top
of the parameter stack with the 16-bit memory contents of that
address. fr is the primary means in FORTH of accessing data
stored in memory.
C@ fetches byte values.
is a low level code primitive.
Refer to C@
FORTH-79: Is equivalent.

ABORT(—)
ABORT can be considered the warm start routine for the
FORTH system. ABORT resets the parameter stack, displays a
start-up message, sets CONTEXT and CURRENT to FORTH
sets BASE to DECIMAL , and issues a QUIT (which stops any
compilation and starts interpretation from the input terminal).
ABORT is commonly called by (ABORT) when WARNING
is — I and an error condition has been detected.
Refer to (ABORT) ,COLD ,and QUIT.
FORTH-79: Is equivaient.

34
ABS (signed value — absolute value)
ABS (pronounced “absolute”) converts a signed single
precision value on the top of the parameter stack into its
absolute unsigned value.
FORTH-79: Is equivalent.

AGAIN(—)

AGAIN marks the end of an infinite ioop structure in the form:

BEGIN “Loop Body” AGAIN

There is no exit from a BEGIN. . AGAIN loop. If an exit is


necessary, another type of loop structure should be used.
BEGIN. . AGAIN loop structures must always be used within
a colon definition.
AGAIN unconditionally branches back to its corresponding
BEGIN (i.e., the beginning of the “loop body”). AGAIN accepts
no input parameters and leaves nothing on the stack.
Note that AGAIN is an IMMEDIATE word.
Refer to BEGIN and BRANCH.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

ALLOT ( number of storage locations —)

ALLOT advances DP the specified number of storage locations.


Its primary purpose is to reserve or “allot” memory space in
the dictionary. The particular length of a storage location is
dependent upon the address type of the machine.
Refer to DP
FORTH-79: Is equivalent.

AND (valuel \ value2 — logical result)

AND performs a bit-wise logical AND function on the top two


values on the parameter stack and replaces them with their
logical result.

35
AND is a low level code primitive.
FORTH-79: Is equivalent.

B/BUF (— bytes per buffer)

B/BUF (pronounced “bytes-per-buffer”) is a single precision


CONSTANT value. This constant places the number of bytes
per disk buffer onto the top of the parameter stack. This value
reflects the number of bytes transferred between mass storage
and memory by BLOCK.
Refer to BUFFER, + BUF ,BLOCK ,LIMIT ,and FIRST.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.” Note that the size of a FORTH-79 buffer is 1024
bytes (1K).

B/SCR ( — blocks per screen)

B/SCR (pronounced “blocks-per-screen”) is a single precision


CONSTANT value. This constant places the number of blocks
per editing screen onto the top of the parameter stack. By
convention, an editing screen in FORTH contains 1024
(decimal) or 1K characters.
FORTH-79: No equivalent.

BACK ( entry point address —)

BACK is primarily used while compiling ioop structure words


at Sequence 2. It resolves the supplied address into a
backward branch offset and compiles the offset into the
dictionary.
For example, during compilation (Sequence 2), DO supplies
the beginning address of the “loop body” to LOOP . BACK
(contained in LOOP ) converts this address into an offset and
then compiles it for (LOOP) to use when “branching back”
during execution time (Sequence 3).
Note: Although BACK is a word used by compiler words, it
is not an IMMEDIATE word itself.
Refer to DO ,LOOP , and + LOOP.
FORTH-79: No equivalent.

36
BASE (— data address)
BASE is a 16-bit single precision user variable that contains
the current number base (or radix) used for input and output
numeric conversion.
HEX and DECIMAL are examples of words that set BASE
Executing HEX stores 16 (decimal) into BASE . Executing
DECIMAL stores 10 (decimal) into BASE
Refer to HEX , DECIMAL, (NUMBER) , . ,and USER.
FORTH-79: Is equivalent.

BEGIN (—)

BEGIN marks the beginning of an indefinite, repetitive loop


structure. It is used as the beginning of three types of loops in
the forms:

BEGIN “Loop Body” AGAIN


BEGIN “Loop Body” “Set Conditional” UNTIL
BEGIN “Set Conditional” WHILE “True Portion” REPEAT

A BEGIN-type ioop structure must always be used within a


colon definition.
BEGIN-type loops differ from DO. . LOOP ‘s in that a BEGIN
loop is not limited from its start to a specified number of
passes through the loop as is a DO. . LOOP . Once started, a
BEGIN-type loop may execute indefinitely or, for some
structures, until a specified condition is met.
BEGIN serves as a return entry point for the “loop back”
word at the end of the structure.
Note that BEGIN is an IMMEDIATE word.
Refer to UNTIL AGAIN , WHILE ,and REPEAT.
FORTH-79: Is equivalent.

BL (— 20H)

BL (pronounced “B-L”) is a single precision CONSTANT value


that places the ascii value for the character “blank” (or

37
“space”) onto the top of the parameter stack. Referencing a
blank via the name BL makes FORTH more readable.
Refer to WORD.
FORTH-79: No equivalent.

BLANKS (beginning address \ # of bytes to


blank —)

BLANKS clears a specified region of memory to ascii blanks


(20H).
Refer to FILL
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

BLK (— data address)

BLK (pronounced “B-L-K”) is a 16-bit single precision user


variable containing the number of the block currently being
interpreted. IF BLK contains 0, the input data stream is from
the terminal.
WORD references BLK to determine the address of the input
data stream. Load and — —> set BLK with the mass storage
block being transferred to memory. QUIT sets BLK to 0,
meaning that input is from the terminal.
Refer to WORD , LOAD, — —> , and USER.
FORTH-79: Is equivalent.

BLOCK ( desired block number — data


address of desired block)

BLOCK accesses data kept in mass storage. BLOCK is a virtual


memory type access word. This means the desired block
number is replaced with the memory address of that block.
The type of storage, the device number, and other physical
attributes may be treated as being transparent to the external
operation of the word. This also means that data that has been
flagged as modified, but that still resides in memory, is written

38
back to storage before that location is overwritten with new
data.
Refer to BUFFER , B/BUF , UPDATE FLUSH , OFFSET,
DRO , DR1 , and R/W.
FORTH-79: Is equivalent.

BRANCH (—)

This execution time (Sequence 3) code is compiled into a


definition (during Sequence 2) by ELSE , AGAIN LOOP
+ LOOP ,and REPEAT to cause an unconditional branch.
BRANCH is a low level code primitive.
Refer to ELSE , AGAIN ,LOOP , + LOOP ,and REPEAT.
FORTH-79: No equivalent.

BUFFER (block number — data address)

BUFFER is a buffer management word that obtains the address


of a buffer to be used for transferring data from mass storage
(usually disk) to memory. BUFFER also writes the data portion
of any buffers flagged as “updated” to disk.
Before any data transfer occurs, a buffer must be allocated. It
is the purpose of BUFFER to perform and manage this
allocation process.
BUFFER stores the address of the next buffer to allocate (i.e.,
“use”) into the system variable USE
Refer to BLOCK, + BUF ,USE ,PREV ,and FLUSH.
FORTH-79: Is equivalent.

C! (byte \ address —)

C! (pronounced “C-store”) stores a byte (or “character”) from


the top of the stack into the specified memory location. C@
has the opposite effect of C!
C! is a low level code primitive.
Refer to C and !
FORTH-79: Is equivalent.

39
C, (single byte value —)
C, (pronounced “C-comma”) stores the low order single byte,
or character, from the top of the parameter stack into the next
available dictionary location and advances OP
Refer to OP
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

C/L (— characters per editing line)


C/L (pronounced “C-slash-L”) is a single precision CONSTANT
value. This constant places the number of characters per
editing line onto the top of the parameter stack. FORTH
editing screens normally consist of 1024 (decimal) characters
organized as 16 lines of 64 characters each.
FORTH-79: No equivalent.

C@ (address — byte)

C@ (pronounced “C-fetch”) replaces an address on the top of


the parameter stack with the 8-bit contents of that memory
location.
C@ is a low level code primitive.
Refer to
FORTH-79: Is equivalent.

CFA (Parameter Field Address — Code Field


Address)
CFA (pronounced “C-F-A”) converts a given Parameter Field
Address ( PFA ) of a dictionary definition into its Code Field
Address (CFA).
Refer to NFA , LFA ,and PFA
FORTH-79: No equivalent. A FORTH-79 program may not
address into a definition’s Code Field.

40
CMOVE ( source \ destination \ length —)
CMOVE (pronounced “C-move”) is a character (byte) oriented
word that moves a character string byte-by-byte from the
source address to the destination proceeding toward high
memory. Note that bytes are moved from the beginning of the
string first; therefore the destination string cannot overlap the
source string. (Some versions of FORTH use the word
<CMOVE (backward CMOVE) to move strings that overlap in
this manner.)
Note, however, that if the destination address is 1 byte
higher than the source address, CMOVE will ripple the first
byte throughout the specified length of memory.
CMOVE is a low level code primitive.
FORTH-79: Is equivalent.

COLD (—)

COLD is the “cold start” routine for the FORTH system. The
purpose of COLD is to initialize user variables to their start-up
values and then call ABORT
COLD may be executed from the terminal. Its effect is to
remove all definitions except the basic FORTH vocabulary and
reset the system.
COLD performs seven basic tasks:

1. Empties the buffers.


2. Sets disk density.
3. Initializes USE and PREV buffer pointers.
4. Selects Drive 0 as the mass storage device.
5. Disables the printer.
6. Initializes the following USER variables: SO , RO , TIB
WIDTH WARNING , FENCE ,DP , and VOC-LINK.
7. Calls ABORT.

Note: The exact nature of COLD is installation dependent.


FORTH-79: No equivalent.

41
COMPILE

COMPILE TIME: (—) (Sequence 2)

EXECUTION TIME: (—) (Sequence 3)

COMPILE is a “form” of compiler word and therefore has two


sets of actions, an apparent compile time action (Sequence 2)
and an execution time action (Sequence 3).
COMPILE causes the CFA of the word immediately
following COMPILE (in the input data stream) to be compiled
into a definition. The CFA to be compiled is specified at
Sequence 1 time when COMPILE is itself compiled into a
compiler or defining word (i.e., the “parent”).
COMPILE TIME: How this “CFA specification” occurs is
quite simple. When COMPILE is encountered in the input data
stream, its CFA is automatically compiled by the Interpreter.
When the word following CFA is encountered (i.e., the
“specified” word), its CFA is also automatically compiled into
the dictionary immediately following COMPILE ‘s CFA. Note
that this is a normal compilation sequence. There is no
correlation between COMPILE and the word “to be compiled”
except that the CFA of the word “to be compiled”
immediately follows the CFA of COMPILE
EXECUTION TIME: Since COMPILE performs compiling, it
is important to keep in mind that COMPILE ‘s execution time
(Sequence 3) occurs at the word “to be compiled’s” (i.e., the
“child’s”) compilation time (Sequence 2).
The specified CFA is actually compiled into a definition at
Sequence 2 time when the compiler/defining word (the
“parent”) executes (creates a “child”), thereby executing
COMPILE.
When COMPILE executes, the CFA it is to compile into the
definition being compiled is physically located in the next
Parameter Field location following COMPILE ‘s CFA . This is
also the location of the next CFA to be executed, and therefore
the address of this location has been placed onto the top of
the return stack by the run time procedure of : (colon).
COMPILE obtains this address from the return stack, uses it
to fetch the specified CFA, then increments the address by 2
and returns it to the return stack. This skips over the

42
“specified” CFA and causes the location following the
specified CFA to be executed when COMPILE finishes.
This concept of specifying the name of the definition to be
compiled at Sequence 1 but not actually compiling it into a
definition until Sequence 2 is called “deferred compilation.”
Refer to INTERPRET and IF
FORTH-79: Is equivalent.

CONSTANT

COMPILE TIME: (value —) (Sequence 2)

EXECUTION TIME: (— value) (Sequence 3)

CONSTANT is a defining word and therefore exhibits both


definition time and execution time actions.
A CONSTANT in FORTH has the same effect as a constant
in most other computer languages, that is, a memory location
containing a fixed value that can be referenced via a name.
CONSTANT does differ from other languages in that it is
active. When the constant name is executed, the constant
value is placed onto the top of the parameter stack.
The compile time action of CONSTANT is to define a named
16-bit constant in the form:

n CONSTANT cccc

where n is the constant’s value and cccc is the value’s


assigned name (e.g., 26 CONSTANT MAX-LETTERS).
The execution time action of CONSTANT , when the named
constant is referenced, is to push this 16-bit value onto the top
of the parameter stack.
Refer to VARIABLE and + BUF
FORTH-79: Is equivalent.

CONTEXT (— data address)

CONTEXT is a user variable containing a pointer to the


vocabulary that is to be searched first.

43
CONTEXT is set to point to a specific vocabulary by
executing that vocabulary name. For example, FORTH causes
CONTEXT to be aimed at the FORTH vocabulary. At system
start-up, CONTEXT is initialized to FORTH by ABORT , which
is called by COLD . Note that this means that any time after
an ABORT occurs, CONTEXT will be aimed at the FORTH
vocabulary.
Refer to VOCABULARY , ABORT , and USER.
FORTH-79: Is equivalent.

COUNT (text string address — text address \


char count)

COUNT replaces the address of a text string with the byte


length and byte address of the text string. The first byte of the
text string must contain the string length. The text must begin
at the second byte. ( WORD automatically provides this
format.)

BEFORE AFTER

Top of stack points here — Top of Stack = 4


Second entry points here
4FROG 4FROG
____ 1’
Refer to TYPE
FORTH-79: Is equivalent.

CR (—)
CR (pronounced “carriage-return”) is an installation dependent
word that usually transmits a carriage return and a line feed to
the selected output device.
CR is a low level code primitive.
FORTH-79: Is equivalent.
44
CREATE (—)
CREATE is a defining word used to “create” the header
portion of a FORTH definition. It is used in the form:
CREATE definition name

CREATE builds a standard FORTH header. In other words, it


creates a Name Field, a Link Field, and a Code Field. Words
that directly use CREATE are classified as being “defining
words.”
Refer to WIDTH , VOCABULARY ,CURRENT WARNING,
and
FORTH-79: Refer to Standard. In FORTH-79, CREATE has
the same meaning as the fig-FORTH <BUILDS

CSP (— data address)


CSP (pronounced “C-S-P”) is a 16-bit single precision user
variable that is used as a temporary storage location for the
stack pointer position.
Refer to : , !CSP , ?CSP , and USER
FORTH-79: No equivalent.

CURRENT (— data address)


CURRENT is a user variable containing a pointer to the
vocabulary to which definitions are “currently” being
appended.
CURRENT is set to point to a specific vocabulary by
executing the word DEFINITIONS , which copies the
vocabulary pointer in CONTEXT into CURRENT . At system
start-up, CURRENT is initialized to FORTH by ABORT , which
is called by COLD . Note that this means after an ABORT
occurs, CURRENT will be aimed at the FORTH vocabulary.
Refer to DEFINITIONS ,VOCABULARY , ABORT ,and
USER.
FORTH-79: Is equivalent.

45
D + (double \ double — 32-bit sum)
o + (pronounced “0-plus”) adds the top two 32-bit signed
values on the parameter stack and replaces them with their
32-bit signed sum.
Note that generation of a carry goes unnoticed.
0+ is a low level code primitive.
FORTH-79: Is equivalent.

D + — (double \ single — double)


O + — (pronounced “0-plus-minus”) negates the sign of the
double precision value in the second and third stack entries if
the sign of the top single precision value is negative. The top
value is then dropped.
The following truth table describes the outcome of all
possible combinations:

Second Top of
Entry Stack Result
+02 +Vi +02
+02 -Vi -02
-02 +Vi -D2
-02 -Vi +02

FORTH-79: No equivalent.

D.(double—)

D. (pronounced “0-dot”) performs a binary-to-ascii conversion


(pictured numeric output) on the 32-bit signed double
precision value on the top of the stack and prints the result on
the output device followed by one space. The sign is displayed
only if the value is negative.
0. does not pad with blanks. Use 0.R if a specific minimum
field length is needed.
The current value in BASE is the conversion radix.
Refer to OR.
FORTH-79: Is equivalent.

46
D.R ( double \ field width —)
DR (pronounced “D-dot-R”) performs a binary-to-ascii
conversion (pictured numeric output) on a signed 32-bit
double precision value and prints the result in a right justified
field whose minimum width is specified by the value on the
top of the stack. D.R does not truncate values larger than the
field width, display the sign unless negative, or print a trailing
blank.
Use 0. if a minimum width field is not needed.
The current value in BASE is the conversion radix.
Refer to <# , , SIGN , #S , and #>.
FORTH-79: Is equivalent.

DABS ( signed double value — absolute


double value)
DABS (pronounced “D-ABS”) replaces a signed 32-bit double
precision number with its absolute value. That is, negative
values are made positive.
Refer to D + —
FORTH-79: Is equivalent.

DECIMAL (—)
DECIMAL sets the user variable BASE to 10 (decimal). This
causes all numeric inpilt and output conversions to be
performed in decimal (base 10).
Note that this is not an IMMEDIATE word.
Refer to (NUMBER) and BASE.
FORTH-79: Is equivalent.

DEFINITIONS (—)
DEFINITIONS specifies the vocabulary into which new
“definitions” are to be added.
DEFINITIONS copies the contents of the user variable
CONTEXT into CURRENT. CONTEXT points to the

47
vocabulary that is to be searched first when performing
dictionary searches and is set to point to a specific vocabulary
by stating (i.e., executing) the vocabulary name. The user
variable CURRENT points to the vocabulary that will
“currently” have new definitions appended to it.
Refer to VOCABULARY CURRENT ,CONTEXT , and
CREATE.
FORTH-79: Is equivalent.

DIGIT

In Range: (char \ base — binary digit \


true flag)
Out of Range: (char \ base — false flag)
DIGIT converts an ascii character into its binary equivalent
using the specified base value. Either the binary “digit” and a
true flag are returned or just a false flag is returned, depending
upon DIGIT ‘s success.
Validity checking is performed such that a character whose
original value is less than 30H (i.e., less than ascii “0”) or
between 3AH and 40H inclusive (greater than ascii “9” but
less than ascii “A”) is automatically invalid. After conversion
from ascii to binary, any “digit” larger than the specified base
is also invalid.
There is no ascii uper range validity test. The character may
be whatever scale the specified base allows.
DIGIT is a low level code primitive.
Refer to (NUMBER)
FORTH-79: No equivalent.

DLITERAL

COMPILE TIME: (double —) (Sequence 2)


EXECUTION TIME: (— double) (Sequence 3)
DLITERAL (pronounced “D-literal”) is a compiler word and
therefore exhibits both compilation time and execution time
actions.

48
Although DLITERAL has no effect when executed outside of
a colon definition, it does not signal an error.
The compile time action (Sequence 2) of DLITERAL is to
compile a dynamically calculated 32-bit value into a
definition. The end result of this compile action is the same as
using LIT twice.
The execution time action of DLITERAL is that of LIT . That
is, upon execution of each LIT , the compiled 16-bit value is
placed onto the top of the parameter stack.
Note that DLITERAL is an IMMEDIATE word.
Refer to LITERAL LIT , [ , ] ,and INTERPRET.
FORTH-79: No equivalent.

DMINUS ( double — negative double)


DMINUS (pronounced “D-minus”) replaces the 32-bit signed
value on the top of the parameter stack with its two’s
complement.
DMINUS is a low level code primitive.
FORTH-79: Is equivalent to DNEGATE.

DO ( Limit \ Index —)
DO marks the beginning of a fixed repetition loop structure.
This is identical in purpose to the FORTRAN DO and the
BASIC FOR statements. DO creates a DO. . LOOP in
conjunction with LOOP or + LOOP in the form:

DO “Loop Body” LOOP

DO “Loop Body” (Increment Value on Stack) + LOOP

The loop Index is accessible within the DO. . LOOP


structure by using the word I
A DO.. LOOP structure may be used only within a colon
definition.
Refer to LOOP , (LOOP) , + LOOP , (+ LOOP) , (DO)
and I.
FORTH-79: Is equivalent.

49
DOES>

DEFINITION TIME: (—) (Sequence 1)

EXECUTION TIME: (second Parameter Field


Address —) (Sequence 3)
DOES> (pronounced “does”) is a defining word and therefore
exhibits both definition time and execution time actions.
DOES> is a Sequence 1 defining word that creates Sequence
2 defining words. DOES> is normally used in conjunction
with <BUILDS to create defining words (“parents”) that in
turn create other words (“children”).
When creating a defining word (at Sequence 1), DOES> acts
as a dividing line between the high level words that create the
“child” (at Sequence 2) and the high level words that are the
“child’s” run time procedure (at the “child’s” Sequence 3).
CODE creates code level run time procedures. (See
Figure 2.)
The compile time action of DOES> is to overlay the “child”
definition’s Code Field with the address of the execution time
code for DOES> . It also overlays the first Parameter Field
location with the address of the definition following DOES> in
the “parent” definition. This is the address of the “child’s”
first execution time procedure. When words that are then
created with this defining word execute, the run time code of
DOES> transfers control to the procedure following DOES>
(Refer to Figure 3.)
The execution time portion of DOES> is DODOES . This
code performs two primary functions:
1. Places the address of the “child’s” Parameter Field (actually
the second entry in the Parameter Field) onto the top of the
parameter stack so that it will be available for the run time
procedure.
2. Nests the return address of the “child” definition being
executed and transfers control to the “child’s” run time
procedure (that is physically defined in the “parent”
defining word definition).

50
0
o

Q)Q)

. a)
0)
b
-Q•5•5•5 c A
a)
u:u:irj Cl)
: • o•
G) • Ecv w 5 G) W 2o
•_
-

L
q)q)
V E
0 X ‘!2
)
0 W

C
0

0 0)

0
U
C
0

a)

51
a)
E
C G)
G) 0
.C C
C

0
-J
•!5.? 2.
LLÜLL
o
•0
G)
Q
G)
Cl)
G) W o o

G)oI Ecx
C)
a)
G) V

•0
o w

V o
o
a)

“4L
o

G) G)

x
G) (I)

V
G)

G) G)
I
I
I
I C
C
U) 0
G)

VV Cl) 0 2 :.cD
i;’;
.c
0
z .? c G)
LU LLü -J
()
a) G) 0 -‘o •-

a
Ec V E
j0 0
‘2
cx
ix
c0 u)

=
C
Cfla)
0 iw LIJ •C
I Oo P
I
c
I
I 2? 1E
52
Note that many “children” can be created via a single
“parent” defining word and all of the “children” reference the
same execution time (Sequence 3) procedure located within
the “parent” definition.
Refer to <BUILDS , CODE ,and NEXT.
FORTH-79: Is equivalent. Note that the fig-FORTH Model
version of DOES> uses the first word of the Parameter Field as
a pointer to the execution time (Sequence 3) procedure.
FORTH-79 DOES> does not utilize the first Parameter Field
location.

DP (— data address)

DP (pronounced “D-P”) is a 16-bit single precision user


variable containing an address pointer to the next available
dictionary location. It is initialized during system start-up by
COLD with data from the origin parameter area.
The word HERE places the contents of DP onto the top of
the parameter stack. The words ALLOT and FORGET alter the
contents of DP
Note that DP is not always a user variable. The physical
location of DP is installation dependent (i.e., memory, a
register, etc.).
Refer to COLD , HERE , ALLOT, FORGET , and USER.
FORTH-79: No equivalent.

DPL (— data address)

DPL (pronounced “D-P-L”) is a 16-bit single precision user


variable that reflects the number of digits found to the right of
a decimal point when converting a numeric character string
into a numeric value. (Actually, it is relative to the last
decimal point encountered.) If a decimal point is not
encountered, NUMBER leaves a —1 in DPL.
INTERPRET uses the contents of DPL to determine whether
a numeric value is to be treated as single precision (i.e., DPL
contained —1, so no decimal point was encountered) or
double precision (i.e., DPL did not contain —1 50 a decimal
point was encountered).

53
Refer to NUMBER , (NUMBER) INTERPRET , and USER.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.” Note that DPL as described in the Referenced
Word Set is used for numeric output, not input.

DRO(—)

DR1(—)

DRO and DR1 are standard FORTH mass storage device


selection words. These words store a block number offset into
the user variable OFFSET so that the programmer can
reference a selected device as if the block numbers for that
device began with block 0.
Refer to BLOCK ,RJW ,and OFFSET.
FORTH-79: No equivalent.

DROP ( value to be dropped —)


DROP discards the 16-bit value presently on the top of the
parameter stack.
DROP is a low level code primitive.
FORTH-79: Is equivalent.

DUP ( value 1 — value 1 \ value 1)

DUP (pronounced “dupe”) duplicates the 16-bit value


presently on the top of the parameter stack.
DUP is a low level code primitive.
FORTH-79: Is equivalent.

ELSE (—)

ELSE is the beginning of the “false portion” of an IF structure


in the form:

IF “True Portion” ELSE “False Portion” THEN

54
(Beware. This differs in form from the PASCAL
IF. . .THEN. . ELSE structure.) The use of ELSE in this type of
structure is optional. If ELSE is omitted, a false Boolean input
causes control simply to branch to the word immediately
following the THEN . When used, ELSE must be located
within an IF. . ELSE. . .THEN structure.
An IF. . ELSE. . .THEN structure must be used within a
colon definition.
Note that ELSE is an IMMEDIATE word.
Refer to IF ,THEN , ENDIF ,and BRANCH.
FORTH-79: Is equivalent.

EMIT ( character to EMIT —)

EMIT outputs the character on the top of the stack to the


output device.
Refer to OUT
FORTH-79: Is equivalent.

EMPTY-BUFFERS (—)

EMPTY-BUFFERS erases the contents of all of the buffers to


zero. All update bits are erased to zero. Note that the null
terminating word at the end of each buffer is also reset to zero.
EMPTY-BUFFERS can be used to prevent modified (and
subsequently “updated” data) from being written and therefore
changing data already on the disk.
The name EMPTY-BUFFERS is purposely made rather
cumbersome to type to prevent accidental execution because of
its potentially destructive power.
Refer to + BUF , UPDATE ,and FLUSH.
FORTH-79: Is equivalent.

ENCLOSE (string addr \ delim — beg string


addr \ offset to 1st non-delim \ offset to 1st
delim \ offset to 1st unexamined char)
ENCLOSE performs a parsing function upon a given text
string.

55
Given a beginning text address and a delimiter character,
ENCLOSE scans the text and leaves its results on the stack.
These results are in the form of byte offsets from the beginning
of the text address. The parameters returned by ENCLOSE are
(1) an offset to the beginning of a delimited string (i.e., the
first non-blank character), (2) the offset to the end of that same
string, (3) the offset to the next byte to examine, and (4) the
original beginning address.
There are three specific conditions that may arise when
parsing any given character string. A description of each
condition and a description of the stack upon exit from that
condition follows:

Condition I
Scan encountered a null character before encountering any
non-delimiter characters.

Condition of stack at exit:


Top of stack: Offset to null.
Second entry: Offset to byte following null.
Third entry: Offset to null.
Fourth entry: Beginning address of character string to
examine.

Condition 2 Scan encountered non-delimiter character(s)


terminated by a null.

Condition of stack at exit:


Top of stack: Offset to null.
Second entry: Offset to null.
Third entry: Offset to first non-delimiter character.
Fourth entry: Beginning address of character string to
examine.

Condition 3 Scan encountered non-delimiter character(s)


terminated by a delimiter character.

56
Condition of stack at exit:
Top of stack: Offset of first unexamined character.
Second entry: Offset to first delimiter after non-delimiter
character(s).
Third entry: Offset to first non-delimiter character.
Fourth entry: Beginning address of character string to
examine.
ENCLOSE is a low level code primitive.
Refer to WORD.
FORTH-79: No equivalent.

END (truth flag —)

END has been replaced by UNTIL This is because END will


eventually replace ; . Therefore UNTIL is the preferred usage,
but END is still valid. Refer to UNTIL

ENDIF (—)

THEN is the preferred usage, but ENDIF is still valid. Refer to


THEN.

ERASE (beginning addr \ # of bytes to


erase —)
ERASE clears a specified region of memory to zeros.
Refer to FILL
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

ERROR ( message # — IN \ BLK)


ERROR displays some type of error message, stops
compilation, and restarts interpretation from the terminal. The
form of the error message to be displayed is governed by the
contents of the user variable WARNING

57
The contents of IN and BLK are saved to aid in determining
where and why the error occurred.
Refer to MESSAGE ,WARNING ,IN ,and BLK.
FORTH-79: No equivalent.

EXECUTE (Code Field Address —)


EXECUTE “executes” the definition whose CFA is on the top
of the parameter stack. That is, EXECUTE transfers control
to the definition whose CFA is on the top of the stack,
executes that definition only, and then returns control to the
next definition following EXECUTE
This is action identical in philosophy to the IBM 360/370 EX
instruction.
EXECUTE is the means by which vectored execution arrays
can be used in FORTH.
EXECUTE is a low level code primitive.
Refer to NEXT and INTERPRET.
FORTH-79: No equivalent.

EXPECT (beg text dest addr \ char count —)

EXPECT inputs characters from the terminal to the specified


address until the specified count is reached or until a carriage
return is encountered. EXPECT allows for backspace
characters.
At least one null is appended to the end of the text stream.
The carriage return character is always replaced with a blank
followed by a null. The blank and null are delimiters for
WORD and INTERPRET.
Refer to QUERY.
FORTH-79: Is equivalent.

FENCE (— data address)

FENCE is a 16-bit single precision user variable used in


conjunction with FORGET to set a boundary past which
FORGET cannot forget. This prevents inadvertently forgetting

58
too much of the dictionary. FENCE is initialized at start-up
time by COLD with data from the origin parameter area, but its
contents may be changed at any time to reflect a new
dictionary structure.
Refer to FORGET and USER.
FORTH-79: No equivalent.

FILL (start address \ count \ fill character—)

FILL “fills” each location of a specified region of memory with


a specified byte value.
The high level version of FILL (based on CMOVE ) works
correctly when filling read/write memory. However, it will not
work correctly when filling write-only memory such as
specialized video display memory. This is because the “ripple
fill” used by CMOVE requires that the byte being moved is
read from memory.
FILL is a low level code primitive.
FORTH-79: Is equivalent.

FIRST (— address)

FIRST is a single precision CONSTANT value. This constant


places the memory address of the “first” (lowest) block buffer
in the buffer array onto the top of the parameter stack.
Conversely, LIMIT is the constant that reflects the upper
“limit” (highest) block buffer address.
Refer to LIMIT, + BUF ,BLOCK ,and BUFFER.
FORTH-79: No equivalent.

FLD (— data address)

FLD (pronounced “F-L-D”) is a 16-bit single precision user


variable intended to control field length in pictured numeric
output.
FLD is not currently used in the fig-FORTH model.
FORTH-79: No equivalent.

59
FLUSH (—)
FLUSH writes to disk all the buffers in the buffer array that
have been flagged as “updated.” FLUSH is FORTH’s virtual
memory equivalent to “traditional” languages “write-to-disk”
command.
A buffer is flagged as being “updated” when the most
significant bit (i.e., the update bit) in the header portion of a
buffer is set. This update bit is set via the word UPDATE If
there are no “updated” buffers, FLUSH has no effect.
Executing EMPTY-BUFFERS prior to executing FLUSH means
that no data will be written to disk.
See BUFFER, + BUF , UPDATE , and BLOCK.
FORTH-79: Is equivalent to SAVE-BUFFERS.

FORGET (—)
FORGET deletes definitions from the dictionary. The specified
definition and all definitions following, up until the end of the
dictionary, are “forgotten.”
In the fig-FORTH version of FORGET ,the programmer must
ensure that the CONTEXT and CURRENT vocabularies are the
same, or the Error Message 18H (“DECLARE VOCABULARY”)
will be issued and the FORGET will QUIT or ABORT.
The user variable FENCE is used in conjunction with
FORGET to set a boundary past which FORGET cannot forget.
Warning: Using FORGET in a system comprised of multiple
vocabularies will probably (but not necessarily always) cause
the system to crash.
Refer to FENCE and VOCABULARY.
FORTH-79: Is equivalent.

FORTH(—)
FORTH is the name of the “vocabulary” definition for the
FORTH vocabulary. The FORTH vocabulary contains all of the
standard FORTH definitions. Executing FORTH sets CONTEXT
to point to the FORTH vocabulary. This causes dictionary
searches to begin with the FORTH vocabulary. Since
60
CONTEXT now points to FORTH , executing DEFINITIONS
will then cause new definitions to be appended to the FORTH
vocabulary.
Refer to VOCABULARY , CONTEXT , CURRENT,
DEFINITIONS <BUILDS , DOES> , and VOC-LINK.
FORTH-79: Is equivalent.

HERE (— address)

HERE places the address of the next available dictionary


location onto the parameter stack.
Refer to DP
FORTH-79: Is equivalent.

HEX(—)

HEX sets the user variable BASE to 16 (decimal). This causes


all numeric input and output conversions to be performed in
hexidecimal.
Note that this is not an IMMEDIATE word.
Refer to (NUMBER) and BASE.
FORTH-79: Is equivalent.

HLD (— data address)

HLD (pronounced “H-L-D”) is a 16-bit single precision user


variable containing the address of the last character of text
placed into PAD during binary-to-ascii pictured numeric
output conversion. <# initializes HLD and HOLD references
HLD during conversion.
Refer to <If , If> , HOLD , SIGN , NUMBER, (NUMBER),
and USER.
FORTH-79: No equivalent.

HOLD (ascii char —)

HOLD stores an ascii character into the next available location


in a pictured numeric output string. HOLD is used internally

61
by # to place each converted ascii digit into memory. Numeric
punctuation (characters such as commas, decimal points, signs,
dollar signs, etc.) can also be placed in output strings via
HOLD.
The address of the next available location is kept in the user
variable HLD . HOLD decrements HLD before each character
store. HOLD is used within a <#. . . #> expression. <# is
used to initialize HLD to the beginning of PAD . Therefore
characters are stored into memory from high to low memory
starting from one byte before the beginning of PAD and
working toward the end of the dictionary.
Refer to # , <# , #> , SIGN , PAD , and HLD.
FORTH-79: Is equivalent.

I (— Index value)

I copies the current DO. . LOOP Index onto the top of the
parameter stack. This is analogous to the loop variable in a
BASIC FOR. . .NEXT loop. The word I (and not R) should
always be used to obtain the current loop Index. The action of
I is undefined outside of a DO. . LOOP structure.
I is a low level code primitive.
FORTH-79: Is equivalent.

ID. (Name Field Address —)

ID. (pronounced “I-D-dot”) lists the ascii Name Field of a


definition on the output device.
ID. calculates the physical length of the Name Field by
subtracting the LFA from the NFA . This length is then used
to move the Name Field text, including the length byte, to
PAD . The contents of the length byte is then used to TYPE
the definition name. This may result in the physical Name
Field being typed followed by trailing blanks.
Refer to WIDTH
FORTH-79: No equivalent.

62
IF (truth flag —)
IF must be used within an IF. . THEN or IF. . .ELSE. . THEN
structure. ( ENDIF may be used in place of THEN if desired,
but THEN is the preferred usage.) The format of these
structures is:

IF “True Portion” THEN


or

IF “True Portion” ELSE “False Portion” THEN

(Beware. This differs in form from the PASCAL


IF. . .THEN. . ELSE structure.)
IF.. .THEN and IF.. ELSE. . .THEN structures must be used
within a colon definition.
Note that IF is an IMMEDIATE word.
Refer to ELSE ,ENDIF , THEN IF ,and OBRANCH.
FORTH-79: Is equivalent.

IMMEDIATE (—)
IMMEDIATE sets the precedence bit of the most recently
created definition. A definition whose precedence bit is set
will be executed “immediately” by INTERPRET even when the
system is in compile state. IMMEDIATE almost always follows
the definition to which it refers.
BEGIN is an example of a compiler word (a conditional
compiler in this case) that is flagged as IMMEDIATE by being
followed by the word IMMEDIATE
Refer to INTERPRET, [COMPILE] ,LATEST ,and STATE.
FORTH-79: Is equivalent.

IN (— data address)
IN (pronounced “in”) is a 16-bit single precision user variable
containing the byte offset from the beginning of the current
input text buffer (whether using the Terminal Input Buffer or a
disk buffer).
IN is set to 0 by QUERY (for TIB input) and by LOAD and
63
— —> (for mass storage input). WORD then references and
increments IN as words in the buffer are moved to HERE
Refer to WORD ,QUERY , LOAD, - -> , HERE , and
USER.
FORTH-79: Is equivalent to >IN (pronounced “to-in”).

INDEX ( beginning screen # \ ending screen

INDEX prints the first line of each screen within the specified
range of screens inclusively. The index listing will be
terminated if any terminal key is pressed.
Refer to LINE and ?TERMINAL.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

INTERPRET (—)

INTERPRET is the FORTH text interpreter, commonly referred


to as the outer interpreter. INTERPRET interprets the text
input stream. This input stream comes from the terminal if
BLK contains 0 or from mass storage if BLK contains a block
number.
INTERPRET will either execute (i.e., “interpret” in the
traditional sense) or compile an input stream word depending
upon the “state” of the system (as reflected by the value stored
in the user variable STATE ). STATE is set to compile mode
by a compiler word such as : and reset to interpret mode by a
word such as
Refer to WORD, - FIND ,NULL (or X ), DPL QUIT,
LOAD and]
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

IP is a pointer used by FORTH’s “threading” words. It plays


an important role in such words as NEXT, 5 ,the execution
time portion of : and so on.

64
IP generally serves as a pointer to the next “word” (actually
a CFA within the Parameter Field of a definition) to execute.
NEXT jumps indirectly “through” this pointer to execute the
Code Field procedure.
IP is not a true FORTH word. It is not a variable. It is a
logical entity and may be physically kept in registers or
memory or whatever, depending upon the exact system
implementation.
Refer to NEXT, : , ;S ,DOES> ,and EXECUTE.

KEY (— input value)

KEY inputs a character from the terminal and places it onto


the top of the parameter stack.
Note: Control is not returned from KEY until an input
character is available. If processing must be performed while
waiting for an input character, ?TERMINAL may be used to
determine whether input data is actually present before
invoking KEY
The actual operation of the word is installation dependent.
KEY is a low level code primitive.
Refer to ?TERMINAL.
FORTH-79: Is equivalent.

LATEST (— address)

LATEST places the NFA of the bottommost word in the


CURRENT vocabulary onto the top of the parameter stack.
When compiling, this bottommost word is also the “latest” or
most recently compiled definition.
Refer to CURRENT and VOCABULARY.
FORTH-79: No equivalent.

LEAVE (—)

LEAVE is used to prematurely exit a DO. . LOOP . It forces


termination of the loop by setting the Limit value equal to the
current value of the Index, which in turn causes an exit at the

65
next execution of LOOP or + LOOP . The Index value remains
valid and unchanged.
LEAVE is a low level code primitive.
Refer to DO LOOP, + LOOP (LOOP), (+ LOOP) ,and I.
FORTH-79: Is equivalent.

LFA (Parameter Field Address — Link Field


Address)
LFA (pronounced “L-F-A”) converts a given Parameter Field
Address of a dictionary definition into its Link Field Address.
Refer to NFA , CFA and PFA.
FORTH-79: No equivalent.

LIMIT (— address)
LIMIT is a single precision CONSTANT value. This constant
places the memory address of the next memory location past
the end of the last or highest (hence “limit”) block buffer in
the buffer array onto the top of the parameter stack.
Conversely, FIRST is the constant that reflects the lowest
(hence “first”) buffer array address.
Refer to + BUF BLOCK BUFFER ,and FIRST.
FORTH-79: No equivalent.

LIST ( Screen number —)


LIST “lists” a specified screen onto the output device. The
value of the constant C/L determines the length of an editing
screen line.
Refer to C/L and B/SCR.
FORTH-79: Is equivalent.

LIT (— literal value)


LIT places the 16-bit contents of the next dictionary location
onto the top of the parameter stack. LIT , followed by the
66
literal value, is compiled into a definition by LITERAL and
DLITERAL. LIT , then, is the execution time (Sequence 3)
action of LITERAL and DLITERAL.
LIT is a low level code primitive.
Refer to LITERAL and DLITERAL.
FORTH-79: No equivalent.

LITERAL

COMPILE TIME: (value —) (Sequence 2)

EXECUTION TIME: (— value ) (Sequence 3)


LITERAL is a compiler word and therefore exhibits both
compilation time and execution time actions.
Although LITERAL has no effect (Sequence 2) when
executed outside of a colon definition, it does not signal an
error. The compile time action (Sequence 2) of LITERAL is to
compile a dynamically calculated 16-bit value into a
definition. The end result of the compile action here is the
same as LIT
The execution time action of LITERAL is that of LIT . That
is, upon execution of LIT , the 16-bit value is placed on the
top of the parameter stack.
Note that LIT is an IMMEDIATE word.
Refer to LIT, [ , ] , and INTERPRET.
FORTH-79: Is equivalent.

LOAD (screen number —)

LOAD begins interpretation of the source text from the screen


number specified on the top of the parameter stack. The blocks
that comprise the specified screen are read from mass storage
to memory (if they are not already in the buffers) and
interpreted.
LOAD starts an entirely new interpretation level; therefore
LOADs may be nested. A null or 5 pops back up to the
previous level and resumes interpretation after the word that
caused LOAD to be executed.

67
Note: “0 LOAD” will cause a return stack overflow and a
system crash!
Refer to - -> WORD ,and INTERPRET.
FORTH-79: Is equivalent.

LOOP (—)
LOOP ends a DO.. LOOP structure in conjunction with the
word DO.
LOOP increments the ioop Index by one and compares this
new Index value with the Limit value. Note: This action is
actually performed by (LOOP) at run time. If the Index value
is less than the Limit value, a branch back to the “loop body”
of the DO. . LOOP structure is executed. If the Index is equal
to or greater than the Limit, then both of these values are
dropped from the return stack, and interpretation continues
with the definition following the DO. . LOOP.
Note that LOOP is an IMMEDIATE word.
If an increment value different from I is needed, + LOOP
should be used.
Refer to (LOOP DO, + LOOP , and (DO).
FORTH-79: The name is the same, but it differs in action.
Refer to FORTH-79 Standard.

M* (value 1 \ value 2— double product)


M* (pronounced “M-star”) multiplies two signed single
precision values and replaces them with their signed double
precision product.
Refer to U*
FORTH-79: No equivalent.

M/ ( double dividend \ divisor — remainder


\ quotient)

M/ (pronounced “M-slash”) divides a 32-bit signed double


precision value by a 16-bit signed single precision value and
replaces them with a 16-bit signed remainder and a 16-bit

68
signed quotient. The remainder takes its sign from the
dividend.
Note that M/ uses a double precision dividend while /MOD
uses a single precision dividend.
Refer to UI
FORTH-79: No equivalent.

M/MOD (double dividend \ divisor —


remainder \ double quotient)
M/MOD (pronounced “M-slash-mod”) divides an unsigned
double precision value by an unsigned single precision value
and replaces them with the unsigned single precision
remainder and the unsigned double precision quotient.
Refer to UI
FORTH-79: No equivalent.

MAX (value \ value — maximum value)

MAX (pronounced “max”) compares the top two 16-bit signed


values on the parameter stack, drops the smaller of the two
values, and leaves the larger.
MIN performs the opposite function of MAX
Refer to MIN
FORTH-79: Is equivalent.

MESSAGE ( message number —)

MESSAGE outputs a selected message to the output device.


The message is either just a message number (if the contents of
the user variable WARNING is 0) or it is a line of text (if the
contents of WARNING is a non-zero value).
The message number is supplied as a signed single precision
value. When WARNING contains a 1, this number is used as a
line offset relative to Line 0 of Screen 4 of Drive 0. That is to
say that a message number of + 2 will cause Line 2 on Screen
4 to be output. A value of + 19 will cause Line 3 of Screen 5
to be output. A value of — 1 will cause Line 16 of Screen 3 to
be output.

69
Message Number 0 will not output anything as Line 0 of
Screen 4 is a comment. An Error Message Number 0 input to
ERROR causes a “?“ (pronounced “HUH?”) to be printed.
Note that, while the FORTH system uses MESSAGE for error
messages, its use is not restricted to that purpose. Applications
may use the word to output any manner of desired messages
stored anywhere on the disk.
Refer to WARNING , ERROR, LINE , OFFSET , and
BLOCK.
FORTH-79: No equivalent.

MIN (value \ value — minimum value)


MIN (pronounced “mm”) compares the top two 16-bit signed
values on the parameter stack, drops the larger of the two
values, and leaves the smaller.
MAX performs the opposite function of MIN
Refer to MAX
FORTH-79: Is equivalent.

MINUS (value to be negated — two’s


complement)
MINUS replaces the 16-bit value on the top of the parameter
stack with its two’s complement.
MINUS is a low level code primitive.
FORTH-79: Is equivalent to NEGATE.

MOD (dividend \ divisor — remainder)


MOD (pronounced “mod”) divides a 16-bit signed single
precision value by another 16-bit signed single precision value
and replaces them with their 16-bit signed remainder (or
modulo, hence the name MOD).
Refer to /MOD
FORTH-79: Is equivalent.

70
MON(—)
MON (pronounced “mon”) exits to the system monitor of the
system FORTH is running on (or under). The word may have
other names, but the function is always the same.
MON may be a high or low level definition, depending upon
the specific installation.
FORTH-79: No equivalent.

NEXT

NEXT is the FORTH inner interpreter. (Actually, NEXT is the


entry point label of the inner interpreter procedure.) This
procedure is not a part of the FORTH dictionary. Its purpose is
to sequentially execute the “next” CFA contained within the
Parameter Field of a compiled definition.
NEXT only sequentially “executes Code Field Addresses”; it
does not of itself perform any nesting or unnesting. Nesting is
performed via a word such as the execution time action of
unnesting is performed via a word such as ;S
All definitions must eventually be terminated with a jump to
NEXT . Code definitions must end by directly jumping to
NEXT or by performing the same function as NEXT (e.g.,
EXECUTE).
Refer to W ,IP , : , ;S ,and DOES>

NFA (Parameter Field Address — Name


Field Address)
NFA (pronounced “N-F-A”) converts a given Parameter Field
Address of a dictionary definition into its Name Field Address.
Refer to PFA LFA , and CFA.
FORTH-79: No equivalent. A FORTH-79 program may not
address into a definition’s Name Field.

NULL (—)
NULL (pronounced “null” and sometimes called “X” ) causes
an exit from the endless loop in the INTERPRET procedure.
71
“NULL” is a pseudonym for an ascii null character (00). The
actual Name Field of NULL consists of one ascii null
character.
As INTERPRET sequentially moves through a buffer,
compiling and interpreting as it goes, it eventually reaches the
end of this buffer. By convention, all buffers must end with a
null character. When INTERPRET encounters this null
character, it searches the dictionary for a Name Field match. A
match occurs when the null definition is encountered. Since
NULL is a valid definition and is also IMMEDIATE , it is
executed.
NULL causes an exit from INTERPRET by dropping the top
address of the return stack. Then, when NULL returns, it does
not exit to the level it was at (i.e., back to INTERPRET), but
instead exits to one level of nesting higher (i.e., back to the
definition that contained INTERPRET —more specifically to
the definition immediately following INTERPRET ).
Note that NULL is an IMMEDIATE word.
Refer to INTERPRET QUIT ,and LOAD.
FORTH-79: No equivalent.

NUMBER ( address of text string — double


precision value)

NUMBER uses thecurrent base to convert a character string


into a signed double precision number. The character string
must begin with a length byte (e.g., standard “WORD” format).
The position of the last decimal point encountered (if any are
present) will be left in DPL
Error Message 0 (“?“) is issued if a non-convertible character
is encountered.
The ascii character blank (20H) terminates the conversion
process.
Note that there are only two valid non-convertible
characters:

1. Decimal points, which are effectively ignored.


2. A minus sign in the first character, which is used to set the
sign bit to negative.

72
Refer to (NUMBER) , DPL , BASE , and WORD.
FORTH-79: Is equivalent to CONVERT.

OFFSET (— data address)

OFFSET is a 16-bit single precision user variable containing a


block “offset” to mass storage devices. Upon entry, BLOCK
adds the contents of OFFSET to the desired block number to
allow explicit selection of a specific device. That is, the
beginning block number of that device is stored into OFFSET
Future block references are then “offset” by that value and
automatically reference the selected device.
DRO and DR1 (“Drive 0” and “Drive 1”) are device selection
words that store beginning block numbers into OFFSET
Refer to BLOCK ,DR0 ,DR1 ,MESSAGE ,and USER.
FORTH-79: Is equivalent.

OR ( valuel \ value2 — logical result)


OR (pronounced “or”) performs a bit-wise logical OR function
on the top two values on the parameter stack and replaces
them with their logical result.
OR is a low level code primitive.
FORTH-79: Is equivalent.

OUT (— data address)

OUT is a 16-bit single precision user variable containing a


value incremented by EMIT . VLIST is the only system word
that alters and references OUT . Applications may utilize OUT
for purposes of formatting lines of text, but note that EMIT
only increments the value. No initialization or checking of
OUT is performed by the system.
Refer to EMIT , VLIST ,and USER.
FORTH-79: No equivalent.

73
OVER ( value2 \ valuel — value2 \ valuel
\ value2)
OVER copies the second parameter stack entry onto the top of
the parameter stack.
OVER is a low level code primitive.
FORTH-79: Is equivalent.

PAD (— address)

PAD places the address of the text output buffer onto the top
of the parameter stack. PAD does not occupy a fixed location
in memory; instead it is always a fixed offset away from the
current end of the dictionary.
The PAD buffer is not a fixed length. It occupies memory
between the end of the dictionary and the beginning of the
user area. How much buffer is available at any time is a factor
of both the installation memory map and the current
dictionary size.
PAD is referenced in two ways:

1. The pictured numeric output words create numeric output


text starting at PAD-i and working toward low memory.
(Refer to <# , , , and #> .)
2. Application words such as text editor words use PAD as a
text buffer, with the beginning character stored in the first
byte and the rest of the characters going toward high
memory.

Low Memory High Memory

I Numeric P Text ) User


Dictionary 4— A
Area
[Conversion D Output J
FORTH-79: Is equivalent.

74
PFA ( Name Field Address — Parameter Field
Address)
PFA (pronounced “P-F-A”) converts a given Name Field
Address ( NFA ) of a dictionary definition into its Parameter
Field Address ( PFA ).
Refer to NFA ,CFA ,and LFA.
FORTH-79: No equivalent. A FORTH-79 program may not
address into a definition’s Parameter Field.

PREV (— data address)


PREV (pronounced “PRE”) is a system variable (not a user
variable) containing the address of the most recently
referenced disk buffer in the buffer array. PREV is used by
buffer referencing management routines.
PREy is normally initialized to point to FIRST
Refer to BLOCK BUFFER, + BUF ,COLD and
VARIABLE.
FORTH-79: No equivalent.

QUERY(—)
QUERY inputs up to 80 (decimal) characters of terminal text.
This text input is prematurely halted by encountering a
carriage return.
Text is placed into the Terminal Input Buffer, as specified
by the contents of the user variable TIB . After text is input,
the character pointer IN is set to 0. The carriage return is not
stored in memory. A null (0) and a blank (20H) are appended
to the end of the character string.
Refer to EXPECT , WORD , and TIB
FORTH-79: Is equivalent.

QUIT (—)
QUIT initially starts up FORTH, “quits” execution of a
routine, and is the most basic and primary loop of the FORTH
75
system. QUIT stops compilation, resets the return stack
pointer, and starts interpretation from the input terminal data
stream.

QUIT is an endless ioop that inputs a line of text from the


terminal and then calls the interpreter to process that text.
When control returns from INTERPRET (see NULL), QUIT
issues the prompt “OK” to the terminal.
Refer to INTERPRET and NULL
FORTH-79: Is equivalent, although the FORTH-79 version
does not output any message.

R (— value on top of return stack)

R copies the top of the return stack to the top of the parameter
stack. In this sense, it performs the same function as I
(although, owing to installation differences, I should still be
used with DO. . LOOP s to perform this function).
Note that R does not “drop” the top of the return stack and
therefore cannot be used to compensate for the use of >R
R is a low level code primitive.
Refer to I
FORTH-79: Is equivalent to R

R# (— data address)

R# (pronounced “R-sharp”) is a 16-bit single precision user


variable that may be used by file-related functions such as
editing. R# is not used in the basic FORTH system.
Refer to USER
FORTH-79: No equivalent.

R/W (buffer addr \ desired block # \ RIW


flag —)
R/W (pronounced “R-slash-W”) is the standard fig-FORTH
mass storage interface word. All mass storage data transfers are
performed by this word. By definition, R/W is always system
dependent.

76
The word has two major functions:

1. To convert the specified virtual block number into an


absolute address on a physical device.
2. To perform the actual data transfer between the device and
memory.

The top of the parameter stack contains a Read or Write


Boolean flag. A zero flag indicates that a write is to occur; a
non-zero flag indicates that a read is to occur.
Refer to BLOCK, + BUF , BUFFER , OFFSET , DRO , and
DR1.
FORTH-79: No equivalent.

RO (— data address)

RO (pronounced “R-zero”) is a 16-bit single precision user


variable containing the initial address of the return stack.
Refer to QUIT ,COLD ,and USER.
FORTH-79: No equivalent.

R> (— value popped from return stack)

R> (pronounced “R-from”) pops a number off of the return


stack and places it onto the top of the parameter stack. It is
often used in conjunction with >R in order to restore the
return stack to its original state.
R> differs from R in that the value is removed, or
“popped,” from the top of the return stack rather than copied.
R> is a low level code primitive.
Refer to >R and R.
FORTH-79: Is equivalent.

REPEAT (—)

REPEAT marks the end of a BEGIN. . WHILE. . REPEAT


structure in the form:

77
BEGIN
“Set Exit Conditional”
WHILE
“True Portion of Loop Body”
REPEAT

Refer to WHILE for a description of the action of a


BEGIN.. WHILE. . REPEAT loop.
Note that REPEAT is an IMMEDIATE word.
Refer to BEGIN , WHILE , AGAIN , ENDIF ,and BRANCH.
FORTH-79: Is equivalent.

ROT (valuel \ value2 \ value 3— value2


\ value3 \ valuel)
ROT (pronounced “rote”) rotates the top three 16-bit values on
the parameter stack. The third value is placed onto the top of
the stack.
FORTH-79: Is equivalent.

RP! (—)
RP! (pronounced “R-P-store”) is an installation dependent
word that initializes the return stack pointer to the address
contained in the user variable RO
RP! is a low level code primitive.
Refer to RO
FORTH-79: No equivalent.

RP@ (— return stack pointer address)


RP@ (pronounced “R-P-fetch”) is an installation dependent
word that returns the return stack pointer address, present at
the time RPC& was initially invoked, to the top of the
parameter stack.
RP@ is a low level code primitive.
FORTH-79: No equivalent.

78
S — >D (single precision number — double
precision number)
S — >D (pronounced “S-to-D”) extends a signed single
precision number to form a signed double precision number.
Warning: S — >D must be used to convert single precision
values to double precision values in order to correctly
propagate the sign bits.
S — >D is a low level code primitive.
FORTH-79: No equivalent.

SO (— data address)

SO (pronounced “S-zero”) is a 16-bit single precision user


variable containing the initial address of the parameter stack.
SO is initialized by COLD during system start-up with data
from the origin parameter area.
Refer to ABORT ,COLD ,SP! ,and USER.
FORTH-79: Is equivalent.

SCR (— data address)

SCR (pronounced “S-C-R”) is a 16-bit single precision user


variable containing the screen number most recently referenced
by LIST . This value can then be referenced by other words—
especially editor commands—so that the desired screen
number does not have to be explicitly stated every time a
command is issued.
Refer to LIST and USER
FORTH-79: Is equivalent.

SIGN ( sign flag \ double precision value —


double precision value)
SIGN is normally used within a pictured numeric output
expression to place a sign immediately to the left of a
converted numeric character string.

79
SIGN places an ascii minus sign in the next available
character string location if the sign of the third parameter stack
entry (i.e., a “sign flag”) is negative. The magnitude of the sign
flag entry is ignored. The top two entries contain a double
precision value.
Refer to # , <# , ,#S , HOLD ,HLD , PAD ,and
DABS.
FORTH-79: Is equivalent.

SMUDGE (—)

SMUDGE is used during word definition to toggle the


“smudge” bit (binary mask value 20H) in the length byte of
the Name Field of a definition so that the word cannot be
“found” (via the word (FIND) ) until the word is correctly
compiled. The length byte is smudged at the beginning of
compilation and is again smudged (toggled back) upon
successful completion (usually by ; ).
Refer to
FORTH-79: No equivalent.

SP! (—)

SP! (pronounced “S-P-store”) is an installation dependent


word that initializes the parameter stack pointer to the address
contained in the user variable SO
SP! is a low level code primitive.
Refer to SO ,ABORT ,and ERROR.
FORTH-79: No equivalent.

SP@ (— parameter stack pointer address)


SP@ (pronounced “S-P-fetch”) is an installation dependent
word that returns the parameter stack pointer address, present
at the time 5P was initially invoked, to the top of the stack.
SP@ is a low level code primitive.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

80
SPACE (—)

SPACE transmits an ascii blank (20H) to the output device.


FORTH-79: Is equivalent.

SPACES (count —)
SPACES outputs a specified number of ascii blanks (20H) to
the output device.
FORTH-79: Is equivalent.

STATE (— data address)

STATE is a 16-bit single precision user variable containing a


value that reflects the compilation “state” of the system.
A 0 value indicates that the system is compiling. A non-zero
value (C0H) indicates that the system is interpreting.
[sets STATE to interpret mode. ] sets STATE to compile
mode.
Refer to [‘1 INTERPRET , QUIT ,and USER.
FORTH-79: Is equivalent.

SWAP (value2 \ valuel —valuel \ value2)


SWAP exchanges the top two 16-bit values on the parameter
stack.
SWAP is a low level code primitive.
FORTH-79: Is equivalent.

TASK (—)
TASK is a no-op (no operation) definition that is used as a
“boundary marker” between applications or program segments.
Refer to FORGET.
FORTH-79: No equivalent.

81
THEN (—)
THEN marks the end of an IF.. THEN or IF. . ELSE. . THEN
structure. (ENDIF may be used in place of THEN , but THEN
is the preferred word.) THEN must be used in the form:

IF “True Portion” THEN

or

IF “True Portion” ELSE “False Portion” THEN

An IF. . .THEN structure must be used within a colon


definition.
Note that THEN is an IMMEDIATE word.
Refer to IF ,ELSE ,and ENDIF
FORTH-79: Is equivalent.

TIB (— data address)


TIB (pronounced “T-I-B”) is a 16-bit single precision user
variable that contains the address of the Terminal Input Buffer.
The TIB is an area of memory reserved as a buffer area for
the data stream coming from the terminal. The buffer is
normally located in memory between the return stack and the
parameter stack. The return stack “grows downward” into the
buffer.
The length of the buffer is usually 82 (decimal) bytes long,
80 characters + 2 terminators. The length is determined by a
literal value in QUERY
TIB is initialized by COLD during system start-up with data
from the origin parameter area.
Refer to QUERY ,and USER.
FORTH-79: No equivalent.

TOGGLE ( address \ bit mask —)


TOGGLE Exclusive-ORs the contents of the memory location
pointed to by the second stack location with the value on the
top of the stack. Note: This is the opposite of “normal” usage
82
(i.e., the address is usually on the top of the stack and the
data is in the second stack entry).
This word is named TOGGLE because of the effect of the
Exclusive-OR. “Toggling” a specific bit once changes the state
of the bit. “Toggling” that same bit again changes the bit back
to its original state (using the same bit mask both times, of
course).
TOGGLE is a low level code primitive.
FORTH-79: No equivalent.

TRAVERSE (beginning address \ direction


— ending address)

TRAVERSE calculates the address of the opposite end of a fig-


FORTH variable length Name Field. Given either the address
of the length byte or the address of the last letter of a Name
Field, TRAVERSE moves across (“traverses”) that Name Field.
Note that this means that TRAVERSE moves across a Name
Field in either direction.
At entry, the top of the parameter stack contains a 16-bit
direction indicator value. If this direction indicator is a 1,
motion is toward high memory and the second stack entry
must be the address of the Name Field’s length byte. If the
direction indicator is a —1, motion is toward low memory and
the second stack entry must be the address of the last letter of
the Name Field.
FORTH-79: No equivalent.

TRIAD ( Screen # —)

TRIAD outputs three screens to the output device, i.e., one


page. The page will begin with a screen whose number is
divisible by 3. One of the screens on the page will be the
screen specified.
FORTH-79: No equivalent.

83
TYPE ( beginning address \ # of
characters —)
TYPE outputs a character string to the output device. No
output takes place if the supplied length is 0.
Refer to COUNT.
FORTH-79: Is equivalent.

U* (unsigned single multiplier \ unsigned


single multiplicand — double unsigned
product)
U* (pronounced “U-star”) is an unsigned multiplier. It inputs
two unsigned 16-bit values and returns an unsigned 32-bit
product.
Warning: fig-FORTH U* actually does not multiply unsigned
16-bit values. It only correctly multiplies signed positive 16-bit
values.
U* is a low level code primitive.
Refer to M*
FORTH-79: Is equivalent.

U.(value—)

U. (pronounced “U-dot”) performs an unsigned binary-to-ascii


conversion on the 16-bit value on the top of the stack and
prints the result on the output device followed by one space.
The current value in BASE is the conversion radix.
U. has the same effect as . but the output is not signed.
Refer to . (dot).
FORTH-79: Is equivalent.

84
UI ( unsigned double precision dividend \
unsigned divisor — unsigned remainder \
unsigned quotient)
U/ (pronounced “U-slash”) performs unsigned division upon a
double precision dividend using a single precision divisor. U/
is the primitive division word used by all of the other division
words such as M/ , MOD , and M/MOD . Note that U/ performs
unsigned division.
U/is a low level code primitive.
FORTH-79: Is equivalent to U/MOD.

UNTIL (truth flag —)

UNTIL marks the end of an indefinite, conditional loop


structure where repetition continues “until” the Boolean input
to UNTIL is true.
UNTIL is used in the form:

BEGIN “Loop Body” “Set Conditional” UNTIL

(END may be used in place of UNTIL ,but UNTIL is the


preferred word.
BEGIN.. UNTIL structures must always be used within a
colon definition.
It is important to note that in using a BEGIN.. UNTIL
structure, the “loop body” is always executed at least once.
This is because the exit condition is not tested “until” after
the “ioop body” has been executed. This is known as a “posttest”
loop. If the exit condition must be tested before “loop
body” execution, the BEGIN.. WHILE. . REPEAT structure
should be used instead.
Note that UNTIL is an IMMEDIATE word.
Refer to BEGIN , OBRANCH ,and END.
FORTH-79: Is equivalent.

85
UPDATE (—)

UPDATE flags the most recently accessed buffer so that the


buffer’s data is written to mass storage when that buffer is
reallocated or FLUSH is executed.
It is important to note that setting the update flag does not
absolutely guarantee that data will be written to disk. This
write occurs only when a buffer is allocated. If the system is
restarted or powered off, or the desired disk is removed from
the drive, the data will not be written to the desired location.
Refer to + BUF , BLOCK , USE , EMPTY-BUFFERS , and
FLUSH.
FORTH-79: Is equivalent.

USE (— data address)


USE is a system variable (not a user variable) containing the
address of the buffer to “use” next. USE is referenced by
buffer allocation routines.
Refer to BUFFER, + BUF , BLOCK , and VARIABLE.
FORTH-79: No equivalent.

USER

COMPILE TIME: (offset —) (Sequence 2)

EXECUTION TIME: (— address)


(Sequence 3)
USER is a defining word and therefore exhibits both definition
time and run time actions.
USER ‘s compile time (Sequence 2) action is to define a user
variable. A user variable is a 16-bit fixed offset (relative to the
user pointer, UP ) for this user variable. (The value of the
offset may not be greater than 255 decimal.)
The form to define a user variable is:

n USER cccc

86
where n is the variable’s offset from the beginning of the user
area and cccc is the name of the variable.
USER variables play a very important role in multitasking
FORTH systems; however, in non-multitasking systems, they
could simply be replaced by variables.
User variables are usually initialized at system start up time
by COLD with initialization data stored in the Origin
Parameter Area. (Refer to COLD .)
The execution time (Sequence 3) action, when the named
variable is referenced, is to place the absolute address (offset
+ beginning address) of the 16-bit variable location onto the
top of the parameter stack.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

VARIABLE

COMPILE TIME: (value —) (Sequence 2)

EXECUTION TIME: (— address)


(Sequence 3)

VARIABLE is a defining word and therefore exhibits both


definition time and execution time actions.
A VARIABLE in FORTH has the same effect as a variable in
most other computer languages. That is, a label is assigned to
a specific memory location. Any further references to that
location can then be performed via the assigned name.
VARIABLE does differ from other languages in that it is active.
The equating of a name to an address is not just an action of a
compiler or an assembler during compile time. Instead, the
execution time code for VARIABLE actively places the address
of the variable onto the top of the parameter stack.
The compile time action (Sequence 2) for VARIABLE is to
create a definition containing the variable name, a pointer to
the execution time code for variable, and the 16-bit location.
One definition is created per variable name. VARIABLE is
used in the form:

n VARIABLE cccc

87
where n is the variable’s initial value and cccc is its assigned
name.

Note: Although it is possible to specify at compile time


(Sequence 2) the initial value of a variable, it is a much safer
programming practice always to initialize variables during
program initialization.
The execution time (Sequence 3) action of VARIABLE, when
the variable name is referenced, is to place the address of the
named 16-bit location onto the top of the parameter stack.
FORTH-79: Is equivalent. However, no initial value can be
specified at compile time.

VLIST (—)

VLIST (pronounced “V-list”) lists the names of all of the


definitions in the CONTEXT vocabulary onto the output
device.
FORTH-79: Not explicitly defined but listed in “Referenced
Word Set.”

VOC-LINK (— data address)

VOC-LINK (pronounced “yoke-link”) is a 16-bit single


precision user variable containing an address pointing to a
field in the vocabulary definition of the last vocabulary
created. All vocabulary definitions are linked together in
chronological order via this pointer. The FORTH vocabulary is
always the end of the voc-link chain.
Refer to VOCABULARY ,FORTH ,and USER.
FORTH-79: No equivalent.

VOCABULARY

DEFINITION TIME: (—) (Sequence 2)

EXECUTION TIME: (—) (Sequence 3)

VOCABULARY is a defining word and therefore exhibits both


definition time and execution time actions.

88
The definition time action of VOCABULARY is to create a
vocabulary definition that serves as the head or first entry of a
new vocabulary.
The execution time action of VOCABULARY is to store the
address of that vocabulary’s “Vocabulary Link Pointer” into
the user variable CONTEXT . The effect of this is to cause the
named vocabulary to be searched first whenever a dictionary
search is performed.
Refer to CONTEXT CURRENT , DEFINITIONS, LATEST,
FORTH, and VOC-LINK.
FORTH-79: Is equivalent. Note, however, that the structure
of vocabularies differs from the fig-FORTH Model. Refer to the
FORTH-79 Standard.

W is a pointer used by FORTH’s “threading” words. It plays


an important role in such words as NEXT , 5 ,DOCOL (the
execution time portion of : ), and the like.
W generally serves as a pointer to the Code Field of the
definition currently being executed. NEXT jumps indirectly
“through” this pointer to execute the CODE Field procedure.
W is not a true FORTH word. It is not a variable. It is a
logical entity and may be physically kept in registers or
memory or whatever, depending upon the exact system
implementation.
Refer to NEXT , : , and 5

WARNING (— data address)


WARNING is a 16-bit single precision user variable containing
a value used to determine the following (see Figure 4):
1. Whether the system ABORTs or QUITs via ERROR.
2. The format of messages output via MESSAGE
When ERROR executes and WARNING contains a negative
value, (ABORT) occurs and execution stops. (ABORT) is
intended to be a user-defined error handling procedure.
89
ERROR

I MESSAGE

L.. _.1

Figure 4
How WARNING Is Used

90
When ERROR executes and WARNING contains a nonnegative
value (i.e., zero or positive value), MESSAGE executes
and then QUIT stops execution.
When MESSAGE executes and WARNING contains a zero,
only the message number is output. (This allows the system to
operate without a disk.)
When a MESSAGE executes and WARNING is non-zero, text
messages are output using Line 0 of Screen 4 of Drive 0 as a
base location.
Refer to MESSAGE ,ERROR , and USER.
FORTH-79: No equivalent.

WHILE (truth flag —)


WHILE is the beginning of the “true portion/loop body” of a
BEGIN. . WHILE.. REPEAT structure in the form:

BEGIN
“Set Exit Conditional”
WHILE
“True Portion/Loop Body”
REPEAT

This is known as a “pre-test” loop because, when using this


structure, it is possible for the loop to terminate before the
“loop body” is executed even once. This is because the exit
condition is tested before executing the “loop body.” That is,
the loop will continue “while” the Boolean flag is true.
Any amount of processing may be performed between the
BEGIN and the WHILE as long as the final result is a Boolean
flag.
Note that WHILE is an IMMEDIATE word.
Refer to BEGIN , REPEAT , 0BRANCH , and UNTIL.
FORTH-79: Is equivalent.

WIDTH (— data address)


WIDTH is a 16-bit single precision user variable containing the
maximum number of characters saved in the compilation of a
91
definition name (i.e., the “width” of the Name Field). This
value may range from 1 to 31 characters (31 is the default
value). The length byte is not included in the field width
specified by WIDTH
Refer to CREATE and USER.
FORTH-79: No equivalent.

WORD (delimiter value —)

WORD parses one word from the input stream. For example,
WORD reads text characters from the input stream until the
specified delimiter character is encountered.
Text characters are transferred from the input stream to
memory starting at the next available dictionary location
(HERE).
WORD leaves the character count of the text string in the
first byte of the string. The string is terminated with one or
more blanks.
Leading delimiter characters are ignored and not transferred
to memory. Trailing delimiters are not transferred to memory.
Ascii “nulls” (OOH) are treated as unconditional delimiters.
Refer to ENCLOSE for specific conditions and their results.
The source of the input stream is determined by the value of
the user variable BLK . If BLK is zero, text is input from the
terminal buffer. If BLK is non-zero, the value specifies the disk
block to be used as input.
Refer to ENCLOSE , BLK , and IN.
FORTH-79: Is equivalent. Note that FORTH-79 requires that
WORD return the beginning address of the parsed string.

X (— data address)

X is a pseudonym for NULL.


Refer to NULL
FORTH-79: No equivalent.

92
XOR (valuel \ value2 — logical result)
XOR (pronounced “Exclusive-OR” or “X-OR” or “X-O-R”)
performs a bit-wise logical Exclusive-OR function on the two
values on the top of the stack and replaces them with their
logical result.
XOR is a low level code primitive.
Refer to TOGGLE
FORTH-79: Is equivalent.

[(pronounced “left-bracket”) suspends compilation within a


colon definition. The words that follow [ are executed, not
compiled. Compilation is resumed via ] (resume compilation).
The effect of [is to put a 0 into the user variable STATE
Note that [is an IMMEDIATE word.
Refer to ], INTERPRET, CODE ,and LITERAL.
FORTH-79: Is equivalent.

[COMPILE] (—) (word to compile must be


the next word in the input stream)
[COMPILE] (pronounced “bracket-compile”) forces the
compilation of the IMMEDIATE word following [COMPILE] in
the input stream.
[COMPILE] forces the next input stream word always to be
compiled (i.e., the input stream word immediately following
[COMPILE] is compiled into the dictionary and is not
executed). This is the only way IMMEDIATE words can be
compiled (during Sequence 2) so that they can execute at a
later time (their Sequence 3).
Refer to [ ,COMPILE ,] ,and INTERPRET.
FORTH-79: Is equivalent.

93
(pronounced “right-bracket”) places the system into the
compilation state. This word is normally used to resume
compilation after [ was used to halt compilation. The effect of
is to place a non-zero value into the user variable STATE
Note that STATE is set to C0H and not just 01. This is done
to save processing time in INTERPRET . Setting STATE to a
non-zero value puts the system into compilation mode, but,
even in compilation mode, IMMEDIATE words must be
executed and not compiled (e.g., compiler words). The purpose
of using C0H, then, is to cause compilation of all but
IMMEDIATE words.
FORTH-79: Is equivalent.

94
FORTH SYSTEM MESSAGES (relative to
Drive 0 Screen 4 Line 0)
? (pronounced “HUH?”) (0, OH): The word in question cannot
be found in the dictionary.
EMPTY STACK (1, 1H): More values have been removed from
the parameter stack than were added. The stack pointer
has backed up beyond the initial stack pointer location.
DICTIONARY FULL (2, 2H): The dictionary has grown into the
Terminal Input Buffer ( TIB ).
ISN’T UNIQUE (4, 4H): The name of this definition already
exists elsewhere in the dictionary.
DISK RANGE? (6, 6H): A disk access to a physically nonexistant
block number was requested. (Make sure you are
not in base hex when you think that you are in base
decimal.)
FULL STACK (7, 7H): Too many values have been added to
the parameter stack. The stack pointer has gone beyond its
upper limit.
DISK ERROR! (8, 8H): An I/O error occurred while attempting
to read or write to virtual I/O. (Make sure a diskette is in
the drive and the door is shut.)
COMPILATION ONLY (17, 11H): This word must only be used
within a colon definition.
EXECUTION ONLY (18, 12H): This word must not be used
while the system is in compile mode.
CONDITIONALS NOT PAIRED (19, 13H): There is some sort of
problem with the pairing of conditionals within the
definition being compiled.
DEFINITION NOT FINISHED (20, 14H): The position of the
parameter stack pointer differs from what it was when this
definition began compiling. Something is wrong with the
definition.
PROTECTED DICTIONARY (21, 5H): The address of the
definition being “forgotten” is less than the value stored in
FENCE . Change the value in FENCE
USE ONLY WHEN LOADING (22, 16H): This definition should
only be used when loadidg.

95
OFF CURRENT EDITING SCREEN (23, 17H): Occurs when
using fig-FORTH editor.
DECLARE VOCABULARY (24, 18H): CONTEXT and CURRENT
are not aiming at the same vocabularies when attempting
to FORGET.

96
1 4— USE

LIMIT [_______________J 4 PREV


FIRST
DISK BUFFERS I

UP • [ USER AREA
RO
RETURN I
STACK

RP _____
a- ——
4 -‘TERMINAL J IN
BUFFER4____ TIB
________

so
STACK

TEXT BUFFER 1
4 PAD
“WORD” BUFFER

DP [ DICTIONARY
LBOOT-UP LITERA1 4 0 + ORIGIN
STANDARD fig-FORTH MEMORY MAP

97
Functional Cross Reference

Stack Manipulation ? 30
—DUP 19 (a 34
0 22 BLANKS 38
1 23 C! 39
2 24 CCa 40
3 24 CMOVE 41
>R 30 ERASE 57
?STACK 33 FILL 59
BL 37
DROP 54 Control 5tructure
DUP 54 (+LOOP) 11
OVER 74 (DO) 12
R 76 (LOOP) 14
RO 77 +LOOP 17
R> 77 OBRANCH 23
ROT 78 AGAIN 35
RP! 78 BEGIN 37
RP@ 78 BRANCH 39
50 79 DO 49
SP! 80 ELSE 54
SP@ 80 END 57
SWAP 81 ENDIF 57
I 62
IF 63
Number Bases
LEAVE 65
BASE 37
LOOP 68
DECIMAL 47
REPEAT 77
HEX 61
THEN 82
Comparison UNTIL 85
0< 22
WHILE 91
0= 23
< 27
Terminal Input/Output
=
30
> 30
(.“) 10
(LINE) 13
20

Memory 20
8 LINE 21
+! 16 .R 21

98
?TERMINAL 34 Vocabularies
C/L 40 CONTEXT 43
COUNT 44 CURRENT 45
CR 44 DEFINITIONS 47
0. 46 FORTH 60
D.R 47 HERE 61
EMIT 55 LATEST 65
EXPECT 58 VOC-LINK 88
IN 63 VOCABULARY 88
KEY 65
MESSAGE 69 Compiler Security
QUERY 75 !CSP 8
SPACE 81 ?COMP 31
SPACES 81 ?CSP 31
TIB 82 ?ERROR 32
TRIAD 83 ?EXEC 32
TYPE 84 ?LOADING 32
U. 84 ?PAIRS 33
VLIST 88 ?STACK 33
WORD 92 CSP 45
ERROR 57
Input/Output Formatting SMUDGE 80
# 8 WARNING 89
#> 9
#S 9 Dictionary
(NUMBER) 14 9
—TRAILING 20 (FIND) 13
<# 27 +ORIGIN 18
COUNT 44 - FIND 19
CR 44 ALLOT 35
DIGIT 48 CFA 40
DPL 53 CONTEXT 43
ENCLOSE 55 CURRENT 45
FLD sg DEFINITIONS 47
HLD 61 DP 53
HOLD 61 FENCE 58
NUMBER 72 FORGET 60
OUT 73 FORTH 60
PAD 74 ID. 62
R# 76 LATEST 65
SIGN 79 LFA 66

99
NFA 71 TOGGLE 82
PFA 75 XOR 93
SMUDGE 80
TRAVERSE 83 Virtual Input/Output
VLIST 88 +BUF 17
VOC-LINK 88 - -> 18
WIDTH 91 BIBUF 36
BISCR 36
Arithmetic BLK 38
* 15 BLOCK 38
*1 15 BUFFER 39
*/MOD 15 DRO 54
+ 16 DRI 54
+! 16 EMPTY-BUFFERS 55
+ — 16 FIRST 59
18 FLUSH 60
/ 22 INDEX 64
/MOD 22 LIMIT 66
1+ 23 LIST 66
2+ 24 LOAD 67
ABS 35 OFFSET 73
D+ 46 PREV 75
D+— 46 R/W 76
DABS 47 SCR 79
M* 68 UPDATE 86
M/ 68 USE 86
M/MOD 69
MAX 69 Compiler Defining Words
MIN 70 ( 10
MOD 70 (;CODE) 12
S—>D 79 , 18
U* 84 OBRANCH 23
U/ 85 : 24
25
Logical CODE 25
AND 35 5 26
DMINUS 49 <BUILDS 28
MAX 69 BACK 36
MIN 70 BRANCH 39
MINUS 70 C, 40
OR 73 COMPILE 42

100
CONSTANT 43 MON 71
CREATE 45 PAD 74
DLITERAL 48 QUIT 75
DOES> 50 TASK 81
IMMEDIATE 63 TIB 82
LIT 66 USER 86
LITERAL 67
SMUDGE 80 Inner Interpreter
STATE 81 IP 64
VARIABLE 87 NEXT 71
VOCABULARY 88 W 89
93
[COMPILE] 93 Outer Interpreter
94 INTERPRET 64
NULL 71
System Words QUERY 75
(ABORT) 12 QUIT 75
ABORT 34 STATE 81
COLD 41 X 92
EXECUTE 58 [ 93
IP 64 1 94

101
Ascii Order Index
8 0< 22
!CSP 8 0= 23
# 8 OBRANCH 23
#> 9 1 23
#s 9 1+ 23
9 2 24
10 2+ 24
(.“) 10 3 24
(+LOOP) 11 24
(;CODE) 12 25
(ABORT) 12 CODE 25
(DO) 12 ;S 26

(FIND) 13 < 27
(LINE) 13 <# 27
(LOOP) 14 <BUILDS 28
(NUMBER) 14 =
30
*
15 > 30
/ 15 >R 30
*/MOD 15 ? 30
+ 16 ?COMP 31
+! 16 ?CSP 31
+—16 ?ERROR 32
+BUF 17 ?EXEC 32
+LOOP 17 ?LOADING 32
+ ORIGIN 18 ?PAIRS 33
18 ?STACK 33
18 ?TERMINAL 34
--> 19 (a 34
-DUP 19 ABORT 34
—FIND 19 ABS 35
- TRAILING 20 AGAIN 35
20 ALLOT 35
20 AND 35
LINE 21 B/BUF 36
.R 21 B/SCR 36
/ 22 BACK 36
/MOD 22 BASE 37
0 22 BEGIN 37

102
BL 37 EMPTY-BUFFERS 55
BLANKS 38 ENCLOSE 55
BLK 38 END 57
BLOCK 38 ENDIF 57
BRANCH 39 ERASE 57
BUFFER 39 ERROR 57
C! 39 EXECUTE 58
C, 40 EXPECT 58
C/L 40 FENCE 58
C(E1 40 FILL 59
CFA 40 FIRST 59
CMOVE 41 FLD 59
COLD 41 FLUSH 60
COMPILE 42 FORGET 60
CONSTANT 43 FORTH 60
CONTEXT 43 HERE 61
COUNT 44 HEX 61
CR 44 HLD 61
CREATE 45 HOLD 61
CSP 45 1 62
CURRENT 45 ID. 62
D+ 46 IF 63
D + - 46 IMMEDIATE 63
D. 46 IN 63
D.R 47 INDEX 64
DABS 47 INTERPRET 64
DECIMAL 47 IP 64
DEFINITIONS 47 KEY 65
DIGIT 48 LATEST 65
DLITERAL 48 LEAVE 65
DMINUS 49 LFA 66
DO 49 LIMIT 66
DOES> 50 LIST 66
DP 53 LIT 66
DPL 53 LITERAL 67
DRO 54 LOAD 67
DRI 54 LOOP 68
DROP 54 M* 68
DUP 54 MI 68
ELSE 54 M/MOD 69
EMIT 55 MAX 69

103
MESSAGE 69 SPi 80
MIN 70 SPACE 81
MINUS 70 SPACES 81
MOD 70 STATE 81
MON 71 SWAP 81
NEXT 71 TASK 81
NFA 71 THEN 82
NULL 71 TIB 82
NUMBER 72 TOGGLE 82
OFFSET 73 TRAVERSE 83
OR 73 TRIAD 83
OUT 73 TYPE 84
OVER 74 U* 84
PAD 74 U. 84
PFA 75 U/ 85
PREV 75 UNTIL 85
QUERY 75 UPDATE 86
QUIT 75 USE 86
R 76 USER 86
R# 76 VARIABLE 87
R/W 76 VLIST 88
RO 77 VOC-LINK 88
R> 77 VOCABULARY 88
REPEAT 77 W 89
ROT 78 WARNING 89
RP! 78 WHILE 91
RP 78 WIDTH 91
S->D 79 WORD 92
50 79 X 92
SCR 79 XOR 93
SIGN 79 1 93
SMUDGE 80 [COMPILE] 93
SP! 80 1 94

104
Notes
Notes
Notes
Notes
Notes
Notes
>> $7.25 FPT
USA

ISBN 0—201-10103—3

You might also like