Double Signed Binary Divide - Dbsl - Omron CPM1 Programming Manual

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Binary Calculation Instructions
5-21-10 DOUBLE SIGNED BINARY DIVIDE – DBSL(––)
Limitations
Description
Flags
Example
00000
R+3: LR 04
F
F
F
F
Remainder (–4)
306
Ladder Symbols
DBS(––)
Dd
Dr
R
This instruction is available in the CQM1-CPU4@-E/-EV1 only.
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.
DBS(––) divides the 32-bit (8-digit) signed binary data in Dd+1 and Dd by the
32-bit signed binary data in Dr+1 and Dr, and outputs the 16-digit signed
binary result to R+3 through R. The quotient is placed in R+1 and R, and the
remainder is placed in R+3 and R+2.
Note Refer to 1-10 Calculating with Signed Binary Data for more details.
R+3
Dr+1
ER:
Dr+1 and Dr contain 0.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the content of R+1 and R (the quotient) is 0, otherwise OFF.
In the following example, DBSL(––) is used to divide the signed binary con-
tents of IR 101 and IR 100 with the signed binary contents of DM 0021 and
DM 0020 and output the result to LR 24 through LR 01.
Dd+1: IR 101
F
F
Dr+1: DM 0021
0
0
R+2: LR 03
R+1: LR 02
F
F
F
C
F
F
@DBS(––)
Dd
Dr
R
Remainder
R+2
Dr
Address Instruction
DBSL(––)
00000
00001
100
DM 0020
LR 01
Dd: IR 100
7
A
B
1
5
C
Dr: DM 0020
0
0
0
0
1
A
R: LR 01
F
A
D
F
7
0
Quotient (–336)
Section 5-21
Operand Data Areas
Dd: Dividend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Dr: Divisor word (binary)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word
IR, SR, AR, DM, HR LR
Quotient
R+1
R
Dd+1
Dd
Operands
LD
DBSL(––)
DM
LR
(–8,736,420)
(26)
(–336,016 and –4/26)
00000
100
0020
21

Advertisement

Table of Contents
loading

Table of Contents