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

SECTIONS and ASSIGN confusion - simple mistake?

I'm writing a debug/test function, and I want to store it at 0x00E00000.

The problem is that all works fine as long as the test function
does not call any external functions. This one is ok:

smt_1.c (This is the entire file.)

int assertWhatever()
{
return 100;
}

Compiles ok.
Linker command line, notice the absence of ASSIGN:
L166.EXE D:cvs\code\OBJ\smt_1.obj TO D:\cvs\code\OBJ\smt_1 SECTIONS ("?PR?smt_1"%FCODE (0xE00000)) PU NOMAP



However, the same procedure, but with an ASSIGN directive (for handling an external reference,
see smt_2.c below) compile, link and quietly produce an error in the resulting hex code. I expected
the four zeros, shown in brackets below, to read 00E0, but it does not! No warnings or errors are issued.

smt_2.h86
:02000004[[0000]]FA
...


smt_2.c (This is the entire file.)

int assertSomethingElse()
{
report_failure(__FILE__, __LINE__);
return 0;
}

Compiles ok (but warns that "'report_failure' undefined; assuming 'extern int report_failure()'")

Linker command line:
L166.EXE D:cvs\code\OBJ\smt_2.obj TO D:\cvs\code\OBJ\smt_2 SECTIONS ("?PR?smt_1"%FCODE (0xE00000)) ASSIGN ( 'report_failure' (03D06CH) ) PU NOMAP


Any suggestions why this happens?
The manual states that ASSIGN "defines a PUBLIC symbol (symbolname) and assigns it a numeric value (value)",
and I want just that - no more, no less...