BCD Calculations
Description
Flags
Example
0000
R+1 : HR 8
0
0
5-16-4
BCD DIVIDE – DIV(33)
Limitations
124
When the execution condition is OFF, MUL(32) is not executed and the next
instruction is moved to. When the execution condition is ON, the contents of
Md and Mr are multiplied and the rightmost four digits of the result are placed
in R; the leftmost four digits, in R + 1.
ER:
Md or Mr is not in 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.
When IR 0000 is ON with the following program, the contents of IR 13 and
DM 05 are multiplied and the result is placed in HR 7 and HR 8. Example
data and calculations are shown below the program.
MD : IR 13
3
3
5
6
X
MR : DM 05
0
0
2
5
R : HR 7
0
8
3
9
0
0
Ladder Symbol
DIV(33)
Dd
Dr
R
R and R + 1 must be in the same data area.
Md word
X
Mr word
R +1 word
R word
Address Instruction
0000
LD
MUL(32)
0001
MUL(32)
13
DM 05
HR 7
Operand Data Areas
Dd : Dividend word (BCD)
IR, SR, DM, HR, TC, #
Dr : Divisor word (BCD)
IR, SR, DM, HR, TC, #
R : First result word (BCD)
Section 5-16
Operands
0000
13
DM
05
HR
7
IR, DM, HR