BCD Calculation Instructions
Description
Example
00000
Flags
7-21-6 BCD DIVIDE – DIV(33)
Limitations
When the execution condition is OFF, MUL(32) is not executed. When the
execution condition is ON, MUL(32) multiplies Md by the content of Mr, and
places the result In R and R+1.
When IR 00000 is ON with the following program, the contents of IR 013 and
DM 0005 are multiplied and the result is placed in HR 07 and HR 08. Example
data and calculations are shown below the program.
MUL(32)
013
DM 0005
HR 07
Md: IR 013
3
3
Mr: DM 0005
X
0
0
R+1: HR 08
R: HR 07
0
0
0
8
3
9
ER:
Md and/or Mr 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.)
CY:
ON when there is a carry in the result.
EQ:
ON when the result is 0.
Ladder Symbol
DIV(33)
Dd
Dr
R
R and R+1 must be in the same data area. DM 6144 to DM 6655 cannot be used
for R.
Md
X
Mr
R +1
R
Address Instruction
00000
LD
00001
MUL(32)
5
6
2
5
0
0
Operand Data Areas
Dd: Dividend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Dr: Divisor word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
R: First result word (BCD)
IR, SR, AR, DM, HR, LR
Section
7-21
Operands
00000
013
DM
0005
HR
07
461
Need help?
Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?