Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual page 1576

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

LODS/LODSB/LODSW/LODSD—Load String Operand
Opcode
AC
AD
AD
AC
AD
AD
Description
Load a byte, word, or doubleword from the source operand into the AL, AX, or EAX
register, respectively. The source operand is a memory location at the address DS:ESI.
(When the operand-size attribute is 16, the SI register is used as the source-index
register.) The DS segment may be overridden with a segment override prefix.
The LODSB, LODSW, and LODSD mnemonics are synonyms of the byte, word, and
doubleword versions of the LODS instructions. (For the LODS instruction, "DS:ESI"
must be explicitly specified in the instruction.)
After the byte, word, or doubleword is transfer from the memory location into the AL,
AX, or EAX register, the ESI register is incremented or decremented automatically
according to the setting of the DF flag in the EFLAGS register. (If the DF flag is 0, the
ESI register is incremented; if the DF flag is 1, the ESI register is decremented.) The
ESI register is incremented or decremented by 1 for byte operations, by 2 for word
operations, or by 4 for doubleword operations.
The LODS, LODSB, LODSW, and LODSD instructions can be preceded by the REP prefix
for block loads of ECX bytes, words, or doublewords. More often, however, these
instructions are used within a LOOP construct, because further processing of the data
moved into the register is usually necessary before the next transfer can be made. See
"REP/REPE/REPZ/REPNE /REPNZ—Repeat String Operation Prefix" on page 4:337
description of the REP prefix.
Operation
IF (byte load)
THEN
AL  SRC; (* byte load *)
ELSE IF (word load)
THEN
ELSE (* doubleword transfer *)
4:274
Instruction
LODS DS:(E)SI
LODS DS:SI
LODS DS:ESI
LODSB
LODSW
LODSD
THEN IF DF = 0
THEN (E)SI  1;
ELSE (E)SI  -1;
FI;
AX  SRC; (* word load *)
THEN IF DF = 0
THEN SI  2;
ELSE SI  -2;
FI;
EAX  SRC; (* doubleword load *)
Description
Load byte at address DS:(E)SI into AL
Load word at address DS:SI into AX
Load doubleword at address DS:ESI into EAX
Load byte at address DS:(E)SI into AL
Load word at address DS:SI into AX
Load doubleword at address DS:ESI into EAX
Volume 4: Base IA-32 Instruction Reference
for a

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents