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.
Read Appendix E, "Byte Ordering" If you want to access bytes with a different ordering to the compiler's ordering, you'll have to use standard techiques like unions (non-portable, quick) or shifting & masking (portable, but possibly slower)
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.