im trying to shift two bytes of "binary" to OR them together and allow a carry from byte1 to be placed into byte2.
at the moment, im trying to shift byte1 by 7 places to the RIGHT and byte2 by 1 place to the LEFT.
i need to use the logical shift and not the arithmetic one so could someone look at the couple of lines of code below to tell me why, when i or together two bytes i get the wrong answer.
Code:firstbyte = (squashdum >>= 7);Code:secondbyte = squashdum <<= 1;imagine first byte is 01100101Code:result = (firstbyte | secondbyte);
and second byte is 10000111
the result should be "00001110". = e0
but actually comes through as "00001111"? = f0