>> IBTD, but perhaps you can point to where the problem in the code maybe.
Are you kidding? I don't even understand the problem clearly, to be quite honest! I mean, if you look at the OP's first post it sets the the value of 'a' to 0x01234567, or in (32 bit) binary:
Code:
0000 0001 0010 0011 0100 0101 0110 0111
Now if 'p' is 30, then we want a mask for 'a' of:
Code:
0011 1111 1111 1111 1111 1111 1111 1111
So at the very least, the result is going to be:
Code:
XX00 0001 0010 0011 0100 0101 0110 0111
Where X is a position to be filled by bits from 'b'. How then did they arrive at:
Code:
0101 0011 0000 0011 0100 0101 0110 0111
I just don't get it!