Specifications

Section 4. CRBasic - Native Language Programming
4-11
If 0 then Y=0
is always false, Y will never be set to 0 by this conditional statement.
The CR3000 expression evaluator evaluates the expression, X>=5, and returns
-1, if the expression is true, and 0, if the expression is false.
W=(X>Y)
will set W equal to -1 if X>Y or will set W equal to 0 if X<=Y.
The CR3000 uses -1 rather than some other non-zero number because the and
and or operators are the same for logical statements and binary bitwise
comparisons (see and and or in Section 8). The number -1 is expressed in
binary with all bits equal to 1, the number 0 has all bits equal to 0. When -1 is
anded with any other number the result is the other number, ensuring that if the
other number is non-zero (true), the result will be non-zero
4.7 Flags
While any variable can be used as a flag as far as logical tests in CRBasic are
concerned, it is best to use Boolean variables. If the value of the variable is
non-zero the flag is high. If the value of the variable is 0 the flag is low
(Section 4.6). Boolean variables can only have one of two values, true (-1) or
false (0).
4.8 Parameter Types
Instruction parameters allow different types of inputs. These types are listed
below and specifically identified in the description of the parameter in the
following sections or in CRBasic help.
Constant
Variable
Variable or Array
Constant, Variable, or Expression
Constant, Variable, Array, or Expression
Name
Name or list of Names
Variable, or Expression
Variable, Array, or Expression
Table 4.8-1 lists the maximum length and allowed characters for the names for
Variables, Arrays, Constants, etc.