256 is 00000001 00000000 and not 00000000 11111111 which is 255.
If I'm correct you need to swap the bytes...