/"'
Meaning of First
Second
Operator
Operation Operand
Operand Result
AND When both bits 1
1
1
are
1,
the re- 1
(l) (l)
suits will be
1.
(l)
1
(l)
Otherwise, the
(l)
(l)
(l)
result will be
(l).
OR
Result will be 1 1 1
1
unless both bits
1
(l)
1
are
(l).
(l)
1
1
(l) (l)
(l)
NOT
Result is oppo-
1
(l)
site of bit.
(l)
1
XOR When one of the bits 1 1
(l)
is
1,
the result is 1
(l)
1
1.
Otherwise, the
(l)
1
1
result is
(l).
(l)
(l)
(l)
EQV
When both bits are 1 1
1
1 or both bits 1
(l)
(l)
are
(l),the
(l)
1
(l)
~-,
result is
1.
(l)
(l)
1
IMP The result is 1 1
1 1
unless the first 1
(l)
(l)
bit is 1 and the
(l)
1 1
second bit is
(l).
(l)
(l)
1
Hierarchy
of
Operators
When your expressions have multiple operators, BASIC performs the
operations according to a well-defined hierarchy so that results are
always predictable.
Parentheses
When a complex expression includes parentheses, BASIC always
evaluates the expressions inside the parentheses before evaluating
the rest of the expression. For example, the expression:
8 -
(3
- 2)
is evaluated like this:
3 - 2
= 1
8 - 1
= 7
2-45