Jaime Rodriguez

CONTROL HOW LIBRARIES ARE USED AND/OR PLACED INTO MEMORY

Discussion created by Jaime Rodriguez on Jan 16, 2009
Latest reply on Jan 16, 2009 by CompilerGuru
I am writing a Loader and some of the code in my loader is calling instructions from this library, the problem is the compiler locates these library instructions into the segments I need to erase.

The question is:
Is there any pragma or instruction to avoid jumping to libraries in specific functions?
I mean, can you specify the compiler to copy this instruction into your function instead of jumping to the library?

This is a very simple example, but I hope it explains what I need to do:
//In ansiis.lib
void Increment(int & P)
{
   P++;
}

//In bootloader.c
void Function()
{
   int A = 1;
   Increment(A); 
}

I want the compiler to to this

void Function()
{
   int P = 1;
   P++; 
}

instead of this

void Function()
{
   int P = 1;
   JMP Increment; 
}

Any ideas, comments, help, will be appreciated.

Outcomes