config - Forth system specific words
Module Description
The config module contains the extension and missing words for a forth system.
Module Words
System Settings
end-of-line
( -- c-addr )
Counted string for the end of line for the current system
#bits/byte
( -- n )
Number of bits in a byte
#bits/char
( -- n )
Number of bits in a char
#bits/cell
( -- n )
Number of bits in a cell
bigendian?
( -- flag )
Check for bigendian hardware
Extension words
ms@
( -- u )
Fetch milliseconds timer
max-ms@
( -- u )
Maximum value of the milliseconds timer
lroll
( u1 u2 -- u3 )
Rotate u1 u2 bits to the left
rroll
( u1 u2 -- u3 )
Rotate u1 u2 bits to the right
0!
( a-addr -- )
Set address to zero
nil!
( a-addr -- )
Set address to nil
nil=
( addr -- flag )
Check for nil
nil<>
( addr -- flag )
Check for unequal to nil
nil<>?
( addr -- false | addr true )
If addr is nil, then return false, else return address with true
?free
( addr -- ior )
Free the address if not nil
1+!
( a-addr -- )
Increase contents of address by 1
1-!
( a-addr -- )
Decrease contents of address by 1
@!
( x1 a-addr -- x2 )
First fetch the contents x2 and then store value x1
icompare
( c-addr1 u1 c-addr2 u2 -- n )
Compare case-insensitive two strings and return the result [-1,0,1]
<=>
( n1 n2 -- n )
Compare the two numbers and return the compare result [-1,0,1]
index2offset
( n1 n2 -- n3 )
Convert the index n1 range [-n2..n2> into offset n3 range [0..n2>, negative values of n1 downward length n2
Float extension constants
0e+0
( F: -- r )
Float constant 0.0
1e+0
( F: -- r )
Float constant 1.0
2e+0
( F: -- r )
Float constant 2.0
Float extension words
f-rot
( F: r1 r2 r3 -- r3 r1 r2 )
Rotate counter clockwise three floats
f2dup
( F: r1 r2 -- r1 r2 r1 r2 )
Duplicate two floats
f>r
( F: r -- ; R: -- r )
Push float on the return stack
fr>
( F: -- r ; R: r -- )
Pop float from the return stack
fr@
( F: -- r ; R: r -- r )
Get float from top of return stack
Exceptions
exp-index-out-of-range
( -- n )
Index out of range exception number
exp-invalid-state
( -- n )
Invalid state exception number
exp-no-data
( -- n )
No data available exception number
exp-invalid-parameters
( -- n )
Invalid parameters on stack
exp-wrong-file-type
( -- n )
Wrong file type
exp-wrong-file-version
( -- n )
Wrong file version
exp-wrong-file-data
( -- n )
Wrong file data
generated 05-Jun-2008 by
ofcfrth-0.5.0