
LODS LOAD STRING LODS
(BYTE OR WORD)
Operation: | Flags Affected: |
(DEST) +- (SRC) | None |
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
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.
Encoding:
11010110wl
if w = 0 then SRC = (SI), DEST = AL, DELTA= 1 else SRC = (SI) +1:(SI), DEST = AX, DELTA = 2
LODS Operands | Clocks* | Transfers | Bytes | LODS Coding Example |
12(16) | 1 | 1 | LODS CUSTOMER_NAME | |
(repeat) | 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.