AH500 Programming Manual 
6-352 
API 
Instruction code  Operand 
Function 
1520    BCOS  P 
S, D 
Cosine 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) 
AH500  AH500  - 
Symbol: 
S
:
Source value  Word 
D
:
Result  Word   
Explanation:   
1.  The source value specified by S is a degree, and the instruction is used to get the cosine of the 
source value specified by S. After the cosine value is gotten, the sign is stored in D, the integer 
part is stored in D+1, and the fractional part is stored in D+2. 
2.  The range of degrees: 0°≦Degree<360° 
3.  The operation result is rounded off to the fifth decimal place. 
4.  If the conversion result is 0, SM600 is ON. 
Example:   
The instruction is used to get the cosine of the value in D0. After the cosine value is gotten, the sign 
is stored in D10, the integer part is stored in D11, and the fractional part is stored in D12. 
 
Binary-coded 
decimal value
Binary-coded 
decimal value
Binary-coded 
decimal value
0
0 0
6
0
0 0
0
0
0 0
0
    D0
D11
BCOS
D10
Binary-coded 
decimal value
5
0 0
0
D12
 
Additional remark: 
1.  If the value in S is not a binary-coded decimal value (The binary-coded decimal value is 
represented by the hexadecimal number, but one of digits is not within the range between 0