S
senthilrag
Provided a unsigned integer say (32bits b31-b0 bits) and its required
to get (b19-b10) .
One approach is have a mask and right shift it
#define BIT_MASK 0x000FFC00
uint32 variable;
variable &= BIT_MASK
variable >>= 10
My question is, does the above code guarantee to do the same in big
and little endian machines? Or should i make sure to check the
endianess and manipulate in accord?
What is the general approach to guarantee bit manipulations on a
software works fine irrespective to endianess of h/w underneath?
to get (b19-b10) .
One approach is have a mask and right shift it
#define BIT_MASK 0x000FFC00
uint32 variable;
variable &= BIT_MASK
variable >>= 10
My question is, does the above code guarantee to do the same in big
and little endian machines? Or should i make sure to check the
endianess and manipulate in accord?
What is the general approach to guarantee bit manipulations on a
software works fine irrespective to endianess of h/w underneath?