Download Type ACPU/QCPU-A (A Mode)(Common Instructions

Transcript
6. BASIC INSTRUCTIONS
Applicable
CPU
Bit device
Word (16-bit) device
X
Y
M
L
S
B
F
T
C
D
W
R
A0
(S1)
O
O
O
O
O
O
O
O
O
O
O
O
O
(S2)
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
(D)
A1
Constant Pointer Level
Z
V
K
H
O
O
O
O
O
O
P
I
N
K1
to
K8
O
Error
flag
Available Device
Carry
flag
All CPUs
Index
BIN 32-bit multiplication, division
(D*, D*P, D/, D/P)
Digit specification
6.2.4
MELSEC-A
M9012 (M9010, M9011)
O
Indicates the instruction symbol.
Multiplication/division commands
D*, D/
P
Functions
(S1)
Setting data
(D)
(S2)
(S1)
(D)
(S2)
(S1)
Multiplicand/dividend or
head device number
storing multiplier/dividend
(S2)
Multiplicand/divider or
head device number
storing multiplier/divider
(D)
Head device number
which will store the
result
D*
(1) Performs the multiplication of BIN data specified at (S1) and the BIN data specified at (S2), and stores the multiplication result into the device specified at (D).
(S1)+1
(S1)
(S2)+1
(D)+3
(S2)
b63
b31
b16 b15
b0
b31
567890(BIN)
b16 b15
123456(BIN)
b0
(D)+1
(D)+2
b47
b48
b31
b32
(D)
b15
b16
b0
70109427840(BIN)
(2) When (D) is a bit device, up to the lower 32 bits can be specified and the upper
32 bits cannot be specified.
Example
K1: Lower 4 bits (b0 to 3)
K4: Lower 16 bits (b0 to 15)
K8: 32 bits (b0 to 31)
When the upper 32-bit data of multiplication result is required for the bit device,
store the data to the word device and then transfer the data ((D)+2) and ((D)+3)
of word device to the specified bit device.
(3) At (S1) and (S2), -2147483648 to 2147483647 (BIN 32 bits) can be specified.
(4) The judgment of whether the data of (S1) and (S2) are positive or negative is
made at the highest bit (b31) and that of (D), at (b63).
6 − 19