 Question:
Restrictions on location of .const and .bss
Answer:
The .const and .bss sections generated by the
compiler are accessed using " direct addressing " that uses the processor's DP
register. For this reason, there are special restrictions regarding their locations:
-Restrictions under Floating-Point compiler:
When using small memory model, sections .const and .bss MUST be
linked in the same data page (i.e the 16 MSBits of their memory address should be the
same) because the compiler uses direct addressing to access them. Otherwise, this could
cause wrong execution of the program. This doesn't apply to the large memory model.
-Restrictions under Fixed-Point compiler:
No restriction exists in the location of .bss and .const because
the Fixed-point compiler always initializes the DP before accessing each memory location. |