Top "Bit-shift" questions

A bit shift operation moves the bits contained in a binary numeral or bit pattern to the left or to the right.

c get nth byte of integer

I know you can get the first byte by using int x = number & ((1<<8)-1); or int x = …

c byte shift bit-shift
warning: left shift count >= width of type

I'm very new to dealing with bits and have got stuck on the following warning when compiling: 7: warning: left shift …

c bit-manipulation long-integer bit-shift
Why doesn't left bit-shift, "<<", for 32-bit integers work as expected when used more than 32 times?

When I write the following program and use the GNU C++ compiler, the output is 1 which I think is due …

c++ bit-shift
Right shifting negative numbers in C

I have C code in which I do the following. int nPosVal = +0xFFFF; // + Added for ease of understanding int nNegVal = …

c bit-shift negative-number
unsigned right Shift '>>>' Operator in Java

Possible Duplicate: Why is (-1 >>> 32) = -1? The unsigned right shift operator inserts a 0 in the leftmost. So …

java bit-shift
Difference between SHL and SAL in 80x86

I have learned how to work with 80x86 assembler, so in bit-wise shift operation, I faced a problem with SAL …

assembly x86-16 bit-shift
Getting upper and lower byte of an integer in C# and putting it as a char array to send to a com port, how?

In C I would do this int number = 3510; char upper = number >> 8; char lower = number && 8; SendByte(upper); …

c# char bytearray bit-shift bitmask
Multiplication using Logical shifts in MIPS assembly

Can someone please give me pointers on how I can go about making a code that multiplies using shifts in …

assembly mips bit-shift multiplication mips32
Converting from RGB ints to Hex

What I have is R:255 G:181 B:178, and I am working in C# (for WP8, to be more specific) I …

c# bitmap bit-shift
sra(shift right arithmetic) vs srl (shift right logical)

Please take a look at these two pieces of pseudo-assembly code: 1) li $t0,53 sll $t1,$t0,2 srl $t2,$t0,2 sra $…

assembly mips bit-shift twos-complement