source: trunk/minix/lib/i86/em/em_dvu4.s@ 20

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

Minix 3.1.2a

File size: 682 bytes
Line 
1.define .dvu4
2
3yl=6
4yh=8
5xl=10
6xh=12
7
8.text
9.dvu4:
10 push si
11 push di
12 mov si,sp ! copy of sp
13 mov bx,yl(si)
14 mov ax,yh(si)
15 or ax,ax
16 jne 7f
17 xor dx,dx
18 mov cx,xl(si)
19 mov ax,xh(si)
20 div bx
21 xchg ax,cx
22 div bx
239:
24 ! cx is high order result
25 ! ax is low order result
26 mov dx,cx
27 pop di
28 pop si
29 ret 8 ! result in ax/dx
30
317:
32 mov di,ax
33 xor bx,bx
34 mov ax,xl(si)
35 mov dx,xh(si)
36 mov cx,#16
371:
38 shl ax,#1
39 rcl dx,#1
40 rcl bx,#1
41 cmp di,bx
42 ja 3f
43 jb 2f
44 cmp yl(si),dx
45 jbe 2f
463:
47 loop 1b
48 jmp 9b
492:
50 sub dx,yl(si)
51 sbb bx,di
52 inc ax
53 loop 1b
54 jmp 9b
Note: See TracBrowser for help on using the repository browser.