8.1.1 Implementation Defined Options

(Cell) aligned addresses:

processor-dependent. Gforth’s alignment words perform natural alignment (e.g., an address aligned for a datum of size 8 is divisible by 8). Unaligned accesses may result in a -23 THROW.

EMIT and non-graphic characters:

The character is output using the C library function (actually, macro) putc.

character editing of ACCEPT and EXPECT:

This is modeled on the GNU readline library (see Command Line Editing in The GNU Readline Library) with Emacs-like key bindings. Tab deviates a little by producing a full word completion every time you type it (instead of producing the common prefix of all completions). See Command-line editing.

character set:

The character set of your computer and display device. Gforth is 8-bit-clean (but some other component in your system may make trouble).

Character-aligned address requirements:

All addresses are character-aligned, because 1 chars produces 1.

character-set extensions and matching of names:

Any character can be used in a name. Matching is case-insensitive (except in tables and cs-wordlists) for ASCII characters and case-sensitive for other characters.

conditions under which control characters match a space delimiter:

If word is called with the space character as a delimiter, all white-space characters (as identified by the C macro isspace()) are delimiters. Parse, on the other hand, treats space like other delimiters. Parse-name, which is used by the outer interpreter (aka text interpreter) by default, treats all white-space characters as delimiters.

format of the control-flow stack:

The data stack is used as control-flow stack. The size of a control-flow stack item in cells is given by the constant cs-item-size. At the time of this writing, an item consists of a cell-sized stack-state descriptor (fourth), a (pointer to a) locals list (third), an address in the code (second), and a tag for identifying the item (TOS). The following tags are used: defstart, live-orig, dead-orig, dest, do-dest, scopestart.

conversion of digits > 35

The characters [\]^_' are the digits with the decimal value 36−41. There is no way to input many of the larger digits.

display after input terminates in ACCEPT and EXPECT:

The cursor is moved to the end of the entered string. If the input is terminated using the Return key, a space is typed.

exception abort sequence of ABORT":

The error string is stored into the variable abort-string and a -2 throw is performed.

input line terminator:

For interactive input, C-m (CR) and C-j (LF) terminate lines. One of these characters is typically produced when you type the Enter or Return key.

maximum size of a counted string:

255 characters.

maximum size of a parsed string:

Given by the constant /line. Currently 255 characters.

maximum size of a definition name, in characters:

-1 8 rshift; 72057594037927935 characters on 64-bit systems, 16777215 characters on 32-bit systems.

maximum string length for ENVIRONMENT?, in characters:

Any string length, but only strings that can be names can be recognized.

method of selecting the user input device:

Change infile-id, ideally with infile-execute. Or by changing ip-vector (undocumented).

method of selecting the user output device:

Change outfile-id, e.g., with outfile-execute. Or change type and emit, e.g., with >string-execute. Or by changing op-vector (undocumented).

methods of dictionary compilation:

What are we expected to document here?

number of bits in one address unit:

8

number representation and arithmetic:

Binary. Negative integers are represented in two’s-complement form. FP numbers are represented as IEEE DP FP numbers (binary64) on nearly all platforms (exception: ARM with soft floats).

ranges for integer types:

For 32-bit platforms: u: 0...4294967295, n: -2147483648...2147483647, ud: 0...18446744073709551615, d: -9223372036854775808...9223372036854775807.

For 64-bit platforms: u: 0...18446744073709551615, n: -9223372036854775808...9223372036854775807, ud: 0...340282366920938463463374607431768211455, d: -170141183460469231731687303715884105728...170141183460469231731687303715884105727

You can also make environmental queries for MAX-N, MAX-U, MAX-D and MAX-UD.

read-only data space regions:

The whole Forth data space is writable.

size of buffer at WORD:

PAD HERE - .. 104 characters on 32-bit machines, 176 on 64-bit machines. The buffer is shared with the pictured numeric output string. If overwriting PAD is acceptable, it is as large as the remaining dictionary space, although only as much can be sensibly used as fits in a counted string.

size of one cell in address units:

1 cells .. 4 on 32-bit systems, 8 on 64-bit systems.

size of one character in address units:

1

size of the keyboard terminal buffer:

max#tib @. This can vary.

size of the pictured numeric output buffer:

word-pno-size

size of the scratch area returned by PAD:

The remainder of dictionary space. unused pad here - - ..

system case-sensitivity characteristics:

Dictionary searches are case-insensitive for ASCII characters and case-sensitive for other characters (except that everything is case-sensitive in tables and cs-wordlists).

system prompt:

ok in interpret state, compiled in compile state, postponed in postpone state.

division rounding:

The ordinary division words / mod /mod */ */mod perform floored division. If you write programs that need a specific division rounding, best use fm/mod or sm/rem for portability, but you can also use /s, /f etc.

values of STATE when true:

-1.

values returned after arithmetic overflow:

Arithmetic is performed modulo 2**bits-per-cell for single arithmetic and 4**bits-per-cell for double arithmetic (with appropriate mapping for signed types). Division by zero typically results in a -55 throw (Floating-point unidentified fault) or -10 throw (divide by zero). Integer division overflow can result in these throws, or in -11 throw; in gforth-fast division overflow and divide by zero may also result in returning bogus results without producing an exception.

whether the current definition can be found after DOES>:

No.