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

Questions about XBYTE

Hi
I'm new to Keil so please bear with me.
for(nddX=0;nddX<imgDownloaded.bWidth;nddX++)
XBYTE[HIGHEST_BYTE|START_1BYTE]=bImage[nPnt+nddX];

where HIGHEST_BYTE is defined as 0x30
and START_1BYTE is defined as 0x01.

My question is whether the data from bImage array is written to the same X ram address causing an overwrite. Any ideas why this is done?

Best Regards


Parents
  • for(nddX=0;nddX<imgDownloaded.bWidth;nddX++)
       XBYTE[HIGHEST_BYTE|START_1BYTE]=bImage[nPnt+nddX];
    What are bImage and nPnt?

    The expression HIGHEST_BYTE|START_1BYTE is a constant (0x31) so yes, all the data from bImage will be written to the same address - 0x31 - in XDATA; each byte overwriting the previous one.

    "Any ideas why this is done?"
    No idea - what are you trying to achieve?
    Is this a memory-mapped port, or something?


    Note the use of &ltpre&gt and &lt/pre&gt tags for code samples - see the "Tips for Posting Messages" link:
    http://www.keil.com/forum/tips.asp

Reply
  • for(nddX=0;nddX<imgDownloaded.bWidth;nddX++)
       XBYTE[HIGHEST_BYTE|START_1BYTE]=bImage[nPnt+nddX];
    What are bImage and nPnt?

    The expression HIGHEST_BYTE|START_1BYTE is a constant (0x31) so yes, all the data from bImage will be written to the same address - 0x31 - in XDATA; each byte overwriting the previous one.

    "Any ideas why this is done?"
    No idea - what are you trying to achieve?
    Is this a memory-mapped port, or something?


    Note the use of &ltpre&gt and &lt/pre&gt tags for code samples - see the "Tips for Posting Messages" link:
    http://www.keil.com/forum/tips.asp

Children