 | Discussion Forum |  |
|
|
SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONSNext Thread | Thread List | Previous Thread Start a Thread | Settings | Details | Message |
|---|
Read-Only Author PADMANABHAM HAMSA Posted 19-Nov-2003 10:01 GMT Toolset C51 |  SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS PADMANABHAM HAMSA HELLO all, Can we Sepecify exact location to our own defined functions. for example
void function() _at_ c:0x5000; void main() { ... ... }
void function() { ... ... } | | Read-Only Author Andrew Neil Posted 19-Nov-2003 10:04 GMT Toolset C51 |  RE: SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS Andrew Neil This is the Linker's job, not the Compiler's.
Anyway, why do you want to do it? | | Read-Only Author PADMANABHAM HAMSA Posted 19-Nov-2003 12:40 GMT Toolset C51 |  RE: SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS PADMANABHAM HAMSA 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 | | Read-Only Author Jon Ward Posted 19-Nov-2003 16:29 GMT Toolset C51 |  RE: SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS Jon Ward http://www.keil.com/support/docs/1408.htm | | Read-Only Author Drew Davis Posted 19-Nov-2003 17:30 GMT Toolset C51 |  RE: SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS Drew Davis 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. | | Read-Only Author PADMANABHAM HAMSA Posted 22-Nov-2003 06:50 GMT Toolset C51 |  RE: SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS PADMANABHAM HAMSA 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?" | |
Next Thread | Thread List | Previous Thread Start a Thread | Settings |
|