ARRAY ACCESS RESTRICTIONS

The XCASM compiler (the component of the XCASM assembler responsible for converting high level expressions and statements into their equivalent assembly code form) has an optimising 8 bit code generator and an optimising 16 bit code generator.

The optimising 8 bit code generator can only produce RAM (data space) and CODE (program space) pointer code that accesses the first 256 items of each space (data and program). This means that all the RAM is accessable since there is less than 256 bytes of RAM, and that only the first 256 words of FLASH is accessable.

When using the optimising 8 bit code generator in combination with constant arrays held in CODE space tables, the tables should be placed as near to the start of the CODE space as possible.

There is no 256 item restriction when using the 16 bit optimising code generator.

Arrays are a special short hand form of pointers. Using the 8 bit code generator, they are restricted to 256 bytes of RAM and 256 words of CODE space.

Because of the way the PIC accesses arrays in CODE space, the 256 word CODE space limit actually means that only 256 bytes are actually available for use as CODE space arrays.