PROGRAM CONTROL INSTRUCTIONS INTRODUCTION The program control instructions direct the flow of a program and allow the flow to change. A change in flow often occurs after a decision made with the CMP or TEST instruction is followed by a conditional jump instruction. This chapter explains the program control instructions, including the jumps, calls, returns, […]
Continue reading…
Uncategorized
ARITHMETIC AND LOGIC INSTRUCTIONS:QUESTIONS AND PROBLEMS.
QUESTIONS AND PROBLEMS 1. Select an ADD instruction that will: (a) add BX to AX (b) add 12H to AL (c) add EDI and EBP (d) add 22H to CX (e) add the data addressed by SI to AL (f) add CX to the data stored at memory location FROG (g) add 234H to RCX […]
Continue reading…
ARITHMETIC AND LOGIC INSTRUCTIONS:STRING COMPARISONS.
STRING COMPARISONS As illustrated in Chapter 4, the string instructions are very powerful because they allow the programmer to manipulate large blocks of data with relative ease. Block data manipulation occurs with the string instructions MOVS, LODS, STOS, INS, and OUTS. In this section, additional string instructions that allow a section of memory to be […]
Continue reading…
SUMMARY OF ARITHMETIC AND LOGIC INSTRUCTIONS.
SUMMARY 1. Addition (ADD) can be 8, 16, 32, or 64 bits. The ADD instruction allows any address- ing mode except segment register addressing. Most flags (C, A, S, Z, P, and O) change when the ADD instruction executes. A different type of addition, add-with-carry (ADC), adds two operands and the contents of the carry […]
Continue reading…
ARITHMETIC AND LOGIC INSTRUCTIONS:SHIFT AND ROTATE.
SHIFT AND ROTATE Shift and rotate instructions manipulate binary numbers at the binary bit level, as did the AND, OR, Exclusive-OR, and NOT instructions. Shifts and rotates find their most common applications in low-level software used to control I/O devices. The microprocessor contains a complete complement of shift and rotate instructions that are used to […]
Continue reading…
ARITHMETIC AND LOGIC INSTRUCTIONS:BASIC LOGIC INSTRUCTIONS.
BASIC LOGIC INSTRUCTIONS The basic logic instructions include AND, OR, Exclusive-OR, and NOT. Another logic instruction is TEST, which is explained in this section of the text because the operation of the TEST instruction is a special form of the AND instruction. Also explained is the NEG instruction, which is similar to the NOT instruction. […]
Continue reading…
ARITHMETIC AND LOGIC INSTRUCTIONS:BCD AND ASCII ARITHMETIC.
BCD AND ASCII ARITHMETIC The microprocessor allows arithmetic manipulation of both BCD (binary-coded decimal) and ASCII (American Standard Code for Information Interchange) data. This is accomplished by instructions that adjust the numbers for BCD and ASCII arithmetic. The BCD operations occur in systems such as point-of-sales terminals (e.g., cash registers) and others that seldom require […]
Continue reading…
ARITHMETIC AND LOGIC INSTRUCTIONS:MULTIPLICATION AND DIVISION.
MULTIPLICATION AND DIVISION Only modern microprocessors contain multiplication and division instructions. Earlier 8-bit microprocessors could not multiply or divide without the use of a program that multiplied or divided by using a series of shifts and additions or subtractions. Because microprocessor manufacturers were aware of this inadequacy, they incorporated multiplication and division instructions into the […]
Continue reading…
ARITHMETIC AND LOGIC INSTRUCTIONS:ADDITION, SUBTRACTION, AND COMPARISON
Arithmetic and Logic Instructions INTRODUCTION In this chapter, we examine the arithmetic and logic instructions. The arithmetic instructions include addition, subtraction, multiplication, division, comparison, negation, increment, and decrement. The logic instructions include AND, OR, Exclusive-OR, NOT, shifts, rotates, and the logical compare (TEST). This chapter also presents the 80386 through the Core2 instructions XADD, SHRD, […]
Continue reading…
QUESTIONS AND PROBLEMS ON DATA MOVEMENT INSTRUCTIONS.
QUESTIONS AND PROBLEMS 1. The first byte of an instruction is the , unless it contains one of the override prefixes. 2. Describe the purpose of the D- and W-bits found in some machine language instructions. 3. In a machine language instruction, what information is specified by the MOD field? 4. If the register field […]
Continue reading…