I have Little Endian WordHH,WordHL,WordLH,WordLL values and they represent with a,b,c,d
I have this number as a decimal 1234456789
it equals as a hex 0x075BCD15 so I call the function like this :
BitShifting(0xCD15,0x075D,0x0000,0x000000)
But return value equals = 123587861
Why this happening where is my mistake ?
uint64_t BitShifting(uint16_t a,uint16_t b, uint16_t c, uint16_t d)
{
uint64_t val;
val = ((a & 0x000000000000FFFF) | ((b << 16) & 0x00000000FFFF0000) | ((c << 32) & 0x0000FFFF00000000) | ((d << 48) & 0xFFFF000000000000));
return val;
}