xref: /original-bsd/lib/libc/vax/string/strcpy.s (revision 4092c5cc)
1/*
2 * Copyright (c) 1983, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 */
7
8#if defined(LIBC_SCCS) && !defined(lint)
9	.asciz "@(#)strcpy.s	8.1 (Berkeley) 06/04/93"
10#endif /* LIBC_SCCS and not lint */
11
12/*
13 * Copy string s2 over top of s1.
14 * Return base of s1.
15 *
16 * char *
17 * strcpy(s1, s2)
18 *	char *s1, *s2;
19 */
20#include "DEFS.h"
21
22ENTRY(strcpy, R6)
23	movl	4(ap), r3	# r3 = s1
24	movl	8(ap), r6	# r6 = s2
251:
26	locc	$0,$65535,(r6)	# find length of s2
27	bneq	2f
28	movc3	$65535,(r6),(r3)# copy full block
29	movl	r1,r6
30	jbr	1b
312:
32	subl2	r6,r1		# calculate length
33	incl	r1
34	movc3	r1,(r6),(r3)	# copy remainder
35	movl	4(ap),r0	# return base of s1
36	ret
37