MOVSB
Usage: MOVSB Modifies flags: None
Copies byte of data from location addressed by ESI (even if operands are given) to the location EDI destination and updates ESI and EDI based on the size of the operand or instruction used. Use with REP prefixes.
Move String
MOVSB ; A4 [8086]
MOVSW ; o16 A5 [8086]
MOVSD ; o32 A5 [386]
MOVSB copies the byte at ESI to EDI. It then increments or decrements (depending on the direction flag: increments if the flag is clear, decrements if it is set) ESI and EDI.
MOVSW and MOVSD work in the same way, but they copy a word or a doubleword instead of a byte, and increment or decrement the addressing registers by 2 or 4 instead of 1.
The REP prefix may be used to repeat the instruction ECX times.
Example:
While B$esi <> 0 | movsb | End_While