Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 502

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Special Math Instructions
Floating-point Division of Two BCD Numbers
In this example, the 4-digit BCD number in D0 is divided by the 4-digit BCD
number in D1 and the floating-point result is written to D2 and D3.
To perform the floating point division, the BCD value in D0 is converted to
floating-point format in D2001 and D2000 and the BCD value in D1 is con-
verted to floating-point format in D2003 and D2002.
0.00
@MOV
1
#0
D2000
@MOV
#0
D2002
@MOV
2
D2001
@MOV
D2003
3
@MOVD
D0
#21
D2001
@MOVD
D0
#300
D2000
@MOVD
D1
#21
D2003
@MOVD
D1
#300
D2002
@FDIV
4
D2000
D2002
D2
Section 3-13
469

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CP - PROGRAMMING MANUAL 05-2007 and is the answer not in the manual?

Questions and answers

Table of Contents