From: Bernhard H. <Ber...@be...> - 2001-08-26 15:39:20
|
>I was making the point that to use assignment to initialize xdata seems >unreasonable since the data values and the code have to be stored in >code memory and then transferred to xdata whereas using the Intel Hex >Dowload file (or S-Record dowload file) the values could be initialized >without recourse to code. XDATA space is intended to be RAM, which is normally volatile. And it doesn't make sense to write IHX-data to volatile memory. This is the simple reason, why SDCC (and IAR) have no mechanism to initialize data in XDATA-space. >If the array is put into the code segment, or made const, then the >compiler uses initialization rather than assignment but puts the >information in the code segment rather than xdata. I still don't understand. In what type of XDATA-memory do you want to put your data? RAM or ROM? RAM does not make sense. And if it is ROM: what is the problem? Why don't you use ROM in code-space for your data? >The problem I have is that the 8051 based system I am involved with has >RAM, EEPROM and ROM in the xdata space. Seems to be a weird design ... Bernhard |