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

XDATA Question

Hi,
I have a loop

for (address = 1; address <= 5; address ++)

ram_ptr[address] = 0xFA:

where unsigned char xdata *ram_ptr = 0x0000;
and unsigned int address;

Somehow when i watch the simulation the address never increments and it always write FA in the same address 0x0000. I have also tried using XBYTE[address] to no use.
Any solution to my problem would be greatly appreciated

Parents
  • Sorry about the var i confusion. When I got to XBYTE I got carried away with xdata. XBYTE is used to access xdata NOT data area.
    As Andrew and Dan pointed out, the startup.a51 will clear the data area and selected areas of xdata. Init.a51 will initialize some statics and init_tny.a51 will initialize statics defined in the small data area of some LPC type devices. See chapter 6 of C51 user guide for these routines.
    Is the DW8051 a CEIBO device or Simulator?
    Brad

Reply
  • Sorry about the var i confusion. When I got to XBYTE I got carried away with xdata. XBYTE is used to access xdata NOT data area.
    As Andrew and Dan pointed out, the startup.a51 will clear the data area and selected areas of xdata. Init.a51 will initialize some statics and init_tny.a51 will initialize statics defined in the small data area of some LPC type devices. See chapter 6 of C51 user guide for these routines.
    Is the DW8051 a CEIBO device or Simulator?
    Brad

Children
No data