Chapter 4. programming – IAI America S-SEL-E User Manual
Page 157

Page 152
2-10 Logical Operation Commands
AND (Logical AND)
Chapter 4. Programming
[Function]
Stores the results of the AND operation on the contents of the variable in Operand 1 and the data in Operand
2, in the variable in Operand 1. Stores the results of the AND operation on the variable in Operand 1 and the
contents of the variable in Operand 2, in the variable in Operand 1. If there is a post instruction (flag, output
port), it turns ON when the computation result is zero.
[Example]
AND
1
3
If the content of variable 1 in Operand 1 is 131 in decimal notation (10000011 in binary notation)
and the data in Operand 2 is 3 in decimal notation (00000011 in binary notation), the result of the
AND operation is 3 in decimal notation (00000011 in binary notation), and variable 1 becomes 3.
Variable 1 (Operand 1)
10000011
Data (Operand 2)
00000011
Result (Store in Variable 1)
00000011 (3 in decimal notation, variable 1 becomes 3)
OR (Logical OR)
E x p a n s io n
c o n d itio n
( A N D · O R )
In p u t
c o n d itio n
( I/O · F la g )
C o m m a n d
P o s t
( O u tp u t p o r t · F la g )
C o m m a n d
O p e r a n d 1
O p e r a n d 2
O p tio n a l
O p tio n a l
A N D
V a r ia b le n o .
D a ta ·V a r ia b le n o .
O p tio n a l
E x p a n s io n
c o n d itio n
( A N D · O R )
In p u t
c o n d itio n
( I/O · F la g )
C o m m a n d
P o s t
( O u tp u t p o r t · F la g )
C o m m a n d
O p e r a n d 1
O p e r a n d 2
O p tio n a l
O p tio n a l
O R
V a r ia b le n o .
D a ta ·V a r ia b le n o .
O p tio n a l
AND
[Function]
Stores the results of the OR operation on the contents of the variable in Operand 1 and the data in Operand 2,
in the variable in Operand 1. Stores the results of the OR operation on the variable in Operand 1 and the
contents of the variable in Operand 2, in the variable in Operand 1. If there is a post instruction (flag, output
port), it turns ON when the computation result is zero.
[Example]
OR
1
3
If the content of variable 1 in Operand 1 is 128 in decimal notation (10000000 in binary notation)
and the data in Operand 2 is 3 in decimal notation (00000011 in binary notation), the result of the OR
operation is 131 in decimal notation (10000011 in binary notation), and variable 1 becomes 131.
Variable 1 (Operand 1)
10000000
Data (Operand 2)
00000011
Result (Store in Variable 1)
10000011 (131 in decimal notation, variable 1 becomes 131)
OR