skpc.S revision 1.4
11.4Sagc/*	$NetBSD: skpc.S,v 1.4 2003/08/07 16:32:17 agc Exp $	*/
21.2Scgd
31.1Scgd/*
41.1Scgd * Copyright (c) 1980, 1990 The Regents of the University of California.
51.1Scgd * All rights reserved.
61.4Sagc *
71.4Sagc * This code is derived from software contributed to Berkeley by
81.4Sagc * the Systems Programming Group of the University of Utah Computer
91.4Sagc * Science Department.
101.4Sagc *
111.4Sagc * Redistribution and use in source and binary forms, with or without
121.4Sagc * modification, are permitted provided that the following conditions
131.4Sagc * are met:
141.4Sagc * 1. Redistributions of source code must retain the above copyright
151.4Sagc *    notice, this list of conditions and the following disclaimer.
161.4Sagc * 2. Redistributions in binary form must reproduce the above copyright
171.4Sagc *    notice, this list of conditions and the following disclaimer in the
181.4Sagc *    documentation and/or other materials provided with the distribution.
191.4Sagc * 3. Neither the name of the University nor the names of its contributors
201.4Sagc *    may be used to endorse or promote products derived from this software
211.4Sagc *    without specific prior written permission.
221.4Sagc *
231.4Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
241.4Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
251.4Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
261.4Sagc * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
271.4Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
281.4Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
291.4Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
301.4Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
311.4Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
321.4Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
331.4Sagc * SUCH DAMAGE.
341.4Sagc *
351.4Sagc *	from: Utah Hdr: locore.s 1.58 91/04/22
361.4Sagc *	@(#)locore.s	7.11 (Berkeley) 5/9/91
371.4Sagc */
381.4Sagc
391.4Sagc/*
401.4Sagc * Copyright (c) 1988 University of Utah.
411.1Scgd *
421.1Scgd * This code is derived from software contributed to Berkeley by
431.1Scgd * the Systems Programming Group of the University of Utah Computer
441.1Scgd * Science Department.
451.1Scgd *
461.1Scgd * Redistribution and use in source and binary forms, with or without
471.1Scgd * modification, are permitted provided that the following conditions
481.1Scgd * are met:
491.1Scgd * 1. Redistributions of source code must retain the above copyright
501.1Scgd *    notice, this list of conditions and the following disclaimer.
511.1Scgd * 2. Redistributions in binary form must reproduce the above copyright
521.1Scgd *    notice, this list of conditions and the following disclaimer in the
531.1Scgd *    documentation and/or other materials provided with the distribution.
541.1Scgd * 3. All advertising materials mentioning features or use of this software
551.1Scgd *    must display the following acknowledgement:
561.1Scgd *	This product includes software developed by the University of
571.1Scgd *	California, Berkeley and its contributors.
581.1Scgd * 4. Neither the name of the University nor the names of its contributors
591.1Scgd *    may be used to endorse or promote products derived from this software
601.1Scgd *    without specific prior written permission.
611.1Scgd *
621.1Scgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
631.1Scgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
641.1Scgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
651.1Scgd * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
661.1Scgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
671.1Scgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
681.1Scgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
691.1Scgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
701.1Scgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
711.1Scgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
721.1Scgd * SUCH DAMAGE.
731.1Scgd *
741.1Scgd *	from: Utah Hdr: locore.s 1.58 91/04/22
751.2Scgd *	@(#)locore.s	7.11 (Berkeley) 5/9/91
761.1Scgd */
771.1Scgd
781.1Scgd#include "DEFS.h"
791.1Scgd
801.1Scgd/*
811.1Scgd * Emulate fancy VAX string operations:
821.1Scgd *	skpc(mask, count, startc)
831.1Scgd */
841.1ScgdENTRY(skpc)
851.3Sthorpej	movl	%sp@(8),%d0	| get length
861.1Scgd	jeq	Lskdone		| nothing to do, return
871.3Sthorpej	movb	%sp@(7),%d1	| mask to use
881.3Sthorpej	movl	%sp@(12),%a0	| where to start
891.3Sthorpej	subqw	#1,%d0		| adjust for dbcc
901.1ScgdLskloop:
911.3Sthorpej	cmpb	%a0@+,%d1	| compate with mask
921.3Sthorpej	dbne	%d0,Lskloop	| keep going til no more or zero
931.3Sthorpej	addqw	#1,%d0		| overshot by one
941.1ScgdLskdone:
951.1Scgd	rts
96