source: trunk/minix/lib/i86/em/em_rmu4.s@ 10

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

Minix 3.1.2a

File size: 789 bytes
Line 
1.define .rmu4
2.text
3
4yl=6
5yh=8
6xl=10
7xh=12
8
9.rmu4:
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
171:
18 xor dx,dx
19 mov cx,xl(si)
20 mov ax,xh(si)
212:
22 div bx
23 xchg ax,cx
24 div bx
25 xor bx,bx
269:
27 ! bx is high order result
28 ! dx is low order result
29 mov ax,dx
30 mov dx,bx
31 pop di
32 pop si
33 ret 8 ! result in ax/dx
34
357:
36 mov di,ax
37 xor bx,bx
38 mov ax,xl(si)
39 mov dx,xh(si)
40 mov cx,#16
411:
42 shl ax,#1
43 rcl dx,#1
44 rcl bx,#1
45 cmp di,bx
46 ja 3f
47 jb 2f
48 cmp yl(si),dx
49 jbe 2f
503:
51 loop 1b
52 ! dx=result(low), bx=result(high)
53 jmp 9b
542:
55 sub dx,yl(si)
56 sbb bx,di
57 inc ax
58 loop 1b
591:
60 ! dx=result(low), bx=result(high)
61 jmp 9b
Note: See TracBrowser for help on using the repository browser.