App. - 28
(2) Example 2
In example 2, D0 is divided by D1 to obtain D5 in 4 decimal places.
The dividend D0 is multiplied with 10000. The result of the dividing calculation
using this multiplied value is converted to a BCD value and output to an external
digital display.
K4Y50 K 4 Y 4 0
K4Y60
D6, integral number
in 4 digits
D5, decimal number
in 4 digits
D7, remainder of
a decimal numbe
r
Project name QA-6
Program name MAIN
X0
0
D0K4X30BINP
D1K4X20BINP
D5D1
Clears D2
10000-fold
D2K0MOVP
D3D0*P
D/P D3
D5D5DBCDP
D7D7DBCDP
K4Y50D6MOVP
K4Y40D5MOVP
K4Y60D7MOVP
K10000
Integral part
Decimal part
Decimal number
remainder