Subversion Repositories Kolibri OS

Rev

Rev 1408 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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