Chapter 7 & 8 Flashcards
(38 cards)
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
IDIV Instruction
Signed Integer Division
CBD, CWD, CDQ
Convert BYTE to WORD
Convert WORD to DWORD
Convert DWORD to QWORD
ADC Instruction
Add with carry
- adds source and the contents of the CF to destination operand
SBB Instruction
Subtract with borrow
- subtracts both a source operand and the value of the CF from a destination operand
BCD
Binary Coded Decimal
- integers which use 4 binary bits to represent each decimal digit
Unpacked BCD
Stores a decimal digit in the lower 4 bits of each byte
Hex ex: 5678 is stored as 05 06 07 08
AAA Instruction
ASCII adjust after addition
AAS Instruction
ASCII adjust after subtraction
AAM Instruction
ASCII adjust after multiplication