Electronic Components Datasheet Search
  English  ▼

X  

AN669 Datasheet(PDF) 5 Page - Microchip Technology

Part # AN669
Description  Embedding Assembly Routines into C Language Using a Floating Point Routine as an Example
PDF  7 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

AN669 Datasheet(HTML) 5 Page - Microchip Technology

  AN669 Datasheet HTML 1Page - Microchip Technology AN669 Datasheet HTML 2Page - Microchip Technology AN669 Datasheet HTML 3Page - Microchip Technology AN669 Datasheet HTML 4Page - Microchip Technology AN669 Datasheet HTML 5Page - Microchip Technology AN669 Datasheet HTML 6Page - Microchip Technology AN669 Datasheet HTML 7Page - Microchip Technology  
Zoom Inzoom in Zoom Outzoom out
 5 / 7 page
background image
© 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.



Html Pages

1 2 3 4 5 6 7


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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