Intel 253666-024US Computer Hardware User Manual


 
Vol. 2A 3-551
INSTRUCTION SET REFERENCE, A-M
LODS/LODSB/LODSW/LODSD/LODSQ—Load String
LODS/LODSB/LODSW/LODSD/LODSQ—Load String
Description
Loads a byte, word, or doubleword from the source operand into the AL, AX, or EAX
register, respectively. The source operand is a memory location, the address of which
is read from the DS:EDI or the DS:SI registers (depending on the address-size
attribute of the instruction, 32 or 16, respectively). The DS segment may be over-
ridden with a segment override prefix.
At the assembly-code level, two forms of this instruction are allowed: the “explicit-
operands” form and the “no-operands” form. The explicit-operands form (specified
with the LODS mnemonic) allows the source operand to be specified explicitly. Here,
the source operand should be a symbol that indicates the size and location of the
source value. The destination operand is then automatically selected to match the
size of the source operand (the AL register for byte operands, AX for word operands,
and EAX for doubleword operands). This explicit-operands form is provided to allow
documentation; however, note that the documentation provided by this form can be
misleading. That is, the source operand symbol must specify the correct type (size)
of the operand (byte, word, or doubleword), but it does not have to specify the
Opcode Instruction 64-Bit
Mode
Compat/
Leg Mode
Description
AC LODS m8 Valid Valid For legacy mode, Load byte at address
DS:(E)SI into AL. For 64-bit mode load byte
at address (R)SI into AL.
AD LODS m16 Valid Valid For legacy mode, Load word at address
DS:(E)SI into AX. For 64-bit mode load
word at address (R)SI into AX.
AD LODS m32 Valid Valid For legacy mode, Load dword at address
DS:(E)SI into EAX. For 64-bit mode load
dword at address (R)SI into EAX.
REX.W + AD LODS m64 Valid N.E. Load qword at address (R)SI into RAX.
AC LODSB Valid Valid For legacy mode, Load byte at address
DS:(E)SI into AL. For 64-bit mode load byte
at address (R)SI into AL.
AD LODSW Valid Valid For legacy mode, Load word at address
DS:(E)SI into AX. For 64-bit mode load
word at address (R)SI into AX.
AD LODSD Valid Valid For legacy mode, Load dword at address
DS:(E)SI into EAX. For 64-bit mode load
dword at address (R)SI into EAX.
REX.W + AD LODSQ Valid N.E. Load qword at address (R)SI into RAX.