Chapter
2.
Assembly
Language
Concepts
Notice
that
a shift one bit position
to
the left has the effect
of
multiplying a value
by
two; a shift one bit
position
to
the right has the effect
of
dividing a value
by
two.
Logical Operators
The logical operators are
as
follows:
Operator
Meaning
NOT
Logical one's complement
AND
Logical
AND
(=1
if both ANDed'bits are
1)
OR
Logical OR
(=1
if either ORed bit
is
1 )
XOR
Logical EXCLUSIVE OR
(=1
if bits are different)
The logical operators act only upon the least significant bit
of
values involved
in
the operation. Also, these
operators are commonly used
in
conditional
IF
directives. These directives are fully explained
in
Chapter 4.
Example:
The
following I F directive tests the least significant bit
of
three items. The assembly language code
that
follows
the IF
is
assembled only if the condition
is
TRUE. This means that
all
three fields must have a one bit
in
the
least significant bit position.
IF
FLD1
AND FLD2 AND FLD3
Compare Operators
The compare operators are
as
follows:
Operator
EQ
NE
LT
LE
GT
GE
NUL
Meaning
Equal
Not equal
Less
than
Less
than or
eq
ual
Greater than
Greater than or equal
Special operator used to test for
null (missing) macro
parameters
2-13