How to Use Linker Error Messages
4-4
Example 4–1. Referencing Far Global Objects Defined in Other Files
<file1.c>
/* Define ary to be a global variable not accessible via the data page */
/* pointer. */
far int ary;...
<file2.c>
/* In order for the code in file2.c to access ary correctly, it must be */
/* defined as ’extern far’. ’extern’ informs the compiler that ary is */
/* defined in some other file. ’far’ informs the compiler that ary is */
/* accessible via the data page pointer. If the ’far’ keyword is */
/* missing, then the compiler will incorrectly assume that ary is in */
/* .bss and can be accessed via the data page pointer. */
extern far in ary;
...
= ary;
...
4.1.1.3
The MVKL Mnemonic
If the MVK instruction is just a simple load of an address:
123 000000a4 0200002A! MVK sym,B4
Then the linker warning message is telling you that sym is greater than 32767,
and you will end up with something other than the value of sym in B4. In most
cases, this instruction is accompanied by:
124 000000a8 0200006A! MVKH sym,B4
When this is the case, the solution is to change the MVK to MVKL.
On any other MVK problem, it usually helps to look up the value of the sym-
bol(s) involved in the linker map file.