Systemnahe Programmierung in C: Typlose Zeiger |
1#include <stddef.h>
2
3void *
4memcpy1 (void *d, void *s, size_t n)
5{
6 register char *d1 = d;
7 register char *s1 = s;
8
9 while (n--)
10 *d1++ = *s1++;
11
12 return d;
13}
|
1 memcpy1:
2 movq %rdi, %rax
3 testq %rdx, %rdx
4 je .L2
5 movl $0, %ecx
6 .L3:
7 movzbl (%rsi,%rcx), %r8d
8 movb %r8b, (%rax,%rcx)
9 addq $1, %rcx
10 cmpq %rdx, %rcx
11 jne .L3
12 .L2:
13 rep ret
|
Letzte Änderung: 22.11.2012 | © Prof. Dr. Uwe Schmidt |