This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPECIFY EXACT LOCATION FOR C51 USER DEFINED FUNCTIONS

HELLO all,
Can we Sepecify exact location to our own defined functions. for example


void function() _at_ c:0x5000;
void main()
{
...
...
}

void function()
{
...
...
}

Parents Reply Children
  • 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?"