Chapter 7 - Integer Arithmetic

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

Logical Shift

fills the newly created bit position with zero

2
New cards

Arithmetic Shift

fills newly created bit position with a copy of the number’s sign bit

3
New cards

SHL Instruction

shift left instruction that performs a logical left shift on the destination operand, filling the lowest bit with 0

4
New cards

Fast multiplication

shift left 1 bit (multiplies number by 2)

thus, shifting left n bits multiplies operand by 2^n

5
New cards

SHR Instruction

(shift right) instruction performs a logical right shift on destination operand. Highest bit position filled with a zero

Shifting right n bits divides the operand by 2^n

6
New cards

SAL

Shift arithmetic left (identical to SHL)

7
New cards

SAR

Shift arithmetic right (performs right arithmetic shift on the destination operand)

8
New cards

sign

Arithmetic shift preserves the number’s ____

9
New cards

ROL Instruction

Rotate shifts each bit to the left
Highest bit copied into both Carry flag and lowest bit

No bits are lost

10
New cards

ROR

Rotate right (shifts each bit right)

Lowest bit copied into both carry flag and highest bit

No bits are lost

11
New cards

RCL

Rotate carry left: shifts each bit left

Copies carry flag to least significant bit

Copies most significant bit to the carry flag

12
New cards

RCR

Rotate carry right: shifts each bit to the right

Copies the carry flag to the most significant bit

Copies the least significant bit to the carry flag

13
New cards

MUL Instruction

Unsigned multiply instruction that multiples 8-, 16-, or 32-bit operands by either AL, AX, or EAX

14
New cards

IMUL

Signed integer multiplies an 8-, 16-, 32-bit signed operand by either AL, AX, EAX

Preserves the sign of the product by sign extending it into the upper half of the destination register

15
New cards

DIV

Unsigned instruction that performs 8-, 16-, and 32-bit division on unsigned integers (A single operand is supplied and assumed to be the divisor)

16
New cards

IDIV

Signed integers must be sign-extended before division takes place

17
New cards

CBW, CWD, CDQ Instructions

Provide important sign extension operations

18
New cards

CBW

Convert byte to word (extends AL into AH)

19
New cards

CWD

Convert word to doubleword (extended AX into DX)

20
New cards

CDQ

convert doubleword to quadword (extends EAX into EDX)

21
New cards

IDIV instruction

Signed div performs signed integer divison

22
New cards

ADC Instruction

Add with carry: adds both a source operand and contents of the Carry flag to a destination operand

23
New cards

SBB Instruction

Subtract with borrow: Subtracts both a source operand and the value of the carry flag from a destination operand

24
New cards

BCD

Binary coded decimal integers use 4 binary bits to represent each decimal digit

25
New cards

AAA

ASCII adjust after addition: adjusts binary result of ADD or ADC. Makes result in AL consistent with ASCII decimal representation

26
New cards

AAS Instruction

ASCII adjust after subtraction. Adjusts binary result of SUB or SBB instruction. Makes result in AL consistent with ASCII decimal representation

27
New cards

AAM Instruction

ASCII adjust after multiplication. Adjusts the binary result of a MUL instruction. The multiplication must have been performed on unpacked BCD numbers

28
New cards

AAD Instruction

ACII adjust before division; instruction adjusts the unpacked BCD dvidend in AZ before a division operation

29
New cards

Packed Decimal Integers

store two decimal digit per byte

30
New cards

packed BCD

packed decimal is also known as…

31
New cards

DAA Instruction

Decimal adjust after addition: converts binary result of ADD or ADC operation to packed decimal format

32
New cards

DAS Instruction

Decimal adjust after subtraction: converts binary result of a SUB or SBB operation to packed decimal format (value must be in AL)