SW006010 Microchip Technology, SW006010 Datasheet - Page 108

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
MPLAB
apRNOVS^-page 104
C17 C Compiler Libraries
The two formats may be easily converted from one to the other by simple a
manipulation of the Exponent and Mantissa 0 bytes. The following C code shows an
example of this operation.
EXAMPLE 5-1:
Rlcf(AARGB0);
Rlcf(AEXP);
Rrcf(AARGB0);
EXAMPLE 5-2:
Rlcf(AARGB0);
Rrcf(AEXP);
Rrcf(AARGB0);
5.3.2
Several 8-bit RAM registers are used by the math routines to hold the operands for and
results of floating point and integer operations. Since there may be two operands
required for a floating point operation (such as multiplication or division), there are two
sets of exponent and mantissa registers reserved. AEXP and BEXP hold the exponent
for arguments A and B respectively while AARGB0, AARGB1 and AARGB2 or
BARGB0, BARGB1 and BARGB2 hold the mantissa.
For 32-bit integers, AARGB0, AARGB1, AARGB2 and AARGB3 or BARGB0,
BARGB1, BARGB2 and BARGB3 are used to hold the operands. Results of integer
operations will be placed in AARGB0, AARGB1, AARGB2 and AARGB3. In the case
of 32-bit division, the remainder is placed in an additional set of registers, REMB0,
REMB1, REMB2 and REMB3. The MSB of the 32-bit integer is contained in AARGB0,
BARGB0 or REMB0.
5.3.3
Before calling a math operation, the exponent and/or mantissa operands must be set
up by your C code. For those operations that require two arguments (such as division
or multiplication), both sets of arguments must be initialized. Once initialization is
complete, the math function may be called using standard C function calls. The
operands of the math routine are not passed as arguments to the function.Table 5-1
shows the syntax, operation, operand(s) required and where to extract the result of the
operation.
Note: The MSB of the mantissa is stored in the AARGB0 or BARGB0 byte.
Variables Used by the Floating Point Libraries
Calling the Math Functions
Results of the floating point routines are placed in the AEXP and
AARGB0:2 registers.
IEEE-754 TO MICROCHIP
MICROCHIP TO IEEE-754
 2002 Microchip Technology Inc.

Related parts for SW006010