16 bit Assembly
Home Site Map Instruction Index
The SHL instruction is used to perform a logical shift left, resulting in a multiplication.
This command has 3 part the Instruction, A Register or memory address, and the number of bits to shift left.
As each bit is shift it passes in to the Carry flag, where it can be assessed using a conditional jump JC or JNC.
As each bit moves left the lowest bit becomes zero.
Assembly Sample | Description | 16 bit Machine Code |
---|---|---|
SHL AL, 1 | ; Shift AL left by 1 bit | D0 E0 |
SHL AL, CL | ; Shift AL left by value of CL | D2 E0 |
SHL AL, 0x03 | ; Shift AL left by 8 bit immediate | C0 E0 03 |
SHL AX, 1 | ; Shift AL left by 1 bit | D1 E0 |
SHL AX, CL | ; Shift AL left by value of CL | D3 E0 |
SHL AX, 0x03 | ; Shift AL left by 8 bit immediate | C1 E0 03 |
SHL [BX], 1 | ; Shift memory address left by 1 bit | D1 27 |
SHL [BX], CL | ; Shift memory address left by value of CL | D3 27 |
SHL [BX], 0x03 | ; Shift memory address left by 8 bit immediate | C1 27 03 |
SHL [BX+2], 1 | ; Shift memory address left by 1 bit | D1 67 02 |
SHL [BX+2], CL | ; Shift memory address left by value of CL | D3 67 02 |
SHL [BX+2], 0x03 | ; Shift memory address left by 8 bit immediate | C1 67 02 03 |