Intel 80286, 80287 Programming Numeric Applications, Condition Code Interpretation after Fprem

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 401
Image 401

PROGRAMMING NUMERIC APPLICATIONS

Table 2-4. Condition Code Interpretation after FPREM

 

Condition Code

 

 

 

 

 

 

 

Interpretation after FPREM

C3

C2

C1

CO

 

 

X

1

X

X

Incomplete Reduction;

 

 

 

 

further iteration is required for complete

 

 

 

 

reduction.

 

 

 

 

 

Complete Reduction;

 

 

 

 

 

C1, C3, and CO contain the three least-

 

 

 

 

significant bits of quotient:

0

0

0

0

(Quotient) MOD 8 =

0

0

0

0

1

(Quotient) MOD 8 =

4

0

0

1

0

(Quotient) MOD 8 =

1

0

0

1

1

(Quotient) MOD 8 =

5

1

0

0

0

(Quotient) MOD 8 =

2

1

0

0

1

(Quotient) MOD 8 =

6

1

0

1

0

(Quotient) MOD 8 =

3

1

0

1

1

(Quotient) MOD 8 =

7

FXTRACT

FXTRACT (extract exponent and significand) "decomposes" the number in the stack top into two numbers that represent the actual value of the operand's exponent and significand fields. The "exponent" replaces the original operand on the stack and the "significand" is pushed onto the stack. Following execution of FXTRACT, ST (the new stack top) contains the value of the original significand expressed as a real number: its sign is the same as the operand's, its exponent is 0 true (16,383 or 3FFFH biased), and its significant is identical to the original operand's. ST(1) contains the value of the original operand's true (unbiased) exponent expressed as a real number. If the original operand is zero, FXTRACT produces zeros in ST and ST(l) and both are signed as the original operand.

To clarify the operation of FXTRACT, assume ST contains a number of whose true exponent is +4 (i.e., its exponent field contains 4003H). After executing FXTRACT, ST(l) will contain the real number +4.0; its sign will be positive, its exponent field will contain 400lH (+2 true) and its significand field will contain 1.l00...00B. In other words, the value in ST(I) will be 1.0 X 22 = 4. If ST contains an operand whose true exponent is -7 (Le., its exponent field contains 3FF8H), then FXTRACT will return an "exponent" of -7.0; after the instruction executes, ST(1)'s sign and exponent fields will contain COOIH (negative sign, true exponent of 2), and its significand will be 1.l1100...00B. In other words, the value in ST(1) will be -1.11 X 22 = -7.0. In both cases, following FXTRACT, ST's sign and significand fields will be the same as the original operand's, and its exponent field will contain 3FFFH (0 true).

FXTRACT is useful in conjunction with FBSTP for converting numbers in 80287 temporary real format to decimal representations (e.g., for printing or displaying). It can also be useful for debugging, because it allows the exponent and significant parts of a real number to be examined separately.

2-9

Page 401
Image 401
Intel 80286, 80287 manual Programming Numeric Applications, Condition Code Interpretation after Fprem