5.3.6.3 Data Pointers

There are several pointer classifications used with the MPLAB XC8 C Compiler, such as those indicated below. Those classification marked with (local) are the only classifications considered when local OCG optimizations have been selected (see 5.3.6.3.2 Pointer Classifications with Local Optimization).

For Baseline and Mid-range devices:

  • 8-bit pointer capable of accessing common memory and two consecutive (even-odd) banks, e.g., banks 0 and 1, or banks 6 and 7, etc.
  • 16-bit pointer capable of accessing the entire data memory space (local).
  • 8-bit pointer capable of accessing up to 256 bytes of program space data.
  • 16-bit pointer capable of accessing the entire program space data (local).
  • 16-bit mixed target space pointer capable of accessing the entire data space memory and up to 32 KB of the program space data (local).

For PIC18 devices:

  • 8-bit pointer capable of accessing the access bank.
  • 16-bit pointer capable of accessing the entire data memory space (local).
  • 8-bit pointer capable of accessing up to 256 bytes of program space data.
  • 16-bit pointer capable of accessing up to 64 KB of program space data (local).
  • 24-bit pointer capable of accessing the entire program space (local).
  • 16-bit mixed target space pointer capable of accessing the entire data space memory and up to 64 KB of program space data.
  • 24-bit mixed target space pointer capable of accessing the entire data space memory and the entire program space (local).

Each data pointer will be allocated one of the available classifications after preliminary scans of the source code. There is no mechanism by which the programmer can specify the style of pointer required (other than by the assignments to the pointer). The C code must convey the required information to the compiler.

Information about the pointers and their targets are shown in the pointer reference graph (described in 6.3.5 Pointer Reference Graph). This graph is printed in the assembly list file.