xref: /original-bsd/usr.bin/f77/libF77/CCI/s_cat_s.s (revision 963f8367)
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 "@(#)s_cat_s.s	5.2 (Berkeley) 04/12/91"
13#endif /* not lint */
14
15.data
16.text
17LL0:.align	1
18.globl	_s_cat
19.set	MASK__,0x1F04
20.data
21.text
22_s_cat:.word	MASK__
23movl	8(fp),r12		/* rpp */
24movl	20(fp),r10		/* ll */
25movl	12(fp),r9		/* pi = &rnp */
26shll	$2,*16(fp),r1		/* *np * 4 */
27addl3	r1,r9,r8		/* pn = &rnp + *np */
28movl	4(fp),r1		/* lp */
29jbr	L18			/* for */
30
31L20:
32movs3				/* copy nc chars from rp to lp */
33addl2	$4,r12			/* rpp++ */
34addl2	$4,r9			/* pi++ */
35
36L18:
37cmpl	r9,r8			/* pi < pn */
38jgequ	L22			/* pn reached - out of loop */
39movl	r10,r2			/* nc = ll */
40cmpl	(r9),r2			/* if (*pi < nc) */
41jgeq	L19
42movl	(r9),r2			/* nc = *pi */
43
44L19:
45subl2	r2,r10			/* ll -= nc */
46movl	(r12),r0		/* rp = *rpp */
47jbr	L20
48
49L2000005:			/* pad with spaces */
50movb	$32,(r1)
51incl	r1
52
53L22:				/* while (--ll >= 0) */
54decl	r10
55jgeq	L2000005
56ret#2
57
58