Strings Flashcards
Strings may have an actual value _______ than the total numbers of cells declared.
less
Strings operands use ___ and ___ registers.
RSI and RDI
As part of execution, string instructions automatically __________________________ the index registers used by them.
update (increment or decrement)
The direction of string processing (forward or backward) is controlled by the ____________.
Direction flag
If the direction flag is clear (DF = 0). string operations proceed in ________ direction.
forward (from head to tail)
Two instructions to explicitly manipulate the direction flag:
std: set direction flag (DF = 1)
cld: clear direction flag (DF = 0)
String instructions can accept a ________ ________ to repeatedly execute the operation.
repetition prefix
Unconditional repeat prefix which causes the instruction to repeat according to the value in the RCX register.
rep
Operations similar to that of rep except that repetition is also conditional on the zero flag. Stops the repetition when ZF is 0.
repe / repz
Operations similar to that of rep except that repetition is also conditional on the zero flag. Stops the repetition when ZF is 1.
repne / repnz
Copies the value from the source string to the A register
Load a String (LODS)
Copies the value from the A register to the destination string (RDI)
Store a string (STOS)
Compares the two bytes, words, doublewords, or quadwords at RSI and RDI and sets the flags.
Compare strings (CMPS)
CMPS performs: ___ - ___ and sets the flags according to the result.
RSI - RDI
Useful in searching for a particular value or character in a string.
Scanning a String (SCAS)