xref: /minix/lib/libc/arch/i386/stdlib/ldiv.S (revision 00b67f09)
1/*	$NetBSD: ldiv.S,v 1.10 2014/05/23 02:34:19 uebayasi Exp $	*/
2/*
3 * Written by J.T. Conklin <jtc@NetBSD.org>.
4 * Public domain.
5 */
6
7#include <machine/asm.h>
8
9#if defined(LIBC_SCCS)
10RCSID("$NetBSD: ldiv.S,v 1.10 2014/05/23 02:34:19 uebayasi Exp $")
11#endif
12
13ENTRY(ldiv)
14	pushl	%ebx
15	movl	8(%esp),%ebx
16	movl	12(%esp),%eax
17	movl	16(%esp),%ecx
18	cdq
19	idiv	%ecx
20	movl	%eax,(%ebx)
21	movl	%edx,4(%ebx)
22	movl	%ebx,%eax
23	popl	%ebx
24	ret	$4
25END(ldiv)
26