4.14 De Directive
The MPASM DE
directive places words into EEPROM.
Suggested Replacement
The PIC Assembler's DW
directive inside a suitable
psect performs a similar function.
You can use the edata
psect to hold the values defined.
This psect is predefined once you include <xc.inc>
. For
example:
PSECT edata
DW 9700h
DW 'r', -48
Alternatively, you can define your own psect and allocate it to EEPROM.
Ensure that the psect's space
flag is set to 0 (the default value)
for PIC18 devices, or set to 3 for any other devices that support EEPROM. The psect
can be assigned an address by associating it with the EEDATA linker class, or by
explicitly positioning the psect using the linker's -P
option
(accessible from the driver using the -Wl
option), as in the
following Mid-range example.
PSECT eepromData,space=3,class=CONST
symbols:
DW 76h
DW 'A', -23