4

The following bit operation functions are described in this section:

Abbreviation

Function

Description

Page

 

 

 

 

 

 

 

 

AND

Logical AND

If a bit in bit string I1 and the corresponding bit

4-49

 

 

in bit string I2 are both 1, place a 1 in the

 

 

 

corresponding location in output string Q.

 

 

 

 

 

OR

Logical OR

If a bit in bit string I1 and/or the corresponding

4-49

 

 

bit in bit string I2 are both 1, place a 1 in the

 

 

 

corresponding location in output string Q.

 

 

 

 

 

XOR

Logical exclusive

If a bit in bit string I1 and the corresponding bit

4-51

 

OR

in string I2 are different, place a 1 in the

 

 

 

corresponding location in the output bit string.

 

 

 

 

 

NOT

Logical invert

Set the state of each bit in output bit string Q to the

4-53

 

 

opposite state of the corresponding bit in bit string I1.

 

 

 

 

 

SHL

Shift Left

Shift all the bits in a word or string of words to the left

4-55

 

 

by a specified number of places.

 

 

 

 

 

SHR

Shift Right

Shift all the bits in a word or string of words to the right

4-55

 

 

by a specified number of places.

 

 

 

 

 

ROL

Rotate Left

Rotate all the bits in a string a specified number of

4-58

 

 

places to the left.

 

ROR

Rotate Right

Rotate all the bits in a string a specified number of

4-57

 

 

places to the right.

 

BTST

Bit Test

Test a bit within a bit string to determine whether that

4-60

 

 

bit is currently 1 or 0.

 

BSET

Bit Set

Set a bit in a bit string to 1.

4-62

 

 

 

 

BCLR

Bit Clear

Clear a bit within a string by setting that bit to 0.

4-62

 

 

 

 

BPOS

Bit Position

Locate a bit set to 1 in a bit string.

4-64

 

 

 

 

MSKCMP

Masked Compare

Compare the contents of two separate bit strings with

4-66

 

 

the ability to mask selected bits (available for Release

 

 

 

4.5 or higher CPUs).

 

4-48

Series 90-30/20/Micro Programmable Controllers Reference Manual–September 1998

GFK-0467K

Page 129
Image 129
GE 90-30/20/Micro manual Xor, Shl, Shr, Rol, Ror, Bset, Bclr, Bpos