( x a-addr -- )
Store x at a-addr.
( x1 a-addr -- x2 )
Fetch x2, x2 is the value stored at a-addr. Store x1 at a-addr.
( -- )
Store the depth of the control flow stack for checking by
( dea wid -- )
Store the dictionary entry address dea in the word list described
by the word list identifier wid.
( x x-addr -- )
Store x at extended address x-addr.
( -- c-addr u )
c-addr u specify the empty string, u is zero.
See also:
( ud1 -- ud2 )
Divide ud1 by the number in
See also:
( xd -- c-addr u )
Drop xd. Make the pictured numeric output string available as a
character string. c-addr and u specify the resulting character
string. A program may replace characters within the string.
See also:
( -- a-addr )
a-addr is the address of a cell containg the value of the current
See also:
( -- a-addr )
a-addr is the address of a cell containing the number of the
current line of the input text file. Only valid if
See also:
( ud1 -- ud2 )
Convert one digit of ud1 according to the rule for
( "<spaces>name" -- xt )
Skip leading space delimiters. Parse name delimited by a space.
Find name and return xt, the execution token for name. Exception
-13 is issued if name is not found.
When interpreting ' xyz
See also:
Compilation: Perform the execution semantics given below.
Execution: ( "ccc<paren>" -- )
Parse ccc delimited by ) (right parenthesis). ( is an immediate
word.
The number of characters in ccc may be zero to the number of
characters in the parse area.
When parsing from a text file, if the end of the parse area is
reached before a right parenthesis is found, refill the input
buffer from the next line of the file, set
See also:
( n -- c-addr u )
Convert n to a numeric output string with a leading minus sign if
n is negative.
( d -- c-addr u )
Convert d to a numeric output string with a leading minus sign if
d is negative.
( u1 -- c-addr u2 )
c-addr u2 specify a string representing the value u1 as four
hexadecimal digits.
See also:
Interpretation: Perform the function of -14
Execution: ( c-addr u -- )
When executed during compilation, (LOCAL) passes a message to
the system that has one of two meanings. If u is non-zero, the
message identifies a new local whose definition name is given by
the string of characters identified by c-addr u. If u is zero,
the message is "last local" and c-addr has no significance.
The result of executing (LOCAL) during compilation of a
definition is to create a set of named local identifiers, each of
which is a definition name, that only have execution semantics
within the scope of that definition's source.
local Execution: ( -- x )
Push the local's value, x, onto the stack. The local's value is
initialized by removing x from the stack and storing into the
local. The value may changed by preceding the local's name by
Note: This word is not intended for direct use in a definition
to declare that definition's locals. It is instead used by
system or user compiling words. These compiling words in turn
define their own syntax, and may be used directly in
definitions to declare locals.
See also:
( n1|u1 n2|u2 -- n3|u3 )
Multiply n1|u1 by n2|u2 giving product n3|u3.
( n1 n2 n3 -- n4 )
Multiply n1 by n2 producing the double-cell intermediate result
d. Divide d by n3, giving the single-cell quotient n4. Exception
-10 is issued if n3 is zero or if the quotient n4 lies outside
the range of a single-cell signed integer. If d and n3 differ in
sign the result returned will be the same as returned by the
phrase >R M* R>
SWAP DROP
.
( n1 n2 n3 -- n4 n5 )
Multiply n1 by n2 producing the double-cell intermediate result
d. Divide d by n3, giving the single-cell remainder n4 and the
single-cell quotient n5. Exception -10 is issued if n3 is zero or
if the quotient n5 lies outside the range of a single-cell signed
integer. If d and n3 differ in sign the result returned will be
the same as returned by the phrase >R M* R>
( n1|u1 n2|u2 -- n3|u3 )
Add n2|u2 to n1|u1, giving the sum n3|u3.
( n|u a-addr -- )
Add n|u to the single-cell number at a-addr.
Interpretation: Perform the function of -14
Compilation: ( C: do-sys -- )
Append the run-time semantics given below to the current
definition. Resolve the destination of all unresolved occurrences
of
Run-time: ( n -- ) ( R: loop-sys1 -- | loop-sys2 )
The loop control parameters must be available. Add n to the loop
index. If the loop index did not cross the boundary between the
loop limit minus one and the loop limit, continue execution at
beginning of the loop. Otherwise, discard the current loop
control parameters and continue execution immediately following
the loop.
See also:
( c-addr1 u c-addr2 -- )
Place the characters of the string specified by c-addr1 u at the
end of the counted string at c-addr2 and add u to the count at
c-addr2. An exception is issued if the length of the resulting
string would be greater than the implementation defined maximum
length of a counted string.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
Interpretation: ( i*x "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Perform the "+TO name run-time" semantic given in the definition for
the defining word of name.
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Append the "+TO name run-time" semantics given in the definition for
the defining word of name to the current definition.
Implementation: Exception -32 is issued if name was not defined
by a word with "+TO name run-time" semantics.
See also:
( x -- )
Reserve one cell of data space and store x in the cell. If the
data-space pointer is aligned when , begins execution, it will
remain aligned when , finishes execution.
( n1|u1 n2|u2 -- n3|u3 )
Subtract n2|u2 from n1|u1, giving the difference n3|u3.
( -- )
If there is output on the current line, perform
( x1 x2 x3 -- x3 x1 x2 )
Rotate the top three stack items. Equivalent to ROT
.
( c-addr u1 -- c-addr u2 )
If u1 is greater than zero, u2 is equal to u1 less the number of
spaces at the end of the character string specified by c-addr u1.
If u1 is zero or the entire string consists of spaces, u2 is
zero.
( n -- )
Display n in free field format.
Compilation: Perform the execution semantics given below.
Execution: ( "ccc<paren>" -- )
Parse and display ccc delimited by ) (right parenthesis). ( is an
immediate word.
See also:
( n -- )
If
( -- )
Display the copyright message and e-mail address of the author.
( n -- )
Display n as a signed decimal number.
See also:
( char -- )
If char is a printable ASCII character in the range {32 .. 126},
use
( -- )
Display the amount of free memory and the beginning and end of
free memory in the data, list, name, and string space. Display the
size of the stacks and the amount of memory available for
See also:
( u -- )
Display u as a four digit hexadecimal number with a leading
$ (dollar sign) and a trailing space.
See also:
( n -- )
Display the message that is assigned to exception number n. If the
message is not found, display the exception number and the name of
the word where the exception occurred. If n is -1 nothing is
displayed. If n is -2, display the message of the last invoked
( n1 n2 -- )
Display n1 right aligned in a field n2 characters wide. If the
number of characters required to display n1 is greater than n2,
all digits are displayed with no leading spaces in a field as
wide as necessary.
( -- )
Copy and display the values currently on the data stack. Display
delimited by a ( (left parenthesis) and a ) (right parenthesis),
the values on the stack. If
.S is implemented using pictured numeric output words. Its use
will corrupt the transient region identified by
( -- n )
A value. n is the maximum number of values displayed by
( u -- )
Display u as a four character string if it corresponds to a base
paragraph address in CHForth else as a four digit hexadecimal
string. Display a trailing : (colon).
( -- )
Display the signon message. It contains the name of the program,
the version and the name of the author.
( -- )
When .RS is present, any
See also:
( c-addr u -- )
If u is greater than zero, display the character string specified
by c-addr and u. The characters are displayed as with
( n1 n2 -- n3 )
Divide n1 by n2, giving the single-cell quotient n3. Exception
-10 is issued if n2 is zero. If n1 and n2 differ in sign the
result returned will be the same as returned by the phrase >R S>D R>
SWAP DROP
.
( -- n )
n is the maximum number of characters in an input line.
( x1 x2 -- x3 x4 )
Divide n1 by n2, giving the single-cell remainder n3 and the
single-cell quotient n4. Exception -10 is issued if n2 is zero.
If n1 and n2 differ in sign the result returned will be the same
as returned by the phrase >R S>D R>
( -- n )
n is the maximum number of characters in a definition name.
( c-addr1 u1 n -- c-addr2 u2 )
STRADJ the character string at c-addr1 by n characters. The
resulting character string, specified by c-addr2 u2, begins at
c-addr1 plus n characters and is u1 minus n characters long.
( -- 0 )
Return the value zero.
( n -- flag )
flag is true if and only if n is less than zero.
( x -- flag )
flag is true if and only if x is not equal to zero.
( x -- flag )
flag is true if and only if x is equal to zero.
( n -- flag )
flag is true if and only if n is greater than zero.
( -- 1 )
Return the value one.
( n1|u1 -- n2|u2 )
Add 1 to n1|u1 giving the sum n2|u2.
( n1|u1 -- n2|u2 )
Subtract 1 from n1|u1 giving the difference n2|u2.
( -- 2 )
Return the value two.
( x1 x2 a-addr -- )
Store the cell pair x1 x2 at a-addr with x2 at a-addr and x1 at
the next consecutive cell. It is equivalent to the sequence
!
.
See also:
( x1 -- x2 )
x2 is the result by shifting x1 one bit toward the
most-significant bit, filling the vacated least-significant bit
with zero.
( x1 -- x2 )
x2 is the result of shifting x1 one bit toward the
least-significant bit, leaving the most-significant bit
unchanged.
Interpretation: Perform the execution semantics given below.
Execution: ( x1 x2 -- ) ( R: -- x1 x2 )
Transfer cell pair x1 x2 to the return stack. Semantically
equivalent to >R
See also:
( a-addr -- x1 x2 )
Fetch the cell pair x1 x2 stored at a-addr. x2 is stored at
a-addr and x1 at the next consecutive cell. It is equivalent to
the sequence @
.
See also:
( x1 x2 -- )
Drop cell pair x1 x2 from the stack.
( x1 x2 -- x1 x2 x1 x2 )
Duplicate cell pair x1 x2.
Interpretation: Perform the function of -14
Compilation: ( x1 x2 -- )
Append the run-time semantics defined below to the current
definition.
Run-time: ( -- x1 x2 )
Place cell pair x1 x2 on the stack.
( x1 x2 x3 x4 -- x3 x4 )
Drop the first cell pair below the top cell pair of the stack.
( c-addr u -- false | d|ud true )
Convert the string specified by c-addr u1 to a double-cell number
in the current
BASE can be ignored, numbers that are prefixed by
# (number sign) are interpreted as decimal, $ (dollar sign) are interpreted as hexadecimal, % (percentage sign) are interpreted as binary.These prefixes must be placed before an optional - for negative numbers. When BASE is sixteen or $ is used as prefix, lower case characters are considered equal to their upper case equivalents.
( x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2 )
Copy cell pair x1 x2 to the top of the stack.
Interpretation: Perform the execution semantics given below.
Execution: ( -- x1 x2 ) ( R: x1 x2 -- )
Transfer the cell pair x1 x2 from the return stack. Semantically
equivalent to R>
See also:
Interpretation: Perform the execution semantics given below.
Execution: ( -- x1 x2 ) ( R: x1 x2 -- x1 x2 )
Copy cell pair x1 x2 from the returnstack. Semantically
equivalent to R>
>R
See also:
( -- } { R: x1 x2 -- )
Remove cell pair x1 x2 from the return stack. Semantically
equivalent to RDROP
.
( x1 x2 x3 x4 -- x3 x4 x1 x2 )
Exchange the two top cell pairs.
( C: "<spaces>name" -- colon-sys )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name called a "colon definition". Enter
compilation state and start the current definition, producing
colon-sys. Append the initiation semantics given below to the
current definition.
The execution semantics of name will be determined by the words
compiled into the body of the definition. The current definition
definition for name is not findable in the dictionary until it is
ended.
Initiation: ( i*x -- i*x ) ( R: -- nest-sys )
Save information nest-sys about the calling definition. The stack
effects i*x represent arguments to name.
name Execution: ( i*x -- j*x )
Execute the definition name. The stack effects i*x and j*x
represent arguments to and results from name, respectively.
See also:
( C: -- colon-sys ) ( S: -- xt )
Create an execution token xt, enter compilation state and start
the current definition, producing colon-sys. Append the initiation
semantics given below to the current definition.
The execution semantics of xt will be determined by the words
compiled into the body of the definition. The definition can be
executed later by xt
Initiation: ( i*x -- i*x ) ( R: -- nest-sys )
Save implementation-dependent information nest-sys about the
calling definition. The stack effects i*x represent arguments to
xt.
xt Execution: ( i*x -- j*x )
Execute the definition specified by xt. The stack effects i*x and
j*x represent arguments to and results from xt, respectively.
( C: -- colon-sys )
Create a nameless word that is executed when this part of the
dictionary is removed.
Interpretation: Perform the function of -14
Compilation: ( C: colon-sys -- )
Append the run-time semantics defined below to the current
definition. End the current definition, allow it to be found in
the dictionary and enter interpretation state, consuming
colon-sys. The data-space pointer is left aligned.
Run-time: ( -- ) ( R: nest-sys -- )
Return to the calling definition specified by nest-sys.
See also:
( n1 n2 -- flag )
flag is true if and only if n1 is less than n2.
See also:
( -- )
Initialize the pictured numeric output conversion process.
See also:
( x1 x2 -- flag )
flag is true if and only if x1 is not bit-for-bit the same as x2.
( x1 x2 -- flag )
flag is true if and only if x1 is bit-for-bit the same as x2.
( n1 n2 -- flag )
flag is true if and only if n1 is greater than n2.
See also:
( xt -- a-addr )
a-addr is the data-field address corresponding to xt. This is
only valid for words defined via
( xt1 -- xt2 | 0 )
xt2 is the execution token of the
( dea -- n-addr )
n-addr is the flag field address of the dictionary entry dea.
( dea -- n-addr )
n-addr is the forget field address of the dictionary entry dea.
( -- a-addr )
a-addr is the address of a cell containing the offset in
characters from the start of the input buffer to the start of
the parse area.
( dea -- xt x )
Return the execution token xt and the contents of the flags field x
of the definition identified by the dictionary entry address dea.
See also:
( char1 -- char2 )
If char1 is an upper case character, char2 is its lower case
equivalent. Otherwise char2 is char1.
See also:
( xt -- dea | 0 )
dea is the dictionary entry address that is associated with
execution token xt. If xt is not a valid execution token, return
zero.
( ud1 c-addr1 u1 -- ud2 c-addr2 u2 )
ud2 is the unsigned result of converting the characters within
the string specified by c-addr1 u1 into digits, using the number
in
Implementation: Overflow of ud2 during the conversion is ignored.
( wid -- )
Transform the search order consisting of widn .. wid1 (where
wid1 is searched first) into widn .. wid1 wid. Exception
-49 is issued if there are too many word lists in the search
order.
( u1 -- u2 )
u2 is the minimum number of paragraphs needed to store u1
characters.
Interpretation: Perform the execution semantics given below.
Execution: ( x -- ) ( R: -- x )
Move x to the return stack.
See also:
Interpretation: Perform the function of -14
Execution: ( u -- )
u is the paragraph address of the data at the next execution of
See also:
Interpretation: Perform the function of -14
Execution: ( u -- )
u is the paragraph address of the first data block at the next
execution of
See also:
Interpretation: Perform the function of -14
Execution: ( u -- )
u is the paragraph address of the second data block at the next
execution of
See also:
( char1 -- char2 )
If char1 is a lower case character, char2 is its upper case
equivalent. Otherwise char2 is char1.
See also:
( dea -- xt )
xt is the execution token that is associated with the dictionary
entry address dea.
( a-addr -- )
Display the value stored at a-addr.
? is implemented using pictured numeric output words. Its use
will corrupt the transient region identified by
( -- )
Issue exception -29 if the depth of the control flow stack differs
from the value stored by !CSP
.
Interpretation: Perform the function of -14
Compilation: ( C: -- do-sys )
Place do-sys on the control flow stack. Append the run-time
semantics given below the current definition. The semantics are
incomplete until resolved by a consumer of do-sys such as
Run-time: ( n1|u1 n2|u2 -- ) ( R: -- loop-sys )
If n1|u1 is equal to n2|u2, continue execution at the location
given by the consumer of do-sys. Otherwise set up loop control
parameters with index n2|u2 and limit n1|u1 and continue
executing immediately following ?DO. Anything already on the
return stack becomes unavailable until the loop control
parameters are discarded.
Implementation: The condition of n1|u1 and n2|u2 being not both of
the same type is ignored.
See also:
( x -- 0 | x x )
Duplicate x if it is non-zero.
( k*x x1 n -- k*x | i*x n )
If any bits of x1 are non-zero, perform the function of n
Interpretation: Perform the function of -14
Execution: ( flag -- ) ( R: loop-sys -- | loop-sys )
If flag is true, discard the current loop control parameters. An
ambiguous condition exists if they are unavailable. Continue
execution immediately following the innermost syntactically
enclosing
See also:
( x1 x2 -- )
Compare x1 and x2. Exception -22 is issued if they are not equal.
( -- )
Check the stack pointers and issue an exception if one of them
over- or underflows.
( a-addr -- x )
Fetch x, x is the value stored at a-addr.
( a-addr1 -- a-addr2 x )
Fetch x, x is the value stored at a-addr1. Add the size in
address units of a cell to a-addr1 giving a-addr2.
( wid -- dea )
Fetch the dictionary entry address dea of the last definition
from the word list described by the word list identifier wid.
( x-addr -- x )
Fetch x, x is the value stored at extended address x-addr.
( i*x -- ) ( R: j*x -- )
If there is no exception frame on the exception stack (except the
one built by
Implementation: If ABORT was called during interpretation of a
file or block, display some information about the file and the
line where ABORT was called.
( n -- u )
u is the absolute value of n.
( c-addr +n1 -- +n2 )
Receive a string of at most +n1 characters. If +n1 is zero or
greater than 32767, no characters will be received and +n2 will
be zero. Display graphic characters as they are received. A
program that depends on the presence or absence of non-graphic
characters has an environmental dependency.
Input terminates when "return" is received. When input
terminates, nothing is appended to the string, and the display is
maintained in an implementation defined way.
+n2 is the length of the string stored at c-addr.
Interpretation: ( "<spaces>name" -- xt )
Skip leading spaces and parse name delimited by a space. xt is
the xt assigned to name. An exception is issued if name was not
defined by
Compilation: ( "<spaces>name" -- )
Skip leading spaces and parse name delimited by a space. Append
the run-time semantics given below to the current definition. An
exception is issued if name was not defined by DEFER.
Run-time: ( -- xt )
xt is the execution token assigned to name when the run-time
semantics is performed.
See also:
( x2 x1 listid -- )
Append the cell pair x2 and x1 to the list identified by listid.
x1 may be looked up in the list by
See also:
Interpretation: Perform the function of -14
Compilation: ( C: dest -- )
Append the run-time semantics given below to the current
definition, resolving the backward reference dest.
Run-time: ( -- )
Continue execution at the location specified by dest. If no other
control flow words are used, any program code after AGAIN will
not be executed.
See also:
Interpretation: Perform the function of -14
Compilation: ( C: -- orig )
Put the location of a new unresolved forward reference orig onto
the control flow stack. Append the run-time semantics given below
to the current definition. The semantics are incomplete until
orig is resolved (e.g., by
Run-time: ( -- )
Continue execution at the location specified by the resolution of
orig.
( xt "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the semantics defined for the
execution token xt. name inherits the flags from xt.
See also:
( -- )
If the data-space pointer is not aligned, reserve enough space to
align it.
( addr -- a-addr )
a-addr is the first aligned address greater than or equal to
addr.
( u1 -- u2 ior )
Allocate u1 contiguous paragraphs of free memory available to the
operating system. The data-space pointer is unaffected by this
operation. The initial contents of the allocated space is
undefined.
If the allocation succeeds, u2 is the starting paragraph address
of the allocated space and ior is zero.
If the operation fails, u2 is the number of paragraphs of the
largest contiguous available memory block and ior is the I/O
result code.
See also:
( +n -- a-addr )
Reserve +n address units of contiguous data space. The data space
pointer is unaffected by this operation. The initial content of
the allocated space is undefined. a-addr is the aligned starting
address of the allocated space.
Note: This space does not survive
See also:
( +n -- c-addr )
Reserve +n characters of temporary contiguous data space. The
data-space pointer is unaffected by this operation. The initial
content of the allocated space is undefined. c-addr is the
starting address of the allocated space.
See also:
( n -- )
If n is greater than zero, reserve n address units of data space.
If n is less than zero, release |n| address units of data space.
If n is zero, leave the data-space pointer unchanged.
If the data-space pointer is aligned and n is a multiple of the
size of a cell when ALLOT begins execution, it will remain
aligned when ALLOT finishes execution.
If the data-space pointer is character aligned and n is a
multiple of the size of a character when ALLOT begins execution,
it will remain character aligned when ALLOT finishes execution.
( -- )
Transform the search order consisting of widn .. wid2 wid1 (where
wid1 is searched first) into widn .. widn2 wid1 wid1. Exception
-49 is issued if there are too many word lists in the search
order.
( x1 x2 -- x3 )
x3 is the bit-by-bit logical "and" of x1 with x2.
( fileid -- ior )
Reposition the file identified by fileid to the end of the file.
ior is the I/O result code.
At the conclusion of the operation,
( -- c-addr u )
c-addr u describe a character string containing a copy of the
string following the program name on the command line that invoked
the program.
See also:
( xt char | xt x -- )
Assign execution token xt to control character char or extended
key x. An exception is issued if char is not a control character
or an extended key.
See also:
( u1 u2 -- )
Perform steps so that the next character displayed will appear in
column u1, row u2 of the current output device, the upper left
corner of which is row zero, column zero. It is a no-op if the
operation cannot be performed on the current output device with
the specified parameters. Note that for other implementations the
result in that case is an ambiguous condition.
( -- )
A word that is executed when the program is terminated or when
special actions like
See also:
( u -- )
Display u as a two digit hexadecimal number with a trailing
space.
See also:
( -- n )
n is the number of characters in a block buffer.
( -- a-addr )
a-addr is the address of a cell containing the current number
conversion radix {{2..36}}.
( c-addr1 u1 -- c-addr2 u2 )
If the character string c-addr u1 contains one or more
occurrences of / (slash), c-addr2 is the address of the first
character after the rightmost occurrence of the slash and u2 is
the number of characters to the right of the slash. If no slash is
present, or u1 is zero, c-addr2 is c-addr1 and u2 is u1.
See also:
( -- )
Make an alarm sound on the speaker.
See also:
( -- a-addr )
a-addr is the address of a cell containing the frequency in Hertz
of
( -- a-addr )
a-addr is the address of a cell containing the duration in
milliseconds of
Interpretation: Perform the function of -14
Compilation: ( C: -- dest )
Put the next location for a transfer of control, dest, onto the
control flow stack. Append the run-time semantics given below to
the current definition.
Run-time: ( -- )
Continue execution.
See also:
( fam1 -- fam2 )
Modify the file access method fam1 to additionally select a
"binary", i.e. not line oriented, file access method, giving
access method fam2.
See also:
( -- char )
char is the character value for a space.
( c-addr u -- )
If u is greater than zero, store the character value for space in
u consecutive character positions beginning at c-addr.
Implementation: The paragraph address of c-addr may be modified
by
( -- )
Invert the blink character attribute.
See also:
( -- a-addr )
a-addr is the address of a cell containing zero or the number of
the mass-storage block being interpreted. If BLK contains zero,
the input source is not a block and can be identified by
( u -- a-addr )
a-addr is the address of the first character of the block buffer
assigned to mass-storage block u. Exception -33, -34 or -35 is
issued if u is not an available block number.
If block u is already in a block buffer, a-addr is the address of
that block buffer.
If block u is not already in memory and there is an unassigned
block buffer, transfer block u from mass-storage to an
usassigned block buffer, a-addr is the address of that block
buffer.
If block u is not already in memory and there are no unassigned
block buffers, unassign a block buffer. If the block in that
buffer has been
At the conclusion of the operation the block buffer pointed to
by a-addr is the current block buffer and is assigned to u.
( -- )
Set the cursor form to a block.
( a-addr -- xt )
xt is execution token corresponding to the data field address
a-addr. This is only valid for a word defined via
( n1|u1 n2|u2 -- n3|u3 n1|u1 )
Add n1|u1 to n2|u2 giving n3|u3. Used for setting up
( -- )
Invert the bright character attribute.
See also:
( u -- a-addr )
a-addr is the address of the first character of the block buffer
assigned to block u. The contents of the block are unspecified.
Exception -34 or -35 is issued if u is not an available block
number.
If block u is already in a block buffer, a-addr is the address of
that block buffer.
If block u is not already in memory and there is an unassigned
block buffer, a-addr is the address of that block buffer.
If block u is not already in memory and there are no unassigned
block buffers, unassign a block buffer. If the block in that
buffer has been
At the conclusion of the operation the block buffer pointed to by
a-addr is the current block buffer and is assigned to u.
See also:
( fileid -- ior )
Allocate a buffer outside the data space for the file identified
by fileid for subsequent use by
See also:
( -- )
Return control to the host operating system with return code zero.
See also:
( char c-addr -- )
Store char at c-addr.
( char x-addr -- )
Store char at extended address x-addr.
( char -- )
Reserve space for one character in the data space and store char
in the space. The data-space pointer is always character-aligned.
( char -- c-addr u )
c-addr u represent a temporary string containing character char.
( c-addr -- char )
Fetch the character stored at c-addr.
( x-addr -- char )
Fetch the character stored at extend address x-addr.
( -- )
Calculate the approximate values for
( a-addr -- )
Compile an assembly language call in the dictionary at the
data-space pointer to the address on the stack and increment the
data-space pointer to an aligned address after the instruction.
( -- u )
u is the total number of mass-storage blocks of the current block
file or disk being used.
Interpretation: Perform the function of -14
Compilation: ( C: -- case-sys )
Mark the start of the CASE ...
Run-time: ( -- )
Continue execution.
( -- a-addr )
a-addr is the address of a cell containing a non zero value when
case of characters is significant, zero otherwise.
See also:
( i*x xt -- j*x 0 | i*x n )
Push an exception frame on the exception stack and then execute
the execution token xt (as with
If the execution of xt completes normally (i.e. the exception
frame pushed by this CATCH is not popped by an execution of
THROW) pop the execution frame and return zero on top of the data
stack, above whatever stack items would have been returned by xt
EXECUTE. Otherwise, the remainder of the execution semantics are
given by THROW.
Implementation: No input source specification is saved by CATCH.
( c-addr1 u1 char -- c-addr2 u2 )
c-addr2 u2 describe a temporary location containing the characters
of the string specified by c-addr1 u1 followed by character char.
u2 is u1+1. c-addr2 may differ from c-addr1.
See also:
( a-addr1 -- a-addr2 )
Add the size in address units of a cell to a-addr1 giving
a-addr2.
( a-addr1 -- a-addr2 )
Subtract the size in address units of a cell from a-addr1 giving
a-addr2.
( u1 -- u2 )
u2 is the number of cells in u1 characters.
( n1 -- n2 )
n2 is the size in address units of n1 cells.
( c-addr1 -- c-addr2 )
Add the size in address units of a character to c-addr1 giving
c-addr2.
( c-addr1 -- c-addr2 )
Subtract the size in address units of a character from c-addr1
giving c-addr2.
( n1 -- n2 )
n2 is the size in address units of n1 characters.
( c-addr u -- )
Allocate space for u characters at the data-space pointer and
copy u characters beginning at c-addr into the allocated space.
Implementation: The paragraph address of c-addr may be modified
by
See also:
( -- c-addr u )
c-addr u represent a string containing the name, the processor
type, and version of the CHForth program.
CHFORTH is implemented using pictured numeric output words. Its
use will corrupt the transient region identified by
( u1 -- u2 )
u2 is a random number less than u1.
Interpretation: ( "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Perform the "CLEAR name run-time" semantic given in the definition for
the defining word of name.
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Append the "CLEAR name run-time" semantics given in the definition for
the defining word of name to the current definition.
Implementation: Exception -32 is issued if name was not defined
by a word with "CLEAR name run-time" semantics.
See also:
( -- )
Make a more pleasant sort of
( fileid -- ior )
Close the file identified by fileid, ior is the I/O result code.
Implementation: If fileid is equal to
( -- )
Clear the stacks, except the return stack.
( c-addr1 c-addr2 u -- )
If u is greater than zero, copy u consecutive characters,
character-by-character and left-to-right, from c-addr1 to
c-addr2. If c-addr2 lies within the source region, memory
propagation occurs. (c-addr2 lies within the source region if
c-addr2 is not less than c-addr1 and c-addr2 is less than the
quantity c-addr1 u
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( c-addr1 c-addr2 u -- )
If u is greater than zero, copy u consecutive characters,
character-by-character and right-to-left, from c-addr1 to
c-addr2. If c-addr1 lies within the destination region, memory
propagation occurs. (c-addr1 lies within the destination region
if c-addr1 is greater than or equal to c-addr2 and if c-addr2 is
less than the quantity c-addr1 u
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
Interpretation: Perform the function of -14
Execution: ( -- ) ( R: nest-sys1 -- nest-sys2 )
Save information nest-sys2 about the current definition. Return
control to the calling definition specified by nest-sys1.
( -- )
Start or restart the Forth system. When the program starts,
interpret the string given by
( -- n )
Return the number of characters on an output line.
See also:
( c-addr1 u1 c-addr2 u2 -- n )
Compare the string specified by c-addr1 u1 to the string
specified by c-addr2 u2. The strings are compared, beginning at
the given addresses, character by character, up to the length of
the shorter string or until a difference is found. If the two
strings are identical, n is zero. If the two strings are
identical up to the length of the shorter string, n is minus-one
(-1) if u1 is less than u2, and one (1) otherwise. If the two
strings are not identical up to the length of the shorter string,
n is minus-one (-1) if the first non-matching character in the
string specified by c-addr1 u1 has a lesser numerical value than
the corresponding character in the string specified by c-addr2 u2
and one (1) otherwise.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( xt -- )
Append the execution semantics of the definition represented by
xt to the execution semantics of the current word definition.
( -- flag )
flag is true in compilation state, false otherwise.
See also:
( -- flag )
A value containing true if output to the screen is enabled.
( x "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below.
name is referred to as a "constant".
name Execution: ( -- x )
Place x on the stack.
( c-addr1 -- c-addr2 u )
Return the character string specification for the counted string
stored at c-addr1. c-addr2 is the address of the first character
after c-addr1. u is the contents of the character at c-addr1,
which is the length in characters of the string at c-addr2.
( x-addr1 -- x-addr2 char )
Fetch the character char stored at extended address x-addr1 and
add the size in address units of a character to x-addr1 giving
x-addr2.
( -- n )
n identifies the processor type. Allowed values are 86, 186, 286,
386, 486, 586 and 686.
( -- )
Cause subsequent output to appear at the beginning of the next
line.
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below. If the data-space pointer is not aligned, reserve enough
data space to align it. The new data-space pointer defines name's
data field. CREATE does not allocate data space in name's data
field.
name Execution: ( -- a-addr )
a-addr is the address of name's data field. The execution
semantics of name may be extended by using
( c-addr u fam -- fileid ior )
Create the file named in the character string specified by c-addr
and u, and open it with file access method fam. If a file with the
same name already exists, recreate it as an empty file.
If the file was successfully created and opened, ior is zero,
fileid is its identifier, and the file has been positioned at the
start of the file.
Otherwise ior is the I/O result code and fileid is undefined.
Implementation: If the file name begins with ~ (tilde), it is
expanded by
( -- u )
u is the paragraph address of the code and data space. This space
holds the stacks if
( d1|ud1 d2|ud2 -- d3|ud3 )
Add d2|ud2 to d1|ud1, giving the sum d3|ud3.
( d1|ud1 d2|ud2 -- d3|ud3 )
Subtract d2|ud2 from d1|ud1, giving the difference d3|ud3.
( d -- )
Display d in free field format.
( ud -- )
Divide ud by 1024 and display the result in a field of at least 5
characters wide with one decimal and a space.
( d n -- )
Display d right aligned in a field n characters wide. If the
number of characters required to display d is greater than n, all
digits are displayed with no leading spaces in a field as wide as
necessary.
( d -- flag )
flag is true if and only if d is less than zero.
( d1 d2 -- flag )
flag is true if and only if d1 is less than d2.
( xd1 xd2 -- flag )
flag is true if and only if xd1 is equal to xd2.
( d1 d2 -- flag )
flag is true if and only if d1 is greater than d2.
( d -- n )
n is the equivalent of d. An overflow occurs if d lies outside
the range of a signed single-cell number.
( d -- ud )
ud is the absolute value of d.
( -- +n1 +n2 +n3 )
Return the current date. +n1 is the day {1..31}, +n2 is the month
{1..12}, and +n3 is the year (e.g. 1991).
( u -- ior )
Return the contiguous region of memory outside the data space
indicated by the paragraph address u to the operating system for
later allocation. u shall indicate a region of memory outside the
data space that was previously obtained by
If the operation succeeds, or u is zero, ior is zero. If the
operation fails, ior is the I/O result code.
( -- )
Set the numeric conversion radix to ten (decimal).
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below.
name Execution: ( i*x -- j*x )
Execute the xt assigned to name. Exception -60 is issued if no
execution token is assigned to name.
See also:
Interpretation: Perform the function of -14
Compilation: ( "<spaces>name" -- )
Skip leading spaces and parse name delimited by a space. Append
the xt assigned to name to the current definition. An exception
is issued if name was not defined by
See also:
( -- )
Make the compilation word list the same as the first word list
in the search order. Specifies that the names of subsequent
definitions will be placed in the compilation word list.
Subsequent changes in the search order will not effect the
compilation word list.
( c-addr u -- ior )
Delete the file named in the character string specified by c-addr
u.
Implementation: If the file name begins with ~ (tilde), it is
expanded by
( fam1 -- fam2 )
Modify the file access method fam1 to additionally select a file
mode which denies access of other processes for reading and
writing, giving access method fam2.
See also:
( -- +n )
+n is the number of single-cell values on the data stack before
+n was placed on the stack.
( -- )
Display information over the compiled number of bytes, number of
lines and the elapsed time since the start of the program.
( char +n1 -- +n2 true | char false )
+n2 is the result of the conversion of char into a single-digit
number using base +n1. Return also a true flag. If the conversion
fails return char and a false flag. If +n1 is sixteen, a lower
case char is considered equal to its upper case equivalent.
( c-addr u1 -- c-addr u2 )
If the character string c-addr u1 contains one or more
occurrences of / (slash), u2 is the number of characters to the
left of the rightmost occurrence of the slash. If no slash is
present or if the string consists of a single slash, or u1 is
zero, u2 is zero.
See also:
( d1 -- d2 )
d1 is the negation of d1.
Interpretation: Perform the function of -14
Compilation: ( C: -- do-sys )
Place do-sys on the control flow stack. Append the run-time
semantics given below the current definition. The semantics are
incomplete until resolved by a consumer of do-sys such as
Run-time: ( n1|u1 n2|u2 -- ) ( R: -- loop-sys )
Set up loop control parameters with index n2|u2 and limit n1|u1.
Anything already on the return stack becomes unavailable until the
loop control parameters are discarded.
Implementation: The condition of n1|u1 and n2|u2 being not both of
the same type is ignored.
See also:
( x -- )
Remove x from the stack.
( -- a-addr )
a-addr is the address of the disk transfer area, used by
( x -- x x )
Duplicate x.
( x -- x } { R: -- x )
Copy x to the return stack. Semantically equivalent to
See also:
( -- a-addr )
a-addr is the address of a cell containing the line number of the
file where an exception occurred or of the file returned by
( -- u )
Receive one keyboard event u. ASCII keys have bits 7 to 15 set to
zero; other keys have the scan code in bits 8 to 15 and the lower
bits set to zero. Key codes made by holding the ALT-key down and
using the numeric pad give a 8 bit code.
( u -- u false | char true )
If the keyboard event u corresponds to a valid 8 bit character,
return that character and true, otherwise return u and false.
( -- flag )
If a keyboard event is available, return true. Otherwise return
false. The event shall be returned by the next execution of
After EKEY? returns with a value of true, subseqent executions of
EKEY? prior to the execution of
( -- c-addr u )
c-addr u specify the time elapsed in seconds since the last
execution of
ELAPSED is implemented using pictured numeric output words. Its
use will corrupt the transient region identified by
See also:
Interpretation: Perform the function of -14
Compilation: ( C: orig1 -- orig2 )
Put the location of a new unresolved forward reference orig2 onto
the control flow stack. Append the run-time semantics given
below to the current definition. The semantics will be incomplete
until orig2 is resolved (e.g. by
Run-time: ( -- )
Continue execution at the location given by the resolution of
orig2.
See also:
( x -- )
If x is a graphic character in the implementation-defined
character set, display x. The effect of EMIT for all other values
of x is implementation-defined.
Programs that use control characters to perform specific
functions have an environmental dependency. Each EMIT deals with
one character.
See also:
( -- flag )
flag is true if the user output device is ready to accept data
and the execution of
( -- )
Perform the function of
( -- )
Unassign all block buffers. Do not transfer the contents of any
See also:
( method-sys -- )
Terminate defining methods. Remove method-sys from the stack.
See also:
Interpretation: Perform the function of -14
Compilation: ( C: case-sys -- )
Mark the end of the
Run-time: ( x -- )
Discard the case selector x and continue execution.
Interpretation: Perform the function of -14
Compilation: ( C: case-sys1 of-sys -- case-sys2 )
Mark the end of the ...
Run-time: ( -- )
Continue execution at the location specified by the consumer of
case-sys2.
See also:
( -- +n )
+n is the number of characters occupied by the environment strings
of the operation system.
See also:
( c-addr u -- )
If u is greater than zero, clear all bits in each of u
consecutive address units of memory beginning at c-addr.
Implementation: The paragraph address of c-addr may be modified
by
( n -- )
Display the exception message and information where the exception
with number n occurred and the type of the exception and display
the source line with the exception word marked out.
( -- n )
n identifies the source of the last exception occurring when
0 interpreting text entered at the terminal; +n loading a textfile; -2 loading a block; -1 evaluating a string.
( c-addr u n -- )
Compile the string described by c-addr u and exception number n
into the dictionary. When passed n,
See also:
( -- a-addr )
a-addr contains two cells, the length and temporary address
respectively, of the string representing the source line
where an exception occurred.
( -- u )
u is the paragraph address of the environment strings of the
operating system.
See also:
( -- flag )
If the parse area is empty, attempt to
( i*x c-addr u -- j*x )
Save the current input source specification. Store zero in
( c-addr u -- n )
Compile the string described by c-addr u into the dictionary.
Decrement the value of
See also:
( i*x xt -- j*x )
Remove xt from the stack and perform the semantics identified by
it. Other stack effects are due to the word EXECUTEd.
See also:
( c-addr1 u1 -- c-addr2 u2 )
If the string c-addr1 u1 begins with ~ (tilde), c-addr2 u2
describe a temporary region containing the string returned by
The result of a string starting with / will be the letter of the
current drive followed by : and the given string.
( -- xt )
xt is returned by
( -- false )
Return a false flag.
( -- flag )
If a key was pressed, return true. Otherwise return false. This
word looks directly to the keyboard buffer of the BIOS so it is
not directly compatible with
( -- c-addr )
c-addr is the address of a counted character string representing
the name of the current input file. Only valid if
See also:
( fileid -- ud ior )
ud is the current file position for the file identified by
fileid. ior is the I/O result code. ud is undefined if ior is
non-zero.
( fileid -- ud ior )
ud is the size, in characters, of the file identified by
fileid. ior is the I/O result code. This operation does not
effect the value returned by
( c-addr u -- x ior )
Return the status of the file identified by the character
string c-addr u. If the file exists, ior is zero and x is the
file attribute; otherwise ior is the I/O result code and x is
undefined.
Implementation: If the file name begins with ~ (tilde), it is
expanded by
See also:
( c-addr u char -- )
If u is greater than zero, store char in each of u consecutive
characters of memory beginning at c-addr.
Implementation: The paragraph address of c-addr may be modified
by
( c-addr u -- 0 | dea )
Find the definition identified by the string c-addr u. If the
definition is not found after searching all word lists in the
search-order, return zero. If the definition is found, return its
dictionary entry address dea. Case of characters is significant
if the value of
See also:
( c-addr u wid -- 0 | dea )
Find the definition identified by the string c-addr u in the word
list identified by wid. If the definition is not found, return
zero. If the definition is found, return its dictionary entry
address dea. Case of characters is significant if the value of
See also:
( -- )
Perform the function of
( fileid -- ior )
Attempt to force any buffered information written to the file
referred to by fileid to be written to mass storage, and the
size information for the file to be recorded in the storage
directory if changed. If the operation is successful, ior is
zero. Otherwise ior is the I/O result code.
See also:
( d n1 -- n2 n3 )
Divide d by n1, giving the floored quotient n3 and the remainder
n3. Input and output stack arguments are signed. Exception -10 is
issued if n1 is zero or the quotient lies outside the range of a
single-cell signed integer.
See also:
( -- )
Transform the search order consisting of widn .. wid2 wid1 (where
wid1 is searched first) into widn .. wid2
wid(
( -- c-addr u )
c-addr u describe a string representing the name of the base
directory where the Forth source text files reside. The directory
name is defined by the environment variable ForthRoot or, when not
present, the path to the CHForth program. Path names starting with
~ (tilde) are relative to this directory.
See also:
( -- wid )
Return wid, the identifier of the word list that includes all
standard words provided by the implementation. This word list is
initially the compilation word list and is part of the initial
search order.
( -- wid )
Return wid, the identifier of the compilation word list.
( -- c-addr u ior )
c-addr u describe a temporary location containing the name of the
current directory. The name is preceded by the drive letter and a
colon. If no exception occurs, ior is zero. Otherwise c-addr and u
are unspecified and ior is the I/O result code. Characters are
converted to lower case and \ (backslash) to / (slash). c-addr u
is not terminated by a slash.
See also:
( fileid -- u1 u2 ior )
u1 and u2 are the packed modification time and date respectively
of the file identified by fileid. If no exception occurs, ior is
zero. Otherwise u1 and u2 are unspecified and ior is the I/O
result code.
See also:
( n -- x-addr )
Return the extended address x-addr of the interrupt vector n.
( -- widn .. wid1 n )
Returns the number of word lists n in the search order and the
word list identifiers widn .. wid1 identifying these word
lists. wid1 identifies the word list searched first, and widn
the word list that is searched last. The search order is
unaffected.
( -- u1 u2 )
Return the column u1 and row u2 of the cursor on the screen.
( c-addr1 u1 -- c-addr2 u2 )
Search the operating system environment for the character string
specified by c-addr1 u1, given without a terminating = (equals).
The case of the characters is significant. c-addr2 u2 describe a
temporary location containing a character string representing the
characters in the matching environment string following =.
If c-addr1 u1 is not found, u2 is zero and c-addr2 is a temporary
location.
See also:
( u -- )
Display u as a four digit hexadecimal number with a trailing
space.
See also:
( n -- )
Return control to the host operating system with return code n.
See also:
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a dictionary entry for name. The entry is not known to the
Forth system until
( -- addr )
addr is the data-space pointer.
( -- )
Set the contents of
( -- )
Hide the cursor.
( char -- )
Add char to the beginning of the pictured numeric output string.
Exception -17 is issued if HOLD executes outside of a
( c-addr u -- )
Adds the string represented by c-addr u to the pictured numeric
output string. Exception -17 is issued if HOLDS executes outside
of a
See also:
( -- )
Set the cursor on the top left of the screen.
Interpretation: ( -- x ) ( R: x -- x )
Copy x from the return stack to the data stack.
See also:
Execution: ( -- n|u ) ( R: loop-sys -- loop-sys )
n|u is a copy of the current (innermost) loop index.
Implementation: I is equivalent to R@.
Interpretation: ( -- x1 ) ( R: x1 x2 -- x1 x2 )
Copy x1 from the return stack to the data stack.
See also:
Execution: ( -- n|u ) ( R: loop-sys -- loop-sys )
n|u is a copy of the current (innermost) loop limit.
( c-addr1 u1 c-addr2 u2 -- n )
Compare the string specified by c-addr1 u1 to the string
specified by c-addr2 u2. The strings are compared, beginning at
the given addresses, character by character, up to the length of
the shorter string or until a difference is found. If the two
strings are identical, where lower case characters are considered
equal to their upper case equivalents, n is zero. If the two
strings are identical up to the length of the shorter string, n
is minus-one (-1) if u1 is less than u2, and one (1) otherwise.
If the two strings are not identical up to the length of the
shorter string, n is minus-one (-1) if the first non-matching
character in the string specified by c-addr1 u1 has a lesser
numerical value than the corresponding character in the string
specified by c-addr2 u2, where lower case characters are
considered equal to their upper case equivalents, and one (1)
otherwise.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( -- c-addr u )
c-addr u describe a temporary location containing a character
string representing the full path and name of the currently
running CHForth program.
See also:
Interpretation: Perform the function of -14
Compilation: ( C: -- orig )
Put the location of a new unresolved forward reference orig onto
the control flow stack. Append the run-time semantics given
below to the current definition. The semantics are incomplete
until orig is resolved, e.g., by
Run-time: ( x -- )
If all bits of x are zero, continue execution at the location
specified by the resolution of orig.
( -- )
Make the most recent definition an immediate word.
( x1 listid -- x1 false | x2 true )
Search for x1 in the list identified by listid. If x1 is found,
return the associated value x2 and a true flag. Otherwise return
x1 and a false flag.
See also:
( -- c-addr )
c-addr is the address of the input buffer of the current input
file. Only valid if
See also:
( i*x fileid -- j*x )
Remove fileid from the stack. Save the current input source
specification, including the current value of
Repeat until end of file: read a line from the file, fill the
input buffer from the contents of that line, set
Text interpretation begins at the file position where the next
file read would occur.
When the end of the file is reached, close the file and restore
the input source specification to its saved value.
An ambiguous condition exists if fileid is invalid, if an I/O
exception occurs reading fileid, or an I/O exception occurs while
closing fileid.
Implementation: When an ambiguous condition exists, the files
that were being interpreted will be closed and the appropriate
ior will be
( i*x c-addr u -- j*x )
Remove c-addr u from the stack. Save the current input source
specification, including the current value of
Repeat until end of file: read a line from the file, fill the
input buffer from the contents of that line, set >IN to zero, and
interpret.
Text interpretation begins at the file position where the next
file read would occur.
When the end of the file is reached, close the file and restore
the input source specification to its saved value.
An ambiguous condition exists if the named file cannot be opened,
if an I/O exception occurs reading the file, or an I/O exception
occurs closing the file.
Implementation: If the file name begins with ~ (tilde), it is
expanded by
See also:
( -- c-addr )
c-addr is the address of a counted string representing the name
of the configuration file.
( -- )
Interpret the current input buffer.
See also:
( xt1 xt2 "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the interpretation and
compilation semantics given below.
name Interpretation: ( i*x "name1" -- j*x )
Skip leading space delimiters. Parse name1 delimited by a space.
Execute the semantics of xt1. Exception -32 is issued if this
method is not valid for this word or datatype.
name Compilation: ( i*x "name2" -- j*x )
Skip leading space delimiters. Parse name2 delimited by a space.
Execute the semantics of xt2. Exception -32 is issued if this
method is not valid for this word or datatype.
( -- )
Exchange the character foreground and background colors.
See also:
( x1 -- x2 )
Invert all bits of x1, giving its logical inverse x2.
See also:
Interpretation: ( xt "<spaces>name" -- )
Skip leading spaces and parse name delimited by a space. Set name
to execute xt. An exception is issued if name was not defined by
Compilation: ( "<spaces>name" -- )
Skip leading spaces and parse name delimited by a space. Append
the run-time semantics given below to the current definition. An
exception is issued if name was not defined by DEFER.
Run-time: ( xt -- )
Set name to execute xt.
See also:
( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 flag )
Search the string specified by c-addr1 u1 for the string
specified by c-addr2 u2, where lower case characters are
considered equal to their upper case equivalents. If flag is
true, a match was found at c-addr3 with u3 characters remaining.
If flag is false there was no match and c-addr3 is c-addr1 and u3
is u1.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( c-addr1 u1 c-addr2 u2 -- flag )
Compare the string specified by c-addr1 u1 to the string
specified by c-addr2 u2. If u1 and u2 differ, return false.
The strings are compared, beginning at the given addresses,
character by character, where lower case characters are considered
equal to their upper case equivalents, until a difference is found
or the end of the strings is reached. If the two strings are
identical, flag is true, otherwise false.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
Interpretation: ( -- x1 ) ( R: x1 x2 x3 -- x1 x2 x3 )
Copy x1 from the return stack to the data stack.
See also:
Execution: ( -- n|u ) ( R: loop-sys1 loop-sys2 -- loop-sys1
loop-sys2 )
n|u is a copy of the index of the next outer loop.
See also:
( c-addr u -- a-addr )
Reserve u+1 address units of contiguous data space. The data space
pointer is unaffected by this operation. a-addr is the aligned
starting address of the allocated space. Store the string
described by c-addr u as a counted string at a-addr.
Note: This space does not survive
See also:
( -- char )
Receive one character char, a member of the implementation
defined character set. Keyboard events that do not correspond to
such characters are discarded until a valid character is
received, and those events are subsequently unavailable.
All standard characters can be received. Characters received by
KEY are not displayed.
Programs that require the ability to receive control characters
have an environmental dependency.
See also:
( -- flag )
If a character is available, return true. Otherwise return
false. If non keyboard events are available before the first
valid character, they are discarded and subsequently unavailable.
The character shall be returned by the next execution of
After KEY? returns with a value of true, subseqent executions of
KEY? prior to the execution of KEY or
( x l-addr -- )
Store x at l-addr.
( x -- )
Reserve one cell of list space and store x in the cell.
( l-addr -- x )
Fetch x, x is the value stored at l-addr.
( l-addr1 -- l-addr2 x )
Fetch x, x is the value stored at l-addr1. Add the size in
address units of a cell to l-addr1 giving l-addr2.
( -- a-addr )
a-addr is the address of a double cell containing the last
dictionary entry address and its word list identifier.
( -- xt )
A value that contains the last defined execution token.
Interpretation: Perform the function of -14
Execution: ( -- ) ( R: loop-sys -- )
Discard the current loop control parameters. An ambiguous
condition exists if they are unavailable. Continue execution
immediately following the innermost syntactically enclosing
( -- l-addr )
l-addr is the list-space pointer.
( -- a-addr )
addr is one address unit past the last usable address in the code
and data space.
( -- )
Set the cursor form to a line.
( -- a-addr )
a-addr is the address of a cell containing the number of lines
read from text files since the start of the program, not counting
lines read by interpreting the configuration file.
See also:
( a-addr -- )
Make a link from HERE to a-addr. Link in normal order. Current
item is found earlier than previous linked items.
See also:
Interpretation: Perform the function of -14
Compilation: ( x -- )
Append the run-time semantics given below to the current definition.
Run-time: ( -- x )
Place x on the stack.
( -- l-addr )
l-addr is one address unit past the last usable address in the
list space.
( -- l-addr )
l-addr is one address unit past the last physical address in the
list space.
( i*x u -- j*x )
Save the current input source specification. Store u in
Exception -33, -34, or -35 is issued if u is zero, or not a valid
block number.
( -- fileid )
A value containing the file identifier fileid of the log file,
zero if the file is not open.
( -- flag )
A value containing true if output is logged to the logfile.
See also:
( -- flag )
A value containing true if
Interpretation: Perform the function of -14
Compilation: ( C: do-sys -- )
Append the run-time semantics given below to the current
definition. Resolve the destination of all unresolved occurrences
of
Run-time: ( -- ) ( R: loop-sys1 -- | loop-sys2 )
The loop control parameters must be available. Add one to the
loop index. If the loop index is then equal to the loop limit,
discard the loop parameters and continue execution immediately
following the loop. Otherwise continue execution at the beginning
of the loop.
See also:
( u -- )
Reserve u address units above
( -- u )
u is the paragraph address of the list space.
( x1 u -- x2 )
Perform a logical left shift of u bit-places on x1, giving x2.
Put zeroes in the least significant bits vacated by the shift.
( n1 n2 -- d )
d is the signed product of n1 times n2.
( d1 n1 n2 -- d2 )
Multiply d1 by n1 producing the triple-cell intermediate result
t. Divide t by n2, giving the double-cell quotient n3. Exception
-10 is issued if n2 is zero or if the quotient lies outside the
range of a double-cell signed integer.
See also:
( d1|ud1 n -- d2|ud2 )
Add n to d1|ud1, giving the sum d1|ud2.
( char | x -- xt true | false )
If an execution token is assigned to control character char or
extended key x, return xt and a true flag. Otherwise return a
false flag.
See also:
( n1 n2 -- n3 )
n3 is the greater if n1 and n2
( c-addr1 u c-addr2 -- c-addr2 u )
Copy the contents of the area specified by c-addr1 u to the area
specified by c-addr2 u.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( -- a-addr )
addr is one address unit past the last physical address in the
code and data space.
( n -- c-addr u | n 0 )
c-addr u describe a temporary location containing the characters
of the message that is displayed if exception n is issued. If no
associated message is present, n is returned and zero.
See also:
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the interpretation and
compilation semantics defined below. name is referred to as a
"method".
name Interpretation: ( i*x "name1" -- j*x )
Skip leading space delimiters. Parse name1 delimited by a space.
Execute the method action of name1. Exception -32 is issued if
this method is not valid for this word or datatype.
name Compilation: ( "name2" -- )
Skip leading space delimiters. Parse name2 delimited by a space.
Compile the method action of name1. Exception -32 is issued if
this method is not valid for this word or datatype.
( "<spaces>name" -- method-sys )
Skip leading space delimiters. Parse name delimited by a space.
Find name. Start defining methods for name. An exception is
issued if name is not found or name is no defining word. Leave
method-sys on the stack.
See also:
( n1 n2 -- n3 )
n3 is the lesser if n1 and n2
( n1 n2 -- n3 )
Divide n1 by n2, giving the single-cell remainder n3. Exception
-10 is issued if n2 is zero. If n1 and n2 differ in sign the
result returned will be the same as returned by the phrase
>R S>D R>
DROP
.
( addr1 addr2 u -- )
If u is greater than zero, copy the contents of u consecutive
address units at addr1 to the u consecutive address units at
addr2. After MOVE completes, the u consecutive address units at
addr2 contain exactly what the u consecutive address units at
addr1 contained before the move.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( u -- )
Wait u milliseconds.
( -- n1 n2 )
n1/n2 is a factor to convert clock ticks to milliseconds.
See also:
( -- d )
d is the number of milliseconds elapsed since the last
( -- c-addr )
c-addr is the address of a counted string representing the name of
the last opened file, or the name of the file where an exception
occurred, or the name of the file returned by
( x n-addr -- )
Store x at n-addr.
( x -- )
Reserve one cell of name space and store x in the cell.
( n*x n -- } { R: -- n*x n )
Remove n+1 items from the data stack and store them for later
retrieval by
( n-addr -- x )
Fetch x, x is the value stored at n-addr.
( "<spaces>name" -- c-addr u )
Skip leading space delimiters. Parse name delimited by a space.
c-addr is the address of the selected string within the input
buffer and u is its length in characters. If the parse area is
empty or contains only white space, the resulting string has
length zero.
See also:
( dea -- c-addr u )
If dea is a valid dictionary entry address, c-addr u describe a
transient region containing the name of the definition associated
with dea. Otherwise c-addr u contains "{NoName}". u is limited to
See also:
( n1 -- n2 )
Negate n1, giving its aritmetic inverse n2.
See also:
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below. name is referred to as a "list". This list is initially
empty.
name Execution: ( -- listid )
listid is the list identifier of name.
See also:
Interpretation: Perform the function of -14
Compilation: ( -- )
Append the run-time semantics given below to the current definition.
Run-time: ( -- n )
Place n on the stack. n is the value of
( dea1 -- dea2 | 0 )
If dictionary entry dea1 exists and has a precursor, dea2 is the
dictionary entry of the precursor. Otherwise dea2 is zero.
See also:
( -- n-addr )
n-addr is the name-space pointer.
( -- c-addr )
c-addr is the address of a counted string of length zero.
See also:
( x1 x2 -- x2 )
Drop the first item below the top of the stack.
( -- n-addr )
n-addr is one address unit past the last usable address in the
name space.
( c-addr u1 -- c-addr u2 )
If the character string c-addr u1 contains one of more
occurrences of . (dot), u2 is the number of characters to the
left of the rightmost occurrence of . . Otherwise or if . is
followed by one or more occurrences of / (slash), or u1 is zero,
u2 is u1.
See also:
( -- a-addr )
a-addr is the address of a cell containing true when the source
during loading of text files is displayed, otherwise false.
( -- )
Does nothing.
( -- )
Set the attribute of the characters on the screen to the default
value.
See also:
( -- )
Abort with exception message: not implemented, used in some
definitions.
( -- n*x n } { R: n*x n -- )
Retrieve the items previously stored by an invocation of
( u -- )
Reserve u address units above
( -- u )
u is the paragraph address of the name space.
( c-addr u -- false | n|u true )
Convert the string specified by c-addr u1 to a single-cell number
in the current
BASE can be ignored, numbers that are prefixed by
# (number sign) are interpreted as decimal, $ (dollar sign) are interpreted as hexadecimal, % (percentage sign) are interpreted as binary.These prefixes must be placed before an optional - for negative numbers. When BASE is sixteen or $ is used as prefix, lower case characters are considered equal to their upper case equivalents.
Interpretation: Perform the function of -14
Compilation: ( C: -- of-sys )
Put of-sys on the compilation stack. Append the run-time
semantics given below to the current definition. The semantics
are incomplete until resolved by a consumer of of-sys such as
Run-time: ( x1 x2 -- | x1 )
If the two values on the stack are not equal, discard the top
value and continue execution at the location specified by the
consumer of of-sys (e.g., following the next ENDOF). Otherwise,
discard both values and continue execution in line.
See also:
( a-addr -- )
Clear all bits of the single-cell value at a-addr.
( -- u )
u is the number assigned to the first mass-storage block of the
current block file or disk being used.
( a-addr -- )
Set all bits of the single-cell value at a-addr.
( -- )
Set the search order to the minimum search order. The minimum
search order includes the words
See also:
( c-addr u fam -- fileid ior )
Open the file named in the character string specified by c-addr
u, with file access method indicated by fam.
If the file was successfully opened, ior is zero, fileid is its
identifier, and the file has been positioned at the start of the
file.
Otherwise ior is the I/O result code and fileid is undefined.
Implementation: If the file name begins with ~ (tilde), it is
expanded by
( x1 x2 -- x3 )
x3 is the bit-by-bit logical inclusive-or of x1 with x2.
( -- )
Transform the search order consisting of widn .. wid2 wid1 (where
wid1 is searched first) into widn .. wid2 wid(
( -- a-addr )
a-addr is the address of a cell containing the number of
characters printed on the current output line.
( -- fileid )
A value containing the file identifier fileid of the output
stream; otherwise, e.g. with graphics, zero.
( x1 x2 -- x1 x2 x1 )
Place a copy of x1 on top of the stack.
( -- c-addr )
c-addr is the address of a transient region that can be used to
hold data for intermediate processing.
( -- )
Move to another page for output. Actual function depends on the
output device. On a terminal, PAGE clears the screen and resets
the cursor position to the upper left corner. On a printer, PAGE
performs a form feed.
( addr -- a-addr )
a-addr is the first paragraph-aligned address greater than or
equal to addr.
( u1 -- u2 )
u2 is the size in address units of u1 paragraphs.
( char "ccc<char>" -- c-addr u )
Parse ccc delimited by the delimiter char.
c-addr is the address (within the input buffer) and u is the
length of the parsed string. If the parse area was empty, the
resulting string has zero length.
See also:
( "<spaces>name<space>" -- c-addr u )
Skip leading space delimiters. Parse name delimited by a space.
c-addr is the address of the selected string within the input
buffer and u is its length in characters. If the parse area is
empty or contains only white space, the resulting string has
length zero.
See also:
( -- c-addr u )
c-addr u describe the most recent parsed character string within
the input buffer by words like
( c-addr u -- i*x xt )
Find the definition named in the string c-addr u, searching all
word lists in the search order. If the definition is found,
return xt and optional values i*x. If the definition is not found
(when compiling starting with locals), return
( -- )
A word that normally contains
( xu .. x1 x0 u -- xu .. x1 x0 xu )
Remove u. Copy the xu to the top of the stack. An ambiguous
condition exists if there are less than u+2 items on the stack
before PICK is executed.
( c-addr1 u c-addr2 -- )
Place the characters of the string specified by c-addr1 u as a
counted string at c-addr2. An exception is issued if u is greater
than the implementation defined maximum length of a counted
string.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
Interpretation: Perform the function of -14
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Find name. Append the compilation semantics of name to the
current definition. Exception -13 is issued if name is not found.
( -- )
Transform the search order consisting of widn .. wid2 wid1 (where
wid1 is searched first) into widn .. wid2. Exception -50 will be
issued if the search order would be empty after PREVIOUS was
executed.
( -- flag )
A value containing true if output to the printer is enabled.
See also:
( -- fileid )
A value containing the file identifier fileid of the print file;
otherwise zero.
( -- )
Display the 'ok' message in interpretation state if there were
no exceptions issued.
See also:
( -- u )
u is the paragraph address of the program segment prefix.
( x q-addr -- )
Store x at q-addr.
( x -- )
Reserve one cell of string space and store x in the cell.
( q-addr -- x )
Fetch x, x is the value stored at q-addr.
( -- q-addr )
q-addr is the string-space pointer.
( -- q-addr )
q-addr is one address unit past the last usable address in the
strings space.
( u -- )
Reserve u address units above
( -- u )
u is the paragraph address of the string space.
( -- ) ( R: i*x -- )
Empty the return stack, store zero in
- Accept a line from the input source into the input buffer, set>IN to zero and interpret. - Display the implementation defined system prompt if in interpretation state, all processing has been completed, and no ambiguous condition exists.
( -- fam )
fam is the value for selecting the "read only" file access
method.
See also:
( -- fam )
fam is the value for selecting the "read/write" file access
method.
See also:
Interpretation: Perform the execution semantics given below.
Execution: ( -- x ) ( R: x -- )
Move x from the return stack to the data stack.
See also:
Interpretation: Perform the execution semantics given below.
Execution: ( -- x ) ( R: x -- x )
Copy x from the return stack to the data stack.
See also:
( -- u )
Return a random number.
( ud -- )
Initialize the random number generator.
( -- } { R: x -- )
Remove x from the return stack. Semantically equivalent to
See also:
( c-addr u1 fileid -- u2 ior )
Read u1 consecutive characters to c-addr from the current
position of the file identified by fileid.
If u1 characters are read without an exception, ior is zero and
u2 is equal to u1.
If the end of the file is reached before u1 characters are read,
ior is zero and u2 is the number of characters actually read.
If the operation is initiated when the value of
If an exception occurs, ior is the I/O result code and u2 is the
number of characters transferred to c-addr without an exception.
If the operation is initiated when the value returned by
FILE-POSITION is greater than the value returned by FILE-SIZE for
the file identified by fileid, or if the requested operation
attempts to read portions of the file not written, ior is zero
and u2 is zero.
At the conclusion of the operation, FILE-POSITION returns the
next file position after the last character read.
Implementation: The paragraph address of c-addr may be modified
by
See also:
( c-addr u1 fileid -- u2 flag ior )
Read the next line from the file specified by fileid into memory
at the address c-addr. At most u1 characters are read. Up to two
line terminating characters may be read into memory at the end of
the line, but are not included in the count u2. The line buffer
provided by c-addr should be at least u1+2 characters long.
If the operation succeeded, flag is true and ior is zero. If a
line terminator was received before u1 characters were read, then
u2 is the number of characters, not including the line
terminator, actually read (0 <= u2 <= u1). When u1 = u2 the line
terminator has yet to be reached.
If the operation is initiated when the value returned by
If the operation is initiated when the value returned by
FILE-POSITION is greater than the value returned by FILE-SIZE for
the file identified by fileid, or the requested operation
attempts to read portions of the file not yet written ior is
zero, flag is zero and u2 is zero.
At the conclusion of the operation, FILE-POSITION returns the
next file position after the last character read.
Implementation: The paragraph address of c-addr may not be
modified by
( u1 u2 -- ior )
Change the allocation of the contiguous region of memory outside
the data space starting at the paragraph address u1, previously
allocated by
The starting paragraph address u1 is not changed. If the
operation succeeds, ior is zero. If the operation fails, the
region of memory at u1 is unaffected and ior is the I/O result
code.
Interpretation: Perform the function of -14
Compilation: ( -- )
Append the execution semantics of the current definition to the
current definition.
( -- flag )
Attempt to fill the current input stream, returning a true flag
if successful.
When the input source is a block, make the next block the input
source and current input buffer by adding one to the value of
When the input source is a text file, attempt to read the next
line from the text-input file. If successful, make the result the
current input buffer, set >IN to zero and return true. Otherwise
return false.
When the input source is the user input device, attempt to
receive input into the terminal input buffer. If successful, make
the result the input buffer, set >IN to zero, and return true.
Receipt of a line containing no characters is considered
successful. If there is no input available from the current input
source, return false.
When the input source is a string from
( c-addr1 u1 c-addr2 u2 -- ior )
Rename the file named by the character string c-addr1 u1 to the
name in the character string c-addr2 u2. ior is the I/O result
code.
Implementation: If one or both of the file names begins with ~
(tilde), it is expanded by
Interpretation: Perform the function of -14
Compilation: ( C: orig dest -- )
Append the run-time semantics given below to the current
definition, resolving the backward reference dest. Resolve the
forward reference orig using the location following the appended
run-time semantics.
Run-time: ( -- )
Continue execution at the location given by dest.
See also:
( ud fileid -- ior )
Reposition the file identified by fileid to ud. ior is the I/O
result code.
If the file is positioned outside the file boundaries, ior will
be zero, as the operating system does not consider that an error.
At the conclusion of the operation,
( u -- )
Reserve u address units above
( -- u )
u is the number of address units to be reserved in the data space
in a
( xn .. x1 n -- flag )
Attempt to restore the input source specification to the state
described by x1 through xn, flag is true if the input source
specification cannot be so restored.
An ambiguous condition exists if the input source represented by
the arguments is not the same as the current input source.
Implementation: undeterminate action.
See also:
( -- )
Make the most recent definition a compile-only word. The default
interpreter performs the function of -14
( -- )
Make the current definition findable.
( -- )
Transform the search order consisting of widn .. wid2 wid1 (where
wid1 is searched first) into widn .. wid2 wid(
See also:
( x1 x2 x3 -- x2 x3 x1 )
Rotate the top three stack items.
( -- n )
Return the number of lines on an output page.
See also:
( x1 u -- x2 )
Perform a logical right shift of u bit-places on x1, giving x2.
Put zeroes in the most significant bits vacated by the shift.
( n -- d )
Convert the number n to the double-cell number d with the same
numerical value.
( -- )
Transfer the contents of each
( -- xn .. x1 n )
x1 through xn describe the current state of the input source
specification for later use by
( c-addr u -- )
Write the CHForth program with the name specified by c-addr u as
an executable file. name may have a preceding path. Any extension
is replaced by ".exe".
See also:
( -- u )
u is the paragraph address of the text screen.
( c-addr1 u1 char -- c-addr2 u2 )
Scan the string specified by c-addr1 u1 for character char.
c-addr2 u2 describe the part of the string starting with the first
character equal to char. If the string c-addr1 u1 does not contain
char or u1 is zero, c-addr2 the location of the first character
past the end of the string and u2 is zero.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( -- n )
n is the total count of characters plus attributes on the screen.
( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 flag )
Search the string specified by c-addr1 u1 for the string
specified by c-addr2 u2. If flag is true, a match was found at
c-addr3 with u3 characters remaining. If flag is false there was
no match and c-addr3 is c-addr1 and u3 is u1.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( -- d )
d is the number of seconds elapsed since startup of this program.
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the initiation and execution
semantics defined below. Reserve 5 cells of data space and leave
the data-space pointer at an aligned address.
Initiation: ( u1 -- u2 )
Allocate u1 contiguous paragraphs of free memory available to the
operating system. The data-space pointer is unaffected by this
operation. The initial contents of the allocated space is
undefined. Store the paragraph address u2 in the first cell of the
data space reserved, u1 in the second cell and zero in the third
cell. The fourth and fifth cell are for internal administration.
name Execution: ( -- u2 )
u2 is the paragraph address of the allocated memory.
Note: The user may change the value of the third cell to a value
between zero and u1 in order to save the allocated area with the
program.
Interpretation: ( "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Perform the "SET name run-time" semantic given in the definition for
the defining word of name.
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Append the "SET name run-time" semantics given in the definition for
the defining word of name to the current definition.
Implementation: Exception -32 is issued if name was not defined
by a word with "SET name run-time" semantics.
See also:
( wid -- )
Set the compilation word list to the word list identified by
wid.
( c-addr u -- ior )
Set the current directory to the character string specified by
c-addr u. If the string begins with ~ (tilde), the string is
expanded by
See also:
( u1 u2 fileid -- ior )
Set the packed modification time and date of the file identified
by fileid to u1 and u2 respectively. If no exception occurs, ior
is zero. Otherwise ior is the I/O result code.
See also:
( u -- )
Set the frequency of the speaker to u.
( x-addr n -- )
Set interrupt vector n to extended address x-addr.
( widn .. wid1 n -- )
Set the search order to the word lists identified by widn ..
wid1. Subsequently, word list wid1 will be searched first, and
word list widn searched last. If n is zero, empty the search
order. If n is minus one, set the search order to the minimum
search order
Implementation: The maximum of n is sixteen. If n is -2, set the
search order to
( c-addr u -- )
Set the address of the input buffer to c-addr and the number of
characters in the buffer to u. Set
( -- )
Display the cursor.
( n -- )
If n is negative, add a minus sign to the beginning of the
pictured numeric output string. Exception -17 is issued if SIGN
executes outside of a
( -- a-addr )
a-addr is the address of a cell containing true to display the
signon message at startup and false otherwise.
( -- )
Suppress character output to the screen.
See also:
( c-addr1 u1 char -- c-addr2 u2 )
Scan the string specified by c-addr1 u1 for character char.
c-addr2 u2 describe the part of the string starting with the first
character different from char. If the string c-addr1 u1 consists
entirely of characters char or u1 is zero, c-addr2 the location of
the first character past the end of the string and u2 is zero.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
Interpretation: Perform the function of -14
Compilation: ( c-addr1 u -- )
Append the run-time semantics given below to the current
definition.
Run-time: ( -- c-addr2 u )
Return c-addr2 u describing a string consisting of the characters
specified by c-addr1 u during compilation. A program shall not
alter the returned string.
( d n1 -- n2 n3 )
Divide d by n1, giving the symmetric quotient n3 and the
remainder n2. Input and output stack arguments are signed.
Exception -10 is issued if n1 is zero or the quotient lies
outside the range of a single-cell signed integer.
See also:
( -- c-addr u )
c-addr is the address of, and u is the number of characters in,
the input buffer.
( -- 0 | -1 | fileid )
Identifies the source of the non-block input stream (i.e., when
SOURCE-ID Input stream source ----------- ------------------- 0 User input device. -1 String (viaImplementation: If BLK contains a non-zero value, SOURCE-ID is ignored.EVALUATE ). fileid Text file "fileid".
( -- )
Display one space.
( n -- )
If n is greater than zero, display n spaces.
( -- )
Turn the speaker off.
( -- )
Turn the speaker on.
( c-addr1 u1 char -- c-addr2 u2 c-addr1 u3 )
Scan the string specified by c-addr1 u1 for character char.
c-addr2 u2 describe the part of the string after the first
character equal to char. c-addr1 u3 describe the part of the
string before this character. If the string does not contain char
or u1 is zero, c-addr2 is the location of the first character past
the end of the string, u2 is zero and u3 is u1.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( -- u )
u is the paragraph address of the stack space. If missing, the
stacks reside in
( -- )
A word that is executed at the start of the program before
executing
See also:
( -- )
Display an optional message before asking input.
See also:
( -- fileid )
Return the fileid of the standard error file. This file is
initially unbuffered.
( -- fileid )
Return the fileid of the standard input file. This file is
buffered, use
( -- fileid )
Return the fileid of the standard output file. This file is
initially unbuffered.
( -- fileid )
Return the fileid of the standard printer file. This file is
initially unbuffered.
( c-addr1 u1 c-addr2 u2 -- flag )
Compare the string specified by c-addr1 u1 to the string
specified by c-addr2 u2. If u1 and u2 differ, return false.
The strings are compared, beginning at the given addresses,
character by character, until a difference is found or the end
of the strings is reached. If the two strings are identical, flag
is true, otherwise false.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 )
c-addr3 u3 describe a temporary location containing the characters
of the string specified by c-addr1 u1 followed by the characters of
the string specified by c-addr2 u2. u3 is the sum of u1 and u2.
c-addr3 may differ from c-addr1.
See also:
( c-addr1 u -- c-addr2 u )
c-addr2 u describe a temporary location containing a copy of the
character string specified by c-addr1 u.
Implementation: The paragraph address of c-addr1 may be modified
by
See also:
( c-addr u -- )
Place the string specified by c-addr u as a counted string in the
dictionary at the data-space pointer and increment the data-space
pointer to the address past the string.
Implementation: The paragraph address of c-addr may be modified
by
See also:
( c-addr1 u1 -- false | c-addr2 u2 true )
If the string specified by c-addr1 u1 begins with " (double-quote),
and ends with " or at the end of the parse area, c-addr2 u2
represent the string without the leading and trailing quotes and
return true. Otherwise return false. A pair of " represent a
single " in the resulting string.
Note: use only in
( x1 x2 -- x2 x1 )
Exchange the top two stack items.
( -- )
Reset the input and output to the terminal. Store zero in
Interpretation: Perform the function of -14
Compilation: ( C: orig -- )
Append the run-time semantics given below to the current
definition. Resolve the forward reference orig using the location
of the appended run-time semantics.
Run-time: ( -- )
Continue execution.
See also:
( k*x n -- k*x | i*x n )
If any bits of n are non-zero, pop the topmost exception frame
from the exception stack, along with everything on the return
stack above that frame. Then restore the input source
specification in use before the corresponding
If the top of the stack is non zero and there is no exception
frame on the exception stack the behavior is as follows:
If n is minus-one (-1), perform the function of
If n is minus-two (-2), perform the function of
Otherwise display information about the exception, the exception
number and a message associated with the exception number.
Implementation: The stacks involved are the data, return and
locals stacks. No input source specification is restored by THROW.
See also:
( -- ud )
ud is the current number of clock ticks.
See also:
( -- +n1 +n2 +n3 )
Return the current time. +n1 is the second {0..59}, +n2
is the minute {0..59}, and +n3 is the hour {0..23}.
( -- +n1 +n2 +n3 +n4 +n5 +n6 )
Return the current time and date. +n1 is the second {0..59}, +n2
is the minute {0..59}, +n3 is the hour {0..23}, +n4 is the day
{1..31}, +n5 is the month {1..12}, and +n6 is the year (e.g.
1991).
( -- )
Reset the timer for use by
( -- a-addr )
a-addr is the address of variable that is free for use.
Interpretation: ( i*x "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Perform the "TO name run-time" semantic given in the definition for
the defining word of name.
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters and parse name delimited by a space.
Append the "TO name run-time" semantics given in the definition for
the defining word of name to the current definition.
Implementation: Exception -32 is issued if name was not defined
by a word with "TO name run-time" semantics.
See also:
( u1 u2 -- )
Make a sound for the duration of u1 milliseconds with a
frequency of u2.
( -- a-addr )
A variable used in the tracer. If different from zero and the
tracer is present, trace information will be compiled in future
definitions.
See also:
( -- )
Callback to the debugger program, used for stepping through
Forth.
( -- true )
Return a true flag, a single-cell value with all bits set.
( x1 x2 -- x2 x1 x2 )
Copy the first (top) stack item below the second stack item.
( -- a-addr )
a-addr contains the number of milliseconds to wait between
successive executions of
See also:
( c-addr u -- )
If u is greater than zero, display the character string specified
by c-addr and u.
See also:
( u -- )
Display u in free field format.
See also:
( u n -- )
Display u right aligned in a field n characters wide. If the
number of characters required to display u is greater than n, all
digits are displayed with no leading spaces in a field as wide as
necessary.
( u1 u2 -- flag )
flag is true if and only if u1 is less than u2.
See also:
( u1 u2 -- flag )
flag is true if and only if u1 is greater than u2.
See also:
( u -- ud )
ud is the equivalent of u.
( ud -- )
Display ud in free field format.
See also:
( ud n -- )
Display ud right aligned in a field n characters wide. If the
number of characters required to display ud is greater than n,
all digits are displayed with no leading spaces in a field as
wide as necessary.
See also:
( u1 u2 -- ud )
Multiply u1 by u2 giving the unsigned double-cell product ud. All
values and arithmetic are unsigned.
( ud u1 -- u2 u3 )
Divide ud by u1, giving the quotient u3 and the remainder u2. All
values and arithmetic are unsigned. Exception -10 is issued if u1
is zero or if the quotient lies outside the range of a
single-cell unsigned integer.
See also:
Interpretation: Perform the function of -14
Execution: ( -- ) ( R: loop-sys )
Discard the loop-control parameters for the current nesting
level. An UNLOOP is required for each nesting level before the
definition may be
Interpretation: Perform the function of -14
Compilation: ( C: dest -- )
Append the run-time semantics given below to the current
definition, resolving the backward reference dest.
Run-time: ( x -- )
If all bits of x are zero, continue execution at the location
specified by dest.
See also:
( -- )
Mark the current block buffer as modified.
UPDATE does not immediate cause I/O.
See also:
( x "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below with an initial value equal to x.
name is referred to as a "value".
name Execution: ( -- x )
Place x on the stack. The value of x is that given when name was
is created, until the phrase x
Methods for name:
+TO ( n|u -- ) Add n|u to name CLEAR ( -- ) Store zero in name SET ( -- ) Store true in name TO ( x -- ) Store x in name
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below. Reserve one cell of data space at an aligned address.
name is referred to as a "variable".
name Execution: ( -- a-addr )
a-addr is the address of the reserved cell. A program is
responsible for initializing the contents of the reserved cell.
( -- n )
n is the three decimal digit version number of this CHForth
system.
( -- )
Direct character output to the screen.
See also:
( -- a-addr )
a-addr is the address of a cell containg a link to the word lists
and vocabularies.
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Create a definition for name with the execution semantics defined
below. Create a new word list and store the word list identifier
with the definition for name. name is referred to as a
"vocabulary".
name Execution: ( -- )
Set the word list identifier as the first in the search order.
See also:
( -- fam )
fam is the value for selecting the "write only" file access
method.
See also:
( c-addr u -- )
Find name described by the string c-addr u in
See also:
( -- a-addr )
a-addr is the address of a cell containing a non zero value when
the program will warn the user if redefinitions are encountered
and zero otherwise.
( n -- )
Display the type of the exception n, the name of the text file or
blocks file if exception n occurred during loading of such a file
and the line number where the exception occurred. Display the
source line where the exception occurred and markers under the
word that caused the exception. Any control characters in the
source line (notably tabs) are changed to spaces to keep the line
and the markers aligned.
Interpretation: Perform the function of -14
Compilation: ( C: dest -- orig dest )
Put the location of a new unresolved forward reference orig onto
the control flow stack, under the existing dest. Append the
run-time semantics given below to the current definition. The
semantics are incomplete until orig and dest are resolved (e.g.,
by
Run-time: ( x -- )
If all bits of x are zero, continue execution at the location
specified by the resolution of orig.
( n1|u1 n2|u2 n3|u3 -- flag )
Perform a comparison of a test value n1|u1 with a lower limit
n2|u2 and an upper limit n3|u3, returning true if either
(n2|u2<n3|u3 and (n2|u2<=n1|u1 and n1|u1<n3|u3))
or
(n2|u2>n3|u3 and (n2|u2<=n1|u1 or n1|u1<n3|u3))
are true,
returning false otherwise.
Implementation: The condition of n1|u1, n2|u2, and n3|u3 being not
all of the same type is ignored.
( -- wid )
Create a new empty word list, returning its word list identifier
wid. The new word list is allocated in data space. The system
allows the creation of any number of new word lists in addition
of those already provided.
See also:
( c-addr u fileid -- ior )
Write u characters from c-addr to the file identified by fileid
starting at its current position. ior is the I/O result code.
At the conclusion of the operation,
Implementation: The paragraph address of c-addr may be modified
by
See also:
( c-addr u fileid -- ior )
Write u characters from c-addr followed by the line terminator
to the file identified by fileid starting at its current
position. ior is the I/O result code.
At the conclusion of the operation,
Implementation: The paragraph address of c-addr may be modified
by
See also:
( x-addr -- )
Display extended address x-addr as a four character string as
with
( x1 x2 -- x3 )
x3 is the bit-by-bit logical exclusive-or of x1 with x2.
( c-addr -- c-addr n )
Scan the character string at c-addr for character NUL. n is the
number of characters before the first occurence.
Implementation: The paragraph address of c-addr may be modified
by
Interpretation: Perform the execution semantics defined below.
Compilation: Perform the execution semantics defined below.
Execution: ( -- )
Enter interpretation state. [ is an immediate word.
See also:
Interpretation: Perform the function of -14
Compilation: ( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space.
Find name. Append the run-time semantics below to the current
definition. Exception -13 is issued if name is not found.
Run-time: ( -- xt )
Place name's execution token xt on the stack. The execution token
compiled by the phrase " ['] X "
is the same value returned
by " ' X "
outside of compilation state.
See also:
Compilation: Perform the execution semantics given below.
Execution: ( "ccc<eol>" -- )
If
Compilation: Perform the execution semantics given below.
Execution: ( "ccc<eol>" -- )
If
( "ccc<eol>" -- )
Parse and discard the remainder of the parse area. If the input
source is a block, stop interpreting the block. If the input
source is a text file, stop interpreting the file.
( -- )
Enter compilation state.
See also:
Interpretation: Perform the function of -14
Compilation: ( i*x "<spaces>ccc" :}" -- )
Parse ccc according to the following syntax:
{: <arg>* [| <val>* ][-- <out>*] :}
where <arg>, <val> and <out> are local names, and i is the number
of <arg> names given.
The following ambiguous conditions exist when:
-- a local name ends in ":", "[", "^" -- a local name is a single non-alphabetic character; -- the text between {: and :} extends over more than one line; -- {: ... :} is used more than once in a word.Run-time: ( x1 ... xi -- )
+TO ( n|u -- ) Add n|u to name CLEAR ( -- ) Store zero in name SET ( -- ) Store true in nameImplementation: The definition of local identifiers may occur more than once in a definition.