![background image](http://html1.mh-extra.com/html/omron/sysmac-c1000h/sysmac-c1000h_operation-manual_743079174.webp)
168
When IR 00000 is ON with the following program, the content of IR 020 is
divided by the content of HR 09 and the result is placed in DM 0017 and DM
0018. Example data and calculations are shown below the program.
DIV(33)
020
HR 09
DM 0017
00000
R: DM 0017
R + 1: DM 0018
1
1
5
0
0
0
0
2
Dd: IR 020
3
4
5
2
Quotient
Remainder
Dd: HR 09
0
0
0
3
Address
Instruction
Operands
00000
LD
00000
00001
DIV(33)
020
HR
09
DM
0017
5-17-12 DOUBLE BCD DIVIDE – DIVL(57)
Dd
: First dividend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Dr
: First divisor word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R
: First result word
IR, AR, DM, HR LR
DIVL(57)
Dd
Dr
R
@DIVL(57)
Dd
Dr
R
When the execution condition is OFF, DIVL(57) is not executed. When the
execution condition is ON, DIVL(57) the eight-digit content of Dd and D+1 is
divided by the content of Dr and Dr+1 and the result is placed in R to R+3:
the quotient in R and R+1, the remainder in R+2 and R+3.
R+1
R
Quotient
Remainder
Dd+1
Dd
Dr+1
Dr
R+3
R+2
ER:
Dr and Dr+1 contain 0.
Dd, Dd+1, Dr, or Dr+1 is not BCD.
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 result is 0.
Example
Description
Flags
BCD Calculations
Section 5-17