3. Instructions
ROOT
Instruction
BCD SQUARE ROOT
Symbol
Applicable Program Areas
Function block
Area
definitions
Usage
OK
Operands
Operand
S
First source word
R
Result word
Operand Specifications
Word addresses
Area
CIO
WR
HR
S
OK
OK
OK
R
Flags
Name
Error Flag
Equals Flag
Function
ROOT(072) computes the square root of the 8-digit
BCD number in S+1 and S and outputs the integer
portion of the result to R.
Note 1 The non-integer remainder is eliminated.
2 The operands of this instruction (S+1, S,
and R) are all treated as BCD values. If the
input data is binary, use the ROTB(620)
instruction.
450
Mnemonic
Variations
ROOT
@ROOT
Block program areas
Step program areas
OK
OK
Description
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
ER
• ON if the data in S+1 and S is not BCD.
• OFF in all other cases.
=
• ON if the result is 0000.
• OFF in all other cases.
Function
code
Computes the square root of an 8-digit BCD num-
072
ber and outputs the integer portion of the result to
the specified result word.
ROOT
ROOT(072)
S: First source word
S
R: Result word
R
Subroutines
OK
Data type
DWORD
WORD
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
OK
---
OK
OK
---
OK
Operation
S+1
Binary data (8 digits)
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Function
SFC action or
Interrupt tasks
transition programs
OK
OK
Size
2
1
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
---
S
R
Binary data (4 digits)
TR
bits
---
Need help?
Do you have a question about the CJ - INSTRUCTIONS and is the answer not in the manual?
Questions and answers