Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. format ELF
  2.  
  3. section '.text' executable
  4. include '../../../../../proc32.inc'
  5.  
  6. public memmove
  7.  
  8. proc memmove c, to:dword,from:dword,count:dword
  9.  
  10.     push esi
  11.     push edi
  12.         mov ecx,[count]
  13.         test ecx,ecx
  14.         jz no_copy_block_
  15.                 mov esi,[from]
  16.                 mov edi,[to]
  17.                 cmp esi, edi
  18.                 je no_copy_block_
  19.                 jg copy_
  20.             add esi, ecx
  21.             add edi, ecx
  22.             dec esi
  23.             dec edi
  24.             std
  25. copy_:
  26.                 rep movsb
  27.         cld
  28. no_copy_block_:
  29.  
  30.     pop edi
  31.     pop esi
  32.     mov eax,[to]
  33.         ret
  34. endp
  35.