I have following question about code banking. There's some small tests, that uses one big library. So, how can I put this library to different code banks? Ofc, I can include this tests right in library project, but are there any other solutions?
"There's nothing to be gained from forcing its code into a particular bank." Well, I have a library > 64k. And so?
What you're being told is that you don't need to explicitly specify which bank the code goes into. The linker will fit the code into the banks which you say are available.
That should work.
When you get a deeper understanding of the banking mechanism and linker controls, you could (if you feel it is necessary) start locating certain blocks of code into specific banks - But if the code runs at an acceptable speed, then you do not have to.
"What you're being told is that you don't need to explicitly specify which bank the code goes into. The linker will fit the code into the banks which you say are available." Sure? But linker can't split library to different code banks. It's not a project or smth. It's only .LIB with some API. Ive solved this problem, but I dont like my solution at all. And I want another one.
Mb, I need to explain. Ive include library with code>64k in project. And I want to split it to different code bank, because its the only way to compile this project.
*code banks
What you're saying there does not make sense to me.
What type of library is this?
Normally object modules will be extracted from a library file during the link process {and would be located in a suitable bank]. Unless you have an object module that is larger than the size of one of your banks, I cannot see how there can be a problem.
Ive solved this problem
How? Did you split the library?
"Unless you have an object module that is larger than the size of one of your banks, I cannot see how there can be a problem." Hmm...May be I dont understand something. Im new to keil/c51. When I include library to project, I get the following: <BANK1> "...name.LIB" <BANK2> "....obj" and so. If library is large enough, and it cannot fit in one bank, linker throws an error.
ps. My solution: I split the tests, so linker cut unused code from library.
"linker cut unused code from library"
That is exactly how the linker should process library files.
"That is exactly how the linker should process library files." Ofc, and I used this to solve the problem, but I want more complex tests, when used library code is >64k.
I now understand what you're asking.
You should be able to specify the inclusion of a library file, without having to specify an explicit bank for that library.
The default for the runtime libraries is no specific bank, so the control of such things must be there.
My project(s) tended to only a minimal amount of library functions, so I have not seen what you are saying.
Is that done by specifying the <default> bank under properties for the group containing the library?
If push-comes-to-shove you could consider using the LIB tool and split your libraries into smaller units.