ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 47

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
In other languages, evaluation of boolean expressions may be strict (for example, ADA
gives the programmer the choice) and so both expressions in dyadic logical opera-
tions may need to be evaluated.
Where false is represented by 0, and true is represented by any fixed bit pattern other
than 0 (e.g. true is always 1, or true is always -1), then the following transformations
apply:
and the bitwise instructions given in section 4.8 can be used:
Note that even for some non-strict evaluations, the above sequence may be prefer-
able. Where Y is a simple boolean expression such as a local variable, its evaluation
does not cause any side-effects, and so it does no harm to implement a non-strict
evaluation using a bitwise operation.
4.8
Bitwise logic and bit operations are provided by the instructions listed in Table 4.10.
The not operation has only one operand that is taken from Areg. The result of this,
which is a bitwise inversion of all bits in the operand, is loaded into Areg, leaving Breg
and Creg unaffected.
and , or and xor are bitwise logical operations on two operands that are taken from
Areg and Breg. For each, the result is loaded into Areg. The data previously held in
Creg is popped into Breg and the initial Areg is left in Creg. These operations are
commutative.
bitld , bitst and bitmask are used for setting, clearing and testing bits of a word. bitld
returns the value of a single bit from a value in Breg, bitst sets or clears a single bit
and bitmask creates a mask with a single bit set. In each case the bit number is
initially in Areg and the result is put in Areg. For bitld and bitst , the value containing
the bit to be tested, set or cleared is initially in Breg.
X OR Y
X AND Y
Bitwise logic and bit operations
and
or
xor
not
bitld
bitst
bitmask
rmw
Table 4.10 Bitwise logic and bit instructions
Mnemonic
=
=
and
or
exclusive or
bitwise not
bit load
bit store
bit mask
memory read modify write
X BITOR Y
X BITAND Y
Name
4 Using ST20-C1 instructions
47/205

Related parts for ST20-C1