source: trunk/minix/lib/i86/int64/div64u.s@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 553 bytes
Line 
1! div64u() - 64 bit divided by unsigned giving unsigned long
2! Author: Kees J. Bot
3! 24 Dec 1995
4.sect .text
5.define _div64u, _rem64u
6
7_div64u: ! unsigned long div64u(u64_t i, unsigned j);
8 mov bx, sp
9div64u: xor dx, dx
10 mov ax, 8(bx)
11 div 10(bx)
12 mov ax, 6(bx)
13 div 10(bx)
14 mov ax, 4(bx)
15 div 10(bx) ! division bits 16-31
16 mov cx, ax
17 mov ax, 2(bx)
18 div 10(bx) ! division bits 0-15
19 xchg dx, cx ! division in dx:ax, remainder in cx
20 ret
21
22_rem64u: ! unsigned rem64u(u64_t i, unsigned j);
23 mov bx, sp
24 call div64u
25 mov ax, cx
26 ret
Note: See TracBrowser for help on using the repository browser.