SHL (shift left)

Left shifts the bits of a value.

Syntax

SHL1 value [in,1], n [in,1u], result [out,1] ;code:113
SHL2 value [in,2], n [in,1u], result [out,2] ;code:114
SHL4 value [in,4], n [in,1u], result [out,4] ;code:115
SHL8 value [in,8], n [in,1u], result [out,8] ;code:116

Description

This instruction performs bitwise left shift operation by n bits: result = value << n.

This instruction shifts the bits of input value left by the number of bits specified in n. Digits shifted off the left are discarded. New bits on the right are 0.

If n is greater than number of bits in the value (correspondingly 8, 16, 32 or 64) the result is undefined.

NoASM

There are several kinds of these instructions defined in NoASM Compiler:

SHL1,  SHL2,  SHL4,  SHL8,
SHL1u, SHL2u, SHL4u, SHL8u