	.file	"libg.s"
/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 *
 */

/*	Copyright (c) 1984 AT&T	*/
/*	All Rights Reserved	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any	*/
/*	actual or intended publication of such source code.	*/

	.ident	"$Header: libg.s 1.4 89/10/10 $"

/*	for SDB on i386
 *	warning--functions returning structures are not treated.
 *	To implement calling a USER subroutine from sdb
 *	This becomes libg.a, which gets loaded when cc is given -g flag
 */

/*
 * NOTE:
 *
 * This supports debuggers other than SDB.  Specifically, DBX and PDBX
 * will use the same areas to allow calling user procedures.
 */

	.globl	__dbsubc
	.globl	__dbsubn
	.globl	__dbargs

	.data
	.align	4
__dbargs:
	.=.+512

	.text
	.align	4
__dbsubc:
	movl	$__dbargs,%eax
	movl	4(%eax),%ecx		/* number of argument words */
	movl	%ecx,%edx		/* convert to byte offset in array */
	shll	$2,%edx
	addl	$8,%edx			/* skip the address and the size */
					/* eax+edx points after last arg in list */
	jcxz	.callb			/* in case there are zero args to call */
.looplb:
	subl	$4,%edx			/* push args on the stack */
	pushl	(%edx,%eax)
	loop	.looplb
.callb:
	call	*(%eax)			/* call user function */
__dbsubn:
	int	$3			/* breakpoint */
