xref: /csrg-svn/usr.bin/f77/libF77/CCI/l_le_s.s (revision 47942)
1*47942Sbostic/*-
2*47942Sbostic * Copyright (c) 1991 The Regents of the University of California.
3*47942Sbostic * All rights reserved.
4*47942Sbostic *
5*47942Sbostic * This code is derived from software contributed to Berkeley by
6*47942Sbostic * Computer Consoles Inc.
7*47942Sbostic *
8*47942Sbostic * %sccs.include.proprietary.c%
9*47942Sbostic */
1029958Smckusick
11*47942Sbostic#ifndef lint
12*47942Sbostic	.asciz "@(#)l_le_s.s	5.2 (Berkeley) 04/12/91"
13*47942Sbostic#endif /* not lint */
14*47942Sbostic
1529958Smckusick.data
1629958Smckusick.text
1729958SmckusickLL0:.align	1
1829958Smckusick.globl	_l_le
1929958Smckusick.set	MASK__,0x4
2029958Smckusick.data
2129958Smckusick.text
2229958Smckusick_l_le:.word	MASK__
2329958Smckusick	movl	4(fp),r0		/* a */
2429958Smckusick	movl	8(fp),r1		/* b */
2529958Smckusick	cmpl	12(fp),16(fp)		/* if (la <= lb) */
2629958Smckusick	jgtr	LB
2729958Smckusick	movl	12(fp), r2		/* compare according to la */
2829958Smckusick	cmps3
2929958Smckusick	jleq	out1			/* if less or equal return(1) */
3029958Smckusick	jbr	out0			/* else greater: return(0) */
3129958Smckusick
3229958SmckusickLB:					/* else */
3329958Smckusick	movl	16(fp), r2		/* compare according to lb */
3429958Smckusick	cmps3
3529958Smckusick	jlss	out1			/* if less return(1) */
3629958Smckusick	jgtr	out0			/* if greater return(0) */
3729958Smckusick
3829958Smckusick	addl3	4(fp), 12(fp), r2	/* aend */
3929958SmckusickLOOP2:
4029958Smckusick	cmpb	(r0), $32		/* if *a != space */
4129958Smckusick	jneq	out0			/* then astring > bstring */
4229958Smckusick	incl	r0			/* else continue */
4329958Smckusick	cmpl	r0, r2			/* till aend */
4429958Smckusick	jlssu	LOOP2
4529958Smckusickout1:
4629958Smckusick	movl	$1, r0			/* else return(1) */
4729958Smckusick	ret
4829958Smckusickout0:
4929958Smckusick	clrl	r0
5029958Smckusick	ret
51