Command |
Full name |
Command mnemonic |
Meaning |
Rep |
Repeat |
Repeated |
It allows repeated execution of string commands (ECx is executed when it is not equal to 0). Each execution time, the content of ECx is reduced by 1. |
Repe |
Repeat equal |
Equal and repeated |
When the two strings are equal, that is, ZF = 1, it can execute the string commands repeatedly (if ECx is not equal to 0). Each execution time, the content of ECx is reduced by 1. (Exactly the same as repz) |
Repne |
Repeat not equal |
Not repeated |
When the two strings are not equal, that is, ZF = 0, it can execute the string commands repeatedly (if ECx is not equal to 0). Each execution time, the content of ECx is reduced by 1. (Exactly the same as repnz) |
Movs |
Move string |
String Transmission |
Similar to movsb and movsw, but the data string type (word or byte) must be specified ). |
Movsb |
Move string by byte |
Transmit strings by byte |
Transmit one byte of data in the data segment directed by ESI to a byte storage unit in the additional segment directed by EDI, and modify the addresses in ESI and EDI according to the direction signs. When df = 0, the address is added with 1; When df = 1, the address is reduced by 1. |
Movsw |
Move string by word |
Send string by word |
Transmit a word term in the data segment directed by Si to a word storage unit in the additional segment directed by DI, and modify the address in Si and di according to the direction indicator. When df = 0, the address is added with 2; When df = 1, the address is reduced by 2. |
CMPS |
Compare string |
String comparison |
Cmpsb or cmpsw is usually used. |
Cmpsb |
Compare string by byte |
Byte comparison string |
Subtract the byte data specified by the DS segment Si from the byte data specified by the es segment di (the result is not saved), and then set the flag Based on the subtraction result (if the two data are equal, ZF = 1 ). And the direction signs DF to modify the address in Si and Di, that is, when df = 0, the address is added with 1; When df = 1, the address is reduced by 1. |
Cmpsw |
Compare string by word |
Comparing strings by words |
Subtract the word data specified by Si in the DS segment from the word data specified by DI in the es segment (the result is not saved), and then set the flag Based on the subtraction result (if the two data are equal, ZF = 1 ). And the direction signs DF to modify the address in Si and Di, that is, when df = 0, the address is added with 2; When df = 1, the address is reduced by 2. |
STOs |
Store Accumulator |
Storage Accumulators |
This command transfers the value in the accumulators to the memory specified by DS: Di. After the storage ends, the CPU either increases or reduces EDI, depending on the DF flag. |
Lods |
Load Accumulator |
Load Accumulators |
The lods command is unique in string commands. You never need to use a duplicate prefix to modify the command. The lods Command copies the byte or word directed by DS: Si to Al, ax, or eax. After the copy is completed, the SI value is increased or decreased Based on the DF flag. Repeat this command does not make any sense. The value in eax will be continuously washed away, leaving only the last loaded value. |
SCAs |
Scan string |
Scan string |
This command can be used to find a specific element in a string. The SCAs command only needs the address es: Di of the target string, instead of the Source and Destination strings. The value of the source string is in Al, ax, or eax. This command compares the value pointed to by ES: di with the value (Al, ax, eax) in the accumulators, and then increases or decreases di 1, 2, or 4 According to DF. |