Treating a short like an uchar[2] I need to create a commandword to be send to hardware and I'd like to make is as efficient as possible (without going to Assembler or similar). 
The command is 16Bit long and has to be passed as an array of two bytes to the hardware interfacing library I use (wiringpi). The first four Bit are configuration Bits and the other 12 are the actual command. 

My code currently looks like this:

// global variables
short prefix_A = 3 &lt;&lt; (4+8);
short prefix_B = 11 &lt;&lt; (4+8);
unsigned char dac_cmd[2];
short cmd;

// not thread safe but that's ok in this application
void send_cmd(bool A, short new_cmd){
  assert( new_cmd &lt; 4096);
  cmd = (A?prefix_A:prefix_B) | new_cmd;
  dac_cmd[0] = cmd &gt;&gt; 8;
  dac_cmd[1] = cmd &amp; (255);
  wiringPiSPIDataRW(0, dac_cmd, 2);
}


I especially don't like the additional copy from the short (cmd) to the uchar[2] (dac_cmd).
Well, there's no need to copy the short into an array of (unsigned) char:
Treating any type as an array of (optionally signed/unsigned) char is an explicit exception from the strict-aliasing-rule.
(I assume your targets byte-order is big-endian for that. Or you will need to byte-swap it first.)
Unless prefix_A and/or prefix_B should ever be dynamically changed, mark them as const so you don't change them accidentally, and the compiler knows they cannot change so it will optimize accordingly.


So it becomes:

// constants
const short prefix_A = 3 &lt;&lt; (4+8);
const short prefix_B = 11 &lt;&lt; (4+8);

void send_cmd(bool A, short cmd){
    assert( cmd &lt; 4096);
    cmd |= A ? prefix_A : prefix_B;
    cmd = htons(cmd); // byte-swap if little-endian
    wiringPiSPIDataRW(0, (unsigned char*)&amp;cmd, 2);
}