Category : Forth Source Code
Archive   : DIARY.ZIP
Filename : F83FILE.002

Output of file : F83FILE.002 contained in archive : DIARY.ZIP



Signed and unsigned numbers use weighted bits. Weighted
bits within a number have a value of a power of two
beginning with the rightmost (least-significant) bit having
the value of two to the zero power. This weighting
continues to the leftmost bit increasing the power by one
for each bit. For an unsigned number this weighting pattern
includes the leftmost bit; thus, for an unsigned 16-bit
number the weight of the leftmost bit is 32,768. For a
signed number this weighting pattern includes the leftmost
bit but the weight of the leftmost bit is negated; thus, for
a signed 16-bit number the weight of the leftmost bit is
-32,768. This weighting pattern for signed numbers is
called two's complement notation.

Unspecified weighted numbers are either unsigned numbers or
signed numbers; program context determines whether the
number is signed or unsigned. See: "11.7 Stack Parameters"

pictured numeric output
The use of numeric output definitions which convert
numerical values into text strings. These definitions are
used in a sequence which resembles a symbolic 'picture' of
the desired text format. Conversion proceeds from least-
significant digit to most-significant digit, and converted
characters are stored from higher memory addresses to lower.

A complete specification of execution to achieve a specific
function (application task) expressed in FORTH source code

The process of obtaining one character from the current
input device. The selection of the current input device is
system dependent.

The process of self-reference, either directly or

The means of indicating the end of text by striking a key on
an input device. The key used is system dependent. This
key is typically called "RETURN", "CARRIAGE RETURN", or

Textual data arranged for editing. By convention, a screen
consists of 16 lines (numbered 0 through 15) of 64
characters each. Screens usually contain program source
text, but may be used to view mass storage data. The first
byte of a screen occupies the first byte of a mass storage
block, which is the beginning point for text interpretation
during a load.



search order
A specification of the order in which selected vocabularies
in the dictionary are searched. Execution of a vocabulary
makes it the first vocabulary in the search order. The
dictionary is searched whenever a word is to be located by
its name. This order applies to all dictionary searches
unless otherwise noted. The search order begins with the
last vocabulary executed and ends with FORTH , unless
altered in a system dependent manner.

source definition
Text consisting of word names suitable for compilation or
execution by the text interpreter. Such text is usually
arranged in screens and maintained on a mass storage device.

stack, data
A last in, first out list consisting of 16-bit binary
values. This stack is primarily used to hold intermediate
values during execution of word definitions. Stack values
may represent numbers, characters, addresses, boolean
values, etc.

When the name 'stack' is used alone, it implies the data

stack, return
A last in, first out list which contains the addresses of
word definitions whose execution has not been completed by
the address interpreter. As a word definition passes
control to another definition, the return point is placed on
the return stack.

The return stack may cautiously be used for other values.

string, counted
A sequence of consecutive 8-bit bytes located in memory by
their low memory address. The byte at this address contains
a count {0..255} of the number of bytes following which are
part of the string. The count does not include the count
byte itself. Counted strings usually contain ASCII

string, text
A sequence of consecutive 8-bit bytes located in memory by
their low memory address and length in bytes. Strings
usually, but not exclusively, contain ASCII characters.
When the term 'string' is used alone or in conjunction with
other words it refers to text strings.

structure, control



A group of FORTH words which when executed alter the
execution sequence. The group starts and terminates with
compiler words. Examples of control structures: DO ...
UNTIL IF ... THEN IF ... ELSE ... THEN See: "9.9 Control

This term indicates that equivalent execution results when a
program is executed on other than the system on which it was
created. See: "equivalent execution"

A non-zero value represents the true state of a flag. Any
non-zero value will be accepted by a standard word as
'true'; all standard words return a 16-bit value with all
bits set to one when returning a 'true' flag.

user area
An area in memory which contains the storage for user

variable, user
A variable whose data storage area is usually located in the
user area. Some system variables are maintained in the user
area so that the words may be re-entrant to different users.

An ordered list of word definitions. Vocabularies are an
advantage in separating different word definitions that may
have the same name. More than one definition with the same
name can exist in one vocabulary. The latter is called a
redefinition. The most recently created redefinition will
be found when the vocabulary is searched.

vocabulary, compilation
The vocabulary into which new word definitions are appended.

A sequence of characters terminated by one blank or the end
of the input stream. Leading blanks are ignored. Words are
usually obtained via the input stream.

word definition
A named FORTH execution procedure compiled into the
dictionary. Its execution may be defined in terms of
machine code, as a sequence of compilation address, or other
compiled words.

word name



The name of a word definition. Word names are limited to 31
characters and may not contain an ASCII space. If two
definitions have different word names in the same vocabulary
they must be uniquely findable when this vocabulary is
searched. See: "vocabulary" "9.5.3 EXPECT"

word set
A named group of FORTH word definitions in the Standard.

word set, assembler extension
Additional words which facilitate programming in the native
machine language of the computer which are by nature system

word set, double number extension
Additional words which facilitate manipulation of 32-bit

word set, required
The minimum words needed to compile and execute Standard

word set, system extension
Additional words which facilitate the access to internal
system characteristics.

word, standard
A named FORTH procedure definition, in the Required word set
or any extension word sets, formally reviewed and accepted
by the Standards Team.




The following document is considered to be a portion of this

American National Standard Code for Information Interchange,
X3.4-1977 (ASCII), American National Standards Institute,
1430 Broadway, New York, NY 10018, USA.

The following documents are noted as pertinent to the FORTH-83
Standard, but are not part of this Standard.

FORTH-77, FORTH Users Group, FST-780314

FORTH-78, FORTH International Standards Team

FORTH-79, FORTH Standards Team

FORTH-83 STANDARD, Appendices, FORTH Standards Team

Webster's Collegiate Dictionary shall be used to resolve
conflicts in spelling and English word usage.




7.1 Documentation Requirements

7.1.1 Each Standard System shall be accompanied by a
statement of:

1. System dictionary space used in bytes;

2. Application dictionary space available in bytes;

3. Data space in bytes;

4. Return stack space in bytes;

5. Mass storage block ranges used by the system;

6. Mass storage block ranges available to applications;

7. Operator's terminal facilities available;

8. System action taken upon each of the general or specified
error conditions as identified in this standard.

7.1.2 Each standard program shall be accompanied by a
statement of the minimum requirements for:

1. Dictionary space in bytes;

2. Data stack space in bytes;

3. Return stack space in bytes;

4. Mass storage block ranges;

5. Operator's terminal facilities

7.2 Testing Requirements

The following host computer configuration is specified as a
minimum environment for testing against this Standard.
Applications may require different capacities.

1. 2000 bytes of memory for application dictionary;

2. Data stack of 64 bytes;



3. Return stack of 48 bytes;

4. Mass storage capacity of 32 blocks, numbered 0 through 31;

5. One ASCII input/output device acting as an operator's




The FORTH Standards Team hereby specifies the requirements for
labeling of systems and applications so that the conditions for
program portability may be established.

A Standard System may use the specified labeling if it complies
with the terms of this Standard and meets the particular Word Set

A Standard Program (application) may use the specified labeling
if it utilizes the specified Standard System according to this
Standard and executes equivalently on any such system.

In a system or application, a standard word may not be redefined
to perform a different function within the vocabulary FORTH.

FORTH Standard

A system may be labeled:

FORTH-83 Standard

if it includes all of the Required Word Set in either source or
object form and complies with the text of this Standard. After
executing "FORTH-83" the dictionary must contain all of the
Required Word Set in the vocabulary FORTH, as specified in this

Standard Sub-set

A system may be labeled:

FORTH-83 Standard Sub-set

if it includes a portion of the Required Word Set and complies
with the remaining text of this Standard. However, no Required
Word may be present with a non-standard definition.

Standard with Extensions

A system may be labeled:

FORTH-83 Standard with Standard Extension(s)

if it comprises a FORTH-83 Standard System and one or more
Standard Extension Word Set(s). For example, a designation would
be in the form:



FORTH-83 Standard with Double-Number Standard Extension

Standard Program

A FORTH source program which executes equivalently on any
Standard System may be labeled:

FORTH-83 Standard Program

See: "equivalent execution" "7. REQUIREMENTS"

Standard Program with Environmental Dependencies

A program which is standard in all ways except for specific
environmentally dependent words may be labeled:

FORTH-83 Standard Program with Environmental Dependencies

if the following additional requirements are met:

1) Environmental dependencies (including hardware
dependencies) shall be factored into an isolated set of
application word definitions.

2) Each environmentally dependent word definition must be
fully documented, including all dependencies in a manner at
least as detailed as the standard words.




9.1 Words Names and Word Definitions

A Standard Program may reference only the definitions of the
Required Word Set and Standard Extensions and definitions which
are subsequently defined in terms of these words. Furthermore, A
Standard Program must use the standard words as required by any
conventions of this Standard. Equivalent execution must result
from Standard Programs.

The implementation of a Standard System may use words and
techniques outside the scope of the Standard, provided that no
program running on that system is required to use words outside
the Standard for normal operation.

If a Standard System or Standard Program redefines Standard
definitions within the FORTH vocabulary, these definitions must
comply with the Standard.

9.2 Addressable Memory

The FORTH system may share the dictionary space with the user's
application. The native addressing protocol of the host computer
is beyond the scope of this Standard.

Therefore, in a Standard Program, the user may only operate on
data which was stored by the application. No exceptions!

A Standard Program may address:

1. parameter fields of words created with CREATE , VARIABLE ,
and user defined words which execute CREATE ;

2. dictionary space ALLOTted;

3. data in a valid mass storage block buffer.
See: "9.7 Multiprogramming Impact";

4. data area of user variables;

5. text input buffer and PAD up to the amount specified as the
minimum for each area.

A Standard Program may NOT address:

1. directly into the data or return stacks;

2. into a definition's name field, link field, or code field;



3. into a definition's parameter field if not stored by the

9.3 Return Stack

A Standard Program may cautiously use the return stack with the
following restrictions:

The return stack may not be accessed inside a do-loop for values
placed on the return stack before the loop was entered. Further,
neither I nor J may be used to obtain the index of a loop if
values are placed and remain on the return stack within the loop.
When the do-loop is executed all values placed on the return
stack within that loop must be removed before LOOP , +LOOP , or
LEAVE is executed. Similarly, all values placed on the return
stack within a colon definition must be removed before the colon
definition is terminated at ; or before EXIT is executed.

9.4 Compilation

The system uses the return stack and the dictionary in a system
dependent manner during the compilation of colon definitions.
Some words use the data stack in a system dependent manner during
compilation. See: "sys (11.7)"

9.5 Terminal Input and Output

9.5.1 KEY

A Standard System must receive all valid ASCII characters. Each
KEY receives one ASCII character, with more-significant bits
environmentally dependent and might be zero. KEY must receive as
many bits as are obtainable. A Standard Program without
environmental dependencies may only use the least significant 7-
bit ASCII character received by KEY . For example: KEY 127 AND

9.5.2 EXPECT

Control characters may be processed to allow system dependent
editing of the characters prior to receipt. Therefore, a
Standard Program may not anticipated that control characters can
be received.