6 BASIC INSTRUCTIONS
6.2 Arithmetic Operation Instructions
231
6
■D/
• Divides BIN 32-bit data designated by (S1) and BIN 32-bit data designated by (S2), and stores the result in the device
designated by (D).
• With a word device, the division operation result is stored in 64 bits and both the quotient and remainder are stored. With a
bit device, only the quotient is stored as the operation result in 32 bits.
• The values for (S1) and (S2) can be designated at between -2147483648 and 2147483647 (BIN 32 bits).
• Judgment whether values for (S1), (S2), (D) and (D)+2 are positive or negative is made on the basis of the most significant
bit (b31). (Sign is attached to both the quotient and remainder.)
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
• The following program multiplies the BIN data at D7 and D8 by the BIN data at D18 and D19 when X5 is ON, and stores the
result at D1 to D4.
• The following program outputs the value resulting when the data at X8 to XF is multiplied by 3.14 to Y30 to Y3F when X3 is
ON.
• Quotient Stored at the lower 32 bits.
• Remainder Stored at the upper 32 bits (Stored only when using a word device).
•0 Positive
•1 Negative
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4100 The divisor is 0.
[Ladder Mode] [List Mode]
[Ladder Mode] [List Mode]
123456 (BIN)
b0b15
567890 (BIN)
b31
4 (BIN) 74066 (BIN)
S1
S2
D D D D
b16
S1
b0b15b31 b16
S2
b0b15b31 b16 b0b15b31 b16