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
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.
The 8051 architecture uses different processor instructions to access code space and xdata space. These instructions differ in size and cycle count. Details can be found in the 8051 programmers guide.
Sorry array size was also [72]. In generated map file it is showing data=202.0 xdata=599 const=552 code=20547 But when i moved array to code then it is showing const=552 code=20475 Is ROM space is summation of code and const