fist
Store Integer
Converts ST(0) to integer and stores in memory.
Pseudocode Operation
dest ← convert_to_integer(ST(0), rounding_mode);
update_x87_status_flags();
Encoding
Operands
-
dest
Integer Memory
Related
More in x87 FPU
Reference
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| DF /2 | FIST m16int | Valid Valid | Store ST(0) in m16int. | ||
| DB /2 | FIST m32int | Valid Valid | Store ST(0) in m32int. | ||
| DF /3 | FISTP m16int | Valid Valid | Store ST(0) in m16int and pop register stack. | ||
| DB /3 | FISTP m32int | Valid Valid | Store ST(0) in m32int and pop register stack. | ||
| DF /7 | FISTP m64int | Valid Valid | Store ST(0) in m64int and pop register stack. |
Description
The FIST instruction converts the value in the ST(0) register to a signed integer and stores the result in the destination operand. Values can be stored in word or doubleword integer format. The destination operand specifies the address where the first byte of the destination value is to be stored. The FISTP instruction performs the same operation as the FIST instruction and then pops the register stack. To pop the register stack, the processor marks the ST(0) register as empty and increments the stack pointer (TOP) by 1. The FISTP instruction also stores values in quadword integer format. The following table shows the results obtained when storing various classes of numbers in integer format. Table 3-29. FIST/FISTP Results ST(0) DEST
- ∞ or Value Too Large for DEST Format * F ≤ -1 - I -1 < F < -0 **
- 0 0 + 0 0
+ 0 < F < + 1 ** F ≥ + 1 + I + ∞ or Value Too Large for DEST Format *
NaN *
Operation
DEST := Integer(ST(0)); IF Instruction = FISTP THEN PopRegisterStack; FI;