In this, the 16th, tutorial we'll look at two more interesting if slightly less useful instructions, SHLD and SHRD. They were added by Intel to help data packing and unpacking. Like many of the more obscure Assembly instructions it's best to keep in mind exactly what they do not what they were invented for.
They squash the bits in the first operand to the left or right and make room for bits from another register.
They may not be the quickest way to achieve the desired result but it's still good to know them since when you're planning an algorithm it might help to think of SHLD or SHRD instead of the couple of instruction that you will replace them with when optimizing.