
' include "fp18.bas" ' Include file for 18xxxx (24-bit)

' include "fp1732.bas" ' Include file for 17Cxxx (32-bit) ' include "fp17.bas" ' Include file for 17Cxxx (24-bit) ' include "fp2032.bas" ' Include file for most other PICmicros (32-bit) ' include "fp0c32.bas" ' Include file for 'F84 (32-bit) ' include "fp20.bas" ' Include file for most other PICmicros (24-bit) Include "fp0c.bas" ' Include file for 'F84 (24-bit) Below is one example program that demonstrates the use of the libraries. Also, several example programs are included. The readme files included in the zip explain the procedures in more detail. PICBASIC PRO file that must be INCLUDEd at the beginning of the program. These GOSUB routines are created in an additional Finally, the floating point number is converted back into an integer (aint) so that Next a GOSUB to the required floating point operation, multiply for example, is performed. Generally, floating point operations occur between 2 numbers, so a second integer (bint) should also be converted. The first routine should convert the integer value (aint) to a floating point value. The routines are accessed in PICBASIC PRO by setting up specific integer variables (aint and bint) and performing a GOSUB to a floating point routine. It is part of the MPLAB development environment, which isĪvailable as a free download from Microchip. MPASM".) You must have the MPASMWIN assembler installed on your (In MicroCode Studio,Ĭlick View - Compile And Program Options, then check the box labeled "Use ampasm switch to invoke Microchip's assembler. The PICBASIC PRO programs must be compiled using the The appropriate floating point routines (Microchip's AN575)Īre included in this zip. Point routines into your program, FP.ZIP, Source code to integrate either the 24-bit or 32-bit Microchip floating While it is not thatĭifficult, it is not obvious how to make this work properly. Program and called, if floating point is a necessity.

These routines can be integrated into a PICBASIC PRO Microchip has developed several different floating point routines in assemblerĪnd placed them on their web site. There are several workarounds for this, including multiplying each value by 10 or 100 for calculations and dividing back when it is time to display the value. This means there is no decimal point so real or floating point numbers cannot be represented. All of these types are unsigned integers. The PICBASIC PRO™ Compiler has several built-in data types: bits, bytes and words, along with arrays of each. Using Microchip's Floating Point Routines with PICBASIC PRO™
