
Instruction Set Listing
3-9
3.1.11
Proc essor Control
Proc essor Control Instruc tions
Coproc essor Interfac e Instruc tions
3.1.12
String
A string is a contiguous sequence of components stored in memory. For example, a string
might be composed of a list of ASCII characters or a table of numbers.
A string instruction operates on a single component in a string. To manipulate more than
one component in a string, the string instruction prefixes(REP/REPE/REPNE/REPNZ/
REPZ) can be used to repeatedly execute the same string instruction.
A string instruction uses an index register as the offset of a component in a string. Most
string instructions operate on only one string, in which case they use either the Source
Index (SI) register or the Destination Index (DI) register. String instructions that operate on
two strings use SI as the offset of a component in one string and DI as the offset of the
corresponding component in the other string.
After executing a string instruction, the microcontroller automatically increments or
decrements SI and DI so that they contain the offsets of the next components in their strings.
The microcontroller determines the amount by which the index registers must be
incremented or decremented based on the size of the components.
The microcontroller can process the components of a string in a forward direction (from
lower addresses to higher addresses), or in a backward direction (from higher addresses
to lower ones). The microcontroller uses the value of the Direction Flag (DF) to determine
whether to increment or decrement SI and DI. If DF is cleared to 0, the microcontroller
increments the index registers; otherwise, it decrements them.
String-Instruc tion Prefixes
Mnemonic
Name
See Page
HLT
LOCK
NOP
Halt
Lock the Bus
No Operation
4-57
4-140
4-165
Mnemonic
Name
See Page
ESC
WAIT
Escape
Wait for Coprocessor 4-245
4-56
Mnemonic
Name
See Page
REP
REPE
REPNE
REPNZ
REPZ
Repeat
Repeat While Equal
Repeat While Not Equal
Repeat While Not Zero (Synonym forREPNE)
Repeat While Zero (Synonym forREPE)
4-191
4-193
4-197
4-197
4-193