Changes
Jump to navigation
Jump to search
→Example
; the end of the string, so go back and copy some more.
end: ; If we didn't loop then we must have finished,
; so carry on with something else.</source>
There is an immediate speed benefit simply because the processor doesn't have to load so many instructions to do the same task, but also because the movs instruction is likely to be optimized by the processor designer to be more efficient than the sequence used in the first example. (For example, it may make better use of parallel execution in the processor to increment A and B while it is still copying bytes).