summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/i386/stdlib/div.S
blob: 29fef17d0c8e124a29fbd637271ced4a82ba34c7 (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: div.S,v 1.3 1997/07/23 20:55:20 kstailey Exp $"
#endif

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