home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / CLIBS / STRING / 386 / MEMMOVE.ASM < prev    next >
Encoding:
Assembly Source File  |  1996-06-29  |  368 b   |  31 lines

  1.     .386
  2.     .model small
  3.     public _memmove
  4.     .code
  5. _memmove:
  6.     push    ebp
  7.     mov    ebp,esp
  8.     push    esi
  9.     push    edi
  10.     mov    ecx,[ebp+16]
  11.     mov    esi,[ebp+12]
  12.     mov    edi,[ebp+8]
  13.     mov    eax,edi
  14.     cmp    edi,esi    
  15.     ja    short negmove
  16.     cld
  17.     rep movsb
  18. exit:
  19.     pop    edi
  20.     pop    esi
  21.     pop    ebp
  22.     ret
  23. negmove:
  24.     add    esi,ecx
  25.     add    edi,ecx
  26.     dec    esi
  27.     dec    edi
  28.     std
  29.     rep    movsb
  30.     jmp    short exit
  31.     end