User manual
XC8 Command-line Driver
2012 Microchip Technology Inc. DS52053B-page 101
4.8.22 --CODEOFFSET: Offset Program Code to Address
In some circumstances, such as bootloaders, it is necessary to shift the program image
to an alternative address. This option is used to specify a base address for the program
code image and to reserve memory from address 0 to that specified in the option.
When using this option, all code psects (including Reset and interrupt vectors and con-
stant data) will be adjusted to the address specified. The address is assumed to be a
hexadecimal constant. A leading 0x, or a trailing h hexadecimal specifier can be used,
but is not necessary.
This option differs from the --ROM option in that it will move the code associated with
the Reset and interrupt vectors which cannot be done using the --ROM option, see
Section 4.8.49 “--ROM: Adjust ROM Ranges”.
For example, if the option --CODEOFFSET=600 is specified, the Reset vector will be
moved from address 0 to address 0x600; the interrupt vector will be moved from
address 4 to 0x604, in the case of mid-range PIC devices, or to the addresses 0x608
and 0x618 for PIC18 devices. No code will be placed between address 0 and 0x600.
See Section 4.9 “MPLAB IDE V8 Universal Toolsuite Equivalents” or
Section 4.10 “MPLAB X Universal Toolsuite Equivalents” for use of this option in
MPLAB IDE.
4.8.23 --DEBUGGER: Select Debugger Type
This option is intended for use for compatibility with development tools which can act
as a debugger. xc8 supports several debuggers and using this option will configure the
compiler to conform to the requirements of that selected. The possible selections for
this option are defined in Table 4-8.
For example:
xc8
--CHIP=16F877AA --DEBUGGER=icd2 main.c
Choosing the correct debugger is important as they can use memory resources that
could otherwise be used by the project if this option is omitted. Such a conflict would
lead to runtime failure.
If the debugging features of the development tool are not to be used (for example, if the
MPLAB ICD 3 is only being used as a programmer), then the debugger option can be
set to none, because memory resources are not being used by the tool.
See Section 4.9 “MPLAB IDE V8 Universal Toolsuite Equivalents” for use of this
option in MPLAB IDE. MPLAB X IDE should automatically apply this option for debug
builds only once you have indicated the hardware tool in the Project Preferences.
TABLE 4-8: SELECTABLE DEBUGGERS
Suboption Debugger selected
none No debugger (default)
icd2 MPLAB
®
ICD 2
icd3 MPLAB ICD 3
pickit2 PICkit™ 2
pickit3 PICkit 3
realice MPLAB REAL ICE™ in-circuit emulator