My theories:
1. The assassins were mercenaries hired by Mycroft to protect Sherlock from Moriarty. Mycroft clearly leaves it ambiguous as to how and why they're there. "If not Moriarty, then who?" Along with Mycroft's guilt, and his resources, I think he's trying to protect Sherlock.
2. Moriarty knows of the assassins (but not of their purpose), he believes that they're there to attack/kill Sherlock for the "code" that Sherlock "believes" exists, even though Moriarty knows there's no code, and Sherlock knows there's no code (but pretends that he thinks there's one, anyway, to Moriarty).
3. Moriarty's snipers have been instructed to kill the assassins if they make contact with Sherlock. Moriarty is ensuring that Sherlock is stayin' alive, otherwise he can't perform his own fall. If the assassins really wanted to kill each other, they could have already done it. My guess is that Moriarty instructed his snipers to kill any suspicious person who tries to make contact with Sherlock, as it jeopardizes Sherlock's life.
______________________________________________________________________________________________________________________________
Which one of the following statements does not belong with the rest? Deduce away!
Luke, I am your father. - Do you feel lucky, punk? - Elementary, my dear Watson. - I don't think we're in Kansas anymore, Toto. - Frankly, my dear, I don't give a damn.