| Electronic Components Datasheet Search |
|
AN669 Datasheet(PDF) 5 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN669 Datasheet(HTML) 5 Page - Microchip Technology |
|
5 / 7 page ![]() © 1997 Microchip Technology Inc. DS00669A-page 5 AN669 SUMMARY For this discussion only the 32-bit floating point multiply is used. However, the same principles of embedded assembly language routines into C code can be used with other assembly language routines. A summary list of a step- by- step process to embed assembly code into your C code is below: • Convert assembly register EQU equates to C vari- able types such as unsigned int. • Convert constants to #define in C. • Place the assembly code into a subroutine using #asm and #endasm • To avoid paging issues in parts with multiple pro- gram memory pages, force the code to an address where it will not cross a page boundary. For example: #pragma memory ROM [MAXROM-0x800] @ 0x800; • Macros and conditional assembly will have to be rewritten in actual in-line assembly code. The MPLAB-C compiler does not support these higher level assembly options to the same degree as the assembler, MPASM. For your convenience, all the 32-bit floating point rou- tines in application note AN575 are provided in a zip file along with this application note. Each routine has been separated to work as a stand-alone routine. There is a separate file for each floating point routine. The files may be included individually into your C code. Table 2 shows a list of all the files and routines included with this application note. TABLE 2: 32-BIT FLOATING POINT C FILES/FUNCTIONS INCLUDED WITH THIS APPLICATION NOTE AN575 Original Assembly Routine/file * Equivalent C file/function Purpose - example.c The example main() routine calculating the area given the radius. (uses fpm32) FLO2432 flo2432.inc 24-bit integer to 32-bit floating point conversion FLO3232 flo3232.inc 32-bit integer to 32-bit floating point conversion FPD32 fpd32.inc 32-bit floating point divide FPM32 fpm32.inc 32-bit floating point multiply FPA32 FPS32 fpsa32.inc fps32() 32-bit subtract fpa32() 32-bit add 32-bit floating point add 32-bit floating point subtract INT3224 int3224.inc 32-bit floating point to 24-bit integer conversion INT3232 int3232.inc 32-bit floating point to 32-bit integer conversion NRM3232 nrm3232.inc 32-bit normalization of unnormalized 32-bit floating point numbers NRM4032 nrm4032.inc 32-bit normalization of unnormalized 40-bit floating point numbers math16.inc math16c.c variables and constants need for the floating point functions * Check Microchip web site and bulletin board for latest code. |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |