Instruction Set
4-213
SAL
SAL
This example extracts the middle byte of a word so it can be used by another instruction.
Tips
Use SHL to isolate part of a component.
Use SAL to multiply integers by powers of 2. When multiplying an integer by a power of 2,
it is faster to use SAL than IMUL.
Related Instructions
If you want to
See
Multiply two integers
IMUL
Multiply two unsigned numbers
MUL
Rotate the bits of a component and the value of CF to the left
RCL
Rotate the bits of a component and the value of CF to the right
RCR
Rotate the bits of a component to the left
ROL
Rotate the bits of a component to the right
ROR
Divide an integer by a power of 2
SAR
Shift the bits of the operand downward
SHR
SETTINGS
DW
1234h
; extract middle byte of AX and place in AH
MOV
AX,SETTINGS
; AX = 1234h
AND
AX,0FF0h
; mask middle byte: AX = 0230h
SHL
AX,4
; shift middle byte into AH: AX = 2300h
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...