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

declaration of two dimensional arrays(character

actually this is in reference to the thread that i have already created about declaring two dimensional arrays
I have configured the the model to Xdata
and the change that i have made is only of declaring a character array of a size more than 100
Yes i am going to use it to store strings
but that is later isnt it .There is a problem in the declaration itself

Parents
  • After looking at the hex file, I found the problem! I lost interest in looking at the hex file!

    Seriously though, your micro has 2048 bytes of xram so your array cannot be much bigger than your 100 * 20. Firstly, where has the linker put your array? What memory model have you selected? Tiny? - that's definitely not going to work. Read up on the linker output, it tells you many things.

    Secondly, does the 89c51rd2 need a bit set to enable the xram? I know aduc834 does and a 89c668 does. Read the datasheet on your device.

    Putting the hex file on the forum was a waste of time! If you'd put the linker listing, that would have been much more helpful.

Reply
  • After looking at the hex file, I found the problem! I lost interest in looking at the hex file!

    Seriously though, your micro has 2048 bytes of xram so your array cannot be much bigger than your 100 * 20. Firstly, where has the linker put your array? What memory model have you selected? Tiny? - that's definitely not going to work. Read up on the linker output, it tells you many things.

    Secondly, does the 89c51rd2 need a bit set to enable the xram? I know aduc834 does and a 89c668 does. Read the datasheet on your device.

    Putting the hex file on the forum was a waste of time! If you'd put the linker listing, that would have been much more helpful.

Children
No data