HELLO all, Can we Sepecify exact location to our own defined functions. for example void function() _at_ c:0x5000; void main() { ... ... } void function() { ... ... }
This is the Linker's job, not the Compiler's. Anyway, why do you want to do it?
hello sir, this linker's job ok, but i want to put each function at predetermined location and they are called from another program (asm/c) is this possible. PADMANABHAM
http://www.keil.com/support/docs/1408.htm
If you have several such functions, you may want to consider adding a level of indirection. Fix the location of a vector table (table of addresses, or function pointers), and make the calls through that table. That way, the two pieces of code only have to agree on a single special location, and the code that supplies the functions can move them from version to version without a problem. The drawback, of course, is a small loss of speed when calling the functions.
Dear sir, Finally have achieved to place my functions at address given by me. Thankyou verymuch for all, PADMANABHAM * NOTE:- Leave decession making for where to store functions to Linker only, because we dont know the exact code size of a particular C function. my another question is "Can we know exact size of Particular C function?"