summaryrefslogtreecommitdiff
path: root/lib/libc/arch/i386/stdlib/div.S
blob: f6225c34b97a2d5fc64c7632a2e1ec599941d2f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Written by J.T. Conklin <jtc@netbsd.org>.
 * Public domain.
 */

#include <machine/asm.h>

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