PIC getting each bit value of an integer value
You can build up the byte from arbitrary bits like this:

uint8_t temp; 

temp = 0; 
if (bit_1) temp |= (1 &lt;&lt; NUMBER_OF_BIT_1) ;
if (bit_2) temp |= (1 &lt;&lt; NUMBER_OF_BIT_2) ;
...
if (bit_7) temp |= (1 &lt;&lt; NUMBER_OF_BIT_7) ;
LAT_X = temp; 


You could also set/clear the latch bits directly if you don't care about glitches during the calculation. 

The numbers (1 &lt;&lt; NUMBER_OF_BIT_x) are converted into constants during compilation/pre-processing so there is no wasted time in specifying them in a readable manner.