| |||||
Technical Support Support Resources
Product Information | BL51: WARNING L16 (UNCALLED SEGMENT, IGNORED FOR OVERLAY)Information in this article applies to:
QUESTIONMy simple project has two modules, a C and an Assembly module. I am trying to call one of the C functions from within the assembly module, but each time I build the project I get: WARNING 16 : UNCALLED SEGMENT - IGNORED FOR OVERLAY PROCESS. I have already checked the knowledgebase and have seen several articles relating to this warning, but they don't help. How do I fix this problem? ANSWERThe following is a solution should accomplish what you are trying to do:
void foo(void); // C function declaration
extern void FOO_CALLER(void); // referencing a function
// defined elsewhere - C style
void main(void)
{
FOO_CALLER();
while(1);
}
void foo(void) // C function definition
{
}
NAME ASMTEST ; module name
EXTRN CODE (foo) ; referencing a function defined
; elsewhere - assembly style
?PR?TSEG?ASM_TEST SEGMENT CODE
PUBLIC FOO_CALLER ; assembly routine declaration
RSEG ?PR?TSEG?ASM_TEST
using 0
FOO_CALLER: ; assembly routine definition
call foo
RET
END
CAUSEThe reason you may be receiving this warning is that although you have an assembly module that calls a C function, the assembly module itself is not being called by anything. RESOLUTIONAs illustrated above, you have to define a routine in your assembly module that calls the C function. The assembly routine in turn must be called from main or some other function that is called from main in C. Note that programs must have a "main" routine and in this example, the "main" routine is in the C module. See the Attached Files section below to download an example project. The actual code for the assembly module was generated using the SRC pragma. MORE INFORMATION
SEE ALSO
ATTACHED FILESRequest the files attached to this knowledgebase article. FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Friday, November 16, 2007 | ||||
| |||||