File:  [CSRG BSD Unix] / 43BSDTahoe / usr.lib / libF77 / CCI / h_indx_s.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:58 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43tahoe
BSD 4.3tahoe

#	"@(#)h_indx_s.s	5.1 (Berkeley) 11/3/86"

.data
.text
LL0:.align	1
.globl	_h_indx
.set MASK__, 0x1c0c
.data
.text
_h_indx:	.word	MASK__

	movl	4(fp), r3		/* s = a */
	movl	8(fp), r10		/* b */
	movl	16(fp), r12		/* lb */
	addl3	r3, 12(fp), r11		/* end = a + la */
	subl2  	r12, r11		/* end -= lb */
loop:
	cmpl	r3, r11			/* while (s <= end) */
	jgtr	out0			/* not found - return(0) */
	movl	r3, r0			/* current s in string */
	movl	r10, r1			/* b */
	movl	r12, r2			/* lb */
	cmps3				/* if strings equal */
	jeql	out			/* return index */

	incl	r3			/* s++ */	
	jbr	loop

out:
	incl	r3			/* index = ++s - a */
	subl3	4(fp), r3, r0
	ret

out0:
	clrl	r0
	ret

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.