xref: /original-bsd/usr.bin/f77/libF77/CCI/l_gt_s.s (revision a5a45b47)
1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Computer Consoles Inc.
7 *
8 * %sccs.include.proprietary.c%
9 */
10
11#ifndef lint
12	.asciz "@(#)l_gt_s.s	5.2 (Berkeley) 04/12/91"
13#endif /* not lint */
14
15.data
16.text
17LL0:.align	1
18.globl	_l_gt
19.set	MASK__,0x4
20.data
21.text
22_l_gt:.word	MASK__
23	movl	4(fp),r0		/* a */
24	movl	8(fp),r1		/* b */
25	cmpl	12(fp),16(fp)		/* if (la <= lb) */
26	jgtr	LB
27	movl	12(fp), r2		/* compare according to la */
28	cmps3
29	jleq	out0			/* if less or equal return(0) */
30	jbr	out1			/* else greater: return(1) */
31
32LB:					/* else */
33	movl	16(fp), r2		/* compare according to lb */
34	cmps3
35	jlss	out0			/* if less return(0) */
36	jgtr	out1			/* if greater return(1) */
37
38	addl3	4(fp), 12(fp), r2	/* aend */
39LOOP2:
40	cmpb	(r0), $32		/* if *a != space */
41	jneq	out1			/* then astring > bstring */
42	incl	r0			/* else continue */
43	cmpl	r0, r2			/* till aend */
44	jlssu	LOOP2
45out0:
46	clrl	r0
47	ret
48out1:
49	movl	$1, r0			/* else return(1) */
50	ret
51