## fwt - Fixed Width Types module

### Module Description

The fwt module implements types that have a fixed bit width. They are mainly used in interfaces. The words are defined for 32- and 64-bit forth engines.

### Module Words

#### Fixed width constants

#### Fixed width structure fields

wfield: ( structure-sys "<spaces>name" -- structure-sys ; addr1 -- addr2 )
  Create a structure field for a word, 2 bytes, not aligned, return the field address
lfield: ( structure-sys "<spaces>name" -- structure-sys ; addr1 -- addr2 )
  Create a structure field for a long word, 4 bytes, not aligned, return the field address
wfields: ( structure-sys n "<spaces>name" -- structure-sys ; addr1 -- addr2 )
  Create a structure field for n words, not aligned, return the field address
lfields: ( structure-sys n "<spaces>name" -- structure-sys ; addr1 -- addr2 )
  Create a structure field for n long words, not aligned, return the field address

#### Fixed width store and fetch

w@ ( w-addr -- u )
  Fetch a word, 16 bit, zero extend
( w-addr -- n )
  Fetch a word, 16 bit, sign extend
w! ( n w-addr -- )
  Store a word, 16 bit
w, ( x -- )
  Store 16 bits of data in the data storage
u>l ( u -- l )
  Convert a unsigned number to 32 bit number
u>l ( u -- l )
  Convert a unsigned number to 32 bit number
l@ ( l-addr -- n )
  Fetch a long word, 32 bit, zero extend
( l-addr -- n )
  Fetch a long word, 32 bit, sign extend
l! ( n l-addr -- )
  Store a long word, 32 bit
l+! ( l l-addr -- )
  Add l to l-addr
l+! ( l l-addr -- )
  Add l to l-addr
l, ( x -- )
  Store 32 bits of data in the data storage
l, ( x -- )
  Store 32 bits of data in the data storage
llroll ( l1 u2 -- l3 )
  Rotate l1 u2 bits to the left
llroll ( l1 u2 -- l3 )
  Rotate l1 u2 bits to the left
lrroll ( l1 u2 -- l3 )
  Rotate l1 u2 bits to the right
lrroll ( l1 u2 -- l3 )
  Rotate l1 u2 bits to the left
l@! ( l1 l-addr -- l2 )
  Fetch l2 from l-addr and then store l1 at l-addr
l@! ( l1 l-addr -- l2 )
  Fetch l2 from l-addr and then store l1 at l-addr

generated 03-Jun-2010 by ofcfrth-0.10.0