LODS
LOAD STRING
(BYTE
OR
WORD)
LODS
Operation:
(DEST)
+-
(SRC)
if(DF)
=:=
0 then
(SI)
+-
(SI)
+ DELTA
else
(SI)
+-
(SI) - DELTA
Description:
LODS
source-string
LODS
(Load
String) transfers the byte
or
word
string element addressed by SI to register
AL
or
AX,
and
updates SI
to
point
to the next ele-
ment in the string. This instruction
is
not
ordi-
narily repeated since the
accumulator
would be
Encoding:
11010110wl
Flags Affected:
None
overwritten by each repetition,
and·
only the
last element would be retained. However,
LODS
is
very useful in
software
loops as
part
of
a more complex string function built up
from string primitives
and
other
instructions.
if
w = 0
then
SRC = (SI), DEST = AL, DEL
TA=
1
else
SRC = (SI) + 1 :(SI), DEST = AX, DELTA = 2
LODS Operands Clocks*
Transfers Bytes
LODS Coding Example
source-string
12(16)
1
1
LODS
CUSTOMER_NAME
(repeat) source-string
9+13(17)/rep
11
rep 1
REP
LODS
NAME
*b(w):
where
b
denotes
the
number
of
clock
cycles
for
byte
operands
and
w
denotes
the
number
of
clock
cycles
for
word
operands.
2-112