I had a bunch of 8bit packets I had to separate into opcode and operand. I have pulled out the first 2 bits for the opcode and I have the 6 bit operand saved to a Int.
I need to be able to work with negative number in two's compliment. Is there a quick way I can convert the 6 bit operand from twos compliment into a negative Integer?
So it would convert 34 into -30. I can detect the sign at the beginning with a bit mask. but from there I'm lost.