Quartus Forth Manual

Table of Contents - Quartus Forth Home Page - How to Register

ISO/ANS Compliant Documentation

  1. Standard Labeling
  2. Required Documentation
    1. Implementation-defined Options
      1. EXCEPTION word set
      2. FACILITY word set
      3. FILE word set
      4. FLOAT word set
      5. TOOLS word set
      6. SEARCH word set
    2. Ambiguous Conditions
      1. DOUBLE word set
      2. FACILITY word set
      3. FILE word set
      4. FLOAT word set
      5. TOOLS word set
      6. SEARCH word set
    3. Other Standard Documentation

ISO/ANS Standard Labeling

Quartus Forth is an ISO/ANS Forth Standard System:


Required ISO/ANS Standard Documentation

Implementation-defined options

Aligned address requirements (3.1.3.3 Addresses):

The DragonBall CPU architecture mandates that word- and long-size reads and writes of RAM occur on even-byte boundaries. In Forth terms, cell- or double-cell-width reads and writes must occur on even-byte boundaries.

Behavior of 6.1.1320 EMIT for non-graphic characters:

EMIT treats all characters as graphic. If the font selected has no character representation for a given value, a 'no-character' symbol (an unfilled rectangle) is displayed.

Character editing of 6.1.0695 ACCEPT and 6.2.1390 EXPECT:

Standard PalmOS editing facilities (marking text, undo, cut, copy, paste, popup keyboard) are available in ACCEPT. . Additionally, while in the interpreter, the Page Up button retrieves the previously input line. EXCEPT, being obsolescent, is not provided

Character set (3.1.2 Character types, 6.1.1320 EMIT, 6.1.1750 KEY):

Characters in the standard, large, and bold PalmPilot fonts from 0x20 to 0x7E correspond to ASCII. Other characters vary by font selection.

Character-aligned address requirements (3.1.3.3 Addresses):

All address are valid for character-width (byte) access.

Character-set-extensions matching characteristics (3.4.2 Finding definition names):

Matching is both case- and accent-insensitive (i.e. a, à, and A all match each other).

Conditions under which control characters match a space delimiter (3.4.1.1 Delimiters):

When parsing, all control characters match the space delimiter.

Format of the control-flow stack (3.2.3.2 Control-flow stack):

The data stack serves as the control-flow stack.

Conversion of digits larger than thirty-five (3.2.1.2 Digit conversion):

Input conversion will fail.  Output conversion will be attempted, with digits larger than 35 mapped into the character-set range beyond Z (i.e. [, \, ], and so forth).

Display after input terminates in 6.1.0695 ACCEPT and 6.2.1390 EXPECT:

The display is not changed; the cursor is positioned at the end of the input text.

Exception abort sequence (as in 6.1.0680 ABORT"):

The text message associated with the ABORT" is displayed, and execution continues as per ABORT.

Input line terminator (3.2.4.1 User input device):

At the Quartus Forth console, the input line terminator is the carriage return (Graffiti stroke upper-right to lower-left).  In INCLUDEd files, input is terminated via carriage-return, or end-of-file.

Maximum size of a counted string, in characters (3.1.3.4 Counted strings, 6.1.2450 WORD):

255.

Maximum size of a parsed string (3.4.1 Parsing):

255.

Maximum size of a definition name, in characters:

31.

Maximum string length for 6.1.1345 ENVIRONMENT?, in characters:

31.

Method of selecting 3.2.4.1 User input device:

Input is from the keyboard (pop-up keyboard, or Graffiti input) unless redirected via INCLUDED, INCLUDE, or NEEDS.

Method of selecting 3.2.4.2 User output device:

No facilities are currently provided for redirection of output.

Methods of dictionary compilation (3.3 The Forth dictionary):

Code is compiled to the dictionary using what the Standard calls a type 3 mechanism (native-code with optimizations).

Number of bits in one address unit (3.1.3.3 Addresses):

8.

Number representation and arithmetic (3.2.1.1 Internal number representation):

Numbers are represented internally as two's-complement, big-endian values.

Ranges for n, +n, u, d, +d, and ud (3.1.3 Single-cell types, 3.1.4 Cell-pair types):

n -32767..32767
+n 0..32767
u 0..65535
d -214783648..2147483647
+d 0..2147483647
ud 0..4294967295

Read-only data-space regions (3.3.3 Data space):

All dataspace regions are read/write.

Size of buffer at 6.1.2450 WORD (3.3.3.6 Other transient regions):

40 characters.

Size of one cell in address units (3.1.3 Single-cell types):

2.

Size of one character in address units (3.1.2 Character types):

1.

Size of the keyboard terminal input buffer (3.3.3.5 Input buffers):

80 characters.

Size of the pictured numeric output string buffer (3.3.3.6 Other transient regions):

34 characters.

Size of the scratch area whose address is returned by 6.2.2000 PAD (3.3.3.6 Other transient regions):

Depends upon the user implementation of PAD. Recommended:

CREATE PAD  84 CHARS ALLOT

System case-sensitivity characteristics (3.4.2 Finding definition names):

The system is case-insensitive.

System prompt (3.4 The Forth text interpreter, 6.1.2050 QUIT):

 ok

Type of division rounding (3.2.2.1 Integer division, 6.1.0100 */, 6.1.0110 */MOD, 6.1.0230 /, 6.1.0240 /MOD, 6.1.1890 MOD):

Symmetrical.

Values of 6.1.2250 STATE when true:

Compilation state is indicated by a 1 in STATE.

Values returned after arithmetic overflow (3.2.2.2 Other integer operations):

Overflow results in integer rollover (e.g. 65535 1+ -> 0)

Whether the current definition can be found after 6.1.1250 DOES> (6.1.0450 :):

The current definition cannot be found until ; (except via RECURSE).

Implementation-defined options: EXCEPTION word set

Values used in the system by 9.6.1.0875 CATCH and 9.6.1.2275 THROW (9.3.1 THROW values, 9.3.5 Possible actions on an ambiguous condition):

-1 -2 -4 -9 -13 -14 -16 -19 -29 -31 -38 -42 -43 -45

Implementation-defined options: FACILITY word set

Encoding of keyboard events (10.6.2.1305 EKEY):

EKEY returns a keyDownEvent for each keyboard event received. EKEY>CHAR interrogates the event buffer to retrieve the received character.

Duration of a system clock tick:

10 milliseconds.

Repeatability to be expected from execution of 10.6.2.1905 MS:

Repeatable to +/- 10 milliseconds.

Implementation-defined options: FILE word set

File access methods used by 11.6.1.0765 BIN, 11.6.1.1010 CREATE-FILE, 11.6.1.1970 OPEN-FILE, 11.6.1.2054 R/O, 11.6.1.2056 R/W, and 11.6.1.2425 W/O:

Not applicable.

File exceptions:

-38.

File line terminator (11.6.1.2090 READ-LINE):

Line-feed (0x0A) (REFILL).

File name format (11.3.1.4 File names):

Case- and accent-insensitive non-whitespace names not to exceed 31 characters in length.

Information returned by 11.6.2.1524 FILE-STATUS:

Not applicable.

Input file state after an exception (11.6.1.1717 INCLUDE-FILE, 11.6.1.1718 INCLUDED):

The file (and any nesting file) is closed.

Ior values and meaning (11.3.1.2 I/O results):

Not applicable.

Maximum depth of file input nesting (11.3.4 Input source):

Maximum nesting depth is 64 levels deep.

Maximum size of input line (11.3.6 Parsing):

100 characters.

Methods for mapping block ranges to files (11.3.2 Blocks in files):

Not applicable.

Number of string buffers provided (11.6.1.2165 S"):

Not applicable.

Size of string buffer used by 11.6.1.2165 S":

Not applicable.

Implementation-defined options: FLOAT word set

Format and range of floating-point numbers (12.3.1 Data types, 12.6.1.2143 REPRESENT):

Motorola Fast Floating Point (FFP) format. See the floating point specification for detailed specifications.

Results of 12.6.1.2143 REPRESENT when float is out of range:

Not applicable.

Rounding or truncation of floating-point numbers (12.3.1.2 Floating-point numbers):

Floats are rounded to 24 bits of precision.

Size of floating-point stack (12.3.3 Floating-point stack):

8 floats.

Width of floating-point stack (12.3.3 Floating-point stack):

2 cells.

Implementation-defined options: TOOLS word set

Ending sequence for input following 15.6.2.0470 ;CODE and 15.6.2.0930 CODE:

END-CODE.

Manner of processing input following 15.6.2.0470 ;CODE and 15.6.2.0930 CODE:

Input is processed as either prefix or postfix 68000 assembler, as described in 'asm68k.html'.

Search-order capability for 15.6.2.1300 EDITOR and 15.6.2.0740 ASSEMBLER (15.3.3 The Forth dictionary):

ASSEMBLER allows all asm68k words to be found.  FORTH (SEARCH EXT) is available in the ASSEMBLER wordlist for easy return to the default search-order.

Source and format of display by 15.6.1.2194 SEE.

Not applicable.

Implementation-defined options: SEARCH word set

Maximum number of word lists in the search order (16.3.3 Finding definition names, 16.6.1.2197 SET-ORDER):

8.

Minimum search order (16.6.1.2197 SET-ORDER, 16.6.2.1965 ONLY):

FORTH-WORDLIST.

 


Ambiguous conditions

A name is neither a valid definition name nor a valid number during text interpretation (3.4 The Forth text interpreter):

-13 THROW.  When at the Quartus Forth console, the system beeps, prints the invalid name on the screen in underlined text, followed by a question-mark, and then performs the semantics of ABORT.

A definition name exceeded the maximum length allowed (3.3.1.2 Definition names):

-19 THROW.

Addressing a region not listed in 3.3.3 Data Space:

Attempts to write to write-protected RAM are trapped by the PalmOS and result in a system exception.

Argument type incompatible with specified input parameter, e.g., passing a flag to a word expecting an n (3.1 Data types):

Not detected. False flags (0) are always legal values. True flags are legal values for data types n and u.

Attempting to obtain the execution token, (e.g., with 6.1.0070 ', 6.1.1550 FIND, etc.) of a definition with undefined interpretation semantics:

Returns the execution token representing the compilation semantics of the definition.

Dividing by zero (6.1.0100 */, 6.1.0110 */MOD, 6.1.0230 /, 6.1.0240 /MOD, 6.1.1561 FM/MOD, 6.1.1890 MOD, 6.1.2214 SM/REM, 6.1.2370 UM/MOD, 8.6.1.1820 M*/):

Trapped by the PalmOS, resulting in a system exception.

Insufficient data-stack space or return-stack space (stack overflow):

Not detected.

Insufficient space for loop-control parameters:

Not detected.

Insufficient space in the dictionary:

-8 THROW.

Interpreting a word with undefined interpretation semantics:

Permitted. An attempt will be made to execute the compilation semantics, potentially resulting in an ambiguous condition.

Modifying the contents of the input buffer or a string literal (3.3.3.4 Text-literal regions, 3.3.3.5 Input buffers):

Permitted.

Overflow of a pictured numeric output string:

Not detected.

Parsed string overflow:

Not detected.

Producing a result out of range, e.g., multiplication (using *) results in a value too big to be represented by a single-cell integer (6.1.0090 *, 6.1.0100 */, 6.1.0110 */MOD, 6.1.0570 >NUMBER, 6.1.1561 FM/MOD, 6.1.2214 SM/REM, 6.1.2370 UM/MOD, 6.2.0970 CONVERT, 8.6.1.1820 M*/):

Not detected.

Reading from an empty data stack or return stack (stack underflow):

Stack underflow is detected during interpretation after the execution of each word. Not detected during run-time except by an explicit check.

Unexpected end of input buffer, resulting in an attempt to use a zero-length string as a name:

-16 THROW.

>IN greater than size of input buffer (3.4.1 Parsing):

Treated as though the end of the input buffer has been reached.

6.1.2120 RECURSE appears after 6.1.1250 DOES>:

Causes recursion into the word containing the DOES>.

Argument input source different than current input source for 6.2.2148 RESTORE-INPUT:

Not detected.

Data space containing definitions is de-allocated (3.3.3.2 Contiguous regions):

Not detected.

Data space read/write with incorrect alignment (3.3.3.1 Address alignment):

Trapped by the PalmOS, resulting in a system exception.

Data-space pointer not properly aligned (6.1.0150 ,, 6.1.0860 C,):

For cell-sized reads and writes, unaligned accesses are trapped by the PalmOS, resulting in a system exception.

Less than u+2 stack items (6.2.2030 PICK, 6.2.2150 ROLL):

Not detected.

Loop-control parameters not available (6.1.0140 +LOOP, 6.1.1680 I, 6.1.1730 J, 6.1.1760 LEAVE, 6.1.1800 LOOP, 6.1.2380 UNLOOP):

Not detected.

Most recent definition does not have a name (6.1.1710 IMMEDIATE):

Not detected.

Name not defined by 6.2.2405 VALUE used by 6.2.2295 TO:

Not detected.

Name not found (6.1.0070 ', 6.1.2033 POSTPONE, 6.1.2510 ['], 6.2.2530 [COMPILE]):

-13 THROW.

Parameters are not of the same type (6.1.1240 DO, 6.2.0620 ?DO, 6.2.2440 WITHIN):

Not detected.

6.1.2033 POSTPONE or 6.2.2530 [COMPILE] applied to 6.2.2295 TO:

Not detected.

String longer than a counted string returned by 6.1.2450 WORD:

Not detected.

u greater than or equal to the number of bits in a cell ( 6.1.1805 LSHIFT, 6.1.2162 RSHIFT):

Not detected.

Word not defined via 6.1.1000 CREATE (6.1.0550 >BODY, 6.1.1250 DOES>):

>BODY attempts to identify CREATE words, and performs -31 THROW for words failing this identification. DOES> does not attempt to identify words as having been defined by CREATE.

Words improperly used outside 6.1.0490 <# and 6.1.0040 #> (6.1.0030 #, 6.1.0050 #S, 6.1.1670 HOLD, 6.1.2210 SIGN):

Not detected.

Ambiguous conditions: DOUBLE word set

d outside range of n in 8.6.1.1140 D>S:

Not detected.

Ambiguous conditions: FACILITY word set

10.6.1.0742 AT-XY operation can't be performed on user output device.

AT-XY assumes the user output device is the Palm LCD screen.

Ambiguous conditions: FILE word set

Attempting to position a file outside its boundaries (11.6.1.2142 REPOSITION-FILE):

Not applicable.

Attempting to read from file positions not yet written (11.6.1.2080 READ-FILE, 11.6.1.2090 READ-LINE)

Not applicable.

fileid is invalid (11.6.1.1717 INCLUDE-FILE):

Not applicable.

I/O exception reading or closing fileid (11.6.1.1717 INCLUDE-FILE, 11.6.1.1718 INCLUDED):

Not applicable.

Named file cannot be opened (11.6.1.1718 INCLUDED):

-38 THROW.

Requesting an unmapped block number (11.3.2 Blocks in files):

Not applicable.

Using 11.6.1.2218 SOURCE-ID when 7.6.1.0790 BLK is not zero.

Not applicable.

Ambiguous conditions: FLOAT word set

DF@ or DF! is used with an address that is not double-float aligned:

Not applicable.

F@ or F! is used with an address that is not float aligned:

If the address is not cell-aligned, the PalmOS will trap the access and a system exception will result.

Floating point result out of range (e.g., in 12.6.1.1430 F/):

-43 THROW (when detected).

SF@ or SF! is used with an address that is not single-float aligned:

Not applicable.

BASE is not decimal (12.6.1.2143 REPRESENT, 12.6.2.1427 F., 12.6.2.1513 FE., 12.6.2.1613 FS.):

BASE is not required to be decimal for floating-point conversion.

Both arguments equal zero (12.6.2.1489 FATAN2):

Not applicable.

Cosine of argument is zero for 12.6.2.1625 FTAN:

Not applicable.

d can't be precisely represented as float in 12.6.1.1130 D>F:

Not detected.

Dividing by zero (12.6.1.1430 F/):

-42 THROW.

Exponent too big for conversion (12.6.2.1203 DF!, 12.6.2.1204 DF@, 12.6.2.2202 SF!, 12.6.2.2203 SF@):

Not applicable.

Float less than one (12.6.2.1477 FACOSH):

Not applicable.

Float less than or equal to minus-one (12.6.2.1554 FLNP1):

Not applicable.

Float less than or equal to zero (12.6.2.1553 FLN, 12.6.2.1557 FLOG):

Not applicable.

Float less than zero (12.6.2.1487 FASINH, 12.6.2.1618 FSQRT):

Not detected.

Float magnitude greater than one (12.6.2.1476 FACOS, 12.6.2.1486 FASIN, 12.6.2.1491 FATANH):

Not applicable.

Integer part of float can't be represented by d in 12.6.1.1470 F>D:

-43 THROW.

String larger than pictured-numeric output area (12.6.2.1427 F., 12.6.2.1513 FE., 12.6.2.1613 FS.):

Not applicable.

Ambiguous conditions: TOOLS word set

Deleting the compilation word-list (15.6.2.1580 FORGET):

Not detected.

Fewer than u+1 items on control-flow stack (15.6.2.1015 CSPICK, 15.6.2.1020 CSROLL):

Not applicable.

name can't be found (15.6.2.1580 FORGET):

Not applicable.

Name not defined via 6.1.1000 CREATE (15.6.2.0470 ;CODE):

Not applicable.

6.1.2033 POSTPONE applied to 15.6.2.2532 [IF]:

Not detected.

Reaching the end of the input source before matching 15.6.2.2531 [ELSE] or 15.6.2.2533 [THEN] (15.6.2.2532 [IF]):

Responds as though [THEN] was encountered.

Removing a needed definition (15.6.2.1580 FORGET):

Not detected.

Ambiguous conditions: SEARCH word set

Changing the compilation word list (16.3.3 Finding definition names):

Not detected.

Search order empty (16.6.2.2037 PREVIOUS):

Not detected.

Too many word lists in search order (16.6.2.0715 ALSO):

Not detected.

 


Other Standard Documentation

List of non-standard words using 6.2.2000 PAD (3.3.3.6 Other transient regions):

None.

Operator's terminal facilities available:

The Quartus Forth console provides a dot-addressable bitmap screen of 160 pixels across by 160 pixels down. This space holds (in the default proportional font) 14 lines of (roughly) 40 characters each.  Pixels are square. Coordinate addressing is relative to (0,0) at the top-left of the screen. Clipping is handled by the system.

Screen-scrolling is handled automatically by the output subsystem in Quartus Forth.

While interpreting or during ACCEPT, the operator has access to the full range of PalmOS editing facilities.

The Quartus Forth menu provides ABORT and COLD, along with command-shortcuts for editing facilities.

Program data space available, in address units:

Varies by PalmOS version. As a rule, at least 12K; under newer versions of the PalmOS, Quartus Forth apps have as much as 32K of dynamic RAM available.

Return stack space available, in cells:

1024 cells.

Stack space available, in cells:

1024 cells.

System dictionary space required, in address units:

The Quartus Forth kernel requires approximately 18K. User-available codespace defaults to 32000 additional bytes, to a configurable combined maximum (system+user) of 65K.


Table of Contents - Quartus Forth Home Page
© 1998, 1999 Neal Bridges. All rights reserved.