sal

8086 and later

Arithmetic Shift Left

sal r/m8, 1 | sal r/m16, 1 | sal r/m32, 1 | sal r/m64, 1 | sal r/m8, cl | sal r/m16, cl | sal r/m32, cl | sal r/m64, cl | sal r/m8, imm8 | sal r/m16, imm8 | sal r/m32, imm8 | sal r/m64, imm8 | sal [reg8], r/m8, 1 | sal [reg16], r/m16, 1 | sal [reg32], r/m32, 1 | sal [reg64], r/m64, 1 | sal [reg8], r/m8, cl | sal [reg16], r/m16, cl | sal [reg32], r/m32, cl | sal [reg64], r/m64, cl | sal [reg8], r/m8, imm8 | sal [reg16], r/m16, imm8 | sal [reg32], r/m32, imm8 | sal [reg64], r/m64, imm8 | sal reg32, r/m32, reg32 | sal reg64, r/m64, reg64

SAL and SAR perform an arithmetic shift operation on the given source/destination (first) operand. The vacated bits are filled with zero for SAL, and with copies of the original high bit of the source operand for SAR.

SAL is a synonym for SHL (see SHL). NASM will assemble either one to the same code, but NDISASM will always disassemble that code as SHL.

The number of bits to shift by is given by the second operand. Only the bottom five bits of the shift count are considered by processors above the 8086.

You can force the longer (286 and upwards, beginning with a C1 byte) form of SAL foo,1 by using a BYTE prefix: \c{SAL foo,BYTE 1}. Similarly with SAR.

Loading...

Forms

Every form of sal the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
sal r/m8, 18086
sal r/m16, 18086
sal r/m32, 1386
sal r/m64, 1x86-64long
sal r/m8, cl8086
sal r/m16, cl8086
sal r/m32, cl386
sal r/m64, clx86-64long
sal r/m8, imm8186
sal r/m16, imm8186
sal r/m32, imm8386
sal r/m64, imm8x86-64long
sal [reg8], r/m8, 1x86-64apxlong
sal [reg16], r/m16, 1x86-64apxlong
sal [reg32], r/m32, 1x86-64apxlong
sal [reg64], r/m64, 1x86-64apxlong
sal [reg8], r/m8, clx86-64apxlong
sal [reg16], r/m16, clx86-64apxlong
sal [reg32], r/m32, clx86-64apxlong
sal [reg64], r/m64, clx86-64apxlong
sal [reg8], r/m8, imm8x86-64apxlong
sal [reg16], r/m16, imm8x86-64apxlong
sal [reg32], r/m32, imm8x86-64apxlong
sal [reg64], r/m64, imm8x86-64apxlong
sal reg32, r/m32, reg32recentbmi2
sal reg64, r/m64, reg64x86-64bmi2long