Byte Processing, Combining and Shifting help.

Im writing an Arduino program to control 12 leds connected to Shift registers.

I want to process bytes in certain way, and im not sure how to do it.

lets say i have two bytes:

byte 1 = 01110100 (the 7th and 8th bit will always be 0)
byte 2 = 01110100

now i want the 1st and 2nd bit of byte 2, to be combined with byte 1, ie
byte 1 =01110101
lastly i want byte 2 to be shifted up, without the first 2 bits, ie
byte 2=11010000

How can i do this?

byte 1 = 01110100 (the 7th and 8th bit will always be 0)

The most significative bit are the left ones so bit 8 and 7 are 0 and 1 respectivly (01110100)
What you want you could achieve Bitwise Operators.

now i want the 1st and 2nd bit of byte 2, to be combined with byte 1, ie
byte 1 =01110101

No sure what operation you want here but it could be done with a OR (|) or an AND operator (&).

lastly i want byte 2 to be shifted up, without the first 2 bits, ie
byte 2=11010000

Do a bitshift left (<<x) where x is the number of bits to shift left

You need the bitwise AND & and the bitwise OR | (note that is a single & | )

  byte a = b01110100;
  byte b = b01110100;

  byte c = b & b11000000;  // split of 2 highest bits    c = 0100000
  c = c >> 6;  // move them to position 0,1   c = 00000001;
  a = a | c ;  // a = 01110101;

  b = b & b11111100;  // force bit 0, 1 to zero  b = 01110100;
  b = b << 2;   // shift 2 positions,   b = 11010000