Datasheet

PICkit™ 3 Debug Express
DS41370C-page 62 © 2009 Microchip Technology Inc.
FIGURE 3-52: PROJECT CODE MODEL SETTINGS
Once a pointer to program memory has been declared, it can be pointed to a declared
location in program memory, for example a #pragma romdata array, or an explicit
address.
#pragma romdata mystrings = 0x100
rom char hello_str[] = "Hello!";
rom_pointer = hello_str; // = &hello_str[0]
char letter = *rom_pointer
The first letter ‘H’ of the hello_str[] array in program memory is now pointed to by
rom_pointer. The value of the variable letter is now ‘H’
rom_pointer = (near rom char *)0x320;
Now, rom_pointer points to the program memory byte at address 0x320.
Reading Flash program memory then simply requires declaring a ROM pointer and
using an assignment statement to read the pointer value.