A string instruction performs a loop up to 64K times. Because the loop happens inside the processor, it's faster than writing the loop in assembly. The SI register points to the source, the DI register points to the dest, and the CX register counts. The details are complicated.
Here's what the microcode looks like for the string move instruction: the main code, a micro-subroutine to check the CX register, and a micro-subroutine to handle interrupts. Each micro-instruction has a move on the left and an action on the right.