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.
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.
The character set of your computer and display device. Gforth is 8-bit-clean (but some other component in your system may make trouble).
All addresses are character-aligned, because 1 chars produces 1.
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.
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.
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.
The characters [\]^_' are the digits with the decimal value
36−41. There is no way to input many of the larger digits.
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.
ABORT": ¶The error string is stored into the variable abort-string and a
-2 throw is performed.
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.
255 characters.
Given by the constant /line. Currently 255 characters.
-1 8 rshift; 72057594037927935 characters on 64-bit systems,
16777215 characters on 32-bit systems.
ENVIRONMENT?, in characters: ¶Any string length, but only strings that can be names can be recognized.
Change infile-id, ideally with infile-execute. Or by
changing ip-vector (undocumented).
Change outfile-id, e.g., with outfile-execute. Or
change type and emit, e.g., with >string-execute.
Or by changing op-vector (undocumented).
What are we expected to document here?
8
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).
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.
The whole Forth data space is writable.
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.
1
max#tib @. This can vary.
word-pno-size
PAD: ¶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).
ok in interpret state, compiled in compile state,
postponed in postpone state.
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.
STATE when true: ¶-1.
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.
DOES>: ¶No.