
Instruction Set
4-141
LODS
Load String Component
LODS
LODSB Load String Byte
LODSW Load String Word
What It Does
LODS copies a component from a string to a register.
Syntax
Description
LODS loads the memory byte or word at the location pointed to by the source-index register into
the AL or AX register. After the transfer, the instruction automatically advances the source-index
register. If DF=0 (the CLD instruction was executed), the source index increments; if DF=1 (the
STD instruction was executed), it decrements. The increment/decrement rate is 1 for a byte or
2 for a word. The source data address is determined solely by the contents of the source-index
register; load the correct index value into the register before executing LODS. DS is the default
source segment.
LODSB and LODSW are synonyms for the byte and word LODS instructions, respectively.
Form
Opcode
Description
Clocks
Am186 Am188
LODS
m8
AC
Load byte segment:[SI] in AL
12
12
LODS
m16
AD
Load word segment:[SI] in AX
12
16
LODSB
AC
Load byte DS:[SI] in AL
12
12
LODSW
AD
Load word DS:[SI] in AX
12
16
LODS
source
LODSB
LODSW
Before using any form of LODS,
make sure that SI contains the offset
of the string.
To copy a byte within a string located
in the segment specified in DS to AL,
use this form.
To copy a word within a string located
in the segment specified in DS to AX,
use this form.
To override the default source segment
(DS), and to have the assembler type-
check your operand, use this form. In
this form, source is segment:[SI]. The
assembler uses the segment in DS un-
less you specify a different segment
register as part of the string compo-
nent. The assembler uses the definition
of the string component to determine
which destination register to use.
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...