I found ?CO?LIB_CODE occupy a large address space in every bank in my project. What is ?C?LIB_CODE? I've search this keyword on web but I can't find any explanation. Would any one please explain this to me? It looks like I've used some library codes provided by Keil? what kind of codes would occupy this section? Thank you.
CODE 6398H 114BH UNIT ?C?LIB_CODE
It occupy 4.3KB Yes, there are many printf in my project.
As I know, the code size of one or more printf should be the same, isn't it?
I found some sin, cos, ceil, floor and sqrt operations in my project. Also some floating point operations like tmp = (float)x + r * cos(angle);
Why floating point operations takes code space in ?C?LIB_CODE ?
Can I just put ?C?LIB_CODE in a bank rather than common bank?
Thanks for your response.
Well, as the saying goes: "Don't do that, then!"
Floating-point arithmetic is just about the last thing on earth you should use an 8051 for. Particularly if you're worried about code size, speed or anything else relating to general efficiency of the code.
The price for violating this rule is a massive amount of run-time support code. Every single operation involving floating-point numbers will have to be delegated to a library routine. Library functions like sin() and cos() will probably end up outside the specialized library segment, but the implementations of '+', '-', '*', '/' and '=' will be in it.
"Why floating point operations takes code space in ?C?LIB_CODE ?"
The processor does not have any support for floating point arithmetic, so it has to emulate everything, i.e. a help function in the library must perform the actual 'add' or 'subtract' or ...