Hi,
You need to put the SHIFTOUT statement inside the FOR-NEXT loop. Also, I'm not sure about adding temp_data_out, is that something specific to your needs? Finally there's something weird going on with the chip select line, you pull CSN low but set CS high. I'd try something like:
Code:
SPI_write: 
   CS = 0                                                       ' Chip enable 
    For x = 0 to Num_byte                                         '   loop for # byte
        temp_data_out = data_out(x)  
      Shiftout SI, SCK, MSBFIRST, [temp_data_out]          ' Send byte
    next x   

  CS = 1               ' Disable to execute command
return