5.3.9.3 Far Type Qualifier

The __far type qualifier and the -maddrqual compiler option are used to place variables into external memory.

Some PIC18 devices (for example the PIC18F67J50) can support external memory. If your hardware supports this, you must first specify this memory with the-mram option (see 4.6.1.17 Ram Option). For example, to map additional data memory from 20000h to 2FFFFh use:
-mram=default,+20000-2FFFF.
Memory added to the RAM ranges is exclusively used by variables that are qualified __far. Access of external memory is less efficient than that of ordinary data memory and will be slower to execute and use more code. Here is an example of an unsigned int object placed into the device’s external program memory space:
unsigned int __far farvar;

This qualifier is controlled by the compiler option -maddrqual, which determines its effect on PIC18 devices (see 4.6.1.1 Addrqual Option). Based on this option’s settings, this qualifier can be binding or ignored (which is the default operation). Qualifiers which are ignored will not produce an error or warning, but will have no effect.

Note that this qualifier will be ignored when compiling for PIC10/12/16 targets and that not all PIC18 devices support external memory.