source: trunk/minix/lib/i86/string/memcpy.s@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 679 bytes
RevLine 
[9]1! memcpy() Author: Kees J. Bot
2! 27 Jan 1994
3.sect .text; .sect .rom; .sect .data; .sect .bss
4
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.
11!
12.sect .text
13.define _memcpy
14_memcpy:
15 push bp
16 mov bp, sp
17 push si
18 push di
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
Note: See TracBrowser for help on using the repository browser.