xref: /csrg-svn/lib/libc/vax/string/strcpy.s (revision 61222)
121434Sdist/*
2*61222Sbostic * Copyright (c) 1983, 1993
3*61222Sbostic *	The Regents of the University of California.  All rights reserved.
434481Sbostic *
542639Sbostic * %sccs.include.redist.c%
621434Sdist */
717321Ssam
834819Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*61222Sbostic	.asciz "@(#)strcpy.s	8.1 (Berkeley) 06/04/93"
1034819Sbostic#endif /* LIBC_SCCS and not lint */
1121434Sdist
1217321Ssam/*
1317321Ssam * Copy string s2 over top of s1.
1417340Smckusick * Return base of s1.
1517321Ssam *
1617321Ssam * char *
1717321Ssam * strcpy(s1, s2)
1817321Ssam *	char *s1, *s2;
1917321Ssam */
2017329Ssam#include "DEFS.h"
2117321Ssam
2217329SsamENTRY(strcpy, R6)
2317321Ssam	movl	4(ap), r3	# r3 = s1
2417321Ssam	movl	8(ap), r6	# r6 = s2
2517321Ssam1:
2617321Ssam	locc	$0,$65535,(r6)	# find length of s2
2717321Ssam	bneq	2f
2817321Ssam	movc3	$65535,(r6),(r3)# copy full block
2917340Smckusick	movl	r1,r6
3017321Ssam	jbr	1b
3117321Ssam2:
3217321Ssam	subl2	r6,r1		# calculate length
3317321Ssam	incl	r1
3417321Ssam	movc3	r1,(r6),(r3)	# copy remainder
3517340Smckusick	movl	4(ap),r0	# return base of s1
3617321Ssam	ret
37