xref: /netbsd-src/lib/libc/arch/vax/string/bzero.S (revision 787e823fd1325737172861d30c613c7e6e7d2f3d)
1*787e823fSmatt/*	$NetBSD: bzero.S,v 1.4 2011/01/25 02:38:15 matt Exp $	*/
292a955a8Sragge/*
392a955a8Sragge * Copyright (c) 1983, 1993
492a955a8Sragge *	The Regents of the University of California.  All rights reserved.
592a955a8Sragge *
692a955a8Sragge * Redistribution and use in source and binary forms, with or without
792a955a8Sragge * modification, are permitted provided that the following conditions
892a955a8Sragge * are met:
992a955a8Sragge * 1. Redistributions of source code must retain the above copyright
1092a955a8Sragge *    notice, this list of conditions and the following disclaimer.
1192a955a8Sragge * 2. Redistributions in binary form must reproduce the above copyright
1292a955a8Sragge *    notice, this list of conditions and the following disclaimer in the
1392a955a8Sragge *    documentation and/or other materials provided with the distribution.
14eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors
1592a955a8Sragge *    may be used to endorse or promote products derived from this software
1692a955a8Sragge *    without specific prior written permission.
1792a955a8Sragge *
1892a955a8Sragge * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1992a955a8Sragge * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2092a955a8Sragge * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2192a955a8Sragge * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2292a955a8Sragge * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2392a955a8Sragge * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2492a955a8Sragge * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2592a955a8Sragge * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2692a955a8Sragge * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2792a955a8Sragge * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2892a955a8Sragge * SUCH DAMAGE.
2992a955a8Sragge */
3092a955a8Sragge
31*787e823fSmatt#include "DEFS.h"
32*787e823fSmatt
33*787e823fSmatt#if defined(LIBC_SCCS)
34*787e823fSmatt	/* .asciz "@(#)bzero.s	8.1 (Berkeley) 6/4/93" */
35*787e823fSmattRCSID("$NetBSD: bzero.S,v 1.4 2011/01/25 02:38:15 matt Exp $")
36*787e823fSmatt#endif
3792a955a8Sragge
3892a955a8Sragge/* bzero(base, length) */
3992a955a8Sragge
4092a955a8SraggeENTRY(bzero, 0)
410ce5ca14Smatt	movl	4(%ap),%r3
4292a955a8Sragge	jbr	2f
4392a955a8Sragge1:
440ce5ca14Smatt	subl2	%r0,8(%ap)
450ce5ca14Smatt	movc5	$0,(%r3),$0,%r0,(%r3)
4692a955a8Sragge2:
470ce5ca14Smatt	movzwl	$65535,%r0
480ce5ca14Smatt	cmpl	8(%ap),%r0
4992a955a8Sragge	jgtr	1b
500ce5ca14Smatt	movc5	$0,(%r3),$0,8(%ap),(%r3)
5192a955a8Sragge	ret
52*787e823fSmattEND(bzero)
53