How Do I Place Variables in the PIC18 Device’s External Program Memory?

If all you mean to do is place read-only variables in program memory, qualify them as const (see Objects in Program Space). If you intend the variables to be located in the external program memory then use the __far qualifier (see Far Type Qualifier) and specify the memory using the -mram option (see Ram Option). The compiler will allow __far-qualified variables to be modified. Note that the time to access these variables will be longer than for variables in the internal data memory. The access mode to external memory can be specified with an option (see Emi Option).