Variable bit shift
I'm looking to shift a register bits n times to the left specified with another register. For example, something like this shl eax, ebx The only problem being is that the 2nd operand cannot be a register, it has to be an immediate value. How would I be able to shift a register by a value not known at assemble-time? George Gaál In x86 you can specify a shift count in register cl . So shl eax, cl is valid. mov ecx, ebx shl eax, cl Note that you can only use the cl register, not eax or any other register. Also, shift counts greater than 31 are performed modulo 32. (Not modulo the operand-size, so