This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

array type changed from xdata to code for optimisation

Hello,
I have const array of size 72 elements.I declared this array as xdata

UINT8 CONST XDATA A[30]={...};
but during optimisation i changed XDATA to CODE and because of this change i could save around 70 bytes.

Please let me know how can this change will save these many bytes.

Thanks is advance.
Pooja

Parents
  • Your biggest save was probably when you decided to store your 72 elements in an array of only 30 elements...

    You forget to mention exactly what you mean by 70 bytes saved.

    The XDATA region did not need to store the array, so the XDATA region did shrink.

    The CODE region increased with the size of the array. On the other hand, you changed the access method which means that the compiler has to use different procesor instructions and because of this may produce smaller or larger code to perform all accesses.

Reply
  • Your biggest save was probably when you decided to store your 72 elements in an array of only 30 elements...

    You forget to mention exactly what you mean by 70 bytes saved.

    The XDATA region did not need to store the array, so the XDATA region did shrink.

    The CODE region increased with the size of the array. On the other hand, you changed the access method which means that the compiler has to use different procesor instructions and because of this may produce smaller or larger code to perform all accesses.

Children