Composing CPU instructions by merging four short hex strings
Assembly opcodes are not constructed with string manipulations. They are very carefully designed with bit positioning, so a simple add operation between two integers might not be the best way to describe it. 

So your mergeHex method that god-knows-what does with strings should become a method that might do some bit shifting, masks, ...

I sampled the behavior of your mergeHex with two calls (which is not enough to know what it does for all your possible scenarios), but anyway I reached the following conclusion:


The output is a 16bits (word) hex string.
The first 8 bits are given by hexShared[0] | ((hexshared[1] &amp; 0xF0) &gt;&gt; 4)
The last 8 bits are given by  ((hexshared[1] &amp; 0x0F) &lt;&lt; 4) | values[2]


Turning this into an algorithm becomes now trivial, let me suggest an implementation with some simplifications:

private static string ToWord(string[] hexTokens){
    var values = hexTokens
        .Select(t =&gt; HexToInt(t))
        .ToArray();

    var result = values[0] &lt;&lt; 8 | values[1] &lt;&lt; 4 | values[2];
    return result.ToString("X1");
}