Chapter 7 & 8 Flashcards
Logical Shift
Fills the newly created bit position with 0
Last bit shifted is moved into CF
Arithmetic Shift
Fills the newly created bit position with a copy of the number’s sign bit
Last bit shifted is moved into CF
SHL Instruction
Shift Left - performs a logical left shift on the destination operand, filling the lowest but with 0
Shifting left n bits multiplies the operand by 2^n
SHR Instruction
Shift Right - performs a logical right shift on the destination operand
The highest bit position is filled with a 0
Shifting right n bits divides the operand by 2^n
SAL Instruction
Identical to SHL
SAR Instruction
Shift Arithmetic Right - performs an arithmetic shift on the destination operand
Preserves sign
ROL Instruction
Rotate/shifts each bit to the left
Highest bit is copied into the CF and into the lowest bit
ROR Instruction
Rotate/shifts each bit to the right
Lowest bit copied into both the CF and into the highest bit
RCL Instruction
Rotate Carry Left
Copies the CF to the LSB
Copies the MSB to the CF
RCR Instruction
Rotate Carry Right
Copies the CF to the MSB
Copies the LSB to the CF
SHLD Instruction
Shifts destination operand a given number of bits to the left
Syntax:
SHLD destination, source, count
SHRD Instruction
Shifts destination operand a given number of bits to the right
Syntax:
SHRD destination, source, count
MUL Instruction
Multiplies an 8,16, or 32-bit operand by AL, AX or EAX
Product - AX, DX:AX, or EDX:EAX
IMUL Instruction
Signed integer multiplication
DIV Instruction
Performs 8,16, or 32-bit division on unsigned integers
Dividend - AX, DX:AX, EDX:EAX
Divisor - operand
Quotient - AL, AX, EAX
Remainder - AH, DX, EDX