AH500 Programming Manual 
6-348 
API    Instruction code  Operand 
Function 
1518  D  BSQR  P 
S, D 
Square root of the binary-coded 
decimal number 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
16-bit instruction (5 steps) 
32-bit instruction (5 steps) 
AH500  AH500  AH500 
Symbol: 
S
:
Source device  Word/Double word 
D
:
Device in which the result is stored  Word/Double word 
Explanation:   
1.  After the square root of the value in the device specified by S is calculated, the integer part is 
stored in the device specified by D, and the fractional part is stored in the device specified by 
D+1. 
2.  The 16-bit value in S should be within the range between 0 and 9,999, and the 32-bit value in 
S should be within the range between 0 and 99,999,999. 
3.  If the instruction BSQR is used, the square root is rounded down to the fourth decimal place. 
4.  If the instruction DBSQR is used, the square root is rounded down to the eighth decimal place. 
5.  If the operation result stored in D is 0, SM600 is ON. 
Example 1: 
After the square root of the value in D0 is calculated, the integer part is stored in Y0, and the 
fractional part is stored in Y1. 
 
16#1234
1
Binary-coded 
decimal value
1
2 4
3
D0
MOV
Y0
Y1
2
BSQR
Integer part
Fractional part
1
2 3
8
0
5
30
Binary-coded 
decimal value
Binary-coded 
decimal value
 
Example 2: 
After the square root of the value in D0 is calculated, the integer part is stored in Y0, and the 
fractional part is stored in Y1.