App. - 45
Project name QA-15
Program name MAIN
Appendix 4.27 Example of operation program calculating n-th power of data
A value stored in D10 is calculated to its n-th power ("n" is a value stored in D14)
and the result is stored in D10.
X1
X1
X1
X1
0
18
21
23
28
29
P0
K10
K0FMOVP D10
D10
K4X30
BINP
D15
D10MOVP
D14K2X20
BINP
D14K1- P
P0SCJ
P0CJ
D14FOR
D10
D15D10D*
D16K10000D10D/
NEXT
K6Y50D16DBCD
K4Y40
D18DBCD
BCD-outputs value
in 10 digits to exterior
Multiplies value
n times
Sets n
Clears data
Sets data
NOTE
An operation error occurs if a value in D10 exceeds 2147483647.