Binary Calculation Instructions
Flags
Example
00101
CY
1
Note
5-22-7 SIGNED BINARY MULTIPLY – MBS(––)
Limitations
334
ER:
Indirectly addressed EM/DM word is non-existent.
(Content of *EM/*DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
CY:
ON when the result is negative, i.e., when Mi is less than Su plus CY.
EQ:
ON when the result is 0.
OF:
ON when the result exceeds +2,147,483,647 (7FFF FFFF).
UF:
ON when the result is below –2,147,483,648 (8000 0000).
The following example shows an eight-digit subtraction with CY (SR 25504)
used to indicate a negative result (with unsigned data). The status of the UF
and OF flags indicate whether the result has exceeded the signed binary data
range (–2,147,483,648 (8000 0000) to +2,147,483,647 (7FFF FFFF)).
Mi + 1 : LR 03
Mi : LR 02
7
F
F
F
F
Su + 1 : DM 0023
Su : DM 0022
F
F
F
F
F
R + 1 : LR 03
R : LR 02
8
0
0
0
0
1. For unsigned binary data, CY indicates that the result is negative. Take the
2's complement using NEGL(––) to obtain the absolute value of the true
result. (UF and OF can be ignored.)
2. For signed binary data, the OF flag indicates that the result exceeds
+2,147,483,647 (7FFF FFFF). (CY can be ignored.)
Ladder Symbols
MBS(−−)
Md
Mr
R
DM 6143 to DM 6655 cannot be used for R.
Address Instruction
CLC(41)
00000
00001
SBBL(−−)
00002
LR 02
DM 0012
DM 0022
F
F
0
F
F
0
0
CY (Cleared with CLC(41))
0
0
0
0
UF (SR 25405)
1
OF (SR 25404)
@MBS(−−)
Md
Mr
R
Section 5-22
Operands
LD
CLC(41)
SBBL(−−)
LR
DM
DM
Operand Data Areas
Md: Multiplicand word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Mr: Multiplier word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
R: First result word
IR, SR, AR, DM, EM, HR, LR
00101
22
0012
0022
Need help?
Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?