home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 48
/
Amiga_Dream_48.iso
/
Atari
/
forth
/
forst.zoo
/
forst
/
bulletin.doc
next >
Wrap
Text File
|
1990-12-10
|
7KB
|
168 lines
OUTLINE OF THE ForST PACKAGE
Note
A greater level of detail on the use of ForST is provided in the
associated file FORST.DOC. A listing of the user-available words
is in WORDS.LST, and a glossary of unusual words in GLOSSARY.LST.
General
The present version of ForST is placed in the public domain for
non-profit use. This includes the object files and assembly source
files used to generate it. The origin of the files must be
acknowledged at all times.
ForST is written for the Atari ST, any version, with any number of
drives and (preferably) a monochrome monitor. The assembly source
code, suitable for DevPac ST2 assembler, has been modularised to
simplify porting to other 68000 systems.
It is a 32-bit, position-independent, subroutine-threaded system with
macro expansion and two-edged peephole optimisation. Compiled code
is at least as good as that from other ST compilers (eg, 100 iterations
of the Sieve in just over 25 seconds).
Separated headers are used, which can selectively be removed. Local
and register variables are available, adding significantly to the
efficiency of the compiled code and to the source readability. No
assembler is included, as it is not really necessary and detracts from
the portability of code. Using register primitives, much the same
result can be obtained.
An illustrative library is provided, including a floating point package.
Assembly source
The details of the use of these source files (in SOURCE directory)
is given in FORST.DOC. Using DevPac ST2, they are sufficient for
reassembly of the entire system. The top-level file (FORST.S) is
little more than a list of INCLUDEs of other files. User-available
words have names starting with an underscore.
GLOBALS.S: system macros and equates. These should be looked at in
conjunction with VARS.S, which contains all the system variables
and system message. Note that, in all these files, only the
headers are in the data section; code and variables in the code
section; and the stacks, dictionary and header space in the bss.
STRTFIN.S: routines for reserving and freeing memory, and for
initialisation of registers.
SHELL.S: the outermost level of contact with the user, and includes
INTERPRET, WORD, FIND, ', FORGET and related words. INTERPRET
uses the interface routines in ACTIONS.S
ACTIONS.S: directs execution and compilation. It also includes the
error handlers.
COMPILE.S: a very complex file with all the code for compilation of
subroutine calls, expansion of macros, optimisation and keeping
track of the number of edges on the stack. Also included are the
words for structured control (IF, ELSE, WHILE, etc).
ALLMACS.S: all the ForST code macros which can be expanded. These are
not all optimal in isolation, but appear the best compromise for edge
optimisation. Compare the high-level ForST code in the file REGS.S.
Note the headers of the fetch, store and NOT words. These words are
IMMEDIATE, and their smart code is in EXTEND.S.
HEADS.S: I have already changed the header structure once, and may want
to do so again. All the words that know about the detailed header
structure are in this file, to simplify maintenance. Look at them
in conjunction with the macros in GLOBALS.S and the ForST file WHAT.S.
BMATHS.S: rudimentary maths definitions, to permit customised versions
of higher-level words to be written in high-level code. Complementary
to MATHS.S, which has the main maths words. Remember that many of the
maths words are VECTORed (see the top of the assembly file SHELL.S.)
VARS.S: the system variables and buffers. Note that addresses are
always stored as offsets relative to the pointer in register A5. This
point is enlarged in FORST.DOC.
IO.S: character I/O and the routines for redirection. Uses GETC and
PUTC, which are in FILES.S.
EXPECT.S: expect has evolved over the months and, for flexibility, now
uses RE_EXPECT in this file. It is used by _QUERY in SHELL.S.
FILES.S: the file-related I/O, including the relevant routines of
GEMDOS (TOS). Included are words for SAVEing and RUNing files. High-
level file words are in the ForST file UTIL.S.
MEMORY.S: familiar words for accessing memory and stack, including
CMOVE, etc.
GEMDOS.S: non-file operating system words.
BIOS.S: lower-level operating system words.
GEM.S: rudimentary words for interfacing with the GEM environment (a
very complex business).
VT52: terminal emulator which drives the ST screen in non-gem mode
and permits cursor control, scrolling, etc through escape sequences.
EXTEND.S: extensions of compilation to allow local and register
variables, and smart versions of fetch and store words, and NOT,
to improve compiled code. Rather heavy going - and it illustrates
how complex things can get when you try to improve on the simple
Forth compiler.
Executable files
FORST.TOS: obtained from assembling FORST.S.
FORSTX.S: an enhancement of this, as described in FORST.DOC.
Either of these can be run from the desktop, simply by double-
clicking on it.
ForST library files
These are in the LIB directory, and are included to illustrate
extended Forth (ForST) style. They are placed in the public
domain with sole requirement that their authorship be acknowledged.
ANOTHER.S: word to make another complete copy (code and head)
of a suitable system word. (It will have a length entry in its
header and must not have any external calls or PC-relative
memory references.)
APPSKEL.S: skeleton code to illustrate the construction of
completely free-standing application code. This is supported by
the files APPUTILS.S, APPFILIN.S, STRUTIL.S, CONIN.S, CONOUT.S
AND CONIO.S.
DUMP.S: word to give a hex dump of a disk file.
EXPECT.S: high-level definition of a simple expect, which can be
installed into ForST, as described in FORST.DOC.
LDFLOATS.S: load file for FLOATS.S, FPIN.S, FPOUT.S, TRIG.S and
VECTORS.S, to provide the vectorable real number handling in
FORSTX.TOS.
INTDOT.S and INTOUT.S: high-level code for integer output.
REDIR.S: words for I/O redirection, described in FORST.DOC.
REGS.S: examples of primitive words written with direct register
access.
SIEVER.S: version of the Sieve benchmark, using register variables.
UTIL.S: utilities package, including interface words for operating system,
file utilities and Forth words like WORDS and MACWORDS.
WHAT.S: word to analyse a header and report on the type of word.
Illustrates access to the different header fields. Can be made
much more elegant, but it works.