4.56 Udata Directive

The MPASM UDATA directive creates a section for objects that are uninitialised..

Suggested Replacement

Use the predefined udata_bankn psect, where n represents the bank number in which the psect should reside, or a create a similar psect, ensuring the flags are suitable for a section containing variables on the target device.

The PIC Assembler provides the udata_bankn psect once you include <xc.inc>. You can use this psect without having to specify any psect flags, for example:

#include <xc.inc>

PSECT udata_bank1
;data goes here
Alternatively, you can define your own psect with any name and suitable psect flags. The psect's space flag must be 1, to indicate that the psect should be positioned in data memory. Typically, you would use the class flag to assign the psect to one of the BANKN linker classes, where N represents the bank number for which the class defines. These classes are also predefined by the driver, so that the psect will be positioned somewhere in the memory associated with the specified class without you having to specify any linker options. You could also position this psect at a particular address using the linker's -p option, passed to the linker from the driver's -Wl option. For example:
PSECT myData,space=1,class=BANK1
;data goes here