Fig-Forth v2.30
Operator's Manual
By Mary Bell
March 11, 2003
Table of Contents
Part 1. Programmer's Reference
Introduction
Foreword
The Legal Stuff
System Requirements
System Highlights
Installation
How to use this manual
What's New?
Overview
Inside Fig-Forth
Language Outline
Chapter 1. Tokens, Symbols and Labels
What is a token?
Special Characters and Reserved Words
Symbols
Labels
Numbers
Character Strings
Constant Declarations
Comments
Program Lines
Chapter 2. Variables and Math
Syntax and Type
Using Decimal Numbers
Storage Operators
Arithmetic Functions
Basic Functions
Extended Functions
Trigonometric and Other Functions
Logical & Sign Control Functions
Boolean Functions
Number Formatting Functions
Chapter 3. Strings
Strings in Arrays
Basic String Functions
Advanced String Functions
Chapter 4. The Stacks
Scope
Stack Operations
Stack Controls
Chapter 5 Flow Control
The Instruction Pointer
IF ELSE THEN
CASE: :END
SWITCH
Conditional Loops
BEGIN
AGAIN
UNTIL
WHILE
REPEAT
The Counted Loop
DO
?DO
LOOP
+LOOP
I and J
REDO and LEAVE
EXIT and ?EXIT
UNLOOP
Chapter 6. Programming in Fig-Forth
Controlling The Search Process
ONLY
ALSO
PREVIOUS
ORDER
DEFINITIONS
VLIST
Beginning An Application
Adding to Another Vocabulary
Vocabularies: Immediate or Not?
Default Vocabularies
Declaring Statements and Functions
Parameters
Data Files and Source Texts
OPEN
LOAD
LINK
GO
Using the Block Editor
Starting an Edit
Other Editor Starts
Editor Navigation
Editor Modes
Special Functions
Editor Exit & File Saves
Other Editor Functions
About the Editor
Controlling the Dictionary Space
Controlling Compiler Operation
Library Files in Fig-Forth
Turn-Key Operations
Exiting Forth
Chapter 7. Basic Input and Output
The Console or System Keyboard
The Printer
The PC Hardware Ports
The Modem
The Mouse
The Text Screen
The System Speaker
Files
Chapter 8. Advanced Input and Output
The Graphics Screen
Working in the Graphics Modes
Plotting Functions & Definitions
The Font Printer
Block Fonts
Virtual File Access
File Streaming Words
System Sound Card
Talking to DOS or BIOS
Chapter 9. Advanced Procedures and Functions
Compiler Directives
An Overview of STATE
A State-Smart Example
Error Catching and Throwing
Catching A Thrown Error
Creating and Using Overlays
Vectored Words
Under the Hood
EXPECT
FENCE
IN
NEXT
OUT
SCR
TIB
WIDTH
Font Table
EMJ
VESA Buffer
>FILE
CONTEXT and CURRENT
CODE OPTIMIZER
Part 2. User's Guide
Learning Forth
What is Forth?
Starting Forth
System Self-Destruction
Forth Statements
Using the Command Interpreter
The Stack
Your First Program
The Block Editor
Starting an Edit
Other Editor Starts
Editor Navigation
Editor Modes
Special Functions
Editor Exit & File Saves
Other Editor Functions
About the Editor
Your Second Program
Additional Reading
Programming Graphics
Definitions
Graphics Display Theory
VSYNC
HSYNC
SCAN LINES
COLORS
Working with the Graphics Display
Sample Program 1
Sample Program 2
Part 3. Language Guide
Appendix A. Sound File Formats
WAVE FILE FORMAT
MIDI FILE FORMAT
Using The MIDI Maker Utility
Appendix B. Font File Format
Appendix C. Machine Code Definitions
Appendix D. General CRT Controller Registers
Appendix E. Compatibility
1. Vocabularies and Search Order
2. Changed, Discontinued or Outdated Words
3. Changed Definitions
4. Other Concerns
Known Bugs and Problems
Contact Point
Acknowledgments
Final Comments