Function works correctly, it changes 0x0001 to 0x0100. And you program shows this. You are taking high byte 01 shifting it right and printing as First byte of course you'll see 1. So what is wrong?
By the way what & 0xff gives here?
& 0xff