1 ! memcpy
() Author
: Kees J. Bot
3 .sect .text; .sect .rom; .sect .data; .sect .bss
5 ! void
*memcpy
(void
*s1
, const void
*s2
, size_t n
)
6 ! Copy
a chunk of memory.
7 ! This routine need
not handle overlap
, so it does
not handle overlap.
8 ! One could simply call __memmove
, the cost of the overlap check is
9 ! negligible
, but you are dealing with
a programmer who believes that
10 ! if anything can go wrong
, it should go wrong.
19 mov di
, 4(bp
) ! String s1
20 mov si
, 6(bp
) ! String s2
21 mov cx
, 8(bp
) ! Length
22 ! No overlap check here
23 jmp __memcpy
! Call the part of __memmove that copies up