fcos
Cosine
FCOS
Computes cosine of ST(0) (in radians).
Pseudocode Operation
ST(0) ← cos(ST(0))
Encoding
Binary Layout
D9
+0
FF
+1
Operands
Related
More in x87 FPU
Reference
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| D9 FF | FCOS | Valid Valid | Replace ST(0) with its approximate cosine. |
Description
Computes the approximate cosine of the source operand in register ST(0) and stores the result in ST(0). The source operand must be given in radians and must be within the range -263 to +263. The following table shows the results obtained when taking the cosine of various classes of numbers. Table 3-25. FCOS Results
ST(0) SRC ST(0) DEST
- ∞ *
- F -1 to +1 - 0 + 1 + 0 + 1 + F - 1 to + 1
+ ∞ * NaN NaN
Operation
IF |ST(0)| < 263 THEN C2 := 0; ST(0) := FCOS(ST(0)); // approximation of cosine ELSE (* Source operand is out-of-range *) C2 := 1; FI;
Exceptions
Protected Mode Exceptions
#NM CR0.EM[bit 2] or CR0.TS[bit 3] = 1.
#MF If there is a pending x87 FPU exception.
#UD If the LOCK prefix is used.
Real-Address Mode Exceptions
Same exceptions as in protected mode.
Virtual-8086 Mode Exceptions
Same exceptions as in protected mode.
Compatibility Mode Exceptions
Same exceptions as in protected mode.
64-Bit Mode Exceptions
Same exceptions as in protected mode.
FCOS-Cosine Vol. 2A 3-331