254
When CIO 000000 is ON in the following example, the contents of CIO 0013
and D00005 are multiplied and the results is placed in CIO 1207 and CIO 1208.
Example data and calculations are shown below the program.
R+1: CIO 1208 R: CIO 1207
00083900
Md: CIO 0013
3356
Mr: D00005
0025
X
00000 LD 000000
00001 MUL(072)
0013
D00005
1207
Address Instruction Operands
(072)
MUL 0013 D00005 1207
0000
00
5-18-6 BCD DIVIDE: DIV(073)
Variations
j DIV(073)
(073)
DIV Dd Dr R
Operand Data AreasLadder Symbol
Dd: Dividend word CIO, G, A, T, C, #, DM, DR, IR
R: Result word CIO, G, A, DM
Dr: Divisor word CIO, G, A, T, C, #, DM, DR, IR
When the execution condition is OFF, DIV(073) is not executed and the program
moves to the next instruction. When the execution condition is ON, Dd is divided
by Dr and the result is placed in R and R + 1: the quotient in R and the remainder
in R + 1.
R+1 R
DdDr
QuotientRemainder
Note With version-2 CVM1 CPUs, mathematics instructions can use symbols. The
instructions corresponding to DIV(073) and DIVL(077) are /B(434) and /
BL(435).
Dd and Dr must be BCD.
Note Refer to page 115 for general precautions on operand data areas.
Flags ER (A50003): Content of Dd or Dr is not BCD.
Content of *DM word is not BCD when set for BCD.
EQ (A50006): The result is 0.
Example
Description
Precautions
BCD Calculation Instructions Section 5-18