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

fetching integers from fixed address locations

I have a problem with accessing integer pointers and integer variables.the compiler places first the msb and then the lsb.
example :memory location is 0xc000,i place an integer var ,it is placed as follows msb at 0xc000 and lsb at 0xc001.
but what if i want to do the reverse .
if i access the variable and display it using pointer or macro xword ,it displays the reverse binary pattern.
Help please.

Parents
  • maybe you can solve it by creating a union with an integer value on one hand and the high and low byte in the other hand. The compiler is big endian or however that is called. It will store the high byte first. Then you can grab the high adn low byte out of that union variable.

    That might work fastest. You can also mask the low byte ann retrieve the high byte by shifting 8 times righ, but that is probably slow.

    Take care.

Reply
  • maybe you can solve it by creating a union with an integer value on one hand and the high and low byte in the other hand. The compiler is big endian or however that is called. It will store the high byte first. Then you can grab the high adn low byte out of that union variable.

    That might work fastest. You can also mask the low byte ann retrieve the high byte by shifting 8 times righ, but that is probably slow.

    Take care.

Children
No data