337
Binary Calculation Instructions
Section 5-22
Description
DBS(––) divides the signed binary content of Dd by the signed binary content
of Dr, and outputs the 8-digit signed binary result to R+1 and R. The quotient
is placed in R, and the remainder is placed in R+1.
Note
Refer to
1-7 Calculating with Signed Binary Data
for more details.
Flags
ER:
Dr contains 0.
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.)
EQ:
ON when the content of R (the quotient) is 0000, otherwise OFF.
Example
In the following example, DBS(––) is used to divide the signed binary contents
of DM 0010 with the signed binary contents of DM 0020 and output the result
to LR 21 and LR 02.
5-22-10 DOUBLE SIGNED BINARY DIVIDE – DBSL(––)
Limitations
Dd and Dd+1 must be in the same data area, as must Dr and Dr+1.
R and R+3 must be in the same data area.
DM 6143 to DM 6655 cannot be used for R.
Dd
Dr
R
R + 1
Quotient Remainder
DBS(
−−
)
DM 0010
DM 0020
LR 01
Address Instruction
Operands
00000
LD
00000
00001
DBS(
−−
)
DM
0010
DM
0020
LR
21
00000
Dd: DM 0010
D D D A
Dr: DM 0020
0 0 1 A
R: LR 01
F E B 0
÷
R+1: LR 02
F F F A
(
−
8,742)
(26)
(
−
336 and
−
6/26)
Remainder (
−
6)
Quotient (
−
336)
Dd
:
First dividend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Dr
:
First divisor word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ladder Symbols
Operand Data Areas
R
:
First result word
IR, SR, AR, DM, EM, HR, LR
DBSL(
−−
)
Dd
Dr
R
@DBSL(
−−
)
Dd
Dr
R