SUMMARY 1. Data movement instructions transfer data between registers, a register and memory, a register and the stack, memory and the stack, the accumulator and I/O, and the flags and the stack. Memory-to-memory transfers are allowed only with the MOVS instruction. 2. Data movement instructions include MOV, PUSH, POP, XCHG, XLAT, IN, OUT, LEA, LOS, […]
Continue reading…
Uncategorized
DATA MOVEMENT INSTRUCTIONS:ASSEMBLER DETAIL.
ASSEMBLER DETAIL The assembler (MASM)1 for the microprocessor can be used in two ways: (1) with models that are unique to a particular assembler, and (2) with full-segment definitions that allow complete control over the assembly process and are universal to all assemblers. This section of the text presents both methods and explains how to […]
Continue reading…
DATA MOVEMENT INSTRUCTIONS:SEGMENT OVERRIDE PREFIX.
SEGMENT OVERRIDE PREFIX The segment override prefix, which may be added to almost any instruction in any memory- addressing mode, allows the programmer to deviate from the default segment. The segment over- ride prefix is an additional byte that appends the front of an instruction to select an alternate segment register. About the only instructions […]
Continue reading…
DATA MOVEMENT INSTRUCTIONS:MISCELLANEOUS DATA TRANSFER INSTRUCTIONS.
MISCELLANEOUS DATA TRANSFER INSTRUCTIONS Don’t be fooled by the term miscellaneous; these instructions are used in programs. The data transfer instructions detailed in this section are XCHG, LAHF, SAHF, XLAT, IN, OUT, BSWAP, MOVSX, MOVZX, and CMOV. Because the miscellaneous instructions are not used as often as a MOV instruction, they have been grouped together […]
Continue reading…
DATA MOVEMENT INSTRUCTIONS:STRING DATA TRANSFERS
STRING DATA TRANSFERS There are five string data transfer instructions: LODS, STOS, MOVS, INS, and OUTS. Each string instruction allows data transfers that are either a single byte, word, or doubleword (or if repeated, a block of bytes, words, or doublewords). Before the string instructions are presented, the operation of the D flag-bit (direction), DI, […]
Continue reading…
DATA MOVEMENT INSTRUCTIONS:LOAD-EFFECTIVE ADDRESS.
LOAD-EFFECTIVE ADDRESS There are several load-effective address instructions in the microprocessor instruction set. The LEA instruction loads any 16-bit register with the offset address, as determined by the addressing mode selected for the instruction. The LDS and LES variations load any 16-bit register with the offset address retrieved from a memory location, and then load […]
Continue reading…
DATA MOVEMENT INSTRUCTIONS:MOV REVISITED
Data Movement Instructions INTRODUCTION This chapter concentrates on the data movement instructions. The data movement instructions include MOV, MOVSX, MOVZX, PUSH, POP, BSWAP, XCHG, XLAT, IN, OUT, LEA, LDS,LES, LFS, LGS, LSS, LAHF, SAHF, and the string instructions MOVS, LODS, STOS, INS, and OUTS. The latest data transfer instruction implemented on the Pentium Pro and […]
Continue reading…
DATA MOVEMENT INSTRUCTIONS:PUSH/POP
PUSH/POP The PUSH and POP instructions are important instructions that store and retrieve data from the LIFO (last-in, first-out) stack memory. The microprocessor has six forms of the PUSH and POP instructions: register, memory, immediate, segment register, flags, and all registers. The PUSH and POP immediate and the PUSHA and POPA (all registers) forms are […]
Continue reading…
QUESTIONS AND PROBLEMS ON ADDRESSING MODES.
QUESTIONS AND PROBLEMS 1. What do the following MOV instructions accomplish? (a) MOV AX,BX (b) MOV BX,AX (c) MOV BL,CH (d) MOV ESP,EBP (e) MOV RAX,RCX 2. List the 8-bit registers that are used for register addressing. 3. List the 16-bit registers that are used for register addressing. 4. List the 32-bit registers that are […]
Continue reading…
SUMMARY OF ADDRESSING MODES.
SUMMARY 1. The data-addressing modes include register, immediate, direct, register indirect, base- p1us-index, register relative, and base relative-plus-index addressing. The 80386 through the Pentium 4 microprocessors have an additional addressing mode called scaled-index addressing. 2. The program memory-addressing modes include direct, relative, and indirect addressing. 3. Table 3–12 lists all real mode data-addressing modes available […]
Continue reading…