title: 32-Bit variable shifting in 8-bit MCU
body: <p>I'm using 32-bit variable for storing 4 8-bit values into one 32-bit value.</p>
  
  <pre><code>32_bit_buf[0]= cmd[9]&lt;&lt;16 | cmd[10]&lt;&lt;8| cmd[11] &lt;&lt;0;
  </code></pre>
  
  <p><code>cmd</code> is of unsigned char type with data </p>
  
  <pre><code>cmd [9]=AA
  cmd[10]=BB
  cmd[11]=CC
  </code></pre>
  
  <p>However when 32-bit variable is printed I'm getting <code>0xFFFFBBCC</code>.</p>
  
  <p>Architecture- 8-bit AVR Xmega</p>
  
  <p>Language- C</p>
  
  <p>Can anyone figure out where I'm going wrong.</p>