## config - Forth system specific words

### Module Description

The config module contains the extension and missing words for a forth system.

### Module Words

#### Extra includes

#### 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
char/ ( n1 -- n2 )
  Convert n1 address units to n2 chars
lroll ( u1 u2 -- u3 )
  Rotate u1 u2 bits to the left
rroll ( u1 u2 -- u3 )
  Rotate u1 u2 bits to the right
d<> ( d1 d2 -- flag )
  Check if two two double are unequal
sgn ( n1 -- n2 )
  Determine the sign of the number, return [-1,0,1]
nil ( -- addr )
  Nil address
0! ( a-addr -- )
  Set zero in address
nil! ( a-addr -- )
  Set nil in address
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 -- wior )
  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 the new value x1
icompare ( c-addr1 u1 c-addr2 u2 -- n )
  Compare case-insensitive two strings
<=> ( n1 n2 -- n3 )
  Compare the two numbers n1,n2 and return the compare result [-1,0,1]
index2offset ( n1 n2 -- n3 )
  Convert the index n1 [-length..length> with length n2 into the offset n3 [0..length>
r'@ ( R: x1 x2 -- x1 x2; -- x1 )
  Fetch the second cell on the return stack

#### 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

f2dup ( F: r1 r2 -- r1 r2 r1 r2 )
  Duplicate two floats
ftuck ( F: r1 r2 -- r2 r1 r2 )
  Swap and over

#### Exceptions

exception ( c-addr u -- n )
  Create an exception, return its number
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
exp-wrong-checksum ( -- n )
  Wrong checksum
exp-wrong-length ( -- n )
  Wrong length
exp-invalid-data ( -- n )
  Invalid data exception number

generated 03-Jun-2010 by ofcfrth-0.10.0