beautypg.com

Chapter 4. programming, Of variable 1 becomes 1 – IAI America S-SEL-E User Manual

Page 152

background image

Page 147

Chapter 4. Programming

DIV (Division)

MOD (Remainder)

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 O 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

[Function]

Divides the content of the variable in Operand 1 by the data in Operand 2, and stores the remainder in the
variable in Operand 1. Divides the contents of the variable in Operand 1 by the contents of the variable in
Operand 2 and stores the remainder in the variable in Operand 1. If there is a post instruction (flag, output port),
it turns ON when the computation result (remainder) is zero.

* This command is executed with respect to integers.

[Example]

MOD

1

3

If the content of variable 1 in Operand 1 is 10, then 10 (content of variable 1 in Operand 1) ÷ 3 (data in
Operand 2) = 3 with a remainder of 1, and after the command is executed, the content of variable 1
becomes 1.

MOD

1

*2

If the content of variable 1 in Operand 1 is 10 and the content of variable *2 in Operand 2 is 3, then 10
(content of variable 1 in Operand 1) ÷ 3 (contents of variable *2 in Operand 2) = 3 with a remainder of

1, and after the command is executed, the content

of variable 1 becomes 1.

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

D IV

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]

Divides the content of the variable in Operand 1 by the data in Operand 2, then stores this in the variable in

Operand 1. Divides the content of the variable in Operand 1 by the contents of the variable in Operand 2 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]

DIV

1

5

If the content of variable 1 in Operand 1 is 10, then 10 (content of variable 1 in Operand 1) ÷ 5 (data in
Operand 2) = 2, and after the command is executed, the content of variable 1 becomes 2.

DIV

1

*2

If the content of variable 1 in Operand 1 is 10 and the content of variable *2 in Operand 2 is 5, then 10
(content of variable 1 in Operand 1) ÷ 5 (contents of variable *2 in Operand 2) = 2, and after the
command is executed, the content of variable 1 becomes 2.

This manual is related to the following products: