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

Page 146
Chapter 4. Programming
SUB (Subtraction)
[Function]
Subtracts the data in Operand 2 from the variable in Operand 1, then stores this in the variable in Operand 1.
Subtracts the variable in Operand 2 from the contents of the variable in Operand 1 and stores this 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]
SUB
1
10
If the content of variable 1 in Operand 1 is 20, then 20 (content of variable 1 in Operand 1) - 10 (data in
Operand 2) = 10, and after the command is executed, the content of variable 1 becomes 10.
SUB
1
*2
If variable 1 in Operand 1 is 20 and variable *2 in Operand 2 is 10, then 20 (content of variable 1 in
Operand 1) - 10 (contents of variable *2 in Operand 2) = 10, and after the command is executed, the
content of variable 1 becomes 10.
MULT (Multiplication)
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
S U B
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
M U LT
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
[Function]
Multiplies the data in Operand 2 by the variable in Operand 1, then stores this in the variable in Operand 1.
Multiplies the variable in Operand 2 by the contents of the variable in Operand 1 and stores this 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]
MULT 1
10
If the content of variable 1 in Operand 1 is 10, then 10 (content of variable 1 in Operand 1) x 10 (data in
Operand 2) = 100, and after the command is executed, the content of variable 1 becomes 100.
MULT 1
*2
If variable 1 in Operand 1 and variable *2 in Operand 2 both contain 10, then 10 (content of variable 1
in Operand 1) x 10 (contents of variable *2 in Operand 2) = 100, and after the command is executed, the
content of variable 1 becomes 100.