4.9.47.18 Space Flag

The space psect flag is used to differentiate areas of memory that have overlapping addresses, but are distinct. Psects that are positioned in program memory and data memory have a different space value to indicate that the program space address 0, for example, is a different location to the data memory address 0.

The memory spaces associated with the space flag numbers are shown in Table 4-12.

Table 4-12. Space Flag Numbers
Space Flag Number Memory Space
0 Program memory, and EEPROM for PIC18 devices
1 Data memory
2 Reserved
3 EEPROM on Mid-range devices
4 Configuration bit
5 IDLOC
6 Note

Devices that have a banked data space do not use different space values to identify each bank. A full address that includes the bank number is used for objects in this space. So, each location can be uniquely identified. For example, a device with a bank size of 0x80 bytes will use address 0 to 0x7F to represent objects in bank 0, and then addresses 0x80 to 0xFF to represent objects in bank 1, etc.