Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 70
 2012 Microchip Technology Inc.
3.7.8
How Do I Fix a Fixup Overflow Error?
Fixup — the process of replacing a symbolic reference with an actual address — can 
overflow if the address assigned to the symbol is too large to fit in the address field of 
the assembly instruction. Most 8-bit PIC assembly instructions specify a file address 
that is an offset into the currently selected memory bank. If a full unmasked address is 
specified with these instructions, the linker will be unable to encode the large address 
value into the instruction and this error will be generated. For example, a mid-range 
device instruction only allows for file addresses in the range of 0 to 0x7F. However, if 
such a device has 4 data banks of RAM, the address of variables can range from 0 to 
0x1FF. If the symbol of a variable that will be located at address 1D0, for example, is 
specified with one of these instructions, when the symbol is replaced with its final value, 
this value will not fit in the address field of the instruction.
In most cases, these errors are caused by hand-written assembly code. When writing 
assembly, it is the programmer’s responsibility to add instructions to select the destina-
tion bank and then mask the address being used in the instruction, see Section 3.4.7.5 
“What Things Must I Manage When Writing Assembly Code?”
. I
t is important to 
remember that this is an issue with an assembly instruction and you need to find the 
instruction at fault before you can proceed. See the relevant error number in Appendix 
B. “Error and Warning Messages”
 fo
r specific details as to how to track down the 
offending instruction.
3.7.9
What Can Cause Corrupted Variables and Code Failure When 
Using Interrupts?
This is usually caused by having variables used by both interrupt and main-line code. 
If the compiler optimizes access to a variable or access is interrupted by an interrupt 
routine, then corruption can occur. See Section 3.5.5 “How Do I Share Data Between 
Interrupt and Main-line Code?”
 for more information.