Subversion Repositories Kolibri OS

Rev

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

  1. # memcpy() Author: Kees J. Bot 2 Jan 1994
  2.  
  3. # void *memcpy(void *s1, const void *s2, size_t n)
  4. #       Copy a chunk of memory.
  5. #       This routine need not handle overlap, so it does not handle overlap.
  6. #       One could simply call __memmove, the cost of the overlap check is
  7. #       negligible, but you are dealing with a programmer who believes that
  8. #       if anything can go wrong, it should go wrong.
  9.  
  10. .intel_syntax
  11.  
  12. .globl _memcpy
  13.  
  14. .text
  15.  
  16.            .align  16
  17. _memcpy:
  18.            push    ebp
  19.            mov     ebp, esp
  20.            push    esi
  21.            push    edi
  22.            mov     edi, [ebp+8]    # String s1
  23.            mov     esi, [ebp+12]   # String s2
  24.            mov     ecx, [ebp+16]   # Length
  25. # No overlap check here
  26.            jmp     __memcpy        # Call the part of __memmove that copies up
  27.