summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/i386/stdlib/ldiv.S
blob: 2cedafa783f68fe73917d6450a04db438e5c1292 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Written by J.T. Conklin <jtc@netbsd.org>.
 * Public domain.
 */

#include <machine/asm.h>

#if defined(LIBC_SCCS)
	.text
	.asciz "$OpenBSD: ldiv.S,v 1.3 1997/07/23 20:55:21 kstailey Exp $"
#endif

ENTRY(ldiv)
	movl	4(%esp),%eax
	movl	8(%esp),%ecx
	cdq
	idiv	%ecx
	movl	%eax,4(%esp)
	movl	%edx,8(%esp)
	ret