Back to Browse

Strcpy (String copy) using rep movsb

810 views
Mar 30, 2020
7:20

Learn the movsb (mov string) instruction to do a memory-to-memory copy and implement the strcpy function. source code: https://github.com/vishmohan/inline_assembly_examples/blob/master/strcpy/strcpy.cpp Here is the pseudo code snippet from the Intel manual - When DF = 0 the operation moves forward (so the program uses CLD instruction to clear DF before executing movsb). IF (Byte move) THEN IF DF = 0 THEN (E)SI ← (E)SI + 1; (E)DI ← (E)DI + 1; ELSE (E)SI ← (E)SI – 1; (E)DI ← (E)DI – 1; FI

Download

0 formats

No download links available.

Strcpy (String copy) using rep movsb | NatokHD