BZHI AX, DX             ; Copy bits from source and clear higher bits 
                        ; in destination according to the index value

BLSMSK AX, DX           ; Set all lower bits in destination to 1 starting 
                        ; from bit 0 to lowest set bit in source
