## Logical/Bitmanipulation

0<
zero-less ( n -- flag ), flag is true if and only if n is less than zero.
0=
zero-equals ( x -- flag ), flag is true if and only if x is equal to zero.
<
less-than ( n1 n2 -- flag ), flag is true if and only if n1 is less than n2.
=
equals ( x1 x2 -- flag ), flag is true if and only if x1 is bit-for-bit the same as x2.
>
greater-than ( n1 n2 -- flag ), flag is true if and only if n1 is greater than n2.
AND
( x1 x2 -- x3 ), x3 is the bit-by-bit logical and of x1 with x2.
INVERT
( x1 -- x2 ), Invert all bits of x1, giving its logical inverse x2.
LSHIFT
l-shift ( x1 u -- x2 )
Perform a logical left shift of u bit-places on x1, giving x2. Put zeroes into the least significant bits vacated by the shift. An ambiguous condition exists if u is greater than or equal to the number of bits in a cell.
OR
( x1 x2 -- x3 ), x3 is the bit-by-bit inclusive-or of x1 with x2.
RSHIFT
r-shift ( x1 u -- x2 )
Perform a logical right shift of u bit-places on x1, giving x2. Put zeroes into the most significant bits vacated by the shift. An ambiguous condition exists if u is greater than or equal to the number of bits in a cell.
U<
u-less-than ( u1 u2 -- flag )
flag is true if and only if u1 is less than u2.
XOR
x-or ( x1 x2 -- x3 )

x3 is the bit-by-bit exclusive-or of x1 with x2.

## Interpreter

ABORT
( i*x -- ) ( R: j*x -- )
Empty the data stack and perform the function of QUIT, which includes emptying the return stack, without displaying a message.
ABORT"
abort-quote
* Interpretation: Interpretation semantics for this word are undefined. Compilation: ( "ccc" -- )

Parse ccc delimited by a " (double-quote). Append the run-time semantics given below to the current definition.

``````              <dl>
``````

* Run-time: ( i*x x1 -- | i*x ) ( R: j*x -- | j*x )
Remove x1 from the stack. If any bit of x1 is not zero, display ccc and perform an implementation-defined abort sequence that includes the function of ABORT.
ACCEPT
( c-addr +n1 -- +n2 )

Receive a string of at most +n1 characters. An ambiguous condition exists if +n1 is zero or greater than 32,767. Display graphic characters as they are received. A program that depends on the presence or absence of non-graphic characters in the string has an environmental dependency. The editing functions, if any, that the system performs in order to construct the string are implementation-defined.

Input terminates when an implementation-defined line terminator 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.
ENVIRONMENT?
environment-query ( c-addr u -- false | i*x true )
c-addr is the address of a character string and u is the string's character count. u may have a value in the range from zero to an implementation-defined maximum which shall not be less than 31. The character string should contain a keyword from 3.2.6 Environmental queries or the optional word sets to be checked for correspondence with an attribute of the present environment. If the system treats the attribute as unknown, the returned flag is false; otherwise, the flag is true and the i*x returned is of the type specified in the table for the attribute queried.
EVALUATE
( i*x c-addr u -- j*x )
Save the current input source specification. Store minus-one (-1) in SOURCE-ID if it is present. Make the string described by c-addr and u both the input source and input buffer, set >IN to zero, and interpret. When the parse area is empty, restore the prior input source specification. Other stack effects are due to the words EVALUATEd.
EXECUTE
( 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.
EXIT
* Interpretation: Interpretation semantics for this word are undefined. Execution: ( -- ) ( R: nest-sys -- )
Return control to the calling definition specified by nest-sys. Before executing EXIT within a do-loop, a program shall discard the loop-control parameters by executing UNLOOP.
QUIT
( -- ) ( R: i*x -- )

Empty the return stack, store zero in SOURCE-ID if it is present, make the user input device the input source, and enter interpretation state. Do not display a message. Repeat the following:

``````     * 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.
``````