For pending unmasked floating point exceptions

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: alid Valid Valid Compat/ Leg Mode Valid Valid Valid Valid Valid Description Store ST(0) in m16int. Store ST(0) in m32int. Store ST(0) in m16int and pop register stack. Store ST(0) in m32int and pop register stack. 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-32. FIST/FISTP Results ST(0) - or Value Too Large for DEST Format F -1 DEST * -I -1 < F < -0 -0 +0 +0 < F < +1 F +1 + or Value Too Large for DEST Format ** 0 0 ** +I * 3-332 Vol. 2 INSTRUCTION SET REFERENCE, A-M Table 3-32. FIST/FISTP Results (Contd.) ST(0) NaN NOTES: F Means finite floating-point value. I Means integer. * Indicates floating-point invalid-operation (#IA) exception. ** 0 or 1, depending on the rounding mode. If the source value is a non-integral value, it is rounded to an integer value, according to the rounding mode specified by the RC field of the FPU control word. If the converted value is too large for the destination format, or if the source operand is an , SNaN, QNAN, or is in an unsupported format, an invalid-arithmetic-operand condition is signaled. If the invalid-operation exception is not masked, an invalidarithmetic-operand exception (#IA) is generated and no value is stored in the destination operand. If the invalid-operation exception is masked, the integer indefinite value is stored in memory. This instruction's operation is the same in non-64-bit modes and 64-bit mode. DEST * Operation DEST Integer(ST(0)); IF Instruction = FISTP THEN PopRegisterStack; FI; FPU Flags Affected C1 Set to 0 if stack underflow occurred. Indicates rounding direction of if the inexact exception (#P) is generated: 0 not roundup; 1 roundup. Set to 0 otherwise. C0, C2, C3 Undefined. Floating-Point Exceptions #IS #IA #P Stack underflow occurred. Converted value is too large for the destination format. Source operand is an SNaN, QNaN, , or unsupported format. Value cannot be represented exactly in destination format. Vol. 2 3-333 INSTRUCTION SET REFERENCE, A-M Protected Mode Exceptions #GP(0) If the destination is located in a non-writable segment. If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit. If the DS, ES, FS, or GS register is used to access memory and it contains a NULL segment selector. #SS(0) #NM #PF(fault-code) #AC(0) I...
View Full Document

Ask a homework question - tutors are online