<-- Home
Manage -->

CELLS

In Memory Access in Certified Forth Words

Word Name: CELLS
Type: Standard word
Data Stack Signature: n1 -- n2
Return Stack Signature: --
Availability: 200x  ANS94
Forth 200x Reference: 6.1.0890
ANS94 Reference:
Description:

n2 is the size in address units of n1 cells.

Standard Reference URL: http://forth-standard.org/standard/core/CELLS
Example:

CREATE NUMBERS 100 CELLS ALLOT \ Allots space in the array NUMBERS for 100 cells of data.

Comment:

None

See Also: None listed
Test Code:

: BITS ( X -- U )
   0 SWAP BEGIN DUP WHILE
     DUP MSB AND IF >R 1+ R> THEN 2*
   REPEAT DROP ;

( CELLS >= 1 AU, INTEGRAL MULTIPLE OF CHAR SIZE, >= 16 BITS )
T{ 1 CELLS 1 <         -> <FALSE> }T
T{ 1 CELLS 1 CHARS MOD ->    0    }T
T{ 1S BITS 10 <        -> <FALSE> }T