xref: /original-bsd/lib/libc/tahoe/string/ffs.s (revision c3e32dec)
1/*
2 * Copyright (c) 1988, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Computer Consoles Inc.
9 */
10
11#if defined(LIBC_SCCS) && !defined(lint)
12	.asciz "@(#)ffs.s	8.1 (Berkeley) 06/04/93"
13#endif /* LIBC_SCCS and not lint */
14
15/* bit = ffs(value) */
16
17#include "DEFS.h"
18
19ENTRY(ffs, 0)
20	ffs	4(fp),r0
21	bgeq	1f
22	mnegl	$1,r0
231:
24	incl	r0
25	ret
26