EasyManua.ls Logo

Freescale Semiconductor MC68881 - Page 120

Default Icon
409 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
4
FMOD
.o,u,o Remainder
FMOD
Operation:
Assembler
Syntax:
Attributes:
Description:
Modulo Remainder of (FPn (+) Source) ~ FPn
FMOD.<fmt> <ea>,FPn
FMOD.X FPm,FPn
Format= (Byte, Word, Long, Single, Double, Extended, Packed)
Converts the source operand to extended precision (if necessary) and cal-
culates the modulo remainder of the number in the destination floating-point data
register, using the source operand as the modulus. Stores the result in the destination
floating-point data register, and stores the sign and seven least significant bits of the
quotient in the FPSR quotient byte (the quotient is the result of FPn (-) Source). The
modulo remainder function is defined as:
FPn -- (Source x N)
where:
N = INT(FPn (/) Source) in the round-to-zero mode
The FMOD function is not defined for a source operand equal to zero or for a destination
operand equal to infinity. Note that this function is not the same as the FREM instruc-
tion, which uses the round-to-nearest mode and thus returns the remainder that is
required by the
IEEE Specification for Binary Floating-Point Arithmetic.
Operation Table:
=-•-•
Source
Destination
+
In Range
In Range
+
Zero
+
Infinity
+
Modulo Remainder NAN 1 FPn 2
Zero + ÷ 0.0 NAN1 -- 0.0
- -0.0 -0.0
Infinity + NAN 1 NAN 1 NAN1
NOTES:
1. Sets the OPERR bit in the FPSR exception byte.
2. Returns the vatue of FPn before the operation. However, the result is
processed by
the normal
instruction termination procedure to round it as required. Thus, an overflow and or inexact
result may occur if the rounding precision has been changed to a smaller size since the FPn
value was loaded.
3. If the source operand is a NAN, refer to 4.5.4 NANs for more information.
Status Register:
Condition Codes:
Quotient Byte:
Exception Byte:
Affected as described in 4.5.5.1 SETTING FLOATING-POINT
CONDITION CODES
Loaded with the sign and least significant seven bits of the
quotient (FPn (+) Source). The sign of the quotient is the
exclusive OR of the sign bits of the source and destination
operands.
BSUN Cleared
SNAN Refer to 4.5.4
NANs.
OPERR Set if the source is zero, or the destination is
infinity; cleared otherwise
OVFL Cleared
FREESCALE
4-62
MC68881/MC68882 USER'S MANUAL

Table of Contents