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

Memory copy - xhuge and near model types

Hello all,

may you give me an explanation of following piece of code (target is ST10F276):

U8 ndata * Dest;
U8 xhuge * Source;
register U16 wTemp;

while([condition]) {
.....
wTemp = *((U16 xhuge *) Source);
*((U8 ndata *) (Dest++)) = *((U8 ndata *) & wTemp);
*((U8 ndata *) (Dest++)) = *((U8 ndata *) & wTemp + 1);
Source += 2;
.....
}


I understand that read operation (instructions) of data from xhuge pointer is very slow - therefore complete word is read out and stored into any register given by compiler.

But what is an advantage of write per Bytes? AFAIK the processor ST10F276 has 16bit wide bus, has not?

Thanks for your hints in advance,

Best regards
Iggy

0