1 /* memcpy - copy a block from source to destination. 64 bit S/390 version.
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
21 %r2 = address of destination memory area
22 %r3 = address of source memory area
23 %r4 = number of bytes to copy. */
26 #include "asm-syntax.h"
32 aghi %r4,-1 # length - 1
33 lgr %r1,%r2 # copy destination address
36 .L0: mvc 0(256,%r1),0(%r3) # move in 256 byte chunks
40 .L1: bras %r5,.L2 # setup base pointer for execute
41 mvc 0(1,%r1),0(%r3) # instruction for execute
42 .L2: ex %r4,0(%r5) # execute mvc with length ((%r4)&255)+1