I would like to use floats for a particular routine in my project. However I do not have enough space to include the float library and leave it there statically. To effectively have a larger code space, currently I bring in code segments from an external ROM and execute them, making extensive use of the USER SEGMENTS.
Is there a way to relocate individual routines in the float library as in the SEGMENTS directive?
Alternately is there a way to get an assembler listing which does not include calls to the float library from code similar to below using directives like #pragma listinclude #pragma src ?
I have the full verstion of uVision 3 and have looked for the floating point library source but feel stymied. I have even tried to EXTRACT some of the functions but was not sure how to go about it.
Thanks, David
float a; float b; signed long c;
void main(void){ }
void divide(void){ a = a / b; } void cast(void){ a = (float) c; }
Keil (in common with other commercial tool vendors) do not publish the source of their libraries.
If you really need to use floating point, then you need to design your system accordingly - which means providing adequate memory resources.
Floating point always requires significantly more resources than integer maths.
In most cases, integer maths can be used with appropriate scaling; eg, instead of using floating point to represent 1.23V - just treat it as 1230mV.
Or look at fixed-point libraries...
http://www.keil.com/forum/18590/