Download Series 90-30/20/Micro PLC CPU Instruction Set

Transcript
8
The following bit operation functions are described in this chapter:
Abbreviation
Function
AND
Logical AND
If a bit in bit string I1 and the corresponding bit
in bit string I2 are both 1, place a 1 in the
corresponding location in output string Q.
8-3
OR
Logical OR
If a bit in bit string I1 and/or the corresponding
bit in bit string I2 are both 1, place a 1 in the
corresponding location in output string Q.
8-3
XOR
Logical exclusive
OR
If a bit in bit string I1 and the corresponding bit
in string I2 are different, place a 1 in the
corresponding location in the output bit string.
8-5
NOT
Logical invert
Set the state of each bit in output bit string Q to the
opposite state of the corresponding bit in bit string I1.
8-7
SHL
Shift Left
Shift all the bits in a word or string of words to the left
by a specified number of places.
8-8
SHR
Shift Right
Shift all the bits in a word or string of words to the right
by a specified number of places.
8-8
ROL
Rotate Left
8-10
ROR
Rotate Right
BTST
Bit Test
BSET
Bit Set
Rotate all the bits in a string a specified number of
places to the left.
Rotate all the bits in a string a specified number of
places to the right.
Test a bit within a bit string to determine whether that
bit is currently 1 or 0.
Set a bit in a bit string to 1.
BCLR
Bit Clear
BPOS
Bit Position
MSKCMP
8-2
Masked Compare
Description
Page
8-57
8-12
8-14
Clear a bit within a string by setting that bit to 0.
8-14
Locate a bit set to 1 in a bit string.
8-16
Compare the contents of two separate bit strings with
the ability to mask selected bits (available for Release
4.5 or higher CPUs).
8-18
Series 90™-30/20/Micro PLC CPU Instruction Set Reference Manual – June 1999
GFK-0467L