Can I put ?CO?xxx on XDATA space using LX51 user segments "?CO?xxx (X:0x200)" thx all
Possibly. But it'd almost certainly not achieve what you hope it to. Start out by asking yourself: why *is* this data in a ?CO? segment, in the first place? Would that stuff really do you any good in XDATA? Can xdata even *be* in a .hex file, ready to download into your micro?
xdata is a RAM space isn't it. And Data that I put it in will be lost if burn hex file after into a micro, each time I cut off the electricity isnt it ?
Exactly. So, knowing that: do you still think that what you were asking about makes any sense whatsoever?
"xdata is a RAM space isn't it." Not necessarily. As far as the processor is concerned, XDATA is just memory that responds to MOVX opcodes; so, if you connect some ROM so that it responds to (ie, is accessed by) MOVX opcodes, you have ROM in XDATA space. If you want to do this, you need to look at the XCONST and XCROM options http://www.keil.com/support/man/docs/c51/c51_userclass.asp http://www.keil.com/support/man/docs/c51/c51_xcrom.htm I think this requires OMF2 and, therefore, LX51. See also: http://www.keil.com/forum/docs/thread4346.asp http://www.keil.com/forum/docs/thread2074.asp http://www.keil.com/forum/docs/thread3361.asp
"Can xdata even *be* in a .hex file, ready to download into your micro?" Yes, it certainly can! See XCONST and XCROM mentioned elsewhere in this thread!
Firstly, Thx for all But I think I confuse something about burning process ! How a "HEX burner" program writes each section of the hex file xconst,idata etc.. to a IC ? For a example, if I've project contains a IC with 256 Bytes internal RAM and 64 KByte of internal Code ROM (Flash) + 4 external 64 KB Code ROM + 4 KB external RAM (xdata) space. let's assume my object contains some const xdata; these constant will be somewhere in the code space ? What will happen after restart of the main circuit ? xdata will lost and I'll loose my constant?
How a "HEX burner" program writes each section of the hex file xconst,idata etc.. to a IC ? First of all, it's not a HEX burner, it's just a burner. And classically it'll be not a program, but a piece of dedicated hardware controlled by a program. Some modern devices can get away with just a program, but not all. Second, idata is never burnt into anything. Special constant xdata segments may, but only with rather unusual hardware that allows you to do this. This is not something you typically do --- it's more like an ultima ratio solution for rather desperate cases. Given the lack of insight and experience you've displayed here so far, I'm almost 100% certain that you're not in such a situation justifying its application. So forget about it for now. You appear to have lots of basic training to complete yet before you tackle stuff like this --- so do that, now, before you worry about where to sell the skin of that bear you haven't even found, much less killed yet.
"xdata is a RAM space isn't it." Not necessarily. As far as the processor is concerned, XDATA is just memory that responds to MOVX opcodes; so, if you connect some ROM so that it responds to (i.e. is accessed by) MOVX opcodes, you have ROM in XDATA space. expanding on this: the most frequent case I know of using "burned constants in XDATA" is in the cases where you use a negative OR to convert the '51 to vonNeuman memory. Erik